Added show all button (#6249)

* Update call_center_queues.php

* Update call_center_agents.php

* Update app_config.php

* Update app_config.php

* Update contacts.php

* Update app_config.php

* Update ivr_menus.php

* Update app_config.php

* Update call_flows.php

* Update app_config.php

* Update conference_centers.php

* Update app_config.php

* Update voicemails.php

* Update app_config.php

* Update phrases.php

* Update app_config.php

* Update recordings.php

* Update app_config.php

* Update call_recordings.php

* Update app_config.php

* Update call_broadcast.php

* Update app_config.php

* Update time_conditions.php

* Update app_config.php

* Update music_on_hold.php

* Update app_config.php

* Update conferences.php
This commit is contained in:
AlexC
2022-01-20 15:54:42 -07:00
committed by GitHub
parent 00c23e5390
commit e316559771
27 changed files with 443 additions and 53 deletions

View File

@@ -96,8 +96,11 @@
//prepare to page the results
$sql = "select count(*) from v_ivr_menus ";
$sql .= "where domain_uuid = :domain_uuid ";
$parameters['domain_uuid'] = $_SESSION["domain_uuid"];
$sql .= "where true ";
if ($_GET['show'] != "all" || !permission_exists('ivr_menu_all')) {
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
}
$database = new database;
$total_ivr_menus = $database->select($sql, $parameters, 'column');
$num_rows = $total_ivr_menus;
@@ -111,7 +114,10 @@
//prepare to page the results
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
$param = "&search=".$search;
$param = "&search=".urlencode($search);
if ($_GET['show'] == "all" && permission_exists('ivr_menu_all')) {
$param .= "&show=all";
}
$page = is_numeric($_GET['page']) ? $_GET['page'] : 0;
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
@@ -150,6 +156,14 @@
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
}
echo "<form id='form_search' class='inline' method='get'>\n";
if (permission_exists('ivr_menu_all')) {
if ($_GET['show'] == 'all') {
echo " <input type='hidden' name='show' value='all'>";
}
else {
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?type=&show=all'.($search != '' ? "&search=".urlencode($search) : null)]);
}
}
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown=''>";
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search']);
//echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'ivr_menus.php','style'=>($search == '' ? 'display: none;' : null)]);
@@ -185,6 +199,9 @@
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($ivr_menus ?: "style='visibility: hidden;'").">\n";
echo " </th>\n";
}
if ($_GET['show'] == "all" && permission_exists('ivr_menu_all')) {
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, $param, "class='shrink'");
}
echo th_order_by('ivr_menu_name', $text['label-name'], $order_by, $order);
echo th_order_by('ivr_menu_extension', $text['label-extension'], $order_by, $order);
echo th_order_by('ivr_menu_enabled', $text['label-enabled'], $order_by, $order, null, "class='center'");
@@ -207,6 +224,15 @@
echo " <input type='hidden' name='ivr_menus[$x][uuid]' value='".escape($row['ivr_menu_uuid'])."' />\n";
echo " </td>\n";
}
if ($_GET['show'] == "all" && permission_exists('ivr_menu_all')) {
if (strlen($_SESSION['domains'][$row['domain_uuid']]['domain_name']) > 0) {
$domain = $_SESSION['domains'][$row['domain_uuid']]['domain_name'];
}
else {
$domain = $text['label-global'];
}
echo " <td>".escape($domain)."</td>\n";
}
echo " <td>";
if (permission_exists('ivr_menu_edit')) {
echo "<a href='".$list_row_url."' title=\"".$text['button-edit']."\">".escape($row['ivr_menu_name'])."</a>";