From b0aab10872910aeac93ab867a677f8078c3bbf90 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 21 Aug 2024 16:58:44 -0600 Subject: [PATCH] Simplify the dashboard path --- app/call_block/resources/dashboard/config.php | 2 +- .../resources/dashboard/config.php | 2 +- .../resources/dashboard/config.php | 2 +- .../resources/dashboard/config.php | 2 +- .../resources/dashboard/config.php | 2 +- .../resources/dashboard/config.php | 2 +- app/devices/resources/dashboard/config.php | 2 +- .../resources/dashboard/config.php | 2 +- app/extensions/resources/dashboard/config.php | 4 +- app/ivr_menus/resources/dashboard/config.php | 2 +- app/recordings/resources/dashboard/config.php | 2 +- .../resources/dashboard/config.php | 2 +- app/switch/resources/dashboard/config.php | 2 +- app/system/resources/dashboard/config.php | 6 +- .../resources/dashboard/config.php | 2 +- app/voicemails/resources/dashboard/config.php | 4 +- app/xml_cdr/resources/dashboard/config.php | 6 +- core/dashboard/app_defaults.php | 4 ++ core/dashboard/dashboard_edit.php | 60 +++++++++---------- core/dashboard/index.php | 16 ++++- core/users/resources/dashboard/config.php | 6 +- 21 files changed, 74 insertions(+), 58 deletions(-) diff --git a/app/call_block/resources/dashboard/config.php b/app/call_block/resources/dashboard/config.php index ccdef54268..69ce4408f5 100644 --- a/app/call_block/resources/dashboard/config.php +++ b/app/call_block/resources/dashboard/config.php @@ -3,7 +3,7 @@ //call block icon $array['dashboard'][$x]['dashboard_uuid'] = 'e75f04ff-6d1b-4b39-af0f-e1d1860327c1'; $array['dashboard'][$x]['dashboard_name'] = 'Call Block'; -$array['dashboard'][$x]['dashboard_path'] = 'core/dashboard/resources/dashboard/icon.php'; +$array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-ban'; $array['dashboard'][$x]['dashboard_url'] = '/app/call_block/call_block.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; diff --git a/app/call_centers/resources/dashboard/config.php b/app/call_centers/resources/dashboard/config.php index 2724b27b9c..b3ee09a03a 100644 --- a/app/call_centers/resources/dashboard/config.php +++ b/app/call_centers/resources/dashboard/config.php @@ -2,7 +2,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = '9083305a-ebb4-4b67-bb9b-8c09cf030261'; $array['dashboard'][$x]['dashboard_name'] = 'Call Center Agents'; -$array['dashboard'][$x]['dashboard_path'] = 'app/call_centers/resources/dashboard/call_center_agents.php'; +$array['dashboard'][$x]['dashboard_path'] = 'call_centers/call_center_agents'; $array['dashboard'][$x]['dashboard_order'] = '180'; $array['dashboard'][$x]['dashboard_enabled'] = 'false'; $array['dashboard'][$x]['dashboard_description'] = 'Status for agent in a call center.'; diff --git a/app/call_forward/resources/dashboard/config.php b/app/call_forward/resources/dashboard/config.php index 4a63dd59c5..6cb26dbbb9 100644 --- a/app/call_forward/resources/dashboard/config.php +++ b/app/call_forward/resources/dashboard/config.php @@ -3,7 +3,7 @@ //call forward $array['dashboard'][$x]['dashboard_uuid'] = 'ba60799a-1c40-44a8-80ef-c2be4f4692fb'; $array['dashboard'][$x]['dashboard_name'] = 'Call Forward'; -$array['dashboard'][$x]['dashboard_path'] = 'app/call_forward/resources/dashboard/call_forward.php'; +$array['dashboard'][$x]['dashboard_path'] = 'call_forward/call_forward'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-forward'; $array['dashboard'][$x]['dashboard_url'] = '/app/call_forward/call_forward.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; diff --git a/app/conference_centers/resources/dashboard/config.php b/app/conference_centers/resources/dashboard/config.php index 8d34bc4175..f9fd79b610 100644 --- a/app/conference_centers/resources/dashboard/config.php +++ b/app/conference_centers/resources/dashboard/config.php @@ -3,7 +3,7 @@ //conference centers icon $array['dashboard'][$x]['dashboard_uuid'] = 'd1b26c96-6cfd-45ea-824f-0b5e16a9aab9'; $array['dashboard'][$x]['dashboard_name'] = 'Conference Centers'; -$array['dashboard'][$x]['dashboard_path'] = 'core/dashboard/resources/dashboard/icon.php'; +$array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-hotel'; $array['dashboard'][$x]['dashboard_url'] = '/app/conference_centers/conference_rooms.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; diff --git a/app/conferences/resources/dashboard/config.php b/app/conferences/resources/dashboard/config.php index 7739d9f5ec..9a620b5247 100644 --- a/app/conferences/resources/dashboard/config.php +++ b/app/conferences/resources/dashboard/config.php @@ -3,7 +3,7 @@ //conferences icon $array['dashboard'][$x]['dashboard_uuid'] = 'c3c37d29-b654-4024-8ee4-d752b3e4db46'; $array['dashboard'][$x]['dashboard_name'] = 'Conferences'; -$array['dashboard'][$x]['dashboard_path'] = 'core/dashboard/resources/dashboard/icon.php'; +$array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-comments'; $array['dashboard'][$x]['dashboard_url'] = '/app/conferences/conferences.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; diff --git a/app/destinations/resources/dashboard/config.php b/app/destinations/resources/dashboard/config.php index 23ed13eced..dcb4590bd7 100644 --- a/app/destinations/resources/dashboard/config.php +++ b/app/destinations/resources/dashboard/config.php @@ -3,7 +3,7 @@ //destinations icon $array['dashboard'][$x]['dashboard_uuid'] = 'a294b771-a125-4d36-b51a-973540346fad'; $array['dashboard'][$x]['dashboard_name'] = 'Destinations'; -$array['dashboard'][$x]['dashboard_path'] = 'core/dashboard/resources/dashboard/icon.php'; +$array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-solid fa-right-to-bracket'; $array['dashboard'][$x]['dashboard_url'] = '/app/destinations/destinations.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; diff --git a/app/devices/resources/dashboard/config.php b/app/devices/resources/dashboard/config.php index 892d4738e8..4dae6d4201 100644 --- a/app/devices/resources/dashboard/config.php +++ b/app/devices/resources/dashboard/config.php @@ -2,7 +2,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = 'f1c722d5-b714-4fa2-9664-5f6d24d44661'; $array['dashboard'][$x]['dashboard_name'] = 'Device Keys'; -$array['dashboard'][$x]['dashboard_path'] = 'app/devices/resources/dashboard/device_keys.php'; +$array['dashboard'][$x]['dashboard_path'] = 'devices/device_keys'; $array['dashboard'][$x]['dashboard_order'] = '150'; $array['dashboard'][$x]['dashboard_enabled'] = 'false'; $array['dashboard'][$x]['dashboard_description'] = ''; diff --git a/app/domain_limits/resources/dashboard/config.php b/app/domain_limits/resources/dashboard/config.php index 3980870edc..caf4077d17 100644 --- a/app/domain_limits/resources/dashboard/config.php +++ b/app/domain_limits/resources/dashboard/config.php @@ -2,7 +2,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = '2f7a90cc-8d60-4df4-98ee-2ef4000afac7'; $array['dashboard'][$x]['dashboard_name'] = 'Domain Limits'; -$array['dashboard'][$x]['dashboard_path'] = 'app/domain_limits/resources/dashboard/domain_limits.php'; +$array['dashboard'][$x]['dashboard_path'] = 'domain_limits/domain_limits'; $array['dashboard'][$x]['dashboard_order'] = '120'; $array['dashboard'][$x]['dashboard_enabled'] = 'false'; $array['dashboard'][$x]['dashboard_description'] = ''; diff --git a/app/extensions/resources/dashboard/config.php b/app/extensions/resources/dashboard/config.php index df4fb16ea0..95037aae9b 100644 --- a/app/extensions/resources/dashboard/config.php +++ b/app/extensions/resources/dashboard/config.php @@ -2,7 +2,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = '3bac3209-2f51-47db-b5fe-a1a804f49da9'; $array['dashboard'][$x]['dashboard_name'] = 'Caller ID'; -$array['dashboard'][$x]['dashboard_path'] = 'app/extensions/resources/dashboard/caller_id.php'; +$array['dashboard'][$x]['dashboard_path'] = 'extensions/caller_id'; $array['dashboard'][$x]['dashboard_order'] = '160'; $array['dashboard'][$x]['dashboard_enabled'] = 'false'; $array['dashboard'][$x]['dashboard_description'] = ''; @@ -23,7 +23,7 @@ $x++; //extensions icon $array['dashboard'][$x]['dashboard_uuid'] = '4b7b6652-7e5f-48d3-987e-971053f093a7'; $array['dashboard'][$x]['dashboard_name'] = 'Extensions'; -$array['dashboard'][$x]['dashboard_path'] = 'core/dashboard/resources/dashboard/icon.php'; +$array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-suitcase'; $array['dashboard'][$x]['dashboard_url'] = '/app/extensions/extensions.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; diff --git a/app/ivr_menus/resources/dashboard/config.php b/app/ivr_menus/resources/dashboard/config.php index e8e9a39eae..feae19b377 100644 --- a/app/ivr_menus/resources/dashboard/config.php +++ b/app/ivr_menus/resources/dashboard/config.php @@ -3,7 +3,7 @@ //ivr menus icon $array['dashboard'][$x]['dashboard_uuid'] = '3af7af65-7861-4d05-a0bc-36d704458fa0'; $array['dashboard'][$x]['dashboard_name'] = 'IVR Menus'; -$array['dashboard'][$x]['dashboard_path'] = 'core/dashboard/resources/dashboard/icon.php'; +$array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-solid fa-diagram-project'; $array['dashboard'][$x]['dashboard_url'] = '/app/ivr_menus/ivr_menus.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; diff --git a/app/recordings/resources/dashboard/config.php b/app/recordings/resources/dashboard/config.php index 2b3aeddbdd..9c2779bda0 100644 --- a/app/recordings/resources/dashboard/config.php +++ b/app/recordings/resources/dashboard/config.php @@ -3,7 +3,7 @@ //time conditions icon $array['dashboard'][$x]['dashboard_uuid'] = '3d8efe65-49c3-4783-844e-4ebc1c97db68'; $array['dashboard'][$x]['dashboard_name'] = 'Recordings'; -$array['dashboard'][$x]['dashboard_path'] = 'core/dashboard/resources/dashboard/icon.php'; +$array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-microphone'; $array['dashboard'][$x]['dashboard_url'] = '/app/recordings/recordings.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; diff --git a/app/ring_groups/resources/dashboard/config.php b/app/ring_groups/resources/dashboard/config.php index 1029417e3b..4f01c0a531 100644 --- a/app/ring_groups/resources/dashboard/config.php +++ b/app/ring_groups/resources/dashboard/config.php @@ -3,7 +3,7 @@ //ring group forward $array['dashboard'][$x]['dashboard_uuid'] = 'b5da1d72-2cc7-422e-b05c-f07659aed419'; $array['dashboard'][$x]['dashboard_name'] = 'Ring Group Forward'; -$array['dashboard'][$x]['dashboard_path'] = 'app/ring_groups/resources/dashboard/ring_group_forward.php'; +$array['dashboard'][$x]['dashboard_path'] = 'ring_groups/ring_group_forward'; $array['dashboard'][$x]['dashboard_icon'] = ''; $array['dashboard'][$x]['dashboard_url'] = ''; $array['dashboard'][$x]['dashboard_target'] = 'self'; diff --git a/app/switch/resources/dashboard/config.php b/app/switch/resources/dashboard/config.php index efb1070e47..358cdf3422 100644 --- a/app/switch/resources/dashboard/config.php +++ b/app/switch/resources/dashboard/config.php @@ -3,7 +3,7 @@ $x++; $array['dashboard'][$x]['dashboard_uuid'] = 'b9d92260-eaf7-4c05-a51e-3083e25516b3'; $array['dashboard'][$x]['dashboard_name'] = 'Switch Status'; -$array['dashboard'][$x]['dashboard_path'] = 'app/switch/resources/dashboard/switch_status.php'; +$array['dashboard'][$x]['dashboard_path'] = 'switch/switch_status'; $array['dashboard'][$x]['dashboard_order'] = '105'; $array['dashboard'][$x]['dashboard_enabled'] = 'false'; $array['dashboard'][$x]['dashboard_description'] = 'Switch details such as version, uptime, channels and registrations.'; diff --git a/app/system/resources/dashboard/config.php b/app/system/resources/dashboard/config.php index 8cde3f696e..dea09983f2 100644 --- a/app/system/resources/dashboard/config.php +++ b/app/system/resources/dashboard/config.php @@ -3,7 +3,7 @@ $x++; $array['dashboard'][$x]['dashboard_uuid'] = 'c9b1f67a-d78a-4299-a16e-594a4b7cd246'; $array['dashboard'][$x]['dashboard_name'] = 'System Status'; -$array['dashboard'][$x]['dashboard_path'] = 'app/system/resources/dashboard/system_status.php'; +$array['dashboard'][$x]['dashboard_path'] = 'system/system_status'; $array['dashboard'][$x]['dashboard_order'] = '90'; $array['dashboard'][$x]['dashboard_enabled'] = 'true'; $array['dashboard'][$x]['dashboard_description'] = 'System information like Disk usage.'; @@ -15,7 +15,7 @@ $x++; $array['dashboard'][$x]['dashboard_uuid'] = 'beade936-846b-4f02-986c-a2de6fa762c2'; $array['dashboard'][$x]['dashboard_name'] = 'System CPU Status'; -$array['dashboard'][$x]['dashboard_path'] = 'app/system/resources/dashboard/system_cpu_status.php'; +$array['dashboard'][$x]['dashboard_path'] = 'system/system_cpu_status'; $array['dashboard'][$x]['dashboard_order'] = '100'; $array['dashboard'][$x]['dashboard_enabled'] = 'true'; $array['dashboard'][$x]['dashboard_description'] = 'System CPU information.'; @@ -27,7 +27,7 @@ $x++; $array['dashboard'][$x]['dashboard_uuid'] = 'bb76f7fc-669f-41dd-a636-6ddaee5deae1'; $array['dashboard'][$x]['dashboard_name'] = 'System Counts'; -$array['dashboard'][$x]['dashboard_path'] = 'app/system/resources/dashboard/system_counts.php'; +$array['dashboard'][$x]['dashboard_path'] = 'system/system_counts'; $array['dashboard'][$x]['dashboard_order'] = '110'; $array['dashboard'][$x]['dashboard_enabled'] = 'true'; $array['dashboard'][$x]['dashboard_description'] = 'A list of showing the count of active and inactive domains, devices, extensions, gateways, users, desttinations, ring groups and more'; diff --git a/app/time_conditions/resources/dashboard/config.php b/app/time_conditions/resources/dashboard/config.php index 985349d7f2..d0bbe04dea 100644 --- a/app/time_conditions/resources/dashboard/config.php +++ b/app/time_conditions/resources/dashboard/config.php @@ -3,7 +3,7 @@ //time conditions icon $array['dashboard'][$x]['dashboard_uuid'] = 'e9f06ed4-ddfc-4611-b246-fdeab36a49ca'; $array['dashboard'][$x]['dashboard_name'] = 'Time Conditions'; -$array['dashboard'][$x]['dashboard_path'] = 'core/dashboard/resources/dashboard/icon.php'; +$array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-clock'; $array['dashboard'][$x]['dashboard_url'] = '/app/time_conditions/time_conditions.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; diff --git a/app/voicemails/resources/dashboard/config.php b/app/voicemails/resources/dashboard/config.php index db3a0ad794..48eccfa838 100644 --- a/app/voicemails/resources/dashboard/config.php +++ b/app/voicemails/resources/dashboard/config.php @@ -3,7 +3,7 @@ //new messages $array['dashboard'][$x]['dashboard_uuid'] = 'be2aaa22-d8f1-4d9b-b5f9-14a26da329cb'; $array['dashboard'][$x]['dashboard_name'] = 'New Messages'; -$array['dashboard'][$x]['dashboard_path'] = 'app/voicemails/resources/dashboard/voicemails.php'; +$array['dashboard'][$x]['dashboard_path'] = 'voicemails/voicemails'; $array['dashboard'][$x]['dashboard_icon'] = ''; $array['dashboard'][$x]['dashboard_url'] = ''; $array['dashboard'][$x]['dashboard_target'] = ''; @@ -47,7 +47,7 @@ $x++; //voicemails icon $array['dashboard'][$x]['dashboard_uuid'] = '230f2857-f14a-44cd-9c33-577f26a5ce45'; $array['dashboard'][$x]['dashboard_name'] = 'Voicemails'; -$array['dashboard'][$x]['dashboard_path'] = 'core/dashboard/resources/dashboard/icon.php'; +$array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-envelope'; $array['dashboard'][$x]['dashboard_url'] = '/app/voicemails/voicemails.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; diff --git a/app/xml_cdr/resources/dashboard/config.php b/app/xml_cdr/resources/dashboard/config.php index f0239deebc..778ae30980 100644 --- a/app/xml_cdr/resources/dashboard/config.php +++ b/app/xml_cdr/resources/dashboard/config.php @@ -3,7 +3,7 @@ //missed calls $array['dashboard'][$x]['dashboard_uuid'] = '6ad0e056-bf3d-465a-956d-bd77d513ab36'; $array['dashboard'][$x]['dashboard_name'] = 'Missed Calls'; -$array['dashboard'][$x]['dashboard_path'] = 'app/xml_cdr/resources/dashboard/missed_calls.php'; +$array['dashboard'][$x]['dashboard_path'] = 'xml_cdr/missed_calls'; $array['dashboard'][$x]['dashboard_icon'] = ''; $array['dashboard'][$x]['dashboard_url'] = ''; $array['dashboard'][$x]['dashboard_target'] = ''; @@ -47,7 +47,7 @@ $x++; //recent calls $array['dashboard'][$x]['dashboard_uuid'] = 'c323e296-b1cf-42ea-9c57-fc00697915b7'; $array['dashboard'][$x]['dashboard_name'] = 'Recent Calls'; -$array['dashboard'][$x]['dashboard_path'] = 'app/xml_cdr/resources/dashboard/recent_calls.php'; +$array['dashboard'][$x]['dashboard_path'] = 'xml_cdr/recent_calls'; $array['dashboard'][$x]['dashboard_icon'] = ''; $array['dashboard'][$x]['dashboard_url'] = ''; $array['dashboard'][$x]['dashboard_target'] = ''; @@ -91,7 +91,7 @@ $x++; //call detail records icon $array['dashboard'][$x]['dashboard_uuid'] = '7fb8c79b-3fc4-4977-992a-eb0404f80fe8'; $array['dashboard'][$x]['dashboard_name'] = 'Call Detail Records'; -$array['dashboard'][$x]['dashboard_path'] = 'core/dashboard/resources/dashboard/icon.php'; +$array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-list-ul'; $array['dashboard'][$x]['dashboard_url'] = '/app/xml_cdr/xml_cdr.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; diff --git a/core/dashboard/app_defaults.php b/core/dashboard/app_defaults.php index fcde8fe290..a79940eee8 100644 --- a/core/dashboard/app_defaults.php +++ b/core/dashboard/app_defaults.php @@ -118,6 +118,9 @@ if ($domains_processed == 1) { //update dashboard icons to be prefixed with v6.x font awesome style class name (e.g. 'fa-solid ') $queries[] = "update v_dashboard set dashboard_icon = concat('fa-solid ', dashboard_icon) where dashboard_icon is not null and dashboard_icon not like 'fa-solid fa-%' and dashboard_icon not like 'fa-regular fa-%' and dashboard_icon not like 'fa-brands fa-%' "; + //simplify the dashboard path + $queries[] = "update v_dashboard set dashboard_path = regexp_replace(dashboard_path, 'app/|core/|resources/dashboard/|\.php', '', 'g') where dashboard_path like '%.php';"; + //execute array of queries foreach ($queries as $sql) { $database = new database; @@ -128,3 +131,4 @@ if ($domains_processed == 1) { } ?> + diff --git a/core/dashboard/dashboard_edit.php b/core/dashboard/dashboard_edit.php index caeb9b8dbf..9a131383fe 100644 --- a/core/dashboard/dashboard_edit.php +++ b/core/dashboard/dashboard_edit.php @@ -44,7 +44,7 @@ //set the defaults $dashboard_name = ''; - $dashboard_path = '/core/dashboard/resources/dashboard/icon.php'; + $dashboard_path = 'dashboard/icon'; //$dashboard_path = ''; $dashboard_icon = ''; $dashboard_url = ''; @@ -479,11 +479,11 @@ //adjust form by type entered echo "