From e31655977109a908958cc880c791357c3bb708eb Mon Sep 17 00:00:00 2001 From: AlexC <40072887+alexdcrane@users.noreply.github.com> Date: Thu, 20 Jan 2022 15:54:42 -0700 Subject: [PATCH] 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 --- app/call_broadcast/app_config.php | 3 ++ app/call_broadcast/call_broadcast.php | 32 ++++++++++++-- app/call_centers/app_config.php | 3 ++ app/call_centers/call_center_agents.php | 32 ++++++++++++-- app/call_centers/call_center_queues.php | 32 ++++++++++++-- app/call_flows/app_config.php | 3 ++ app/call_flows/call_flows.php | 32 ++++++++++++-- app/call_recordings/app_config.php | 3 ++ app/call_recordings/call_recordings.php | 24 ++++++++-- app/conference_centers/app_config.php | 3 ++ app/conference_centers/conference_centers.php | 32 ++++++++++++-- app/conferences/app_config.php | 3 ++ app/conferences/conferences.php | 32 ++++++++++++-- app/contacts/app_config.php | 3 ++ app/contacts/contacts.php | 32 ++++++++++++-- app/ivr_menus/app_config.php | 3 ++ app/ivr_menus/ivr_menus.php | 32 ++++++++++++-- app/music_on_hold/app_config.php | 3 ++ app/music_on_hold/music_on_hold.php | 29 ++++++++++-- app/phrases/app_config.php | 3 ++ app/phrases/phrases.php | 32 ++++++++++++-- app/recordings/app_config.php | 3 ++ app/recordings/recordings.php | 40 ++++++++++++++--- app/time_conditions/app_config.php | 3 ++ app/time_conditions/time_conditions.php | 44 +++++++++++++++---- app/voicemails/app_config.php | 3 ++ app/voicemails/voicemails.php | 32 ++++++++++++-- 27 files changed, 443 insertions(+), 53 deletions(-) diff --git a/app/call_broadcast/app_config.php b/app/call_broadcast/app_config.php index 2be87c9ca5..a65d8ce9b8 100644 --- a/app/call_broadcast/app_config.php +++ b/app/call_broadcast/app_config.php @@ -80,6 +80,9 @@ $apps[$x]['permissions'][$y]['groups'][] = "admin"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; + $apps[$x]['permissions'][$y]['name'] = "call_broadcast_all"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $y++; $apps[$x]['permissions'][$y]['name'] = "call_broadcast_send"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; diff --git a/app/call_broadcast/call_broadcast.php b/app/call_broadcast/call_broadcast.php index f7f8d8d961..15bba09512 100644 --- a/app/call_broadcast/call_broadcast.php +++ b/app/call_broadcast/call_broadcast.php @@ -90,17 +90,23 @@ //get the count $sql = "select count(*) from v_call_broadcasts "; - $sql .= "where domain_uuid = :domain_uuid "; + $sql .= "where true "; + if ($_GET['show'] != "all" || !permission_exists('call_broadcast_all')) { + $sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) "; + $parameters['domain_uuid'] = $_SESSION['domain_uuid']; + } if (isset($sql_search)) { $sql .= "and ".$sql_search; } $database = new database; - $parameters['domain_uuid'] = $_SESSION['domain_uuid']; $num_rows = $database->select($sql, $parameters, 'column'); //prepare the paging $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('call_broadcast_all')) { + $param .= "&show=all"; + } $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page); @@ -137,6 +143,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 ""; } + if (permission_exists('music_on_hold_all')) { + if ($_GET['show'] == 'all') { + echo " "; + } + 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)]); + } + } if (permission_exists('music_on_hold_delete') && $streams) { 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');"]); } @@ -514,6 +523,9 @@ echo " \n"; echo " \n"; } + if ($_GET['show'] == "all" && permission_exists('music_on_hold_all')) { + echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, $param, "class='shrink'"); + } echo " ".$stream_details."\n"; echo " ".$text['label-tools']."\n"; echo " ".$text['label-file-size']."\n"; @@ -545,6 +557,15 @@ echo " \n"; echo " \n"; } + if ($_GET['show'] == "all" && permission_exists('music_on_hold_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 " ".escape($domain)."\n"; + } echo " ".escape($stream_file)."\n"; echo " "; echo ""; diff --git a/app/phrases/app_config.php b/app/phrases/app_config.php index 8fe3fa4c6c..38a079efe5 100644 --- a/app/phrases/app_config.php +++ b/app/phrases/app_config.php @@ -62,6 +62,9 @@ $apps[$x]['permissions'][$y]['groups'][] = "admin"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; + $apps[$x]['permissions'][$y]['name'] = "phrase_all"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $y++; $apps[$x]['permissions'][$y]['name'] = "phrase_play"; $apps[$x]['permissions'][$y]['groups'][] = "user"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; diff --git a/app/phrases/phrases.php b/app/phrases/phrases.php index 53300161b0..389e628aa9 100644 --- a/app/phrases/phrases.php +++ b/app/phrases/phrases.php @@ -94,15 +94,21 @@ //get phrases record count $sql = "select count(*) from v_phrases "; - $sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) "; + $sql .= "where true "; + if ($_GET['show'] != "all" || !permission_exists('phrase_all')) { + $sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) "; + $parameters['domain_uuid'] = $_SESSION['domain_uuid']; + } $sql .= $sql_search; - $parameters['domain_uuid'] = $domain_uuid; $database = new database; $num_rows = $database->select($sql, $parameters, 'column'); //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('phrase_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); @@ -141,6 +147,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 "