I may have solution to my number 8 bug
I noticed when installing/uninstalling that the path for 'module name' was /add_fields_item/. I then noticed that I didn't actually have a module called additional_fields.
So I have added a module additional_fields and moved the maintenance pages to there, my abbreviated updated hooks.php is now as follows:-
<?php
define('SS_ADDFLD_C',141<<8); // configuration
define('SS_ADDFLD', 142<<8); // transactions
define('SS_ADDFLD_A',143<<8); // analytic functions/reports/inquires
class add_fields_sales_app extends application {
function __construct() {
global $path_to_root;
parent::__construct('orders', _($this->help_context = '&Sales'));
//All Sales functions as per core with the following changed for Add and Manage &Customers
$this->add_lapp_function(2, _("Add and Manage &Customers"),
"/modules/additional_fields/manage/add_customers.php?", 'SA_CUSTOMER', MENU_ENTRY);
}
}
class add_fields_supp_app extends application {
function __construct() {
global $path_to_root;
parent::__construct('AP', _($this->help_context = '&Purchases'));
//All Purchases functions as per core with the following changed for Suppliers ie Removed add fields maintenance
$this->add_lapp_function(2, _("&Suppliers"),
"/modules/additional_fields/manage/add_suppliers.php?", 'SA_SUPPLIER', MENU_ENTRY);
}
}
class add_fields_item_app extends application {
function __construct() {
global $path_to_root;
parent::__construct('stock', _($this->help_context = '&Items and Inventory'));
//All Items & Inventory functions as per core with the following changed for Items
$this->add_lapp_function(2, _("&Items"),
"/modules/additional_fields/manage/add_items.php?", 'SA_ITEM', MENU_ENTRY);
}
}
// New module added
class additional_fields_app extends application {
function __construct() {
global $path_to_root;
parent::__construct('AddFields', _($this->help_context = 'Additional Fields'));
$this->add_module(_('Maintenance'));
$this->add_rapp_function(2, _('Manage Document Types'), $path_to_root.'/modules/additional_fields/manage/document_types.php?', 'SA_SUPPLIER', MENU_MAINTENANCE);
$this->add_rapp_function(2, _('Manage Beneficiary Classes'), $path_to_root.'/modules/additional_fields/manage/customer_class.php?', 'SA_SUPPLIER', MENU_MAINTENANCE);
$this->add_rapp_function(2, _('Manage Countries'), '/modules/additional_fields/manage/country.php?', 'SA_AFSETUP', MENU_MAINTENANCE);
$this->add_rapp_function(2, _('Manage Departments'), $path_to_root.'/modules/additional_fields/manage/department_add_info.php?', 'SA_SUPPLIER', MENU_MAINTENANCE);
$this->add_rapp_function(2, _('Manage Cities'), $path_to_root.'/modules/additional_fields/manage/city_add_info.php?', 'SA_SUPPLIER', MENU_MAINTENANCE);
$this->add_rapp_function(2, _('Manage Sectors'), $path_to_root.'/modules/additional_fields/manage/sectors_add_info.php?', 'SA_SUPPLIER', MENU_MAINTENANCE);
$this->add_extensions();
}
}
class hooks_additional_fields extends hooks {
function __construct() {
$this->module_name = 'add_fields_sales';
$this->module_name = 'add_fields_supp';
$this->module_name = 'add_fields_item';
$this->module_name = 'additional_fields';//NEW
}
function install_tabs($app) {
$app->add_application(new add_fields_sales_app);
$app->add_application(new add_fields_supp_app);
$app->add_application(new add_fields_item_app);
$app->add_application(new additional_fields_app);//NEW
}
function install_access() {
$security_sections[SS_ADDFLD_C] = _("Additional Fields Configuration");
$security_sections[SS_ADDFLD] = _("Additional Transactions");
$security_sections[SS_ADDFLD_A] = _("Additional Fields Analytics");
$security_areas['SA_XFLD'] = array(SS_ADDFLD|1, _("AddFields entry"));
$security_areas['SA_AFSETUP'] = array(SS_ADDFLD_C|2, _("AddFields setup3"));
// $security_areas['SA_AFSETUP'] = array(SS_PURCH|9, _("AddFields setup2"));
return array($security_areas, $security_sections);
}
function activate_extension($company, $check_only=true) {
global $db_connections;
$updates = array( 'update.sql' => array('frontadd'));
return $this->update_databases($company, $updates, $check_only);
}
function deactivate_extension($company, $check_only=true) {
global $db_connections;
$updates = array('remove.sql' => array('frontadd'));
return $this->update_databases($company, $updates, $check_only);
}
}
Update sql & Remove sql now work
I've not updated the demo or repro yet as would like to wait for any comments or alternative solution where an additional tab is not necessary
No solution to security issues even with above changes and a clean install.
@apmuthu I'm guessing it was you who added the screenshots - Thank you