From: <tim...@us...> - 2012-02-15 16:24:52
|
Revision: 4909 http://web-erp.svn.sourceforge.net/web-erp/?rev=4909&view=rev Author: tim_schofield Date: 2012-02-15 16:24:39 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Upload new menuing system moving menu items to an array, only showing items that the user has access to Modified Paths: -------------- trunk/UpgradeDatabase.php trunk/includes/ConnectDB.inc trunk/includes/footer.inc trunk/includes/header.inc trunk/includes/session.inc trunk/index.php Added Paths: ----------- trunk/includes/IndexArray.php trunk/sql/mysql/upgrade4.07-4.08.sql Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2012-02-15 13:32:44 UTC (rev 4908) +++ trunk/UpgradeDatabase.php 2012-02-15 16:24:39 UTC (rev 4909) @@ -133,6 +133,8 @@ $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; case '4.06.6': $SQLScripts[] = './sql/mysql/upgrade4.06-4.07.sql'; + case '4.06.7': + $SQLScripts[] = './sql/mysql/upgrade4.07-4.08.sql'; case '4.07.0': break; } //end switch Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2012-02-15 13:32:44 UTC (rev 4908) +++ trunk/includes/ConnectDB.inc 2012-02-15 16:24:39 UTC (rev 4909) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.06.7'; //must update manually every time there is a DB change +$Version='4.07.1'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Added: trunk/includes/IndexArray.php =================================================================== --- trunk/includes/IndexArray.php (rev 0) +++ trunk/includes/IndexArray.php 2012-02-15 16:24:39 UTC (rev 4909) @@ -0,0 +1,515 @@ +<?php +$ModuleLink = array('orders', 'AR', 'AP', 'PO', 'stock', 'manuf', 'GL', 'FA', 'PC', 'system'); +$ReportList = array('orders'=>'ord', + 'AR'=>'ar', + 'AP'=>'ap', + 'PO'=>'prch', + 'stock'=>'inv', + 'manuf'=>'man', + 'GL'=>'gl', + 'FA'=>'fa', + 'PC'=>'pc', + 'system'=>'sys' + ); + +/*The headings showing on the tabs accross the main index used also in WWW_Users for defining what should be visible to the user */ +$ModuleList = array(_('Sales'), + _('Receivables'), + _('Payables'), + _('Purchases'), + _('Inventory'), + _('Manufacturing'), + _('General Ledger'), + _('Asset Manager'), + _('Petty Cash'), + _('Setup')); + +$MenuItems['orders']['Transactions']['Caption'] = array( _('Enter An Order or Quotation'), + _('Enter Counter Sales'), + _('Print Picking Lists'), + _('Outstanding Sales Orders/Quotations'), + _('Special Order'), + _('Recurring Order Template'), + _('Process Recurring Orders') + ); +$MenuItems['orders']['Transactions']['URL'] = array( '/SelectOrderItems.php?NewOrder=Yes', + '/CounterSales.php', + '/PDFPickingList.php', + '/SelectSalesOrder.php', + '/SpecialOrder.php', + '/SelectRecurringSalesOrder.php', + '/RecurringSalesOrdersProcess.php' + ); + +$MenuItems['orders']['Reports']['Caption'] = array( _('Order Inquiry'), + _('Print Price Lists'), + _('Order Status Report'), + _('Orders Invoiced Reports'), + _('Daily Sales Inquiry'), + _('Sales By Sales Type Inquiry'), + _('Sales By Category Inquiry'), + _('Top Sellers Inquiry'), + _('Order Delivery Differences Report'), + _('Delivery In Full On Time (DIFOT) Report'), + _('Sales Order Detail Or Summary Inquiries'), + _('Top Sales Items Report'), + _('Sales With Low Gross Profit Report') + ); + +$MenuItems['orders']['Reports']['URL'] = array( '/SelectCompletedOrder.php', + '/PDFPriceList.php', + '/PDFOrderStatus.php', + '/PDFOrdersInvoiced.php', + '/DailySalesInquiry.php', + '/SalesByTypePeriodInquiry.php', + '/SalesCategoryPeriodInquiry.php', + '/SalesTopItemsInquiry.php', + '/PDFDeliveryDifferences.php', + '/PDFDIFOT.php', + '/SalesInquiry.php', + '/TopItems.php', + '/PDFLowGP.php' + ); + +$MenuItems['orders']['Maintenance']['Caption'] = array( _('Select Contract'), + _('Create Contract') + ); + +$MenuItems['orders']['Maintenance']['URL'] = array( '/SelectContract.php', + '/Contracts.php' + ); + +$MenuItems['AR']['Transactions']['Caption'] = array (_('Select Order to Invoice'), + _('Create A Credit Note'), + _('Enter Receipts'), + _('Allocate Receipts or Credit Notes') + ); +$MenuItems['AR']['Transactions']['URL'] = array ('/SelectSalesOrder.php', + '/SelectCreditItems.php?NewCredit=Yes', + '/CustomerReceipt.php?NewReceipt=Yes&Type=Customer', + '/CustomerAllocations.php' + ); + +$MenuItems['AR']['Reports']['Caption'] = array (_('Where Allocated Inquiry'), + _('Print Invoices or Credit Notes'), + _('Print Statements'), + _('Sales Analysis Reports'), + _('Aged Customer Balances/Overdues Report'), + _('Re-Print A Deposit Listing'), + _('Debtor Balances At A Prior Month End'), + _('Customer Listing By Area/Salesperson'), + _('Sales Graphs'), + _('List Daily Transactions'), + _('Customer Transaction Inquiries') + ); + +$MenuItems['AR']['Reports']['URL'] = array ('/CustWhereAlloc.php', + '/PrintCustTrans.php', + '/PrintCustStatements.php', + '/SalesAnalRepts.php', + '/AgedDebtors.php', + '/PDFBankingSummary.php', + '/DebtorsAtPeriodEnd.php', + '/PDFCustomerList.php', + '/SalesGraph.php', + '/PDFCustTransListing.php', + '/CustomerTransInquiry.php' + ); + +$MenuItems['AR']['Maintenance']['Caption'] = array (_('Add Customer'), + _('Customers') + ); +$MenuItems['AR']['Maintenance']['URL'] = array ('/Customers.php', + '/SelectCustomer.php' + ); + +$MenuItems['AP']['Transactions']['Caption'] = array (_('Select Supplier'), + _('Supplier Allocations') + ); +$MenuItems['AP']['Transactions']['URL'] = array ('/SelectSupplier.php', + '/SupplierAllocations.php' + ); + +$MenuItems['AP']['Reports']['Caption'] = array (_('Aged Supplier Report'), + _('Payment Run Report'), + _('Remittance Advices'), + _('Outstanding GRNs Report'), + _('Supplier Balances At A Prior Month End'), + _('List Daily Transactions'), + _('Supplier Transaction Inquiries') + ); + +$MenuItems['AP']['Reports']['URL'] = array ('/AgedSuppliers.php', + '/SuppPaymentRun.php', + '/PDFRemittanceAdvice.php', + '/OutstandingGRNs.php', + '/SupplierBalsAtPeriodEnd.php', + '/PDFSuppTransListing.php', + '/SupplierTransInquiry.php' + ); + +$MenuItems['AP']['Maintenance']['Caption'] = array (_('Add Supplier'), + _('Maintain Factor Companies') + ); +$MenuItems['AP']['Maintenance']['URL'] = array ('/Suppliers.php', + '/Factors.php' + ); + +$MenuItems['PO']['Transactions']['Caption'] = array (_('Purchase Orders'), + _('Add Purchase Order'), + _('Create a New Tender'), + _('Edit Existing Tenders'), + _('Process Tenders and Offers'), + _('Orders to Authorise'), + _('Shipment Entry'), + _('Select A Shipment') + ); +$MenuItems['PO']['Transactions']['URL'] = array ('/PO_SelectOSPurchOrder.php', + '/PO_Header.php?NewOrder=Yes', + '/SupplierTenderCreate.php?New=Yes', + '/SupplierTenderCreate.php?Edit=Yes', + '/OffersReceived.php', + '/PO_AuthoriseMyOrders.php', + '/SelectSupplier.php', + '/Shipt_Select.php' + ); + +$MenuItems['PO']['Reports']['Caption'] = array (_('Purchase Order Inquiry'), + _('Purchase Order Detail Or Summary Inquiries'), + _('Supplier Price List') + ); + +$MenuItems['PO']['Reports']['URL'] = array ('/PO_SelectPurchOrder.php', + '/POReport.php', + '/SuppPriceList.php' + ); + +$MenuItems['PO']['Maintenance']['Caption'] = array ( + ); +$MenuItems['PO']['Maintenance']['URL'] = array ( + ); +$MenuItems['stock']['Transactions']['Caption'] = array (_('Receive Purchase Orders'), + _('Bulk Inventory Transfer') . ' - ' . _('Dispatch'), + _('Bulk Inventory Transfer') . ' - ' . _('Receive'), + _('Inventory Location Transfers'), + _('Inventory Adjustments'), + _('Reverse Goods Received'), + _('Enter Stock Counts') + ); +$MenuItems['stock']['Transactions']['URL'] = array ('/PO_SelectOSPurchOrder.php', + '/StockLocTransfer.php', + '/StockLocTransferReceive.php', + '/StockTransfers.php?New=Yes', + '/StockAdjustments.php?NewAdjustment=Yes', + '/ReverseGRN.php', + '/StockCounts.php' + ); + +$MenuItems['stock']['Reports']['Caption'] = array (_('Serial Item Research Tool'), + _('Print Price Labels'), + _('Reprint GRN'), + _('Inventory Item Movements'), + _('Inventory Item Status'), + _('Inventory Item Usage'), + _('Inventory Quantities'), + _('Reorder Level'), + _('Stock Dispatch'), + _('Inventory Valuation Report'), + _('Inventory Planning Report'), + _('Inventory Planning Based On Preferred Supplier Data'), + _('Inventory Stock Check Sheets'), + _('Make Inventory Quantities CSV'), + _('Compare Counts Vs Stock Check Data'), + _('All Inventory Movements By Location/Date'), + _('List Inventory Status By Location/Category'), + _('Historical Stock Quantity By Location/Category'), + _('List Negative Stocks'), + _('Period Stock Transaction Listing'), + _('Stock Transfer Note') + ); + +$MenuItems['stock']['Reports']['URL'] = array ('/StockSerialItemResearch.php', + '/PDFPrintLabel.php', + '/ReprintGRN.php', + '/StockMovements.php', + '/StockStatus.php', + '/StockUsage.php', + '/InventoryQuantities.php', + '/ReorderLevel.php', + '/StockDispatch.php', + '/InventoryValuation.php', + '/InventoryPlanning.php', + '/InventoryPlanningPrefSupplier.php', + '/StockCheck.php', + '/StockQties_csv.php', + '/PDFStockCheckComparison.php', + '/StockLocMovements.php', + '/StockLocStatus.php', + '/StockQuantityByDate.php', + '/PDFStockNegatives.php', + '/PDFPeriodStockTransListing.php', + '/PDFStockTransfer.php' + ); + +$MenuItems['stock']['Maintenance']['Caption'] = array (_('Add A New Item'), + _('Select An Item'), + _('Sales Category Maintenance'), + _('Add or Update Prices Based On Costs'), + _('View or Update Prices Based On Costs'), + _('Reorder Level By Category/Location') + ); +$MenuItems['stock']['Maintenance']['URL'] = array ('/Stocks.php', + '/SelectProduct.php', + '/SalesCategories.php', + '/PricesBasedOnMarkUp.php', + '/PricesByCost.php', + '/ReorderLevelLocation.php' + ); + +$MenuItems['manuf']['Transactions']['Caption'] = array (_('Work Order Entry'), + _('Select A Work Order') + ); +$MenuItems['manuf']['Transactions']['URL'] = array ('/WorkOrderEntry.php', + '/SelectWorkOrder.php' + ); + +$MenuItems['manuf']['Reports']['Caption'] = array (_('Select A Work Order'), + _('Costed Bill Of Material Inquiry'), + _('Where Used Inquiry'), + _('Bill Of Material Listing'), + _('Indented Bill Of Material Listing'), + _('List Components Required'), + _('Indented Where Used Listing'), + _('MRP'), + _('MRP Shortages'), + _('MRP Suggested Purchase Orders'), + _('MRP Suggested Work Orders'), + _('MRP Reschedules Required') + ); + +$MenuItems['manuf']['Reports']['URL'] = array ('/WorkOrderEntry.php', + '/BOMInquiry.php', + '/WhereUsedInquiry.php', + '/BOMListing.php', + '/BOMIndented.php', + '/BOMExtendedQty.php', + '/BOMIndentedReverse.php', + '/MRPReport.php', + '/MRPShortages.php', + '/MRPPlannedPurchaseOrders.php', + '/MRPPlannedWorkOrders.php', + '/MRPReschedules.php' + ); + +$MenuItems['manuf']['Maintenance']['Caption'] = array (_('Work Centre'), + _('Bills Of Material'), + _('Master Schedule'), + _('Auto Create Master Schedule'), + _('MRP Calculation') + ); + +$MenuItems['manuf']['Maintenance']['URL'] = array ('/WorkCentres.php', + '/BOMs.php', + '/MRPDemands.php', + '/MRPCreateDemands.php', + '/MRP.php' + ); + +$MenuItems['GL']['Transactions']['Caption'] = array (_('Bank Account Payments Entry'), + _('Bank Account Receipts Entry'), + _('Journal Entry'), + _('Bank Account Payments Matching'), + _('Bank Account Receipts Matching') + ); + +$MenuItems['GL']['Transactions']['URL'] = array ('/Payments.php?NewPayment=Yes', + '/CustomerReceipt.php?NewReceipt=Yes&Type=GL', + '/GLJournal.php?NewJournal=Yes', + '/BankMatching.php?Type=Payments', + '/BankMatching.php?Type=Receipts' + ); + +$MenuItems['GL']['Reports']['Caption'] = array (_('Trial Balance'), + _('Account Inquiry'), + _('Account Listing'), + _('Account Listing to CSV File'), + _('Bank Account Reconciliation Statement'), + _('Cheque Payments Listing'), + _('Daily Bank Transactions'), + _('Profit and Loss Statement'), + _('Balance Sheet'), + _('Tag Reports'), + _('Tax Reports') + ); + +$MenuItems['GL']['Reports']['URL'] = array ('/GLTrialBalance.php', + '/SelectGLAccount.php', + '/GLAccountReport.php', + '/GLAccountCSV.php', + '/BankReconciliation.php', + '/PDFChequeListing.php', + '/DailyBankTransactions.php', + '/GLProfit_Loss.php', + '/GLBalanceSheet.php', + '/GLTagProfit_Loss.php', + '/Tax.php' + ); + +$MenuItems['GL']['Maintenance']['Caption'] = array (_('GL Account'), + _('GL Budgets'), + _('Account Groups'), + _('Account Sections'), + _('GL Tags') + ); + +$MenuItems['GL']['Maintenance']['URL'] = array ('/GLAccounts.php', + '/GLBudgets.php', + '/AccountGroups.php', + '/AccountSections.php', + '/GLTags.php' + ); + +$MenuItems['FA']['Transactions']['Caption'] = array (_('Add a new Asset'), + _('Select an Asset'), + _('Change Asset Location'), + _('Depreciation Journal') + ); + +$MenuItems['FA']['Transactions']['URL'] = array ('/FixedAssetItems.php', + '/SelectAsset.php', + '/FixedAssetTransfer.php', + '/FixedAssetDepreciation.php' + ); + +$MenuItems['FA']['Reports']['Caption'] = array (_('Asset Register'), + ); + +$MenuItems['FA']['Reports']['URL'] = array ('/FixedAssetRegister.php', + ); + +$MenuItems['FA']['Maintenance']['Caption'] = array (_('Asset Categories Maintenance'), + _('Add or Maintain Asset Locations') + ); + +$MenuItems['FA']['Maintenance']['URL'] = array ('/FixedAssetCategories.php', + '/FixedAssetLocations.php' + ); + +$MenuItems['PC']['Transactions']['Caption'] = array (_('Assign Cash to PC Tab'), + _('Claim Expenses From PC Tab'), + _('Expenses Authorisation') + ); + +$MenuItems['PC']['Transactions']['URL'] = array ('/PcAssignCashToTab.php', + '/PcClaimExpensesFromTab.php', + '/PcAuthorizeExpenses.php' + ); + +$MenuItems['PC']['Reports']['Caption'] = array (_('PC Tab General Report'), + ); + +$MenuItems['PC']['Reports']['URL'] = array ('/PcReportTab.php', + ); + +$MenuItems['PC']['Maintenance']['Caption'] = array (_('Types of PC Tabs'), + _('PC Tabs'), + _('PC Expenses'), + _('Expenses for Type of PC Tab') + ); + +$MenuItems['PC']['Maintenance']['URL'] = array ('/PcTypeTabs.php', + '/PcTabs.php', + '/PcExpenses.php', + '/PcExpensesTypeTab.php' + ); + +$MenuItems['system']['Transactions']['Caption'] = array (_('Company Preferences'), + _('Configuration Settings'), + _('User Maintenance'), + _('Maintain Security Tokens'), + _('Role Permissions'), + _('Page Security Settings'), + _('Bank Accounts'), + _('Currency Maintenance'), + _('Tax Authorities and Rates Maintenance'), + _('Tax Group Maintenance'), + _('Dispatch Tax Province Maintenance'), + _('Tax Category Maintenance'), + _('List Periods Defined'), + _('Report Builder Tool'), + _('View Audit Trail'), + _('Geocode Setup'), + _('Form Layout Editor'), + _('Label Templates Maintenance'), + _('SMTP Server Details') + ); + +$MenuItems['system']['Transactions']['URL'] = array ('/CompanyPreferences.php', + '/SystemParameters.php', + '/WWW_Users.php', + '/SecurityTokens.php', + '/WWW_Access.php', + '/PageSecurity.php', + '/BankAccounts.php', + '/Currencies.php', + '/TaxAuthorities.php', + '/TaxGroups.php', + '/TaxProvinces.php', + '/TaxCategories.php', + '/PeriodsInquiry.php', + '/reportwriter/admin/ReportCreator.php', + '/AuditTrail.php', + '/GeocodeSetup.php', + '/FormDesigner.php', + '/Labels.php', + '/SMTPServer.php' + ); + +$MenuItems['system']['Reports']['Caption'] = array (_('Sales Types'), + _('Customer Types'), + _('Supplier Types'), + _('Credit Status'), + _('Payment Terms'), + _('Set Purchase Order Authorisation levels'), + _('Payment Methods'), + _('Sales People'), + _('Sales Areas'), + _('Shippers'), + _('Sales GL Interface Postings'), + _('COGS GL Interface Postings'), + _('Freight Costs Maintenance'), + _('Discount Matrix') + ); + +$MenuItems['system']['Reports']['URL'] = array ('/SalesTypes.php', + '/CustomerTypes.php', + '/SupplierTypes.php', + '/CreditStatus.php', + '/PaymentTerms.php', + '/PO_AuthorisationLevels.php', + '/PaymentMethods.php', + '/SalesPeople.php', + '/Areas.php', + '/Shippers.php', + '/SalesGLPostings.php', + '/COGSGLPostings.php', + '/FreightCosts.php', + '/DiscountMatrix.php' + ); + +$MenuItems['system']['Maintenance']['Caption'] = array (_('Inventory Categories Maintenance'), + _('Inventory Locations Maintenance'), + _('Discount Category Maintenance'), + _('Units of Measure'), + _('MRP Available Production Days'), + _('MRP Demand Types') + ); + +$MenuItems['system']['Maintenance']['URL'] = array ('/StockCategories.php', + '/Locations.php', + '/DiscountCategories.php', + '/UnitsOfMeasure.php', + '/MRPCalendar.php', + '/MRPDemandTypes.php' + ); +?> \ No newline at end of file Modified: trunk/includes/footer.inc =================================================================== --- trunk/includes/footer.inc 2012-02-15 13:32:44 UTC (rev 4908) +++ trunk/includes/footer.inc 2012-02-15 16:24:39 UTC (rev 4909) @@ -2,34 +2,23 @@ /* $Id$*/ - echo '</td>'; - echo '</tr>'; - echo '</table>'; +echo '<table width="100%" id="footer">'; - echo '</td></tr>'; -/*Do the borders */ +echo '<tr>'; +echo '<td style="width:33%"></td><td class="footer">'; +echo '<img src="'. $rootpath . '/' . $_SESSION['LogoFile'] . '" width="120" alt="webERP" title="webERP ' . _('Copyright') . ' © webrp.org - ' . date('Y') . '" /></td>'; +echo '<td class="footer" style="text-align: right;width:33%">'.(strftime('%A')).', '.(date($_SESSION['DefaultDateFormat']).' | '.(strftime(($DefaultClock==12) ? '%I:%M %p' : '%H:%M'))).'</td>'; - echo '</table>'; - - echo '<table width="100%" id="footer">'; - echo '<tr> - <td width="29%"> </td> - <td class="footer"><a href="http://www.weberp.org" rel="external"><img src="'. $rootpath . '/' . $_SESSION['LogoFile'] . '" width="120" alt="webERP" title="webERP ' . _('Copyright') . ' © weberp.org - ' . date('Y') . '" /></a></td> - <td class="footer">'.(strftime('%A')).', '.(date($_SESSION['DefaultDateFormat']).' | '.(strftime(($DefaultClock==12) ? '%I:%M %p' : '%H:%M'))).'</td> - </tr>'; +echo '</tr>'; - echo '<tr> - <td class="footer"> </td> - <td class="footer">webERP v' . $_SESSION['VersionNumber'] . ' ' . _('Copyright') . ' © weberp.org 2002 - '.date('Y').'</td> - </tr>'; +echo '<tr><td colspan="3" class="footer">webERP v' . $_SESSION['VersionNumber'] . '</td></tr>'; - if(http_file_exists('http://sflogo.sourceforge.net/sflogo.php')) { - echo '<tr> - <td class="footer"></td> - <td class="footer"><a href="https://sourceforge.net/projects/web-erp"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=70949&type=12" width="120" height="30" border="0" alt="Get webERP web-based ERP Accounting at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a></td> - </tr>'; - } - echo '</table>'; - echo '</body>'; - echo '</html>'; -?> +// if(http_file_exists('http://sflogo.sourceforge.net/sflogo.php')) { +// echo '<tr><td class="footer"><a href="https://sourceforge.net/projects/weberp"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=391629&type=12" width="120" height="30" border="0" alt="Get webERP web-based ERP Accounting at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a></td></tr>'; +// } + +echo '</table>'; + +echo '</body>'; +echo '</html>'; +?> \ No newline at end of file Modified: trunk/includes/header.inc =================================================================== --- trunk/includes/header.inc 2012-02-15 13:32:44 UTC (rev 4908) +++ trunk/includes/header.inc 2012-02-15 16:24:39 UTC (rev 4909) @@ -3,13 +3,9 @@ // Titles and screen header // Needs the file config.php loaded where the variables are defined for + // $rootpath // $title - should be defined in the page this file is included with - if (!isset($rootpath)){ - $rootpath = dirname(htmlspecialchars($_SERVER['PHP_SELF'])); - if ($rootpath == '/' OR $rootpath == "\\") { - $rootpath = ''; - } - } + $StrictXHTML=False; if (!headers_sent()){ @@ -22,6 +18,7 @@ echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; + echo '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>' . $title . '</title>'; echo '<link rel="shortcut icon" href="'. $rootpath.'/favicon.ico" />'; echo '<link rel="icon" href="' . $rootpath.'/favicon.ico" />'; @@ -39,39 +36,32 @@ echo '<tr>'; echo '<td colspan="2" rowspan="2">'; - echo '<table class="main_page" cellpadding="0" cellspacing="0">'; - echo '<tr>'; - echo '<td>'; - echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" >'; - echo '<tr>'; - echo '<td>'; - if (isset($title)) { echo '<table cellpadding="0" cellspacing="0" border="0" id="quick_menu" class="quick_menu">'; echo '<tr>'; echo '<td align="left" style="width:100%;" class="quick_menu_left">'; -// Use icons for company and user data, saves screen realestate, use ALT tag in case theme icon not avail. - echo '<img src="'.$rootpath.'/css/'.$theme.'/images/company.png" title="' . _('Company') . '" alt="' . _('Company') . '"></img>'; - echo ' ' . stripslashes($_SESSION['CompanyRecord']['coyname']) . ' <a href="' . $rootpath . '/UserSettings.php"><img src="'.$rootpath.'/css/'.$theme.'/images/user.png" title="User" alt="' . _('User') . '"></img>' . stripslashes($_SESSION['UsersRealName']) . '</a>'; +// Use icons for company and user data, saves screen realestate, use alt tag in case theme icon not avail. + echo '<img src="'.$rootpath.'/css/'.$theme.'/images/company.png" title="' . _('Company') . '" alt="' . _('Company') . '" />'; + echo ' ' . stripslashes($_SESSION['CompanyRecord']['coyname']) . ' <a href="' . $rootpath . '/UserSettings.php"><img src="'.$rootpath.'/css/'.$theme.'/images/user.png" title="User" alt="' . _('User') . '" />' . stripslashes($_SESSION['UsersRealName']) . '</a>'; // Make the title text a class, can be set to display:none is some themes - echo '<br /><p class="header_title"> ' . $title . '</p></td>'; + echo '<br />' . $title . '</td>'; echo '<td class="quick_menu_tabs">'; echo '<table cellpadding="0" cellspacing="0" class="quick_menu_tabs"><tr>'; - echo '<td class="quick_menu_tab" align="center"><a accesskey="1" href="' . $rootpath . '/index.php"><span style="text-decoration:underline;">1</span> ' . _('Main Menu') . '</a></td>'; + echo '<td class="quick_menu_tab" align="center"><a href="' . $rootpath . '/index.php"><span style="text-decoration:underline;">1</span> ' . _('Main Menu') . '</a></td>'; if (count($_SESSION['AllowedPageSecurityTokens'])>1){ - echo '<td class="quick_menu_tab" align="center"><a accesskey="2" href="' . $rootpath . '/SelectCustomer.php"><span style="text-decoration:underline;">2</span> ' . _('Customers') . '</a></td>'; + echo '<td class="quick_menu_tab" align="center"><a href="' . $rootpath . '/SelectCustomer.php"><span style="text-decoration:underline;">2</span> ' . _('Customers') . '</a></td>'; - echo '<td class="quick_menu_tab" align="center"><a accesskey="3" href="' . $rootpath . '/SelectProduct.php"><span style="text-decoration:underline;">3</span> ' . _('Items') . '</a></td>'; + echo '<td class="quick_menu_tab" align="center"><a href="' . $rootpath . '/SelectProduct.php"><span style="text-decoration:underline;">3</span> ' . _('Items') . '</a></td>'; - echo '<td class="quick_menu_tab" align="center"><a accesskey="4" href="' . $rootpath . '/SelectSupplier.php"><span style="text-decoration:underline;">4</span> ' . _('Suppliers') . '</a></td>'; + echo '<td class="quick_menu_tab" align="center"><a href="' . $rootpath . '/SelectSupplier.php"><span style="text-decoration:underline;">4</span> ' . _('Suppliers') . '</a></td>'; - $DefaultManualLink = '<td class="quick_menu_tab" align="center"><a rel="external" accesskey="8" href="' . $rootpath . '/doc/Manual/ManualContents.php"><span style="text-decoration:underline;">8</span> ' . _('Manual') . '</a></td>'; + $DefaultManualLink = '<td class="quick_menu_tab" align="center"><a rel="external" href="' . $rootpath . '/doc/Manual/ManualContents.php"><span style="text-decoration:underline;">8</span> ' . _('Manual') . '</a></td>'; if (mb_substr($_SESSION['Language'],0,2) !='en'){ if (file_exists('locale/' . $_SESSION['Language'] . '/Manual/ManualContents.php')){ - echo '<td class="quick_menu_tab" align="center"><a target="_blank" accesskey="8" href="' . $rootpath . '/locale/' . $_SESSION['Language'] . '/Manual/ManualContents.php"><span style="text-decoration:underline;">8</span> ' . _('Manual') . '</a></td>'; + echo '<td class="quick_menu_tab" align="center"><a target="_blank" href="' . $rootpath . '/locale/' . $_SESSION['Language'] . '/Manual/ManualContents.php"><span style="text-decoration:underline;">8</span> ' . _('Manual') . '</a></td>'; } else { echo $DefaultManualLink; } @@ -80,7 +70,7 @@ } } - echo '<td class="quick_menu_tab" align="center"><a accesskey="0" href="' . $rootpath . '/Logout.php" onclick="return confirm(\'' . _('Are you sure you wish to logout?') . '\');"><span style="text-decoration:underline;">0</span> ' . _('Logout') . '</a></td>'; + echo '<td class="quick_menu_tab" align="center"><a href="' . $rootpath . '/Logout.php" onclick="return confirm(\'' . _('Are you sure you wish to logout?') . '\');"><span style="text-decoration:underline;">0</span> ' . _('Logout') . '</a></td>'; echo '</tr></table>'; echo '</td></tr></table>'; Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2012-02-15 13:32:44 UTC (rev 4908) +++ trunk/includes/session.inc 2012-02-15 16:24:39 UTC (rev 4909) @@ -21,10 +21,10 @@ ini_set('session.gc_Maxlifetime',$SessionLifeTime); -if( !ini_get('safe_mode') ){ - set_time_limit($MaximumExecutionTime); +if( !ini_get('safe_mode') ){ + set_time_limit($MaximumExecutionTime); ini_set('max_execution_time',$MaximumExecutionTime); -} +} session_write_close(); //in case a previous session is not closed session_start(); @@ -75,7 +75,7 @@ if (!isset($AllowAnyone)){ /* only do security checks if AllowAnyone is not true */ - + include $PathPrefix . 'includes/UserLogin.php'; /* Login checking and setup */ if (isset($_POST['UserNameEntryField']) and isset($_POST['Password'])) { @@ -125,9 +125,9 @@ include($PathPrefix . 'includes/GetConfig.php'); /*The page security variable is now retrieved from the database in GetConfig.php and stored in the $SESSION['PageSecurityArray'] array - * the key for the array is the script name - the script name is retrieved from the basename ($_SERVER['SCRIPT_NAME']) + * the key for the array is the script name - the script name is retrieved from the basename ($_SERVER['SCRIPT_NAME']) */ -if (!isset($PageSecurity)){ +if (!isset($PageSecurity)){ //only hardcoded in the UpgradeDatabase script - so old versions that don't have the scripts.pagesecurity field do not choke $PageSecurity = $_SESSION['PageSecurityArray'][basename($_SERVER['SCRIPT_NAME'])]; } @@ -273,17 +273,6 @@ exit; } -/* Nasty kludge to allow Supplier only logins as well as Customer logins */ -if (count($_SESSION['AllowedPageSecurityTokens'])==1 AND - $_SESSION['AllowedPageSecurityTokens'][0]==9 AND $PageSecurity==1){ - - $_SESSION['AllowedPageSecurityTokens'][0]=1; - $SupplierLogin=1; -} else { - $SupplierLogin=0; -} - - if (!isset($AllowAnyone)){ if ((!in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PageSecurity))) { $title = _('Security Permissions Problem'); @@ -305,12 +294,12 @@ } } -/* Nasty kludge to allow Supplier only logins as well as Customer logins - .... hmmmmm some work to do here then! */ -if ($SupplierLogin==1) { - $_SESSION['AllowedPageSecurityTokens'][0]=9; +if (in_array(9,$_SESSION['AllowedPageSecurityTokens']) and $PageSecurity==0 and count($_SESSION['AllowedPageSecurityTokens'])==2){ + $SupplierLogin=1; +} else if (in_array(1,$_SESSION['AllowedPageSecurityTokens']) and $PageSecurity==0 and count($_SESSION['AllowedPageSecurityTokens'])==2){ + $SupplierLogin=0; } - if (in_array(15, $_SESSION['AllowedPageSecurityTokens'])) { /*System administrator login */ $debug = 1; //allow debug messages } else { Modified: trunk/index.php =================================================================== --- trunk/index.php 2012-02-15 13:32:44 UTC (rev 4908) +++ trunk/index.php 2012-02-15 16:24:39 UTC (rev 4909) @@ -1,1533 +1,190 @@ <?php +$PageSecurity=0; -/* $Id$*/ - include('includes/session.inc'); $title=_('Main Menu'); +include('includes/header.inc'); /*The module link codes are hard coded in a switch statement below to determine the options to show for each tab */ -$ModuleLink = array('orders', 'AR', 'AP', 'PO', 'stock', 'manuf', 'GL', 'FA', 'PC', 'system'); -/*The headings showing on the tabs accross the main index used also in WWW_Users for defining what should be visible to the user */ -$ModuleList = array(_('Sales'), - _('Receivables'), - _('Payables'), - _('Purchases'), - _('Inventory'), - _('Manufacturing'), - _('General Ledger'), - _('Asset Manager'), - _('Petty Cash'), - _('Setup')); +include('includes/IndexArray.php'); -if (isset($_GET['Application'])){ /*This is sent by this page (to itself) when the user clicks on a tab */ - $_SESSION['Module'] = $_GET['Application']; -} - -include('includes/header.inc'); - -if (count($_SESSION['AllowedPageSecurityTokens'])==1 AND $SupplierLogin==0){ - -/* if there is only one security access and its 1 (it has to be 1 for this page came up at all)- it must be a customer log on - * need to limit the menu to show only the customer accessible stuff this is what the page looks like for customers logging in - */ -?> - - <tr> - <td class="menu_group_items"> <!-- Orders transaction options --> - <table class="table_index"> +if (isset($SupplierLogin) and $SupplierLogin==1){ + echo '<table class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerInquiry.php?CustomerID=' . $_SESSION['CustomerID'] . '">' . _('Account Status') . '</a></p>'; ?> + <p>• <a href="' . $rootpath . '/SupplierTenders.php?TenderType=1">' . _('View or Amend outstanding offers') . '</a></p> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?NewOrder=Yes">' . _('Place An Order') . '</a></p>'; ?> + <p>• <a href="' . $rootpath . '/SupplierTenders.php?TenderType=2">' . _('Create a new offer') . '</a></p> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedCustomer=' . $_SESSION['CustomerID'] . '">' . _('Order Status') . '</a></p>'; ?> + <p>• <a href="' . $rootpath . '/SupplierTenders.php?TenderType=3">' . _('View any open tenders without an offer') . '</a></p> </td> </tr> - </table> - </td> -<?php + </table>'; include('includes/footer.inc'); exit; -} else if (count($_SESSION['AllowedPageSecurityTokens'])==1 and $SupplierLogin==1){ -?> - - <tr> - <td class="menu_group_items"> <!-- Orders transaction options --> - <table class="table_index"> +} elseif (isset($SupplierLogin) and $SupplierLogin==0){ + echo '<table class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenders.php">' . _('Supplier Tenders') . '</a></p>'; ?> + <p>• <a href="' . $rootpath . '/CustomerInquiry.php?CustomerID=' . $_SESSION['CustomerID'] . '">' . _('Account Status') . '</a></p> </td> </tr> - </table> - </td> -<?php -} else { /* Security settings DO allow seeing the main menu */ - -?> - <table width="100%"><td width="10%" valign="top"><table class="main_menu" width="100%" cellspacing="0" cellpadding="0" border="0"> - - <?php - - - $i=0; - - while ($i < count($ModuleLink)){ - - // This determines if the user has display access to the module see config.php and header.inc - // for the authorisation and security code - if ($_SESSION['ModulesEnabled'][$i]==1) { - - // If this is the first time the application is loaded then it is possible that - // SESSION['Module'] is not set if so set it to the first module that is enabled for the user - if (!isset($_SESSION['Module'])OR $_SESSION['Module']==''){ - $_SESSION['Module']=$ModuleLink[$i]; - } - if ($ModuleLink[$i] == $_SESSION['Module']){ - echo '<tr><td class="main_menu_selected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; - } else { - echo '<tr><td class="main_menu_unselected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; - } - } - $i++; - } - - ?> - </table></td><td> - <?php - - - switch ($_SESSION['Module']) { - - case 'orders': //Sales Orders - ?> - - <table width="100%"> <tr> - <td class="menu_group_area"> - <table width="100%" > - - <?php - // displays the main area headings - OptionHeadings(); - ?> - - <tr> - <td class="menu_group_items"> <!-- Orders transaction options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?NewOrder=Yes">' . _('Enter An Order or Quotation') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CounterSales.php">' . _('Enter Counter Sales') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFPickingList.php">' . _('Print Picking Lists') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php">' . _('Outstanding Sales Orders/Quotations') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SpecialOrder.php?NewSpecial=Yes">' . _('Special Order') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectRecurringSalesOrder.php">' . _('Recurring Order Template') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/RecurringSalesOrdersProcess.php">' . _('Process Recurring Orders') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- Orders Inquiry options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php">' . _('Order Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFPriceList.php">' . _('Print Price Lists') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFOrderStatus.php">' . _('Order Status Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFOrdersInvoiced.php">' . _('Orders Invoiced Reports') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DailySalesInquiry.php">' . _('Daily Sales Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesByTypePeriodInquiry.php">' . _('Sales By Sales Type Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesCategoryPeriodInquiry.php">' . _('Sales By Category Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesTopItemsInquiry.php">' . _('Top Sellers Inquiry') . '</a></p>'; ?> - </td> - </tr> - - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFDeliveryDifferences.php">' . _('Order Delivery Differences Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFDIFOT.php">' . _('Delivery In Full On Time (DIFOT) Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesInquiry.php">' . _('Sales Order Detail Or Summary Inquiries') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TopItems.php">' . _('Top Sales Items Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFLowGP.php">' . _('Sales With Low Gross Profit Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('ord'); ?> - </td> - </tr> - </table> - </td> - - <td class="menu_group_items"> <!-- Orders Maintenance options --> - <table width="100%" class="table_index" > - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectContract.php">' . _('Select Contract') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Contracts.php">' . _('Create Contract') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - </tr> - </table> + <td class="menu_group_item"> + <p>• <a href="' . $rootpath . '/SelectOrderItems.php?NewOrder=Yes">' . _('Place An Order') . '</a></p> </td> </tr> - </table> - <?php - break; - /* ****************** END OF ORDERS MENU ITEMS **************************** */ - - - Case 'AR': //Debtors Module - - unset($ReceiptBatch); - unset($AllocTrans); - - ?> - <table width="100%"> <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> - - <?php OptionHeadings(); ?> - - <tr> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php">' . _('Select Order to Invoice') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCreditItems.php?NewCredit=Yes">' . _('Create A Credit Note') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerReceipt.php?NewReceipt=Yes&Type=Customer">' . _('Enter Receipts') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - - <?php echo '<p>• <a href="' . $rootpath . '/CustomerAllocations.php">' . _('Allocate Receipts or Credit Notes') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustWhereAlloc.php">' . _('Where Allocated Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php - if ($_SESSION['InvoicePortraitFormat']==0){ - echo '<p>• <a href="' . $rootpath . '/PrintCustTrans.php">' . _('Print Invoices or Credit Notes') . '</a></p>'; - } else { - echo '<p>• <a href="' . $rootpath . '/PrintCustTransPortrait.php">' . _('Print Invoices or Credit Notes') . '</a></p>'; - } - ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PrintCustStatements.php">' . _('Print Statements') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesAnalRepts.php">' . _('Sales Analysis Reports') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AgedDebtors.php">' . _('Aged Customer Balances/Overdues Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFBankingSummary.php">' . _('Re-Print A Deposit Listing') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DebtorsAtPeriodEnd.php">' . _('Debtor Balances At A Prior Month End') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFCustomerList.php">' . _('Customer Listing By Area/Salesperson') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesGraph.php">' . _('Sales Graphs') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFCustTransListing.php">' . _('List Daily Transactions') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerTransInquiry.php">' . _('Customer Transaction Inquiries') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('ar'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Customers.php">' . _('Add Customer') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCustomer.php">' . _('Customers') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - </tr> - </table> + <td class="menu_group_item"> + <p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedCustomer=' . $_SESSION['CustomerID'] . '">' . _('Order Status') . '</a></p> </td> </tr> - </table> - <?php + </table>'; + include('includes/footer.inc'); + exit; +} - /* ********************* END OF AR OPTIONS **************************** */ - break; +if (isset($_GET['Application'])){ /*This is sent by this page (to itself) when the user clicks on a tab */ + $_SESSION['Module'] = $_GET['Application']; +} - Case 'AP': //Creditors Module +echo '<table width="99%"> + <tr> + <td style="width:10%" valign="top">'; +echo '<table class="main_menu" width="100%" cellspacing="0" cellpadding="0" border="0">'; - ?> - <table width="100%"> - <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> + $i=0; - <?php OptionHeadings(); ?> +while ($i < count($ModuleLink)){ - <tr> - <td class="menu_group_items"> <!-- AP transaction options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php">' . _('Select Supplier') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierAllocations.php">' . _('Supplier Allocations') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- AP Inquiries --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AgedSuppliers.php">' . _('Aged Supplier Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SuppPaymentRun.php">' . _('Payment Run Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFRemittanceAdvice.php">' . _('Remittance Advices') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/OutstandingGRNs.php">' . _('Outstanding GRNs Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierBalsAtPeriodEnd.php">' . _('Supplier Balances At A Prior Month End') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFSuppTransListing.php">' . _('List Daily Transactions') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTransInquiry.php">' . _('Supplier Transaction Inquiries') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('ap'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- AP Maintenance Options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Suppliers.php">' . _('Add Supplier') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Factors.php">' . _('Maintain Factor Companies') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - </table> - <?php - break; + // This determines if the user has display access to the module see config.php and header.inc + // for the authorisation and security code + if ($_SESSION['ModulesEnabled'][$i]==1) { + // If this is the first time the application is loaded then it is possible that + // SESSION['Module'] is not set if so set it to the first module that is enabled for the user + if (!isset($_SESSION['Module'])OR $_SESSION['Module']==''){ + $_SESSION['Module']=$ModuleLink[$i]; + } + if ($ModuleLink[$i] == $_SESSION['Module']){ + echo '<tr><td class="main_menu_selected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; + } else { + echo '<tr><td class="main_menu_unselected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; + } + } + $i++; +} - Case 'PO': /* Purchase Ordering */ +echo '</table>'; - ?> - <table width="100%"> +echo '</td>'; +echo '<td style="width:30%" valign="top">'; +if ($_SESSION['Module']=='system') { + $Header='<img src="' . $rootpath . '/css/' . $theme . '/images/company.png" title="' . _('General Setup Options') . '" alt="' . _('General Setup Options') . '" /><b>' . _('General Setup Options') . '</b>'; +} else { + $Header='<img src="' . $rootpath . '/css/' . $theme . '/images/transactions.png" title="' . _('Transactions') . '" alt="' . _('Transactions') . '" /><b>'. _('Transactions') . '</b>'; +} +echo ' <table width="100%" class="selection"> <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> + <td class="menu_group_headers"> + <div class="centre"> + ' . $Header . ' + </div> + </td> + </tr>'; - <?php OptionHeadings(); ?> +$i=0; +foreach ($MenuItems[$_SESSION['Module']]['Transactions']['Caption'] as $Caption) { +/* Transactions Menu Item */ + $ScriptNameArray = explode('?', substr($MenuItems[$_SESSION['Module']]['Transactions']['URL'][$i],1)); + $PageSecurity = $_SESSION['PageSecurityArray'][$ScriptNameArray[0]]; + if ((in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PageSecurity))) { + echo '<tr> + <td class="menu_group_item"> + <p>• <a href="' . $rootpath . $MenuItems[$_SESSION['Module']]['Transactions']['URL'][$i] .'">' . $Caption . '</a></p> + </td> + </tr>'; + } + $i++; +} +echo '</table>'; +echo '</td>'; - <tr> - <td class="menu_group_items"> <!-- PO Transactions --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Purchase Orders') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_Header.php?&NewOrder=Yes">' . _('Add Purchase Order') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenderCreate.php?New=Yes">' . _('Create a New Tender') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenderCreate.php?Edit=Yes">' . _('Edit Existing Tenders') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/OffersReceived.php">' . _('Process Tenders and Offers') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_AuthoriseMyOrders.php">' . _('Orders to Authorise') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php">' . _('Shipment Entry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Shipt_Select.php">' . _('Select A Shipment') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- PO Inquiries and Reports --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectPurchOrder.php">' . _('Purchase Order Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/POReport.php">' . _('Purchase Order Detail Or Summary Inquiries') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SuppPriceList.php">' . _('Supplier Price List') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('prch'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- PO Maintenance --> - <table width="100%" class="table_index"> - </table> - </td> - </tr> - </table> - </td> - </tr> - </table> - <?php - break; - /* ****************************** END OF PURCHASING OPTIONS ******************************** */ - - - Case 'stock': //Inventory Module - - ?> - <table width="100%"> +echo '<td style="width:30%" valign="top">'; +if ($_SESSION['Module']=='system') { + $Header='<img src="' . $rootpath . '/css/' . $theme . '/images/ar.png" title="' . _('Receivables/Payables Setup') . '" alt="' . _('Receivables/Payables Setup') . '" /><b>' . _('Receivables/Payables Setup') . '</b>'; +} else { + $Header='<img src="' . $rootpath . '/css/' . $theme . '/images/reports.png" title="' . _('Inquiries and Reports') . '" alt="' . _('Inquiries and Reports') . '" /><b>'. _('Inquiries and Reports') . '</b>'; +} +echo ' <table width="100%" class="selection"> <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> + <td class="menu_group_headers"> + <div class="centre"> + ' . $Header . ' + </div> + </td> + </tr>'; +$i=0; +foreach ($MenuItems[$_SESSION['Module']]['Reports']['Caption'] as $Caption) { +/* Transactions Menu Item */ + $ScriptNameArray = explode('?', substr($MenuItems[$_SESSION['Module']]['Reports']['URL'][$i],1)); + $PageSecurity = $_SESSION['PageSecurityArray'][$ScriptNameArray[0]]; + if ((in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PageSecurity))) { + echo '<tr> + <td class="menu_group_item"> + <p>• <a href="' . $rootpath . $MenuItems[$_SESSION['Module']]['Reports']['URL'][$i] .'">' . $Caption . '</a></p> + </td> + </tr>'; + } + $i++; +} +echo GetRptLinks($_SESSION['Module']); +echo '</table>'; +echo '</td>'; - <?php OptionHeadings(); ?> - <tr> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Receive Purchase Orders') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransfer.php">' . _('Bulk Inventory Transfer') . ' - ' . _('Dispatch') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransferReceive.php">' . _('Bulk Inventory Transfer') . ' - ' . _('Receive') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php?New=Yes">' . _('Inventory Location Transfers') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes">' . _('Inventory Adjustments') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReverseGRN.php">' . _('Reverse Goods Received') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockCounts.php">' . _('Enter Stock Counts') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> -... [truncated message content] |