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:
Alex
2023-05-26 11:48:39 -06:00
committed by GitHub
parent b939ac2442
commit 3112c9ae18
18 changed files with 243 additions and 209 deletions
+24 -24
View File
@@ -47,7 +47,7 @@
$text = $language->get();
//action add or update
if (is_uuid($_REQUEST["id"])) {
if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
$action = "update";
$call_flow_uuid = $_REQUEST["id"];
}
@@ -59,7 +59,7 @@
$destination = new destinations;
//get http post variables and set them to php variables
if (count($_POST) > 0) {
if (!empty($_POST)) {
//set the variables from the http values
$call_flow_uuid = $_POST["call_flow_uuid"];
@@ -91,7 +91,7 @@
}
//process the user data and save it to the database
if (count($_POST) > 0 && empty($_POST["persistformvar"])) {
if (!empty($_POST) && empty($_POST["persistformvar"])) {
//get the uuid from the POST
if ($action == "update") {
@@ -302,7 +302,7 @@
} //(is_array($_POST) && empty($_POST["persistformvar"]))
//pre-populate the form
if (is_array($_GET) && $_POST["persistformvar"] != "true") {
if (!empty($_GET) && empty($_POST["persistformvar"])) {
$call_flow_uuid = $_GET["id"];
$sql = "select * from v_call_flows ";
$sql .= "where domain_uuid = :domain_uuid ";
@@ -310,7 +310,7 @@
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['call_flow_uuid'] = $call_flow_uuid;
$database = new database;
$result = $database->select($sql, $parameters, 'all');
$result = $database->select($sql, $parameters ?? null, 'all');
foreach ($result as $row) {
//set the php variables
$call_flow_uuid = $row["call_flow_uuid"];
@@ -365,7 +365,7 @@
$sql .= "order by recording_name asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$recordings = $database->select($sql, $parameters, 'all');
$recordings = $database->select($sql, $parameters ?? null, 'all');
unset($parameters, $sql);
if (if_group("superadmin")) {
@@ -420,7 +420,7 @@
}
//recordings
$tmp_selected = false;
if (count($recordings) > 0) {
if (!empty($recordings)) {
echo "<optgroup label=".$text['recordings'].">\n";
foreach ($recordings as &$row) {
$recording_name = $row["recording_name"];
@@ -443,9 +443,9 @@
$sql = "select * from v_phrases where domain_uuid = :domain_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$result = $database->select($sql, $parameters, 'all');
$result = $database->select($sql, $parameters ?? null, 'all');
unset($parameters, $sql);
if (is_array($result)) {
if (!empty($result)) {
echo "<optgroup label='Phrases'>\n";
foreach ($result as &$row) {
if ($var == "phrase:".$row["phrase_uuid"]) {
@@ -462,7 +462,7 @@
if ($load_sound) {
$file = new file;
$sound_files = $file->sounds();
if (is_array($sound_files)) {
if (!empty($sound_files)) {
echo "<optgroup label=".$text["sounds"].">\n";
foreach ($sound_files as $value) {
if (!empty($value)) {
@@ -532,7 +532,7 @@
echo " ".$text['label-call_flow_name']."\n";
echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_flow_name' maxlength='255' value=\"".escape($call_flow_name)."\">\n";
echo " <input class='formfld' type='text' name='call_flow_name' maxlength='255' value=\"".escape($call_flow_name ?? '')."\">\n";
echo "<br />\n";
echo $text['description-call_flow_name']."\n";
echo "</td>\n";
@@ -543,7 +543,7 @@
echo " ".$text['label-call_flow_extension']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_flow_extension' maxlength='255' value=\"".escape($call_flow_extension)."\">\n";
echo " <input class='formfld' type='text' name='call_flow_extension' maxlength='255' value=\"".escape($call_flow_extension ?? '')."\">\n";
echo "<br />\n";
echo $text['description-call_flow_extension']."\n";
echo "</td>\n";
@@ -554,7 +554,7 @@
echo " ".$text['label-call_flow_feature_code']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_flow_feature_code' maxlength='255' value=\"".escape($call_flow_feature_code)."\">\n";
echo " <input class='formfld' type='text' name='call_flow_feature_code' maxlength='255' value=\"".escape($call_flow_feature_code ?? '')."\">\n";
echo "<br />\n";
echo $text['description-call_flow_feature_code']."\n";
echo "</td>\n";
@@ -610,7 +610,7 @@
echo " ".$text['label-call_flow_pin_number']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_flow_pin_number' maxlength='255' value=\"".escape($call_flow_pin_number)."\">\n";
echo " <input class='formfld' type='text' name='call_flow_pin_number' maxlength='255' value=\"".escape($call_flow_pin_number ?? '')."\">\n";
echo "<br />\n";
echo $text['description-call_flow_pin_number']."\n";
echo "</td>\n";
@@ -621,13 +621,13 @@
echo " ".$text['label-call_flow_label']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_flow_label' maxlength='255' value=\"".escape($call_flow_label)."\">\n";
echo " <input class='formfld' type='text' name='call_flow_label' maxlength='255' value=\"".escape($call_flow_label ?? '')."\">\n";
echo "<br />\n";
echo $text['description-call_flow_label']."\n";
echo !empty($text['description-call_flow_label'])."\n";
echo "</td>\n";
echo "</tr>\n";
sound_select_list($call_flow_sound, 'call_flow_sound', 'call_flow_sound', true);
sound_select_list(!empty($call_flow_sound), 'call_flow_sound', 'call_flow_sound', true);
/*
echo "<tr>\n";
@@ -647,9 +647,9 @@
echo " ".$text['label-call_flow_destination']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
$select_value = '';
//set the selected value
if (!empty($call_flow_app.$call_flow_data)) {
$select_value = '';
if (!empty($call_flow_app) && !empty($call_flow_data)) {
$select_value = $call_flow_app.':'.$call_flow_data;
}
//show the destination list
@@ -665,13 +665,13 @@
echo " ".$text['label-call_flow_alternate_label']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_flow_alternate_label' maxlength='255' value=\"".escape($call_flow_alternate_label)."\">\n";
echo " <input class='formfld' type='text' name='call_flow_alternate_label' maxlength='255' value=\"".escape($call_flow_alternate_label ?? '')."\">\n";
echo "<br />\n";
echo $text['description-call_flow_alternate_label']."\n";
echo "</td>\n";
echo "</tr>\n";
sound_select_list($call_flow_alternate_sound, 'call_flow_alternate_sound', 'call_flow_alternate_sound', true);
sound_select_list(!empty($call_flow_alternate_sound), 'call_flow_alternate_sound', 'call_flow_alternate_sound', true);
/*
echo "<tr>\n";
@@ -692,7 +692,7 @@
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
$select_value = '';
if (!empty($call_flow_alternate_app.$call_flow_alternate_data)) {
if (!empty($call_flow_alternate_app) && !empty($call_flow_alternate_data)) {
$select_value = $call_flow_alternate_app.':'.$call_flow_alternate_data;
}
echo $destination->select('dialplan', 'call_flow_alternate_destination', $select_value);
@@ -737,9 +737,9 @@
echo " ".$text['label-call_flow_description']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='call_flow_description' maxlength='255' value=\"".escape($call_flow_description)."\">\n";
echo " <input class='formfld' type='text' name='call_flow_description' maxlength='255' value=\"".escape($call_flow_description ?? '')."\">\n";
echo "<br />\n";
echo $text['description-call_flow_description']."\n";
echo !empty($text['description-call_flow_description'])."\n";
echo "</td>\n";
echo "</tr>\n";
+22 -19
View File
@@ -46,8 +46,11 @@
$language = new text;
$text = $language->get();
//set from session variables
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
//get posted data
if (is_array($_POST['call_flows'])) {
if (!empty($_POST['call_flows'])) {
$action = $_POST['action'];
$search = $_POST['search'];
$call_flows = $_POST['call_flows'];
@@ -55,7 +58,7 @@
}
//process the http post data by action
if ($action != '' && is_array($call_flows) && @sizeof($call_flows) != 0) {
if (!empty($action) && !empty($call_flows)) {
switch ($action) {
case 'copy':
if (permission_exists('call_flow_add')) {
@@ -83,11 +86,11 @@
}
//get variables used to control the order
$order_by = $_GET["order_by"];
$order = $_GET["order"];
$order_by = $_GET["order_by"] ?? '';
$order = $_GET["order"] ?? '';
//add the search term
$search = strtolower($_GET["search"]);
$search = strtolower($_GET["search"] ?? '');
if (!empty($search)) {
$sql_search = "and (";
$sql_search .= "lower(call_flow_name) like :search ";
@@ -105,21 +108,21 @@
//prepare to page the results
$sql = "select count(*) from v_call_flows ";
$sql .= "where true ";
if ($_GET['show'] != "all" || !permission_exists('call_flow_all')) {
if (!empty($_GET['show']) != "all" || !permission_exists('call_flow_all')) {
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
}
$sql .= $sql_search;
$sql .= $sql_search ?? '';
$database = new database;
$num_rows = $database->select($sql, $parameters, 'column');
$num_rows = $database->select($sql, $parameters ?? null, 'column');
//prepare to page the results
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
$rows_per_page = (!empty($_SESSION['domain']['paging']['numeric'])) ? $_SESSION['domain']['paging']['numeric'] : 50;
$param = "&search=".urlencode($search);
if ($_GET['show'] == "all" && permission_exists('call_flow_all')) {
if (!empty($_GET['show']) == "all" && permission_exists('call_flow_all')) {
$param .= "&show=all";
}
$page = $_GET['page'];
$page = $_GET['page'] ?? '';
if (empty($page)) { $page = 0; $_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);
@@ -130,7 +133,7 @@
$sql .= order_by($order_by, $order, 'call_flow_name', 'asc');
$sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$call_flows = $database->select($sql, $parameters, 'all');
$call_flows = $database->select($sql, $parameters ?? null, 'all');
unset($sql, $parameters);
//create token
@@ -174,7 +177,7 @@
}
echo "<form id='form_search' class='inline' method='get'>\n";
if (permission_exists('call_flow_all')) {
if ($_GET['show'] == 'all') {
if (!empty($_GET['show']) == 'all') {
echo " <input type='hidden' name='show' value='all'>";
}
else {
@@ -214,10 +217,10 @@
echo "<tr class='list-header'>\n";
if (permission_exists('call_flow_add') || permission_exists('call_flow_edit') || permission_exists('call_flow_delete')) {
echo " <th class='checkbox'>\n";
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($call_flows ?: "style='visibility: hidden;'").">\n";
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".(!empty($call_flows) ?: "style='visibility: hidden;'").">\n";
echo " </th>\n";
}
if ($_GET['show'] == "all" && permission_exists('call_flow_all')) {
if (!empty($_GET['show']) == "all" && permission_exists('call_flow_all')) {
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, $param, "class='shrink'");
}
echo th_order_by('call_flow_name', $text['label-call_flow_name'], $order_by, $order);
@@ -229,12 +232,12 @@
}
echo th_order_by('call_flow_enabled', $text['label-enabled'], $order_by, $order, null, "class='center'");
echo th_order_by('call_flow_description', $text['label-call_flow_description'], $order_by, $order, null, "class='hide-sm-dn'");
if (permission_exists('call_flow_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
if (permission_exists('call_flow_edit') && $list_row_edit_button == 'true') {
echo " <td class='action-button'>&nbsp;</td>\n";
}
echo "</tr>\n";
if (is_array($call_flows)) {
if (!empty($call_flows)) {
$x = 0;
foreach ($call_flows as $row) {
if (permission_exists('call_flow_edit')) {
@@ -247,7 +250,7 @@
echo " <input type='hidden' name='call_flows[$x][uuid]' value='".escape($row['call_flow_uuid'])."' />\n";
echo " </td>\n";
}
if ($_GET['show'] == "all" && permission_exists('call_flow_all')) {
if (!empty($_GET['show']) == "all" && permission_exists('call_flow_all')) {
if (!empty($_SESSION['domains'][$row['domain_uuid']]['domain_name'])) {
$domain = $_SESSION['domains'][$row['domain_uuid']]['domain_name'];
}
@@ -281,7 +284,7 @@
echo escape($row['call_flow_enabled']);
}
echo " <td class='description overflow hide-sm-dn'>".escape($row['call_flow_description'])."&nbsp;</td>\n";
if (permission_exists('call_flow_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
if (permission_exists('call_flow_edit') && $list_row_edit_button == 'true') {
echo " <td class='action-button'>";
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
echo " </td>\n";