From 9e7cbc31150db4dd53ec469e507e7f5ff49effd7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CVeLiTi=E2=80=9D?= <“info@veliti.nl”>
Date: Thu, 20 Feb 2025 17:26:38 +0100
Subject: [PATCH] CMXX - Improved menu handling
---
api/v1/post/partners.php | 2 +-
api/v2/get/discounts.php | 2 +-
api/v2/get/invoice.php | 2 +-
api/v2/get/products_attributes_items.php | 2 +-
api/v2/get/products_configurations.php | 2 +-
api/v2/get/products_software.php | 2 +-
api/v2/get/transactions.php | 4 +-
api/v2/post/categories.php | 2 +-
assets/functions.php | 106 +++--
settings/settingsmenu.php | 498 ++++++++++++-----------
settings/settingsprofiles.php | 2 +-
11 files changed, 348 insertions(+), 276 deletions(-)
diff --git a/api/v1/post/partners.php b/api/v1/post/partners.php
index 65c688d..356237a 100644
--- a/api/v1/post/partners.php
+++ b/api/v1/post/partners.php
@@ -14,7 +14,7 @@ $post_content = json_decode(decode_payload($input),true);
if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';}
//default whereclause to check if data is owned by user
-$whereclause = getWhereclauselvl2('partners',$permission,$partner);
+list($whereclause,$condition) = getWhereclauselvl2('partners',$permission,$partner);
//SET PARAMETERS FOR QUERY
$id = $post_content['partnerID'] ?? ''; //check for rowID
diff --git a/api/v2/get/discounts.php b/api/v2/get/discounts.php
index f188700..440a5f1 100644
--- a/api/v2/get/discounts.php
+++ b/api/v2/get/discounts.php
@@ -12,7 +12,7 @@ $pdo = dbConnect($dbname);
if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';}
//default whereclause
-$whereclause = getWhereclauselvl2("discounts",$permission,$partner);
+list($whereclause,$condition) = getWhereclauselvl2("discounts",$permission,$partner);
//NEW ARRAY
$criterias = [];
diff --git a/api/v2/get/invoice.php b/api/v2/get/invoice.php
index b6042c0..b95c096 100644
--- a/api/v2/get/invoice.php
+++ b/api/v2/get/invoice.php
@@ -12,7 +12,7 @@ $pdo = dbConnect($dbname);
if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';}
//default whereclause
-$whereclause = getWhereclauselvl2("invoice",$permission,$partner);
+list($whereclause,$condition) = getWhereclauselvl2("invoice",$permission,$partner);
//NEW ARRAY
$criterias = [];
diff --git a/api/v2/get/products_attributes_items.php b/api/v2/get/products_attributes_items.php
index 1792741..419c30c 100644
--- a/api/v2/get/products_attributes_items.php
+++ b/api/v2/get/products_attributes_items.php
@@ -12,7 +12,7 @@ $pdo = dbConnect($dbname);
if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';}
//default whereclause
-$whereclause = getWhereclauselvl2("attributes",$permission,$partner);
+list($whereclause,$condition) = getWhereclauselvl2("attributes",$permission,$partner);
//NEW ARRAY
$criterias = [];
diff --git a/api/v2/get/products_configurations.php b/api/v2/get/products_configurations.php
index d1bbcad..067f1ac 100644
--- a/api/v2/get/products_configurations.php
+++ b/api/v2/get/products_configurations.php
@@ -12,7 +12,7 @@ $pdo = dbConnect($dbname);
if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';}
//default whereclause
-$whereclause = getWhereclauselvl2("config",$permission,$partner);
+list($whereclause,$condition) = getWhereclauselvl2("config",$permission,$partner);
//NEW ARRAY
$criterias = [];
diff --git a/api/v2/get/products_software.php b/api/v2/get/products_software.php
index 39afbed..e402cdf 100644
--- a/api/v2/get/products_software.php
+++ b/api/v2/get/products_software.php
@@ -12,7 +12,7 @@ $pdo = dbConnect($dbname);
if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';}
//default whereclause
-$whereclause = getWhereclauselvl2("software",$permission,$partner);
+list($whereclause,$condition) = getWhereclauselvl2("software",$permission,$partner);
//NEW ARRAY
$criterias = [];
diff --git a/api/v2/get/transactions.php b/api/v2/get/transactions.php
index 286974b..7d286e4 100644
--- a/api/v2/get/transactions.php
+++ b/api/v2/get/transactions.php
@@ -12,12 +12,14 @@ $pdo = dbConnect($dbname);
if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';}
//default whereclause
-$whereclause = getWhereclauselvl2("transactions",$permission,$partner);
+list($whereclause,$condition) = getWhereclauselvl2("transactions",$permission,$partner);
//NEW ARRAY
$criterias = [];
$clause = '';
+var_dump($w)
+
//Check for $_GET variables and build up clause
if(isset($get_content) && $get_content!=''){
//GET VARIABLES FROM URL
diff --git a/api/v2/post/categories.php b/api/v2/post/categories.php
index ce818a8..b5df660 100644
--- a/api/v2/post/categories.php
+++ b/api/v2/post/categories.php
@@ -14,7 +14,7 @@ $post_content = json_decode($input,true);
if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';}
//default whereclause
-$whereclause = getWhereclauselvl2("categories",$permission,$partner);
+list($whereclause,$condition) = getWhereclauselvl2("categories",$permission,$partner);
//BUILD UP PARTNERHIERARCHY FROM USER
diff --git a/assets/functions.php b/assets/functions.php
index 7ea1098..9e89a40 100644
--- a/assets/functions.php
+++ b/assets/functions.php
@@ -146,6 +146,51 @@ function routes($urls) {
//------------------------------------------
// Menu Builder
//------------------------------------------
+function filterMenuByProfile($menu, $profileString) {
+ // Convert profile string to array
+ $profileArray = explode(',', $profileString);
+
+ // Initialize result array
+ $filteredMenu = [];
+
+ // Loop through main menu sections
+ foreach ($menu as $sectionKey => $section) {
+ $sectionIncluded = in_array($sectionKey, $profileArray);
+ $submenuFound = false;
+ $firstSubmenuItem = null;
+
+ // First check if any submenu items are in profile
+ foreach ($section as $itemKey => $item) {
+ if ($itemKey !== 'main_menu' && in_array($itemKey, $profileArray)) {
+ $submenuFound = true;
+ if ($firstSubmenuItem === null) {
+ $firstSubmenuItem = $item;
+ }
+ }
+ }
+
+ // Include this section if either section key or any submenu is in profile
+ if ($sectionIncluded || $submenuFound) {
+ $filteredMenu[$sectionKey] = [];
+
+ // Add main_menu - if section not in profile but submenu found, use first submenu as main_menu
+ if (!$sectionIncluded && $submenuFound && $firstSubmenuItem !== null) {
+ $filteredMenu[$sectionKey]['main_menu'] = $firstSubmenuItem;
+ } else {
+ $filteredMenu[$sectionKey]['main_menu'] = $section['main_menu'];
+ }
+
+ // Add allowed submenu items
+ foreach ($section as $itemKey => $item) {
+ if ($itemKey !== 'main_menu' && in_array($itemKey, $profileArray)) {
+ $filteredMenu[$sectionKey][$itemKey] = $item;
+ }
+ }
+ }
+ }
+
+ return $filteredMenu;
+}
function menu($selected,$selected_child){
include dirname(__FILE__,2).'/settings/settings.php';
@@ -153,43 +198,42 @@ function menu($selected,$selected_child){
if(isset($_SESSION['country_code'])){
$api_file_language = dirname(__FILE__,2).'/settings/translations/translations_'.strtoupper($_SESSION['country_code']).'.php';
if (file_exists($api_file_language)){
- include $api_file_language; //Include the code
+ include $api_file_language; //Include the code
}
else {
- include dirname(__FILE__,2).'/settings/translations/translations_US.php';
+ include dirname(__FILE__,2).'/settings/translations/translations_US.php';
}
- }
- else {
- include dirname(__FILE__,2).'/settings/translations/translations_US.php';
- }
+ }
+ else {
+ include dirname(__FILE__,2).'/settings/translations/translations_US.php';
+ }
- $profile = explode(',',$_SESSION['profile']);
-
//Define Menu
$menu = '';
- foreach ($main_menu as $menu_item){
- if (in_array($item = $menu_item, $profile,)){
- //Main URL
- $menu .= ''.ucfirst((${$urls[$item]['name']}?? 'not specified')).'';
- //DEFINE SUBMENU
- $sub_menu = $item.'_sub' ?? '';
- $sub_menu = (isset($$sub_menu) && $$sub_menu !='')? $$sub_menu : 0;
- //CHECK IF SUBMENU EXIST
- if ($sub_menu !=0){
- $menu .= '
';
- }
+ //filter the main_menu array based on profile
+ $filteredMenu = filterMenuByProfile($main_menu, $_SESSION['profile']);
+
+ foreach ($filteredMenu as $menu_item){
+ //Main Item
+ $menu .= ''.ucfirst((${$menu_item['main_menu']['name']} ?? 'not specified')).'';
+
+ if (count($menu_item) > 1){
+ //SUBMENU
+ $menu .= '';
}
}
+
return $menu;
- }
+}
//------------------------------------------
// Template Header
@@ -669,15 +713,15 @@ function getWhereclause($table_name,$permission,$partner){
break;
case '3':
$condition = '__salesid___'.$partner->salesid.'___soldto___%';
- $whereclause = 'WHERE '.$table.' like :condition ';
+ $whereclause = 'WHERE '.$table.' like "'.$condition.'"';
break;
case '2':
$condition = '__salesid___'.$partner->salesid.'___soldto___'.substr($partner->soldto, 0, strpos($partner->soldto, "-")).$soldto_search;
- $whereclause = 'WHERE '.$table.' like :condition ';
+ $whereclause = 'WHERE '.$table.' like "'.$condition.'"';
break;
default:
$condition = '__salesid___'.$partner->salesid.'___soldto___'.substr($partner->soldto, 0, strpos($partner->soldto, "-")).$soldto_search.'___shipto___'.substr($partner->shipto, 0, strpos($partner->shipto, "-")).'%___location___'.substr($partner->location, 0, strpos($partner->location, "-")).'%';
- $whereclause = 'WHERE '.$table.' like :condition ';
+ $whereclause = 'WHERE '.$table.' like "'.$condition.'"';
break;
}
@@ -717,7 +761,7 @@ function getWhereclauselvl2($table_name,$permission,$partner){
break;
case '3':
$condition = '__salesid___'.$partner->salesid.'___soldto___%';
- $whereclause = 'WHERE '.$table.' like :condition ';
+ $whereclause = 'WHERE '.$table.' like "'.$condition.'" ';
break;
default:
$condition = '__salesid___'.$partner->salesid.'___soldto___'.substr($partner->soldto, 0, strpos($partner->soldto, "-")).$soldto_search;
diff --git a/settings/settingsmenu.php b/settings/settingsmenu.php
index c9a45e5..bf1b1d0 100644
--- a/settings/settingsmenu.php
+++ b/settings/settingsmenu.php
@@ -7,242 +7,268 @@
// Each Menu name in urls array requires reference
// into translation files and corresponding profile
//------------------------------------------
-//Menu Setup
-$main_menu = array ('dashboard','sales','buildtool','cartests','marketing','equipments','products','reporting','admin','settings');
-
-//Sub menus
-$equipments_sub = array('equipments','servicereports','rmas','histories','firmwaretool','equipments_mass_update');
-$sales_sub = array('accounts','contracts','catalog','orders');
-$products_sub = array('products','products_attributes','pricelists');
-$admin_sub = array('users','categories','discounts','shipping','communications','partners','media');
-$reporting_sub = array('report_build','report_contracts_billing','report_healthindex','report_usage');
-$settings_sub = array('config','translations','logfile','maintenance','profiles');
-
-//URLS
-$urls = array(
- "dashboard" => array(
- "url" => "dashboard",
- "selected" => "dashboard",
- "icon" => "fas fa-tachometer-alt",
- "name" => "menu_dashboard"
- ),
- "equipments" => array(
- "url" => "equipments",
- "selected" => "assets",
- "icon" => "fa-solid fa-database",
- "name" => "menu_assets"
- ),
- "servicereports" => array(
- "url" => "servicereports",
- "selected" => "servicereports",
- "icon" => "fas fa-tachometer-alt",
- "name" => "menu_service_reports"
- ),
- "rmas" => array(
- "url" => "rmas",
- "selected" => "rmas",
- "icon" => "fas fa-tachometer-alt",
- "name" => "menu_rmas"
- ),
- "histories" => array(
- "url" => "histories",
- "selected" => "histories",
- "icon" => "fas fa-tachometer-alt",
- "name" => "menu_history"
- ),
- "firmwaretool" => array(
- "url" => "firmwaretool",
- "selected" => "firmwaretool",
- "icon" => "fas fa-tachometer-alt",
- "name" => "menu_firmwaretool"
- ),
- "equipments_mass_update" => array(
- "url" => "equipments_mass_update",
- "selected" => "equipments_mass_update",
- "icon" => "fas fa-tachometer-alt",
- "name" => "menu_equipments_mass_update"
- ),
- "products" => array(
- "url" => "products&status=1",
- "selected" => "products",
- "icon" => "fas fa-box-open",
- "name" => "menu_products"
- ),
- "products_attributes" => array(
- "url" => "products_attributes",
- "selected" => "products_attributes",
- "icon" => "fas fa-box-open",
- "name" => "menu_products_attributes"
- ),
- "pricelists" => array(
- "url" => "pricelists",
- "selected" => "pricelists",
- "icon" => "fa-solid fa-coins",
- "name" => "menu_pricelists"
- ),
- "sales" => array(
- "url" => "contracts",
- "selected" => "contracts",
- "icon" => "fa-solid fa-bars",
- "name" => "menu_sales"
- ),
- "accounts" => array(
- "url" => "accounts",
- "selected" => "accounts",
- "icon" => "fas fa-tachometer-alt",
- "name" => "menu_sales_accounts"
- ),
- "contracts" => array(
- "url" => "contracts",
- "selected" => "contracts",
- "icon" => "fas fa-tachometer-alt",
- "name" => "menu_sales_contracts"
- ),
- "orders" => array(
- "url" => "orders",
- "selected" => "orders",
- "icon" => "fas fa-tachometer-alt",
- "name" => "menu_sales_orders"
- ),
- "admin" => array(
- "url" => "partners",
- "selected" => "partners",
- "icon" => "fa-solid fa-bars",
- "name" => "menu_admin"
- ),
- "users" => array(
- "url" => "users",
- "selected" => "users",
- "icon" => "fas fa-tachometer-alt",
- "name" => "menu_admin_users"
- ),
- "communications" => array(
- "url" => "communications",
- "selected" => "communications",
- "icon" => "fas fa-tachometer-alt",
- "name" => "menu_admin_communications"
- ),
- "media" => array(
- "url" => "media",
- "selected" => "media",
- "icon" => "fa-solid fa-photo-film",
- "name" => "menu_media"
- ),
- "categories" => array(
- "url" => "categories",
- "selected" => "categories",
- "icon" => "fa-solid fa-photo-film",
- "name" => "menu_categories"
- ),
- "discounts" => array(
- "url" => "discounts",
- "selected" => "discounts",
- "icon" => "fa-solid fa-photo-film",
- "name" => "menu_discounts"
- ),
- "shipping" => array(
- "url" => "shipping",
- "selected" => "shipping",
- "icon" => "fa-solid fa-truck-fast",
- "name" => "menu_shipping"
- ),
- "catalog" => array(
- "url" => "catalog",
- "selected" => "catalog",
- "icon" => "fa-solid fa-photo-film",
- "name" => "menu_catalog"
- ),
- "partners" => array(
- "url" => "partners",
- "selected" => "partners",
- "icon" => "fas fa-tachometer-alt",
- "name" => "menu_admin_partners"
- ),
- "settings" => array(
- "url" => "settings",
- "selected" => "settings",
- "icon" => "fas fa-tools",
- "name" => "menu_settings"
- ),
- "config" => array(
- "url" => "settings",
- "selected" => "settings",
- "icon" => "fas fa-tools",
- "name" => "menu_config"
- ),
- "translations" => array(
- "url" => "translations",
- "selected" => "translations",
- "icon" => "fas fa-tachometer-alt",
- "name" => "menu_translations"
- ),
- "logfile" => array(
- "url" => "logfile",
- "selected" => "logfile",
- "icon" => "fas fa-tachometer-alt",
- "name" => "menu_logfile"
- ),
- "maintenance" => array(
- "url" => "maintenance",
- "selected" => "maintenance",
- "icon" => "fas fa-tachometer-alt",
- "name" => "menu_maintenance"
- ),
- "profiles" => array(
- "url" => "profiles",
- "selected" => "profiles",
- "icon" => "fas fa-tachometer-alt",
- "name" => "menu_profiles"
- ),
- "marketing" => array(
- "url" => "marketing&product_group=Emergency_Plug&product_content=Images",
- "selected" => "marketing",
- "icon" => "fas fa-tachometer-alt",
- "name" => "menu_marketing"
- ),
- "buildtool" => array(
- "url" => "buildtool",
- "selected" => "buildtool",
- "icon" => "fas fa-tachometer-alt",
- "name" => "menu_build"
- ),
- "cartests" => array(
- "url" => "cartests",
- "selected" => "cartests",
- "icon" => "fa-solid fa-car",
- "name" => "menu_cartest"
- ),
- "reporting" => array(
- "url" => "report_build",
- "selected" => "report_build",
- "icon" => "fa-solid fa-magnifying-glass-chart",
- "name" => "menu_report_main"
- ),
- "report_build" => array(
- "url" => "report_build",
- "selected" => "report_build",
- "icon" => "fa-solid fa-magnifying-glass-chart",
- "name" => "menu_report_build"
- ),
- "report_contracts_billing" => array(
- "url" => "report_contracts_billing",
- "selected" => "report_contracts_billing",
- "icon" => "fa-solid fa-magnifying-glass-chart",
- "name" => "menu_report_contracts_billing"
- ),
- "report_healthindex" => array(
- "url" => "report_healthindex",
- "selected" => "report_healthindex",
- "icon" => "fa-solid fa-magnifying-glass-chart",
- "name" => "menu_report_healthindex"
- ),
- "report_usage" => array(
- "url" => "report_usage",
- "selected" => "report_usage",
- "icon" => "fa-solid fa-magnifying-glass-chart",
- "name" => "menu_report_usage"
- )
-);
+$main_menu = [
+ "dashboard" => [
+ "main_menu" => [
+ "url" => "dashboard",
+ "selected" => "dashboard",
+ "icon" => "fas fa-tachometer-alt",
+ "name" => "menu_dashboard"
+ ]
+ ],
+ "sales" => [
+ "main_menu" => [
+ "url" => "contracts",
+ "selected" => "contracts",
+ "icon" => "fa-solid fa-bars",
+ "name" => "menu_sales"
+ ],
+ "accounts" => [
+ "url" => "accounts",
+ "selected" => "accounts",
+ "icon" => "fas fa-tachometer-alt",
+ "name" => "menu_sales_accounts"
+ ],
+ "catalog" => [
+ "url" => "catalog",
+ "selected" => "catalog",
+ "icon" => "fa-solid fa-photo-film",
+ "name" => "menu_catalog"
+ ],
+ "contracts" => [
+ "url" => "contracts",
+ "selected" => "contracts",
+ "icon" => "fas fa-tachometer-alt",
+ "name" => "menu_sales_contracts"
+ ],
+ "orders" => [
+ "url" => "orders",
+ "selected" => "orders",
+ "icon" => "fas fa-tachometer-alt",
+ "name" => "menu_sales_orders"
+ ]
+ ],
+ "buildtool" => [
+ "main_menu" => [
+ "url" => "buildtool",
+ "selected" => "buildtool",
+ "icon" => "fas fa-tachometer-alt",
+ "name" => "menu_build"
+ ]
+ ],
+ "cartests" => [
+ "main_menu" => [
+ "url" => "cartests",
+ "selected" => "cartests",
+ "icon" => "fa-solid fa-car",
+ "name" => "menu_cartest"
+ ]
+ ],
+ "marketing" => [
+ "main_menu" => [
+ "url" => "marketing&product_group=Emergency_Plug&product_content=Images",
+ "selected" => "marketing",
+ "icon" => "fas fa-tachometer-alt",
+ "name" => "menu_marketing"
+ ]
+ ],
+ "equipments" => [
+ "main_menu" => [
+ "url" => "equipments",
+ "selected" => "assets",
+ "icon" => "fa-solid fa-database",
+ "name" => "menu_assets"
+ ],
+ "equipments" =>[
+ "url" => "equipments",
+ "selected" => "assets",
+ "icon" => "fa-solid fa-database",
+ "name" => "menu_assets"
+ ],
+ "servicereports" => [
+ "url" => "servicereports",
+ "selected" => "servicereports",
+ "icon" => "fas fa-tachometer-alt",
+ "name" => "menu_service_reports"
+ ],
+ "rmas" => [
+ "url" => "rmas",
+ "selected" => "rmas",
+ "icon" => "fas fa-tachometer-alt",
+ "name" => "menu_rmas"
+ ],
+ "histories" => [
+ "url" => "histories",
+ "selected" => "histories",
+ "icon" => "fas fa-tachometer-alt",
+ "name" => "menu_history"
+ ],
+ "firmwaretool" => [
+ "url" => "firmwaretool",
+ "selected" => "firmwaretool",
+ "icon" => "fas fa-tachometer-alt",
+ "name" => "menu_firmwaretool"
+ ] ,
+ "equipments_mass_update" => [
+ "url" => "equipments_mass_update",
+ "selected" => "equipments_mass_update",
+ "icon" => "fas fa-tachometer-alt",
+ "name" => "menu_equipments_mass_update"
+ ]
+ ],
+ "products" => [
+ "main_menu" => [
+ "url" => "products&status=1",
+ "selected" => "products",
+ "icon" => "fas fa-box-open",
+ "name" => "menu_products"
+ ],
+ "products" => [
+ "url" => "products&status=1",
+ "selected" => "products",
+ "icon" => "fas fa-box-open",
+ "name" => "menu_products"
+ ],
+ "products_attributes" => [
+ "url" => "products_attributes",
+ "selected" => "products_attributes",
+ "icon" => "fas fa-box-open",
+ "name" => "menu_products_attributes"
+ ],
+ "pricelists" => [
+ "url" => "pricelists",
+ "selected" => "pricelists",
+ "icon" => "fa-solid fa-coins",
+ "name" => "menu_pricelists"
+ ]
+ ],
+ "reporting" => [
+ "main_menu" => [
+ "url" => "report_build",
+ "selected" => "report_build",
+ "icon" => "fa-solid fa-magnifying-glass-chart",
+ "name" => "menu_report_main"
+ ],
+ "report_build" => [
+ "url" => "report_build",
+ "selected" => "report_build",
+ "icon" => "fa-solid fa-magnifying-glass-chart",
+ "name" => "menu_report_build"
+ ],
+ "report_contracts_billing" => [
+ "url" => "report_contracts_billing",
+ "selected" => "report_contracts_billing",
+ "icon" => "fa-solid fa-magnifying-glass-chart",
+ "name" => "menu_report_contracts_billing"
+ ],
+ "report_healthindex" => [
+ "url" => "report_healthindex",
+ "selected" => "report_healthindex",
+ "icon" => "fa-solid fa-magnifying-glass-chart",
+ "name" => "menu_report_healthindex"
+ ],
+ "report_usage" => [
+ "url" => "report_usage",
+ "selected" => "report_usage",
+ "icon" => "fa-solid fa-magnifying-glass-chart",
+ "name" => "menu_report_usage"
+ ]
+ ],
+ "admin" =>[
+ "main_menu" => [
+ "url" => "partners",
+ "selected" => "partners",
+ "icon" => "fa-solid fa-bars",
+ "name" => "menu_admin"
+ ],
+ "partners" => [
+ "url" => "partners",
+ "selected" => "partners",
+ "icon" => "fa-solid fa-bars",
+ "name" => "menu_admin"
+ ],
+ "users" => [
+ "url" => "users",
+ "selected" => "users",
+ "icon" => "fas fa-tachometer-alt",
+ "name" => "menu_admin_users"
+ ],
+ "communications" => [
+ "url" => "communications",
+ "selected" => "communications",
+ "icon" => "fas fa-tachometer-alt",
+ "name" => "menu_admin_communications"
+ ],
+ "media" => [
+ "url" => "media",
+ "selected" => "media",
+ "icon" => "fa-solid fa-photo-film",
+ "name" => "menu_media"
+ ],
+ "categories" => [
+ "url" => "categories",
+ "selected" => "categories",
+ "icon" => "fa-solid fa-photo-film",
+ "name" => "menu_categories"
+ ],
+ "discounts" => [
+ "url" => "discounts",
+ "selected" => "discounts",
+ "icon" => "fa-solid fa-photo-film",
+ "name" => "menu_discounts"
+ ],
+ "shipping" => [
+ "url" => "shipping",
+ "selected" => "shipping",
+ "icon" => "fa-solid fa-truck-fast",
+ "name" => "menu_shipping"
+ ]
+ ],
+ "settings" => [
+ "main_menu" => [
+ "url" => "settings",
+ "selected" => "settings",
+ "icon" => "fas fa-tools",
+ "name" => "menu_settings"
+ ],
+ "settings" => [
+ "url" => "settings",
+ "selected" => "settings",
+ "icon" => "fas fa-tools",
+ "name" => "menu_settings"
+ ],
+ "config" => [
+ "url" => "settings",
+ "selected" => "settings",
+ "icon" => "fas fa-tools",
+ "name" => "menu_config"
+ ],
+ "translations" => [
+ "url" => "translations",
+ "selected" => "translations",
+ "icon" => "fas fa-tachometer-alt",
+ "name" => "menu_translations"
+ ],
+ "logfile" => [
+ "url" => "logfile",
+ "selected" => "logfile",
+ "icon" => "fas fa-tachometer-alt",
+ "name" => "menu_logfile"
+ ],
+ "maintenance" => [
+ "url" => "maintenance",
+ "selected" => "maintenance",
+ "icon" => "fas fa-tachometer-alt",
+ "name" => "menu_maintenance"
+ ],
+ "profiles" => [
+ "url" => "profiles",
+ "selected" => "profiles",
+ "icon" => "fas fa-tachometer-alt",
+ "name" => "menu_profiles"
+ ]
+ ]
+];
$routes = array(
'/' => 'equipments.php',
diff --git a/settings/settingsprofiles.php b/settings/settingsprofiles.php
index 4309eab..571b2b1 100644
--- a/settings/settingsprofiles.php
+++ b/settings/settingsprofiles.php
@@ -10,7 +10,7 @@ define('adminplus_profile','dashboard,profile,buildtool,sales,accounts,account,c
/*Build*/
define('build','dashboard,profile,buildtool,firmwaretool,buildtool,products_software,application');
/*Commerce*/
-define('commerce','dashboard,profile,assets,equipments,equipment,equipment_manage,equipment_manage_edit,equipments_mass_update,histories,history,history_manage,firmwaretool,products,products_versions,products_software,product,product_manage,servicereports,servicereport,admin,partners,partner,users,user,user_manage,marketing,application');
+define('commerce','dashboard,profile,products,products_versions,products_software,products_attributes,products_attributes_items,products_attributes_manage,products_configurations,products_categories,products_media,product,product_manage,pricelists,pricelists_items,pricelists_manage,catalog,categories,category,discounts,discount,shipping,shipping_manage,admin,users,user,user_manage,translations,translations_details,translation_manage,media,media_manage,application,profiles,shopping_cart,checkout,placeorder,taxes,transactions,transactions_items,invoice,order,orders');
/*Distribution*/
define('distribution','dashboard,profile,assets,equipments,equipment,equipment_manage,equipment_manage_edit,equipments_mass_update,histories,history,history_manage,firmwaretool,products,products_versions,products_software,product,product_manage,servicereports,servicereport,admin,partners,partner,users,user,user_manage,marketing,application');
/*Firmware*/