Operator Panel: Simplify and enhance filter, updates for PHP 8.1.
This commit is contained in:
@@ -432,6 +432,30 @@ $text['label-call_direction']['zh-cn'] = "呼叫方向";
|
|||||||
$text['label-call_direction']['ja-jp'] = "通話方向";
|
$text['label-call_direction']['ja-jp'] = "通話方向";
|
||||||
$text['label-call_direction']['ko-kr'] = "통화 방향";
|
$text['label-call_direction']['ko-kr'] = "통화 방향";
|
||||||
|
|
||||||
|
$text['label-filter']['en-us'] = "Filter...";
|
||||||
|
$text['label-filter']['en-gb'] = "Filter...";
|
||||||
|
$text['label-filter']['ar-eg'] = "فيلم";
|
||||||
|
$text['label-filter']['de-at'] = "Filter...";
|
||||||
|
$text['label-filter']['de-ch'] = "Filter...";
|
||||||
|
$text['label-filter']['de-de'] = "Filter...";
|
||||||
|
$text['label-filter']['es-cl'] = "Filtro...";
|
||||||
|
$text['label-filter']['es-mx'] = "Filtro...";
|
||||||
|
$text['label-filter']['fr-ca'] = "Filtre...";
|
||||||
|
$text['label-filter']['fr-fr'] = "Filtre...";
|
||||||
|
$text['label-filter']['he-il'] = "Filter...";
|
||||||
|
$text['label-filter']['it-it'] = "Filtro...";
|
||||||
|
$text['label-filter']['nl-nl'] = "Filter...";
|
||||||
|
$text['label-filter']['pl-pl'] = "Filter...";
|
||||||
|
$text['label-filter']['pt-br'] = "Filtro...";
|
||||||
|
$text['label-filter']['pt-pt'] = "Filtro...";
|
||||||
|
$text['label-filter']['ro-ro'] = "Filtru...";
|
||||||
|
$text['label-filter']['ru-ru'] = "Фильтр";
|
||||||
|
$text['label-filter']['sv-se'] = "Filter...";
|
||||||
|
$text['label-filter']['uk-ua'] = "Фільтри";
|
||||||
|
$text['label-filter']['zh-cn'] = "筛选";
|
||||||
|
$text['label-filter']['ja-jp'] = "フィルター";
|
||||||
|
$text['label-filter']['ko-kr'] = "필터";
|
||||||
|
|
||||||
$text['description-eavesdrop_destination']['en-us'] = "Select the Eavesdrop Destination";
|
$text['description-eavesdrop_destination']['en-us'] = "Select the Eavesdrop Destination";
|
||||||
$text['description-eavesdrop_destination']['en-gb'] = "Select the Eavesdrop Destination";
|
$text['description-eavesdrop_destination']['en-gb'] = "Select the Eavesdrop Destination";
|
||||||
$text['description-eavesdrop_destination']['ar-eg'] = "حدد وجهة Eavesdrop";
|
$text['description-eavesdrop_destination']['ar-eg'] = "حدد وجهة Eavesdrop";
|
||||||
|
|||||||
@@ -270,8 +270,7 @@ unset($refresh_default);
|
|||||||
url += '&vd_ext_from=' + document.getElementById('vd_ext_from').value;
|
url += '&vd_ext_from=' + document.getElementById('vd_ext_from').value;
|
||||||
url += '&vd_ext_to=' + document.getElementById('vd_ext_to').value;
|
url += '&vd_ext_to=' + document.getElementById('vd_ext_to').value;
|
||||||
url += '&group=' + ((document.getElementById('group')) ? document.getElementById('group').value : '');
|
url += '&group=' + ((document.getElementById('group')) ? document.getElementById('group').value : '');
|
||||||
url += '&extension_filter=' + ((document.getElementById('extension_filter')) ? document.getElementById('extension_filter').value : '');
|
url += '&filter=' + ((document.getElementById('search')) ? document.getElementById('search').value : '');
|
||||||
url += '&name_filter=' + ((document.getElementById('name_filter')) ? document.getElementById('name_filter').value : '');
|
|
||||||
url += '&eavesdrop_dest=' + ((document.getElementById('eavesdrop_dest')) ? document.getElementById('eavesdrop_dest').value : '');
|
url += '&eavesdrop_dest=' + ((document.getElementById('eavesdrop_dest')) ? document.getElementById('eavesdrop_dest').value : '');
|
||||||
if (document.getElementById('sort1'))
|
if (document.getElementById('sort1'))
|
||||||
if (document.getElementById('sort1').value == '1') url += '&sort';
|
if (document.getElementById('sort1').value == '1') url += '&sort';
|
||||||
@@ -359,8 +358,7 @@ unset($refresh_default);
|
|||||||
url += '&vd_ext_from=' + document.getElementById('vd_ext_from').value;
|
url += '&vd_ext_from=' + document.getElementById('vd_ext_from').value;
|
||||||
url += '&vd_ext_to=' + document.getElementById('vd_ext_to').value;
|
url += '&vd_ext_to=' + document.getElementById('vd_ext_to').value;
|
||||||
url += '&group=' + ((document.getElementById('group')) ? document.getElementById('group').value : '');
|
url += '&group=' + ((document.getElementById('group')) ? document.getElementById('group').value : '');
|
||||||
url += '&extension_filter=' + ((document.getElementById('extension_filter')) ? document.getElementById('extension_filter').value : '');
|
url += '&filter=' + ((document.getElementById('search')) ? document.getElementById('search').value : '');
|
||||||
url += '&name_filter=' + ((document.getElementById('name_filter')) ? document.getElementById('name_filter').value : '');
|
|
||||||
url += '&eavesdrop_dest=' + ((document.getElementById('eavesdrop_dest')) ? document.getElementById('eavesdrop_dest').value : '');
|
url += '&eavesdrop_dest=' + ((document.getElementById('eavesdrop_dest')) ? document.getElementById('eavesdrop_dest').value : '');
|
||||||
if (document.getElementById('sort1'))
|
if (document.getElementById('sort1'))
|
||||||
if (document.getElementById('sort1').value == '1') url += '&sort';
|
if (document.getElementById('sort1').value == '1') url += '&sort';
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ if (!class_exists('basic_operator_panel')) {
|
|||||||
$sql .= "e.extension, ";
|
$sql .= "e.extension, ";
|
||||||
$sql .= "e.number_alias, ";
|
$sql .= "e.number_alias, ";
|
||||||
$sql .= "e.effective_caller_id_name, ";
|
$sql .= "e.effective_caller_id_name, ";
|
||||||
$sql .= "lower(e.effective_caller_id_name) as filter_name, ";
|
|
||||||
$sql .= "e.effective_caller_id_number, ";
|
$sql .= "e.effective_caller_id_number, ";
|
||||||
$sql .= "e.call_group, ";
|
$sql .= "e.call_group, ";
|
||||||
$sql .= "e.description, ";
|
$sql .= "e.description, ";
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
Portions created by the Initial Developer are Copyright (C) 2008-2022
|
Portions created by the Initial Developer are Copyright (C) 2008-2023
|
||||||
the Initial Developer. All Rights Reserved.
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
@@ -189,27 +189,30 @@ if (!empty($groups)) {
|
|||||||
echo " <select class='formfld' onchange=\"document.getElementById('group').value = this.options[this.selectedIndex].value; refresh_start();\" onfocus='refresh_stop();'>\n";
|
echo " <select class='formfld' onchange=\"document.getElementById('group').value = this.options[this.selectedIndex].value; refresh_start();\" onfocus='refresh_stop();'>\n";
|
||||||
echo " <option value='' ".(($_REQUEST['group'] == '') ? "selected" : null).">".$text['label-call_group']."</option>\n";
|
echo " <option value='' ".(($_REQUEST['group'] == '') ? "selected" : null).">".$text['label-call_group']."</option>\n";
|
||||||
echo " <option value=''>".$text['button-all']."</option>\n";
|
echo " <option value=''>".$text['button-all']."</option>\n";
|
||||||
if (is_array($groups)) foreach ($groups as $group) {
|
if (is_array($groups)) {
|
||||||
|
foreach ($groups as $group) {
|
||||||
echo " <option value='".escape($group)."' ".(($_REQUEST['group'] == $group) ? "selected" : null).">".escape($group)."</option>\n";
|
echo " <option value='".escape($group)."' ".(($_REQUEST['group'] == $group) ? "selected" : null).">".escape($group)."</option>\n";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
echo " </select>\n";
|
echo " </select>\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//show buttons
|
//show buttons
|
||||||
echo " <input type='button' class='btn' title=\"".$text['label-call_group']."\" value=\"".$text['button-all']."\" onclick=\"document.getElementById('group').value = '';\" ".$onhover_pause_refresh.">\n";
|
echo " <input type='button' class='btn' title=\"".$text['label-call_group']."\" value=\"".$text['button-all']."\" onclick=\"document.getElementById('group').value = '';\" ".$onhover_pause_refresh.">\n";
|
||||||
if (is_array($groups)) foreach ($groups as $group) {
|
if (is_array($groups)) {
|
||||||
|
foreach ($groups as $group) {
|
||||||
echo " <input type='button' class='btn' title=\"".$text['label-call_group']."\" value=\"".escape($group)."\" ".(($_REQUEST['group'] == $group) ? "disabled='disabled'" : null)." onclick=\"document.getElementById('group').value = this.value;\" ".$onhover_pause_refresh.">\n";
|
echo " <input type='button' class='btn' title=\"".$text['label-call_group']."\" value=\"".escape($group)."\" ".(($_REQUEST['group'] == $group) ? "disabled='disabled'" : null)." onclick=\"document.getElementById('group').value = this.value;\" ".$onhover_pause_refresh.">\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo " <td valign='top' nowrap='nowrap'>\n";
|
echo " <td valign='top' nowrap='nowrap'>\n";
|
||||||
echo " <input type='hidden' id='extension_filter' value=\"".escape($_REQUEST['extension_filter'])."\">\n";
|
echo " <input type='text' class='txt list-search' id='search' placeholder=\"".$text['label-filter']."\" value=\"".escape($_REQUEST['filter'] ?? '')."\" onfocus='refresh_stop();' onkeyup='refresh_start();' onblur='refresh_start();'>\n";
|
||||||
echo " <input type='hidden' id='name_filter' value=\"".strtolower(escape($_REQUEST['name_filter']))."\">\n";
|
if (!empty($_REQUEST['filter'])) {
|
||||||
echo " <input type='text' class='formfld' placeholder='Filter Extension' value=\"".escape($_REQUEST['extension_filter'])."\" onkeyup=\"document.getElementById('extension_filter').value = this.value; refresh_start();\" onfocus='refresh_stop();'>\n";
|
echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','style'=>(empty($_REQUEST['filter']) ? 'display: none;' : null),'onclick'=>"document.getElementById('search').value = '';",'onmouseover'=>'refresh_stop();','onmouseout'=>'refresh_start();']);
|
||||||
echo " <input type='text' class='formfld' placeholder='Filter Name' value=\"".strtolower(escape($_REQUEST['name_filter']))."\" onkeyup=\"document.getElementById('name_filter').value = this.value; refresh_start();\" onfocus='refresh_stop();'>\n";
|
}
|
||||||
echo " <input type='button' class='btn' title=\"Clear\" value=\"Clear\" onclick=\"document.getElementById('extension_filter').value = ''; document.getElementById('name_filter').value = '';\" ".$onhover_pause_refresh.">\n";
|
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
echo " </tr>\n";
|
echo " </tr>\n";
|
||||||
echo " </table>\n";
|
echo " </table>\n";
|
||||||
@@ -233,8 +236,15 @@ if (is_array($activity)) {
|
|||||||
if ($_REQUEST['group'] != '' && substr_count($ext['call_group'], $_REQUEST['group']) == 0 && !in_array($extension, $_SESSION['user']['extensions'])) { continue; }
|
if ($_REQUEST['group'] != '' && substr_count($ext['call_group'], $_REQUEST['group']) == 0 && !in_array($extension, $_SESSION['user']['extensions'])) { continue; }
|
||||||
|
|
||||||
//filter by extension or name, if defined
|
//filter by extension or name, if defined
|
||||||
if ($_REQUEST['extension_filter'] != '' && substr_count($ext['extension'], $_REQUEST['extension_filter']) == 0 && !in_array($extension, $_SESSION['user']['extensions'])) { continue; }
|
if (!empty($_REQUEST['filter'])) {
|
||||||
if ($_REQUEST['name_filter'] != '' && substr_count($ext['filter_name'], $_REQUEST['name_filter']) == 0 && !in_array($extension, $_SESSION['user']['extensions'])) { continue; }
|
if (
|
||||||
|
!in_array($extension, $_SESSION['user']['extensions']) && (
|
||||||
|
substr_count($ext['extension'], $_REQUEST['filter']) == 0 &&
|
||||||
|
substr_count(strtolower($ext['description'] ?? ''), strtolower($_REQUEST['filter'])) == 0 &&
|
||||||
|
substr_count(strtolower($ext['effective_caller_id_name'] ?? ''), strtolower($_REQUEST['filter'])) == 0
|
||||||
|
)
|
||||||
|
) { continue; }
|
||||||
|
}
|
||||||
|
|
||||||
//check if feature code being called
|
//check if feature code being called
|
||||||
$format_number = (!empty($ext['dest']) && substr($ext['dest'], 0, 1) == '*') ? false : true;
|
$format_number = (!empty($ext['dest']) && substr($ext['dest'], 0, 1) == '*') ? false : true;
|
||||||
@@ -332,8 +342,9 @@ if (is_array($activity)) {
|
|||||||
}
|
}
|
||||||
if ($found_count > 0) {
|
if ($found_count > 0) {
|
||||||
//determine block style by state (if any) and register status
|
//determine block style by state (if any) and register status
|
||||||
$style = ($ext_state != '') ? "op_ext op_state_".$ext_state : "op_ext";
|
$style = !empty($ext_state) ? "op_ext op_state_".$ext_state : "op_ext";
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$style = "off_ext";
|
$style = "off_ext";
|
||||||
}
|
}
|
||||||
unset($extension_number, $found_count, $array);
|
unset($extension_number, $found_count, $array);
|
||||||
@@ -383,10 +394,10 @@ if (is_array($activity)) {
|
|||||||
if ($ext['uuid'] != '' && $ext['uuid'] == $ext['call_uuid'] && $ext['variable_bridge_uuid'] == '') {
|
if ($ext['uuid'] != '' && $ext['uuid'] == $ext['call_uuid'] && $ext['variable_bridge_uuid'] == '') {
|
||||||
$draggable = false;
|
$draggable = false;
|
||||||
}
|
}
|
||||||
else if ($ext_state == 'ringing' && $ext['variable_call_direction'] == 'local') {
|
else if (!empty($ext_state) && $ext_state == 'ringing' && $ext['variable_call_direction'] == 'local') {
|
||||||
$draggable = false;
|
$draggable = false;
|
||||||
}
|
}
|
||||||
else if ($ext_state != '' && !$format_number) {
|
else if (!empty($ext_state) && !$format_number) {
|
||||||
$draggable = false;
|
$draggable = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -543,6 +554,7 @@ if (sizeof($user_extensions) > 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($valet_array) && is_array($valet_array) && @sizeof($valet_array) != 0) {
|
||||||
foreach ($valet_array as $row) {
|
foreach ($valet_array as $row) {
|
||||||
$extension = $row['extension'];
|
$extension = $row['extension'];
|
||||||
$ext_state = 'active';
|
$ext_state = 'active';
|
||||||
@@ -625,6 +637,7 @@ if (sizeof($user_extensions) > 0) {
|
|||||||
echo $valet_block;
|
echo $valet_block;
|
||||||
unset($valet_block);
|
unset($valet_block);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
echo "</td></tr></table><br>\n";
|
echo "</td></tr></table><br>\n";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user