more php 8.1 changes (#6727)

* Update call_broadcast.php

* Update call_broadcast_edit.php

* Update conference_center_edit.php

* Update call_flows.php

* Update conference_room_edit.php

* Update conference_sessions.php

* Update conference_session_details.php

* Update conference_rooms.php

* Update conference_controls.php

* Update conference_control_edit.php

* Update conference_control_details.php

* Update conference_control_detail_edit.php

* Update conference_profiles.php

* Update conference_profile_edit.php

* Update conference_profile_params.php

* Update conference_profile_param_edit.php

* Update conferences.php

* Update conference_edit.php

* Update conferences.php

* Update conference_interactive_inc.php

* Update contacts.php
This commit is contained in:
Alex
2023-05-31 09:11:50 -06:00
committed by GitHub
parent 1d23d548d0
commit 410f5e6f68
20 changed files with 357 additions and 265 deletions

View File

@@ -21,8 +21,13 @@
$language = new text;
$text = $language->get();
//set the defaults
$control_digits = '';
$control_action = '';
$control_data = '';
//action add or update
if (is_uuid($_REQUEST["id"])) {
if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
$action = "update";
$conference_control_detail_uuid = $_REQUEST["id"];
}
@@ -31,12 +36,12 @@
}
//set the parent uuid
if (is_uuid($_GET["conference_control_uuid"])) {
if (!empty($_GET["conference_control_uuid"]) && is_uuid($_GET["conference_control_uuid"])) {
$conference_control_uuid = $_GET["conference_control_uuid"];
}
//get http post variables and set them to php variables
if (count($_POST) > 0) {
if (!empty($_POST)) {
$control_digits = $_POST["control_digits"];
$control_action = $_POST["control_action"];
$control_data = $_POST["control_data"];
@@ -44,7 +49,7 @@
}
//process the http post
if (count($_POST) > 0 && empty($_POST["persistformvar"])) {
if (!empty($_POST) && empty($_POST["persistformvar"])) {
//get the uuid
if ($action == "update") {
@@ -79,7 +84,7 @@
}
//add or update the database
if ($_POST["persistformvar"] != "true") {
if (empty($_POST["persistformvar"])) {
$array['conference_control_details'][0]['conference_control_uuid'] = $conference_control_uuid;
$array['conference_control_details'][0]['control_digits'] = $control_digits;
@@ -112,16 +117,16 @@
}
//pre-populate the form
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {
$conference_control_detail_uuid = $_GET["id"];
if (!empty($_GET) && empty($_POST["persistformvar"])) {
$conference_control_detail_uuid = $_GET["id"] ?? '';
$sql = "select * from v_conference_control_details ";
$sql .= "where conference_control_detail_uuid = :conference_control_detail_uuid ";
//$sql .= "and domain_uuid = :domain_uuid ";
$parameters['conference_control_detail_uuid'] = $conference_control_detail_uuid;
//$parameters['domain_uuid'] = $_SESSION['domain_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)) {
$control_digits = $row["control_digits"];
$control_action = $row["control_action"];
$control_data = $row["control_data"];
@@ -147,7 +152,7 @@
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-conference_control_detail']."</b></div>\n";
echo " <div class='actions'>\n";
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','collapse'=>'hide-xs','style'=>'margin-right: 15px;','link'=>'conference_control_edit.php?id='.urlencode($conference_control_uuid)]);
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','collapse'=>'hide-xs','style'=>'margin-right: 15px;','link'=>'conference_control_edit.php?id='.urlencode($conference_control_uuid ?? '')]);
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','collapse'=>'hide-xs']);
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
@@ -213,9 +218,9 @@
echo "</table>";
echo "<br /><br />";
echo "<input type='hidden' name='conference_control_uuid' value='".escape($conference_control_uuid)."'>\n";
echo "<input type='hidden' name='conference_control_uuid' value='".escape($conference_control_uuid ?? '')."'>\n";
if ($action == "update") {
echo "<input type='hidden' name='conference_control_detail_uuid' value='".escape($conference_control_detail_uuid)."'>\n";
echo "<input type='hidden' name='conference_control_detail_uuid' value='".escape($conference_control_detail_uuid ?? '')."'>\n";
}
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";

View File

@@ -46,15 +46,18 @@
$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 the http post data
if (is_array($_POST['conference_control_details'])) {
if (!empty($_POST['conference_control_details'])) {
$action = $_POST['action'];
$conference_control_uuid = $_POST['conference_control_uuid'];
$conference_control_details = $_POST['conference_control_details'];
}
//process the http post data by action
if ($action != '' && is_array($conference_control_details) && @sizeof($conference_control_details) != 0) {
if (!empty($action) && !empty($conference_control_details)) {
switch ($action) {
case 'toggle':
if (permission_exists('conference_control_detail_edit')) {
@@ -77,11 +80,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 = $_GET["search"];
$search = $_GET["search"] ?? '';
if (!empty($search)) {
$sql_search = "and (";
$sql_search .= "control_digits like :search";
@@ -96,27 +99,27 @@
$sql = "select count(conference_control_detail_uuid) ";
$sql .= "from v_conference_control_details ";
$sql .= "where conference_control_uuid = :conference_control_uuid ";
$sql .= $sql_search;
$parameters['conference_control_uuid'] = $conference_control_uuid;
$sql .= $sql_search ?? '';
$parameters['conference_control_uuid'] = $conference_control_uuid ?? '';
$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;
$param = "&id=".$conference_control_uuid;
$rows_per_page = (!empty($_SESSION['domain']['paging']['numeric'])) ? $_SESSION['domain']['paging']['numeric'] : 50;
$param = "&id=".!empty($conference_control_uuid);
if (isset($_GET['page'])) {
$page = is_numeric($_GET['page']) ? $_GET['page'] : 0;
$page = isset($_GET['page']) ? $_GET['page'] : 0;
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
$offset = $rows_per_page * $page;
}
//get the list
$sql = str_replace('count(conference_control_detail_uuid)', '*', $sql);
$sql .= $sql_search;
$sql .= $sql_search ?? '';
$sql .= order_by($order_by, $order, 'control_digits', 'asc');
$sql .= limit_offset($rows_per_page, $offset);
$sql .= limit_offset($rows_per_page, !empty($offset));
$database = new database;
$result = $database->select($sql, $parameters, 'all');
$result = $database->select($sql, $parameters ?? null, 'all');
unset($sql, $parameters);
//create token
@@ -129,7 +132,7 @@
echo " <div class='actions'>\n";
echo button::create(['type'=>'button','id'=>'action_bar_sub_button_back','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'collapse'=>'hide-xs','style'=>'margin-right: 15px; display: none;','link'=>'conference_controls.php']);
if (permission_exists('conference_control_detail_add')) {
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'name'=>'btn_add','collapse'=>'hide-xs','link'=>'conference_control_detail_edit.php?conference_control_uuid='.urlencode($_GET['id'])]);
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'name'=>'btn_add','collapse'=>'hide-xs','link'=>'conference_control_detail_edit.php?conference_control_uuid='.urlencode($_GET['id'] ?? '')]);
}
if (permission_exists('conference_control_detail_edit') && $result) {
echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$_SESSION['theme']['button_icon_toggle'],'name'=>'btn_toggle','collapse'=>'hide-xs','onclick'=>"modal_open('modal-toggle','btn_toggle');"]);
@@ -150,7 +153,7 @@
echo "<form id='form_list' method='post' action='conference_control_details.php'>\n";
echo "<input type='hidden' id='action' name='action' value=''>\n";
echo "<input type='hidden' name='conference_control_uuid' value=\"".escape($conference_control_uuid)."\">\n";
echo "<input type='hidden' name='conference_control_uuid' value=\"".escape($conference_control_uuid ?? '')."\">\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
@@ -163,12 +166,12 @@
echo th_order_by('control_action', $text['label-control_action'], $order_by, $order, null, null, $param);
echo th_order_by('control_data', $text['label-control_data'], $order_by, $order, null, "class='pct-50 hide-xs'", $param);
echo th_order_by('control_enabled', $text['label-control_enabled'], $order_by, $order, null, "class='center'", $param);
if (permission_exists('conference_control_detail_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
if (permission_exists('conference_control_detail_edit') && $list_row_edit_button == 'true') {
echo " <td class='action-button'>&nbsp;</td>\n";
}
echo "</tr>\n";
if (is_array($result) && @sizeof($result) != 0) {
if (!empty($result)) {
$x = 0;
foreach ($result as $row) {
if (permission_exists('conference_control_detail_edit')) {
@@ -200,7 +203,7 @@
echo $text['label-'.$row['control_enabled']];
}
echo " </td>\n";
if (permission_exists('conference_control_detail_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
if (permission_exists('conference_control_detail_edit') && $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";
@@ -213,7 +216,7 @@
echo "</table>\n";
echo "<br />\n";
echo "<div align='center'>".$paging_controls."</div>\n";
echo "<div align='center'>".!empty($paging_controls)."</div>\n";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>\n";
@@ -237,4 +240,4 @@
//include the footer
require_once "resources/footer.php";
?>
?>

View File

@@ -21,8 +21,12 @@
$language = new text;
$text = $language->get();
//set the defaults
$control_name = '';
$control_description = '';
//action add or update
if (is_uuid($_REQUEST["id"])) {
if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
$action = "update";
$conference_control_uuid = $_REQUEST["id"];
}
@@ -31,14 +35,14 @@
}
//get http post variables and set them to php variables
if (count($_POST) > 0) {
if (!empty($_POST)) {
$control_name = $_POST["control_name"];
$control_enabled = $_POST["control_enabled"] ?: 'false';
$control_description = $_POST["control_description"];
}
//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") {
@@ -107,15 +111,15 @@
} //(is_array($_POST) && empty($_POST["persistformvar"]))
//pre-populate the form
if (is_array($_GET) && $_POST["persistformvar"] != "true") {
if (!empty($_GET) && !empty($_POST["persistformvar"])) {
$conference_control_uuid = $_GET["id"];
$sql = "select * from v_conference_controls ";
//$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "where conference_control_uuid = :conference_control_uuid ";
$parameters['conference_control_uuid'] = $conference_control_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)) {
$control_name = $row["control_name"];
$control_enabled = $row["control_enabled"];
$control_description = $row["control_description"];

View File

@@ -46,15 +46,18 @@
$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 the http post data
if (is_array($_POST['conference_controls'])) {
if (!empty($_POST['conference_controls'])) {
$action = $_POST['action'];
$search = $_POST['search'];
$conference_controls = $_POST['conference_controls'];
}
//process the http post data by action
if ($action != '' && is_array($conference_controls) && @sizeof($conference_controls) != 0) {
if (!empty($action) && !empty($conference_controls)) {
switch ($action) {
case 'copy':
if (permission_exists('conference_control_add')) {
@@ -76,16 +79,16 @@
break;
}
header('Location: conference_controls.php'.($search != '' ? '?search='.urlencode($search) : null));
header('Location: conference_controls.php'.(!empty($search) ? '?search='.urlencode($search) : null));
exit;
}
//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
$search = strtolower($_GET["search"]);
$search = strtolower($_GET["search"] ?? '');
if (!empty($search)) {
$sql_search = "where (";
$sql_search .= " lower(control_name) like :search ";
@@ -96,14 +99,14 @@
//get the count
$sql = "select count(conference_control_uuid) from v_conference_controls ";
$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 ? "&search=".$search : null;
$page = is_numeric($_GET['page']) ? $_GET['page'] : 0;
$page = isset($_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);
$offset = $rows_per_page * $page;
@@ -113,7 +116,7 @@
$sql .= order_by($order_by, $order, 'control_name', 'asc');
$sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$conference_controls = $database->select($sql, $parameters, 'all');
$conference_controls = $database->select($sql, $parameters ?? null, 'all');
unset($sql, $parameters);
//create token
@@ -173,18 +176,18 @@
echo "<tr class='list-header'>\n";
if (permission_exists('conference_control_add') || permission_exists('conference_control_edit') || permission_exists('conference_control_delete')) {
echo " <th class='checkbox'>\n";
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($conference_controls ?: "style='visibility: hidden;'").">\n";
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".(!empty($conference_controls) ?: "style='visibility: hidden;'").">\n";
echo " </th>\n";
}
echo th_order_by('control_name', $text['label-control_name'], $order_by, $order);
echo th_order_by('control_enabled', $text['label-control_enabled'], $order_by, $order, null, "class='center shrink'");
echo " <th class='hide-sm-dn'>".$text['label-control_description']."</th>\n";
if (permission_exists('conference_control_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
if (permission_exists('conference_control_edit') && $list_row_edit_button == 'true') {
echo " <td class='action-button'>&nbsp;</td>\n";
}
echo "</tr>\n";
if (is_array($conference_controls) && @sizeof($conference_controls) != 0) {
if (!empty($conference_controls)) {
$x = 0;
foreach ($conference_controls as $row) {
if (permission_exists('conference_control_edit')) {
@@ -215,7 +218,7 @@
}
echo " </td>\n";
echo " <td class='description overflow hide-sm-dn'>".escape($row['control_description'])."</td>\n";
if (permission_exists('conference_control_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
if (permission_exists('conference_control_edit') && $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";