Ring Groups: Hide buttons till checkbox checked, Updates for PHP 8.1.

This commit is contained in:
fusionate
2023-06-08 20:46:57 +00:00
parent 9f9021cb69
commit ec40d59152
3 changed files with 40 additions and 38 deletions
@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2010-2019
Portions created by the Initial Developer are Copyright (C) 2010-2023
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -85,7 +85,7 @@ if (!class_exists('ring_groups')) {
//filter out unchecked ring groups, build where clause for below
foreach ($records as $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
@@ -195,13 +195,13 @@ if (!class_exists('ring_groups')) {
//filter out unchecked ring groups, build where clause for below
foreach ($records as $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = $record['uuid'];
}
}
//get ring group context
if (is_array($uuids) && @sizeof($uuids) != 0) {
if (!empty($uuids) && is_array($uuids) && @sizeof($uuids) != 0) {
$sql = "select ring_group_context from v_ring_groups ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and ring_group_uuid = :ring_group_uuid ";
@@ -213,7 +213,7 @@ if (!class_exists('ring_groups')) {
}
//build the delete array
if (is_array($uuids) && @sizeof($uuids) != 0) {
if (!empty($uuids) && is_array($uuids) && @sizeof($uuids) != 0) {
$x = 0;
foreach ($uuids as $uuid) {
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $uuid;
@@ -223,7 +223,7 @@ if (!class_exists('ring_groups')) {
}
//delete the checked rows
if (is_array($array) && @sizeof($array) != 0) {
if (!empty($array) && is_array($array) && @sizeof($array) != 0) {
//execute delete
$database = new database;
@@ -269,8 +269,8 @@ if (!class_exists('ring_groups')) {
if (is_array($records) && @sizeof($records) != 0) {
//get current toggle state
foreach($records as $x => $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
foreach ($records as $x => $record) {
if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}
@@ -366,8 +366,8 @@ if (!class_exists('ring_groups')) {
if (is_array($records) && @sizeof($records) != 0) {
//get checked records
foreach($records as $record) {
if ($record['checked'] == 'true' && is_uuid($record['uuid'])) {
foreach ($records as $record) {
if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) {
$uuids[] = "'".$record['uuid']."'";
}
}