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

View File

@@ -49,6 +49,13 @@
$action = "add";
}
//set the defaults
$bridge_uuid = '';
$bridge_name = '';
$bridge_destination = '';
$bridge_enabled = '';
$bridge_description = '';
//get http post variables and set them to php variables
if (!empty($_POST)) {
$bridge_uuid = $_POST["bridge_uuid"] ?? null;
@@ -59,7 +66,7 @@
}
//process the user data and save it to the database
if (count($_POST) > 0 && empty($_POST["persistformvar"])) {
if (!empty($_POST) && empty($_POST["persistformvar"])) {
//delete the bridge
if (permission_exists('bridge_delete')) {
@@ -152,8 +159,8 @@
$sql .= "where bridge_uuid = :bridge_uuid ";
$parameters['bridge_uuid'] = $bridge_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row');
if (is_array($row) && sizeof($row) != 0) {
$row = $database->select($sql, $parameters ?? null, 'row');
if (!empty($row)) {
$bridge_name = $row["bridge_name"];
$bridge_destination = $row["bridge_destination"];
$bridge_enabled = $row["bridge_enabled"];
@@ -199,7 +206,7 @@
echo " ".$text['label-bridge_name']."\n";
echo "</td>\n";
echo "<td width='70%' class='vtable' style='position: relative;' align='left'>\n";
echo " <input class='formfld' type='text' name='bridge_name' maxlength='255' value='".escape($bridge_name ?? '')."'>\n";
echo " <input class='formfld' type='text' name='bridge_name' maxlength='255' value='".escape($bridge_name)."'>\n";
echo "<br />\n";
echo $text['description-bridge_name']."\n";
echo "</td>\n";
@@ -210,7 +217,7 @@
echo " ".$text['label-bridge_destination']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <input class='formfld' type='text' name='bridge_destination' maxlength='255' value='".escape($bridge_destination ?? '')."'>\n";
echo " <input class='formfld' type='text' name='bridge_destination' maxlength='255' value='".escape($bridge_destination)."'>\n";
echo "<br />\n";
echo $text['description-bridge_destination']."\n";
echo "</td>\n";
@@ -243,7 +250,7 @@
echo " ".$text['label-bridge_description']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='bridge_description' maxlength='255' value=\"".escape($bridge_description ?? '')."\">\n";
echo " <input class='formfld' type='text' name='bridge_description' maxlength='255' value=\"".escape($bridge_description)."\">\n";
echo "<br />\n";
echo $text['description-bridge_description']."\n";
echo "</td>\n";

View File

@@ -46,15 +46,22 @@
$language = new text;
$text = $language->get();
//set additional variables
$search = $_GET["search"] ?? '';
$show = $_GET["show"] ?? '';
//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 the http post data
if (isset($_POST['bridges']) && is_array($_POST['bridges'])) {
if (!empty($_POST['bridges'])) {
$action = $_POST['action'];
$search = $_POST['search'];
$bridges = $_POST['bridges'];
}
//process the http post data by action
if (isset($action) && $action != '' && is_array($bridges) && @sizeof($bridges) != 0) {
if (!empty($action) && !empty($bridges)) {
switch ($action) {
case 'copy':
if (permission_exists('bridge_add')) {
@@ -76,7 +83,7 @@
break;
}
header('Location: bridges.php'.($search != '' ? '?search='.urlencode($search) : null));
header('Location: bridges.php'.(!empty($search) ? '?search='.urlencode($search) : null));
exit;
}
@@ -85,7 +92,7 @@
$order = $_GET["order"] ?? '';
//add the search string
if (isset($_GET["search"])) {
if (!empty($search)) {
$search = strtolower($_GET["search"]);
$sql_search = " (";
$sql_search .= " lower(bridge_name) like :search ";
@@ -98,7 +105,7 @@
//get the count
$sql = "select count(bridge_uuid) from v_bridges ";
if (isset($_GET['show']) && $_GET['show'] == "all" && permission_exists('bridge_all')) {
if (!empty($show) && $show == "all" && permission_exists('bridge_all')) {
if (isset($sql_search)) {
$sql .= "where ".$sql_search;
}
@@ -156,14 +163,14 @@
}
echo "<form id='form_search' class='inline' method='get'>\n";
if (permission_exists('bridge_all')) {
if (isset($_GET['show']) && $_GET['show'] == 'all') {
if (isset($show) && $show == 'all') {
echo " <input type='hidden' name='show' value='all'>\n";
}
else {
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?show=all']);
}
}
echo "<input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search ?? '')."\" placeholder=\"".$text['label-search']."\" onkeydown=''>";
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'=>'bridges.php','style'=>($search == '' ? 'display: none;' : null)]);
if ($paging_controls_mini != '') {
@@ -189,7 +196,7 @@
echo "<form id='form_list' method='post'>\n";
echo "<input type='hidden' id='action' name='action' value=''>\n";
echo "<input type='hidden' name='search' value=\"".escape($search ?? '')."\">\n";
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
@@ -198,19 +205,19 @@
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".(empty($bridges) ? "style='visibility: hidden;'" : null).">\n";
echo " </th>\n";
}
if (isset($_GET['show']) && $_GET['show'] == 'all' && permission_exists('bridge_all')) {
if (!empty($show) && $show == 'all' && permission_exists('bridge_all')) {
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order);
}
echo th_order_by('bridge_name', $text['label-bridge_name'], $order_by, $order);
echo th_order_by('bridge_destination', $text['label-bridge_destination'], $order_by, $order);
echo th_order_by('bridge_enabled', $text['label-bridge_enabled'], $order_by, $order, null, "class='center'");
echo " <th class='hide-sm-dn'>".$text['label-bridge_description']."</th>\n";
if (permission_exists('bridge_edit') && isset($_SESSION['theme']['list_row_edit_button']) && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
if (permission_exists('bridge_edit') && !empty($list_row_edit_button) && $list_row_edit_button == 'true') {
echo " <td class='action-button'>&nbsp;</td>\n";
}
echo "</tr>\n";
if (is_array($bridges) && @sizeof($bridges) != 0) {
if (!empty($bridges)) {
$x = 0;
foreach ($bridges as $row) {
if (permission_exists('bridge_edit')) {
@@ -245,7 +252,7 @@
}
echo " </td>\n";
echo " <td class='description overflow hide-sm-dn'>".escape($row['bridge_description'])."</td>\n";
if (permission_exists('bridge_edit') && !empty($_SESSION['theme']['list_row_edit_button']['boolean']) && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
if (permission_exists('bridge_edit') && !empty($list_row_edit_button) && $list_row_edit_button == 'true') {
echo " <td class='action-button'>\n";
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
echo " </td>\n";