mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Extension - List: Show registration status icon (when permitted).
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2020
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2024
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -305,6 +305,9 @@
|
||||
echo "<th>".$text['label-domain']."</th>\n";
|
||||
//echo th_order_by('domain_name', $text['label-domain'], $order_by, $order);
|
||||
}
|
||||
if (permission_exists('extension_registered')) {
|
||||
echo "<th> </th>\n";
|
||||
}
|
||||
echo th_order_by('extension', $text['label-extension'], $order_by, $order);
|
||||
echo th_order_by('effective_caller_id_name', $text['label-effective_cid_name'], $order_by, $order, null, "class='hide-xs'");
|
||||
if (permission_exists("outbound_caller_id_name")) {
|
||||
@@ -325,9 +328,6 @@
|
||||
if (permission_exists("extension_user_context")) {
|
||||
echo th_order_by('user_context', $text['label-user_context'], $order_by, $order);
|
||||
}
|
||||
if (permission_exists('extension_registered')) {
|
||||
echo "<th>".$text['label-is_registered']."</th>\n";
|
||||
}
|
||||
echo th_order_by('enabled', $text['label-enabled'], $order_by, $order, null, "class='center'");
|
||||
echo th_order_by('description', $text['label-description'], $order_by, $order, null, "class='hide-sm-dn'");
|
||||
if (permission_exists('extension_edit') && !empty($_SESSION['theme']['list_row_edit_button']['boolean']) && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
@@ -351,6 +351,37 @@
|
||||
if (!empty($_GET['show']) && $_GET['show'] == "all" && permission_exists('extension_all')) {
|
||||
echo " <td>".escape($_SESSION['domains'][$row['domain_uuid']]['domain_name'])."</td>\n";
|
||||
}
|
||||
if (permission_exists('extension_registered')) {
|
||||
$icon_registered_color = $_SESSION['extension']['icon_registered_color']['text'] ?? '#12d600';
|
||||
$icon_unregistered_color = $_SESSION['extension']['icon_unregistered_color']['text'] ?? '#e21b1b';
|
||||
|
||||
$extension_number = $row['extension'].'@'.$_SESSION['domains'][$row['domain_uuid']]['domain_name'];
|
||||
$extension_number_alias = $row['number_alias'];
|
||||
if (!empty($extension_number_alias)) {
|
||||
$extension_number_alias .= '@'.$_SESSION['domains'][$row['domain_uuid']]['domain_name'];
|
||||
}
|
||||
$found_count = 0;
|
||||
if (is_array($registrations)) {
|
||||
foreach ($registrations as $array) {
|
||||
if ($extension_number == $array['user'] || ($extension_number_alias != '' && $extension_number_alias == $array['user'])) {
|
||||
$found_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($found_count > 0) {
|
||||
echo " <td class='middle button center' style='text-align: center; cursor: help;' title=\"".($found_count > 1 ? $found_count.' '.$text['label-registrations'] : $text['label-registered'])."\">";
|
||||
if ($found_count > 1) {
|
||||
echo "<div style='display: inline-block; width: 8px; height: 8px; border-radius: 50%; background-color: ".$icon_registered_color."; border: 1px solid ".color_adjust($icon_registered_color, -0.07)."; margin-top: 4px;'></div>\n";
|
||||
}
|
||||
echo " <div style='display: inline-block; width: 8px; height: 8px; line-height: 8px; border-radius: 50%; background-color: ".$icon_registered_color."; border: 1px solid ".color_adjust($icon_registered_color, -0.07)."; margin-top: 4px; ".($found_count > 1 ? 'margin-left: -7px;' : null)."'></div>\n";
|
||||
}
|
||||
else {
|
||||
echo " <td class='middle button center' style='text-align: center; cursor: help;' title=\"".$text['label-unregistered']."\">";
|
||||
echo "<div style='display: inline-block; width: 8px; height: 8px; border-radius: 50%; background-color: ".$icon_unregistered_color."; border: 1px solid ".color_adjust($icon_unregistered_color, -0.15)."; margin-top: 4px;'></div>\n";
|
||||
}
|
||||
unset($extension_number, $extension_number_alias, $found_count, $array);
|
||||
echo "</td>\n";
|
||||
}
|
||||
echo " <td>";
|
||||
if (permission_exists('extension_edit')) {
|
||||
echo "<a href='".$list_row_url."' title=\"".$text['button-edit']."\">".escape($row['extension'])."</a>";
|
||||
@@ -379,30 +410,6 @@
|
||||
if (permission_exists("extension_user_context")) {
|
||||
echo " <td>".escape($row['user_context'])."</td>\n";
|
||||
}
|
||||
if (permission_exists('extension_registered')) {
|
||||
echo " <td>";
|
||||
$extension_number = $row['extension'].'@'.$_SESSION['domains'][$row['domain_uuid']]['domain_name'];
|
||||
$extension_number_alias = $row['number_alias'];
|
||||
if (!empty($extension_number_alias)) {
|
||||
$extension_number_alias .= '@'.$_SESSION['domains'][$row['domain_uuid']]['domain_name'];
|
||||
}
|
||||
$found_count = 0;
|
||||
if (is_array($registrations)) {
|
||||
foreach ($registrations as $array) {
|
||||
if ($extension_number == $array['user'] || ($extension_number_alias != '' && $extension_number_alias == $array['user'])) {
|
||||
$found_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($found_count > 0) {
|
||||
echo $text['label-true']." (".$found_count.")";
|
||||
}
|
||||
else {
|
||||
echo $text['label-false'];
|
||||
}
|
||||
unset($extension_number, $extension_number_alias, $found_count, $array);
|
||||
echo " </td>\n";
|
||||
}
|
||||
if (permission_exists('extension_enabled')) {
|
||||
echo " <td class='no-link center'>";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.$row['enabled']],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]);
|
||||
|
||||
Reference in New Issue
Block a user