Update from usntable branch.
[fa-stable.git] / applications / suppliers.php
index 9f7213ba4250b20378c2b2aaf3b9f9ff0b64ae39..304c653c731a79c0c8169c7751eb7eb51d41e586 100644 (file)
@@ -1,32 +1,63 @@
-<?php\r
-       \r
-       class suppliers_app extends application \r
-       {\r
-               function suppliers_app() \r
-               {\r
-                       $this->application("AP",_("Purchases"));\r
-                       \r
-                       $this->add_module(_("Transactions"));\r
-                       $this->add_lapp_function(0, _("Purchase Order Entry"),"purchasing/po_entry_items.php?NewOrder=Yes");\r
-                       $this->add_lapp_function(0, _("Outstanding Purchase Orders Maintenance"),"purchasing/inquiry/po_search.php?");\r
-                       $this->add_rapp_function(0, _("Payments to Suppliers"),"purchasing/supplier_payment.php?");\r
-                       $this->add_rapp_function(0, "","");\r
-                       $this->add_rapp_function(0, _("Supplier Invoices"),"purchasing/supplier_invoice.php?New=1");                    \r
-                       $this->add_rapp_function(0, _("Supplier Credit Notes"),"purchasing/supplier_credit.php?New=1");\r
-                       $this->add_rapp_function(0, _("Allocate Supplier Payments or Credit Notes"),"purchasing/allocations/supplier_allocation_main.php?");\r
-                       \r
-                       $this->add_module(_("Inquiries and Reports"));\r
-                       $this->add_lapp_function(1, _("Purchase Orders Inquiry"),"purchasing/inquiry/po_search_completed.php?");\r
-                       $this->add_lapp_function(1, _("Supplier Transaction Inquiry"),"purchasing/inquiry/supplier_inquiry.php?");\r
-                       $this->add_lapp_function(1, "","");\r
-                       $this->add_lapp_function(1, _("Supplier Allocation Inquiry"),"purchasing/inquiry/supplier_allocation_inquiry.php?");\r
-                       \r
-                       $this->add_rapp_function(1, _("Supplier and Purchasing Reports"),"reporting/reports_main.php?Class=1");\r
-                       \r
-                       $this->add_module(_("Maintenance"));\r
-                       $this->add_lapp_function(2, _("Suppliers"),"purchasing/manage/suppliers.php?");\r
-               }\r
-       }\r
-       \r
-\r
+<?php
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
+class suppliers_app extends application 
+{
+       function suppliers_app() 
+       {
+               global $installed_extensions;
+               $this->application("AP", _($this->help_context = "&Purchases"));
+
+               $this->add_module(_("Transactions"));
+               $this->add_lapp_function(0, _("Purchase &Order Entry"),
+                       "purchasing/po_entry_items.php?NewOrder=Yes", 'SA_PURCHASEORDER');
+               $this->add_lapp_function(0, _("&Outstanding Purchase Orders Maintenance"),
+                       "purchasing/inquiry/po_search.php?", 'SA_SUPPTRANSVIEW');
+               $this->add_rapp_function(0, _("&Payments to Suppliers"),
+                       "purchasing/supplier_payment.php?", 'SA_SUPPLIERPAYMNT');
+               $this->add_rapp_function(0, "","");
+               $this->add_rapp_function(0, _("Supplier &Invoices"),
+                       "purchasing/supplier_invoice.php?New=1", 'SA_SUPPLIERINVOICE');
+               $this->add_rapp_function(0, _("Supplier &Credit Notes"),
+                       "purchasing/supplier_credit.php?New=1", 'SA_SUPPLIERCREDIT');
+               $this->add_rapp_function(0, _("&Allocate Supplier Payments or Credit Notes"),
+                       "purchasing/allocations/supplier_allocation_main.php?", 'SA_SUPPLIERALLOC');
+
+               $this->add_module(_("Inquiries and Reports"));
+               $this->add_lapp_function(1, _("Purchase Orders &Inquiry"),
+                       "purchasing/inquiry/po_search_completed.php?", 'SA_SUPPTRANSVIEW');
+               $this->add_lapp_function(1, _("Supplier Transaction &Inquiry"),
+                       "purchasing/inquiry/supplier_inquiry.php?", 'SA_SUPPTRANSVIEW');
+               $this->add_lapp_function(1, "","");
+               $this->add_lapp_function(1, _("Supplier Allocation &Inquiry"),
+                       "purchasing/inquiry/supplier_allocation_inquiry.php?", 'SA_SUPPLIERALLOC');
+
+               $this->add_rapp_function(1, _("Supplier and Purchasing &Reports"),
+                       "reporting/reports_main.php?Class=1", 'SA_SUPPTRANSVIEW');
+
+               $this->add_module(_("Maintenance"));
+               $this->add_lapp_function(2, _("&Suppliers"),
+                       "purchasing/manage/suppliers.php?", 'SA_SUPPLIER');
+               if (count($installed_extensions) > 0)
+               {
+                       foreach ($installed_extensions as $mod)
+                       {
+                               if (@$mod['active'] && $mod['type'] == 'plugin' && $mod["tab"] == "AP")
+                                       $this->add_rapp_function(2, $mod["title"], 
+                                               "modules/".$mod["path"]."/".$mod["filename"]."?",
+                                               isset($mod["access"]) ? $mod["access"] : 'SA_OPEN' );
+                       }
+               }
+       }
+}
+
+
 ?>
\ No newline at end of file