Enhance partner dropdowns to include authorization permissions across various management pages. Implement hardware version checks with warning modals for restricted versions. Update translations for hardware compatibility notices in multiple languages. Refactor SQL and PHP files to improve code clarity and maintainability.

This commit is contained in:
“VeLiTi”
2026-02-05 10:10:26 +01:00
parent 5223f6bdfd
commit ee426cf5ea
21 changed files with 235 additions and 51 deletions

View File

@@ -84,12 +84,13 @@ if (!empty($all_roles)){$all_roles = json_decode($all_roles);}else{$all_roles =
// Handle POST for inline edit
//------------------------------
if (isset($_POST['save_permissions']) && $update_allowed_edit === 1) {
// Update role info (name, description, status, system role)
// Update role info (name, description, status, system role, hierarchy)
$role_data_array = [
'rowID' => $role_id,
'name' => $_POST['name'] ?? '',
'description' => $_POST['description'] ?? '',
'is_active' => $_POST['is_active'] ?? 1
'is_active' => $_POST['is_active'] ?? 1,
'role_hierarchy' => $_POST['role_hierarchy'] ?? 0
];
// Only allow is_system to be changed if user has delete permission on user_roles
if ($system_role_allowed === 1) {
@@ -286,6 +287,19 @@ $view .= ' <div class="content-block order-details">
</label>' : '').'
</p>
</div>
<div class="order-detail">
<h3>'.($role_hierarchy ?? 'Role Hierarchy Level').'</h3>
<p>
<span class="view-mode">'.($responses->role_hierarchy ?? '0').'</span>
<select class="edit-mode" name="role_hierarchy" style="display:none;">
<option value="0"'.($responses->role_hierarchy == 0 ? ' selected' : '').'>0 - '.($hierarchy_level_0 ?? 'No restrictions (all access)').'</option>
<option value="1"'.($responses->role_hierarchy == 1 ? ' selected' : '').'>1 - '.($hierarchy_level_1 ?? 'Sales ID level').'</option>
<option value="2"'.($responses->role_hierarchy == 2 ? ' selected' : '').'>2 - '.($hierarchy_level_2 ?? 'Sold To level').'</option>
<option value="3"'.($responses->role_hierarchy == 3 ? ' selected' : '').'>3 - '.($hierarchy_level_3 ?? 'Ship To level').'</option>
<option value="4"'.($responses->role_hierarchy == 4 ? ' selected' : '').'>4 - '.($hierarchy_level_4 ?? 'Location level').'</option>
</select>
</p>
</div>
<div class="order-detail edit-mode-block" style="display:none;">
<h3>'.($copy_from_role ?? 'Copy Permissions From').'</h3>
<p>