php 8.1 changes (#6721)
* Update call_flows.php * Update call_flow_edit.php * Update call_forward.php * Update call_forward_edit.php * Update call_recordings.php * Update conference_centers.php * Update default_settings.php * Update default_setting_edit.php * Update access_controls.php * Update number_translations.php * Update number_translation_edit.php * Update setting_edit.php * Update bridges.php * Update bridge_edit.php * Update call_broadcast_edit.php * Update call_broadcast.php * Update call_block.php * Update call_broadcast_edit.php * Update call_center_agent_edit.php * Update call_center_agent_status.php * Update call_recordings.php
This commit is contained in:
@@ -46,15 +46,19 @@
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//set additional variables
|
||||
$search = $_GET["search"] ?? '';
|
||||
$show = $_GET["show"] ?? '';
|
||||
|
||||
//get the http post data
|
||||
if (is_array($_POST['call_recordings'])) {
|
||||
if (!empty($_POST['call_recordings'])) {
|
||||
$action = $_POST['action'];
|
||||
$search = $_POST['search'];
|
||||
$call_recordings = $_POST['call_recordings'];
|
||||
}
|
||||
|
||||
//process the http post data by action
|
||||
if ($action != '' && is_array($call_recordings) && @sizeof($call_recordings) != 0) {
|
||||
if (!empty($action) && !empty($call_recordings)) {
|
||||
switch ($action) {
|
||||
case 'delete':
|
||||
if (permission_exists('call_recording_delete')) {
|
||||
@@ -70,16 +74,16 @@
|
||||
}
|
||||
|
||||
//get order and order by
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
$order_by = $_GET["order_by"] ?? '';
|
||||
$order = $_GET["order"] ?? '';
|
||||
|
||||
//add the search string
|
||||
if (isset($_GET["search"])) {
|
||||
if (!empty($search)) {
|
||||
$search = strtolower($_GET["search"]);
|
||||
}
|
||||
|
||||
//set the time zone
|
||||
if (isset($_SESSION['domain']['time_zone']['name'])) {
|
||||
if (!empty($_SESSION['domain']['time_zone']['name'])) {
|
||||
$time_zone = $_SESSION['domain']['time_zone']['name'];
|
||||
}
|
||||
else {
|
||||
@@ -106,8 +110,8 @@
|
||||
//$num_rows = $database->select($sql, $parameters, 'column');
|
||||
|
||||
//prepare some of the paging values
|
||||
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||
$page = $_GET['page'];
|
||||
$rows_per_page = (!empty($_SESSION['domain']['paging']['numeric'])) ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||
$page = $_GET['page'] ?? '';
|
||||
if (empty($page)) { $page = 0; $_GET['page'] = 0; }
|
||||
$offset = $rows_per_page * $page;
|
||||
|
||||
@@ -120,12 +124,12 @@
|
||||
$sql .= "from view_call_recordings as r, v_domains as d ";
|
||||
//$sql .= "from v_call_recordings as r, v_domains as d ";
|
||||
$sql .= "where true ";
|
||||
if ($_GET['show'] != "all" || !permission_exists('call_recording_all')) {
|
||||
if ($show != "all" || !permission_exists('call_recording_all')) {
|
||||
$sql .= "and (r.domain_uuid = :domain_uuid or r.domain_uuid is null) ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
}
|
||||
$sql .= "and r.domain_uuid = d.domain_uuid ";
|
||||
if (isset($search)) {
|
||||
if (!empty($search)) {
|
||||
$sql .= "and (";
|
||||
$sql .= " lower(r.call_direction) like :search ";
|
||||
$sql .= " or lower(r.caller_id_name) like :search ";
|
||||
@@ -140,11 +144,11 @@
|
||||
$sql .= order_by($order_by, $order, 'r.call_recording_date', 'desc');
|
||||
$sql .= limit_offset($rows_per_page, $offset);
|
||||
$database = new database;
|
||||
$call_recordings = $database->select($sql, $parameters, 'all');
|
||||
$call_recordings = $database->select($sql, $parameters ?? null, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//count the results
|
||||
$result_count = is_array($call_recordings) ? sizeof($call_recordings) : 0;
|
||||
$result_count = !empty($call_recordings) ? sizeof($call_recordings) : 0;
|
||||
|
||||
//limit the number of results
|
||||
if ($_SESSION['cdr']['limit']['numeric'] > 0) {
|
||||
@@ -153,7 +157,7 @@
|
||||
|
||||
//prepare to page the results
|
||||
$param = "&search=".urlencode($search);
|
||||
if ($_GET['show'] == "all" && permission_exists('call_recording_all')) {
|
||||
if ($show == "all" && permission_exists('call_recording_all')) {
|
||||
$param .= "&show=all";
|
||||
}
|
||||
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true, $result_count); //top
|
||||
@@ -179,17 +183,17 @@
|
||||
}
|
||||
echo "<form id='form_search' class='inline' method='get'>\n";
|
||||
if (permission_exists('call_recording_all')) {
|
||||
if ($_GET['show'] == 'all') {
|
||||
if ($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='.urlencode($destination_type).'&show=all'.($search != '' ? "&search=".urlencode($search) : null)]);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?type='.urlencode($destination_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','collapse'=>'hide-xs']);
|
||||
echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'call_recordings.php','style'=>($search == '' ? 'display: none;' : null),'collapse'=>'hide-xs']);
|
||||
if ($paging_controls_mini != '') {
|
||||
if (!empty($paging_controls_mini)) {
|
||||
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>\n";
|
||||
}
|
||||
echo " </form>\n";
|
||||
@@ -211,7 +215,7 @@
|
||||
echo "<table class='list'>\n";
|
||||
echo "<tr class='list-header'>\n";
|
||||
$col_count = 7;
|
||||
if ($_GET['show'] == "all" && permission_exists('call_recording_all')) {
|
||||
if ($show == "all" && permission_exists('call_recording_all')) {
|
||||
$col_count++;
|
||||
}
|
||||
if (permission_exists('call_recording_delete')) {
|
||||
@@ -220,7 +224,7 @@
|
||||
echo " </th>\n";
|
||||
$col_count++;
|
||||
}
|
||||
if ($_GET['show'] == "all" && permission_exists('call_recording_all')) {
|
||||
if ($show == "all" && permission_exists('call_recording_all')) {
|
||||
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, $param, "class='shrink'");
|
||||
}
|
||||
echo th_order_by('caller_id_name', $text['label-caller_id_name'], $order_by, $order, null, "class='hide-sm-dn shrink'");
|
||||
@@ -240,7 +244,7 @@
|
||||
}
|
||||
echo "</tr>\n";
|
||||
|
||||
if (is_array($call_recordings) && @sizeof($call_recordings) != 0) {
|
||||
if (!empty($call_recordings)) {
|
||||
$x = 0;
|
||||
foreach ($call_recordings as $row) {
|
||||
//playback progress bar
|
||||
@@ -258,7 +262,7 @@
|
||||
echo " <input type='hidden' name='call_recordings[$x][uuid]' value='".escape($row['call_recording_uuid'])."' />\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
if ($_GET['show'] == "all" && permission_exists('call_recording_all')) {
|
||||
if (!empty($_GET['show']) == "all" && permission_exists('call_recording_all')) {
|
||||
echo " <td class='overflow hide-sm-dn shrink'>".escape($row['domain_name'])."</td>\n";
|
||||
}
|
||||
echo " <td class='hide-sm-dn shrink'>".escape($row['caller_id_name'])."</td>\n";
|
||||
|
||||
Reference in New Issue
Block a user