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
This commit is contained in:
Alex
2025-10-17 16:01:39 -07:00
committed by GitHub
parent a11b79e1b5
commit 729b3bf314
22 changed files with 305 additions and 50 deletions

View File

@@ -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 "<div class='hud_box'>\n";
echo "<div class='hud_content' ".($widget_details_state == "disabled" ?: "onclick=\"$('#hud_missed_calls_details').slideToggle('fast');\"").">\n";
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/xml_cdr/xml_cdr.php?call_result=missed'\">".$text['label-missed_calls']."</a></span>";
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/xml_cdr/xml_cdr.php?call_result=missed'\">".escape($widget_label)."</a></span>";
if ($widget_chart_type == "doughnut") {
//add doughnut chart

View File

@@ -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 "<div class='hud_box'>\n";
echo "<div class='hud_content' ".($widget_details_state == "disabled" ?: "onclick=\"$('#hud_recent_calls_details').slideToggle('fast');\"").">\n";
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/xml_cdr/xml_cdr.php';\">".$text['label-recent_calls']."</a></span>\n";
echo " <span class='hud_title'><a onclick=\"document.location.href='".PROJECT_PATH."/app/xml_cdr/xml_cdr.php';\">".escape($widget_label)."</a></span>\n";
if ($widget_chart_type == "doughnut") {
//add doughnut chart