Convert boolean values to a string before being copied (#7591)

* Convert boolean values to a string before being copied

* Update access_controls.php

* Update copyright year and handle boolean values

Updated copyright year from 2019 to 2025 and added conversion of boolean values to strings in the database result processing.

* Update call_block.php

* Update call_center.php

* Update call_flows.php

* Update conference_controls.php

* Update conference_profiles.php

* Update conferences.php

* Update device.php

* Update dialplan.php

* Update event_guard.php

* Update extension_settings.php

* Update fax.php

* Update fax_queue.php

* Update gateways.php

* Update ivr_menu.php

* Update number_translations.php

* Update phrases.php

* Update pin_numbers.php

* Update ring_groups.php

* Update streams.php

* Update time_conditions.php

* Update vars.php

* Update email_templates.php

* Update users.php

* Update domains.php

* Update groups.php

* Update extension_copy.php

* Update device_copy.php
This commit is contained in:
Alex
2025-10-22 16:14:22 -07:00
committed by GitHub
parent 0ab13ffc31
commit 126779190f
30 changed files with 485 additions and 51 deletions

View File

@@ -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) 2018-2024
Portions created by the Initial Developer are Copyright (C) 2018-2025
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -71,8 +71,8 @@
//prepare the array
$x = 0;
foreach ($access_controls as $row) {
$array['access_controls'][$x]['checked'] = $row['checked'] ?? null;
$array['access_controls'][$x]['access_control_uuid'] = $row['access_control_uuid'];
$array[$x]['checked'] = $row['checked'] ?? null;
$array[$x]['uuid'] = $row['access_control_uuid'];
$x++;
}
@@ -80,17 +80,20 @@
switch ($action) {
case 'copy':
if (permission_exists('access_control_add')) {
$database->copy($array);
$obj = new access_controls;
$obj->copy($array);
}
break;
case 'toggle':
if (permission_exists('access_control_edit')) {
$database->toggle($array);
$obj = new access_controls;
$obj->toggle($array);
}
break;
case 'delete':
if (permission_exists('access_control_delete')) {
$database->delete($array);
$obj = new access_controls;
$obj->delete($array);
}
break;
}

View File

@@ -222,6 +222,14 @@
foreach ($rows as $x => $row) {
$primary_uuid = uuid();
//convert boolean values to a string
foreach($row as $key => $value) {
if (gettype($value) == 'boolean') {
$value = $value ? 'true' : 'false';
$row[$key] = $value;
}
}
//copy data
$array[$this->table][$x] = $row;