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 "