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,12 @@
$language = new text;
$text = $language->get();
//set the defaults
$profile_name = '';
$profile_description = '';
//action add or update
if (is_uuid($_REQUEST["id"])) {
if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
$action = "update";
$conference_profile_uuid = $_REQUEST["id"];
}
@@ -31,13 +35,13 @@
}
//get http post variables and set them to php variables
if (count($_POST) > 0) {
if (!empty($_POST)) {
$profile_name = $_POST["profile_name"];
$profile_enabled = $_POST["profile_enabled"] ?: 'false';
$profile_description = $_POST["profile_description"];
}
//check to see if the http post exists
if (count($_POST) > 0 && empty($_POST["persistformvar"])) {
if (!empty($_POST) && empty($_POST["persistformvar"])) {
//get the uuid
if ($action == "update") {
@@ -72,7 +76,7 @@
}
//add or update the database
if ($_POST["persistformvar"] != "true") {
if (empty($_POST["persistformvar"])) {
$array['conference_profiles'][0]['profile_name'] = $profile_name;
$array['conference_profiles'][0]['profile_enabled'] = $profile_enabled;
@@ -103,7 +107,7 @@
}
//pre-populate the form
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {
if (!empty($_GET) && empty($_POST["persistformvar"])) {
$conference_profile_uuid = $_GET["id"];
$sql = "select * from v_conference_profiles ";
$sql .= "where conference_profile_uuid = :conference_profile_uuid ";
@@ -111,7 +115,7 @@
$parameters['conference_profile_uuid'] = $conference_profile_uuid;
//$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$row = $database->select($sql, $parameters, 'row');
$row = $database->select($sql, $parameters ?? null, 'row');
if (is_array($row) && sizeof($row) != 0) {
$profile_name = $row["profile_name"];
$profile_enabled = $row["profile_enabled"];

View File

@@ -21,8 +21,13 @@
$language = new text;
$text = $language->get();
//set the defaults
$profile_param_name = '';
$profile_param_value = '';
$profile_param_description = '';
//action add or update
if (is_uuid($_REQUEST["id"])) {
if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
$action = "update";
$conference_profile_param_uuid = $_REQUEST["id"];
}
@@ -31,12 +36,12 @@
}
//set the parent uuid
if (is_uuid($_GET["conference_profile_uuid"])) {
if (!empty($_GET["conference_profile_uuid"]) && is_uuid($_GET["conference_profile_uuid"])) {
$conference_profile_uuid = $_GET["conference_profile_uuid"];
}
//get http post variables and set them to php variables
if (count($_POST)>0) {
if (!empty($_POST)) {
$profile_param_name = $_POST["profile_param_name"];
$profile_param_value = $_POST["profile_param_value"];
$profile_param_enabled = $_POST["profile_param_enabled"] ?: 'false';
@@ -44,7 +49,7 @@
}
//process the http post if it exists
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_profile_params'][0]['conference_profile_uuid'] = $conference_profile_uuid;
$array['conference_profile_params'][0]['profile_param_name'] = $profile_param_name;
@@ -112,14 +117,14 @@
}
//pre-populate the form
if (count($_GET) > 0 && $_POST["persistformvar"] != "true") {
$conference_profile_param_uuid = $_GET["id"];
if (!empty($_GET) && empty($_POST["persistformvar"])) {
$conference_profile_param_uuid = $_GET["id"] ?? '';
$sql = "select * from v_conference_profile_params ";
$sql .= "where conference_profile_param_uuid = :conference_profile_param_uuid ";
$parameters['conference_profile_param_uuid'] = $conference_profile_param_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row');
if (is_array($row) && sizeof($row)) {
$row = $database->select($sql, $parameters ?? null, 'row');
if (!empty($row)) {
$profile_param_name = $row["profile_param_name"];
$profile_param_value = $row["profile_param_value"];
$profile_param_enabled = $row["profile_param_enabled"];

View File

@@ -22,15 +22,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_profile_params'])) {
if (!empty($_POST['conference_profile_params'])) {
$action = $_POST['action'];
$conference_profile_uuid = $_POST['conference_profile_uuid'];
$conference_profile_params = $_POST['conference_profile_params'];
}
//process the http post data by action
if ($action != '' && is_array($conference_profile_params) && @sizeof($conference_profile_params) != 0) {
if (!empty($action) && !empty($conference_profile_params)) {
switch ($action) {
case 'toggle':
if (permission_exists('conference_profile_param_edit')) {
@@ -53,8 +56,8 @@
}
//get variables used to control the order
$order_by = $_GET["order_by"];
$order = $_GET["order"];
$order_by = $_GET["order_by"] ?? '';
$order = $_GET["order"] ?? '';
//prepare to page the results
$sql = "select count(conference_profile_param_uuid) ";
@@ -65,10 +68,10 @@
$num_rows = $database->select($sql, $parameters, '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 = "&id=".$conference_profile_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;
}
@@ -76,9 +79,9 @@
//get the list
$sql = str_replace('count(conference_profile_param_uuid)', '*', $sql);
$sql .= order_by($order_by, $order, 'profile_param_name', 'asc');
$sql .= limit_offset($rows_per_page, $offset);
$sql .= limit_offset($rows_per_page ?? '', $offset ?? '');
$database = new database;
$result = $database->select($sql, $parameters, 'all');
$result = $database->select($sql, $parameters ?? null, 'all');
unset($sql, $parameters);
//create token
@@ -121,19 +124,19 @@
echo "<tr class='list-header'>\n";
if (permission_exists('conference_profile_param_edit') || permission_exists('conference_profile_param_delete')) {
echo " <th class='checkbox'>\n";
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle();' ".($result ?: "style='visibility: hidden;'").">\n";
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle();' ".(!empty($result) ?: "style='visibility: hidden;'").">\n";
echo " </th>\n";
}
echo th_order_by('profile_param_name', $text['label-profile_param_name'], $order_by, $order, null, null, $param);
echo th_order_by('profile_param_value', $text['label-profile_param_value'], $order_by, $order, null, "class='pct-40'", $param);
echo th_order_by('profile_param_enabled', $text['label-profile_param_enabled'], $order_by, $order, null, "class='center'", $param);
echo th_order_by('profile_param_description', $text['label-profile_param_description'], $order_by, $order, null, "class='hide-sm-dn'", $param);
if (permission_exists('conference_profile_param_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
if (permission_exists('conference_profile_param_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_profile_param_edit')) {
@@ -165,7 +168,7 @@
}
echo " </td>\n";
echo " <td class='description overflow hide-sm-dn'>".escape($row['profile_param_description'])."&nbsp;</td>\n";
if (permission_exists('conference_profile_param_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
if (permission_exists('conference_profile_param_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";
@@ -178,7 +181,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";
@@ -200,4 +203,4 @@
//include the footer
require_once "resources/footer.php";
?>
?>

View File

@@ -45,15 +45,21 @@
$language = new text;
$text = $language->get();
//set additional variables
$search = $_GET["search"] ?? '';
//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_profiles'])) {
if (!empty($_POST['conference_profiles'])) {
$action = $_POST['action'];
$search = $_POST['search'];
$conference_profiles = $_POST['conference_profiles'];
}
//process the http post data by action
if ($action != '' && is_array($conference_profiles) && @sizeof($conference_profiles) != 0) {
if (!empty($action) && !empty($conference_profiles)) {
switch ($action) {
case 'copy':
if (permission_exists('conference_profile_add')) {
@@ -75,13 +81,13 @@
break;
}
header('Location: conference_profiles.php'.($search != '' ? '?search='.urlencode($search) : null));
header('Location: conference_profiles.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
if (isset($_GET["search"])) {
@@ -99,14 +105,14 @@
$sql .= "where ".$sql_search;
}
$database = new database;
$num_rows = $database->select($sql, $parameters, 'column');
$num_rows = $database->select($sql, $parameters ?? null, 'column');
//get the list
$sql = str_replace('count(conference_profile_uuid)', '*', $sql);
$sql .= order_by($order_by, $order, 'profile_name', 'asc');
$sql .= limit_offset($rows_per_page, $offset);
$sql .= limit_offset($rows_per_page ?? '', $offset ?? '');
$database = new database;
$conference_profiles = $database->select($sql, $parameters, 'all');
$conference_profiles = $database->select($sql, $parameters ?? null, 'all');
unset($sql, $parameters);
//create token
@@ -137,7 +143,7 @@
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'=>'conference_profiles.php','style'=>($search == '' ? 'display: none;' : null)]);
if ($paging_controls_mini != '') {
if (!empty($paging_controls_mini)) {
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>\n";
}
echo " </form>\n";
@@ -166,18 +172,18 @@
echo "<tr class='list-header'>\n";
if (permission_exists('conference_profile_add') || permission_exists('conference_profile_edit') || permission_exists('conference_profile_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_profiles ?: "style='visibility: hidden;'").">\n";
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".(!empty($conference_profiles) ?: "style='visibility: hidden;'").">\n";
echo " </th>\n";
}
echo th_order_by('profile_name', $text['label-profile_name'], $order_by, $order);
echo th_order_by('profile_enabled', $text['label-profile_enabled'], $order_by, $order, null, "class='center'");
echo " <th class='hide-sm-dn'>".$text['label-profile_description']."</th>\n";
if (permission_exists('conference_profile_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
if (permission_exists('conference_profile_edit') && $list_row_edit_button == 'true') {
echo " <td class='action-button'>&nbsp;</td>\n";
}
echo "</tr>\n";
if (is_array($conference_profiles) && @sizeof($conference_profiles) != 0) {
if (!empty($conference_profiles)) {
$x = 0;
foreach ($conference_profiles as $row) {
if (permission_exists('conference_profile_edit')) {
@@ -208,7 +214,7 @@
}
echo " </td>\n";
echo " <td class='description overflow hide-sm-dn'>".escape($row['profile_description'])."</td>\n";
if (permission_exists('conference_profile_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
if (permission_exists('conference_profile_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";
@@ -221,7 +227,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";