function add_lapp_function($level, $label,$link="",$access='SA_OPEN')
{
$this->modules[$level]->lappfunctions[] = new app_function($label, $link, $access);
- }
-
+ }
+
function add_rapp_function($level, $label,$link="",$access='SA_OPEN')
{
$this->modules[$level]->rappfunctions[] = new app_function($label, $link, $access);
- }
+ }
+
+ function add_extensions()
+ {
+ global $installed_extensions, $path_to_root;
+
+ foreach ($installed_extensions as $mod)
+ {
+ if (@$mod['active'] && isset($mod['entries']))
+ foreach($mod['entries'] as $entry) {
+ if ($entry['tab_id'] == $this->id)
+ $this->add_rapp_function(
+ isset($entry['section']) ? $entry['section'] : 2,
+ $entry['title'], $path_to_root.'/'.$mod['path'].'/'.$entry['url'],
+ isset($entry["access"]) ? $entry["access"] : 'SA_OPEN' );
+ }
+ }
+ }
+ //
+ // Helper returning link to report class added by extension module.
+ //
+ function report_class_url($class)
+ {
+ global $installed_extensions;
+
+ // TODO : konwencja lub ?
+ $classno = 7;
+// if (file_exists($path_to_root.'/'.$mod['path'].'/'.$entry['url']
+// .'/'.'reporting/reports_custom.php'))
+ return "reporting/reports_main.php?Class=".$class;
+// else
+// return '';
+ }
}
{
function customers_app()
{
- global $installed_extensions;
$this->application("orders", _($this->help_context = "&Sales"));
$this->add_module(_("Transactions"));
"sales/manage/sales_areas.php?", 'SA_SALESAREA');
$this->add_rapp_function(2, _("Credit &Status Setup"),
"sales/manage/credit_status.php?", 'SA_CRSTATUS');
- if (count($installed_extensions) > 0)
- {
- foreach ($installed_extensions as $mod)
- {
- if (@$mod['active'] && $mod['type'] == 'plugin' && $mod["tab"] == "orders")
- $this->add_rapp_function(2, $mod["title"],
- "modules/".$mod["path"]."/".$mod["filename"]."?",
- isset($mod["access"]) ? $mod["access"] : 'SA_OPEN' );
- }
- }
+
+ $this->add_extensions();
}
}
{
function dimensions_app()
{
- global $installed_extensions;
$dim = get_company_pref('use_dimension');
$this->application("proj", _($this->help_context = "&Dimensions"), $dim);
$this->add_module(_("Maintenance"));
$this->add_lapp_function(2, _("Dimension &Tags"),
"admin/tags.php?type=dimension", 'SA_DIMTAGS');
-
- if (count($installed_extensions) > 0)
- {
- foreach ($installed_extensions as $mod)
- {
- if (@$mod['active'] && $mod['type'] == 'plugin' && $mod["tab"] == "proj")
- {
- $this->add_rapp_function(2, $mod["title"],
- "modules/".$mod["path"]."/".$mod["filename"]."?",
- isset($mod["access"]) ? $mod["access"] : 'SA_OPEN' );
- }
- }
- }
+
+ $this->add_extensions();
}
}
}
-
?>
\ No newline at end of file
{
function general_ledger_app()
{
- global $installed_extensions;
$this->application("GL", _($this->help_context = "&Banking and General Ledger"));
$this->add_module(_("Transactions"));
$this->add_rapp_function(1, _("Banking &Reports"),
"reporting/reports_main.php?Class=5", 'SA_BANKREP');
$this->add_rapp_function(1, _("General Ledger &Reports"),
- "reporting/reports_main.php?Class=6", 'SA_GLREP');
+ "reporting/reports_main.php?Class="._("General Ledger"), 'SA_GLREP');
$this->add_module(_("Maintenance"));
$this->add_lapp_function(2, _("Bank &Accounts"),
"gl/manage/gl_account_types.php?", 'SA_GLACCOUNTGROUP');
$this->add_rapp_function(2, _("GL Account &Classes"),
"gl/manage/gl_account_classes.php?", 'SA_GLACCOUNTCLASS');
- if (count($installed_extensions) > 0)
- {
- foreach ($installed_extensions as $mod)
- {
- if (@$mod['active'] && $mod['type'] == 'plugin' && $mod["tab"] == "GL")
- $this->add_rapp_function(2, $mod["title"],
- "modules/".$mod["path"]."/".$mod["filename"]."?",
- isset($mod["access"]) ? $mod["access"] : 'SA_OPEN' );
- }
- }
+
+ $this->add_extensions();
}
}
{
function inventory_app()
{
- global $installed_extensions;
$this->application("stock", _($this->help_context = "&Items and Inventory"));
$this->add_module(_("Transactions"));
$this->add_lapp_function(1, _("Inventory Item &Status"),
"inventory/inquiry/stock_status.php?", 'SA_ITEMSSTATVIEW');
$this->add_rapp_function(1, _("Inventory &Reports"),
- "reporting/reports_main.php?Class=2", 'SA_ITEMSTRANSVIEW');
+ "reporting/reports_main.php?Class="._("Inventory"), 'SA_ITEMSTRANSVIEW');
$this->add_module(_("Maintenance"));
$this->add_lapp_function(2, _("&Items"),
"inventory/purchasing_data.php?", 'SA_PURCHASEPRICING');
$this->add_rapp_function(3, _("Standard &Costs"),
"inventory/cost_update.php?", 'SA_STANDARDCOST');
- if (count($installed_extensions) > 0)
- {
- foreach ($installed_extensions as $mod)
- {
- if (@$mod['active'] && $mod['type'] == 'plugin' && $mod["tab"] == "stock")
- $this->add_rapp_function(2, $mod["title"],
- "modules/".$mod["path"]."/".$mod["filename"]."?",
- isset($mod["access"]) ? $mod["access"] : 'SA_OPEN' );
- }
- }
+
+ $this->add_extensions();
}
}
{
function manufacturing_app()
{
- global $installed_extensions;
$this->application("manuf", _($this->help_context = "&Manufacturing"));
$this->add_module(_("Transactions"));
"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)
- {
- 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' );
- }
- }
+
+ $this->add_extensions();
}
}
{
function setup_app()
{
- global $installed_extensions;
$this->application("system", _($this->help_context = "S&etup"));
$this->add_module(_("Company Setup"));
"admin/inst_lang.php?", 'SA_CREATELANGUAGE');
$this->add_rapp_function(2, _("Install/Activate &Extensions"),
"admin/inst_module.php?", 'SA_CREATEMODULES');
+ $this->add_rapp_function(2, _("Install/Activate &Themes"),
+ "admin/inst_theme.php?", 'SA_CREATEMODULES');
$this->add_rapp_function(2, _("Software &Upgrade"),
"admin/inst_upgrade.php?", 'SA_SOFTWAREUPGRADE');
- if (count($installed_extensions) > 0)
- {
- foreach ($installed_extensions as $mod)
- {
- if (@$mod['active'] && $mod['type'] == 'plugin' && $mod["tab"] == "system")
- $this->add_rapp_function(2, $mod["title"],
- "modules/".$mod["path"]."/".$mod["filename"]."?",
- isset($mod["access"]) ? $mod["access"] : 'SA_OPEN' );
- }
- }
+
+ $this->add_extensions();
}
}
{
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');
+ "purchasing/inquiry/po_search.php?", 'SA_GRN');
+ $this->add_lapp_function(0, _("Direct &GRN"),
+ "purchasing/po_entry_items.php?NewGRN=Yes", 'SA_GRN');
+ $this->add_lapp_function(0, _("Direct &Invoice"),
+ "purchasing/po_entry_items.php?NewInvoice=Yes", 'SA_SUPPLIERINVOICE');
+
$this->add_rapp_function(0, _("&Payments to Suppliers"),
"purchasing/supplier_payment.php?", 'SA_SUPPLIERPAYMNT');
$this->add_rapp_function(0, "","");
$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' );
- }
- }
+
+ $this->add_extensions();
}
}