From 729b3bf314ac256fc5746cfb665f31d55d4ed3b1 Mon Sep 17 00:00:00 2001 From: Alex <40072887+alexdcrane@users.noreply.github.com> Date: Fri, 17 Oct 2025 16:01:39 -0700 Subject: [PATCH] Fix widget name setting not being used on some widget labels (#7582) * Fix widget name setting not being used on some widget labels * Update app_languages.php * Add translations for active calls labels and titles * Update active_calls.php * Update call_forward.php * Update device_keys.php * Add multi-lingual support for widget labels Updated widget label to support multi-lingual text. * Update caller_id.php * Add multilingual support and update widget label * Update switch_status.php * Update system_counts.php * Replace static title with localized widget label Updated widget title to use localized label. * Add multilingual support for disk usage widget * Add translations for system disk usage labels * Update system_status.php * Update system_network_status.php * Add multi-lingual support for CPU status widget * Update app_languages.php * Update app_languages.php * Update voicemails.php * Add multi-lingual support for missed calls widget * Update recent_calls.php * Simplify widget label assignment using null coalescing * Update call_center_agents.php * Update app_languages.php --- app/active_calls/app_languages.php | 26 +++++ .../resources/dashboard/active_calls.php | 8 +- app/call_centers/app_languages.php | 26 +++++ .../dashboard/call_center_agents.php | 8 +- .../resources/dashboard/call_forward.php | 8 +- .../resources/dashboard/device_keys.php | 8 +- .../resources/dashboard/domain_limits.php | 8 +- .../resources/dashboard/caller_id.php | 8 +- .../dashboard/ring_group_forward.php | 10 +- .../resources/dashboard/switch_status.php | 8 +- app/system/app_languages.php | 104 ++++++++++++++++++ .../resources/dashboard/system_counts.php | 8 +- .../resources/dashboard/system_cpu_status.php | 8 +- .../resources/dashboard/system_disk_usage.php | 8 +- .../dashboard/system_network_status.php | 8 +- .../resources/dashboard/system_services.php | 8 +- .../resources/dashboard/system_status.php | 12 +- .../resources/dashboard/voicemails.php | 8 +- .../resources/dashboard/missed_calls.php | 8 +- .../resources/dashboard/recent_calls.php | 8 +- core/domains/resources/dashboard/domains.php | 5 +- core/user_settings/app_languages.php | 52 ++++----- 22 files changed, 305 insertions(+), 50 deletions(-) diff --git a/app/active_calls/app_languages.php b/app/active_calls/app_languages.php index 4dec946e63..c56bb4d51b 100644 --- a/app/active_calls/app_languages.php +++ b/app/active_calls/app_languages.php @@ -52,6 +52,32 @@ $text['title']['zh-cn'] = "主动通话"; $text['title']['ja-jp'] = "アクティブな通話"; $text['title']['ko-kr'] = "활성 통화"; +$text['label-active_calls']['en-us'] = "Active Calls"; +$text['label-active_calls']['en-gb'] = "Active Calls"; +$text['label-active_calls']['ar-eg'] = "المكالمات النشطة"; +$text['label-active_calls']['de-at'] = "Aktive Gespräche"; +$text['label-active_calls']['de-ch'] = "Aktive Gespräche"; +$text['label-active_calls']['de-de'] = "Aktive Gespräche"; +$text['label-active_calls']['el-gr'] = "Ενεργές κλήσεις"; +$text['label-active_calls']['es-cl'] = "Llamadas Activas"; +$text['label-active_calls']['es-mx'] = "Llamadas Activas"; +$text['label-active_calls']['fr-ca'] = "Communications Actives"; +$text['label-active_calls']['fr-fr'] = "Communications Actives"; +$text['label-active_calls']['he-il'] = "הגדרת חשבון"; +$text['label-active_calls']['it-it'] = "Chiamate Attive"; +$text['label-active_calls']['ka-ge'] = "აქტიური ზარები"; +$text['label-active_calls']['nl-nl'] = "Aktieve gesprekken"; +$text['label-active_calls']['pl-pl'] = "Aktywne Rozmowy"; +$text['label-active_calls']['pt-br'] = "Configurações da Conta"; +$text['label-active_calls']['pt-pt'] = "Chamadas Ativas"; +$text['label-active_calls']['ro-ro'] = "Apeluri active"; +$text['label-active_calls']['ru-ru'] = "Активные вызовы"; +$text['label-active_calls']['sv-se'] = "Aktiva Samtal"; +$text['label-active_calls']['uk-ua'] = "Активні дзвінки"; +$text['label-active_calls']['zh-cn'] = "主动通话"; +$text['label-active_calls']['ja-jp'] = "アクティブな通話"; +$text['label-active_calls']['ko-kr'] = "활성 통화"; + $text['label-time']['en-us'] = "Time"; $text['label-time']['en-gb'] = "Time"; $text['label-time']['ar-eg'] = "وقت"; diff --git a/app/active_calls/resources/dashboard/active_calls.php b/app/active_calls/resources/dashboard/active_calls.php index 9055dc2b0d..374cffa2e5 100644 --- a/app/active_calls/resources/dashboard/active_calls.php +++ b/app/active_calls/resources/dashboard/active_calls.php @@ -43,9 +43,15 @@ $row_style["1"] = "row_style1"; //set the dashboard icon to a solid color phone $widget_icon = 'fa-solid fa-phone'; +//convert to a key +$widget_key = str_replace(' ', '_', strtolower($widget_name)); + //add multi-lingual support $text = (new text)->get($settings->get('domain', 'language', 'en-us'), 'app/active_calls'); +//get the dashboard label +$widget_label = $text['label-'.$widget_key] ?? $widget_name; + //show the widget echo "
\n"; @@ -64,7 +70,7 @@ $row_style["1"] = "row_style1"; //icon and count echo "
\n"; - echo "".$text['title']."\n"; + echo "".escape($widget_label)."\n"; echo "
\n"; echo "\n"; echo "0\n"; diff --git a/app/call_centers/app_languages.php b/app/call_centers/app_languages.php index bab0b65ba9..7de3874c63 100644 --- a/app/call_centers/app_languages.php +++ b/app/call_centers/app_languages.php @@ -3848,4 +3848,30 @@ $text['button-wallboard']['zh-cn'] = "墙板"; $text['button-wallboard']['ja-jp'] = "ウォールボード"; $text['button-wallboard']['ko-kr'] = "벽판"; +$text['label-call_center_agents']['en-us'] = "Call Center Queues"; +$text['label-call_center_agents']['en-gb'] = "Call Center Queues"; +$text['label-call_center_agents']['ar-eg'] = "قوائم انتظار مركز الاتصال"; +$text['label-call_center_agents']['de-at'] = "Callcenter Warteschlangen"; +$text['label-call_center_agents']['de-ch'] = "Callcenter Warteschlangen"; +$text['label-call_center_agents']['de-de'] = "Callcenter Warteschlangen"; +$text['label-call_center_agents']['el-gr'] = "Ουρές τηλεφωνικών κέντρων"; +$text['label-call_center_agents']['es-cl'] = "Colas de Centro de Llamados"; +$text['label-call_center_agents']['es-mx'] = "Colas de Centro de Llamados"; +$text['label-call_center_agents']['fr-ca'] = "File d'attente du centre d'appels"; +$text['label-call_center_agents']['fr-fr'] = "File d'attente du centre d'appels"; +$text['label-call_center_agents']['he-il'] = "תורים למוקד טלפוני"; +$text['label-call_center_agents']['it-it'] = "Code del Call Center"; +$text['label-call_center_agents']['ka-ge'] = "ქოლცენტრის რიგები"; +$text['label-call_center_agents']['nl-nl'] = "Call-Center wachtrij"; +$text['label-call_center_agents']['pl-pl'] = "Kolejki w Call Center "; +$text['label-call_center_agents']['pt-br'] = "Filas do call center"; +$text['label-call_center_agents']['pt-pt'] = "Filas do Call Center"; +$text['label-call_center_agents']['ro-ro'] = "Cozi la Call Center"; +$text['label-call_center_agents']['ru-ru'] = "Очереди Колл-центра"; +$text['label-call_center_agents']['sv-se'] = "Callcenter Kö:er"; +$text['label-call_center_agents']['uk-ua'] = "Черги кол-центру"; +$text['label-call_center_agents']['zh-cn'] = "呼叫中心队列"; +$text['label-call_center_agents']['ja-jp'] = "コールセンターの待ち行列"; +$text['label-call_center_agents']['ko-kr'] = "콜센터 대기열"; + ?> diff --git a/app/call_centers/resources/dashboard/call_center_agents.php b/app/call_centers/resources/dashboard/call_center_agents.php index f7f781d62d..29c4295e0e 100644 --- a/app/call_centers/resources/dashboard/call_center_agents.php +++ b/app/call_centers/resources/dashboard/call_center_agents.php @@ -37,10 +37,16 @@ exit; } +//convert to a key + $widget_key = str_replace(' ', '_', strtolower($widget_name)); + //add multi-lingual support $language = new text; $text = $language->get($settings->get('domain', 'language', 'en-us'), 'app/call_centers'); +//get the dashboard label + $widget_label = $text['label-'.$widget_key] ?? $widget_name; + //get http variables and set as php variables $order_by = $_GET["order_by"] ?? null; $order = $_GET["order"] ?? null; @@ -255,7 +261,7 @@ echo "
\n"; echo "
\n"; - echo "
".$text['header-call_center_queues'].(!empty($agent['agent_name']) ? "    Agent: ".$agent['agent_name']."" : "")."
\n"; + echo "
".escape($widget_label).(!empty($agent['agent_name']) ? "    Agent: ".$agent['agent_name']."" : "")."
\n"; echo "
\n"; echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$settings->get('theme', 'button_icon_save'),'collapse'=>false,'onclick'=>"document.getElementById('form_list_call_center_agent_dashboard').submit();"]); echo "
\n"; diff --git a/app/call_forward/resources/dashboard/call_forward.php b/app/call_forward/resources/dashboard/call_forward.php index f7da9d6160..5a21419778 100644 --- a/app/call_forward/resources/dashboard/call_forward.php +++ b/app/call_forward/resources/dashboard/call_forward.php @@ -13,10 +13,16 @@ exit; } +//convert to a key + $widget_key = str_replace(' ', '_', strtolower($widget_name)); + //add multi-lingual support $language = new text; $text = $language->get($settings->get('domain', 'language', 'en-us'), 'app/call_forward'); +//get the dashboard label + $widget_label = $text['header-'.$widget_key] ?? $widget_name; + //extensions link $extension_link = '#'; if (permission_exists('extension_view')) { @@ -97,7 +103,7 @@ echo "
\n"; echo "
\n"; - echo " ".$text['header-call_forward']."\n"; + echo " ".escape($widget_label)."\n"; //doughnut chart if (empty($widget_chart_type) || $widget_chart_type == "doughnut") { diff --git a/app/devices/resources/dashboard/device_keys.php b/app/devices/resources/dashboard/device_keys.php index 57cd92ea93..1202b8d65b 100644 --- a/app/devices/resources/dashboard/device_keys.php +++ b/app/devices/resources/dashboard/device_keys.php @@ -26,10 +26,16 @@ require_once dirname(__DIR__, 4) . "/resources/require.php"; require_once "resources/check_auth.php"; +//convert to a key + $widget_key = str_replace(' ', '_', strtolower($widget_name)); + //add multi-lingual support $language = new text; $text = $language->get($settings->get('domain', 'language', 'en-us'), 'app/devices'); +//get the dashboard label + $widget_label = $text['title-'.$widget_key] ?? $widget_name; + //get the vendor functions $sql = "select v.name as vendor_name, f.type, f.value "; $sql .= "from v_device_vendors as v, v_device_vendor_functions as f "; @@ -424,7 +430,7 @@ echo "
\n"; echo "
\n"; - echo "
".$text['title-device_keys']."
\n"; + echo "
".escape($widget_label)."
\n"; echo "
\n"; echo button::create(['type'=>'button','label'=>$text['button-apply'],'icon'=>$settings->get('theme', 'button_icon_save'),'collapse'=>false,'onclick'=>"document.location.href='".PROJECT_PATH."/app/devices/cmd.php?cmd=check_sync&profile=".$sip_profile_name."&user=".($user_id ?? '')."@".($server_address ?? '')."&domain=".($server_address ?? '')."&agent=".($device_key_vendor ?? '')."';"]); echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$settings->get('theme', 'button_icon_save'),'collapse'=>false,'onclick'=>"list_form_submit('form_list_device_keys');"]); diff --git a/app/domain_limits/resources/dashboard/domain_limits.php b/app/domain_limits/resources/dashboard/domain_limits.php index 2403f9ec93..e8802afa10 100644 --- a/app/domain_limits/resources/dashboard/domain_limits.php +++ b/app/domain_limits/resources/dashboard/domain_limits.php @@ -37,10 +37,16 @@ exit; } +//convert to a key + $widget_key = str_replace(' ', '_', strtolower($widget_name)); + //add multi-lingual support $language = new text; $text = $language->get($settings->get('domain', 'language', 'en-us'), 'core/user_settings'); +//get the dashboard label + $widget_label = $text['label-'.$widget_key] ?? $widget_name; + //clear initial stat unset($hud_stat); @@ -102,7 +108,7 @@ } echo "
\n"; - echo " ".$text['label-domain_limits']."\n"; + echo " ".escape($widget_label)."\n"; //doughnut chart if (!isset($widget_chart_type) || $widget_chart_type == "doughnut") { diff --git a/app/extensions/resources/dashboard/caller_id.php b/app/extensions/resources/dashboard/caller_id.php index 0e3eff60ce..126ce00f91 100644 --- a/app/extensions/resources/dashboard/caller_id.php +++ b/app/extensions/resources/dashboard/caller_id.php @@ -31,10 +31,16 @@ //check permissions if (permission_exists('extension_caller_id')) { + //convert to a key + $widget_key = str_replace(' ', '_', strtolower($widget_name)); + //add multi-lingual support $language = new text; $text = $language->get($settings->get('domain', 'language', 'en-us'), 'app/extensions'); + //get the dashboard label + $widget_label = $text['label-'.$widget_key] ?? $widget_name; + //add or update the database if (isset($_POST['extensions']) && is_array($_POST['extensions']) && @sizeof($_POST['extensions']) != 0) { @@ -166,7 +172,7 @@ echo "
\n"; echo "
\n"; - echo " ".$text['label-caller_id_number']."\n"; + echo " ".escape($widget_label).""; //doughnut chart if (!isset($widget_chart_type) || $widget_chart_type == "doughnut") { diff --git a/app/ring_groups/resources/dashboard/ring_group_forward.php b/app/ring_groups/resources/dashboard/ring_group_forward.php index 9aba8cc16a..991e31c4a8 100644 --- a/app/ring_groups/resources/dashboard/ring_group_forward.php +++ b/app/ring_groups/resources/dashboard/ring_group_forward.php @@ -28,10 +28,16 @@ //includes files require_once dirname(__DIR__, 4) . "/resources/require.php"; +//convert to a key + $widget_key = str_replace(' ', '_', strtolower($widget_name)); + //add multi-lingual support $language = new text; $text = $language->get($settings->get('domain', 'language', 'en-us'), 'app/ring_groups'); +//get the dashboard label + $widget_label = $text['header-'.$widget_key] ?? $widget_name; + //get the list if (permission_exists('ring_group_add') || permission_exists('ring_group_edit')) { $domain_uuid = $_SESSION['domain_uuid']; @@ -147,7 +153,7 @@ echo "
\n"; echo "
\n"; - echo " ".$text['header-ring-group-forward']."\n"; + echo " ".escape($widget_label)."\n"; //doughnut chart if (empty($widget_chart_type) ||$widget_chart_type == "doughnut") { @@ -295,4 +301,4 @@ } echo "
\n"; -?> \ No newline at end of file +?> diff --git a/app/switch/resources/dashboard/switch_status.php b/app/switch/resources/dashboard/switch_status.php index 6a0e7628a9..e7bc5677d6 100644 --- a/app/switch/resources/dashboard/switch_status.php +++ b/app/switch/resources/dashboard/switch_status.php @@ -13,10 +13,16 @@ //access granted } +//convert to a key + $widget_key = str_replace(' ', '_', strtolower($widget_name)); + //add multi-lingual support $language = new text; $text = $language->get($settings->get('domain', 'language', 'en-us'), 'app/switch'); +//get the dashboard label + $widget_label = $text['label-'.$widget_key] ?? $widget_name; + //switch status echo "
\n"; @@ -78,7 +84,7 @@ //show the content echo "
\n"; - echo " ".$text['label-switch_status']."\n"; + echo " ".escape($widget_label)."\n"; if (!isset($widget_chart_type) || $widget_chart_type == "doughnut") { //add doughnut chart diff --git a/app/system/app_languages.php b/app/system/app_languages.php index 26a7185f7d..e5f9915f10 100644 --- a/app/system/app_languages.php +++ b/app/system/app_languages.php @@ -1047,4 +1047,108 @@ $text['label-json']['zh-cn'] = "JSON"; $text['label-json']['ja-jp'] = "JSON"; $text['label-json']['ko-kr'] = "JSON"; +$text['label-system_cpu_usage']['en-us'] = "CPU Usage"; +$text['label-system_cpu_usage']['en-gb'] = "CPU Usage"; +$text['label-system_cpu_usage']['ar-eg'] = "معالج الاستخدام"; +$text['label-system_cpu_usage']['de-at'] = "Prozessorauslastung "; +$text['label-system_cpu_usage']['de-ch'] = "Prozessorauslastung "; +$text['label-system_cpu_usage']['de-de'] = "Prozessorauslastung "; +$text['label-system_cpu_usage']['el-gr'] = "Χρήση επεξεργαστή"; +$text['label-system_cpu_usage']['el-gr'] = "Χρήση CPU"; +$text['label-system_cpu_usage']['es-cl'] = "uso del procesador"; +$text['label-system_cpu_usage']['es-mx'] = "uso del procesador"; +$text['label-system_cpu_usage']['fr-ca'] = "processeur Utilisation"; +$text['label-system_cpu_usage']['fr-fr'] = "processeur Utilisation"; +$text['label-system_cpu_usage']['he-il'] = "שימוש מעבד"; +$text['label-system_cpu_usage']['it-it'] = "Uso CPU"; +$text['label-system_cpu_usage']['ka-ge'] = "CPU-ის დატვირთვა"; +$text['label-system_cpu_usage']['nl-nl'] = "CPU gebruik"; +$text['label-system_cpu_usage']['pl-pl'] = "Wykorzystanie procesora"; +$text['label-system_cpu_usage']['pt-br'] = "Uso do processador"; +$text['label-system_cpu_usage']['pt-pt'] = "O uso do processador"; +$text['label-system_cpu_usage']['ro-ro'] = "procesor de utilizare"; +$text['label-system_cpu_usage']['ru-ru'] = "Использование CPU"; +$text['label-system_cpu_usage']['sv-se'] = "processor Usage"; +$text['label-system_cpu_usage']['uk-ua'] = "Використання процесора"; +$text['label-system_cpu_usage']['tr-tr'] = "CPU kullanımı"; +$text['label-system_cpu_usage']['zh-cn'] = "CPU使用率"; +$text['label-system_cpu_usage']['ja-jp'] = "CPU使用率"; +$text['label-system_cpu_usage']['ko-kr'] = "CPU 사용량"; + +$text['label-system_network_status']['en-us'] = "System Network Status"; +$text['label-system_network_status']['en-gb'] = "System Network Status"; +$text['label-system_network_status']['ar-eg'] = "حالة الشبكة النظامية"; +$text['label-system_network_status']['de-at'] = "System-Netzwerkstatus"; +$text['label-system_network_status']['de-ch'] = "System-Netzwerkstatus"; +$text['label-system_network_status']['de-de'] = "System-Netzwerkstatus"; +$text['label-system_network_status']['es-cl'] = "Estado de la red del sistema"; +$text['label-system_network_status']['es-mx'] = "Estado de la Red del Sistema"; +$text['label-system_network_status']['fr-ca'] = "État du réseau système"; +$text['label-system_network_status']['fr-fr'] = "État du réseau système"; +$text['label-system_network_status']['he-il'] = "מצב הרשת של המערכת"; +$text['label-system_network_status']['it-it'] = "Stato della rete di sistema"; +$text['label-system_network_status']['ka-ge'] = "სისტემის ქსელის სტატუსი"; +$text['label-system_network_status']['nl-nl'] = "Systeem Netwerkstatus"; +$text['label-system_network_status']['pl-pl'] = "Stan Sieci Systemowej"; +$text['label-system_network_status']['pt-br'] = "Status da Rede do Sistema"; +$text['label-system_network_status']['pt-pt'] = "Estado da Rede do Sistema"; +$text['label-system_network_status']['ro-ro'] = "Starea rețelei de sistem"; +$text['label-system_network_status']['ru-ru'] = "Состояние системной сети"; +$text['label-system_network_status']['sv-se'] = "Systemets nätverkstatus"; +$text['label-system_network_status']['uk-ua'] = "Стан мережі системи"; +$text['label-system_network_status']['zh-cn'] = "系统网络状态"; +$text['label-system_network_status']['ja-jp'] = "システムネットワークステータス"; +$text['label-system_network_status']['ko-kr'] = "시스템 네트워크 상태"; + +$text['label-system_services']['en-us'] = "System Services"; +$text['label-system_services']['en-gb'] = "System Services"; +$text['label-system_services']['ar-eg'] = "خدمات النظام"; +$text['label-system_services']['de-at'] = "Systemdienste"; +$text['label-system_services']['de-ch'] = "Systemdienste"; +$text['label-system_services']['de-de'] = "Systemdienste"; +$text['label-system_services']['es-cl'] = "Servicios del sistema"; +$text['label-system_services']['es-mx'] = "Servicios del sistema"; +$text['label-system_services']['fr-ca'] = "Services du système"; +$text['label-system_services']['fr-fr'] = "Services du système"; +$text['label-system_services']['he-il'] = "خدمות מערכת"; +$text['label-system_services']['it-it'] = "Servizi di sistema"; +$text['label-system_services']['ka-ge'] = "სიستემური სერვისები"; +$text['label-system_services']['nl-nl'] = "Systeemservices"; +$text['label-system_services']['pl-pl'] = "Usługi systemowe"; +$text['label-system_services']['pt-br'] = "Serviços do sistema"; +$text['label-system_services']['pt-pt'] = "Serviços do sistema"; +$text['label-system_services']['ro-ro'] = "Serviciile de sistem"; +$text['label-system_services']['ru-ru'] = "Системные службы"; +$text['label-system_services']['sv-se'] = "Systemtjänster"; +$text['label-system_services']['uk-ua'] = "Системні служби"; +$text['label-system_services']['zh-cn'] = "系统服务"; +$text['label-system_services']['ja-jp'] = "システムサービス"; +$text['label-system_services']['ko-kr'] = "시스템 서비스"; + +$text['label-system_status']['en-us'] = "System Status"; +$text['label-system_status']['en-gb'] = "System Status"; +$text['label-system_status']['ar-eg'] = "حالة النظام"; +$text['label-system_status']['de-at'] = "Systemstatus"; +$text['label-system_status']['de-ch'] = "Systemstatus"; +$text['label-system_status']['de-de'] = "Systemstatus"; +$text['label-system_status']['es-cl'] = "Estado del Sistema"; +$text['label-system_status']['es-mx'] = "Estado del Sistema"; +$text['label-system_status']['fr-ca'] = "État du Système"; +$text['label-system_status']['fr-fr'] = "État du Système"; +$text['label-system_status']['he-il'] = "מצב מערכת"; +$text['label-system_status']['it-it'] = "Stato Sistema"; +$text['label-system_status']['ka-ge'] = "სისტემის სტატუსი"; +$text['label-system_status']['nl-nl'] = "Systeem Status"; +$text['label-system_status']['pl-pl'] = "Status systemu"; +$text['label-system_status']['pt-br'] = "Status do sistema"; +$text['label-system_status']['pt-pt'] = "Status do Sistema"; +$text['label-system_status']['ro-ro'] = "Starea sistemului"; +$text['label-system_status']['ru-ru'] = "Статус Системы"; +$text['label-system_status']['sv-se'] = "System Status"; +$text['label-system_status']['uk-ua'] = "Стан системи "; +$text['label-system_status']['tr-tr'] = "Sistem durumu"; +$text['label-system_status']['zh-cn'] = "系统状况"; +$text['label-system_status']['ja-jp'] = "システムステータス"; +$text['label-system_status']['ko-kr'] = "시스템 상태"; + ?> diff --git a/app/system/resources/dashboard/system_counts.php b/app/system/resources/dashboard/system_counts.php index 527bc3f5f8..367224d279 100644 --- a/app/system/resources/dashboard/system_counts.php +++ b/app/system/resources/dashboard/system_counts.php @@ -13,10 +13,16 @@ exit; } +//convert to a key + $widget_key = str_replace(' ', '_', strtolower($widget_name)); + //add multi-lingual support $language = new text; $text = $language->get($settings->get('domain', 'language', 'en-us'), 'core/user_settings'); +//get the dashboard label + $widget_label = $text['label-'.$widget_key] ?? $widget_name; + //system counts //domains if (permission_exists('domain_view')) { @@ -291,7 +297,7 @@ if ($show_stat) { echo "
\n"; - echo " ".$text['label-system_counts']."\n"; + echo " ".escape($widget_label)."\n"; if (!isset($widget_chart_type) || $widget_chart_type == "doughnut") { //add doughnut chart diff --git a/app/system/resources/dashboard/system_cpu_status.php b/app/system/resources/dashboard/system_cpu_status.php index a1c835ea3f..6f14da63b8 100644 --- a/app/system/resources/dashboard/system_cpu_status.php +++ b/app/system/resources/dashboard/system_cpu_status.php @@ -13,10 +13,16 @@ exit; } +//convert to a key + $widget_key = str_replace(' ', '_', strtolower($widget_name)); + //add multi-lingual support $language = new text; $text = $language->get($settings->get('domain', 'language', 'en-us'), 'app/system'); +//get the dashboard label + $widget_label = $text['label-'.$widget_key] ?? $widget_name; + //system cpu status echo "
\n"; @@ -52,7 +58,7 @@ //show the content echo "
\n"; - echo " ".$text['label-cpu_usage']."\n"; + echo " ".escape($widget_label)."\n"; $token = (new token())->create($_SERVER['PHP_SELF']); diff --git a/app/system/resources/dashboard/system_disk_usage.php b/app/system/resources/dashboard/system_disk_usage.php index 90fffdd3b3..dfe99fde92 100644 --- a/app/system/resources/dashboard/system_disk_usage.php +++ b/app/system/resources/dashboard/system_disk_usage.php @@ -13,10 +13,16 @@ exit; } +//convert to a key + $widget_key = str_replace(' ', '_', strtolower($widget_name)); + //add multi-lingual support $language = new text; $text = $language->get($settings->get('domain', 'language', 'en-us'), 'core/user_settings'); +//get the dashboard label + $widget_label = $text['label-'.$widget_key]; + //system status echo "
\n"; @@ -38,7 +44,7 @@ //add half doughnut chart echo "
\n"; - echo " ".$text['label-disk_usage']."\n"; + echo " ".escape($widget_label)."\n"; if (!isset($widget_chart_type) || $widget_chart_type == "doughnut") { ?> diff --git a/app/system/resources/dashboard/system_network_status.php b/app/system/resources/dashboard/system_network_status.php index 1d2bb09fe6..92b7ee5cff 100644 --- a/app/system/resources/dashboard/system_network_status.php +++ b/app/system/resources/dashboard/system_network_status.php @@ -11,10 +11,16 @@ if (permission_exists('system_view_network')) { return; } +//convert to a key +$widget_key = str_replace(' ', '_', strtolower($widget_name)); + //add multi-lingual support $language = new text; $text = $language->get($settings->get('domain', 'language', 'en-us'), 'app/system'); +//get the dashboard label +$widget_label = $text['label-'.$widget_key] ?? $widget_name; + //set the row style class names $c = 0; $row_style["0"] = "row_style0"; @@ -42,7 +48,7 @@ echo "
\n"; echo "\n"; echo "
\n"; echo "\n"; -echo "" . $text['label-network_usage'] . "\n"; +echo "" . escape($widget_label) . "\n"; echo "\n"; //if ($dashboard_chart_type === 'line') { ?>
diff --git a/app/system/resources/dashboard/system_services.php b/app/system/resources/dashboard/system_services.php index cd6ccb6f41..bb6204677b 100644 --- a/app/system/resources/dashboard/system_services.php +++ b/app/system/resources/dashboard/system_services.php @@ -154,13 +154,19 @@ //track total installed services for charts $total_services = count($services); +//convert to a key + $widget_key = str_replace(' ', '_', strtolower($widget_name)); + //add multi-lingual support $text = (new text())->get($settings->get('domain','language','en-us'), 'core/user_settings'); +//get the dashboard label + $widget_label = $text['label-'.$widget_key] ?? $widget_name; + //show the results echo "
\n"; echo "
\n"; -echo " System Services\n"; +echo " ".escape($widget_label)."\n"; //doughnut chart if (!isset($widget_chart_type) || $widget_chart_type == "doughnut") { diff --git a/app/system/resources/dashboard/system_status.php b/app/system/resources/dashboard/system_status.php index 26d182692b..2c758a194e 100644 --- a/app/system/resources/dashboard/system_status.php +++ b/app/system/resources/dashboard/system_status.php @@ -13,10 +13,16 @@ exit; } +//convert to a key + $widget_key = str_replace(' ', '_', strtolower($widget_name)); + //add multi-lingual support $language = new text; $text = $language->get($settings->get('domain', 'language', 'en-us'), 'core/user_settings'); +//get the dashboard label + $widget_label = $text['label-'.$widget_key] ?? $widget_name; + //system status echo "
\n"; @@ -121,7 +127,7 @@ //show the results echo "
\n"; - echo " ".$text['label-system_status']."\n"; + echo " ".escape($widget_label)."\n"; if ($widget_chart_type == "doughnut") { ?> @@ -193,7 +199,7 @@ //disk usage if ($widget_row_span >= 1) { - echo " ".$text['label-disk_usage']."\n"; + echo " ".$text['label-system_disk_usage']."\n"; echo "
\n"; echo "
get('theme', 'dashboard_disk_usage_chart_main_color') ?? '#03c04a').";'>".round($percent_disk_usage)."%
\n"; echo "
\n"; @@ -329,7 +335,7 @@ $style = ($percent_disk_usage > 90) ? "color: red;" : (($percent_disk_usage > 75) ? "color: orange;" : ""); echo "\n"; - echo "".$text['label-disk_usage']."\n"; + echo "".$text['label-system_disk_usage']."\n"; echo "".$percent_disk_usage."% (".$used_space." / ".$total_space.")"."\n"; echo "\n"; $c = ($c) ? 0 : 1; diff --git a/app/voicemails/resources/dashboard/voicemails.php b/app/voicemails/resources/dashboard/voicemails.php index 65c4d76933..811733aacf 100644 --- a/app/voicemails/resources/dashboard/voicemails.php +++ b/app/voicemails/resources/dashboard/voicemails.php @@ -13,10 +13,16 @@ exit; } +//convert to a key + $widget_key = str_replace(' ', '_', strtolower($widget_name)); + //add multi-lingual support $language = new text; $text = $language->get($settings->get('domain', 'language', 'en-us'), 'core/user_settings'); +//get the dashboard label + $widget_label = $text['label-'.$widget_key] ?? $widget_name; + //used for missed and recent calls $theme_image_path = $_SERVER["DOCUMENT_ROOT"]."/themes/".$settings->get('domain', 'template')."/images/"; @@ -50,7 +56,7 @@ } echo "
\n"; - echo " ".$text['label-new_messages'].""; + echo " ".escape($widget_label).""; if (isset($widget_chart_type) && $widget_chart_type == "doughnut") { //add doughnut chart diff --git a/app/xml_cdr/resources/dashboard/missed_calls.php b/app/xml_cdr/resources/dashboard/missed_calls.php index 1fd793d228..582890bda2 100644 --- a/app/xml_cdr/resources/dashboard/missed_calls.php +++ b/app/xml_cdr/resources/dashboard/missed_calls.php @@ -13,10 +13,16 @@ exit; } +//convert to a key + $widget_key = str_replace(' ', '_', strtolower($widget_name)); + //add multi-lingual support $language = new text; $text = $language->get($settings->get('domain', 'language', 'en-us'), 'core/user_settings'); +//get the dashboard label + $widget_label = $text['label-'.$widget_key] ?? $widget_name; + //create assigned extensions array if (is_array($_SESSION['user']['extension'])) { foreach ($_SESSION['user']['extension'] as $assigned_extension) { @@ -90,7 +96,7 @@ echo "
\n"; echo "
\n"; - echo " ".$text['label-missed_calls'].""; + echo " ".escape($widget_label).""; if ($widget_chart_type == "doughnut") { //add doughnut chart diff --git a/app/xml_cdr/resources/dashboard/recent_calls.php b/app/xml_cdr/resources/dashboard/recent_calls.php index 6fe412f785..26a474fac9 100644 --- a/app/xml_cdr/resources/dashboard/recent_calls.php +++ b/app/xml_cdr/resources/dashboard/recent_calls.php @@ -13,10 +13,16 @@ exit; } +//convert to a key + $widget_key = str_replace(' ', '_', strtolower($widget_name)); + //add multi-lingual support $language = new text; $text = $language->get($settings->get('domain', 'language', 'en-us'), 'core/user_settings'); +//get the dashboard label + $widget_label = $text['label-'.$widget_key] ?? $widget_name; + //create assigned extensions array if (is_array($_SESSION['user']['extension'])) { foreach ($_SESSION['user']['extension'] as $assigned_extension) { @@ -87,7 +93,7 @@ echo "
\n"; echo "
\n"; - echo " ".$text['label-recent_calls']."\n"; + echo " ".escape($widget_label)."\n"; if ($widget_chart_type == "doughnut") { //add doughnut chart diff --git a/core/domains/resources/dashboard/domains.php b/core/domains/resources/dashboard/domains.php index 4e5b8c5ff0..0d69b60840 100644 --- a/core/domains/resources/dashboard/domains.php +++ b/core/domains/resources/dashboard/domains.php @@ -12,10 +12,7 @@ $text = $language->get($settings->get('domain', 'language', 'en-us'), dirname($widget_url)); //get the dashboard label - $widget_label = $text['title-'.$widget_key]; - if (empty($widget_label)) { - $widget_label = $widget_name; - } + $widget_label = $text['title-'.$widget_key] ?? $widget_name; //prepare variables $widget_target = ($widget_target == 'new') ? '_blank' : '_self'; diff --git a/core/user_settings/app_languages.php b/core/user_settings/app_languages.php index 420195eed9..27130f99b8 100644 --- a/core/user_settings/app_languages.php +++ b/core/user_settings/app_languages.php @@ -2188,32 +2188,32 @@ $text['label-dnd']['zh-cn'] = "请勿打扰"; $text['label-dnd']['ja-jp'] = "邪魔しないでください"; $text['label-dnd']['ko-kr'] = "방해하지 마"; -$text['label-disk_usage']['en-us'] = "Disk Usage"; -$text['label-disk_usage']['en-gb'] = "Disk Usage"; -$text['label-disk_usage']['ar-eg'] = "إستخدام القرص"; -$text['label-disk_usage']['de-at'] = "Festplattennutzung"; -$text['label-disk_usage']['de-ch'] = "Festplattennutzung"; -$text['label-disk_usage']['de-de'] = "Festplattennutzung"; -$text['label-disk_usage']['el-gr'] = "Χρήση δίσκου"; -$text['label-disk_usage']['es-cl'] = "Uso del disco"; -$text['label-disk_usage']['es-mx'] = "Uso del disco"; -$text['label-disk_usage']['fr-ca'] = "Utilisation du disque"; -$text['label-disk_usage']['fr-fr'] = "Utilisation du disque"; -$text['label-disk_usage']['he-il'] = "שימוש בדיסק"; -$text['label-disk_usage']['it-it'] = "Uso Disco"; -$text['label-disk_usage']['ka-ge'] = "დისკის გამოყენება"; -$text['label-disk_usage']['nl-nl'] = "Schijfgebruik"; -$text['label-disk_usage']['pl-pl'] = "Użycie dysku"; -$text['label-disk_usage']['pt-br'] = "Uso de disco"; -$text['label-disk_usage']['pt-pt'] = "Uso de disco"; -$text['label-disk_usage']['ro-ro'] = "utilizare disc"; -$text['label-disk_usage']['ru-ru'] = "Использование диска"; -$text['label-disk_usage']['sv-se'] = "Disk Användning"; -$text['label-disk_usage']['tr-tr'] = "Disk kullanımı"; -$text['label-disk_usage']['uk-ua'] = "Використання диска"; -$text['label-disk_usage']['zh-cn'] = "磁盘使用情况"; -$text['label-disk_usage']['ja-jp'] = "ディスクの使用状況"; -$text['label-disk_usage']['ko-kr'] = "디스크 사용량"; +$text['label-system_disk_usage']['en-us'] = "Disk Usage"; +$text['label-system_disk_usage']['en-gb'] = "Disk Usage"; +$text['label-system_disk_usage']['ar-eg'] = "إستخدام القرص"; +$text['label-system_disk_usage']['de-at'] = "Festplattennutzung"; +$text['label-system_disk_usage']['de-ch'] = "Festplattennutzung"; +$text['label-system_disk_usage']['de-de'] = "Festplattennutzung"; +$text['label-system_disk_usage']['el-gr'] = "Χρήση δίσκου"; +$text['label-system_disk_usage']['es-cl'] = "Uso del disco"; +$text['label-system_disk_usage']['es-mx'] = "Uso del disco"; +$text['label-system_disk_usage']['fr-ca'] = "Utilisation du disque"; +$text['label-system_disk_usage']['fr-fr'] = "Utilisation du disque"; +$text['label-system_disk_usage']['he-il'] = "שימוש בדיסק"; +$text['label-system_disk_usage']['it-it'] = "Uso Disco"; +$text['label-system_disk_usage']['ka-ge'] = "დისკის გამოყენება"; +$text['label-system_disk_usage']['nl-nl'] = "Schijfgebruik"; +$text['label-system_disk_usage']['pl-pl'] = "Użycie dysku"; +$text['label-system_disk_usage']['pt-br'] = "Uso de disco"; +$text['label-system_disk_usage']['pt-pt'] = "Uso de disco"; +$text['label-system_disk_usage']['ro-ro'] = "utilizare disc"; +$text['label-system_disk_usage']['ru-ru'] = "Использование диска"; +$text['label-system_disk_usage']['sv-se'] = "Disk Användning"; +$text['label-system_disk_usage']['tr-tr'] = "Disk kullanımı"; +$text['label-system_disk_usage']['uk-ua'] = "Використання диска"; +$text['label-system_disk_usage']['zh-cn'] = "磁盘使用情况"; +$text['label-system_disk_usage']['ja-jp'] = "ディスクの使用状況"; +$text['label-system_disk_usage']['ko-kr'] = "디스크 사용량"; $text['label-disabled']['en-us'] = "Disabled"; $text['label-disabled']['en-gb'] = "Disabled";