Update from usntable branch.
[fa-stable.git] / applications / manufacturing.php
index ffcfc021791153510409d1e068b1cc18e827aa41..6892ecc290c4ac5a64e26946f0657438a42131ea 100644 (file)
@@ -9,36 +9,46 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
-       class manufacturing_app extends application
+class manufacturing_app extends application
+{
+       function manufacturing_app()
        {
-               function manufacturing_app()
-               {
-                       global $installed_modules;
-                       $this->application("manuf",_("&Manufacturing"));
+               global $installed_extensions;
+               $this->application("manuf", _($this->help_context = "&Manufacturing"));
 
-                       $this->add_module(_("Transactions"));
-                       $this->add_lapp_function(0, _("Work &Order Entry"),"manufacturing/work_order_entry.php?");
-                       $this->add_lapp_function(0, _("&Outstanding Work Orders"),"manufacturing/search_work_orders.php?outstanding_only=1");
+               $this->add_module(_("Transactions"));
+               $this->add_lapp_function(0, _("Work &Order Entry"),
+                       "manufacturing/work_order_entry.php?", 'SA_WORKORDERENTRY');
+               $this->add_lapp_function(0, _("&Outstanding Work Orders"),
+                       "manufacturing/search_work_orders.php?outstanding_only=1", 'SA_MANUFTRANSVIEW');
 
-                       $this->add_module(_("Inquiries and Reports"));
-                       $this->add_lapp_function(1, _("Costed Bill Of Material Inquiry"),"manufacturing/inquiry/bom_cost_inquiry.php?");
-                       $this->add_lapp_function(1, _("Inventory Item Where Used &Inquiry"),"manufacturing/inquiry/where_used_inquiry.php?");
-                       $this->add_lapp_function(1, _("Work Order &Inquiry"),"manufacturing/search_work_orders.php?");
-                       $this->add_rapp_function(1, _("Manufacturing &Reports"),"reporting/reports_main.php?Class=3");
+               $this->add_module(_("Inquiries and Reports"));
+               $this->add_lapp_function(1, _("Costed Bill Of Material Inquiry"),
+                       "manufacturing/inquiry/bom_cost_inquiry.php?", 'SA_WORKORDERCOST');
+               $this->add_lapp_function(1, _("Inventory Item Where Used &Inquiry"),
+                       "manufacturing/inquiry/where_used_inquiry.php?", 'SA_WORKORDERANALYTIC');
+               $this->add_lapp_function(1, _("Work Order &Inquiry"),
+                       "manufacturing/search_work_orders.php?", 'SA_MANUFTRANSVIEW');
+               $this->add_rapp_function(1, _("Manufacturing &Reports"),
+                       "reporting/reports_main.php?Class=3", 'SA_MANUFTRANSVIEW');
 
-                       $this->add_module(_("Maintenance"));
-                       $this->add_lapp_function(2, _("&Bills Of Material"),"manufacturing/manage/bom_edit.php?");
-                       $this->add_lapp_function(2, _("&Work Centres"),"manufacturing/manage/work_centres.php?");
-                       if (count($installed_modules) > 0)
+               $this->add_module(_("Maintenance"));
+               $this->add_lapp_function(2, _("&Bills Of Material"),
+                       "manufacturing/manage/bom_edit.php?", 'SA_BOM');
+               $this->add_lapp_function(2, _("&Work Centres"),
+                       "manufacturing/manage/work_centres.php?", 'SA_WORKCENTRES');
+               if (count($installed_extensions) > 0)
+               {
+                       foreach ($installed_extensions as $mod)
                        {
-                               foreach ($installed_modules as $mod)
-                               {
-                                       if ($mod["tab"] == "manuf")
-                                               $this->add_rapp_function(2, $mod["name"], "modules/".$mod["path"]."/".$mod["filename"]."?");
-                               }
+                               if (@$mod['active'] && $mod['type'] == 'plugin' && $mod["tab"] == "manuf")
+                                       $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