mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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) 2008-2019
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -249,6 +249,14 @@
|
||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
||||
foreach ($rows as $x => $row) {
|
||||
|
||||
//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;
|
||||
|
||||
|
||||
@@ -272,6 +272,14 @@
|
||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
||||
foreach ($rows as $x => $row) {
|
||||
|
||||
//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;
|
||||
|
||||
|
||||
@@ -533,6 +533,14 @@
|
||||
$new_call_center_queue_uuid = uuid();
|
||||
$new_dialplan_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;
|
||||
|
||||
@@ -566,6 +574,14 @@
|
||||
$dialplan = $this->database->select($sql_3, $parameters_3, 'row');
|
||||
if (is_array($dialplan) && @sizeof($dialplan) != 0) {
|
||||
|
||||
//convert boolean values to a string
|
||||
foreach($dialplan as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$dialplan[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['dialplans'][$x] = $dialplan;
|
||||
|
||||
|
||||
@@ -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) 2008 - 2019
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -363,6 +363,14 @@
|
||||
$new_call_flow_uuid = uuid();
|
||||
$new_dialplan_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;
|
||||
|
||||
@@ -377,6 +385,14 @@
|
||||
$dialplan = $this->database->select($sql_2, $parameters_2, 'row');
|
||||
if (is_array($dialplan) && @sizeof($dialplan) != 0) {
|
||||
|
||||
//convert boolean values to a string
|
||||
foreach($dialplan as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$dialplan[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['dialplans'][$x] = $dialplan;
|
||||
|
||||
|
||||
@@ -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) 2019-2023
|
||||
Portions created by the Initial Developer are Copyright (C) 2019-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -363,6 +363,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;
|
||||
|
||||
@@ -377,6 +385,14 @@
|
||||
if (is_array($rows_2) && @sizeof($rows_2) != 0) {
|
||||
foreach ($rows_2 as $row_2) {
|
||||
|
||||
//convert boolean values to a string
|
||||
foreach($row_2 as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$row_2[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['conference_control_details'][$y] = $row_2;
|
||||
|
||||
@@ -397,7 +413,6 @@
|
||||
//save the changes and set the message
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
//save the array
|
||||
|
||||
$this->database->save($array);
|
||||
unset($array);
|
||||
|
||||
|
||||
@@ -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) 2019-2023
|
||||
Portions created by the Initial Developer are Copyright (C) 2019-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -107,7 +107,7 @@
|
||||
$p->add('conference_profile_param_delete', 'temp');
|
||||
|
||||
//execute delete
|
||||
$this->$database->delete($array);
|
||||
$this->database->delete($array);
|
||||
unset($array);
|
||||
|
||||
//revoke temporary permissions
|
||||
@@ -159,7 +159,7 @@
|
||||
//delete the checked rows
|
||||
if (!empty($array) && is_array($array) && @sizeof($array) != 0) {
|
||||
//execute delete
|
||||
$this->$database->delete($array);
|
||||
$this->database->delete($array);
|
||||
unset($array);
|
||||
|
||||
//set message
|
||||
@@ -207,7 +207,7 @@
|
||||
if (is_array($uuids) && @sizeof($uuids) != 0) {
|
||||
$sql = "select ".$this->name."_uuid as uuid, ".$this->toggle_field." as toggle from v_".$this->table." ";
|
||||
$sql .= "where ".$this->name."_uuid in (".implode(', ', $uuids).") ";
|
||||
$rows = $this->$database->select($sql, $parameters ?? null, 'all');
|
||||
$rows = $this->database->select($sql, $parameters ?? null, 'all');
|
||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
||||
foreach ($rows as $row) {
|
||||
$states[$row['uuid']] = $row['toggle'];
|
||||
@@ -230,7 +230,7 @@
|
||||
//save the changes
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
//save the array
|
||||
$this->$database->save($array);
|
||||
$this->database->save($array);
|
||||
unset($array);
|
||||
|
||||
//set message
|
||||
@@ -275,7 +275,7 @@
|
||||
if (!empty($uuids) && is_array($uuids) && @sizeof($uuids) != 0) {
|
||||
$sql = "select ".$this->name."_uuid as uuid, ".$this->toggle_field." as toggle from v_".$this->table." ";
|
||||
$sql .= "where ".$this->name."_uuid in (".implode(', ', $uuids).") ";
|
||||
$rows = $this->$database->select($sql, $parameters ?? null, 'all');
|
||||
$rows = $this->database->select($sql, $parameters ?? null, 'all');
|
||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
||||
foreach ($rows as $row) {
|
||||
$states[$row['uuid']] = $row['toggle'];
|
||||
@@ -300,7 +300,7 @@
|
||||
//save the changes
|
||||
if (!empty($array) && is_array($array) && @sizeof($array) != 0) {
|
||||
//save the array
|
||||
$this->$database->save($array);
|
||||
$this->database->save($array);
|
||||
unset($array);
|
||||
|
||||
//set message
|
||||
@@ -352,12 +352,20 @@
|
||||
//primary table
|
||||
$sql = "select * from v_".$this->table." ";
|
||||
$sql .= "where ".$this->name."_uuid in (".implode(', ', $uuids).") ";
|
||||
$rows = $this->$database->select($sql, $parameters ?? null, 'all');
|
||||
$rows = $this->database->select($sql, $parameters ?? null, 'all');
|
||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
||||
$y = 0;
|
||||
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;
|
||||
|
||||
@@ -368,10 +376,18 @@
|
||||
//params sub table
|
||||
$sql_2 = "select * from v_conference_profile_params where conference_profile_uuid = :conference_profile_uuid";
|
||||
$parameters_2['conference_profile_uuid'] = $row['conference_profile_uuid'];
|
||||
$rows_2 = $this->$database->select($sql_2, $parameters_2, 'all');
|
||||
$rows_2 = $this->database->select($sql_2, $parameters_2, 'all');
|
||||
if (is_array($rows_2) && @sizeof($rows_2) != 0) {
|
||||
foreach ($rows_2 as $row_2) {
|
||||
|
||||
//convert boolean values to a string
|
||||
foreach($row_2 as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$row_2[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['conference_profile_params'][$y] = $row_2;
|
||||
|
||||
@@ -398,7 +414,7 @@
|
||||
$p->add('conference_profile_param_add', 'temp');
|
||||
|
||||
//save the array
|
||||
$this->$database->save($array);
|
||||
$this->database->save($array);
|
||||
unset($array);
|
||||
|
||||
//revoke temporary permissions
|
||||
|
||||
@@ -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) 2008-2023
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -303,6 +303,14 @@
|
||||
$new_conference_uuid = uuid();
|
||||
$new_dialplan_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;
|
||||
|
||||
@@ -321,6 +329,14 @@
|
||||
if (is_array($conference_users) && @sizeof($conference_users) != 0) {
|
||||
foreach ($conference_users as $conference_user) {
|
||||
|
||||
//convert boolean values to a string
|
||||
foreach($conference_user as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$conference_user[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['conference_users'][$y] = $conference_user;
|
||||
|
||||
@@ -341,6 +357,14 @@
|
||||
$dialplan = $this->database->select($sql_3, $parameters_3, 'row');
|
||||
if (is_array($dialplan) && @sizeof($dialplan) != 0) {
|
||||
|
||||
//convert boolean values to a string
|
||||
foreach($dialplan as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$dialplan[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['dialplans'][$x] = $dialplan;
|
||||
|
||||
|
||||
@@ -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) 2008-2019
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -71,7 +71,30 @@
|
||||
}
|
||||
|
||||
//get the device
|
||||
$sql = "select * from v_devices ";
|
||||
$sql = "select ";
|
||||
$sql .= "device_uuid, ";
|
||||
$sql .= "domain_uuid, ";
|
||||
$sql .= "device_profile_uuid, ";
|
||||
$sql .= "device_address, ";
|
||||
$sql .= "device_label, ";
|
||||
$sql .= "device_vendor, ";
|
||||
$sql .= "device_location, ";
|
||||
$sql .= "device_model, ";
|
||||
$sql .= "device_firmware_version, ";
|
||||
$sql .= "cast(device_enabled as text), ";
|
||||
$sql .= "device_enabled_date, ";
|
||||
$sql .= "device_template, ";
|
||||
$sql .= "device_user_uuid, ";
|
||||
$sql .= "device_username, ";
|
||||
$sql .= "device_password, ";
|
||||
$sql .= "device_uuid_alternate, ";
|
||||
$sql .= "device_description, ";
|
||||
$sql .= "device_provisioned_date, ";
|
||||
$sql .= "device_provisioned_method, ";
|
||||
$sql .= "device_provisioned_ip, ";
|
||||
$sql .= "device_provisioned_agent, ";
|
||||
$sql .= "device_serial_number ";
|
||||
$sql .= "from v_devices ";
|
||||
$sql .= "where device_uuid = :device_uuid ";
|
||||
$parameters['device_uuid'] = $device_uuid;
|
||||
$devices = $database->select($sql, $parameters, 'all');
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Copyright (C) 2010 - 2024
|
||||
Copyright (C) 2010-2025
|
||||
All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -1323,6 +1323,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;
|
||||
|
||||
@@ -1346,6 +1354,14 @@
|
||||
if (is_array($rows_2) && @sizeof($rows_2) != 0) {
|
||||
foreach ($rows_2 as $row_2) {
|
||||
|
||||
//convert boolean values to a string
|
||||
foreach($row_2 as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$row_2[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['device_profile_keys'][$y] = $row_2;
|
||||
|
||||
@@ -1367,6 +1383,14 @@
|
||||
if (is_array($rows_3) && @sizeof($rows_3) != 0) {
|
||||
foreach ($rows_3 as $row_3) {
|
||||
|
||||
//convert boolean values to a string
|
||||
foreach($row_3 as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$row_3[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['device_profile_settings'][$z] = $row_3;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Copyright (C) 2010-2023
|
||||
Copyright (C) 2010-2025
|
||||
All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -1350,6 +1350,14 @@
|
||||
//set a unique uuid
|
||||
$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;
|
||||
|
||||
@@ -1378,6 +1386,14 @@
|
||||
if (!empty($rows_2)) {
|
||||
foreach ($rows_2 as $row_2) {
|
||||
|
||||
//convert boolean values to a string
|
||||
foreach($row_2 as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$row_2[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['dialplan_details'][$y] = $row_2;
|
||||
|
||||
|
||||
@@ -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) 2019-2023
|
||||
Portions created by the Initial Developer are Copyright (C) 2019-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -290,6 +290,14 @@
|
||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
||||
$x = 0;
|
||||
foreach ($rows as $row) {
|
||||
//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;
|
||||
|
||||
|
||||
@@ -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) 2021-2023
|
||||
Portions created by the Initial Developer are Copyright (C) 2021-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -261,6 +261,14 @@
|
||||
foreach ($rows as $x => $row) {
|
||||
// var_dump($row); exit;
|
||||
|
||||
//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;
|
||||
|
||||
|
||||
@@ -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) 2008-2019
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -66,7 +66,40 @@
|
||||
}
|
||||
|
||||
//get the extension data
|
||||
$sql = "select * from v_extensions ";
|
||||
$sql = "select ";
|
||||
$sql .= "extension, ";
|
||||
$sql .= "number_alias, ";
|
||||
$sql .= "accountcode, ";
|
||||
$sql .= "effective_caller_id_name, ";
|
||||
$sql .= "effective_caller_id_number, ";
|
||||
$sql .= "outbound_caller_id_name, ";
|
||||
$sql .= "outbound_caller_id_number, ";
|
||||
$sql .= "emergency_caller_id_name, ";
|
||||
$sql .= "emergency_caller_id_number, ";
|
||||
$sql .= "directory_visible, ";
|
||||
$sql .= "directory_exten_visible, ";
|
||||
$sql .= "limit_max, ";
|
||||
$sql .= "limit_destination, ";
|
||||
$sql .= "user_context, ";
|
||||
$sql .= "missed_call_app, ";
|
||||
$sql .= "missed_call_data, ";
|
||||
$sql .= "toll_allow, ";
|
||||
$sql .= "call_timeout, ";
|
||||
$sql .= "call_group, ";
|
||||
$sql .= "user_record, ";
|
||||
$sql .= "hold_music, ";
|
||||
$sql .= "auth_acl, ";
|
||||
$sql .= "cidr, ";
|
||||
$sql .= "sip_force_contact, ";
|
||||
$sql .= "nibble_account, ";
|
||||
$sql .= "sip_force_expires, ";
|
||||
$sql .= "mwi_account, ";
|
||||
$sql .= "sip_bypass_media, ";
|
||||
$sql .= "dial_string, ";
|
||||
$sql .= "extension_type, ";
|
||||
$sql .= "cast(enabled as text), ";
|
||||
$sql .= "description ";
|
||||
$sql .= "from v_extensions ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "and extension_uuid = :extension_uuid ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
@@ -151,7 +184,12 @@
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/voicemails')) {
|
||||
|
||||
//get the voicemails
|
||||
$sql = "select * from v_voicemails ";
|
||||
$sql = "select ";
|
||||
$sql .= "voicemail_mail_to, ";
|
||||
$sql .= "voicemail_file, ";
|
||||
$sql .= "voicemail_local_after_email, ";
|
||||
$sql .= "cast(voicemail_enabled as text) ";
|
||||
$sql .= "from v_voicemails ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql .= "and voicemail_id = :voicemail_id ";
|
||||
$parameters['voicemail_id'] = is_numeric($number_alias) ? $number_alias : $extension;
|
||||
|
||||
@@ -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) 2008 - 2023
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -588,6 +588,14 @@
|
||||
$new_fax_uuid = uuid();
|
||||
$new_dialplan_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;
|
||||
|
||||
@@ -610,6 +618,14 @@
|
||||
if (is_array($rows_2) && @sizeof($rows_2) != 0) {
|
||||
foreach ($rows_2 as $row_2) {
|
||||
|
||||
//convert boolean values to a string
|
||||
foreach($row_2 as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$row_2[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['fax_users'][$y] = $row_2;
|
||||
|
||||
@@ -630,6 +646,14 @@
|
||||
$dialplan = $this->database->select($sql_3, $parameters_3, 'row');
|
||||
if (is_array($dialplan) && @sizeof($dialplan) != 0) {
|
||||
|
||||
//convert boolean values to a string
|
||||
foreach($dialplan as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$dialplan[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['dialplans'][$x] = $dialplan;
|
||||
|
||||
|
||||
@@ -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) 2019 - 2021
|
||||
Portions created by the Initial Developer are Copyright (C) 2019-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -277,6 +277,14 @@
|
||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
||||
$x = 0;
|
||||
foreach ($rows as $row) {
|
||||
//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;
|
||||
|
||||
|
||||
@@ -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) 2008-2022
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -537,6 +537,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;
|
||||
|
||||
|
||||
@@ -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) 2008-2023
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -412,6 +412,14 @@
|
||||
$new_ivr_menu_uuid = uuid();
|
||||
$new_dialplan_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;
|
||||
|
||||
@@ -426,6 +434,13 @@
|
||||
$rows_2 = $this->database->select($sql_2, $parameters_2, 'all');
|
||||
if (!empty($rows_2)) {
|
||||
foreach ($rows_2 as $row_2) {
|
||||
//convert boolean values to a string
|
||||
foreach($row_2 as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$row_2[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['ivr_menu_options'][$y] = $row_2;
|
||||
@@ -446,6 +461,13 @@
|
||||
$parameters_3['dialplan_uuid'] = $row['dialplan_uuid'];
|
||||
$dialplan = $this->database->select($sql_3, $parameters_3, 'row');
|
||||
if (!empty($dialplan)) {
|
||||
//convert boolean values to a string
|
||||
foreach($dialplan as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$dialplan[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['dialplans'][$z] = $dialplan;
|
||||
|
||||
@@ -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) 2008-2019
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -344,6 +344,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;
|
||||
|
||||
@@ -357,6 +365,13 @@
|
||||
$rows_2 = $this->database->select($sql_2, $parameters_2, 'all');
|
||||
if (is_array($rows_2) && @sizeof($rows_2) != 0) {
|
||||
foreach ($rows_2 as $row_2) {
|
||||
//convert boolean values to a string
|
||||
foreach($row_2 as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$row_2[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['number_translation_details'][$y] = $row_2;
|
||||
|
||||
@@ -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) 2008-2023
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -361,6 +361,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;
|
||||
|
||||
@@ -375,6 +383,14 @@
|
||||
if (is_array($rows_2) && @sizeof($rows_2) != 0) {
|
||||
foreach ($rows_2 as $row_2) {
|
||||
|
||||
//convert boolean values to a string
|
||||
foreach($row_2 as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$row_2[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['phrase_details'][$y] = $row_2;
|
||||
|
||||
|
||||
@@ -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) 2016-2019
|
||||
Portions created by the Initial Developer are Copyright (C) 2016-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -228,6 +228,14 @@
|
||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
||||
foreach ($rows as $x => $row) {
|
||||
|
||||
//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;
|
||||
|
||||
|
||||
@@ -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-2023
|
||||
Portions created by the Initial Developer are Copyright (C) 2010-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -407,6 +407,14 @@
|
||||
$new_ring_group_uuid = uuid();
|
||||
$new_dialplan_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;
|
||||
|
||||
@@ -422,6 +430,14 @@
|
||||
if (is_array($rows_2) && @sizeof($rows_2) != 0) {
|
||||
foreach ($rows_2 as $row_2) {
|
||||
|
||||
//convert boolean values to a string
|
||||
foreach($row_2 as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$row_2[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['ring_group_users'][$y] = $row_2;
|
||||
|
||||
@@ -443,6 +459,14 @@
|
||||
if (is_array($rows_3) && @sizeof($rows_3) != 0) {
|
||||
foreach ($rows_3 as $row_3) {
|
||||
|
||||
//convert boolean values to a string
|
||||
foreach($row_3 as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$row_3[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['ring_group_destinations'][$z] = $row_3;
|
||||
|
||||
@@ -463,6 +487,14 @@
|
||||
$dialplan = $this->database->select($sql_4, $parameters_4, 'row');
|
||||
if (is_array($dialplan) && @sizeof($dialplan) != 0) {
|
||||
|
||||
//convert boolean values to a string
|
||||
foreach($dialplan as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$dialplan[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['dialplans'][$x] = $dialplan;
|
||||
|
||||
|
||||
@@ -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-2023
|
||||
Portions created by the Initial Developer are Copyright (C) 2018-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -245,6 +245,14 @@
|
||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
||||
foreach ($rows as $x => $row) {
|
||||
|
||||
//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;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Copyright (C) 2010-2019
|
||||
Copyright (C) 2010-2025
|
||||
All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -304,6 +304,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;
|
||||
|
||||
@@ -318,6 +326,14 @@
|
||||
if (is_array($rows_2) && @sizeof($rows_2) != 0) {
|
||||
foreach ($rows_2 as $row_2) {
|
||||
|
||||
//convert boolean values to a string
|
||||
foreach($row_2 as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$row_2[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['dialplan_details'][$y] = $row_2;
|
||||
|
||||
|
||||
@@ -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) 2008-2023
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -216,6 +216,14 @@
|
||||
if (!empty($rows) && @sizeof($rows) != 0) {
|
||||
foreach ($rows as $x => $row) {
|
||||
|
||||
//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;
|
||||
|
||||
|
||||
@@ -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) 2008-2023
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -227,6 +227,14 @@
|
||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
||||
foreach ($rows as $x => $row) {
|
||||
|
||||
//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;
|
||||
|
||||
|
||||
@@ -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) 2019-2020
|
||||
Portions created by the Initial Developer are Copyright (C) 2019-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -269,6 +269,14 @@
|
||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
||||
$x = 0;
|
||||
foreach ($rows as $row) {
|
||||
//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;
|
||||
|
||||
@@ -286,7 +294,6 @@
|
||||
//save the changes and set the message
|
||||
if (!empty($array) && is_array($array) && @sizeof($array) != 0) {
|
||||
//save the array
|
||||
|
||||
$this->database->save($array);
|
||||
unset($array);
|
||||
|
||||
|
||||
@@ -416,6 +416,14 @@
|
||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
||||
$x = 0;
|
||||
foreach ($rows as $row) {
|
||||
//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;
|
||||
|
||||
|
||||
@@ -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) 2016-2024
|
||||
Portions created by the Initial Developer are Copyright (C) 2016-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -322,6 +322,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;
|
||||
|
||||
@@ -335,6 +343,13 @@
|
||||
$rows_2 = $this->database->select($sql_2, $parameters_2, 'all');
|
||||
if (is_array($rows_2) && @sizeof($rows_2) != 0) {
|
||||
foreach ($rows_2 as $row_2) {
|
||||
//convert boolean values to a string
|
||||
foreach($row_2 as $key => $value) {
|
||||
if (gettype($value) == 'boolean') {
|
||||
$value = $value ? 'true' : 'false';
|
||||
$row_2[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//copy data
|
||||
$array['group_permissions'][$y] = $row_2;
|
||||
|
||||
Reference in New Issue
Block a user