mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
* Change the data type to boolean
* Use boolean values in SQL and Conditional Statements
* Schema Data Types: Drop views so that alter tables statements complete
* Update settings.php
* Add extension for call_screen_enabled
* Gateway handle boolean
Add the boolean toggle
- distinct_to
- caller_id_in_from
- supress_cng
- extension_in_contact
- contact_in_ping
* Update gateways.php
* Update voicemail_edit.php
* Replace the ${caller_id_name} with the extensions caller id name
* Phrase - Edit: Update slide toggle with new select beneath.
* Update the input toggle style
* Set the input_toggle_style_switch as boolean
* Update the input toggle style
* Theme: Adjust CSS to wrap description text on form fields.
* Add domain_uuid and domain_name to the SQL SELECT
* Unset the parameters to fix the next query
* Gateway: Integrate new slide toggle switch.
* Dashboard: Update the input toggle style (#7499)
* Dashboard: Update the input toggle style
* Update dashboard_widget_edit.php
* Update dashboard_edit.php
* Inbound Route - Add: Integrate new slide toggle switch and boolean.
* User Settings: Integrate new slide toggle switch.
* Call Block Edit: Update the input toggle style (#7500)
* Bridge Edit: Update the input toggle style (#7501)
* Update phrases.php
* Update domain_edit.php
* Domain Settings Edit: Update the input toggle style
* User Edit: Update the input toggle style
* Update install.php
* Remove fields marked as deprecated
* Use boolean in the select statement
* Streams: New slide toggle and boolean.
* Streams: Remove unnecessary default.
* Queues (FIFO): New slide toggle.
* Call Detail Records: Update the input toggle style (#7503)
* Call Detail Records: Update the input toggle style
* Update xml_cdr_extension_summary.php
* Update xml_cdr_extension_summary.php
* Update xml_cdr_extension_summary.php
* Call Centers: Update the input toggle style (#7502)
* Call Centers: Update the input toggle style
* Update call_center_agent_edit.php
* Conference Centers: Update the input toggle style (#7506)
* Conference Centers: Update the input toggle style
* Update app_config.php
* Update conference_center_edit.php
* Use boolean data type (#7505)
* Call Flow Edit: Update the input toggle style (#7504)
* Devices: Update the input toggle style
* IVR Menus: New slide toggle.
* IVR Menu: Remove deprected file.
* SIP Profile - Edit: New slide toggle.
* Device Profiles: Update the input toggle style
* Ring Groups - List: Fix syntax.
* Theme: Fire onchange event when switching slide toggle control.
* Device Vendors: Update the input toggle style
* Update enabled boolean
* Update device_edit.php
* Ring Groups: New slide toggle.
* Update domain_edit.php
* Email Templates: Update the input toggle style
* Header: Correct default value on input toggle style.
* Default/Domain/User Settings: Adjust Select option label for better clarity.
* Use true boolean types for switch theme toggle or drop-down box (#7507)
* Groups: Update the input toggle style
* Conference Controls: Update the input toggle style (#7509)
* Conference Controls: Update the input toggle style
* Update conference_control_edit.php
* Update conference_control_details.php
* Update conference_control_detail_edit.php
* Conferences: Update the input toggle style (#7511)
* Use true boolean types for switch theme toggle or drop-down box (#7513)
* Dialplans: Update the input toggle style
Also updated outbound route add
* Ring Group: Only adjust ring group forward destination top margin when slide toggle enabled.
* Default/Domain/User Settings - List: Adjust for new 'Select Box' label on input_toggle_style value.
* Use true boolean types for switch theme toggle or drop-down box (#7514)
* Call Forward / Follow Me: Minor javascript adjustments to mirror previous behavior.
* Ring Groups [Dashboard]: New slide toggle.
* Get the contacts details with a seperate SQL Query
* Remove debug info
* Destinations: Update the input toggle style
* Conference Profiles: Update the input toggle style (#7515)
* Conference Profiles: Update the input toggle style
* Update conference_profiles.php
* Update conference_profile_params.php
* Update conference_profile_param_edit.php
* Update conference_profile_edit.php
* Extensions: Update the input toggle style
* Contacts: Update the input toggle style (#7517)
* Contacts: Update the input toggle style
* Update contact_address_edit.php
* Update contact_attachment_edit.php
* Update contact_edit.php
* Update contact_email_edit.php
* Update contact_phone_edit.php
* Update contact_relation_edit.php
* Update contact_setting_edit.php
* Update contact_url_edit.php
* Update contacts.php
* Voicemails: New slide toggle.
* Voicemail Greeting: New slide toggle.
* Modules: New slide toggle.
* Recordings: New slide toggle
* Variables: New slide toggle.
* Time Conditions: New slide toggle.
* Extensions - List: Remove invalid column name.
* Extension Settings: New slide toggle.
* Number Translations: New slide toggle and boolean.
* Sofia global settings: Update the input toggle style
* Update alter table convert to boolean
* Fix contact relation search (#7518)
* Sip Profile Edit: Fix setting enabled labels (#7519)
* Sip Profile Edit: Fix setting enabled labels
* Update sip_profile_edit.php
* Update dialplan_edit.php (#7520)
* Update SQL queries to use true/false for contact primary settings (#7521)
* Update SQL queries to use true/false for contact primary settings
* Update contacts_vcard.php
* Update email.php
* Update totp.php
* Update contact_url_edit.php
* Update contact_email_edit.php
* Update contact_address_edit.php
* Update contact_attachment_edit.php
* Update contact_phone_edit.php
* Add a database views method
* Add database view groups
* Add database users view
* Add database call_recordings view
* Update users.php
* Add database view call block
* Update schema to use the database views method
* Update conference.conf.lua boolean
* Update directory.lua boolean
* Update callcenter.conf.lua agent_status boolean
* Update sofia.conf.lua boolean
* Update number translations lua boolean
* Update directory.lua boolean
* Update group_call.lua fix the cache
* Update reverse-auth-lookup.lua boolean
* Update directory.lua boolean
* Use concat instead of ||
* Update index.lua
---------
Co-authored-by: fusionate <nate@fusionpbx.com>
Co-authored-by: Alex <alex@fusionpbx.com>
Co-authored-by: frytimo <tim@fusionpbx.com>
191 lines
8.5 KiB
PHP
191 lines
8.5 KiB
PHP
<?php
|
|
/*
|
|
FusionPBX
|
|
Version: MPL 1.1
|
|
|
|
The contents of this file are subject to the Mozilla Public License Version
|
|
1.1 (the "License"); you may not use this file except in compliance with
|
|
the License. You may obtain a copy of the License at
|
|
http://www.mozilla.org/MPL/
|
|
|
|
Software distributed under the License is distributed on an "AS IS" basis,
|
|
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
for the specific language governing rights and limitations under the
|
|
License.
|
|
|
|
The Original Code is FusionPBX
|
|
|
|
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
|
|
the Initial Developer. All Rights Reserved.
|
|
|
|
Contributor(s):
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
|
*/
|
|
|
|
//update dialplan details when group is null set to 0
|
|
if ($domains_processed == 1) {
|
|
//change dialplan context ${domain_name} to global
|
|
$sql = "update v_dialplan_details set dialplan_detail_group = '0' ";
|
|
$sql .= "where dialplan_detail_group is null;\n";
|
|
$database->execute($sql);
|
|
unset($sql);
|
|
}
|
|
|
|
//get the $apps array from the installed apps from the core and mod directories
|
|
if ($domains_processed == 1) {
|
|
|
|
//get the list of domains
|
|
$sql = "select * from v_domains ";
|
|
$domains = $database->select($sql, null, 'all');
|
|
unset($sql);
|
|
|
|
//dialplan class
|
|
$dialplan = new dialplan;
|
|
$dialplan->import($domains);
|
|
|
|
//update the dialplan order
|
|
$sql = "update v_dialplans set dialplan_order = '870' where dialplan_order = '980' and dialplan_name = 'cidlookup';\n";
|
|
$database->execute($sql);
|
|
$sql = "update v_dialplans set dialplan_order = '880' where dialplan_order = '990' and dialplan_name = 'call_screen';\n";
|
|
$database->execute($sql);
|
|
$sql = "update v_dialplans set dialplan_order = '890' where dialplan_order = '999' and dialplan_name = 'local_extension';\n";
|
|
$database->execute($sql);
|
|
unset($sql);
|
|
|
|
//set empty strings to null
|
|
$sql = "update v_device_lines set outbound_proxy_primary = null where outbound_proxy_primary = '';\n";
|
|
$database->execute($sql);
|
|
$sql = "update v_device_lines set outbound_proxy_secondary = null where outbound_proxy_secondary = '';\n";
|
|
$database->execute($sql);
|
|
unset($sql);
|
|
|
|
//change recording_slots to recording_id
|
|
$sql = "update v_dialplan_details set dialplan_detail_data = 'recording_id=true' ";
|
|
$sql .= "where dialplan_uuid in (select dialplan_uuid from v_dialplans where app_uuid = '430737df-5385-42d1-b933-22600d3fb79e') ";
|
|
$sql .= "and dialplan_detail_data = 'recording_slots=true'; \n";
|
|
$database->execute($sql);
|
|
$sql = "update v_dialplan_details set dialplan_detail_data = 'recording_id=false' ";
|
|
$sql .= "where dialplan_uuid in (select dialplan_uuid from v_dialplans where app_uuid = '430737df-5385-42d1-b933-22600d3fb79e') ";
|
|
$sql .= "and dialplan_detail_data = 'recording_slots=false'; \n";
|
|
$database->execute($sql);
|
|
unset($sql);
|
|
}
|
|
|
|
//additional dialplan upgrade commands
|
|
if ($domains_processed == 1) {
|
|
//add xml for each dialplan where the dialplan xml is empty
|
|
$sql = "select domain_name ";
|
|
$sql .= "from v_domains \n";
|
|
$results = $database->select($sql, null, 'all');
|
|
if (is_array($results) && @sizeof($results) != 0) {
|
|
foreach ($results as $row) {
|
|
$dialplans = new dialplan;
|
|
$dialplans->source = "details";
|
|
$dialplans->destination = "database";
|
|
$dialplans->context = $row["domain_name"];
|
|
$dialplans->is_empty = "dialplan_xml";
|
|
$array = $dialplans->xml();
|
|
}
|
|
}
|
|
unset($sql, $results);
|
|
$dialplans = new dialplan;
|
|
$dialplans->source = "details";
|
|
$dialplans->destination = "database";
|
|
$dialplans->is_empty = "dialplan_xml";
|
|
$array = $dialplans->xml();
|
|
|
|
//delete the follow me bridge dialplan
|
|
$sql = "delete from v_dialplan_details where dialplan_uuid = '8ed73d1f-698f-466c-8a7a-1cf4cd229f7f' ";
|
|
$database->execute($sql);
|
|
$sql = "delete from v_dialplans where dialplan_uuid = '8ed73d1f-698f-466c-8a7a-1cf4cd229f7f' ";
|
|
$database->execute($sql);
|
|
unset($sql);
|
|
|
|
//change dialplan context ${domain_name} to global
|
|
$sql = "update v_dialplans set dialplan_context = 'global' ";
|
|
$sql .= "where dialplan_context = '\${domain_name}';\n";
|
|
$database->execute($sql);
|
|
unset($sql);
|
|
|
|
//update recordings dialplan change recording_id=true to recording_id
|
|
$sql = "update v_dialplans set dialplan_xml = replace(dialplan_xml, 'recording_id=true','recording_id=') where dialplan_xml like '%recording_id=true%'\n";
|
|
$database->execute($sql);
|
|
$sql = "update v_dialplan_details set dialplan_detail_data = 'recording_id=' where dialplan_detail_data = 'recording_id=true'\n";
|
|
$database->execute($sql);
|
|
unset($sql);
|
|
}
|
|
|
|
//remove origination_callee_id_name from domain-variables dialplan
|
|
if ($domains_processed == 1) {
|
|
$sql = "select count(*) from v_dialplans ";
|
|
$sql .= "where dialplan_name = 'domain-variables' ";
|
|
$sql .= "and dialplan_xml like '%origination_callee_id_name%' ";
|
|
$num_rows = $database->select($sql, null, 'column');
|
|
if ($num_rows > 0) {
|
|
$sql = "update v_dialplan_details set dialplan_detail_data = 'origination_callee_id_name=\${caller_destination}', update_date = now() \n";
|
|
$sql .= "where dialplan_uuid in (select dialplan_uuid from v_dialplans where dialplan_name = 'domain-variables' or dialplan_name = 'variables') \n";
|
|
$sql .= "and dialplan_detail_data = 'origination_callee_id_name=\${destination_number}'; \n";
|
|
$database->execute($sql);
|
|
|
|
$sql = "update v_dialplans set dialplan_xml = REPLACE(dialplan_xml, '<action application=\"export\" data=\"origination_callee_id_name=\${destination_number}\"/>', '<action application=\"export\" data=\"origination_callee_id_name=\${caller_destination}\"/>'), update_date = now() \n";
|
|
$sql .= "where dialplan_uuid in (select dialplan_uuid from v_dialplans where dialplan_name = 'domain-variables' or dialplan_name = 'variables'); \n";
|
|
$database->execute($sql);
|
|
|
|
$sql = "update v_dialplans set dialplan_xml = REPLACE(dialplan_xml, '<action application=\"export\" data=\"origination_callee_id_name=\${destination_number}\" inline=\"true\"/>', '<action application=\"export\" data=\"origination_callee_id_name=\${caller_destination}\" inline=\"true\"/>'), update_date = now() \n";
|
|
$sql .= "where dialplan_uuid in (select dialplan_uuid from v_dialplans where dialplan_name = 'domain-variables' or dialplan_name = 'variables'); \n";
|
|
$database->execute($sql);
|
|
}
|
|
unset($sql, $num_rows);
|
|
}
|
|
|
|
//add not found dialplan to inbound routes
|
|
/*
|
|
if ($domains_processed == 1) {
|
|
if (is_readable($settings->get('switch','dialplan'))) {
|
|
$sql = "select count(*) from v_dialplans ";
|
|
$sql .= "where dialplan_uuid = 'ea5339de-1982-46ca-9695-c35176165314' ";
|
|
$num_rows = $database->select($sql, null, 'column');
|
|
if ($num_rows == 0) {
|
|
$array['dialplans'][0]['dialplan_uuid'] = 'ea5339de-1982-46ca-9695-c35176165314';
|
|
$array['dialplans'][0]['app_uuid'] = 'c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4';
|
|
$array['dialplans'][0]['dialplan_context'] = 'public';
|
|
$array['dialplans'][0]['dialplan_name'] = 'not-found';
|
|
$array['dialplans'][0]['dialplan_continue'] = false;
|
|
$array['dialplans'][0]['dialplan_order'] = '999';
|
|
$array['dialplans'][0]['dialplan_enabled'] = false;
|
|
|
|
$array['dialplan_details'][0]['dialplan_uuid'] = 'ea5339de-1982-46ca-9695-c35176165314';
|
|
$array['dialplan_details'][0]['dialplan_detail_uuid'] = '8a21744d-b381-4cb0-9930-55b776e4e461';
|
|
$array['dialplan_details'][0]['dialplan_detail_tag'] = 'condition';
|
|
$array['dialplan_details'][0]['dialplan_detail_type'] = 'context';
|
|
$array['dialplan_details'][0]['dialplan_detail_data'] = 'public';
|
|
$array['dialplan_details'][0]['dialplan_detail_order'] = '10';
|
|
|
|
$array['dialplan_details'][1]['dialplan_uuid'] = 'ea5339de-1982-46ca-9695-c35176165314';
|
|
$array['dialplan_details'][1]['dialplan_detail_uuid'] = 'e391530c-4078-4b49-bc11-bda4a23ad566';
|
|
$array['dialplan_details'][1]['dialplan_detail_tag'] = 'action';
|
|
$array['dialplan_details'][1]['dialplan_detail_type'] = 'log';
|
|
$array['dialplan_details'][1]['dialplan_detail_data'] = 'WARNING [inbound routes] 404 not found \${sip_network_ip}';
|
|
$array['dialplan_details'][1]['dialplan_detail_order'] = '20';
|
|
|
|
$p = permissions::new();
|
|
$p->add('dialplan_add', 'temp');
|
|
$p->add('dialplan_detail_add', 'temp');
|
|
|
|
$database->app_name = 'dialplans';
|
|
$database->app_uuid = '742714e5-8cdf-32fd-462c-cbe7e3d655db';
|
|
$database->save($array, false);
|
|
unset($array);
|
|
|
|
$p->delete('dialplan_add', 'temp');
|
|
$p->delete('dialplan_detail_add', 'temp');
|
|
}
|
|
unset($sql, $num_rows);
|
|
}
|
|
}
|
|
*/
|
|
|
|
?>
|