Update boolean toggle and the database boolean type (#7522)

* 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>
This commit is contained in:
FusionPBX
2025-09-20 18:42:05 -06:00
committed by GitHub
parent 96874c19b8
commit 7f9064fadb
223 changed files with 3215 additions and 2963 deletions

View File

@@ -158,7 +158,7 @@
//rescan each sip profile //rescan each sip profile
$sql = "select sip_profile_name from v_sip_profiles "; $sql = "select sip_profile_name from v_sip_profiles ";
$sql .= "where sip_profile_enabled = 'true'; "; $sql .= "where sip_profile_enabled = true; ";
$sip_profiles = $database->select($sql, null, 'all'); $sip_profiles = $database->select($sql, null, 'all');
if (is_array($sip_profiles)) { if (is_array($sip_profiles)) {
foreach ($sip_profiles as $row) { foreach ($sip_profiles as $row) {

View File

@@ -881,7 +881,7 @@ class active_calls_service extends service implements websocket_service_interfac
* @return array * @return array
*/ */
private static function get_domain_names(database $database): array { private static function get_domain_names(database $database): array {
return array_column($database->execute("select domain_name, domain_uuid from v_domains where domain_enabled='true'") ?: [], 'domain_name', 'domain_uuid'); return array_column($database->execute("select domain_name, domain_uuid from v_domains where domain_enabled= true ") ?: [], 'domain_name', 'domain_uuid');
} }
/** /**
@@ -890,7 +890,7 @@ class active_calls_service extends service implements websocket_service_interfac
* @return string * @return string
*/ */
private static function get_domain_name_by_uuid(database $database, string $domain_uuid): string { private static function get_domain_name_by_uuid(database $database, string $domain_uuid): string {
return $database->execute("select domain_name from v_domains where domain_enabled='true' and domain_uuid = :domain_uuid limit 1", ['domain_uuid' => $domain_uuid], 'column') ?: ''; return $database->execute("select domain_name from v_domains where domain_enabled = true and domain_uuid = :domain_uuid limit 1", ['domain_uuid' => $domain_uuid], 'column') ?: '';
} }
/** /**
@@ -899,6 +899,6 @@ class active_calls_service extends service implements websocket_service_interfac
* @return string * @return string
*/ */
private static function get_domain_uuid_by_name(database $database, string $domain_name): string { private static function get_domain_uuid_by_name(database $database, string $domain_name): string {
return $database->execute("select domain_uuid from v_domains where domain_enabled='true' and domain_name = :domain_name limit 1", ['domain_name' => $domain_name], 'column') ?: ''; return $database->execute("select domain_uuid from v_domains where domain_enabled = true and domain_name = :domain_name limit 1", ['domain_name' => $domain_name], 'column') ?: '';
} }
} }

View File

@@ -46,7 +46,7 @@
$apps[$x]['destinations'][$y]['label'] = "bridges"; $apps[$x]['destinations'][$y]['label'] = "bridges";
$apps[$x]['destinations'][$y]['name'] = "bridges"; $apps[$x]['destinations'][$y]['name'] = "bridges";
//$apps[$x]['destinations'][$y]['sql'] = "select bridge_name, bridge_destination, bridge_description from v_bridges "; //$apps[$x]['destinations'][$y]['sql'] = "select bridge_name, bridge_destination, bridge_description from v_bridges ";
$apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and bridge_enabled = 'true'"; $apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and bridge_enabled = true ";
$apps[$x]['destinations'][$y]['order_by'] = "bridge_name asc"; $apps[$x]['destinations'][$y]['order_by'] = "bridge_name asc";
$apps[$x]['destinations'][$y]['field']['bridge_uuid'] = "bridge_uuid"; $apps[$x]['destinations'][$y]['field']['bridge_uuid'] = "bridge_uuid";
$apps[$x]['destinations'][$y]['field']['uuid'] = "bridge_uuid"; $apps[$x]['destinations'][$y]['field']['uuid'] = "bridge_uuid";
@@ -89,7 +89,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the destination.'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the destination.';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'bridge_enabled'; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'bridge_enabled';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'boolean';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Select to enable or disable.'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Select to enable or disable.';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'bridge_description'; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'bridge_description';

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
*/ */
@@ -62,7 +62,7 @@
$bridge_gateways = $_POST["bridge_gateways"]; $bridge_gateways = $_POST["bridge_gateways"];
$destination_number = $_POST["destination_number"]; $destination_number = $_POST["destination_number"];
$bridge_destination = $_POST["bridge_destination"]; $bridge_destination = $_POST["bridge_destination"];
$bridge_enabled = $_POST["bridge_enabled"] ?? 'false'; $bridge_enabled = $_POST["bridge_enabled"];
$bridge_description = $_POST["bridge_description"]; $bridge_description = $_POST["bridge_description"];
} }
@@ -343,7 +343,7 @@
//get the domains //get the domains
$sql = "select * from v_domains "; $sql = "select * from v_domains ";
$sql .= "where domain_enabled = 'true' "; $sql .= "where domain_enabled = true ";
$database = new database; $database = new database;
$domains = $database->select($sql, null, 'all'); $domains = $database->select($sql, null, 'all');
unset($sql); unset($sql);
@@ -351,15 +351,12 @@
//get the sip profiles //get the sip profiles
$sql = "select sip_profile_name "; $sql = "select sip_profile_name ";
$sql .= "from v_sip_profiles "; $sql .= "from v_sip_profiles ";
$sql .= "where sip_profile_enabled = 'true' "; $sql .= "where sip_profile_enabled = true ";
$sql .= "order by sip_profile_name asc "; $sql .= "order by sip_profile_name asc ";
$database = new database; $database = new database;
$sip_profiles = $database->select($sql, null, 'all'); $sip_profiles = $database->select($sql, null, 'all');
unset($sql); unset($sql);
//set the defaults
if (empty($bridge_enabled)) { $bridge_enabled = 'true'; }
//create token //create token
$object = new token; $object = new token;
$token = $object->create($_SERVER['PHP_SELF']); $token = $object->create($_SERVER['PHP_SELF']);
@@ -572,17 +569,16 @@
echo " ".$text['label-bridge_enabled']."\n"; echo " ".$text['label-bridge_enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n"; echo "<td class='vtable' style='position: relative;' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='bridge_enabled' name='bridge_enabled' value='true' ".(!empty($bridge_enabled) && $bridge_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='bridge_enabled' name='bridge_enabled'>\n"; echo " <select class='formfld' id='bridge_enabled' name='bridge_enabled'>\n";
echo " <option value='true' ".($bridge_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($bridge_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($bridge_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($bridge_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-bridge_enabled']."\n"; echo $text['description-bridge_enabled']."\n";

View File

@@ -93,7 +93,6 @@
$sql_search = " ("; $sql_search = " (";
$sql_search .= " lower(bridge_name) like :search "; $sql_search .= " lower(bridge_name) like :search ";
$sql_search .= " or lower(bridge_destination) like :search "; $sql_search .= " or lower(bridge_destination) like :search ";
$sql_search .= " or lower(bridge_enabled) like :search ";
$sql_search .= " or lower(bridge_description) like :search "; $sql_search .= " or lower(bridge_description) like :search ";
$sql_search .= ") "; $sql_search .= ") ";
$parameters['search'] = '%'.$search.'%'; $parameters['search'] = '%'.$search.'%';
@@ -126,7 +125,7 @@
$offset = $rows_per_page * $page; $offset = $rows_per_page * $page;
//get the list //get the list
$sql = "select d.domain_uuid, b.bridge_uuid, d.domain_name, b.bridge_name, b.bridge_destination, bridge_enabled, bridge_description "; $sql = "select d.domain_uuid, b.bridge_uuid, d.domain_name, b.bridge_name, b.bridge_destination, cast(bridge_enabled as text), bridge_description ";
$sql .= "from v_bridges as b, v_domains as d "; $sql .= "from v_bridges as b, v_domains as d ";
$sql .= "where b.domain_uuid = d.domain_uuid "; $sql .= "where b.domain_uuid = d.domain_uuid ";
if (!empty($show) && $show == "all" && permission_exists('bridge_all')) { if (!empty($show) && $show == "all" && permission_exists('bridge_all')) {

View File

@@ -170,7 +170,7 @@
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_enabled";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "block_call_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "block_call_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enable/disable blocking the call."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enable/disable blocking the call.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'call_block_description'; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'call_block_description';

View File

@@ -163,7 +163,7 @@
else { else {
$sql .= " to_char(timezone(:time_zone, insert_date), 'HH24:MI:SS am') as time_formatted, \n"; $sql .= " to_char(timezone(:time_zone, insert_date), 'HH24:MI:SS am') as time_formatted, \n";
} }
$sql .= " call_block_enabled, call_block_description, insert_date, insert_user, update_date, update_user "; $sql .= " cast(call_block_enabled as text), call_block_description, insert_date, insert_user, update_date, update_user ";
$sql .= "from view_call_block "; $sql .= "from view_call_block ";
$sql .= "where true "; $sql .= "where true ";
$parameters['time_zone'] = $time_zone; $parameters['time_zone'] = $time_zone;

View File

@@ -71,7 +71,7 @@
$call_block_name = $_POST["call_block_name"] ?? null; $call_block_name = $_POST["call_block_name"] ?? null;
$call_block_country_code = $_POST["call_block_country_code"] ?? null; $call_block_country_code = $_POST["call_block_country_code"] ?? null;
$call_block_number = $_POST["call_block_number"] ?? null; $call_block_number = $_POST["call_block_number"] ?? null;
$call_block_enabled = $_POST["call_block_enabled"] ?? 'false'; $call_block_enabled = $_POST["call_block_enabled"];
$call_block_description = $_POST["call_block_description"] ?? null; $call_block_description = $_POST["call_block_description"] ?? null;
//get the call block app and data //get the call block app and data
@@ -154,7 +154,7 @@
$sql .= "and domain_uuid = :domain_uuid "; $sql .= "and domain_uuid = :domain_uuid ";
} }
$sql .= "and app_uuid = 'b1b31930-d0ee-4395-a891-04df94599f1f' "; $sql .= "and app_uuid = 'b1b31930-d0ee-4395-a891-04df94599f1f' ";
$sql .= "and dialplan_enabled <> 'true' "; $sql .= "and dialplan_enabled <> true ";
if (!empty($domain_uuid) && is_uuid($domain_uuid)) { if (!empty($domain_uuid) && is_uuid($domain_uuid)) {
$parameters['domain_uuid'] = $domain_uuid; $parameters['domain_uuid'] = $domain_uuid;
} }
@@ -163,7 +163,7 @@
if (!empty($rows)) { if (!empty($rows)) {
foreach ($rows as $index => $row) { foreach ($rows as $index => $row) {
$array['dialplans'][$index]['dialplan_uuid'] = $row['dialplan_uuid']; $array['dialplans'][$index]['dialplan_uuid'] = $row['dialplan_uuid'];
$array['dialplans'][$index]['dialplan_enabled'] = 'true'; $array['dialplans'][$index]['dialplan_enabled'] = true;
} }
$p = permissions::new(); $p = permissions::new();
@@ -291,9 +291,6 @@
unset($sql, $parameters, $row); unset($sql, $parameters, $row);
} }
//set the defaults
if (empty($call_block_enabled)) { $call_block_enabled = 'true'; }
//get the extensions //get the extensions
if (permission_exists('call_block_all') || permission_exists('call_block_extension')) { if (permission_exists('call_block_all') || permission_exists('call_block_extension')) {
$sql = "select extension_uuid, extension, number_alias, user_context, description from v_extensions "; $sql = "select extension_uuid, extension, number_alias, user_context, description from v_extensions ";
@@ -303,7 +300,7 @@
$sql .= " or domain_uuid is null "; $sql .= " or domain_uuid is null ";
} }
$sql .= ") "; $sql .= ") ";
$sql .= "and enabled = 'true' "; $sql .= "and enabled = true ";
$sql .= "order by extension asc "; $sql .= "order by extension asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid']; $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$extensions = $database->select($sql, $parameters); $extensions = $database->select($sql, $parameters);
@@ -561,17 +558,16 @@ if (permission_exists('call_block_all') || permission_exists('call_block_ring_gr
echo " ".$text['label-enabled']."\n"; echo " ".$text['label-enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='call_block_enabled' name='call_block_enabled' value='true' ".($call_block_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='call_block_enabled' name='call_block_enabled'>\n"; echo " <select class='formfld' id='call_block_enabled' name='call_block_enabled'>\n";
echo " <option value='true' ".($call_block_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($call_block_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($call_block_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($call_block_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-enable']."\n"; echo $text['description-enable']."\n";

View File

@@ -314,7 +314,7 @@
$sql .= "from v_destinations as d "; $sql .= "from v_destinations as d ";
$sql .= "where domain_uuid = :domain_uuid "; $sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and destination_prefix <> '' "; $sql .= "and destination_prefix <> '' ";
$sql .= "and destination_enabled = 'true' "; $sql .= "and destination_enabled = true ";
$sql .= "order by count desc limit 1; "; $sql .= "order by count desc limit 1; ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid']; $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$destination_country_code = $this->database->select($sql, $parameters ?? null, 'column'); $destination_country_code = $this->database->select($sql, $parameters ?? null, 'column');
@@ -378,7 +378,7 @@
$array['call_block'][$x]['call_block_count'] = 0; $array['call_block'][$x]['call_block_count'] = 0;
$array['call_block'][$x]['call_block_app'] = $this->call_block_app; $array['call_block'][$x]['call_block_app'] = $this->call_block_app;
$array['call_block'][$x]['call_block_data'] = $this->call_block_data; $array['call_block'][$x]['call_block_data'] = $this->call_block_data;
$array['call_block'][$x]['call_block_enabled'] = 'true'; $array['call_block'][$x]['call_block_enabled'] = true;
$array['call_block'][$x]['date_added'] = time(); $array['call_block'][$x]['date_added'] = time();
$x++; $x++;
} }
@@ -402,7 +402,7 @@
$array['call_block'][$x]['call_block_count'] = 0; $array['call_block'][$x]['call_block_count'] = 0;
$array['call_block'][$x]['call_block_app'] = $this->call_block_app; $array['call_block'][$x]['call_block_app'] = $this->call_block_app;
$array['call_block'][$x]['call_block_data'] = $this->call_block_data; $array['call_block'][$x]['call_block_data'] = $this->call_block_data;
$array['call_block'][$x]['call_block_enabled'] = 'true'; $array['call_block'][$x]['call_block_enabled'] = true;
$array['call_block'][$x]['date_added'] = time(); $array['call_block'][$x]['date_added'] = time();
$x++; $x++;
} }
@@ -420,13 +420,13 @@
$sql = "select dialplan_uuid from v_dialplans "; $sql = "select dialplan_uuid from v_dialplans ";
$sql .= "where domain_uuid = :domain_uuid "; $sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and app_uuid = '".$this->app_uuid."' "; $sql .= "and app_uuid = '".$this->app_uuid."' ";
$sql .= "and dialplan_enabled <> 'true' "; $sql .= "and dialplan_enabled <> true ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid']; $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$rows = $this->database->select($sql, $parameters); $rows = $this->database->select($sql, $parameters);
if (is_array($rows) && @sizeof($rows) != 0) { if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $x => $row) { foreach ($rows as $x => $row) {
$array['dialplans'][$x]['dialplan_uuid'] = $row['dialplan_uuid']; $array['dialplans'][$x]['dialplan_uuid'] = $row['dialplan_uuid'];
$array['dialplans'][$x]['dialplan_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_enabled'] = true;
} }
} }
unset($rows, $parameters); unset($rows, $parameters);

View File

@@ -0,0 +1,12 @@
<?php
$view['name'] = "view_call_block";
$view['version'] = "20250919";
$view['description'] = "Show the call block details with extension information.";
$view['sql'] = " select domain_uuid, group_uuid, group_name, ";
$view['sql'] .= " select c.domain_uuid, call_block_uuid, c.call_block_direction, c.extension_uuid, c.call_block_name, c.call_block_country_code, \n";
$view['sql'] .= " c.call_block_number, e.extension, e.number_alias, c.call_block_count, c.call_block_app, c.call_block_data, c.date_added, \n";
$view['sql'] .= " c.call_block_enabled, c.call_block_description, c.insert_date, c.insert_user, c.update_date, c.update_user \n";
$view['sql'] .= " from v_call_block as c \n";
$view['sql'] .= " left join v_extensions as e \n";
$view['sql'] .= " on c.extension_uuid = e.extension_uuid \n";

View File

@@ -167,7 +167,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "broadcast_avmd"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "broadcast_avmd";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "broadcast_destination_data"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "broadcast_destination_data";

View File

@@ -534,10 +534,17 @@ if (!empty($_POST) && empty($_POST["persistformvar"])) {
echo " ".$text['label-avmd']."\n"; echo " ".$text['label-avmd']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='broadcast_avmd'>\n"; if ($input_toggle_style_switch) {
echo " <option value='false'>".$text['option-false']."</option>\n"; echo " <span class='switch'>\n";
echo " <option value='true' ".(!empty($broadcast_avmd) && $broadcast_avmd == "true" ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; }
echo " <select class='formfld' id='broadcast_avmd' name='broadcast_avmd'>\n";
echo " <option value='true' ".($broadcast_avmd === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($broadcast_avmd === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
}
echo "<br />\n"; echo "<br />\n";
echo $text['description-avmd']."\n"; echo $text['description-avmd']."\n";
echo "</td>\n"; echo "</td>\n";

View File

@@ -327,7 +327,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_record"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "agent_record";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date";
@@ -454,7 +454,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_tier_rules_apply"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_tier_rules_apply";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_tier_rule_wait_second"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_tier_rule_wait_second";
@@ -462,7 +462,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_tier_rule_no_agent_no_wait"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_tier_rule_no_agent_no_wait";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_timeout_action"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_timeout_action";
@@ -474,11 +474,11 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_abandoned_resume_allowed"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_abandoned_resume_allowed";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_tier_rule_wait_multiply_level"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_tier_rule_wait_multiply_level";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_cid_prefix"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_cid_prefix";

View File

@@ -150,10 +150,10 @@ if ($domains_processed == 1) {
$array['dialplans'][$id]["dialplan_name"] = $row["queue_name"]; $array['dialplans'][$id]["dialplan_name"] = $row["queue_name"];
$array['dialplans'][$id]["dialplan_number"] = $row["queue_extension"]; $array['dialplans'][$id]["dialplan_number"] = $row["queue_extension"];
$array['dialplans'][$id]["dialplan_context"] = $row['domain_name']; $array['dialplans'][$id]["dialplan_context"] = $row['domain_name'];
$array['dialplans'][$id]["dialplan_continue"] = "false"; $array['dialplans'][$id]["dialplan_continue"] = false;
$array['dialplans'][$id]["dialplan_xml"] = $dialplan_xml; $array['dialplans'][$id]["dialplan_xml"] = $dialplan_xml;
$array['dialplans'][$id]["dialplan_order"] = "230"; $array['dialplans'][$id]["dialplan_order"] = "230";
$array['dialplans'][$id]["dialplan_enabled"] = "true"; $array['dialplans'][$id]["dialplan_enabled"] = true;
$array['dialplans'][$id]["dialplan_description"] = $row["queue_description"]; $array['dialplans'][$id]["dialplan_description"] = $row["queue_description"];
$array['dialplans'][$id]["app_uuid"] = "95788e50-9500-079e-2807-fd530b0ea370"; $array['dialplans'][$id]["app_uuid"] = "95788e50-9500-079e-2807-fd530b0ea370";
} }

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2024 Portions created by the Initial Developer are Copyright (C) 2008-2025
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -83,7 +83,7 @@
$agent_wrap_up_time = $_POST["agent_wrap_up_time"]; $agent_wrap_up_time = $_POST["agent_wrap_up_time"];
$agent_reject_delay_time = $_POST["agent_reject_delay_time"]; $agent_reject_delay_time = $_POST["agent_reject_delay_time"];
$agent_busy_delay_time = $_POST["agent_busy_delay_time"]; $agent_busy_delay_time = $_POST["agent_busy_delay_time"];
$agent_record = $_POST["agent_record"] ?? 'false'; $agent_record = $_POST["agent_record"];
//$agent_logout = $_POST["agent_logout"]; //$agent_logout = $_POST["agent_logout"];
} }
@@ -265,7 +265,23 @@
//pre-populate the form //pre-populate the form
if (!empty($_GET["id"]) && is_uuid($_GET["id"]) && empty($_POST["persistformvar"])) { if (!empty($_GET["id"]) && is_uuid($_GET["id"]) && empty($_POST["persistformvar"])) {
$call_center_agent_uuid = $_GET["id"]; $call_center_agent_uuid = $_GET["id"];
$sql = "select * from v_call_center_agents "; $sql = "select ";
$sql .= "call_center_agent_uuid, ";
$sql .= "user_uuid, ";
$sql .= "agent_name, ";
$sql .= "agent_type, ";
$sql .= "agent_call_timeout, ";
$sql .= "agent_id, ";
$sql .= "agent_password, ";
$sql .= "agent_status, ";
$sql .= "agent_contact, ";
$sql .= "agent_no_answer_delay_time, ";
$sql .= "agent_max_no_answer, ";
$sql .= "agent_wrap_up_time, ";
$sql .= "agent_reject_delay_time, ";
$sql .= "agent_busy_delay_time, ";
$sql .= "agent_record ";
$sql .= "from v_call_center_agents ";
$sql .= "where domain_uuid = :domain_uuid "; $sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and call_center_agent_uuid = :call_center_agent_uuid "; $sql .= "and call_center_agent_uuid = :call_center_agent_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid']; $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
@@ -495,17 +511,16 @@
echo " ".$text['label-record_template']."\n"; echo " ".$text['label-record_template']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' name='agent_record' value='true' ".(empty($agent_record) || $agent_record == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else { echo " <select class='formfld' id='agent_record' name='agent_record'>\n";
echo " <select class='formfld' name='agent_record'>\n"; echo " <option value='true' ".($agent_record === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='true'>".$text['option-true']."</option>\n"; echo " <option value='false' ".($agent_record === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='false' ".(!empty($agent_record) && $agent_record != 'true' ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-record_template']."\n"; echo $text['description-record_template']."\n";

View File

@@ -123,8 +123,8 @@
$queue_max_wait_time_with_no_agent_time_reached = $_POST["queue_max_wait_time_with_no_agent_time_reached"]; $queue_max_wait_time_with_no_agent_time_reached = $_POST["queue_max_wait_time_with_no_agent_time_reached"];
$queue_tier_rules_apply = $_POST["queue_tier_rules_apply"]; $queue_tier_rules_apply = $_POST["queue_tier_rules_apply"];
$queue_tier_rule_wait_second = $_POST["queue_tier_rule_wait_second"]; $queue_tier_rule_wait_second = $_POST["queue_tier_rule_wait_second"];
$queue_tier_rule_wait_multiply_level = $_POST["queue_tier_rule_wait_multiply_level"] ?? 'false'; $queue_tier_rule_wait_multiply_level = $_POST["queue_tier_rule_wait_multiply_level"];
$queue_tier_rule_no_agent_no_wait = $_POST["queue_tier_rule_no_agent_no_wait"] ?? 'false'; $queue_tier_rule_no_agent_no_wait = $_POST["queue_tier_rule_no_agent_no_wait"];
$queue_timeout_action = $_POST["queue_timeout_action"] ?? null; $queue_timeout_action = $_POST["queue_timeout_action"] ?? null;
$queue_discard_abandoned_after = $_POST["queue_discard_abandoned_after"]; $queue_discard_abandoned_after = $_POST["queue_discard_abandoned_after"];
$queue_abandoned_resume_allowed = $_POST["queue_abandoned_resume_allowed"]; $queue_abandoned_resume_allowed = $_POST["queue_abandoned_resume_allowed"];
@@ -454,7 +454,7 @@
$array['dialplans'][0]["dialplan_continue"] = "false"; $array['dialplans'][0]["dialplan_continue"] = "false";
$array['dialplans'][0]["dialplan_xml"] = $dialplan_xml; $array['dialplans'][0]["dialplan_xml"] = $dialplan_xml;
$array['dialplans'][0]["dialplan_order"] = "230"; $array['dialplans'][0]["dialplan_order"] = "230";
$array['dialplans'][0]["dialplan_enabled"] = "true"; $array['dialplans'][0]["dialplan_enabled"] = true;
$array['dialplans'][0]["dialplan_description"] = $queue_description; $array['dialplans'][0]["dialplan_description"] = $queue_description;
$array['dialplans'][0]["app_uuid"] = "95788e50-9500-079e-2807-fd530b0ea370"; $array['dialplans'][0]["app_uuid"] = "95788e50-9500-079e-2807-fd530b0ea370";
@@ -557,7 +557,41 @@
//pre-populate the form //pre-populate the form
if (!empty($_GET) && is_uuid($_GET["id"]) && empty($_POST["persistformvar"])) { if (!empty($_GET) && is_uuid($_GET["id"]) && empty($_POST["persistformvar"])) {
$call_center_queue_uuid = $_GET["id"]; $call_center_queue_uuid = $_GET["id"];
$sql = "select * from v_call_center_queues "; $sql = "select ";
$sql = "select ";
$sql .= "queue_name, ";
$sql .= "dialplan_uuid, ";
$sql .= "queue_extension, ";
$sql .= "queue_greeting, ";
$sql .= "queue_language, ";
$sql .= "queue_dialect, ";
$sql .= "queue_voice , ";
$sql .= "queue_strategy, ";
$sql .= "queue_moh_sound, ";
$sql .= "queue_record_template, ";
$sql .= "queue_time_base_score, ";
$sql .= "queue_time_base_score_sec, ";
$sql .= "queue_max_wait_time, ";
$sql .= "queue_max_wait_time_with_no_agent, ";
$sql .= "queue_max_wait_time_with_no_agent_time_reached, ";
$sql .= "queue_timeout_action, ";
$sql .= "queue_tier_rules_apply, ";
$sql .= "queue_tier_rule_wait_second, ";
$sql .= "queue_tier_rule_wait_multiply_level, ";
$sql .= "queue_tier_rule_no_agent_no_wait, ";
$sql .= "queue_discard_abandoned_after, ";
$sql .= "queue_abandoned_resume_allowed, ";
$sql .= "queue_cid_prefix, ";
$sql .= "queue_outbound_caller_id_name, ";
$sql .= "queue_outbound_caller_id_number, ";
$sql .= "queue_announce_position, ";
$sql .= "queue_announce_sound, ";
$sql .= "queue_announce_frequency, ";
$sql .= "queue_cc_exit_keys, ";
$sql .= "queue_email_address, ";
$sql .= "queue_context, ";
$sql .= "queue_description ";
$sql .= "from v_call_center_queues ";
$sql .= "where domain_uuid = :domain_uuid "; $sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and call_center_queue_uuid = :call_center_queue_uuid "; $sql .= "and call_center_queue_uuid = :call_center_queue_uuid ";
$parameters['domain_uuid'] = $domain_uuid; $parameters['domain_uuid'] = $domain_uuid;
@@ -661,16 +695,11 @@
if (empty($queue_strategy)) { $queue_strategy = "longest-idle-agent"; } if (empty($queue_strategy)) { $queue_strategy = "longest-idle-agent"; }
if (empty($queue_moh_sound)) { $queue_moh_sound = "\$\${hold_music}"; } if (empty($queue_moh_sound)) { $queue_moh_sound = "\$\${hold_music}"; }
if (empty($queue_time_base_score)) { $queue_time_base_score = "system"; } if (empty($queue_time_base_score)) { $queue_time_base_score = "system"; }
if (empty($queue_time_base_score)) { $queue_time_base_score = ""; }
if (empty($queue_max_wait_time)) { $queue_max_wait_time = "0"; } if (empty($queue_max_wait_time)) { $queue_max_wait_time = "0"; }
if (empty($queue_max_wait_time_with_no_agent)) { $queue_max_wait_time_with_no_agent = "90"; } if (empty($queue_max_wait_time_with_no_agent)) { $queue_max_wait_time_with_no_agent = "90"; }
if (empty($queue_max_wait_time_with_no_agent_time_reached)) { $queue_max_wait_time_with_no_agent_time_reached = "30"; } if (empty($queue_max_wait_time_with_no_agent_time_reached)) { $queue_max_wait_time_with_no_agent_time_reached = "30"; }
if (empty($queue_tier_rules_apply)) { $queue_tier_rules_apply = "false"; }
if (empty($queue_tier_rule_wait_second)) { $queue_tier_rule_wait_second = "30"; } if (empty($queue_tier_rule_wait_second)) { $queue_tier_rule_wait_second = "30"; }
if (empty($queue_tier_rule_wait_multiply_level)) { $queue_tier_rule_wait_multiply_level = "true"; }
if (empty($queue_tier_rule_no_agent_no_wait)) { $queue_tier_rule_no_agent_no_wait = "true"; }
if (empty($queue_discard_abandoned_after)) { $queue_discard_abandoned_after = "900"; } if (empty($queue_discard_abandoned_after)) { $queue_discard_abandoned_after = "900"; }
if (empty($queue_abandoned_resume_allowed)) { $queue_abandoned_resume_allowed = "false"; }
if (empty($queue_context)) { $queue_context = $domain_name; } if (empty($queue_context)) { $queue_context = $domain_name; }
//create token //create token
@@ -1076,17 +1105,16 @@
echo " ".$text['label-record_template']."\n"; echo " ".$text['label-record_template']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' name='queue_record_template' value='".escape($record_template)."' ".(!empty($queue_record_template) ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else { echo " <select class='formfld' id='queue_record_template' name='queue_record_template'>\n";
echo " <select class='formfld' name='queue_record_template'>\n"; echo " <option value='true' ".($queue_record_template === 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='".escape($record_template)."'>".$text['option-true']."</option>\n"; echo " <option value='false' ".($queue_record_template === 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='' ".(empty($queue_record_template) ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-record_template']."\n"; echo $text['description-record_template']."\n";
@@ -1177,17 +1205,16 @@
echo " ".$text['label-tier_rules_apply']."\n"; echo " ".$text['label-tier_rules_apply']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' name='queue_tier_rules_apply' value='true' ".(empty($queue_tier_rules_apply) || $queue_tier_rules_apply == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else { echo " <select class='formfld' id='queue_tier_rules_apply' name='queue_tier_rules_apply'>\n";
echo " <select class='formfld' name='queue_tier_rules_apply'>\n"; echo " <option value='true' ".($queue_tier_rules_apply === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='true'>".$text['option-true']."</option>\n"; echo " <option value='false' ".($queue_tier_rules_apply === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='false' ".(!empty($queue_tier_rules_apply) && $queue_tier_rules_apply == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-tier_rules_apply']."\n"; echo $text['description-tier_rules_apply']."\n";
@@ -1210,17 +1237,16 @@
echo " ".$text['label-tier_rule_wait_multiply_level']."\n"; echo " ".$text['label-tier_rule_wait_multiply_level']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' name='queue_tier_rule_wait_multiply_level' value='true' ".(empty($queue_tier_rule_wait_multiply_level) || $queue_tier_rule_wait_multiply_level == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else { echo " <select class='formfld' id='queue_tier_rule_wait_multiply_level' name='queue_tier_rule_wait_multiply_level'>\n";
echo " <select class='formfld' name='queue_tier_rule_wait_multiply_level'>\n"; echo " <option value='true' ".($queue_tier_rule_wait_multiply_level === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='true'>".$text['option-true']."</option>\n"; echo " <option value='false' ".($queue_tier_rule_wait_multiply_level === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='false' ".(!empty($queue_tier_rule_wait_multiply_level) && $queue_tier_rule_wait_multiply_level == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-tier_rule_wait_multiply_level']."\n"; echo $text['description-tier_rule_wait_multiply_level']."\n";
@@ -1232,17 +1258,16 @@
echo " ".$text['label-tier_rule_no_agent_no_wait']."\n"; echo " ".$text['label-tier_rule_no_agent_no_wait']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' name='queue_tier_rule_no_agent_no_wait' value='true' ".(empty($queue_tier_rule_no_agent_no_wait) || $queue_tier_rule_no_agent_no_wait == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else { echo " <select class='formfld' id='queue_tier_rule_no_agent_no_wait' name='queue_tier_rule_no_agent_no_wait'>\n";
echo " <select class='formfld' name='queue_tier_rule_no_agent_no_wait'>\n"; echo " <option value='true' ".($queue_tier_rule_no_agent_no_wait === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='true'>".$text['option-true']."</option>\n"; echo " <option value='false' ".($queue_tier_rule_no_agent_no_wait === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='false' ".(!empty($queue_tier_rule_no_agent_no_wait) && $queue_tier_rule_no_agent_no_wait == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-tier_rule_no_agent_no_wait']."\n"; echo $text['description-tier_rule_no_agent_no_wait']."\n";
@@ -1265,17 +1290,16 @@
echo " ".$text['label-abandoned_resume_allowed']."\n"; echo " ".$text['label-abandoned_resume_allowed']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' name='queue_abandoned_resume_allowed' value='true' ".(!empty($queue_abandoned_resume_allowed) && $queue_abandoned_resume_allowed == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else { echo " <select class='formfld' id='queue_abandoned_resume_allowed' name='queue_abandoned_resume_allowed'>\n";
echo " <select class='formfld' name='queue_abandoned_resume_allowed'>\n"; echo " <option value='true' ".($queue_abandoned_resume_allowed === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false'>".$text['option-false']."</option>\n"; echo " <option value='false' ".($queue_abandoned_resume_allowed === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='true' ".(!empty($queue_abandoned_resume_allowed) && $queue_abandoned_resume_allowed == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-abandoned_resume_allowed']."\n"; echo $text['description-abandoned_resume_allowed']."\n";

View File

@@ -97,9 +97,9 @@
$dialplan["dialplan_name"] = ($this->queue_name != '') ? $this->queue_name : format_phone($this->destination_number); $dialplan["dialplan_name"] = ($this->queue_name != '') ? $this->queue_name : format_phone($this->destination_number);
$dialplan["dialplan_number"] = $this->destination_number; $dialplan["dialplan_number"] = $this->destination_number;
$dialplan["dialplan_context"] = $_SESSION['domain_name']; $dialplan["dialplan_context"] = $_SESSION['domain_name'];
$dialplan["dialplan_continue"] = "false"; $dialplan["dialplan_continue"] = false;
$dialplan["dialplan_order"] = "210"; $dialplan["dialplan_order"] = "210";
$dialplan["dialplan_enabled"] = "true"; $dialplan["dialplan_enabled"] = true;
$dialplan["dialplan_description"] = $this->queue_description; $dialplan["dialplan_description"] = $this->queue_description;
$dialplan_detail_order = 10; $dialplan_detail_order = 10;

View File

@@ -36,7 +36,7 @@
$apps[$x]['destinations'][$y]['label'] = "call_flows"; $apps[$x]['destinations'][$y]['label'] = "call_flows";
$apps[$x]['destinations'][$y]['name'] = "call_flows"; $apps[$x]['destinations'][$y]['name'] = "call_flows";
$apps[$x]['destinations'][$y]['sql'] = "select call_flow_name as name, call_flow_uuid, call_flow_uuid as uuid, call_flow_extension as destination, call_flow_extension as extension, call_flow_context as context from v_call_flows "; $apps[$x]['destinations'][$y]['sql'] = "select call_flow_name as name, call_flow_uuid, call_flow_uuid as uuid, call_flow_extension as destination, call_flow_extension as extension, call_flow_context as context from v_call_flows ";
$apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and call_flow_enabled = 'true' "; $apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and call_flow_enabled = true ";
$apps[$x]['destinations'][$y]['order_by'] = "natural_sort(call_flow_extension) asc"; $apps[$x]['destinations'][$y]['order_by'] = "natural_sort(call_flow_extension) asc";
$apps[$x]['destinations'][$y]['field']['call_flow_uuid'] = "call_flow_uuid"; $apps[$x]['destinations'][$y]['field']['call_flow_uuid'] = "call_flow_uuid";
$apps[$x]['destinations'][$y]['field']['name'] = "call_flow_name"; $apps[$x]['destinations'][$y]['field']['name'] = "call_flow_name";
@@ -51,7 +51,7 @@
$apps[$x]['destinations'][$y]['label'] = "call_flows"; $apps[$x]['destinations'][$y]['label'] = "call_flows";
$apps[$x]['destinations'][$y]['name'] = "call_flows"; $apps[$x]['destinations'][$y]['name'] = "call_flows";
$apps[$x]['destinations'][$y]['sql'] = "select call_flow_name as name, call_flow_uuid, call_flow_uuid as uuid, call_flow_feature_code as extension, call_flow_feature_code as destination, call_flow_context as context from v_call_flows "; $apps[$x]['destinations'][$y]['sql'] = "select call_flow_name as name, call_flow_uuid, call_flow_uuid as uuid, call_flow_feature_code as extension, call_flow_feature_code as destination, call_flow_context as context from v_call_flows ";
$apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and call_flow_feature_code is not null and call_flow_enabled = 'true' "; $apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and call_flow_feature_code is not null and call_flow_enabled = true ";
$apps[$x]['destinations'][$y]['order_by'] = "natural_sort(call_flow_feature_code) asc"; $apps[$x]['destinations'][$y]['order_by'] = "natural_sort(call_flow_feature_code) asc";
$apps[$x]['destinations'][$y]['field']['uuid'] = "uuid"; $apps[$x]['destinations'][$y]['field']['uuid'] = "uuid";
$apps[$x]['destinations'][$y]['field']['name'] = "name"; $apps[$x]['destinations'][$y]['field']['name'] = "name";
@@ -200,7 +200,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the alernate application data."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the alernate application data.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_flow_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "call_flow_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select whether to enable or disable the call flow"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select whether to enable or disable the call flow";
$z++; $z++;

View File

@@ -28,7 +28,7 @@
if ($domains_processed == 1) { if ($domains_processed == 1) {
//update the dialplan order //update the dialplan order
$sql = "update v_call_flows set call_flow_enabled = 'true' where call_flow_enabled is null;\n"; $sql = "update v_call_flows set call_flow_enabled = true where call_flow_enabled is null;\n";
$database->execute($sql); $database->execute($sql);
unset($sql); unset($sql);

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2024 Portions created by the Initial Developer are Copyright (C) 2008-2025
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -84,7 +84,7 @@
$call_flow_alternate_sound = $_POST["call_flow_alternate_sound"]; $call_flow_alternate_sound = $_POST["call_flow_alternate_sound"];
$call_flow_alternate_destination = $_POST["call_flow_alternate_destination"]; $call_flow_alternate_destination = $_POST["call_flow_alternate_destination"];
$call_flow_context = $_POST["call_flow_context"]; $call_flow_context = $_POST["call_flow_context"];
$call_flow_enabled = $_POST["call_flow_enabled"] ?? 'false'; $call_flow_enabled = $_POST["call_flow_enabled"];
$call_flow_description = $_POST["call_flow_description"]; $call_flow_description = $_POST["call_flow_description"];
//seperate the action and the param //seperate the action and the param
@@ -364,9 +364,6 @@
$call_flow_context = $_SESSION['domain_name']; $call_flow_context = $_SESSION['domain_name'];
} }
//set the defaults
if (empty($call_flow_enabled)) { $call_flow_enabled = 'true'; }
//get the sounds //get the sounds
$sounds = new sounds; $sounds = new sounds;
$audio_files = $sounds->get(); $audio_files = $sounds->get();
@@ -770,17 +767,16 @@
echo " ".$text['label-enabled']."\n"; echo " ".$text['label-enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td width=\"70%\" class='vtable' align='left'>\n"; echo "<td width=\"70%\" class='vtable' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='call_flow_enabled' name='call_flow_enabled' value='true' ".($call_flow_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='call_flow_enabled' name='call_flow_enabled'>\n"; echo " <select class='formfld' id='call_flow_enabled' name='call_flow_enabled'>\n";
echo " <option value='true' ".($call_flow_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($call_flow_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($call_flow_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($call_flow_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<tr>\n"; echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n"; echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";

View File

@@ -115,7 +115,6 @@
$parameters['domain_uuid'] = $_SESSION['domain_uuid']; $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
} }
$sql .= $sql_search ?? ''; $sql .= $sql_search ?? '';
$database = new database;
$num_rows = $database->select($sql, $parameters ?? null, 'column'); $num_rows = $database->select($sql, $parameters ?? null, 'column');
//prepare to page the results //prepare to page the results
@@ -131,10 +130,35 @@
$offset = $rows_per_page * $page; $offset = $rows_per_page * $page;
//get the list //get the list
$sql = str_replace('count(*)', '*', $sql ?? ''); $sql = "select ";
$sql .= "call_flow_uuid, ";
$sql .= "domain_uuid, ";
$sql .= "dialplan_uuid, ";
$sql .= "call_flow_name, ";
$sql .= "call_flow_extension, ";
$sql .= "call_flow_feature_code, ";
$sql .= "call_flow_context, ";
$sql .= "call_flow_status, ";
$sql .= "call_flow_pin_number, ";
$sql .= "call_flow_label, ";
$sql .= "call_flow_sound, ";
$sql .= "call_flow_app, ";
$sql .= "call_flow_data, ";
$sql .= "call_flow_alternate_label, ";
$sql .= "call_flow_alternate_sound, ";
$sql .= "call_flow_alternate_app, ";
$sql .= "call_flow_alternate_data, ";
$sql .= "cast(call_flow_enabled as text), ";
$sql .= "call_flow_description ";
$sql .= "from v_call_flows ";
$sql .= "where true ";
if ($show != "all" || !permission_exists('call_flow_all')) {
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
}
$sql .= $sql_search ?? '';
$sql .= order_by($order_by, $order, 'call_flow_name', 'asc', $sort); $sql .= order_by($order_by, $order, 'call_flow_name', 'asc', $sort);
$sql .= limit_offset($rows_per_page, $offset); $sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$call_flows = $database->select($sql, $parameters ?? null, 'all'); $call_flows = $database->select($sql, $parameters ?? null, 'all');
unset($sql, $parameters); unset($sql, $parameters);

View File

@@ -305,7 +305,7 @@
if (!empty($extensions)) { if (!empty($extensions)) {
$x = 0; $x = 0;
foreach ($extensions as $row) { foreach ($extensions as $row) {
$list_row_url = PROJECT_PATH . "/app/call_forward/call_forward_edit.php?id=" . $row['extension_uuid'] . "&return_url=" . urlencode($_SERVER['REQUEST_URI']); $list_row_url = PROJECT_PATH . "/app/call_forward/call_forward_edit.php?id=".$row['extension_uuid'];
if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) { if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) {
$list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true'; $list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true';
} }
@@ -341,13 +341,13 @@
//---------------------------------- //----------------------------------
echo " <td>\n"; echo " <td>\n";
echo $row['forward_all_enabled'] == 'true' ? escape(format_phone($row['forward_all_destination'])) : '&nbsp;'; echo $row['forward_all_enabled'] == true ? escape(format_phone($row['forward_all_destination'])) : '&nbsp;';
echo " </td>\n"; echo " </td>\n";
} }
if (permission_exists('follow_me')) { if (permission_exists('follow_me')) {
//-- inline toggle ----------------- //-- inline toggle -----------------
//get destination count //get destination count
//if ($row['follow_me_enabled'] == 'true' && is_uuid($row['follow_me_uuid'])) { //if ($row['follow_me_enabled'] == true && is_uuid($row['follow_me_uuid'])) {
// $sql = "select count(*) from v_follow_me_destinations "; // $sql = "select count(*) from v_follow_me_destinations ";
// $sql .= "where follow_me_uuid = :follow_me_uuid "; // $sql .= "where follow_me_uuid = :follow_me_uuid ";
// $sql .= "and domain_uuid = :domain_uuid "; // $sql .= "and domain_uuid = :domain_uuid ";
@@ -370,7 +370,7 @@
//---------------------------------- //----------------------------------
//get destination count //get destination count
$follow_me_destination_count = 0; $follow_me_destination_count = 0;
if ($row['follow_me_enabled'] == 'true' && is_uuid($row['follow_me_uuid'])) { if ($row['follow_me_enabled'] == true && is_uuid($row['follow_me_uuid'])) {
$sql = "select count(*) from v_follow_me_destinations "; $sql = "select count(*) from v_follow_me_destinations ";
$sql .= "where follow_me_uuid = :follow_me_uuid "; $sql .= "where follow_me_uuid = :follow_me_uuid ";
$sql .= "and domain_uuid = :domain_uuid "; $sql .= "and domain_uuid = :domain_uuid ";

View File

@@ -38,6 +38,15 @@
exit; exit;
} }
//set toggle defaults
$forward_all_enabled = false;
$forward_busy_enabled = false;
$forward_no_answer_enabled = false;
$forward_user_not_registered_enabled = false;
$do_not_disturb = false;
$follow_me_enabled = false;
$follow_me_ignore_busy = false;
//add multi-lingual support //add multi-lingual support
$language = new text; $language = new text;
$text = $language->get(); $text = $language->get();
@@ -80,7 +89,6 @@
} }
$parameters['domain_uuid'] = $_SESSION['domain_uuid']; $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['extension_uuid'] = $extension_uuid; $parameters['extension_uuid'] = $extension_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row'); $row = $database->select($sql, $parameters, 'row');
if (!empty($row)) { if (!empty($row)) {
$extension = $row["extension"]; $extension = $row["extension"];
@@ -90,15 +98,15 @@
$effective_caller_id_number = $row["effective_caller_id_number"]; $effective_caller_id_number = $row["effective_caller_id_number"];
$outbound_caller_id_name = $row["outbound_caller_id_name"]; $outbound_caller_id_name = $row["outbound_caller_id_name"];
$outbound_caller_id_number = $row["outbound_caller_id_number"]; $outbound_caller_id_number = $row["outbound_caller_id_number"];
$do_not_disturb = !empty($row["do_not_disturb"]) ? $row["do_not_disturb"] : 'false'; $do_not_disturb = filter_var($row["do_not_disturb"], FILTER_VALIDATE_BOOLEAN);
$forward_all_destination = $row["forward_all_destination"]; $forward_all_destination = $row["forward_all_destination"];
$forward_all_enabled = $row["forward_all_enabled"]; $forward_all_enabled = filter_var($row["forward_all_enabled"], FILTER_VALIDATE_BOOLEAN);
$forward_busy_destination = $row["forward_busy_destination"]; $forward_busy_destination = $row["forward_busy_destination"];
$forward_busy_enabled = $row["forward_busy_enabled"]; $forward_busy_enabled = filter_var($row["forward_busy_enabled"], FILTER_VALIDATE_BOOLEAN);
$forward_no_answer_destination = $row["forward_no_answer_destination"]; $forward_no_answer_destination = $row["forward_no_answer_destination"];
$forward_no_answer_enabled = $row["forward_no_answer_enabled"]; $forward_no_answer_enabled = filter_var($row["forward_no_answer_enabled"], FILTER_VALIDATE_BOOLEAN);
$forward_user_not_registered_destination = $row["forward_user_not_registered_destination"]; $forward_user_not_registered_destination = $row["forward_user_not_registered_destination"];
$forward_user_not_registered_enabled = $row["forward_user_not_registered_enabled"]; $forward_user_not_registered_enabled = filter_var($row["forward_user_not_registered_enabled"], FILTER_VALIDATE_BOOLEAN);
$follow_me_uuid = $row["follow_me_uuid"]; $follow_me_uuid = $row["follow_me_uuid"];
} }
else { else {
@@ -111,20 +119,20 @@
if (!empty($_POST) && empty($_POST["persistformvar"])) { if (!empty($_POST) && empty($_POST["persistformvar"])) {
//get http post variables and set them to php variables //get http post variables and set them to php variables
if (!empty($_POST)) { $forward_all_enabled = filter_var($_POST["forward_all_enabled"], FILTER_VALIDATE_BOOLEAN);
$forward_all_enabled = !empty($_POST["forward_all_destination"]) ? $_POST["forward_all_enabled"] : 'false';
$forward_all_destination = $_POST["forward_all_destination"]; $forward_all_destination = $_POST["forward_all_destination"];
$forward_busy_enabled = !empty($_POST["forward_busy_destination"]) ? $_POST["forward_busy_enabled"] : 'false'; $forward_busy_enabled = filter_var($_POST["forward_busy_enabled"], FILTER_VALIDATE_BOOLEAN);
$forward_busy_destination = $_POST["forward_busy_destination"]; $forward_busy_destination = $_POST["forward_busy_destination"];
$forward_no_answer_enabled = !empty($_POST["forward_no_answer_destination"]) ? $_POST["forward_no_answer_enabled"] : 'false'; $forward_no_answer_enabled = filter_var($_POST["forward_no_answer_enabled"], FILTER_VALIDATE_BOOLEAN);
$forward_no_answer_destination = $_POST["forward_no_answer_destination"]; $forward_no_answer_destination = $_POST["forward_no_answer_destination"];
$forward_user_not_registered_enabled = !empty($_POST["forward_user_not_registered_destination"]) ? $_POST["forward_user_not_registered_enabled"] : 'false'; $forward_user_not_registered_enabled = filter_var($_POST["forward_user_not_registered_enabled"], FILTER_VALIDATE_BOOLEAN);
$forward_user_not_registered_destination = $_POST["forward_user_not_registered_destination"]; $forward_user_not_registered_destination = $_POST["forward_user_not_registered_destination"];
$do_not_disturb = filter_var($_POST["do_not_disturb"], FILTER_VALIDATE_BOOLEAN);
$cid_name_prefix = $_POST["cid_name_prefix"] ?? ''; $cid_name_prefix = $_POST["cid_name_prefix"] ?? '';
$cid_number_prefix = $_POST["cid_number_prefix"] ?? ''; $cid_number_prefix = $_POST["cid_number_prefix"] ?? '';
$follow_me_enabled = $_POST["follow_me_enabled"]; $follow_me_enabled = filter_var($_POST["follow_me_enabled"], FILTER_VALIDATE_BOOLEAN);
$follow_me_ignore_busy = $_POST["follow_me_ignore_busy"]; $follow_me_ignore_busy = filter_var($_POST["follow_me_ignore_busy"], FILTER_VALIDATE_BOOLEAN);
$n = 0; $n = 0;
$destination_found = false; $destination_found = false;
@@ -134,13 +142,11 @@
$destinations[$n]['delay'] = $field['delay']; $destinations[$n]['delay'] = $field['delay'];
$destinations[$n]['prompt'] = $field['prompt']; $destinations[$n]['prompt'] = $field['prompt'];
$destinations[$n]['timeout'] = $field['timeout']; $destinations[$n]['timeout'] = $field['timeout'];
if (!empty($field['destination'])) { if (isset($field['destination'])) {
$destination_found = true; $destination_found = true;
} }
$n++; $n++;
} }
$dnd_enabled = $_POST["dnd_enabled"];
}
//validate the token //validate the token
$token = new token; $token = new token;
@@ -176,13 +182,13 @@
//build the array //build the array
$array['extensions'][0]['domain_uuid'] = $_SESSION['domain_uuid']; $array['extensions'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['extensions'][0]['extension_uuid'] = $extension_uuid; $array['extensions'][0]['extension_uuid'] = $extension_uuid;
$array['extensions'][0]['forward_all_enabled'] = $forward_all_enabled; $array['extensions'][0]['forward_all_enabled'] = $forward_all_enabled ? 'true' : 'false';
$array['extensions'][0]['forward_all_destination'] = $forward_all_destination; $array['extensions'][0]['forward_all_destination'] = $forward_all_destination;
$array['extensions'][0]['forward_busy_enabled'] = $forward_busy_enabled; $array['extensions'][0]['forward_busy_enabled'] = $forward_busy_enabled ? 'true' : 'false';
$array['extensions'][0]['forward_busy_destination'] = $forward_busy_destination; $array['extensions'][0]['forward_busy_destination'] = $forward_busy_destination;
$array['extensions'][0]['forward_no_answer_enabled'] = $forward_no_answer_enabled; $array['extensions'][0]['forward_no_answer_enabled'] = $forward_no_answer_enabled ? 'true' : 'false';
$array['extensions'][0]['forward_no_answer_destination'] = $forward_no_answer_destination; $array['extensions'][0]['forward_no_answer_destination'] = $forward_no_answer_destination;
$array['extensions'][0]['forward_user_not_registered_enabled'] = $forward_user_not_registered_enabled; $array['extensions'][0]['forward_user_not_registered_enabled'] = $forward_user_not_registered_enabled ? 'true' : 'false';
$array['extensions'][0]['forward_user_not_registered_destination'] = $forward_user_not_registered_destination; $array['extensions'][0]['forward_user_not_registered_destination'] = $forward_user_not_registered_destination;
} }
@@ -190,7 +196,7 @@
if (permission_exists('do_not_disturb')) { if (permission_exists('do_not_disturb')) {
$array['extensions'][0]['domain_uuid'] = $_SESSION['domain_uuid']; $array['extensions'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['extensions'][0]['extension_uuid'] = $extension_uuid; $array['extensions'][0]['extension_uuid'] = $extension_uuid;
$array['extensions'][0]['do_not_disturb'] = $dnd_enabled; $array['extensions'][0]['do_not_disturb'] = $do_not_disturb ? 'true' : 'false';
} }
//follow me config //follow me config
@@ -203,24 +209,15 @@
$array['extensions'][0]['extension_uuid'] = $extension_uuid; $array['extensions'][0]['extension_uuid'] = $extension_uuid;
$array['extensions'][0]['follow_me_uuid'] = $follow_me_uuid; $array['extensions'][0]['follow_me_uuid'] = $follow_me_uuid;
} }
if ($destination_found) { $array['extensions'][0]['follow_me_enabled'] = ($destination_found && $follow_me_enabled) ? 'true' : 'false';
$array['extensions'][0]['follow_me_enabled'] = $follow_me_enabled;
}
else {
$array['extensions'][0]['follow_me_enabled'] = 'false';
}
//build the follow me array //build the follow me array
$array['follow_me'][0]['domain_uuid'] = $_SESSION['domain_uuid']; $array['follow_me'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['follow_me'][0]['follow_me_uuid'] = $follow_me_uuid; $array['follow_me'][0]['follow_me_uuid'] = $follow_me_uuid;
$array['follow_me'][0]['cid_name_prefix'] = $cid_name_prefix; $array['follow_me'][0]['cid_name_prefix'] = $cid_name_prefix;
$array['follow_me'][0]['cid_number_prefix'] = $cid_number_prefix; $array['follow_me'][0]['cid_number_prefix'] = $cid_number_prefix;
$array['follow_me'][0]['follow_me_ignore_busy'] = $follow_me_ignore_busy; $array['follow_me'][0]['follow_me_ignore_busy'] = $follow_me_ignore_busy ? 'true' : 'false';
if ($destination_found) { $array['follow_me'][0]['follow_me_enabled'] = ($destination_found && $follow_me_enabled) ? 'true' : 'false';
$array['follow_me'][0]['follow_me_enabled'] = $follow_me_enabled;
}
else {
$array['follow_me'][0]['follow_me_enabled'] = 'false';
}
$d = 0; $d = 0;
$destination_found = false; $destination_found = false;
@@ -252,7 +249,6 @@
$p->add("extension_edit", "temp"); $p->add("extension_edit", "temp");
//save the data //save the data
$database = new database;
$database->app_name = 'call_forward'; $database->app_name = 'call_forward';
$database->app_uuid = '19806921-e8ed-dcff-b325-dd3e5da4959d'; $database->app_uuid = '19806921-e8ed-dcff-b325-dd3e5da4959d';
$database->save($array); $database->save($array);
@@ -266,7 +262,6 @@
foreach ($follow_me_delete_uuids as $follow_me_delete_uuid) { foreach ($follow_me_delete_uuids as $follow_me_delete_uuid) {
$array['follow_me_destinations'][]['follow_me_destination_uuid'] = $follow_me_delete_uuid; $array['follow_me_destinations'][]['follow_me_destination_uuid'] = $follow_me_delete_uuid;
} }
$database = new database;
$database->app_name = 'call_forward'; $database->app_name = 'call_forward';
$database->app_uuid = '19806921-e8ed-dcff-b325-dd3e5da4959d'; $database->app_uuid = '19806921-e8ed-dcff-b325-dd3e5da4959d';
$database->delete($array); $database->delete($array);
@@ -291,11 +286,11 @@
$dnd->domain_name = $_SESSION['domain_name']; $dnd->domain_name = $_SESSION['domain_name'];
$dnd->extension_uuid = $extension_uuid; $dnd->extension_uuid = $extension_uuid;
$dnd->extension = $extension; $dnd->extension = $extension;
$dnd->enabled = $dnd_enabled; $dnd->enabled = $do_not_disturb ? 'true' : 'false';
} }
//if follow me is enabled then process call forward and dnd first //if follow me is enabled then process call forward and dnd first
if ($follow_me_enabled == "true") { if ($follow_me_enabled) {
//call forward //call forward
$call_forward->set(); $call_forward->set();
unset($call_forward); unset($call_forward);
@@ -318,8 +313,8 @@
} }
//if dnd or call forward are enabled process them last //if dnd or call forward are enabled process them last
if ($follow_me_enabled != "true") { if ($follow_me_enabled != true) {
if ($forward_all_enabled == "true") { if ($forward_all_enabled == true) {
//dnd //dnd
$dnd->set(); $dnd->set();
$dnd->user_status(); $dnd->user_status();
@@ -346,7 +341,7 @@
$feature_event_notify = new feature_event_notify; $feature_event_notify = new feature_event_notify;
$feature_event_notify->domain_name = $_SESSION['domain_name']; $feature_event_notify->domain_name = $_SESSION['domain_name'];
$feature_event_notify->extension = $extension; $feature_event_notify->extension = $extension;
$feature_event_notify->do_not_disturb = $dnd_enabled; $feature_event_notify->do_not_disturb = $do_not_disturb ? 'true' : 'false';
$feature_event_notify->ring_count = $ring_count; $feature_event_notify->ring_count = $ring_count;
$feature_event_notify->forward_all_enabled = $forward_all_enabled; $feature_event_notify->forward_all_enabled = $forward_all_enabled;
$feature_event_notify->forward_busy_enabled = $forward_busy_enabled; $feature_event_notify->forward_busy_enabled = $forward_busy_enabled;
@@ -378,7 +373,7 @@
//send presence event //send presence event
if (permission_exists('do_not_disturb')) { if (permission_exists('do_not_disturb')) {
if ($dnd_enabled == 'true') { if ($do_not_disturb) {
//build the event //build the event
$cmd = "sendevent PRESENCE_IN\n"; $cmd = "sendevent PRESENCE_IN\n";
$cmd .= "proto: sip\n"; $cmd .= "proto: sip\n";
@@ -420,7 +415,7 @@
} }
//synchronize configuration //synchronize configuration
if (!empty($_SESSION['switch']['extensions']['dir']) && is_readable($_SESSION['switch']['extensions']['dir'])) { if (!empty($settings->get('switch', 'extensions')) && is_readable($settings->get('switch', 'extensions'))) {
$ext = new extension; $ext = new extension;
$ext->xml(); $ext->xml();
unset($ext); unset($ext);
@@ -435,6 +430,11 @@
//add the message //add the message
message::add($text['confirm-update']); message::add($text['confirm-update']);
// redirect
header('Location: call_forward_edit.php?id='.$extension_uuid);
exit;
} }
//show the header //show the header
@@ -448,22 +448,21 @@
$sql .= "and follow_me_uuid = :follow_me_uuid "; $sql .= "and follow_me_uuid = :follow_me_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid']; $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['follow_me_uuid'] = $follow_me_uuid; $parameters['follow_me_uuid'] = $follow_me_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row'); $row = $database->select($sql, $parameters, 'row');
unset($sql, $parameters); unset($sql, $parameters);
if (!empty($row)) { if (!empty($row)) {
$cid_name_prefix = $row["cid_name_prefix"]; $cid_name_prefix = $row["cid_name_prefix"];
$cid_number_prefix = $row["cid_number_prefix"]; $cid_number_prefix = $row["cid_number_prefix"];
$follow_me_enabled = $row["follow_me_enabled"]; $follow_me_enabled = filter_var($row["follow_me_enabled"], FILTER_VALIDATE_BOOLEAN);
$follow_me_ignore_busy = $row["follow_me_ignore_busy"]; $follow_me_ignore_busy = filter_var($row["follow_me_ignore_busy"], FILTER_VALIDATE_BOOLEAN);
unset($row); unset($row);
$sql = "select * from v_follow_me_destinations "; $sql = "select * from v_follow_me_destinations ";
$sql .= "where follow_me_uuid = :follow_me_uuid "; $sql .= "where follow_me_uuid = :follow_me_uuid ";
$sql .= "order by follow_me_order asc "; $sql .= "order by follow_me_order asc ";
$parameters['follow_me_uuid'] = $follow_me_uuid; $parameters['follow_me_uuid'] = $follow_me_uuid;
$database = new database;
$result = $database->select($sql, $parameters, 'all'); $result = $database->select($sql, $parameters, 'all');
unset($destinations); unset($destinations);
@@ -479,7 +478,7 @@
} }
//add the pre-defined follow me destinations //add the pre-defined follow me destinations
for ($n = 0; $n <= (((!empty($_SESSION['follow_me']['max_destinations']['numeric'])) ? $_SESSION['follow_me']['max_destinations']['numeric'] : 5) - 1); $n++) { for ($n = 0; $n <= $settings->get('follow_me', 'max_destinations', 5) - 1; $n++) {
if (empty($destinations[$n]['uuid'])) { $destinations[$n]['uuid'] = null; } if (empty($destinations[$n]['uuid'])) { $destinations[$n]['uuid'] = null; }
if (empty($destinations[$n]['destination'])) { $destinations[$n]['destination'] = null; } if (empty($destinations[$n]['destination'])) { $destinations[$n]['destination'] = null; }
if (empty($destinations[$n]['delay'])) { $destinations[$n]['delay'] = null; } if (empty($destinations[$n]['delay'])) { $destinations[$n]['delay'] = null; }
@@ -492,16 +491,9 @@
$sql .= "where domain_uuid = :domain_uuid "; $sql .= "where domain_uuid = :domain_uuid ";
$sql .= "order by extension, number_alias asc "; $sql .= "order by extension, number_alias asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid']; $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$extensions = $database->select($sql, $parameters, 'all'); $extensions = $database->select($sql, $parameters, 'all');
unset($sql, $parameters, $row); unset($sql, $parameters, $row);
//set the default
if (empty($dnd_enabled)) {
//set the value from the database
$dnd_enabled = $do_not_disturb;
}
//prepare the autocomplete //prepare the autocomplete
if ($settings->get('follow_me', 'follow_me_autocomplete', false)) { if ($settings->get('follow_me', 'follow_me_autocomplete', false)) {
echo "<link rel=\"stylesheet\" href=\"".PROJECT_PATH."/resources/jquery/jquery-ui.min.css\" />\n"; echo "<link rel=\"stylesheet\" href=\"".PROJECT_PATH."/resources/jquery/jquery-ui.min.css\" />\n";
@@ -518,7 +510,7 @@
} }
} }
echo " ];\n"; echo " ];\n";
for ($n = 0; $n <= (((!empty($_SESSION['follow_me']['max_destinations']['numeric'])) ? $_SESSION['follow_me']['max_destinations']['numeric'] : 5) - 1); $n++) { for ($n = 0; $n <= $settings->get('follow_me', 'max_destinations', 5) - 1; $n++) {
echo " \$(\"#destination_".$n."\").autocomplete({\n"; echo " \$(\"#destination_".$n."\").autocomplete({\n";
echo " source: extensions\n"; echo " source: extensions\n";
echo " });\n"; echo " });\n";
@@ -558,40 +550,29 @@
echo " <strong>".$text['label-call_forward']."</strong>\n"; echo " <strong>".$text['label-call_forward']."</strong>\n";
echo "</td>\n"; echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n"; echo "<td width='70%' class='vtable' align='left'>\n";
echo " <script>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { echo " function changed_call_forward() {\n";
echo "<label class='switch'>\n"; echo " if (document.getElementById('forward_all_enabled').value == 'true'){\n";
echo " <input type='checkbox' id='forward_all_enabled' name='forward_all_enabled' value='true' ".(!empty($forward_all_enabled) && $forward_all_enabled == 'true' ? "checked='checked'" : null)." onchange='changed_forward_all(this);'>\n";
echo " <span class='slider'></span>\n";
echo "</label>\n";
echo "<script>\n";
echo "function changed_forward_all(el) {\n";
echo " if (el.checked) {\n";
echo " $('#div_follow_me_settings').slideUp('fast');\n";
echo " document.getElementById('follow_me_enabled').checked = false;\n";
echo " document.getElementById('dnd_enabled').checked = false;\n";
echo " document.getElementById('forward_all_destination').focus();\n"; echo " document.getElementById('forward_all_destination').focus();\n";
echo " document.getElementById('follow_me_enabled').value = 'false';\n";
echo " document.getElementById('do_not_disturb').value = 'false';\n";
echo " $('#div_follow_me_settings').slideUp('fast');\n";
echo " }\n"; echo " }\n";
echo " else {\n";
echo " if (document.getElementById('follow_me_enabled').checked) { $('#div_follow_me_settings').slideDown('fast'); }\n";
echo " }\n"; echo " }\n";
echo "}\n"; echo " </script>\n";
echo "</script>\n"; if ($input_toggle_style_switch) {
echo " <span class='switch'>\n";
} }
else { echo " <select class='formfld' id='forward_all_enabled' name='forward_all_enabled' onchange='changed_call_forward();'>\n";
$on_click = "$('#div_follow_me_settings').slideUp('fast'); "; echo " <option value='true' ".($forward_all_enabled === true ? "selected='selected'" : '').">".$text['option-true']."</option>\n";
$on_click .= "document.getElementById('follow_me_disabled').checked = true; "; echo " <option value='false' ".($forward_all_enabled === false ? "selected='selected'" : '').">".$text['option-false']."</option>\n";
$on_click .= "document.getElementById('dnd_disabled').checked = true; "; echo " </select>\n";
$on_click .= "document.getElementById('forward_all_destination').focus(); "; if ($input_toggle_style_switch) {
$on_click2 = "(document.getElementById('follow_me_enabled').checked) ? $('#div_follow_me_settings').slideDown('fast') : '' "; echo " <span class='slider'></span>\n";
echo " <label for='forward_all_disabled'><input type='radio' name='forward_all_enabled' id='forward_all_disabled' onclick=\"$on_click2\" value='false' ".(($forward_all_enabled == "false" || $forward_all_enabled == "") ? "checked='checked'" : null)." /> ".$text['label-disabled']."</label> \n"; echo " </span>\n";
echo " <label for='forward_all_enabled'><input type='radio' name='forward_all_enabled' id='forward_all_enabled' onclick=\"$on_click\" value='true' ".(($forward_all_enabled == "true") ? "checked='checked'" : null)." /> ".$text['label-enabled']."</label> \n";
unset($on_click);
echo "&nbsp;&nbsp;";
}
echo "&nbsp;"; echo "&nbsp;";
echo " <input class='formfld' type='text' name='forward_all_destination' id='forward_all_destination' maxlength='255' placeholder=\"".$text['label-destination']."\" value=\"".escape($forward_all_destination)."\">\n"; }
echo " <input class='formfld' type='text' name='forward_all_destination' id='forward_all_destination' ".($input_toggle_style_switch ? "style='margin-top: -21px;'" : null)." maxlength='255' placeholder=\"".$text['label-destination']."\" value=\"".escape($forward_all_destination)."\">\n";
echo " <br />".$text['description-call_forward']."\n"; echo " <br />".$text['description-call_forward']."\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
@@ -601,30 +582,27 @@
echo " ".$text['label-on-busy']."\n"; echo " ".$text['label-on-busy']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { echo " <script>\n";
echo "<label class='switch'>\n"; echo " function changed_forward_on_busy() {\n";
echo " <input type='checkbox' id='forward_busy_enabled' name='forward_busy_enabled' value='true' ".(!empty($forward_busy_enabled) && $forward_busy_enabled == 'true' ? "checked='checked'" : null)." onchange='changed_forward_on_busy(this);'>\n"; echo " if (document.getElementById('forward_busy_enabled').value == 'true') {\n";
echo " <span class='slider'></span>\n"; echo " document.getElementById('do_not_disturb').value = 'false';\n";
echo "</label>\n";
echo "<script>\n";
echo "function changed_forward_on_busy(el) {\n";
echo " if (el.checked) {\n";
echo " document.getElementById('dnd_enabled').checked = false;\n";
echo " document.getElementById('forward_busy_destination').focus();\n"; echo " document.getElementById('forward_busy_destination').focus();\n";
echo " }\n"; echo " }\n";
echo "}\n"; echo " }\n";
echo "</script>\n"; echo " </script>\n";
} if ($input_toggle_style_switch) {
else { echo " <span class='switch'>\n";
$on_click = "document.getElementById('dnd_disabled').checked = true;";
$on_click .= "document.getElementById('forward_busy_destination').focus();";
echo " <label for='forward_busy_disabled'><input type='radio' name='forward_busy_enabled' id='forward_busy_disabled' onclick=\"\" value='false' ".(($forward_busy_enabled == "false" || $forward_busy_enabled == "") ? "checked='checked'" : null)." /> ".$text['label-disabled']."</label> \n";
echo " <label for='forward_busy_enabled'><input type='radio' name='forward_busy_enabled' id='forward_busy_enabled' onclick=\"$on_click\" value='true' ".(($forward_busy_enabled == "true") ? "checked='checked'" : null)."/> ".$text['label-enabled']."</label> \n";
unset($on_click);
echo "&nbsp;&nbsp;";
} }
echo " <select class='formfld' id='forward_busy_enabled' name='forward_busy_enabled' onchange='changed_forward_on_busy();'>\n";
echo " <option value='true' ".($forward_busy_enabled === true ? "selected='selected'" : '').">".$text['option-true']."</option>\n";
echo " <option value='false' ".($forward_busy_enabled === false ? "selected='selected'" : '').">".$text['option-false']."</option>\n";
echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
echo "&nbsp;"; echo "&nbsp;";
echo " <input class='formfld' type='text' name='forward_busy_destination' id='forward_busy_destination' maxlength='255' placeholder=\"".$text['label-destination']."\" value=\"".escape($forward_busy_destination)."\">\n"; }
echo " <input class='formfld' type='text' name='forward_busy_destination' id='forward_busy_destination' ".($input_toggle_style_switch ? "style='margin-top: -21px;'" : null)." maxlength='255' placeholder=\"".$text['label-destination']."\" value=\"".escape($forward_busy_destination)."\">\n";
echo " <br />".$text['description-on-busy']."\n"; echo " <br />".$text['description-on-busy']."\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
@@ -634,30 +612,27 @@
echo " ".$text['label-no_answer']."\n"; echo " ".$text['label-no_answer']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { echo " <script>\n";
echo "<label class='switch'>\n"; echo " function changed_forward_no_answer() {\n";
echo " <input type='checkbox' id='forward_no_answer_enabled' name='forward_no_answer_enabled' value='true' ".(!empty($forward_no_answer_enabled) && $forward_no_answer_enabled == 'true' ? "checked='checked'" : null)." onchange='changed_forward_no_answer(this);'>\n"; echo " if (document.getElementById('forward_no_answer_enabled').value == 'true') {\n";
echo " <span class='slider'></span>\n"; echo " document.getElementById('do_not_disturb').value = 'false';\n";
echo "</label>\n";
echo "<script>\n";
echo "function changed_forward_no_answer(el) {\n";
echo " if (el.checked) {\n";
echo " document.getElementById('dnd_enabled').checked = false;\n";
echo " document.getElementById('forward_no_answer_destination').focus();\n"; echo " document.getElementById('forward_no_answer_destination').focus();\n";
echo " }\n"; echo " }\n";
echo "}\n"; echo " }\n";
echo "</script>\n"; echo " </script>\n";
} if ($input_toggle_style_switch) {
else { echo " <span class='switch'>\n";
$on_click = "document.getElementById('dnd_disabled').checked = true;";
$on_click .= "document.getElementById('forward_no_answer_destination').focus();";
echo " <label for='forward_no_answer_disabled'><input type='radio' name='forward_no_answer_enabled' id='forward_no_answer_disabled' onclick=\"\" value='false' ".(($forward_no_answer_enabled == "false" || $forward_no_answer_enabled == "") ? "checked='checked'" : null)." /> ".$text['label-disabled']."</label> \n";
echo " <label for='forward_no_answer_enabled'><input type='radio' name='forward_no_answer_enabled' id='forward_no_answer_enabled' onclick=\"$on_click\" value='true' ".(($forward_no_answer_enabled == "true") ? "checked='checked'" : null)."/> ".$text['label-enabled']."</label> \n";
unset($on_click);
echo "&nbsp;&nbsp;";
} }
echo " <select class='formfld' id='forward_no_answer_enabled' name='forward_no_answer_enabled' onchange='changed_forward_no_answer();'>\n";
echo " <option value='true' ".($forward_no_answer_enabled === true ? "selected='selected'" : '').">".$text['option-true']."</option>\n";
echo " <option value='false' ".($forward_no_answer_enabled === false ? "selected='selected'" : '').">".$text['option-false']."</option>\n";
echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
echo "&nbsp;"; echo "&nbsp;";
echo " <input class='formfld' type='text' name='forward_no_answer_destination' id='forward_no_answer_destination' maxlength='255' placeholder=\"".$text['label-destination']."\" value=\"".escape($forward_no_answer_destination)."\">\n"; }
echo " <input class='formfld' type='text' name='forward_no_answer_destination' id='forward_no_answer_destination' ".($input_toggle_style_switch ? "style='margin-top: -21px;'" : null)." maxlength='255' placeholder=\"".$text['label-destination']."\" value=\"".escape($forward_no_answer_destination)."\">\n";
echo " <br />".$text['description-no_answer']."\n"; echo " <br />".$text['description-no_answer']."\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
@@ -667,72 +642,65 @@
echo " ".$text['label-not_registered']."\n"; echo " ".$text['label-not_registered']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { echo " <script>\n";
echo "<label class='switch'>\n"; echo " function changed_forward_not_registered() {\n";
echo " <input type='checkbox' id='forward_user_not_registered_enabled' name='forward_user_not_registered_enabled' value='true' ".(!empty($forward_user_not_registered_enabled) && $forward_user_not_registered_enabled == 'true' ? "checked='checked'" : null)." onchange='changed_forward_not_registered(this);'>\n"; echo " if (document.getElementById('forward_user_not_registered_enabled').value == 'true') {\n";
echo " <span class='slider'></span>\n";
echo "</label>\n";
echo "<script>\n";
echo "function changed_forward_not_registered(el) {\n";
echo " if (el.checked) {\n";
echo " document.getElementById('forward_user_not_registered_destination').focus();\n"; echo " document.getElementById('forward_user_not_registered_destination').focus();\n";
echo " }\n"; echo " }\n";
echo "}\n"; echo " }\n";
echo "</script>\n"; echo " </script>\n";
} if ($input_toggle_style_switch) {
else { echo " <span class='switch'>\n";
$on_click = "document.getElementById('forward_user_not_registered_destination').focus();";
echo " <label for='forward_user_not_registered_disabled'><input type='radio' name='forward_user_not_registered_enabled' id='forward_user_not_registered_disabled' onclick=\"\" value='false' ".(($forward_user_not_registered_enabled == "false" || $forward_user_not_registered_enabled == "") ? "checked='checked'" : null)." /> ".$text['label-disabled']."</label> \n";
echo " <label for='forward_user_not_registered_enabled'><input type='radio' name='forward_user_not_registered_enabled' id='forward_user_not_registered_enabled' onclick=\"$on_click\" value='true' ".(($forward_user_not_registered_enabled == "true") ? "checked='checked'" : null)."/> ".$text['label-enabled']."</label> \n";
unset($on_click);
echo "&nbsp;&nbsp;";
} }
echo " <select class='formfld' id='forward_user_not_registered_enabled' name='forward_user_not_registered_enabled' onchange='changed_forward_not_registered(this);'>\n";
echo " <option value='true' ".($forward_user_not_registered_enabled === true ? "selected='selected'" : '').">".$text['option-true']."</option>\n";
echo " <option value='false' ".($forward_user_not_registered_enabled === false ? "selected='selected'" : '').">".$text['option-false']."</option>\n";
echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
echo "&nbsp;"; echo "&nbsp;";
echo " <input class='formfld' type='text' name='forward_user_not_registered_destination' id='forward_user_not_registered_destination' maxlength='255' placeholder=\"".$text['label-destination']."\" value=\"".escape($forward_user_not_registered_destination)."\">\n"; }
echo " <input class='formfld' type='text' name='forward_user_not_registered_destination' id='forward_user_not_registered_destination' ".($input_toggle_style_switch ? "style='margin-top: -21px;'" : null)." maxlength='255' placeholder=\"".$text['label-destination']."\" value=\"".escape($forward_user_not_registered_destination)."\">\n";
echo " <br />".$text['description-not_registered']."\n"; echo " <br />".$text['description-not_registered']."\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
echo "<tr><td colspan='2'><br /></td></tr>\n"; echo "<tr><td colspan='2'><br /></td></tr>\n";
echo "</table>\n"; echo "</table>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n"; echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n"; echo "<tr>\n";
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'>\n"; echo "<td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " <strong>".$text['label-follow_me']."</strong>\n"; echo " <strong>".$text['label-follow_me']."</strong>\n";
echo "</td>\n"; echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n"; echo "<td id='td_follow_me' width='70%' class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { echo " <script>\n";
echo "<label class='switch'>\n"; echo " function changed_follow_me() {\n";
echo " <input type='checkbox' id='follow_me_enabled' name='follow_me_enabled' value='true' ".(!empty($follow_me_enabled) && $follow_me_enabled == 'true' ? "checked='checked'" : null)." onchange='changed_follow_me(this);'>\n"; echo " if (document.getElementById('follow_me_enabled').value == 'true'){\n";
echo " <span class='slider'></span>\n";
echo "</label>\n";
echo "<script>\n";
echo "function changed_follow_me(el) {\n";
echo " if (el.checked) {\n";
echo " $('#div_follow_me_settings').slideDown('fast');\n"; echo " $('#div_follow_me_settings').slideDown('fast');\n";
echo " document.getElementById('forward_all_enabled').checked = false;\n"; echo " document.getElementById('forward_all_enabled').value = 'false';\n";
echo " document.getElementById('dnd_enabled').checked = false;\n"; echo " document.getElementById('do_not_disturb').value = 'false';\n";
echo " }\n"; echo " } else {\n";
echo " else {\n";
echo " $('#div_follow_me_settings').slideUp('fast');\n"; echo " $('#div_follow_me_settings').slideUp('fast');\n";
echo " }\n"; echo " }\n";
echo "}\n"; echo " }\n";
echo "</script>\n"; echo " </script>\n";
if ($input_toggle_style_switch) {
echo " <span class='switch'>\n";
} }
else { echo " <select class='formfld' id='follow_me_enabled' name='follow_me_enabled' onchange='changed_follow_me();'>\n";
$on_click = "document.getElementById('forward_all_disabled').checked = true; "; echo " <option value='true' ".($follow_me_enabled === true ? "selected='selected'" : '').">".$text['option-true']."</option>\n";
$on_click .= "document.getElementById('dnd_disabled').checked = true; "; echo " <option value='false' ".($follow_me_enabled === false ? "selected='selected'" : '').">".$text['option-false']."</option>\n";
echo " <label for='follow_me_disabled'><input type='radio' name='follow_me_enabled' id='follow_me_disabled' onclick=\"$('#div_follow_me_settings').slideUp('fast');\" value='false' ".((!empty($follow_me_enabled) && $follow_me_enabled == "false" || empty($follow_me_enabled)) ? "checked='checked'" : null)." /> ".$text['label-disabled']."</label> \n"; echo " </select>\n";
echo " <label for='follow_me_enabled'><input type='radio' name='follow_me_enabled' id='follow_me_enabled' onclick=\"$('#div_follow_me_settings').slideDown('fast'); $on_click\" value='true' ".((!empty($follow_me_enabled) && $follow_me_enabled == "true") ? "checked='checked'" : null)."/> ".$text['label-enabled']."</label> \n"; if ($input_toggle_style_switch) {
unset($on_click); echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
echo "</table>\n"; echo "</table>\n";
if (!empty($follow_me_enabled) && $follow_me_enabled == "true" && $dnd_enabled != "true" && $forward_all_enabled != "true") { $style = ''; } else { $style = 'display: none;'; } echo "<div id='div_follow_me_settings' ".(empty($follow_me_enabled) || $follow_me_enabled !== true ? "style='display: none;'" : null).">\n";
echo "<div id='div_follow_me_settings' style='$style'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n"; echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n"; echo "<tr>\n";
@@ -761,7 +729,7 @@
destination_select('destinations['.$n.'][delay]', $destination['delay'], '0'); destination_select('destinations['.$n.'][delay]', $destination['delay'], '0');
echo " </td>\n"; echo " </td>\n";
echo " <td>\n"; echo " <td>\n";
destination_select('destinations['.$n.'][timeout]', $destination['timeout'], ((!empty($_SESSION['follow_me']['timeout']['numeric'])) ? $_SESSION['follow_me']['timeout']['numeric'] : 30)); destination_select('destinations['.$n.'][timeout]', $destination['timeout'], $settings->get('follow_me', 'timeout', 30));
echo " </td>\n"; echo " </td>\n";
if (permission_exists('follow_me_prompt')) { if (permission_exists('follow_me_prompt')) {
echo " <td>\n"; echo " <td>\n";
@@ -785,17 +753,18 @@
echo $text['label-ignore_busy']; echo $text['label-ignore_busy'];
echo " </td>\n"; echo " </td>\n";
echo " <td class='vtable' align='left'>\n"; echo " <td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='follow_me_ignore_busy' name='follow_me_ignore_busy' value='true' ".(!empty($follow_me_ignore_busy) && $follow_me_ignore_busy == 'true' ? "checked='checked'" : null).">\n"; }
echo " <select class='formfld' id='follow_me_ignore_busy' name='follow_me_ignore_busy'>\n";
echo " <option value='true' ".($follow_me_ignore_busy === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($follow_me_ignore_busy === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n"; echo " <span class='slider'></span>\n";
echo " </label>\n"; echo " </span>\n";
}
}
else {
echo " <label for='follow_me_ignore_busy_false'><input type='radio' name='follow_me_ignore_busy' id='follow_me_ignore_busy_false' value='false' onclick=\"\" ".(empty($follow_me_ignore_busy) || $follow_me_ignore_busy == "false" ? "checked='checked'" : null)." /> ".$text['label-disabled']."</label> \n";
echo " <label for='follow_me_ignore_busy_true'><input type='radio' name='follow_me_ignore_busy' id='follow_me_ignore_busy_true' value='true' onclick=\"".$on_click."\" ".(!empty($follow_me_ignore_busy) && $follow_me_ignore_busy == "true" ? "checked='checked'" : null)." /> ".$text['label-enabled']."</label> \n";
}
echo " <br />\n"; echo " <br />\n";
echo $text['description-ignore_busy']."\n"; echo $text['description-ignore_busy']."\n";
echo " </td>\n"; echo " </td>\n";
@@ -828,7 +797,6 @@
echo "</tr>\n"; echo "</tr>\n";
} }
// echo "<tr><td colspan='2'><br /></td></tr>\n";
echo "</table>\n"; echo "</table>\n";
echo "</div>\n"; echo "</div>\n";
@@ -840,24 +808,23 @@
echo " <strong>".$text['label-dnd']."</strong>\n"; echo " <strong>".$text['label-dnd']."</strong>\n";
echo "</td>\n"; echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n"; echo "<td width='70%' class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { echo " <script>\n";
echo "<label class='switch'>\n"; echo " function changed_do_not_disturb(el) {\n";
echo " <input type='checkbox' id='dnd_enabled' name='dnd_enabled' value='true' ".(!empty($dnd_enabled) && $dnd_enabled == 'true' ? "checked='checked'" : null)." onchange='changed_do_not_disturb(this);'>\n"; echo " if (document.getElementById('do_not_disturb').value == 'true') {\n";
echo " <span class='slider'></span>\n"; echo " document.getElementById('forward_all_enabled').value = 'false';\n";
echo "</label>\n";
echo "<script>\n";
echo "function changed_do_not_disturb(el) {\n";
echo " if (el.checked) {\n";
echo " document.getElementById('forward_all_enabled').checked = false;\n";
echo " }\n"; echo " }\n";
echo "}\n"; echo " }\n";
echo "</script>\n"; echo " </script>\n";
if ($input_toggle_style_switch) {
echo " <span class='switch' onclick='changed_do_not_disturb(this);'>\n";
} }
else { echo " <select class='formfld' id='do_not_disturb' name='do_not_disturb' onchange='changed_do_not_disturb();'>\n";
$on_click = "document.getElementById('forward_all_disabled').checked = true;"; echo " <option value='true' ".($do_not_disturb === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
$on_click2 = "if (document.getElementById('follow_me_enabled').checked) { $('#div_follow_me_settings').slideDown('fast'); }"; echo " <option value='false' ".($do_not_disturb === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <label for='dnd_disabled'><input type='radio' name='dnd_enabled' id='dnd_disabled' value='false' onclick=\"$on_click2\" ".(($dnd_enabled == "false" || $dnd_enabled == "") ? "checked='checked'" : null)." /> ".$text['label-disabled']."</label> \n"; echo " </select>\n";
echo " <label for='dnd_enabled'><input type='radio' name='dnd_enabled' id='dnd_enabled' value='true' onclick=\"$on_click\" ".(($dnd_enabled == "true") ? "checked='checked'" : null)." /> ".$text['label-enabled']."</label> \n"; if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo " <br />\n"; echo " <br />\n";
echo "</td>\n"; echo "</td>\n";
@@ -876,5 +843,3 @@
//include the footer //include the footer
require_once "resources/footer.php"; require_once "resources/footer.php";
?>

View File

@@ -52,7 +52,7 @@
$sql .= "where domain_uuid = :domain_uuid "; $sql .= "where domain_uuid = :domain_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid']; $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
} }
$sql .= "and enabled = 'true' "; $sql .= "and enabled = true ";
if (!permission_exists('extension_edit')) { if (!permission_exists('extension_edit')) {
if (is_array($_SESSION['user']['extension']) && count($_SESSION['user']['extension']) > 0) { if (is_array($_SESSION['user']['extension']) && count($_SESSION['user']['extension']) > 0) {
$sql .= "and ("; $sql .= "and (";
@@ -84,13 +84,13 @@
if (is_array($extensions) && @sizeof($extensions) != 0) { if (is_array($extensions) && @sizeof($extensions) != 0) {
foreach ($extensions as $row) { foreach ($extensions as $row) {
if (permission_exists('call_forward')) { if (permission_exists('call_forward')) {
$stats['call_forward'] += $row['forward_all_enabled'] == 'true' && $row['forward_all_destination'] ? 1 : 0; $stats['call_forward'] += $row['forward_all_enabled'] == true && $row['forward_all_destination'] ? 1 : 0;
} }
if (permission_exists('follow_me')) { if (permission_exists('follow_me')) {
$stats['follow_me'] += $row['follow_me_enabled'] == 'true' && is_uuid($row['follow_me_uuid']) ? 1 : 0; $stats['follow_me'] += $row['follow_me_enabled'] == true && is_uuid($row['follow_me_uuid']) ? 1 : 0;
} }
if (permission_exists('do_not_disturb')) { if (permission_exists('do_not_disturb')) {
$stats['dnd'] += $row['do_not_disturb'] == 'true' ? 1 : 0; $stats['dnd'] += $row['do_not_disturb'] == true ? 1 : 0;
} }
} }
$stats['active'] = @sizeof($extensions) - $stats['call_forward'] - $stats['follow_me'] - $stats['dnd']; $stats['active'] = @sizeof($extensions) - $stats['call_forward'] - $stats['follow_me'] - $stats['dnd'];
@@ -223,7 +223,7 @@
if (permission_exists('follow_me')) { if (permission_exists('follow_me')) {
//get destination count //get destination count
$follow_me_destination_count = 0; $follow_me_destination_count = 0;
if ($row['follow_me_enabled'] == 'true' && is_uuid($row['follow_me_uuid'])) { if ($row['follow_me_enabled'] == true && is_uuid($row['follow_me_uuid'])) {
$sql = "select count(*) from v_follow_me_destinations "; $sql = "select count(*) from v_follow_me_destinations ";
$sql .= "where follow_me_uuid = :follow_me_uuid "; $sql .= "where follow_me_uuid = :follow_me_uuid ";
$sql .= "and domain_uuid = :domain_uuid "; $sql .= "and domain_uuid = :domain_uuid ";

View File

@@ -0,0 +1,14 @@
<?php
$view['name'] = "view_call_recordings";
$view['version'] = "20250919";
$view['description'] = "Show the call recordings details from the call detail records database.";
$view['sql'] = " select domain_uuid, xml_cdr_uuid as call_recording_uuid, \n";
$view['sql'] .= " caller_id_name, caller_id_number, caller_destination, destination_number, \n";
$view['sql'] .= " record_name as call_recording_name, record_path as call_recording_path, \n";
$view['sql'] .= " record_transcription as call_recording_transcription, \n";
$view['sql'] .= " duration as call_recording_length, start_stamp as call_recording_date, direction as call_direction \n";
$view['sql'] .= " from v_xml_cdr \n";
$view['sql'] .= " where record_name is not null \n";
$view['sql'] .= " and record_path is not null \n";
$view['sql'] .= " order by start_stamp desc \n";

View File

@@ -283,7 +283,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the center description."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the center description.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "conference_center_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "conference_center_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enable or disable the conference center."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enable or disable the conference center.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date";
@@ -347,7 +347,7 @@
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "record"; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "record";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "recording"; $apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "recording";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select whether to record the conference."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select whether to record the conference.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "moderator_pin"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "moderator_pin";
@@ -371,31 +371,31 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Close the conference room at the stop time."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Close the conference room at the stop time.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "wait_mod"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "wait_mod";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Wait for the moderator to join before starting the conference."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Wait for the moderator to join before starting the conference.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "moderator_endconf"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "moderator_endconf";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "When moderator exits end conference."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "When moderator exits end conference.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "announce_name"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "announce_name";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Introduce participants as they enter the conference."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Introduce participants as they enter the conference.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "announce_count"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "announce_count";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Announce number of participants when entering the conference."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Announce number of participants when entering the conference.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "announce_recording"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "announce_recording";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Announce to participants that conference is being recorded."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Announce to participants that conference is being recorded.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "sounds"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "sounds";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Play sound when someone enters or exists the conference."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Play sound when someone enters or exists the conference.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "mute"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "mute";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Mute participants on entering the conference."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Mute participants on entering the conference.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "created"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "created";
@@ -417,7 +417,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Optional account code for the conference."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Optional account code for the conference.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select to enable or disable the session."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select to enable or disable the session.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "description"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "description";

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2024 Portions created by the Initial Developer are Copyright (C) 2008-2025
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -82,7 +82,7 @@
$conference_center_extension = $_POST["conference_center_extension"]; $conference_center_extension = $_POST["conference_center_extension"];
$conference_center_greeting = $_POST["conference_center_greeting"]; $conference_center_greeting = $_POST["conference_center_greeting"];
$conference_center_pin_length = $_POST["conference_center_pin_length"]; $conference_center_pin_length = $_POST["conference_center_pin_length"];
$conference_center_enabled = $_POST["conference_center_enabled"] ?? 'false'; $conference_center_enabled = $_POST["conference_center_enabled"];
$conference_center_description = $_POST["conference_center_description"]; $conference_center_description = $_POST["conference_center_description"];
//validate the token //validate the token
@@ -233,7 +233,6 @@
} }
//set defaults //set defaults
if (empty($conference_center_enabled)) { $conference_center_enabled = "true"; }
if (empty($conference_center_pin_length)) { $conference_center_pin_length = 9; } if (empty($conference_center_pin_length)) { $conference_center_pin_length = 9; }
//get the sounds //get the sounds
@@ -453,17 +452,16 @@
echo " ".$text['label-conference_center_enabled']."\n"; echo " ".$text['label-conference_center_enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='conference_center_enabled' name='conference_center_enabled' value='true' ".($conference_center_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='conference_center_enabled' name='conference_center_enabled'>\n"; echo " <select class='formfld' id='conference_center_enabled' name='conference_center_enabled'>\n";
echo " <option value='true' ".($conference_center_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($conference_center_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($conference_center_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($conference_center_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-conference_center_enabled']."\n"; echo $text['description-conference_center_enabled']."\n";

View File

@@ -127,7 +127,17 @@
$offset = $rows_per_page * $page; $offset = $rows_per_page * $page;
//get the list //get the list
$sql = "select * from v_conference_centers "; $sql = "select ";
$sql .= "domain_uuid, ";
$sql .= "conference_center_uuid, ";
$sql .= "dialplan_uuid, ";
$sql .= "conference_center_name, ";
$sql .= "conference_center_extension, ";
$sql .= "conference_center_pin_length, ";
$sql .= "conference_center_greeting, ";
$sql .= "conference_center_description, ";
$sql .= "cast(conference_center_enabled as text) ";
$sql .= "from v_conference_centers ";
$sql .= "where true "; $sql .= "where true ";
if ($show != "all" || !permission_exists('conference_center_all')) { if ($show != "all" || !permission_exists('conference_center_all')) {
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) "; $sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
@@ -289,4 +299,3 @@
require_once "resources/footer.php"; require_once "resources/footer.php";
?> ?>

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2024 Portions created by the Initial Developer are Copyright (C) 2008-2025
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -85,7 +85,7 @@
$created_by = $_POST["created_by"] ?? null; $created_by = $_POST["created_by"] ?? null;
$email_address = $_POST["email_address"] ?? null; $email_address = $_POST["email_address"] ?? null;
$account_code = $_POST["account_code"]; $account_code = $_POST["account_code"];
$enabled = $_POST["enabled"] ?? 'false'; $enabled = $_POST["enabled"];
$description = $_POST["description"]; $description = $_POST["description"];
//remove any pin number formatting //remove any pin number formatting
@@ -303,16 +303,7 @@
if ($action == "add" && permission_exists('conference_room_add')) { if ($action == "add" && permission_exists('conference_room_add')) {
//set default values //set default values
if (empty($profile)) { $profile = 'default'; } if (empty($profile)) { $profile = 'default'; }
if (empty($record)) { $record = 'false'; }
if (empty($max_members)) { $max_members = 0; } if (empty($max_members)) { $max_members = 0; }
if (empty($wait_mod)) { $wait_mod = 'true'; }
if (empty($moderator_endconf)) { $moderator_endconf = 'false'; }
if (empty($announce_name)) { $announce_name = 'true'; }
if (empty($announce_recording)) { $announce_recording = 'true'; }
if (empty($announce_count)) { $announce_count = 'true'; }
if (empty($mute)) { $mute = 'false'; }
if (empty($enabled)) { $enabled = 'true'; }
if (empty($sounds)) { $sounds = 'false'; }
//add a conference room //add a conference room
$conference_room_uuid = uuid(); $conference_room_uuid = uuid();
@@ -544,18 +535,6 @@
$participant_pin = substr($participant_pin, 0, 3) ."-". substr($participant_pin, 3, 3) ."-". substr($participant_pin, -3)."\n"; $participant_pin = substr($participant_pin, 0, 3) ."-". substr($participant_pin, 3, 3) ."-". substr($participant_pin, -3)."\n";
} }
//set default values
if (empty($record)) { $record = 'false'; }
if (empty($max_members)) { $max_members = 0; }
if (empty($wait_mod)) { $wait_mod = 'true'; }
if (empty($moderator_endconf)) { $moderator_endconf = 'false'; }
if (empty($announce_name)) { $announce_name = 'true'; }
if (empty($announce_recording)) { $announce_recording = 'true'; }
if (empty($announce_count)) { $announce_count = 'true'; }
if (empty($mute)) { $mute = 'false'; }
if (empty($sounds)) { $sounds = 'false'; }
if (empty($enabled)) { $enabled = 'true'; }
//create token //create token
$object = new token; $object = new token;
$token = $object->create($_SERVER['PHP_SELF']); $token = $object->create($_SERVER['PHP_SELF']);
@@ -693,21 +672,17 @@
echo "<tr>\n"; echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>".$text['label-record']."</td>\n"; echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>".$text['label-record']."</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='record'>\n"; if ($input_toggle_style_switch) {
echo " <option value=''></option>\n"; echo " <span class='switch'>\n";
if ($record == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($record == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
} }
echo " <select class='formfld' id='record' name='record'>\n";
echo " <option value='false' ".($record === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='true' ".($record === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
}
echo "<br />\n"; echo "<br />\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
@@ -737,21 +712,17 @@
echo "<tr>\n"; echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>".$text['label-wait_for_moderator']."</td>\n"; echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>".$text['label-wait_for_moderator']."</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='wait_mod'>\n"; if ($input_toggle_style_switch) {
echo " <option value=''></option>\n"; echo " <span class='switch'>\n";
if ($wait_mod == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($wait_mod == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
} }
echo " <select class='formfld' id='wait_mod' name='wait_mod'>\n";
echo " <option value='true' ".($wait_mod === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($wait_mod === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
}
echo "<br />\n"; echo "<br />\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
@@ -761,21 +732,17 @@
echo "<tr>\n"; echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>".$text['label-moderator_endconf']."</td>\n"; echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>".$text['label-moderator_endconf']."</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='moderator_endconf'>\n"; if ($input_toggle_style_switch) {
echo " <option value=''></option>\n"; echo " <span class='switch'>\n";
if ($moderator_endconf == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($moderator_endconf == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
} }
echo " <select class='formfld' id='moderator_endconf' name='moderator_endconf'>\n";
echo " <option value='false' ".($moderator_endconf === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='true' ".($moderator_endconf === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
}
echo "<br />\n"; echo "<br />\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
@@ -785,21 +752,17 @@
echo "<tr>\n"; echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>".$text['label-announce_name']."</td>\n"; echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>".$text['label-announce_name']."</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='announce_name'>\n"; if ($input_toggle_style_switch) {
echo " <option value=''></option>\n"; echo " <span class='switch'>\n";
if ($announce_name == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($announce_name == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
} }
echo " <select class='formfld' id='announce_name' name='announce_name'>\n";
echo " <option value='true' ".($announce_name === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($announce_name === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
}
echo "<br />\n"; echo "<br />\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
@@ -809,21 +772,17 @@
echo "<tr>\n"; echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>".$text['label-announce_count']."</td>\n"; echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>".$text['label-announce_count']."</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='announce_count'>\n"; if ($input_toggle_style_switch) {
echo " <option value=''></option>\n"; echo " <span class='switch'>\n";
if ($announce_count == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($announce_count == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
} }
echo " <select class='formfld' id='announce_count' name='announce_count'>\n";
echo " <option value='true' ".($announce_count === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($announce_count === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
}
echo "<br />\n"; echo "<br />\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
@@ -833,21 +792,17 @@
echo "<tr>\n"; echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>".$text['label-announce_recording']."</td>\n"; echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>".$text['label-announce_recording']."</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='announce_recording'>\n"; if ($input_toggle_style_switch) {
echo " <option value=''></option>\n"; echo " <span class='switch'>\n";
if ($announce_recording == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($announce_recording == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
} }
echo " <select class='formfld' id='announce_recording' name='announce_recording'>\n";
echo " <option value='true' ".($announce_recording === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($announce_recording === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
}
echo "<br />\n"; echo "<br />\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
@@ -868,21 +823,17 @@
echo "<tr>\n"; echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>".$text['label-mute']."</td>\n"; echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>".$text['label-mute']."</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='mute'>\n"; if ($input_toggle_style_switch) {
echo " <option value=''></option>\n"; echo " <span class='switch'>\n";
if ($mute == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($mute == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
} }
echo " <select class='formfld' id='mute' name='mute'>\n";
echo " <option value='false' ".($mute === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='true' ".($mute === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
}
echo "<br />\n"; echo "<br />\n";
echo "\n"; echo "\n";
echo "</td>\n"; echo "</td>\n";
@@ -919,17 +870,16 @@
echo "<tr>\n"; echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>".$text['label-enabled']."</td>\n"; echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>".$text['label-enabled']."</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='enabled' name='enabled' value='true' ".($enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='enabled' name='enabled'>\n"; echo " <select class='formfld' id='enabled' name='enabled'>\n";
echo " <option value='true' ".($enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo "\n"; echo "\n";
@@ -941,21 +891,17 @@
echo "<tr>\n"; echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>".$text['label-sounds']."</td>\n"; echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>".$text['label-sounds']."</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='sounds'>\n"; if ($input_toggle_style_switch) {
echo " <option value=''></option>\n"; echo " <span class='switch'>\n";
if ($sounds == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($sounds == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
} }
echo " <select class='formfld' id='sounds' name='sounds'>\n";
echo " <option value='false' ".($sounds === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='true' ".($sounds === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
}
echo "<br />\n"; echo "<br />\n";
echo "\n"; echo "\n";
echo "</td>\n"; echo "</td>\n";

View File

@@ -85,7 +85,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the conference control name."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the conference control name.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "control_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "control_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Set the stats of the control."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Set the stats of the control.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "control_description"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "control_description";
@@ -151,7 +151,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the data."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the data.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "control_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "control_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Set the status of the control."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Set the status of the control.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date";

View File

@@ -83,7 +83,7 @@
$control_action = $p['@attributes']['action']; $control_action = $p['@attributes']['action'];
$control_digits = $p['@attributes']['digits']; $control_digits = $p['@attributes']['digits'];
$control_data = $p['@attributes']['data']; $control_data = $p['@attributes']['data'];
$control_enabled = 'true'; $control_enabled = true;
//add the coference profile params //add the coference profile params
$conference_control_detail_uuid = uuid(); $conference_control_detail_uuid = uuid();

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -65,7 +65,7 @@
$control_digits = $_POST["control_digits"]; $control_digits = $_POST["control_digits"];
$control_action = $_POST["control_action"]; $control_action = $_POST["control_action"];
$control_data = $_POST["control_data"]; $control_data = $_POST["control_data"];
$control_enabled = $_POST["control_enabled"] ?? 'false'; $control_enabled = $_POST["control_enabled"];
} }
//process the http post //process the http post
@@ -155,9 +155,6 @@
unset($sql, $parameters, $row); unset($sql, $parameters, $row);
} }
//set the defaults
if (empty($control_enabled)) { $control_enabled = 'true'; }
//create token //create token
$object = new token; $object = new token;
$token = $object->create($_SERVER['PHP_SELF']); $token = $object->create($_SERVER['PHP_SELF']);
@@ -219,17 +216,16 @@
echo " ".$text['label-control_enabled']."\n"; echo " ".$text['label-control_enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='control_enabled' name='control_enabled' value='true' ".($control_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='control_enabled' name='control_enabled'>\n"; echo " <select class='formfld' id='control_enabled' name='control_enabled'>\n";
echo " <option value='true' ".($control_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($control_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($control_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($control_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-control_enabled']."\n"; echo $text['description-control_enabled']."\n";

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -97,8 +97,8 @@
$sql .= "where conference_control_uuid = :conference_control_uuid "; $sql .= "where conference_control_uuid = :conference_control_uuid ";
$sql .= $sql_search ?? ''; $sql .= $sql_search ?? '';
$parameters['conference_control_uuid'] = $conference_control_uuid ?? ''; $parameters['conference_control_uuid'] = $conference_control_uuid ?? '';
$database = new database;
$num_rows = $database->select($sql, $parameters ?? null, 'column'); $num_rows = $database->select($sql, $parameters ?? null, 'column');
unset($sql, $parameters);
//prepare to page the results //prepare to page the results
$rows_per_page = (!empty($_SESSION['domain']['paging']['numeric'])) ? $_SESSION['domain']['paging']['numeric'] : 50; $rows_per_page = (!empty($_SESSION['domain']['paging']['numeric'])) ? $_SESSION['domain']['paging']['numeric'] : 50;
@@ -110,11 +110,17 @@
} }
//get the list //get the list
$sql = str_replace('count(conference_control_detail_uuid)', '*', $sql); $sql = "select ";
$sql .= "conference_control_detail_uuid, ";
$sql .= "conference_control_uuid, ";
$sql .= "control_digits, ";
$sql .= "control_action, ";
$sql .= "control_data, ";
$sql .= "cast(control_enabled as text) ";
$sql .= "from v_conference_control_details ";
$sql .= $sql_search ?? ''; $sql .= $sql_search ?? '';
$sql .= order_by($order_by, $order, 'control_digits', 'asc'); $sql .= order_by($order_by, $order, 'control_digits', 'asc');
$sql .= limit_offset($rows_per_page, !empty($offset)); $sql .= limit_offset($rows_per_page, !empty($offset));
$database = new database;
$result = $database->select($sql, $parameters ?? null, 'all'); $result = $database->select($sql, $parameters ?? null, 'all');
unset($sql, $parameters); unset($sql, $parameters);

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -57,7 +57,7 @@
//get http post variables and set them to php variables //get http post variables and set them to php variables
if (!empty($_POST)) { if (!empty($_POST)) {
$control_name = $_POST["control_name"]; $control_name = $_POST["control_name"];
$control_enabled = $_POST["control_enabled"] ?? 'false'; $control_enabled = $_POST["control_enabled"];
$control_description = $_POST["control_description"]; $control_description = $_POST["control_description"];
} }
@@ -108,7 +108,6 @@
$array['conference_controls'][0]['control_description'] = $control_description; $array['conference_controls'][0]['control_description'] = $control_description;
//save to the data //save to the data
$database = new database;
$database->app_name = 'conference_controls'; $database->app_name = 'conference_controls';
$database->app_uuid = 'e1ad84a2-79e1-450c-a5b1-7507a043e048'; $database->app_uuid = 'e1ad84a2-79e1-450c-a5b1-7507a043e048';
if (!empty($conference_control_uuid)) { if (!empty($conference_control_uuid)) {
@@ -137,7 +136,6 @@
//$sql .= "where domain_uuid = '$domain_uuid' "; //$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "where conference_control_uuid = :conference_control_uuid "; $sql .= "where conference_control_uuid = :conference_control_uuid ";
$parameters['conference_control_uuid'] = $conference_control_uuid; $parameters['conference_control_uuid'] = $conference_control_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row'); $row = $database->select($sql, $parameters, 'row');
if (!empty($row)) { if (!empty($row)) {
$control_name = $row["control_name"]; $control_name = $row["control_name"];
@@ -147,9 +145,6 @@
unset($sql, $parameters, $row); unset($sql, $parameters, $row);
} }
//set the defaults
if (empty($control_enabled)) { $control_enabled = 'true'; }
//create token //create token
$object = new token; $object = new token;
$token = $object->create($_SERVER['PHP_SELF']); $token = $object->create($_SERVER['PHP_SELF']);
@@ -189,17 +184,16 @@
echo " ".$text['label-control_enabled']."\n"; echo " ".$text['label-control_enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='control_enabled' name='control_enabled' value='true' ".($control_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='control_enabled' name='control_enabled'>\n"; echo " <select class='formfld' id='control_enabled' name='control_enabled'>\n";
echo " <option value='true' ".($control_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($control_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($control_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($control_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-control_enabled']."\n"; echo $text['description-control_enabled']."\n";

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -98,6 +98,7 @@
$sql .= $sql_search ?? ''; $sql .= $sql_search ?? '';
$database = new database; $database = new database;
$num_rows = $database->select($sql, $parameters ?? null, 'column'); $num_rows = $database->select($sql, $parameters ?? null, 'column');
unset($sql);
//prepare to page the results //prepare to page the results
$rows_per_page = (!empty($_SESSION['domain']['paging']['numeric'])) ? $_SESSION['domain']['paging']['numeric'] : 50; $rows_per_page = (!empty($_SESSION['domain']['paging']['numeric'])) ? $_SESSION['domain']['paging']['numeric'] : 50;
@@ -108,7 +109,13 @@
$offset = $rows_per_page * $page; $offset = $rows_per_page * $page;
//get the list //get the list
$sql = str_replace('count(conference_control_uuid)', '*', $sql); $sql = "select ";
$sql .= "conference_control_uuid, ";
$sql .= "control_name, ";
$sql .= "cast(control_enabled as text), ";
$sql .= "control_description ";
$sql .= "from v_conference_controls ";
$sql .= $sql_search ?? '';
$sql .= order_by($order_by, $order, 'control_name', 'asc'); $sql .= order_by($order_by, $order, 'control_name', 'asc');
$sql .= limit_offset($rows_per_page, $offset); $sql .= limit_offset($rows_per_page, $offset);
$database = new database; $database = new database;

View File

@@ -85,7 +85,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the profile name."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the profile name.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "profile_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "profile_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Set the status of the profile."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Set the status of the profile.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "profile_description"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "profile_description";
@@ -144,7 +144,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the value."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the value.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "profile_param_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "profile_param_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Set the status of the parameter."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Set the status of the parameter.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "profile_param_description"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "profile_param_description";

View File

@@ -81,7 +81,7 @@
//print_r($p); //print_r($p);
$profile_param_name = $p['@attributes']['name']; $profile_param_name = $p['@attributes']['name'];
$profile_param_value = $p['@attributes']['value']; $profile_param_value = $p['@attributes']['value'];
$profile_param_enabled = 'true'; $profile_param_enabled = true;
//add the coference profile params //add the coference profile params
$conference_profile_param_uuid = uuid(); $conference_profile_param_uuid = uuid();

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -57,7 +57,7 @@
//get http post variables and set them to php variables //get http post variables and set them to php variables
if (!empty($_POST)) { if (!empty($_POST)) {
$profile_name = $_POST["profile_name"]; $profile_name = $_POST["profile_name"];
$profile_enabled = $_POST["profile_enabled"] ?? 'false'; $profile_enabled = $_POST["profile_enabled"];
$profile_description = $_POST["profile_description"]; $profile_description = $_POST["profile_description"];
} }
//check to see if the http post exists //check to see if the http post exists
@@ -129,7 +129,11 @@
//pre-populate the form //pre-populate the form
if (!empty($_GET) && empty($_POST["persistformvar"])) { if (!empty($_GET) && empty($_POST["persistformvar"])) {
$conference_profile_uuid = $_GET["id"]; $conference_profile_uuid = $_GET["id"];
$sql = "select * from v_conference_profiles "; $sql = "select ";
$sql .= "profile_name, ";
$sql .= "profile_enabled, ";
$sql .= "profile_description ";
$sql .= "from v_conference_profiles ";
$sql .= "where conference_profile_uuid = :conference_profile_uuid "; $sql .= "where conference_profile_uuid = :conference_profile_uuid ";
//$sql .= "and domain_uuid = :domain_uuid "; //$sql .= "and domain_uuid = :domain_uuid ";
$parameters['conference_profile_uuid'] = $conference_profile_uuid; $parameters['conference_profile_uuid'] = $conference_profile_uuid;
@@ -144,9 +148,6 @@
unset($sql, $parameters); unset($sql, $parameters);
} }
//set the defaults
if (empty($profile_enabled)) { $profile_enabled = 'true'; }
//create token //create token
$object = new token; $object = new token;
$token = $object->create($_SERVER['PHP_SELF']); $token = $object->create($_SERVER['PHP_SELF']);
@@ -186,17 +187,16 @@
echo " ".$text['label-profile_enabled']."\n"; echo " ".$text['label-profile_enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='profile_enabled' name='profile_enabled' value='true' ".($profile_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else { echo " <select class='formfld' id='profile_enabled' name='profile_enabled'>\n";
echo " <select class='formfld' name='profile_enabled'>\n"; echo " <option value='true' ".($profile_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='true' ".($profile_enabled == "true" ? "selected='selected'" : null).">".$text['label-true']."</option>\n"; echo " <option value='false' ".($profile_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='false' ".($profile_enabled == "false" ? "selected='selected'" : null).">".$text['label-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-profile_enabled']."\n"; echo $text['description-profile_enabled']."\n";

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -64,7 +64,7 @@
if (!empty($_POST)) { if (!empty($_POST)) {
$profile_param_name = $_POST["profile_param_name"]; $profile_param_name = $_POST["profile_param_name"];
$profile_param_value = $_POST["profile_param_value"]; $profile_param_value = $_POST["profile_param_value"];
$profile_param_enabled = $_POST["profile_param_enabled"] ?? 'false'; $profile_param_enabled = $_POST["profile_param_enabled"];
$profile_param_description = $_POST["profile_param_description"]; $profile_param_description = $_POST["profile_param_description"];
} }
@@ -123,7 +123,6 @@
} }
if (is_uuid($array['conference_profile_params'][0]['conference_profile_param_uuid'])) { if (is_uuid($array['conference_profile_params'][0]['conference_profile_param_uuid'])) {
$database = new database;
$database->app_name = 'conference_profiles'; $database->app_name = 'conference_profiles';
$database->app_uuid = 'c33e2c2a-847f-44c1-8c0d-310df5d65ba9'; $database->app_uuid = 'c33e2c2a-847f-44c1-8c0d-310df5d65ba9';
$database->save($array); $database->save($array);
@@ -139,11 +138,15 @@
//pre-populate the form //pre-populate the form
if (!empty($_GET) && empty($_POST["persistformvar"])) { if (!empty($_GET) && empty($_POST["persistformvar"])) {
$conference_profile_param_uuid = $_GET["id"] ?? ''; $conference_profile_param_uuid = $_GET["id"] ?? '';
$sql = "select * from v_conference_profile_params "; $sql = "select ";
$sql .= "profile_param_name, ";
$sql .= "profile_param_value, ";
$sql .= "profile_param_enabled, ";
$sql .= "profile_param_description ";
$sql .= "from v_conference_profile_params ";
$sql .= "where conference_profile_param_uuid = :conference_profile_param_uuid "; $sql .= "where conference_profile_param_uuid = :conference_profile_param_uuid ";
$parameters['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 ?? null, 'row');
$row = $database->select($sql, $parameters, 'row');
if (!empty($row)) { if (!empty($row)) {
$profile_param_name = $row["profile_param_name"]; $profile_param_name = $row["profile_param_name"];
$profile_param_value = $row["profile_param_value"]; $profile_param_value = $row["profile_param_value"];
@@ -153,9 +156,6 @@
unset($sql, $parameters); unset($sql, $parameters);
} }
//set the defaults
if (empty($profile_param_enabled)) { $profile_param_enabled = 'true'; }
//create token //create token
$object = new token; $object = new token;
$token = $object->create($_SERVER['PHP_SELF']); $token = $object->create($_SERVER['PHP_SELF']);
@@ -206,17 +206,16 @@
echo " ".$text['label-profile_param_enabled']."\n"; echo " ".$text['label-profile_param_enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='profile_param_enabled' name='profile_param_enabled' value='true' ".($profile_param_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='profile_param_enabled' name='profile_param_enabled'>\n"; echo " <select class='formfld' id='profile_param_enabled' name='profile_param_enabled'>\n";
echo " <option value='true' ".($profile_param_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($profile_param_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($profile_param_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($profile_param_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-profile_param_enabled']."\n"; echo $text['description-profile_param_enabled']."\n";

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -84,8 +84,8 @@
$sql .= "from v_conference_profile_params "; $sql .= "from v_conference_profile_params ";
$sql .= "where conference_profile_uuid = :conference_profile_uuid "; $sql .= "where conference_profile_uuid = :conference_profile_uuid ";
$parameters['conference_profile_uuid'] = $conference_profile_uuid; $parameters['conference_profile_uuid'] = $conference_profile_uuid;
$database = new database;
$num_rows = $database->select($sql, $parameters, 'column'); $num_rows = $database->select($sql, $parameters, 'column');
unset($sql, $parameters);
//prepare to page the results //prepare to page the results
$rows_per_page = (!empty($_SESSION['domain']['paging']['numeric'])) ? $_SESSION['domain']['paging']['numeric'] : 50; $rows_per_page = (!empty($_SESSION['domain']['paging']['numeric'])) ? $_SESSION['domain']['paging']['numeric'] : 50;
@@ -97,10 +97,18 @@
} }
//get the list //get the list
$sql = str_replace('count(conference_profile_param_uuid)', '*', $sql); $sql = "select ";
$sql .= "conference_profile_param_uuid, ";
$sql .= "conference_profile_uuid, ";
$sql .= "profile_param_name, ";
$sql .= "profile_param_value, ";
$sql .= "cast(profile_param_enabled as text), ";
$sql .= "profile_param_description ";
$sql .= "from v_conference_profile_params ";
$sql .= "where conference_profile_uuid = :conference_profile_uuid ";
$parameters['conference_profile_uuid'] = $conference_profile_uuid;
$sql .= order_by($order_by, $order, 'profile_param_name', 'asc'); $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 ?? null, 'all'); $result = $database->select($sql, $parameters ?? null, 'all');
unset($sql, $parameters); unset($sql, $parameters);

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -102,9 +102,18 @@
} }
$database = new database; $database = new database;
$num_rows = $database->select($sql, $parameters ?? null, 'column'); $num_rows = $database->select($sql, $parameters ?? null, 'column');
unset($sql);
//get the list //get the list
$sql = str_replace('count(conference_profile_uuid)', '*', $sql); $sql = "select ";
$sql .= "conference_profile_uuid, ";
$sql .= "profile_name, ";
$sql .= "cast(profile_enabled as text), ";
$sql .= "profile_description ";
$sql .= "from v_conference_profiles ";
if (!empty($sql_search)) {
$sql .= "where ".$sql_search;
}
$sql .= order_by($order_by, $order, 'profile_name', 'asc'); $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; $database = new database;

View File

@@ -102,7 +102,6 @@
$p->add('conference_profile_param_delete', 'temp'); $p->add('conference_profile_param_delete', 'temp');
//execute delete //execute delete
$database = new database;
$database->app_name = $this->app_name; $database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid; $database->app_uuid = $this->app_uuid;
$database->delete($array); $database->delete($array);
@@ -157,7 +156,6 @@
//delete the checked rows //delete the checked rows
if (!empty($array) && is_array($array) && @sizeof($array) != 0) { if (!empty($array) && is_array($array) && @sizeof($array) != 0) {
//execute delete //execute delete
$database = new database;
$database->app_name = $this->app_name; $database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid; $database->app_uuid = $this->app_uuid;
$database->delete($array); $database->delete($array);
@@ -208,7 +206,6 @@
if (is_array($uuids) && @sizeof($uuids) != 0) { if (is_array($uuids) && @sizeof($uuids) != 0) {
$sql = "select ".$this->name."_uuid as uuid, ".$this->toggle_field." as toggle from v_".$this->table." "; $sql = "select ".$this->name."_uuid as uuid, ".$this->toggle_field." as toggle from v_".$this->table." ";
$sql .= "where ".$this->name."_uuid in (".implode(', ', $uuids).") "; $sql .= "where ".$this->name."_uuid in (".implode(', ', $uuids).") ";
$database = new database;
$rows = $database->select($sql, $parameters ?? null, 'all'); $rows = $database->select($sql, $parameters ?? null, 'all');
if (is_array($rows) && @sizeof($rows) != 0) { if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $row) { foreach ($rows as $row) {
@@ -232,7 +229,6 @@
//save the changes //save the changes
if (is_array($array) && @sizeof($array) != 0) { if (is_array($array) && @sizeof($array) != 0) {
//save the array //save the array
$database = new database;
$database->app_name = $this->app_name; $database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid; $database->app_uuid = $this->app_uuid;
$database->save($array); $database->save($array);
@@ -280,7 +276,6 @@
if (!empty($uuids) && is_array($uuids) && @sizeof($uuids) != 0) { 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 = "select ".$this->name."_uuid as uuid, ".$this->toggle_field." as toggle from v_".$this->table." ";
$sql .= "where ".$this->name."_uuid in (".implode(', ', $uuids).") "; $sql .= "where ".$this->name."_uuid in (".implode(', ', $uuids).") ";
$database = new database;
$rows = $database->select($sql, $parameters ?? null, 'all'); $rows = $database->select($sql, $parameters ?? null, 'all');
if (is_array($rows) && @sizeof($rows) != 0) { if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $row) { foreach ($rows as $row) {
@@ -306,7 +301,6 @@
//save the changes //save the changes
if (!empty($array) && is_array($array) && @sizeof($array) != 0) { if (!empty($array) && is_array($array) && @sizeof($array) != 0) {
//save the array //save the array
$database = new database;
$database->app_name = $this->app_name; $database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid; $database->app_uuid = $this->app_uuid;
$database->save($array); $database->save($array);
@@ -361,7 +355,6 @@
//primary table //primary table
$sql = "select * from v_".$this->table." "; $sql = "select * from v_".$this->table." ";
$sql .= "where ".$this->name."_uuid in (".implode(', ', $uuids).") "; $sql .= "where ".$this->name."_uuid in (".implode(', ', $uuids).") ";
$database = new database;
$rows = $database->select($sql, $parameters ?? null, 'all'); $rows = $database->select($sql, $parameters ?? null, 'all');
if (is_array($rows) && @sizeof($rows) != 0) { if (is_array($rows) && @sizeof($rows) != 0) {
$y = 0; $y = 0;
@@ -378,7 +371,6 @@
//params sub table //params sub table
$sql_2 = "select * from v_conference_profile_params where conference_profile_uuid = :conference_profile_uuid"; $sql_2 = "select * from v_conference_profile_params where conference_profile_uuid = :conference_profile_uuid";
$parameters_2['conference_profile_uuid'] = $row['conference_profile_uuid']; $parameters_2['conference_profile_uuid'] = $row['conference_profile_uuid'];
$database = new database;
$rows_2 = $database->select($sql_2, $parameters_2, 'all'); $rows_2 = $database->select($sql_2, $parameters_2, 'all');
if (is_array($rows_2) && @sizeof($rows_2) != 0) { if (is_array($rows_2) && @sizeof($rows_2) != 0) {
foreach ($rows_2 as $row_2) { foreach ($rows_2 as $row_2) {
@@ -409,7 +401,6 @@
$p->add('conference_profile_param_add', 'temp'); $p->add('conference_profile_param_add', 'temp');
//save the array //save the array
$database = new database;
$database->app_name = $this->app_name; $database->app_name = $this->app_name;
$database->app_uuid = $this->app_uuid; $database->app_uuid = $this->app_uuid;
$database->save($array); $database->save($array);

View File

@@ -35,7 +35,7 @@
$apps[$x]['destinations'][$y]['type'] = "sql"; $apps[$x]['destinations'][$y]['type'] = "sql";
$apps[$x]['destinations'][$y]['label'] = "conferences"; $apps[$x]['destinations'][$y]['label'] = "conferences";
$apps[$x]['destinations'][$y]['name'] = "conferences"; $apps[$x]['destinations'][$y]['name'] = "conferences";
$apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and conference_enabled = 'true' "; $apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and conference_enabled = true ";
$apps[$x]['destinations'][$y]['order_by'] = "natural_sort(conference_extension) asc"; $apps[$x]['destinations'][$y]['order_by'] = "natural_sort(conference_extension) asc";
$apps[$x]['destinations'][$y]['field']['conference_uuid'] = "conference_uuid"; $apps[$x]['destinations'][$y]['field']['conference_uuid'] = "conference_uuid";
$apps[$x]['destinations'][$y]['field']['uuid'] = "conference_uuid"; $apps[$x]['destinations'][$y]['field']['uuid'] = "conference_uuid";
@@ -188,7 +188,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "conference_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "conference_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select whether to enable or disable the conference."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select whether to enable or disable the conference.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date";

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2024 Portions created by the Initial Developer are Copyright (C) 2008-2025
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -70,7 +70,7 @@
$conference_account_code = $_POST["conference_account_code"]; $conference_account_code = $_POST["conference_account_code"];
$conference_order = $_POST["conference_order"]; $conference_order = $_POST["conference_order"];
$conference_description = $_POST["conference_description"]; $conference_description = $_POST["conference_description"];
$conference_enabled = $_POST["conference_enabled"] ?? 'false'; $conference_enabled = $_POST["conference_enabled"];
//set the context for users that do not have the permission //set the context for users that do not have the permission
if (permission_exists('conference_context')) { if (permission_exists('conference_context')) {
@@ -234,7 +234,7 @@
} }
$array['dialplans'][0]['app_uuid'] = 'b81412e8-7253-91f4-e48e-42fc2c9a38d9'; $array['dialplans'][0]['app_uuid'] = 'b81412e8-7253-91f4-e48e-42fc2c9a38d9';
$array['dialplans'][0]['dialplan_xml'] = $dialplan_xml; $array['dialplans'][0]['dialplan_xml'] = $dialplan_xml;
$array['dialplans'][0]['dialplan_continue'] = 'false'; $array['dialplans'][0]['dialplan_continue'] = "false";
$array['dialplans'][0]['dialplan_order'] = '333'; $array['dialplans'][0]['dialplan_order'] = '333';
$array['dialplans'][0]['dialplan_enabled'] = $conference_enabled; $array['dialplans'][0]['dialplan_enabled'] = $conference_enabled;
$array['dialplans'][0]['dialplan_description'] = $conference_description; $array['dialplans'][0]['dialplan_description'] = $conference_description;
@@ -288,7 +288,20 @@
//pre-populate the form //pre-populate the form
if (!empty($_GET) && empty($_POST["persistformvar"])) { if (!empty($_GET) && empty($_POST["persistformvar"])) {
$conference_uuid = $_GET["id"]; $conference_uuid = $_GET["id"];
$sql = "select * from v_conferences "; $sql = "select ";
$sql .= "dialplan_uuid, ";
$sql .= "conference_name, ";
$sql .= "conference_extension, ";
$sql .= "conference_pin_number, ";
$sql .= "conference_profile, ";
$sql .= "conference_flags, ";
$sql .= "conference_email_address, ";
$sql .= "conference_account_code, ";
$sql .= "conference_order, ";
$sql .= "conference_description, ";
$sql .= "conference_context, ";
$sql .= "conference_enabled ";
$sql .= "from v_conferences ";
$sql .= "where domain_uuid = :domain_uuid "; $sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and conference_uuid = :conference_uuid "; $sql .= "and conference_uuid = :conference_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid']; $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
@@ -315,7 +328,6 @@
//set the defaults //set the defaults
if (empty($conference_context)) { $conference_context = $_SESSION['domain_name']; } if (empty($conference_context)) { $conference_context = $_SESSION['domain_name']; }
if (empty($conference_enabled)) { $conference_enabled = 'true'; }
//get the conference profiles //get the conference profiles
$sql = "select * "; $sql = "select * ";
@@ -329,7 +341,7 @@
//get conference users //get conference users
$sql = "select * from v_conference_users as e, v_users as u "; $sql = "select * from v_conference_users as e, v_users as u ";
$sql .= "where e.user_uuid = u.user_uuid "; $sql .= "where e.user_uuid = u.user_uuid ";
$sql .= "and u.user_enabled = 'true' "; $sql .= "and u.user_enabled = true ";
$sql .= "and e.domain_uuid = :domain_uuid "; $sql .= "and e.domain_uuid = :domain_uuid ";
$sql .= "and e.conference_uuid = :conference_uuid "; $sql .= "and e.conference_uuid = :conference_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid']; $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
@@ -341,7 +353,7 @@
//get the users //get the users
$sql = "select * from v_users "; $sql = "select * from v_users ";
$sql .= "where domain_uuid = :domain_uuid "; $sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and user_enabled = 'true' "; $sql .= "and user_enabled = true ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid']; $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database; $database = new database;
$users = $database->select($sql, $parameters ?? null, 'all'); $users = $database->select($sql, $parameters ?? null, 'all');
@@ -556,17 +568,16 @@
echo " ".$text['table-enabled']."\n"; echo " ".$text['table-enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='conference_enabled' name='conference_enabled' value='true' ".($conference_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='conference_enabled' name='conference_enabled'>\n"; echo " <select class='formfld' id='conference_enabled' name='conference_enabled'>\n";
echo " <option value='true' ".($conference_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($conference_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($conference_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($conference_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo "".$text['description-conference-enable']."\n"; echo "".$text['description-conference-enable']."\n";

View File

@@ -118,7 +118,6 @@
$parameters['user_uuid'] = $_SESSION['user_uuid']; $parameters['user_uuid'] = $_SESSION['user_uuid'];
} }
$sql .= $sql_search ?? ''; $sql .= $sql_search ?? '';
$database = new database;
$num_rows = $database->select($sql, $parameters ?? null, 'column'); $num_rows = $database->select($sql, $parameters ?? null, 'column');
//prepare to page the results //prepare to page the results
@@ -134,10 +133,40 @@
$offset = $rows_per_page * $page; $offset = $rows_per_page * $page;
//get the list //get the list
$sql = str_replace('count(*)', '*', $sql); $sql = "select ";
$sql .= "domain_uuid, ";
$sql .= "conference_uuid, ";
$sql .= "dialplan_uuid, ";
$sql .= "conference_name, ";
$sql .= "conference_extension, ";
$sql .= "conference_pin_number, ";
$sql .= "conference_profile, ";
$sql .= "conference_email_address, ";
$sql .= "conference_account_code, ";
$sql .= "conference_flags, ";
$sql .= "conference_order, ";
$sql .= "conference_description, ";
$sql .= "conference_context, ";
$sql .= "cast(conference_enabled as text) ";
if (permission_exists('conference_view')) {
//show all extensions
$sql .= "from v_conferences as c ";
$sql .= "where true ";
if ($show != "all" || !permission_exists('conference_all')) {
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
}
}
else {
//show only assigned extensions
$sql .= "from v_conferences as c, v_conference_users as u ";
$sql .= "where c.conference_uuid = u.conference_uuid ";
$sql .= "and c.domain_uuid = :domain_uuid ";
$sql .= "and u.user_uuid = :user_uuid ";
$parameters['user_uuid'] = $_SESSION['user_uuid'];
}
$sql .= order_by($order_by, $order, null, null, $sort); $sql .= order_by($order_by, $order, null, null, $sort);
$sql .= limit_offset($rows_per_page, $offset); $sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$conferences = $database->select($sql, $parameters ?? null, 'all'); $conferences = $database->select($sql, $parameters ?? null, 'all');
unset($sql, $parameters); unset($sql, $parameters);

View File

@@ -36,7 +36,7 @@
$apps[$x]['destinations'][$y]['label'] = "destinations"; $apps[$x]['destinations'][$y]['label'] = "destinations";
$apps[$x]['destinations'][$y]['name'] = "destinations"; $apps[$x]['destinations'][$y]['name'] = "destinations";
$apps[$x]['destinations'][$y]['sql'] = "select destination_uuid, destination_uuid as uuid, destination_number, destination_context, destination_description from v_destinations "; $apps[$x]['destinations'][$y]['sql'] = "select destination_uuid, destination_uuid as uuid, destination_number, destination_context, destination_description from v_destinations ";
$apps[$x]['destinations'][$y]['where'] = "where (domain_uuid = '\${domain_uuid}' or domain_uuid is null) and (destination_type = 'outbound' or destination_type = 'local') and destination_enabled = 'true' "; $apps[$x]['destinations'][$y]['where'] = "where (domain_uuid = '\${domain_uuid}' or domain_uuid is null) and (destination_type = 'outbound' or destination_type = 'local') and destination_enabled = true ";
$apps[$x]['destinations'][$y]['order_by'] = "destination_number asc"; $apps[$x]['destinations'][$y]['order_by'] = "destination_number asc";
$apps[$x]['destinations'][$y]['field']['destination_uuid'] = "destination_uuid"; $apps[$x]['destinations'][$y]['field']['destination_uuid'] = "destination_uuid";
$apps[$x]['destinations'][$y]['field']['destination_number'] = "destination_number"; $apps[$x]['destinations'][$y]['field']['destination_number'] = "destination_number";
@@ -393,7 +393,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Set the destination order."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Set the destination order.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "destination_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "destination_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "destination_description"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "destination_description";

View File

@@ -120,7 +120,7 @@
$user_uuid = $_POST["user_uuid"]; $user_uuid = $_POST["user_uuid"];
$group_uuid = $_POST["group_uuid"]; $group_uuid = $_POST["group_uuid"];
$destination_order= $_POST["destination_order"]; $destination_order= $_POST["destination_order"];
$destination_enabled = $_POST["destination_enabled"] ?? 'false'; $destination_enabled = $_POST["destination_enabled"];
$destination_description = $_POST["destination_description"]; $destination_description = $_POST["destination_description"];
$destination_sell = check_float($_POST["destination_sell"] ?? ''); $destination_sell = check_float($_POST["destination_sell"] ?? '');
$currency = $_POST["currency"] ?? null; $currency = $_POST["currency"] ?? null;
@@ -207,7 +207,6 @@
//if (empty($destination_prefix) && permission_exists('destination_prefix')) { $msg .= $text['message-required']." ".$text['label-destination_country_code']."<br>\n"; } //if (empty($destination_prefix) && permission_exists('destination_prefix')) { $msg .= $text['message-required']." ".$text['label-destination_country_code']."<br>\n"; }
if (empty($destination_number)) { $msg .= $text['message-required']." ".$text['label-destination_number']."<br>\n"; } if (empty($destination_number)) { $msg .= $text['message-required']." ".$text['label-destination_number']."<br>\n"; }
if (empty($destination_context)) { $msg .= $text['message-required']." ".$text['label-destination_context']."<br>\n"; } if (empty($destination_context)) { $msg .= $text['message-required']." ".$text['label-destination_context']."<br>\n"; }
if (empty($destination_enabled)) { $msg .= $text['message-required']." ".$text['label-destination_enabled']."<br>\n"; }
//check for duplicates //check for duplicates
if ($destination_type == 'inbound' && $destination_number != $db_destination_number && $settings->get('destinations', 'unique', false)) { if ($destination_type == 'inbound' && $destination_number != $db_destination_number && $settings->get('destinations', 'unique', false)) {
@@ -449,7 +448,7 @@
$dialplan["dialplan_name"] = (!empty($dialplan_name)) ? $dialplan_name : format_phone($destination_area_code.$destination_number); $dialplan["dialplan_name"] = (!empty($dialplan_name)) ? $dialplan_name : format_phone($destination_area_code.$destination_number);
$dialplan["dialplan_number"] = $destination_area_code.$destination_number; $dialplan["dialplan_number"] = $destination_area_code.$destination_number;
$dialplan["dialplan_context"] = $destination_context; $dialplan["dialplan_context"] = $destination_context;
$dialplan["dialplan_continue"] = "false"; $dialplan["dialplan_continue"] = 'false';
$dialplan["dialplan_order"] = $destination_order; $dialplan["dialplan_order"] = $destination_order;
$dialplan["dialplan_enabled"] = $destination_enabled; $dialplan["dialplan_enabled"] = $destination_enabled;
$dialplan["dialplan_description"] = (!empty($dialplan_description)) ? $dialplan_description : $destination_description; $dialplan["dialplan_description"] = (!empty($dialplan_description)) ? $dialplan_description : $destination_description;
@@ -1326,7 +1325,6 @@
$currency_buy = $currency_buy ?? ''; $currency_buy = $currency_buy ?? '';
$destination_carrier = $destination_carrier ?? ''; $destination_carrier = $destination_carrier ?? '';
$destination_order = $destination_order ?? ''; $destination_order = $destination_order ?? '';
$destination_enabled = $destination_enabled ?? '';
$destination_description = $destination_description ?? ''; $destination_description = $destination_description ?? '';
$destination_email = $destination_email ?? ''; $destination_email = $destination_email ?? '';
$select_style = $select_style ?? ''; $select_style = $select_style ?? '';
@@ -1335,7 +1333,39 @@
if (!empty($_GET["id"]) && empty($_POST["persistformvar"])) { if (!empty($_GET["id"]) && empty($_POST["persistformvar"])) {
if (is_uuid($_GET["id"])) { if (is_uuid($_GET["id"])) {
$destination_uuid = $_GET["id"]; $destination_uuid = $_GET["id"];
$sql = "select * from v_destinations "; $sql = "select ";
$sql .= "domain_uuid, ";
$sql .= "dialplan_uuid, ";
$sql .= "destination_type, ";
$sql .= "destination_number, ";
$sql .= "destination_condition_field, ";
$sql .= "destination_prefix, ";
$sql .= "destination_trunk_prefix, ";
$sql .= "destination_area_code, ";
$sql .= "destination_caller_id_name, ";
$sql .= "destination_caller_id_number, ";
$sql .= "destination_cid_name_prefix, ";
$sql .= "destination_hold_music, ";
$sql .= "destination_distinctive_ring, ";
$sql .= "destination_record, ";
$sql .= "destination_ringback, ";
$sql .= "destination_accountcode, ";
$sql .= "destination_type_voice, ";
$sql .= "destination_type_fax, ";
$sql .= "destination_type_text, ";
$sql .= "destination_type_emergency, ";
$sql .= "destination_context, ";
$sql .= "destination_conditions, ";
$sql .= "destination_actions, ";
$sql .= "fax_uuid, ";
$sql .= "provider_uuid, ";
$sql .= "user_uuid, ";
$sql .= "group_uuid, ";
$sql .= "destination_order, ";
$sql .= "destination_enabled, ";
$sql .= "destination_description, ";
$sql .= "destination_email ";
$sql .= "from v_destinations ";
$sql .= "where destination_uuid = :destination_uuid "; $sql .= "where destination_uuid = :destination_uuid ";
$parameters['destination_uuid'] = $destination_uuid; $parameters['destination_uuid'] = $destination_uuid;
$row = $database->select($sql, $parameters, 'row'); $row = $database->select($sql, $parameters, 'row');
@@ -1462,7 +1492,6 @@
if (empty($destination_order)) { $destination_order = '100'; } if (empty($destination_order)) { $destination_order = '100'; }
if (empty($destination_type)) { $destination_type = 'inbound'; } if (empty($destination_type)) { $destination_type = 'inbound'; }
if (empty($destination_context)) { $destination_context = 'public'; } if (empty($destination_context)) { $destination_context = 'public'; }
if (empty($destination_enabled)) { $destination_enabled = 'true'; }
if ($destination_type =="outbound") { $destination_context = $_SESSION['domain_name']; } if ($destination_type =="outbound") { $destination_context = $_SESSION['domain_name']; }
if ($destination_type =="local") { $destination_context = $_SESSION['domain_name']; } if ($destination_type =="local") { $destination_context = $_SESSION['domain_name']; }
@@ -1489,7 +1518,7 @@
if (permission_exists('user_edit')) { if (permission_exists('user_edit')) {
$sql = "select * from v_users "; $sql = "select * from v_users ";
$sql .= "where domain_uuid = :domain_uuid "; $sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and user_enabled = 'true' "; $sql .= "and user_enabled = true ";
$sql .= "order by username asc "; $sql .= "order by username asc ";
$parameters['domain_uuid'] = $domain_uuid; $parameters['domain_uuid'] = $domain_uuid;
$users = $database->select($sql, $parameters, 'all'); $users = $database->select($sql, $parameters, 'all');
@@ -2135,22 +2164,16 @@
echo " ".$text['label-destination_enabled']."\n"; echo " ".$text['label-destination_enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style', ''), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='destination_enabled' name='destination_enabled' value='true' ".($destination_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else { echo " <select class='formfld' id='destination_enabled' name='destination_enabled'>\n";
echo " <select class='formfld' name='destination_enabled'>\n"; echo " <option value='true' ".($destination_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
switch ($destination_enabled) { echo " <option value='false' ".($destination_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
case "true" : $selected[1] = "selected='selected'"; break;
case "false" : $selected[2] = "selected='selected'"; break;
}
echo " <option value='true' ".$selected[1].">".$text['label-true']."</option>\n";
echo " <option value='false' ".$selected[2].">".$text['label-false']."</option>\n";
unset($selected);
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-destination_enabled']."\n"; echo $text['description-destination_enabled']."\n";

View File

@@ -267,7 +267,7 @@
$array["dialplans"][$row_id]["dialplan_name"] = !empty($dialplan_name) ? $dialplan_name : format_phone($destination_number); $array["dialplans"][$row_id]["dialplan_name"] = !empty($dialplan_name) ? $dialplan_name : format_phone($destination_number);
$array["dialplans"][$row_id]["dialplan_number"] = $destination_number; $array["dialplans"][$row_id]["dialplan_number"] = $destination_number;
$array["dialplans"][$row_id]["dialplan_context"] = $destination_context; $array["dialplans"][$row_id]["dialplan_context"] = $destination_context;
$array["dialplans"][$row_id]["dialplan_continue"] = "false"; $array["dialplans"][$row_id]["dialplan_continue"] = false;
$array["dialplans"][$row_id]["dialplan_order"] = "100"; $array["dialplans"][$row_id]["dialplan_order"] = "100";
$array["dialplans"][$row_id]["dialplan_enabled"] = $destination_enabled; $array["dialplans"][$row_id]["dialplan_enabled"] = $destination_enabled;
$array["dialplans"][$row_id]["dialplan_description"] = $destination_description; $array["dialplans"][$row_id]["dialplan_description"] = $destination_description;

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2024 Portions created by the Initial Developer are Copyright (C) 2008-2025
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -164,14 +164,12 @@
$sql .= "or lower(destination_caller_id_name) like :search "; $sql .= "or lower(destination_caller_id_name) like :search ";
$sql .= "or destination_caller_id_number like :search "; $sql .= "or destination_caller_id_number like :search ";
} }
$sql .= "or lower(destination_enabled) like :search ";
$sql .= "or lower(destination_description) like :search "; $sql .= "or lower(destination_description) like :search ";
$sql .= "or lower(destination_data) like :search "; $sql .= "or lower(destination_data) like :search ";
$sql .= ") "; $sql .= ") ";
$parameters['search'] = '%'.$search.'%'; $parameters['search'] = '%'.$search.'%';
} }
$parameters['destination_type'] = $destination_type; $parameters['destination_type'] = $destination_type;
$database = new database;
$num_rows = $database->select($sql, $parameters, 'column'); $num_rows = $database->select($sql, $parameters, 'column');
//prepare to page the results //prepare to page the results
@@ -206,7 +204,7 @@
$sql .= " d.destination_context, "; $sql .= " d.destination_context, ";
$sql .= " d.destination_caller_id_name, "; $sql .= " d.destination_caller_id_name, ";
$sql .= " d.destination_caller_id_number, "; $sql .= " d.destination_caller_id_number, ";
$sql .= " d.destination_enabled, "; $sql .= " cast(d.destination_enabled as text), ";
$sql .= " d.destination_description "; $sql .= " d.destination_description ";
$sql .= "from v_destinations as d "; $sql .= "from v_destinations as d ";
if ($show == "all" && permission_exists('destination_all')) { if ($show == "all" && permission_exists('destination_all')) {
@@ -230,7 +228,6 @@
$sql .= " or lower(destination_caller_id_name) like :search "; $sql .= " or lower(destination_caller_id_name) like :search ";
$sql .= " or destination_caller_id_number like :search "; $sql .= " or destination_caller_id_number like :search ";
} }
$sql .= " or lower(destination_enabled) like :search ";
$sql .= " or lower(destination_description) like :search "; $sql .= " or lower(destination_description) like :search ";
$sql .= " or lower(destination_data) like :search "; $sql .= " or lower(destination_data) like :search ";
$sql .= ") "; $sql .= ") ";
@@ -238,7 +235,6 @@
} }
$sql .= order_by($order_by, $order, 'destination_number, destination_order ', 'asc'); $sql .= order_by($order_by, $order, 'destination_number, destination_order ', 'asc');
$sql .= limit_offset($rows_per_page, $offset); $sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$destinations = $database->select($sql, $parameters, 'all'); $destinations = $database->select($sql, $parameters, 'all');
unset($sql, $parameters); unset($sql, $parameters);
@@ -463,4 +459,3 @@
require_once "resources/footer.php"; require_once "resources/footer.php";
?> ?>

View File

@@ -1240,7 +1240,7 @@
$sql .= "and d.domain_uuid = :domain_uuid \n"; $sql .= "and d.domain_uuid = :domain_uuid \n";
} }
$sql .= "and destination_type = 'inbound' \n"; $sql .= "and destination_type = 'inbound' \n";
$sql .= "and destination_enabled = 'true' \n"; $sql .= "and destination_enabled = true \n";
$sql .= "group by d.domain_uuid, d.destination_uuid, d.dialplan_uuid, n.domain_name, d.destination_type, d.destination_prefix, d.destination_number \n"; $sql .= "group by d.domain_uuid, d.destination_uuid, d.dialplan_uuid, n.domain_name, d.destination_type, d.destination_prefix, d.destination_number \n";
$sql .= "order by destination_number asc \n"; $sql .= "order by destination_number asc \n";
if (!(!empty($_GET['show']) && $_GET['show'] === 'all' && permission_exists('destination_summary_all'))) { if (!(!empty($_GET['show']) && $_GET['show'] === 'all' && permission_exists('destination_summary_all'))) {

View File

@@ -482,7 +482,7 @@
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "device_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "device_enabled";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "device_provision_enable"; $apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "device_provision_enable";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "device_enabled_date"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "device_enabled_date";
@@ -670,7 +670,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date";
@@ -743,7 +743,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "device_setting_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "device_setting_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "device_setting_description"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "device_setting_description";
@@ -912,7 +912,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "device_profile_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "device_profile_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "device_profile_description"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "device_profile_description";
@@ -1003,7 +1003,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the device key extension.'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the device key extension.';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'profile_key_protected'; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'profile_key_protected';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'boolean';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the device key protected.'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the device key protected.';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'profile_key_label'; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'profile_key_label';
@@ -1073,7 +1073,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the profile setting value.'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the profile setting value.';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'profile_setting_enabled'; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'profile_setting_enabled';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'boolean';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the profile setting enabled.'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the profile setting enabled.';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'profile_setting_description'; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'profile_setting_description';
@@ -1119,7 +1119,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the name."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the name.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Set the status of the vendor."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Set the status of the vendor.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "description"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "description";
@@ -1189,7 +1189,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the value."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the value.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Set the status of the function."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Set the status of the function.";
$z++; $z++;

View File

@@ -128,7 +128,7 @@
$device_uuid_alternate = $_POST["device_uuid_alternate"] ?? null; $device_uuid_alternate = $_POST["device_uuid_alternate"] ?? null;
$device_model = $_POST["device_model"] ?? null; $device_model = $_POST["device_model"] ?? null;
$device_firmware_version = $_POST["device_firmware_version"] ?? null; $device_firmware_version = $_POST["device_firmware_version"] ?? null;
$device_enabled = $_POST["device_enabled"] ?? 'false'; $device_enabled = $_POST["device_enabled"];
$device_template = $_POST["device_template"]; $device_template = $_POST["device_template"];
$device_description = $_POST["device_description"]; $device_description = $_POST["device_description"];
//lines //lines
@@ -349,7 +349,7 @@
if (permission_exists('device_line_shared')) { if (permission_exists('device_line_shared')) {
$array['devices'][0]['device_lines'][$y]['shared_line'] = $row["shared_line"]; $array['devices'][0]['device_lines'][$y]['shared_line'] = $row["shared_line"];
} }
$array['devices'][0]['device_lines'][$y]['enabled'] = $row["enabled"] ?? 'false'; $array['devices'][0]['device_lines'][$y]['enabled'] = $row["enabled"] ?? false;
if (permission_exists('device_line_port')) { if (permission_exists('device_line_port')) {
$array['devices'][0]['device_lines'][$y]['sip_port'] = $row["sip_port"]; $array['devices'][0]['device_lines'][$y]['sip_port'] = $row["sip_port"];
} }
@@ -435,15 +435,14 @@
$array['devices'][0]['device_settings'][$y]['device_setting_subcategory'] = $row["device_setting_subcategory"] ?? null; $array['devices'][0]['device_settings'][$y]['device_setting_subcategory'] = $row["device_setting_subcategory"] ?? null;
$array['devices'][0]['device_settings'][$y]['device_setting_name'] = $row["device_setting_name"] ?? null; $array['devices'][0]['device_settings'][$y]['device_setting_name'] = $row["device_setting_name"] ?? null;
$array['devices'][0]['device_settings'][$y]['device_setting_value'] = $row["device_setting_value"] ?? null; $array['devices'][0]['device_settings'][$y]['device_setting_value'] = $row["device_setting_value"] ?? null;
$array['devices'][0]['device_settings'][$y]['device_setting_enabled'] = $row["device_setting_enabled"] ?? 'false'; $array['devices'][0]['device_settings'][$y]['device_setting_enabled'] = $row["device_setting_enabled"] ?? false;
// echo $array['devices'][0]['device_settings'][$y]['device_setting_enabled'].'<br>';
$array['devices'][0]['device_settings'][$y]['device_setting_description'] = $row["device_setting_description"]; $array['devices'][0]['device_settings'][$y]['device_setting_description'] = $row["device_setting_description"];
$y++; $y++;
} }
} }
} }
// view_array($array);
// exit;
//save the device //save the device
$database->app_name = 'devices'; $database->app_name = 'devices';
$database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e';
@@ -545,9 +544,6 @@
$domains = $database->select($sql, null, 'all'); $domains = $database->select($sql, null, 'all');
unset($sql, $parameters); unset($sql, $parameters);
//set the defaults
if (empty($device_enabled)) { $device_enabled = 'true'; }
//use the device address to get the vendor //use the device address to get the vendor
if (empty($device_vendor)) { if (empty($device_vendor)) {
//get the device vendor using the device address //get the device vendor using the device address
@@ -597,7 +593,7 @@
$device_lines[$x]['auth_id'] = ''; $device_lines[$x]['auth_id'] = '';
$device_lines[$x]['password'] = ''; $device_lines[$x]['password'] = '';
$device_lines[$x]['shared_line'] = ''; $device_lines[$x]['shared_line'] = '';
$device_lines[$x]['enabled'] = ''; $device_lines[$x]['enabled'] = false;
$device_lines[$x]['sip_port'] = $settings->get('provision', 'line_sip_port', '5060'); $device_lines[$x]['sip_port'] = $settings->get('provision', 'line_sip_port', '5060');
$device_lines[$x]['sip_transport'] = $settings->get('provision', 'line_sip_transport', 'tcp'); $device_lines[$x]['sip_transport'] = $settings->get('provision', 'line_sip_transport', 'tcp');
$device_lines[$x]['register_expires'] = $settings->get('provision', 'line_register_expires', '120'); $device_lines[$x]['register_expires'] = $settings->get('provision', 'line_register_expires', '120');
@@ -685,7 +681,7 @@
for ($x = 0; $x < $rows; $x++) { for ($x = 0; $x < $rows; $x++) {
$device_settings[$id]['device_setting_name'] = ''; $device_settings[$id]['device_setting_name'] = '';
$device_settings[$id]['device_setting_value'] = ''; $device_settings[$id]['device_setting_value'] = '';
$device_settings[$id]['device_setting_enabled'] = ''; $device_settings[$id]['device_setting_enabled'] = false;
$device_settings[$id]['device_setting_description'] = ''; $device_settings[$id]['device_setting_description'] = '';
$id++; $id++;
} }
@@ -694,7 +690,7 @@
//get the users //get the users
$sql = "select * from v_users "; $sql = "select * from v_users ";
$sql .= "where domain_uuid = :domain_uuid "; $sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and user_enabled = 'true' "; $sql .= "and user_enabled = true ";
$sql .= "order by username asc "; $sql .= "order by username asc ";
$parameters['domain_uuid'] = $domain_uuid; $parameters['domain_uuid'] = $domain_uuid;
$users = $database->select($sql, $parameters, 'all'); $users = $database->select($sql, $parameters, 'all');
@@ -1283,7 +1279,6 @@
$x = 0; $x = 0;
foreach ($device_lines as $row) { foreach ($device_lines as $row) {
//set the defaults //set the defaults
if (!permission_exists('device_line_server_address')) { if (!permission_exists('device_line_server_address')) {
if (empty($row['server_address'])) { $row['server_address'] = $domain_name; } if (empty($row['server_address'])) { $row['server_address'] = $domain_name; }
@@ -1453,17 +1448,16 @@
} }
echo " <td align='left'>\n"; echo " <td align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' name='device_lines[".$x."][enabled]' value='true' ".(empty($row['enabled']) || $row['enabled'] == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else { echo " <select class='formfld' id='user_setting_enabled' name='device_lines[".$x."][enabled]'>\n";
echo " <select class='formfld' name='device_lines[".$x."][enabled]'>\n"; echo " <option value='true' ".($row['enabled'] === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='true'>".$text['option-true']."</option>\n"; echo " <option value='false' ".($row['enabled'] === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='false' ".($row['enabled'] == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo " </td>\n"; echo " </td>\n";
@@ -1817,17 +1811,16 @@
echo "</td>\n"; echo "</td>\n";
echo "<td align='left'>\n"; echo "<td align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' name='device_settings[".$x."][device_setting_enabled]' value='true' ".(empty($row['device_setting_enabled']) || $row['device_setting_enabled'] == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else { echo " <select class='formfld' id='device_setting_enabled' name='device_settings[".$x."][device_setting_enabled]'>\n";
echo " <select class='formfld' name='device_settings[".$x."][device_setting_enabled]'>\n"; echo " <option value='true' ".($row['device_setting_enabled'] === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='true'>".$text['option-true']."</option>\n"; echo " <option value='false' ".($row['device_setting_enabled'] === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='false' ".(!empty($row['device_setting_enabled']) && $row['device_setting_enabled'] == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "</td>\n"; echo "</td>\n";
@@ -2017,17 +2010,16 @@
echo " ".$text['label-device_enabled']."\n"; echo " ".$text['label-device_enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style', ''), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='device_enabled' name='device_enabled' value='true' ".($device_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='device_enabled' name='device_enabled'>\n"; echo " <select class='formfld' id='device_enabled' name='device_enabled'>\n";
echo " <option value='true' ".($device_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($device_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($device_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($device_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-device_enabled']."\n"; echo $text['description-device_enabled']."\n";

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Copyright (C) 2020-2024 All Rights Reserved. Copyright (C) 2020-2025 All Rights Reserved.
Contributor(s): Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
@@ -76,7 +76,7 @@
$device_profile_name = $_POST["device_profile_name"]; $device_profile_name = $_POST["device_profile_name"];
$device_profile_keys = $_POST["device_profile_keys"]; $device_profile_keys = $_POST["device_profile_keys"];
$device_profile_settings = $_POST["device_profile_settings"]; $device_profile_settings = $_POST["device_profile_settings"];
$device_profile_enabled = $_POST["device_profile_enabled"] ?? 'false'; $device_profile_enabled = $_POST["device_profile_enabled"];
$device_profile_description = $_POST["device_profile_description"]; $device_profile_description = $_POST["device_profile_description"];
$device_profile_keys_delete = $_POST["device_profile_keys_delete"] ?? null; $device_profile_keys_delete = $_POST["device_profile_keys_delete"] ?? null;
$device_profile_settings_delete = $_POST["device_profile_settings_delete"] ?? null; $device_profile_settings_delete = $_POST["device_profile_settings_delete"] ?? null;
@@ -96,7 +96,6 @@
$sql = "select domain_uuid from v_device_profiles "; $sql = "select domain_uuid from v_device_profiles ";
$sql .= "where device_profile_uuid = :device_profile_uuid "; $sql .= "where device_profile_uuid = :device_profile_uuid ";
$parameters['device_profile_uuid'] = $device_profile_uuid; $parameters['device_profile_uuid'] = $device_profile_uuid;
$database = new database;
$domain_uuid = $database->execute($sql, $parameters, 'column'); $domain_uuid = $database->execute($sql, $parameters, 'column');
} }
} }
@@ -115,7 +114,6 @@
//if (empty($device_profile_keys)) { $msg .= $text['message-required']." ".$text['label-device_profile_keys']."<br>\n"; } //if (empty($device_profile_keys)) { $msg .= $text['message-required']." ".$text['label-device_profile_keys']."<br>\n"; }
//if (empty($device_profile_settings)) { $msg .= $text['message-required']." ".$text['label-device_profile_settings']."<br>\n"; } //if (empty($device_profile_settings)) { $msg .= $text['message-required']." ".$text['label-device_profile_settings']."<br>\n"; }
//if (empty($domain_uuid)) { $msg .= $text['message-required']." ".$text['label-domain_uuid']."<br>\n"; } //if (empty($domain_uuid)) { $msg .= $text['message-required']." ".$text['label-domain_uuid']."<br>\n"; }
if (empty($device_profile_enabled)) { $msg .= $text['message-required']." ".$text['label-device_profile_enabled']."<br>\n"; }
//if (empty($device_profile_description)) { $msg .= $text['message-required']." ".$text['label-device_profile_description']."<br>\n"; } //if (empty($device_profile_description)) { $msg .= $text['message-required']." ".$text['label-device_profile_description']."<br>\n"; }
if (!empty($msg) && empty($_POST["persistformvar"])) { if (!empty($msg) && empty($_POST["persistformvar"])) {
require_once "resources/header.php"; require_once "resources/header.php";
@@ -170,7 +168,7 @@
$array['device_profiles'][0]['device_profile_settings'][$y]["device_profile_setting_uuid"] = $row["device_profile_setting_uuid"]; $array['device_profiles'][0]['device_profile_settings'][$y]["device_profile_setting_uuid"] = $row["device_profile_setting_uuid"];
$array['device_profiles'][0]['device_profile_settings'][$y]["profile_setting_name"] = $row["profile_setting_name"]; $array['device_profiles'][0]['device_profile_settings'][$y]["profile_setting_name"] = $row["profile_setting_name"];
$array['device_profiles'][0]['device_profile_settings'][$y]["profile_setting_value"] = $row["profile_setting_value"]; $array['device_profiles'][0]['device_profile_settings'][$y]["profile_setting_value"] = $row["profile_setting_value"];
$array['device_profiles'][0]['device_profile_settings'][$y]["profile_setting_enabled"] = $row["profile_setting_enabled"] ?? 'false'; $array['device_profiles'][0]['device_profile_settings'][$y]["profile_setting_enabled"] = $row["profile_setting_enabled"];
$array['device_profiles'][0]['device_profile_settings'][$y]["profile_setting_description"] = $row["profile_setting_description"]; $array['device_profiles'][0]['device_profile_settings'][$y]["profile_setting_description"] = $row["profile_setting_description"];
$y++; $y++;
} }
@@ -178,7 +176,6 @@
} }
//save to the data //save to the data
$database = new database;
$database->app_name = 'Device Profiles'; $database->app_name = 'Device Profiles';
$database->app_uuid = 'bb2531c3-97e6-428f-9a19-cbac1b96f5b7'; $database->app_uuid = 'bb2531c3-97e6-428f-9a19-cbac1b96f5b7';
$database->save($array); $database->save($array);
@@ -223,12 +220,17 @@
//pre-populate the form //pre-populate the form
if (!empty($_GET) && is_array($_GET) && (empty($_POST["persistformvar"]) || $_POST["persistformvar"] != "true")) { if (!empty($_GET) && is_array($_GET) && (empty($_POST["persistformvar"]) || $_POST["persistformvar"] != "true")) {
$device_profile_uuid = $_GET["id"]; $device_profile_uuid = $_GET["id"];
$sql = "select * from v_device_profiles "; $sql = "select ";
$sql .= "device_profile_uuid, ";
$sql .= "domain_uuid, ";
$sql .= "device_profile_name, ";
$sql .= "device_profile_enabled, ";
$sql .= "device_profile_description ";
$sql .= "from v_device_profiles ";
$sql .= "where device_profile_uuid = :device_profile_uuid "; $sql .= "where device_profile_uuid = :device_profile_uuid ";
//$sql .= "and domain_uuid = :domain_uuid "; //$sql .= "and domain_uuid = :domain_uuid ";
//$parameters['domain_uuid'] = $_SESSION['domain_uuid']; //$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['device_profile_uuid'] = $device_profile_uuid; $parameters['device_profile_uuid'] = $device_profile_uuid;
$database = new database;
$result = $database->execute($sql, $parameters, 'all'); $result = $database->execute($sql, $parameters, 'all');
foreach ($result as $row) { foreach ($result as $row) {
$domain_uuid = $row["domain_uuid"]; $domain_uuid = $row["domain_uuid"];
@@ -241,9 +243,6 @@
unset ($sql, $parameters); unset ($sql, $parameters);
} }
//set the defaults
if (empty($device_profile_enabled)) { $device_profile_enabled = 'true'; }
//get the child data //get the child data
if (!empty($device_profile_uuid)) { if (!empty($device_profile_uuid)) {
$sql = "select * from v_device_profile_keys "; $sql = "select * from v_device_profile_keys ";
@@ -265,7 +264,6 @@
$sql .= "profile_key_id asc "; $sql .= "profile_key_id asc ";
//$parameters['domain_uuid'] = $_SESSION['domain_uuid']; //$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['device_profile_uuid'] = $device_profile_uuid; $parameters['device_profile_uuid'] = $device_profile_uuid;
$database = new database;
$device_profile_keys = $database->execute($sql, $parameters, 'all'); $device_profile_keys = $database->execute($sql, $parameters, 'all');
unset ($sql, $parameters); unset ($sql, $parameters);
} }
@@ -295,9 +293,8 @@
//get the vendors //get the vendors
$sql = "select * "; $sql = "select * ";
$sql .= "from v_device_vendors as v "; $sql .= "from v_device_vendors as v ";
$sql .= "where enabled = 'true' "; $sql .= "where enabled = true ";
$sql .= "order by name asc "; $sql .= "order by name asc ";
$database = new database;
$vendors = $database->select($sql, null, 'all'); $vendors = $database->select($sql, null, 'all');
unset($sql); unset($sql);
@@ -305,10 +302,9 @@
$sql = "select v.name as vendor_name, f.type, f.subtype, f.value "; $sql = "select v.name as vendor_name, f.type, f.subtype, f.value ";
$sql .= "from v_device_vendors as v, v_device_vendor_functions as f "; $sql .= "from v_device_vendors as v, v_device_vendor_functions as f ";
$sql .= "where v.device_vendor_uuid = f.device_vendor_uuid "; $sql .= "where v.device_vendor_uuid = f.device_vendor_uuid ";
$sql .= "and v.enabled = 'true' "; $sql .= "and v.enabled = true ";
$sql .= "and f.enabled = 'true' "; $sql .= "and f.enabled = true ";
$sql .= "order by v.name asc, f.type asc "; $sql .= "order by v.name asc, f.type asc ";
$database = new database;
$vendor_functions = $database->select($sql, null, 'all'); $vendor_functions = $database->select($sql, null, 'all');
unset($sql); unset($sql);
@@ -352,7 +348,6 @@
$sql .= "order by profile_setting_name asc"; $sql .= "order by profile_setting_name asc";
//$parameters['domain_uuid'] = $_SESSION['domain_uuid']; //$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['device_profile_uuid'] = $device_profile_uuid; $parameters['device_profile_uuid'] = $device_profile_uuid;
$database = new database;
$device_profile_settings = $database->execute($sql, $parameters, 'all'); $device_profile_settings = $database->execute($sql, $parameters, 'all');
unset ($sql, $parameters); unset ($sql, $parameters);
} }
@@ -369,7 +364,7 @@
$device_profile_settings[$x]['device_profile_setting_uuid'] = ''; $device_profile_settings[$x]['device_profile_setting_uuid'] = '';
$device_profile_settings[$x]['profile_setting_name'] = ''; $device_profile_settings[$x]['profile_setting_name'] = '';
$device_profile_settings[$x]['profile_setting_value'] = ''; $device_profile_settings[$x]['profile_setting_value'] = '';
$device_profile_settings[$x]['profile_setting_enabled'] = 'true'; $device_profile_settings[$x]['profile_setting_enabled'] = true;
$device_profile_settings[$x]['profile_setting_description'] = ''; $device_profile_settings[$x]['profile_setting_description'] = '';
//filter the uuid //filter the uuid
@@ -632,20 +627,29 @@
echo " <td class='formfld'>\n"; echo " <td class='formfld'>\n";
echo " <input class='formfld' type='text' name='device_profile_keys[$x][profile_key_value]' maxlength='255' value=\"".escape($row["profile_key_value"])."\">\n"; echo " <input class='formfld' type='text' name='device_profile_keys[$x][profile_key_value]' maxlength='255' value=\"".escape($row["profile_key_value"])."\">\n";
echo " </td>\n"; echo " </td>\n";
if (permission_exists('device_key_extension')) { if (permission_exists('device_key_extension')) {
echo " <td class='formfld'>\n"; echo " <td class='formfld'>\n";
echo " <input class='formfld' type='text' name='device_profile_keys[$x][profile_key_extension]' maxlength='255' value=\"".escape($row["profile_key_extension"])."\">\n"; echo " <input class='formfld' type='text' name='device_profile_keys[$x][profile_key_extension]' maxlength='255' value=\"".escape($row["profile_key_extension"])."\">\n";
echo " </td>\n"; echo " </td>\n";
} }
if (permission_exists('device_key_protected')) { if (permission_exists('device_key_protected')) {
echo " <td>\n"; echo " <td>\n";
echo " <select class='formfld' name='device_profile_keys[$x][profile_key_protected]'>\n"; if ($input_toggle_style_switch) {
echo " <option value=''></option>\n"; echo " <span class='switch'>\n";
echo " <option value='true' ".($row['profile_key_protected'] == "true" ? "selected='selected'" : null).">".$text['label-true']."</option>\n"; }
echo " <option value='false' ".($row['profile_key_protected'] == "false" ? "selected='selected'" : null).">".$text['label-false']."</option>\n"; echo " <select class='formfld' id='profile_key_protected' name='device_profile_keys[$x][profile_key_protected]'>\n";
echo " <option value='true' ".($row['profile_key_protected'] === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($row['profile_key_protected'] === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
}
echo " </td>\n"; echo " </td>\n";
} }
echo " <td class='formfld'>\n"; echo " <td class='formfld'>\n";
echo " <input class='formfld' type='text' name='device_profile_keys[$x][profile_key_label]' maxlength='255' value=\"".escape($row["profile_key_label"])."\">\n"; echo " <input class='formfld' type='text' name='device_profile_keys[$x][profile_key_label]' maxlength='255' value=\"".escape($row["profile_key_label"])."\">\n";
echo " </td>\n"; echo " </td>\n";
@@ -711,17 +715,16 @@
echo " <input class='formfld' type='text' name='device_profile_settings[$x][profile_setting_value]' maxlength='255' value=\"".escape($row["profile_setting_value"])."\">\n"; echo " <input class='formfld' type='text' name='device_profile_settings[$x][profile_setting_value]' maxlength='255' value=\"".escape($row["profile_setting_value"])."\">\n";
echo " </td>\n"; echo " </td>\n";
echo " <td class='formfld'>\n"; echo " <td class='formfld'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' name='device_profile_settings[".$x."][profile_setting_enabled]' value='true' ".(empty($row['profile_setting_enabled']) || $row['profile_setting_enabled'] == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else { echo " <select class='formfld' id='profile_setting_enabled' name='device_profile_settings[".$x."][profile_setting_enabled]'>\n";
echo " <select class='formfld' name='device_profile_settings[".$x."][profile_setting_enabled]'>\n"; echo " <option value='true' ".($row['profile_setting_enabled'] === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='true'>".$text['option-true']."</option>\n"; echo " <option value='false' ".($row['profile_setting_enabled'] === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='false' ".(!empty($row['profile_setting_enabled']) && $row['profile_setting_enabled'] == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo " </td>\n"; echo " </td>\n";
echo " <td class='formfld'>\n"; echo " <td class='formfld'>\n";
@@ -771,17 +774,16 @@
echo " ".$text['label-device_profile_enabled']."\n"; echo " ".$text['label-device_profile_enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n"; echo "<td class='vtable' style='position: relative;' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='device_profile_enabled' name='device_profile_enabled' value='true' ".($device_profile_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='device_profile_enabled' name='device_profile_enabled'>\n"; echo " <select class='formfld' id='device_profile_enabled' name='device_profile_enabled'>\n";
echo " <option value='true' ".($device_profile_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($device_profile_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($device_profile_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($device_profile_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo ($text['description-device_profile_enabled'] ?? '')."\n"; echo ($text['description-device_profile_enabled'] ?? '')."\n";

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Copyright (C) 2019-2024 All Rights Reserved. Copyright (C) 2019-2025 All Rights Reserved.
Contributor(s): Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
@@ -118,7 +118,6 @@
$parameters['domain_uuid'] = $domain_uuid; $parameters['domain_uuid'] = $domain_uuid;
} }
$sql .= $sql_search ?? ''; $sql .= $sql_search ?? '';
$database = new database;
$num_rows = $database->select($sql, $parameters ?? null, 'column'); $num_rows = $database->select($sql, $parameters ?? null, 'column');
//prepare to page the results //prepare to page the results
@@ -137,10 +136,21 @@
$offset = $rows_per_page * $page; $offset = $rows_per_page * $page;
//get the list //get the list
$sql = str_replace('count(*)', '*', $sql); $sql = "select ";
$sql .= "device_profile_uuid, ";
$sql .= "domain_uuid, ";
$sql .= "device_profile_name, ";
$sql .= "cast(device_profile_enabled as text), ";
$sql .= "device_profile_description ";
$sql .= "from v_device_profiles ";
$sql .= "where true ";
if ($show != "all" || !permission_exists('device_profile_all')) {
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
$parameters['domain_uuid'] = $domain_uuid;
}
$sql .= $sql_search ?? '';
$sql .= order_by($order_by, $order, 'device_profile_name', 'asc'); $sql .= order_by($order_by, $order, 'device_profile_name', 'asc');
$sql .= limit_offset($rows_per_page, $offset); $sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$device_profiles = $database->select($sql, $parameters ?? null, 'all'); $device_profiles = $database->select($sql, $parameters ?? null, 'all');
unset($sql, $parameters); unset($sql, $parameters);
@@ -302,4 +312,3 @@
require_once "resources/footer.php"; require_once "resources/footer.php";
?> ?>

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -53,7 +53,7 @@
//get http post variables and set them to php variables //get http post variables and set them to php variables
if (count($_POST) > 0) { if (count($_POST) > 0) {
$name = $_POST["name"]; $name = $_POST["name"];
$enabled = $_POST["enabled"] ?? 'false'; $enabled = $_POST["enabled"];
$description = $_POST["description"]; $description = $_POST["description"];
} }
@@ -76,7 +76,6 @@
//check for all required data //check for all required data
$msg = ''; $msg = '';
if (empty($name)) { $msg .= $text['message-required']." ".$text['label-name']."<br>\n"; } if (empty($name)) { $msg .= $text['message-required']." ".$text['label-name']."<br>\n"; }
if (empty($enabled)) { $msg .= $text['message-required']." ".$text['label-enabled']."<br>\n"; }
//if (empty($description)) { $msg .= $text['message-required']." ".$text['label-description']."<br>\n"; } //if (empty($description)) { $msg .= $text['message-required']." ".$text['label-description']."<br>\n"; }
if (!empty($msg) && empty($_POST["persistformvar"])) { if (!empty($msg) && empty($_POST["persistformvar"])) {
require_once "resources/header.php"; require_once "resources/header.php";
@@ -123,7 +122,12 @@
//pre-populate the form //pre-populate the form
if (!empty($_GET) && count($_GET) > 0 && (empty($_POST["persistformvar"]) || $_POST["persistformvar"] != "true")) { if (!empty($_GET) && count($_GET) > 0 && (empty($_POST["persistformvar"]) || $_POST["persistformvar"] != "true")) {
$device_vendor_uuid = $_GET["id"]; $device_vendor_uuid = $_GET["id"];
$sql = "select * from v_device_vendors "; $sql = "select ";
$sql .= "device_vendor_uuid, ";
$sql .= "name, ";
$sql .= "enabled, ";
$sql .= "description ";
$sql .= "from v_device_vendors ";
$sql .= "where device_vendor_uuid = :device_vendor_uuid "; $sql .= "where device_vendor_uuid = :device_vendor_uuid ";
$parameters['device_vendor_uuid'] = $device_vendor_uuid; $parameters['device_vendor_uuid'] = $device_vendor_uuid;
$database = new database; $database = new database;
@@ -136,9 +140,6 @@
unset($sql, $parameters, $row); unset($sql, $parameters, $row);
} }
//set the defaults
if (empty($enabled)) { $enabled = true; }
//create token //create token
$object = new token; $object = new token;
$token = $object->create($_SERVER['PHP_SELF']); $token = $object->create($_SERVER['PHP_SELF']);
@@ -178,17 +179,16 @@
echo " ".$text['label-enabled']."\n"; echo " ".$text['label-enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='enabled' name='enabled' value='true' ".($enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='enabled' name='enabled'>\n"; echo " <select class='formfld' id='enabled' name='enabled'>\n";
echo " <option value='true' ".($enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-enabled']."\n"; echo $text['description-enabled']."\n";

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -47,7 +47,6 @@
$p = permissions::new(); $p = permissions::new();
$p->add('device_vendor_function_group_delete', 'temp'); $p->add('device_vendor_function_group_delete', 'temp');
$database = new database;
$database->app_name = 'devices'; $database->app_name = 'devices';
$database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e';
$database->delete($array); $database->delete($array);
@@ -95,7 +94,7 @@
$type = $_POST["type"]; $type = $_POST["type"];
$subtype = $_POST["subtype"]; $subtype = $_POST["subtype"];
$value = $_POST["value"]; $value = $_POST["value"];
$enabled = $_POST["enabled"] ?? 'false'; $enabled = $_POST["enabled"];
$description = $_POST["description"]; $description = $_POST["description"];
} }
@@ -120,7 +119,6 @@
//if (empty($label)) { $msg .= $text['message-required']." ".$text['label-label']."<br>\n"; } //if (empty($label)) { $msg .= $text['message-required']." ".$text['label-label']."<br>\n"; }
if (empty($type)) { $msg .= $text['message-required']." ".$text['label-type']."<br>\n"; } if (empty($type)) { $msg .= $text['message-required']." ".$text['label-type']."<br>\n"; }
if (empty($value)) { $msg .= $text['message-required']." ".$text['label-value']."<br>\n"; } if (empty($value)) { $msg .= $text['message-required']." ".$text['label-value']."<br>\n"; }
if (empty($enabled)) { $msg .= $text['message-required']." ".$text['label-enabled']."<br>\n"; }
//if (empty($description)) { $msg .= $text['message-required']." ".$text['label-description']."<br>\n"; } //if (empty($description)) { $msg .= $text['message-required']." ".$text['label-description']."<br>\n"; }
if (!empty($msg) && empty($_POST["persistformvar"])) { if (!empty($msg) && empty($_POST["persistformvar"])) {
require_once "resources/header.php"; require_once "resources/header.php";
@@ -159,7 +157,6 @@
$array['device_vendor_functions'][0]['enabled'] = $enabled; $array['device_vendor_functions'][0]['enabled'] = $enabled;
$array['device_vendor_functions'][0]['description'] = $description; $array['device_vendor_functions'][0]['description'] = $description;
$database = new database;
$database->app_name = 'devices'; $database->app_name = 'devices';
$database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e';
$database->save($array); $database->save($array);
@@ -186,7 +183,6 @@
$p = permissions::new(); $p = permissions::new();
$p->add('device_vendor_function_group_add', 'temp'); $p->add('device_vendor_function_group_add', 'temp');
$database = new database;
$database->app_name = 'devices'; $database->app_name = 'devices';
$database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e';
$database->save($array); $database->save($array);
@@ -206,13 +202,19 @@
//pre-populate the form //pre-populate the form
if (!empty($_GET) && count($_GET) > 0 && (empty($_POST["persistformvar"]) || $_POST["persistformvar"] != "true")) { if (!empty($_GET) && count($_GET) > 0 && (empty($_POST["persistformvar"]) || $_POST["persistformvar"] != "true")) {
$device_vendor_function_uuid = $_GET["id"] ?? null; $device_vendor_function_uuid = $_GET["id"] ?? null;
$sql = "select * from v_device_vendor_functions "; $sql = "select ";
$sql .= "device_vendor_function_uuid, ";
$sql .= "device_vendor_uuid, ";
$sql .= "type, ";
$sql .= "subtype, ";
$sql .= "value, ";
$sql .= "enabled, ";
$sql .= "description ";
$sql .= "from v_device_vendor_functions ";
$sql .= "where device_vendor_function_uuid = :device_vendor_function_uuid "; $sql .= "where device_vendor_function_uuid = :device_vendor_function_uuid ";
$parameters['device_vendor_function_uuid'] = $device_vendor_function_uuid; $parameters['device_vendor_function_uuid'] = $device_vendor_function_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row'); $row = $database->select($sql, $parameters, 'row');
if (is_array($row) && @sizeof($row) != 0) { if (is_array($row) && @sizeof($row) != 0) {
//$label = $row["label"];
$type = $row["type"]; $type = $row["type"];
$subtype = $row["subtype"]; $subtype = $row["subtype"];
$value = $row["value"]; $value = $row["value"];
@@ -237,7 +239,6 @@
$sql .= "g.group_name asc "; $sql .= "g.group_name asc ";
$parameters['device_vendor_uuid'] = $device_vendor_uuid; $parameters['device_vendor_uuid'] = $device_vendor_uuid;
$parameters['device_vendor_function_uuid'] = $device_vendor_function_uuid; $parameters['device_vendor_function_uuid'] = $device_vendor_function_uuid;
$database = new database;
$function_groups = $database->select($sql, $parameters, 'all'); $function_groups = $database->select($sql, $parameters, 'all');
unset($sql, $parameters); unset($sql, $parameters);
@@ -251,7 +252,14 @@
} }
//get the groups //get the groups
$sql = "select * from v_groups "; $sql = "select ";
$sql .= "group_uuid, ";
$sql .= "domain_uuid, ";
$sql .= "group_name, ";
$sql .= "group_protected, ";
$sql .= "group_level, ";
$sql .= "group_description ";
$sql .= "from v_groups ";
if (!empty($assigned_groups) && is_array($assigned_groups) && @sizeof($assigned_groups) != 0) { if (!empty($assigned_groups) && is_array($assigned_groups) && @sizeof($assigned_groups) != 0) {
$sql .= "where "; $sql .= "where ";
foreach ($assigned_groups as $index => $group_uuid) { foreach ($assigned_groups as $index => $group_uuid) {
@@ -263,7 +271,6 @@
} }
} }
$sql .= "order by domain_uuid desc, group_name asc "; $sql .= "order by domain_uuid desc, group_name asc ";
$database = new database;
$groups = $database->select($sql, $parameters ?? null, 'all'); $groups = $database->select($sql, $parameters ?? null, 'all');
unset($sql, $parameters, $sql_where, $index); unset($sql, $parameters, $sql_where, $index);
@@ -366,17 +373,16 @@
echo " ".$text['label-enabled']."\n"; echo " ".$text['label-enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' name='enabled' value='true' ".(empty($enabled) || $enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else { echo " <select class='formfld' id='enabled' name='enabled'>\n";
echo " <select class='formfld' name='enabled'>\n"; echo " <option value='true' ".($enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='true'>".$text['option-true']."</option>\n"; echo " <option value='false' ".($enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='false' ".(empty($enabled) || $enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-enabled']."\n"; echo $text['description-enabled']."\n";

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -76,18 +76,20 @@
$order_by = $_GET["order_by"] ?? null; $order_by = $_GET["order_by"] ?? null;
$order = $_GET["order"] ?? null; $order = $_GET["order"] ?? null;
//get the search term
$search = strtolower($_GET["search"] ?? '');
//prepare to page the results //prepare to page the results
$sql = "select count(*) from v_device_vendor_functions "; $sql = "select count(*) from v_device_vendor_functions ";
$sql .= "where device_vendor_uuid = :device_vendor_uuid "; $sql .= "where device_vendor_uuid = :device_vendor_uuid ";
if (isset($_GET["search"])) { if (!empty($search)) {
$sql .= "and ("; $sql .= "and (";
$sql .= " label like :search "; $sql .= " label like :search ";
$sql .= " or type like :search "; $sql .= " or type like :search ";
$sql .= " or subtype like :search "; $sql .= " or subtype like :search ";
$sql .= " or enabled like :search ";
$sql .= " or description like :search "; $sql .= " or description like :search ";
$sql .= ")"; $sql .= ")";
$parameters['search'] = '%'.$_GET["search"].'%'; $parameters['search'] = '%'.$search.'%';
} }
$parameters['device_vendor_uuid'] = $device_vendor_uuid; $parameters['device_vendor_uuid'] = $device_vendor_uuid;
$database = new database; $database = new database;
@@ -106,18 +108,25 @@
} }
//get the list //get the list
$sql = "select * from v_device_vendor_functions "; $sql = "select ";
$sql .= "device_vendor_function_uuid, ";
$sql .= "device_vendor_uuid, ";
$sql .= "type, ";
$sql .= "subtype, ";
$sql .= "value, ";
$sql .= "cast(enabled as text), ";
$sql .= "description ";
$sql .= "from v_device_vendor_functions ";
$sql .= "where device_vendor_uuid = :device_vendor_uuid "; $sql .= "where device_vendor_uuid = :device_vendor_uuid ";
if (isset($_GET["search"])) { if (!empty($search)) {
$sql .= "and ("; $sql .= "and (";
$sql .= " label like :search "; $sql .= " label like :search ";
$sql .= " or type like :search "; $sql .= " or type like :search ";
$sql .= " or subtype like :search "; $sql .= " or subtype like :search ";
$sql .= " or value like :search "; $sql .= " or value like :search ";
$sql .= " or enabled like :search ";
$sql .= " or description like :search "; $sql .= " or description like :search ";
$sql .= ")"; $sql .= ")";
$parameters['search'] = '%'.$_GET["search"].'%'; $parameters['search'] = '%'.$search.'%';
} }
$parameters['device_vendor_uuid'] = $device_vendor_uuid; $parameters['device_vendor_uuid'] = $device_vendor_uuid;
$sql .= order_by($order_by, $order, 'type', 'asc'); $sql .= order_by($order_by, $order, 'type', 'asc');
@@ -293,4 +302,3 @@
echo "</script>\n"; echo "</script>\n";
?> ?>

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -74,20 +74,19 @@
$order_by = $_GET["order_by"] ?? null; $order_by = $_GET["order_by"] ?? null;
$order = $_GET["order"] ?? null; $order = $_GET["order"] ?? null;
//add the search term //set the search term
$search = strtolower($_GET["search"] ?? ''); $search = strtolower($_GET["search"] ?? '');
if (!empty($search)) {
$sql_where = "where (";
$sql_where .= "lower(name) like :search ";
$sql_where .= "or lower(enabled) like :search ";
$sql_where .= "or lower(description) like :search ";
$sql_where .= ")";
$parameters['search'] = '%'.$search.'%';
}
//prepare to page the results //prepare to page the results
$sql = "select count(*) from v_device_vendors "; $sql = "select count(*) from v_device_vendors ";
$sql .= $sql_where ?? null; if (!empty($search)) {
$sql .= "where (";
$sql .= " lower(name) like :search ";
$sql .= " or lower(enabled) like :search ";
$sql .= " or lower(description) like :search ";
$sql .= ")";
$parameters['search'] = '%'.$search.'%';
}
$database = new database; $database = new database;
$num_rows = $database->select($sql, $parameters ?? null, 'column'); $num_rows = $database->select($sql, $parameters ?? null, 'column');
@@ -101,7 +100,20 @@
$offset = $rows_per_page * $page; $offset = $rows_per_page * $page;
//get the list //get the list
$sql = str_replace('count(*)', '*', $sql); $sql = "select ";
$sql .= "device_vendor_uuid, ";
$sql .= "name, ";
$sql .= "cast(enabled as text), ";
$sql .= "description ";
$sql .= "from v_device_vendors ";
if (!empty($search)) {
$sql .= "where (";
$sql .= " lower(name) like :search ";
$sql .= " or lower(enabled) like :search ";
$sql .= " or lower(description) like :search ";
$sql .= ")";
$parameters['search'] = '%'.$search.'%';
}
$sql .= order_by($order_by, $order, 'name', 'asc'); $sql .= order_by($order_by, $order, 'name', 'asc');
$sql .= limit_offset($rows_per_page, $offset); $sql .= limit_offset($rows_per_page, $offset);
$database = new database; $database = new database;
@@ -226,4 +238,3 @@
require_once "resources/footer.php"; require_once "resources/footer.php";
?> ?>

View File

@@ -135,7 +135,6 @@
$sql .= " lower(d.device_address) like :search "; $sql .= " lower(d.device_address) like :search ";
$sql .= " or lower(d.device_label) like :search "; $sql .= " or lower(d.device_label) like :search ";
$sql .= " or lower(d.device_vendor) like :search "; $sql .= " or lower(d.device_vendor) like :search ";
$sql .= " or lower(d.device_enabled) like :search ";
$sql .= " or lower(d.device_template) like :search "; $sql .= " or lower(d.device_template) like :search ";
$sql .= " or lower(d.device_description) like :search "; $sql .= " or lower(d.device_description) like :search ";
$sql .= " or lower(d.device_provisioned_method) like :search "; $sql .= " or lower(d.device_provisioned_method) like :search ";
@@ -189,7 +188,30 @@
if (isset($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) { if (isset($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) {
$sql .= "d3.domain_name, "; $sql .= "d3.domain_name, ";
} }
$sql .="d.*, d2.device_label as alternate_label, "; $sql .= "d.device_uuid, ";
$sql .= "d.domain_uuid, ";
$sql .= "d.device_address, ";
$sql .= "d.device_label, ";
$sql .= "d.device_vendor, ";
$sql .= "d.device_model, ";
$sql .= "d.device_firmware_version, ";
$sql .= "d.device_template, ";
$sql .= "d.device_username, ";
$sql .= "d.device_password, ";
$sql .= "d.device_time_zone, ";
$sql .= "d.device_description, ";
$sql .= "d.device_profile_uuid, ";
$sql .= "d.device_uuid_alternate, ";
$sql .= "d.device_user_uuid, ";
$sql .= "d.device_provisioned_date, ";
$sql .= "d.device_provisioned_method, ";
$sql .= "d.device_provisioned_ip, ";
$sql .= "d.device_enabled_date, ";
$sql .= "d.device_provisioned_agent, ";
$sql .= "d.device_location, ";
$sql .= "d.device_serial_number, ";
$sql .= "cast(d.device_enabled as text), ";
$sql .= "d2.device_label as alternate_label, ";
$sql .= "to_char(timezone(:time_zone, d.device_provisioned_date), 'DD Mon YYYY') as provisioned_date_formatted, \n"; $sql .= "to_char(timezone(:time_zone, d.device_provisioned_date), 'DD Mon YYYY') as provisioned_date_formatted, \n";
$sql .= "to_char(timezone(:time_zone, d.device_provisioned_date), 'HH12:MI:SS am') as provisioned_time_formatted \n"; $sql .= "to_char(timezone(:time_zone, d.device_provisioned_date), 'HH12:MI:SS am') as provisioned_time_formatted \n";
$sql .= "from v_devices as d, v_devices as d2 "; $sql .= "from v_devices as d, v_devices as d2 ";
@@ -224,7 +246,6 @@
$sql .= " lower(d.device_address) like :search "; $sql .= " lower(d.device_address) like :search ";
$sql .= " or lower(d.device_label) like :search "; $sql .= " or lower(d.device_label) like :search ";
$sql .= " or lower(d.device_vendor) like :search "; $sql .= " or lower(d.device_vendor) like :search ";
$sql .= " or lower(d.device_enabled) like :search ";
$sql .= " or lower(d.device_template) like :search "; $sql .= " or lower(d.device_template) like :search ";
$sql .= " or lower(d.device_description) like :search "; $sql .= " or lower(d.device_description) like :search ";
$sql .= " or lower(d.device_provisioned_method) like :search "; $sql .= " or lower(d.device_provisioned_method) like :search ";
@@ -477,4 +498,3 @@
require_once "resources/footer.php"; require_once "resources/footer.php";
?> ?>

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -122,9 +122,8 @@
$condition_expression_1 = '^('.$condition_expression_1.')$'; $condition_expression_1 = '^('.$condition_expression_1.')$';
} }
} }
$dialplan_enabled = $_POST["dialplan_enabled"] ?? 'false'; $dialplan_enabled = $_POST["dialplan_enabled"];
$dialplan_description = $_POST["dialplan_description"]; $dialplan_description = $_POST["dialplan_description"];
if (empty($dialplan_enabled)) { $dialplan_enabled = "true"; } //set default to enabled
} }
//process the http post data //process the http post data
@@ -145,9 +144,6 @@
if (empty($condition_field_1)) { $msg .= "".$text['label-required-condition_field_1']."<br>\n"; } if (empty($condition_field_1)) { $msg .= "".$text['label-required-condition_field_1']."<br>\n"; }
if (empty($condition_expression_1)) { $msg .= "".$text['label-required-condition_expression_1']."<br>\n"; } if (empty($condition_expression_1)) { $msg .= "".$text['label-required-condition_expression_1']."<br>\n"; }
if (empty($action_application_1)) { $msg .= "".$text['label-required-action_application_1']."<br>\n"; } if (empty($action_application_1)) { $msg .= "".$text['label-required-action_application_1']."<br>\n"; }
//if (empty($limit)) { $msg .= "Please provide: Limit<br>\n"; }
//if (empty($dialplan_enabled)) { $msg .= "Please provide: Enabled True or False<br>\n"; }
//if (empty($dialplan_description)) { $msg .= "Please provide: Description<br>\n"; }
if (!empty($msg) && empty($_POST["persistformvar"])) { if (!empty($msg) && empty($_POST["persistformvar"])) {
require_once "resources/header.php"; require_once "resources/header.php";
require_once "resources/persist_form_var.php"; require_once "resources/persist_form_var.php";
@@ -180,7 +176,7 @@
$array['dialplans'][$x]['dialplan_name'] = $dialplan_name; $array['dialplans'][$x]['dialplan_name'] = $dialplan_name;
$array['dialplans'][$x]['dialplan_number'] = $destination_number; $array['dialplans'][$x]['dialplan_number'] = $destination_number;
$array['dialplans'][$x]['dialplan_order'] = $public_order; $array['dialplans'][$x]['dialplan_order'] = $public_order;
$array['dialplans'][$x]['dialplan_continue'] = 'false'; $array['dialplans'][$x]['dialplan_continue'] = false;
$array['dialplans'][$x]['dialplan_context'] = 'public'; $array['dialplans'][$x]['dialplan_context'] = 'public';
$array['dialplans'][$x]['dialplan_enabled'] = $dialplan_enabled; $array['dialplans'][$x]['dialplan_enabled'] = $dialplan_enabled;
$array['dialplans'][$x]['dialplan_description'] = $dialplan_description; $array['dialplans'][$x]['dialplan_description'] = $dialplan_description;
@@ -781,17 +777,16 @@
echo " ".$text['label-enabled']."\n"; echo " ".$text['label-enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n"; echo "<td class='vtable' style='position: relative;' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='dialplan_enabled' name='dialplan_enabled' value='true' ".(!empty($dialplan_enabled) && $dialplan_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='dialplan_enabled' name='dialplan_enabled'>\n"; echo " <select class='formfld' id='dialplan_enabled' name='dialplan_enabled'>\n";
echo " <option value='true' ".($dialplan_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($dialplan_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($dialplan_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($dialplan_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo "</td>\n"; echo "</td>\n";

View File

@@ -191,7 +191,7 @@
} }
//set additional variables //set additional variables
$dialplan_enabled = $_POST["dialplan_enabled"] ?? 'false'; $dialplan_enabled = $_POST["dialplan_enabled"] ?? false;
$dialplan_description = $_POST["dialplan_description"]; $dialplan_description = $_POST["dialplan_description"];
} }
@@ -438,7 +438,7 @@
$dialplan_order ='333'; $dialplan_order ='333';
} }
$dialplan_context = $_SESSION['domain_name']; $dialplan_context = $_SESSION['domain_name'];
$dialplan_continue = 'false'; $dialplan_continue = false;
$app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3'; $app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3';
//set the uuid //set the uuid
@@ -451,7 +451,7 @@
$array['dialplans'][$x]['app_uuid'] = $app_uuid; $array['dialplans'][$x]['app_uuid'] = $app_uuid;
$array['dialplans'][$x]['dialplan_name'] = 'call_direction-outbound'.(empty($dialplan_description) && !empty($abbrv) ? '.'.$abbrv : null); $array['dialplans'][$x]['dialplan_name'] = 'call_direction-outbound'.(empty($dialplan_description) && !empty($abbrv) ? '.'.$abbrv : null);
$array['dialplans'][$x]['dialplan_order'] = '22'; $array['dialplans'][$x]['dialplan_order'] = '22';
$array['dialplans'][$x]['dialplan_continue'] = 'true'; $array['dialplans'][$x]['dialplan_continue'] = true;
$array['dialplans'][$x]['dialplan_context'] = $dialplan_context; $array['dialplans'][$x]['dialplan_context'] = $dialplan_context;
$array['dialplans'][$x]['dialplan_enabled'] = $dialplan_enabled; $array['dialplans'][$x]['dialplan_enabled'] = $dialplan_enabled;
$array['dialplans'][$x]['dialplan_description'] = $dialplan_description; $array['dialplans'][$x]['dialplan_description'] = $dialplan_description;
@@ -464,7 +464,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'false'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'false';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
$y++; $y++;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid(); $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid']; $array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid'];
@@ -474,7 +474,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = '^$'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = '^$';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
$y++; $y++;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid(); $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid']; $array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid'];
@@ -484,7 +484,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = $dialplan_expression; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = $dialplan_expression;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
$y++; $y++;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid(); $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid']; $array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid'];
@@ -495,7 +495,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_inline'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_inline'] = 'true';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
$y++; $y++;
$x++; $x++;
@@ -521,7 +521,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'false'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'false';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
$y++; $y++;
if (!empty($toll_allow)) { if (!empty($toll_allow)) {
@@ -533,7 +533,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = $toll_allow; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = $toll_allow;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
$y++; $y++;
} }
@@ -545,7 +545,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = $dialplan_expression; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = $dialplan_expression;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
if ($gateway_type != "transfer") { if ($gateway_type != "transfer") {
if (!empty($accountcode)) { if (!empty($accountcode)) {
@@ -558,7 +558,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'sip_h_accountcode='.$accountcode; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'sip_h_accountcode='.$accountcode;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'false'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = false;
} }
else { else {
$y++; $y++;
@@ -570,7 +570,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'sip_h_accountcode=${accountcode}'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'sip_h_accountcode=${accountcode}';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'false'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = false;
} }
} }
@@ -584,7 +584,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_inline'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_inline'] = 'true';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
$y++; $y++;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid(); $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
@@ -595,7 +595,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'call_timeout'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'call_timeout';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
if ($gateway_type != "transfer") { if ($gateway_type != "transfer") {
$y++; $y++;
@@ -607,7 +607,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'hangup_after_bridge=true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'hangup_after_bridge=true';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
$y++; $y++;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid(); $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
@@ -623,7 +623,7 @@
} }
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
$y++; $y++;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid(); $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
@@ -639,7 +639,7 @@
} }
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
if ($dialplan_expression == '(^911$|^933$)') { if ($dialplan_expression == '(^911$|^933$)') {
$y++; $y++;
@@ -651,7 +651,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'call_date=${strftime(%d-%b-%Y %r)}'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'call_date=${strftime(%d-%b-%Y %r)}';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'false'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = false;
$y++; $y++;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid(); $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid']; $array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid'];
@@ -661,7 +661,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = "app.lua emergency 1"; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = "app.lua emergency 1";
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'false'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = false;
} }
$y++; $y++;
@@ -673,7 +673,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'inherit_codec=true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'inherit_codec=true';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
$y++; $y++;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid(); $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
@@ -684,7 +684,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'ignore_display_updates=true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'ignore_display_updates=true';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
$y++; $y++;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid(); $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
@@ -695,7 +695,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'callee_id_number=$1'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'callee_id_number=$1';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
$y++; $y++;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid(); $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
@@ -706,7 +706,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'continue_on_fail=1,2,3,6,18,21,27,28,31,34,38,41,42,44,58,88,111,403,501,602,607,809'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'continue_on_fail=1,2,3,6,18,21,27,28,31,34,38,41,42,44,58,88,111,403,501,602,607,809';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
} }
if ($gateway_type == "enum" || $gateway_2_type == "enum") { if ($gateway_type == "enum" || $gateway_2_type == "enum") {
@@ -719,7 +719,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = $prefix_number."$1 e164.org"; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = $prefix_number."$1 e164.org";
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
} }
if (!empty($limit)) { if (!empty($limit)) {
@@ -732,7 +732,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = "hash \${domain_name} outbound ".$limit." !USER_BUSY"; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = "hash \${domain_name} outbound ".$limit." !USER_BUSY";
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
} }
if (!empty($outbound_prefix)) { if (!empty($outbound_prefix)) {
@@ -745,7 +745,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'outbound_prefix='.$outbound_prefix; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'outbound_prefix='.$outbound_prefix;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
} }
if ($pin_numbers_enable == "true") { if ($pin_numbers_enable == "true") {
@@ -758,7 +758,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'pin_number=database'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'pin_number=database';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
$y++; $y++;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid(); $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
@@ -769,7 +769,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'pin_number.lua'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'pin_number.lua';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
} }
if (strlen($prefix_number) > 2) { if (strlen($prefix_number) > 2) {
@@ -782,7 +782,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'provider_prefix='.$prefix_number; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'provider_prefix='.$prefix_number;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
} }
if ($gateway_type == "transfer") { $dialplan_detail_type = 'transfer'; } else { $dialplan_detail_type = 'bridge'; } if ($gateway_type == "transfer") { $dialplan_detail_type = 'transfer'; } else { $dialplan_detail_type = 'bridge'; }
@@ -795,7 +795,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = $bridge_data; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = $bridge_data;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
if (!empty($bridge_2_data)) { if (!empty($bridge_2_data)) {
$y++; $y++;
@@ -807,7 +807,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = $bridge_2_data; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = $bridge_2_data;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
} }
if (!empty($bridge_3_data)) { if (!empty($bridge_3_data)) {
@@ -820,7 +820,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = $bridge_3_data; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = $bridge_3_data;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
} }
unset($bridge_data); unset($bridge_data);
@@ -870,14 +870,14 @@
//get the domains //get the domains
$sql = "select * from v_domains "; $sql = "select * from v_domains ";
$sql .= "where domain_enabled = 'true' "; $sql .= "where domain_enabled = true ";
$database = new database; $database = new database;
$domains = $database->select($sql, null, 'all'); $domains = $database->select($sql, null, 'all');
unset($sql); unset($sql);
//get the gateways //get the gateways
$sql = "select * from v_gateways "; $sql = "select * from v_gateways ";
$sql .= "where enabled = 'true' "; $sql .= "where enabled = true ";
if (permission_exists('outbound_route_any_gateway')) { if (permission_exists('outbound_route_any_gateway')) {
$sql .= "order by CASE WHEN domain_uuid = :domain_uuid THEN 0 ELSE 1 END, domain_uuid DESC, gateway "; $sql .= "order by CASE WHEN domain_uuid = :domain_uuid THEN 0 ELSE 1 END, domain_uuid DESC, gateway ";
} }
@@ -893,7 +893,7 @@
//get the bridges //get the bridges
if (permission_exists('bridge_view')) { if (permission_exists('bridge_view')) {
$sql = "select * from v_bridges "; $sql = "select * from v_bridges ";
$sql .= "where bridge_enabled = 'true' "; $sql .= "where bridge_enabled = true ";
$sql .= "and domain_uuid = :domain_uuid "; $sql .= "and domain_uuid = :domain_uuid ";
$parameters['domain_uuid'] = $domain_uuid; $parameters['domain_uuid'] = $domain_uuid;
$database = new database; $database = new database;
@@ -901,9 +901,6 @@
unset($sql, $parameters); unset($sql, $parameters);
} }
//set defaults
if (empty($dialplan_enabled)) { $dialplan_enabled = "true"; }
//create token //create token
$object = new token; $object = new token;
$token = $object->create($_SERVER['PHP_SELF']); $token = $object->create($_SERVER['PHP_SELF']);
@@ -1342,17 +1339,16 @@ function type_onchange(dialplan_detail_type) {
echo " ".$text['label-enabled']."\n"; echo " ".$text['label-enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n"; echo "<td class='vtable' style='position: relative;' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='dialplan_enabled' name='dialplan_enabled' value='true' ".(!empty($dialplan_enabled) && $dialplan_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='dialplan_enabled' name='dialplan_enabled'>\n"; echo " <select class='formfld' id='dialplan_enabled' name='dialplan_enabled'>\n";
echo " <option value='true' ".($dialplan_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($dialplan_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($dialplan_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($dialplan_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-enabled']."\n"; echo $text['description-enabled']."\n";

View File

@@ -36,7 +36,7 @@
$apps[$x]['destinations'][$y]['label'] = "dialplans"; $apps[$x]['destinations'][$y]['label'] = "dialplans";
$apps[$x]['destinations'][$y]['name'] = "dialplans"; $apps[$x]['destinations'][$y]['name'] = "dialplans";
$apps[$x]['destinations'][$y]['sql'] = "select d.domain_name, e.dialplan_name, e.dialplan_number as destination, e.dialplan_description as description from v_dialplans as e, v_domains as d "; $apps[$x]['destinations'][$y]['sql'] = "select d.domain_name, e.dialplan_name, e.dialplan_number as destination, e.dialplan_description as description from v_dialplans as e, v_domains as d ";
$apps[$x]['destinations'][$y]['where'] = "where e.domain_uuid = '\${domain_uuid}' and e.domain_uuid = d.domain_uuid and e.dialplan_destination = 'true' and e.dialplan_number <> '' and e.dialplan_enabled = 'true' "; $apps[$x]['destinations'][$y]['where'] = "where e.domain_uuid = '\${domain_uuid}' and e.domain_uuid = d.domain_uuid and e.dialplan_destination = true and e.dialplan_number <> '' and e.dialplan_enabled = true ";
$apps[$x]['destinations'][$y]['order_by'] = "dialplan_order asc"; $apps[$x]['destinations'][$y]['order_by'] = "dialplan_order asc";
$apps[$x]['destinations'][$y]['field']['domain_name'] = "domain_name"; $apps[$x]['destinations'][$y]['field']['domain_name'] = "domain_name";
$apps[$x]['destinations'][$y]['field']['dialplan_name'] = "dialplan_name"; $apps[$x]['destinations'][$y]['field']['dialplan_name'] = "dialplan_name";
@@ -158,12 +158,11 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "dialplan_destination"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "dialplan_destination";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "dialplan_continue"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "dialplan_continue";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "dialplan_xml"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "dialplan_xml";
@@ -177,7 +176,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "dialplan_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "dialplan_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "dialplan_description"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "dialplan_description";

View File

@@ -152,9 +152,9 @@
$array['dialplans'][0]['app_uuid'] = 'c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4'; $array['dialplans'][0]['app_uuid'] = 'c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4';
$array['dialplans'][0]['dialplan_context'] = 'public'; $array['dialplans'][0]['dialplan_context'] = 'public';
$array['dialplans'][0]['dialplan_name'] = 'not-found'; $array['dialplans'][0]['dialplan_name'] = 'not-found';
$array['dialplans'][0]['dialplan_continue'] = 'false'; $array['dialplans'][0]['dialplan_continue'] = false;
$array['dialplans'][0]['dialplan_order'] = '999'; $array['dialplans'][0]['dialplan_order'] = '999';
$array['dialplans'][0]['dialplan_enabled'] = 'false'; $array['dialplans'][0]['dialplan_enabled'] = false;
$array['dialplan_details'][0]['dialplan_uuid'] = 'ea5339de-1982-46ca-9695-c35176165314'; $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_uuid'] = '8a21744d-b381-4cb0-9930-55b776e4e461';

View File

@@ -72,7 +72,7 @@
$dialplan_context = $_POST["dialplan_context"]; $dialplan_context = $_POST["dialplan_context"];
$dialplan_order = $_POST["dialplan_order"]; $dialplan_order = $_POST["dialplan_order"];
$dialplan_enabled = $_POST["dialplan_enabled"] ?? 'false'; $dialplan_enabled = $_POST["dialplan_enabled"] ?? false;
$dialplan_description = $_POST["dialplan_description"]; $dialplan_description = $_POST["dialplan_description"];
} }
@@ -122,7 +122,7 @@
$array['dialplans'][0]['app_uuid'] = '742714e5-8cdf-32fd-462c-cbe7e3d655db'; $array['dialplans'][0]['app_uuid'] = '742714e5-8cdf-32fd-462c-cbe7e3d655db';
$array['dialplans'][0]['dialplan_name'] = $dialplan_name; $array['dialplans'][0]['dialplan_name'] = $dialplan_name;
$array['dialplans'][0]['dialplan_order'] = $dialplan_order; $array['dialplans'][0]['dialplan_order'] = $dialplan_order;
$array['dialplans'][0]['dialplan_continue'] = 'false'; $array['dialplans'][0]['dialplan_continue'] = false;
$array['dialplans'][0]['dialplan_context'] = $dialplan_context; $array['dialplans'][0]['dialplan_context'] = $dialplan_context;
$array['dialplans'][0]['dialplan_enabled'] = $dialplan_enabled; $array['dialplans'][0]['dialplan_enabled'] = $dialplan_enabled;
$array['dialplans'][0]['dialplan_description'] = $dialplan_description; $array['dialplans'][0]['dialplan_description'] = $dialplan_description;
@@ -269,13 +269,13 @@
//echo "<td class='vtable' align='left'>\n"; //echo "<td class='vtable' align='left'>\n";
//echo " <select class='formfld' name='dialplan_continue' style='width: 60%;'>\n"; //echo " <select class='formfld' name='dialplan_continue' style='width: 60%;'>\n";
//echo " <option value=''></option>\n"; //echo " <option value=''></option>\n";
//if ($dialplan_continue == "true") { //if ($dialplan_continue == true) {
// echo " <option value='true' selected='selected'>true</option>\n"; // echo " <option value='true' selected='selected'>true</option>\n";
//} //}
//else { //else {
// echo " <option value='true'>true</option>\n"; // echo " <option value='true'>true</option>\n";
//} //}
//if ($dialplan_continue == "false") { //if ($dialplan_continue == false) {
// echo " <option value='false' selected='selected'>false</option>\n"; // echo " <option value='false' selected='selected'>false</option>\n";
//} //}
//else { //else {
@@ -520,17 +520,16 @@
echo " ".$text['label-enabled']."\n"; echo " ".$text['label-enabled']."\n";
echo " </td>\n"; echo " </td>\n";
echo " <td class='vtable' align='left'>\n"; echo " <td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' name='dialplan_enabled' value='true' ".(empty($dialplan_enabled) || $dialplan_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else { echo " <select class='formfld' id='dialplan_enabled' name='dialplan_enabled'>\n";
echo " <select class='formfld' name='dialplan_enabled'>\n"; echo " <option value='true' ".($dialplan_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='true'>".$text['option-true']."</option>\n"; echo " <option value='false' ".($dialplan_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='false' ".(!empty($dialplan_enabled) && $dialplan_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo " <br />\n"; echo " <br />\n";
echo " </td>\n"; echo " </td>\n";

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -96,10 +96,10 @@
$dialplan_name = $_POST["dialplan_name"]; $dialplan_name = $_POST["dialplan_name"];
$dialplan_number = $_POST["dialplan_number"]; $dialplan_number = $_POST["dialplan_number"];
$dialplan_order = $_POST["dialplan_order"]; $dialplan_order = $_POST["dialplan_order"];
$dialplan_continue = $_POST["dialplan_continue"] ?? 'false'; $dialplan_continue = $_POST["dialplan_continue"];
$dialplan_details = $_POST["dialplan_details"] ?? null; $dialplan_details = $_POST["dialplan_details"] ?? null;
$dialplan_context = $_POST["dialplan_context"]; $dialplan_context = $_POST["dialplan_context"];
$dialplan_enabled = $_POST["dialplan_enabled"] ?? 'false'; $dialplan_enabled = $_POST["dialplan_enabled"];
$dialplan_description = $_POST["dialplan_description"]; $dialplan_description = $_POST["dialplan_description"];
$dialplan_details_delete = $_POST["dialplan_details_delete"] ?? null; $dialplan_details_delete = $_POST["dialplan_details_delete"] ?? null;
if (!empty($dialplan_details_delete)) { if (!empty($dialplan_details_delete)) {
@@ -265,7 +265,7 @@
$array['dialplans'][$x]['dialplan_context'] = $_POST["dialplan_context"]; $array['dialplans'][$x]['dialplan_context'] = $_POST["dialplan_context"];
$array['dialplans'][$x]['dialplan_continue'] = $_POST["dialplan_continue"]; $array['dialplans'][$x]['dialplan_continue'] = $_POST["dialplan_continue"];
$array['dialplans'][$x]['dialplan_order'] = $_POST["dialplan_order"]; $array['dialplans'][$x]['dialplan_order'] = $_POST["dialplan_order"];
$array['dialplans'][$x]['dialplan_enabled'] = $_POST["dialplan_enabled"] ?? 'false'; $array['dialplans'][$x]['dialplan_enabled'] = $_POST["dialplan_enabled"];
$array['dialplans'][$x]['dialplan_description'] = $_POST["dialplan_description"]; $array['dialplans'][$x]['dialplan_description'] = $_POST["dialplan_description"];
$y = 0; $y = 0;
if (!empty($_POST["dialplan_details"]) && is_array($_POST["dialplan_details"])) { if (!empty($_POST["dialplan_details"]) && is_array($_POST["dialplan_details"])) {
@@ -312,7 +312,6 @@
$array['dialplans'][$x]['dialplan_xml'] = $dialplan_array[$dialplan_uuid]; $array['dialplans'][$x]['dialplan_xml'] = $dialplan_array[$dialplan_uuid];
//add or update the database //add or update the database
$database = new database;
$database->app_name = 'dialplans'; $database->app_name = 'dialplans';
$database->app_uuid = $app_uuid ?? null; $database->app_uuid = $app_uuid ?? null;
$database->uuid($dialplan_uuid); $database->uuid($dialplan_uuid);
@@ -353,10 +352,23 @@
//pre-populate the form //pre-populate the form
if (!empty($_GET) && count($_GET) > 0 && (empty($_POST["persistformvar"]) || $_POST["persistformvar"] != "true")) { if (!empty($_GET) && count($_GET) > 0 && (empty($_POST["persistformvar"]) || $_POST["persistformvar"] != "true")) {
$sql = "select * from v_dialplans "; $sql = "select ";
$sql .= "domain_uuid, ";
$sql .= "dialplan_uuid, ";
$sql .= "app_uuid, ";
$sql .= "hostname, ";
$sql .= "dialplan_context, ";
$sql .= "dialplan_name, ";
$sql .= "dialplan_number, ";
$sql .= "dialplan_destination, ";
$sql .= "dialplan_continue, ";
$sql .= "dialplan_xml, ";
$sql .= "dialplan_order, ";
$sql .= "dialplan_enabled, ";
$sql .= "dialplan_description ";
$sql .= "from v_dialplans ";
$sql .= "where dialplan_uuid = :dialplan_uuid "; $sql .= "where dialplan_uuid = :dialplan_uuid ";
$parameters['dialplan_uuid'] = $dialplan_uuid; $parameters['dialplan_uuid'] = $dialplan_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row'); $row = $database->select($sql, $parameters, 'row');
if (is_array($row) && @sizeof($row) != 0) { if (is_array($row) && @sizeof($row) != 0) {
$domain_uuid = $row["domain_uuid"]; $domain_uuid = $row["domain_uuid"];
@@ -381,18 +393,17 @@
$dialplan_order = '200'; $dialplan_order = '200';
} }
if (empty($dialplan_destination)) { if (empty($dialplan_destination)) {
$dialplan_destination = 'false'; $dialplan_destination = false;
} }
//get the dialplan details in an array //get the dialplan details in an array
$sql = "select "; $sql = "select ";
$sql .= "domain_uuid, dialplan_uuid, dialplan_detail_uuid, dialplan_detail_tag, dialplan_detail_type, dialplan_detail_data, "; $sql .= "domain_uuid, dialplan_uuid, dialplan_detail_uuid, dialplan_detail_tag, dialplan_detail_type, dialplan_detail_data, ";
$sql .= "dialplan_detail_break, dialplan_detail_inline, dialplan_detail_group, dialplan_detail_order, cast(dialplan_detail_enabled as text) "; $sql .= "dialplan_detail_break, dialplan_detail_inline, dialplan_detail_group, dialplan_detail_order, dialplan_detail_enabled ";
$sql .= "from v_dialplan_details "; $sql .= "from v_dialplan_details ";
$sql .= "where dialplan_uuid = :dialplan_uuid "; $sql .= "where dialplan_uuid = :dialplan_uuid ";
$sql .= "order by dialplan_detail_group asc, dialplan_detail_order asc"; $sql .= "order by dialplan_detail_group asc, dialplan_detail_order asc";
$parameters['dialplan_uuid'] = $dialplan_uuid; $parameters['dialplan_uuid'] = $dialplan_uuid;
$database = new database;
$result = $database->select($sql, $parameters, 'all'); $result = $database->select($sql, $parameters, 'all');
unset($sql, $parameters); unset($sql, $parameters);
@@ -476,7 +487,7 @@
$details[$group][$x]['dialplan_detail_inline'] = ''; $details[$group][$x]['dialplan_detail_inline'] = '';
$details[$group][$x]['dialplan_detail_group'] = $group; $details[$group][$x]['dialplan_detail_group'] = $group;
$details[$group][$x]['dialplan_detail_order'] = $dialplan_detail_order; $details[$group][$x]['dialplan_detail_order'] = $dialplan_detail_order;
$details[$group][$x]['dialplan_detail_enabled'] = 'true'; $details[$group][$x]['dialplan_detail_enabled'] = true;
} }
} }
@@ -639,17 +650,16 @@
echo " ".$text['label-continue']."\n"; echo " ".$text['label-continue']."\n";
echo " </td>\n"; echo " </td>\n";
echo " <td class='vtable' align='left'>\n"; echo " <td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' name='dialplan_continue' value='true' ".(!empty($dialplan_continue) && $dialplan_continue == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else { echo " <select class='formfld' id='dialplan_continue' name='dialplan_continue'>\n";
echo " <select class='formfld' name='dialplan_continue'>\n"; echo " <option value='true' ".($dialplan_continue === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='true'>".$text['option-true']."</option>\n"; echo " <option value='false' ".($dialplan_continue === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='false' ".(!empty($dialplan_continue) && $dialplan_continue == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo " </td>\n"; echo " </td>\n";
echo " </tr>\n"; echo " </tr>\n";
@@ -692,13 +702,13 @@
echo " <td class='vtable' align='left'>\n"; echo " <td class='vtable' align='left'>\n";
echo " <select class='formfld' name='dialplan_destination'>\n"; echo " <select class='formfld' name='dialplan_destination'>\n";
echo " <option value=''></option>\n"; echo " <option value=''></option>\n";
if ($dialplan_destination == "true") { if ($dialplan_destination == true) {
echo " <option value='true' selected='selected'>".$text['option-true']."</option>\n"; echo " <option value='true' selected='selected'>".$text['option-true']."</option>\n";
} }
else { else {
echo " <option value='true'>".$text['option-true']."</option>\n"; echo " <option value='true'>".$text['option-true']."</option>\n";
} }
if ($dialplan_destination == "false") { if ($dialplan_destination == false) {
echo " <option value='false' selected='selected'>".$text['option-false']."</option>\n"; echo " <option value='false' selected='selected'>".$text['option-false']."</option>\n";
} }
else { else {
@@ -743,17 +753,16 @@
echo " ".$text['label-enabled']."\n"; echo " ".$text['label-enabled']."\n";
echo " </td>\n"; echo " </td>\n";
echo " <td class='vtable' style='position: relative;' align='left'>\n"; echo " <td class='vtable' style='position: relative;' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='dialplan_enabled' name='dialplan_enabled' value='true' ".(!empty($dialplan_enabled) && $dialplan_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='dialplan_enabled' name='dialplan_enabled'>\n"; echo " <select class='formfld' id='dialplan_enabled' name='dialplan_enabled'>\n";
echo " <option value='true' ".($dialplan_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($dialplan_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($dialplan_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($dialplan_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo " </td>\n"; echo " </td>\n";
echo " </tr>\n"; echo " </tr>\n";
@@ -837,11 +846,6 @@
$dialplan_detail_order = $row['dialplan_detail_order']; $dialplan_detail_order = $row['dialplan_detail_order'];
$dialplan_detail_enabled = $row['dialplan_detail_enabled']; $dialplan_detail_enabled = $row['dialplan_detail_enabled'];
//default to enabled true
if (empty($dialplan_detail_enabled)) {
$dialplan_detail_enabled = 'true';
}
//no border on last row //no border on last row
$no_border = ($index == 999) ? "border: none;" : null; $no_border = ($index == 999) ? "border: none;" : null;
@@ -949,7 +953,6 @@
// retrieve gateway name from db // retrieve gateway name from db
$sql = "select gateway from v_gateways where gateway_uuid = :gateway_uuid "; $sql = "select gateway from v_gateways where gateway_uuid = :gateway_uuid ";
$parameters['gateway_uuid'] = $bridge_statement[3]; $parameters['gateway_uuid'] = $bridge_statement[3];
$database = new database;
$gateways = $database->select($sql, $parameters, 'all'); $gateways = $database->select($sql, $parameters, 'all');
if (is_array($gateways) && @sizeof($gateways) != 0) { if (is_array($gateways) && @sizeof($gateways) != 0) {
$gateway_name = $gateways[0]['gateway']; $gateway_name = $gateways[0]['gateway'];
@@ -1037,13 +1040,13 @@
echo "</td>\n"; echo "</td>\n";
//enabled //enabled
echo "<td class='vtablerow' style='".$no_border." text-align: center;' onclick=\"label_to_form('label_dialplan_detail_enabled_".$x."','dialplan_detail_enabled_".$x."');\" nowrap='nowrap'>\n"; echo "<td class='vtablerow' style='".$no_border." text-align: center;' onclick=\"label_to_form('label_dialplan_detail_enabled_".$x."','dialplan_detail_enabled_".$x."');\" nowrap='nowrap'>\n";
$label_dialplan_detail_enabled = $text['label-'.($dialplan_detail_enabled === true ? 'true' : 'false')];
if ($element['hidden']) { if ($element['hidden']) {
echo " <label id=\"label_dialplan_detail_enabled_".$x."\">".escape($dialplan_detail_enabled)."</label>\n"; echo " <label id=\"label_dialplan_detail_enabled_".$x."\">".$label_dialplan_detail_enabled."</label>\n";
} }
echo " <select id='dialplan_detail_enabled_".$x."' name='dialplan_details[".$x."][dialplan_detail_enabled]' class='formfld' style='width: auto; ".$element['visibility']."'>\n"; echo " <select id='dialplan_detail_enabled_".$x."' name='dialplan_details[".$x."][dialplan_detail_enabled]' class='formfld' style='width: auto; ".$element['visibility']."'>\n";
echo " <option></option>\n"; echo " <option value='true' ".($dialplan_detail_enabled === true ? $selected : null).">".$text['option-true']."</option>\n";
echo " <option value='true' ".($dialplan_detail_enabled == "true" ? $selected : null).">".$text['option-true']."</option>\n"; echo " <option value='false' ".($dialplan_detail_enabled === false ? $selected : null).">".$text['option-false']."</option>\n";
echo " <option value='false' ".($dialplan_detail_enabled == "false" ? $selected : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
echo "</td>\n"; echo "</td>\n";
//tools //tools

View File

@@ -123,7 +123,6 @@
$sql .= "app_uuid = 'c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4' "; $sql .= "app_uuid = 'c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4' ";
$sql .= "where dialplan_context = 'public' "; $sql .= "where dialplan_context = 'public' ";
$sql .= "and app_uuid is null; "; $sql .= "and app_uuid is null; ";
$database = new database;
$database->execute($sql); $database->execute($sql);
unset($sql); unset($sql);
} }
@@ -178,8 +177,6 @@
$sql .= " lower(dialplan_context) like :search "; $sql .= " lower(dialplan_context) like :search ";
$sql .= " or lower(dialplan_name) like :search "; $sql .= " or lower(dialplan_name) like :search ";
$sql .= " or lower(dialplan_number) like :search "; $sql .= " or lower(dialplan_number) like :search ";
$sql .= " or lower(dialplan_continue) like :search ";
$sql .= " or lower(dialplan_enabled) like :search ";
$sql .= " or lower(dialplan_description) like :search "; $sql .= " or lower(dialplan_description) like :search ";
if (is_numeric($search)) { if (is_numeric($search)) {
$sql .= " or dialplan_order = :search_numeric "; $sql .= " or dialplan_order = :search_numeric ";
@@ -188,7 +185,6 @@
$sql .= ") "; $sql .= ") ";
$parameters['search'] = '%'.$search.'%'; $parameters['search'] = '%'.$search.'%';
} }
$database = new database;
$num_rows = $database->select($sql, $parameters ?? null, 'column'); $num_rows = $database->select($sql, $parameters ?? null, 'column');
//prepare the paging //prepare the paging
@@ -214,7 +210,21 @@
$offset = $rows_per_page * $page; $offset = $rows_per_page * $page;
//get the list of dialplans //get the list of dialplans
$sql = "select * from v_dialplans "; $sql = "select ";
$sql .= "domain_uuid, ";
$sql .= "dialplan_uuid, ";
$sql .= "app_uuid, ";
$sql .= "hostname, ";
$sql .= "dialplan_context, ";
$sql .= "dialplan_name, ";
$sql .= "dialplan_number, ";
$sql .= "dialplan_destination, ";
$sql .= "cast(dialplan_continue as text), ";
$sql .= "dialplan_xml, ";
$sql .= "dialplan_order, ";
$sql .= "cast(dialplan_enabled as text), ";
$sql .= "dialplan_description ";
$sql .= "from v_dialplans ";
if ($show == "all" && permission_exists('dialplan_all')) { if ($show == "all" && permission_exists('dialplan_all')) {
$sql .= "where true "; $sql .= "where true ";
} }
@@ -252,8 +262,6 @@
$sql .= " lower(dialplan_context) like :search "; $sql .= " lower(dialplan_context) like :search ";
$sql .= " or lower(dialplan_name) like :search "; $sql .= " or lower(dialplan_name) like :search ";
$sql .= " or lower(dialplan_number) like :search "; $sql .= " or lower(dialplan_number) like :search ";
$sql .= " or lower(dialplan_continue) like :search ";
$sql .= " or lower(dialplan_enabled) like :search ";
$sql .= " or lower(dialplan_description) like :search "; $sql .= " or lower(dialplan_description) like :search ";
if (is_numeric($search)) { if (is_numeric($search)) {
$sql .= " or dialplan_order = :search_numeric "; $sql .= " or dialplan_order = :search_numeric ";
@@ -274,7 +282,6 @@
$sql .= "order by dialplan_order asc, lower(dialplan_name) asc "; $sql .= "order by dialplan_order asc, lower(dialplan_name) asc ";
} }
$sql .= limit_offset($rows_per_page, $offset); $sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$dialplans = $database->select($sql, $parameters ?? null, 'all'); $dialplans = $database->select($sql, $parameters ?? null, 'all');
unset($sql, $parameters); unset($sql, $parameters);
@@ -298,7 +305,6 @@
$parameters['app_uuid'] = $app_uuid; $parameters['app_uuid'] = $app_uuid;
} }
$sql .= ") as dc "; $sql .= ") as dc ";
$database = new database;
$rows = $database->select($sql, $parameters ?? null, 'all'); $rows = $database->select($sql, $parameters ?? null, 'all');
if (is_array($rows) && @sizeof($rows) != 0) { if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $row) { foreach ($rows as $row) {
@@ -655,4 +661,3 @@
require_once "resources/footer.php"; require_once "resources/footer.php";
?> ?>

View File

@@ -326,7 +326,7 @@
$array['dialplans'][$x]['dialplan_enabled'] = $dialplan['@attributes']['enabled']; $array['dialplans'][$x]['dialplan_enabled'] = $dialplan['@attributes']['enabled'];
} }
else { else {
$array['dialplans'][$x]['dialplan_enabled'] = "true"; $array['dialplans'][$x]['dialplan_enabled'] = true;
} }
$array['dialplans'][$x]['dialplan_description'] = $dialplan['@attributes']['description'] ?? null; $array['dialplans'][$x]['dialplan_description'] = $dialplan['@attributes']['description'] ?? null;
@@ -351,7 +351,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = $row['@attributes']['enabled']; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = $row['@attributes']['enabled'];
} }
else { else {
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
} }
$y++; $y++;
@@ -391,7 +391,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = $row2['@attributes']['enabled']; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = $row2['@attributes']['enabled'];
} }
else { else {
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
} }
$y++; $y++;
@@ -418,7 +418,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = $row2['@attributes']['enabled']; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = $row2['@attributes']['enabled'];
} }
else { else {
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true'; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = true;
} }
$y++; $y++;
@@ -499,7 +499,7 @@
$sql .= "or d.domain_uuid is null "; $sql .= "or d.domain_uuid is null ";
$sql .= ") "; $sql .= ") ";
$sql .= "and d.app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3' "; $sql .= "and d.app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3' ";
$sql .= "and d.dialplan_enabled = 'true' "; $sql .= "and d.dialplan_enabled = true ";
$sql .= "and d.dialplan_uuid = s.dialplan_uuid "; $sql .= "and d.dialplan_uuid = s.dialplan_uuid ";
$sql .= "order by "; $sql .= "order by ";
$sql .= "d.dialplan_order asc, "; $sql .= "d.dialplan_order asc, ";
@@ -603,7 +603,7 @@
foreach($database_array['dialplans'] as $row) { foreach($database_array['dialplans'] as $row) {
if (!empty($row['dialplan_details'])) { if (!empty($row['dialplan_details'])) {
foreach($row['dialplan_details'] as $detail) { foreach($row['dialplan_details'] as $detail) {
if ($detail['dialplan_detail_enabled'] == 'true') { if ($detail['dialplan_detail_enabled'] == true) {
$array[$id]['domain_uuid'] = $row['domain_uuid']; $array[$id]['domain_uuid'] = $row['domain_uuid'];
$array[$id]['dialplan_uuid'] = $row['dialplan_uuid']; $array[$id]['dialplan_uuid'] = $row['dialplan_uuid'];
$array[$id]['app_uuid'] = $row['app_uuid']; $array[$id]['app_uuid'] = $row['app_uuid'];
@@ -668,7 +668,7 @@
else { else {
$sql .= "where (dialplan_context = :dialplan_context or dialplan_context = '\${domain_name}' or dialplan_context = 'global') "; $sql .= "where (dialplan_context = :dialplan_context or dialplan_context = '\${domain_name}' or dialplan_context = 'global') ";
} }
$sql .= "and dialplan_enabled = 'true' "; $sql .= "and dialplan_enabled = true ";
$parameters['dialplan_context'] = $this->context; $parameters['dialplan_context'] = $this->context;
} }
} }
@@ -728,7 +728,7 @@
$sql .= "and p.dialplan_uuid = :dialplan_uuid \n"; $sql .= "and p.dialplan_uuid = :dialplan_uuid \n";
$parameters['dialplan_uuid'] = $this->uuid; $parameters['dialplan_uuid'] = $this->uuid;
} }
$sql .= "and (s.dialplan_detail_enabled = 'true' or s.dialplan_detail_enabled is null) \n"; $sql .= "and (s.dialplan_detail_enabled = true or s.dialplan_detail_enabled is null) \n";
$sql .= "order by \n"; $sql .= "order by \n";
$sql .= "p.dialplan_order asc, \n"; $sql .= "p.dialplan_order asc, \n";
$sql .= "p.dialplan_name asc, \n"; $sql .= "p.dialplan_name asc, \n";

View File

@@ -55,7 +55,7 @@
$sql .= " and template_category = 'email' "; $sql .= " and template_category = 'email' ";
$sql .= " and template_subcategory = 'test' "; $sql .= " and template_subcategory = 'test' ";
$sql .= " and template_type = 'html' "; $sql .= " and template_type = 'html' ";
$sql .= " and template_enabled = 'true' "; $sql .= " and template_enabled = true ";
$sql .= " and (domain_uuid = :domain_uuid or domain_uuid is null) "; $sql .= " and (domain_uuid = :domain_uuid or domain_uuid is null) ";
$sql .= "limit 1 "; $sql .= "limit 1 ";
$parameters['template_language'] = $language_dialect; $parameters['template_language'] = $language_dialect;

View File

@@ -197,7 +197,7 @@
//get the email template from the database //get the email template from the database
$sql = "select template_subject, template_body from v_email_templates "; $sql = "select template_subject, template_body from v_email_templates ";
$sql .= "where template_enabled = 'true' "; $sql .= "where template_enabled = true ";
$sql .= "and template_language = :template_language "; $sql .= "and template_language = :template_language ";
$sql .= "and template_category = :template_category "; $sql .= "and template_category = :template_category ";
$sql .= "and template_subcategory = :template_subcategory "; $sql .= "and template_subcategory = :template_subcategory ";

View File

@@ -181,7 +181,7 @@
//$voicemail_name_base64 = $row["voicemail_name_base64"]; //$voicemail_name_base64 = $row["voicemail_name_base64"];
//$voicemail_tutorial = $row["voicemail_tutorial"]; //$voicemail_tutorial = $row["voicemail_tutorial"];
if (gettype($voicemail_transcription_enabled) === 'string') { if (gettype($voicemail_transcription_enabled) === 'string') {
$voicemail_transcription_enabled = ($voicemail_transcription_enabled === 'true') ? true : false; $voicemail_transcription_enabled = ($voicemail_transcription_enabled === true) ? true : false;
} }
} }
unset($parameters); unset($parameters);

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
*/ */
@@ -69,7 +69,7 @@
$extension_setting_type = $_POST["extension_setting_type"]; $extension_setting_type = $_POST["extension_setting_type"];
$extension_setting_name = $_POST["extension_setting_name"]; $extension_setting_name = $_POST["extension_setting_name"];
$extension_setting_value = $_POST["extension_setting_value"]; $extension_setting_value = $_POST["extension_setting_value"];
$extension_setting_enabled = $_POST["extension_setting_enabled"] ?? 'false'; $extension_setting_enabled = $_POST["extension_setting_enabled"];
$extension_setting_description = $_POST["extension_setting_description"]; $extension_setting_description = $_POST["extension_setting_description"];
} }
@@ -123,7 +123,7 @@
if (empty($extension_setting_type)) { $msg .= $text['message-required']." ".$text['label-extension_setting_type']."<br>\n"; } if (empty($extension_setting_type)) { $msg .= $text['message-required']." ".$text['label-extension_setting_type']."<br>\n"; }
if (empty($extension_setting_name)) { $msg .= $text['message-required']." ".$text['label-extension_setting_name']."<br>\n"; } if (empty($extension_setting_name)) { $msg .= $text['message-required']." ".$text['label-extension_setting_name']."<br>\n"; }
//if (empty($extension_setting_value)) { $msg .= $text['message-required']." ".$text['label-extension_setting_value']."<br>\n"; } //if (empty($extension_setting_value)) { $msg .= $text['message-required']." ".$text['label-extension_setting_value']."<br>\n"; }
if (empty($extension_setting_enabled)) { $msg .= $text['message-required']." ".$text['label-extension_setting_enabled']."<br>\n"; } // if (empty($extension_setting_enabled)) { $msg .= $text['message-required']." ".$text['label-extension_setting_enabled']."<br>\n"; }
//if (empty($extension_setting_description)) { $msg .= $text['message-required']." ".$text['label-extension_setting_description']."<br>\n"; } //if (empty($extension_setting_description)) { $msg .= $text['message-required']." ".$text['label-extension_setting_description']."<br>\n"; }
if (!empty($msg) && empty($_POST["persistformvar"])) { if (!empty($msg) && empty($_POST["persistformvar"])) {
require_once "resources/header.php"; require_once "resources/header.php";
@@ -193,7 +193,7 @@
$sql .= "extension_setting_type, "; $sql .= "extension_setting_type, ";
$sql .= "extension_setting_name, "; $sql .= "extension_setting_name, ";
$sql .= "extension_setting_value, "; $sql .= "extension_setting_value, ";
$sql .= "cast(extension_setting_enabled as text), "; $sql .= "extension_setting_enabled, ";
$sql .= "extension_setting_description "; $sql .= "extension_setting_description ";
$sql .= "from v_extension_settings "; $sql .= "from v_extension_settings ";
$sql .= "where extension_setting_uuid = :extension_setting_uuid "; $sql .= "where extension_setting_uuid = :extension_setting_uuid ";
@@ -216,9 +216,6 @@
unset($sql, $parameters, $row); unset($sql, $parameters, $row);
} }
//set the defaults
if (empty($extension_setting_enabled)) { $extension_setting_enabled = 'true'; }
//create token //create token
$object = new token; $object = new token;
$token = $object->create($_SERVER['PHP_SELF']); $token = $object->create($_SERVER['PHP_SELF']);
@@ -341,17 +338,16 @@
echo " ".$text['label-extension_setting_enabled']."\n"; echo " ".$text['label-extension_setting_enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n"; echo "<td class='vtable' style='position: relative;' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='extension_setting_enabled' name='extension_setting_enabled' value='true' ".($extension_setting_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='extension_setting_enabled' name='extension_setting_enabled'>\n"; echo " <select class='formfld' id='extension_setting_enabled' name='extension_setting_enabled'>\n";
echo " <option value='true' ".($extension_setting_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($extension_setting_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($extension_setting_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($extension_setting_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-extension_setting_enabled']."\n"; echo $text['description-extension_setting_enabled']."\n";

View File

@@ -477,11 +477,11 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "directory_visible"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "directory_visible";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "directory_exten_visible"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "directory_exten_visible";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "max_registrations"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "max_registrations";
@@ -524,7 +524,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "call_screen_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "call_screen_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_record"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "user_record";
@@ -580,7 +580,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "do_not_disturb"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "do_not_disturb";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "forward_all_destination"; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "forward_all_destination";
@@ -589,7 +589,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "forward_all_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "forward_all_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "forward_busy_destination"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "forward_busy_destination";
@@ -597,7 +597,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "forward_busy_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "forward_busy_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "forward_no_answer_destination"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "forward_no_answer_destination";
@@ -605,7 +605,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "forward_no_answer_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "forward_no_answer_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "forward_user_not_registered_destination"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "forward_user_not_registered_destination";
@@ -613,7 +613,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "forward_user_not_registered_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "forward_user_not_registered_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "follow_me_uuid"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "follow_me_uuid";
@@ -625,7 +625,7 @@
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "follow_me_uuid"; $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "follow_me_uuid";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "follow_me_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "follow_me_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "follow_me_destinations"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "follow_me_destinations";
@@ -649,7 +649,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "description"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "description";
@@ -664,7 +664,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "force_ping"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "force_ping";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date";

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -159,7 +159,7 @@
//$device_uuid = $_POST["device_uuid"]; //$device_uuid = $_POST["device_uuid"];
//$device_line = $_POST["device_line"]; //$device_line = $_POST["device_line"];
$voicemail_password = $_POST["voicemail_password"]; $voicemail_password = $_POST["voicemail_password"];
$voicemail_enabled = $_POST["voicemail_enabled"] ?? 'false'; $voicemail_enabled = $_POST["voicemail_enabled"];
$voicemail_mail_to = $_POST["voicemail_mail_to"]; $voicemail_mail_to = $_POST["voicemail_mail_to"];
$voicemail_transcription_enabled = $_POST["voicemail_transcription_enabled"]; $voicemail_transcription_enabled = $_POST["voicemail_transcription_enabled"];
$voicemail_file = $_POST["voicemail_file"]; $voicemail_file = $_POST["voicemail_file"];
@@ -186,7 +186,7 @@
$dial_string = $_POST["dial_string"]; $dial_string = $_POST["dial_string"];
$extension_language = $_POST["extension_language"]; $extension_language = $_POST["extension_language"];
$extension_type = $_POST["extension_type"]; $extension_type = $_POST["extension_type"];
$enabled = $_POST["enabled"] ?? 'false'; $enabled = $_POST["enabled"];
$description = $_POST["description"]; $description = $_POST["description"];
//set defaults //set defaults
@@ -375,9 +375,6 @@
//check for all required data //check for all required data
$msg = ''; $msg = '';
if (empty($extension)) { $msg .= $text['message-required'].$text['label-extension']."<br>\n"; } if (empty($extension)) { $msg .= $text['message-required'].$text['label-extension']."<br>\n"; }
if (permission_exists('extension_enabled')) {
if (empty($enabled)) { $msg .= $text['message-required'].$text['label-enabled']."<br>\n"; }
}
if (!empty($msg) && empty($_POST["persistformvar"])) { if (!empty($msg) && empty($_POST["persistformvar"])) {
require_once "resources/header.php"; require_once "resources/header.php";
require_once "resources/persist_form_var.php"; require_once "resources/persist_form_var.php";
@@ -695,7 +692,7 @@
if (!empty($device_templates[$d])) { if (!empty($device_templates[$d])) {
$array["devices"][$j]["device_template"] = $device_templates[$d]; $array["devices"][$j]["device_template"] = $device_templates[$d];
} }
$array["devices"][$j]["device_enabled"] = "true"; $array["devices"][$j]["device_enabled"] = true;
$array["devices"][$j]["device_lines"][0]["device_uuid"] = $device_uuids[$d]; $array["devices"][$j]["device_lines"][0]["device_uuid"] = $device_uuids[$d];
$array["devices"][$j]["device_lines"][0]["device_line_uuid"] = uuid(); $array["devices"][$j]["device_lines"][0]["device_line_uuid"] = uuid();
$array["devices"][$j]["device_lines"][0]["domain_uuid"] = $domain_uuid; $array["devices"][$j]["device_lines"][0]["domain_uuid"] = $domain_uuid;
@@ -754,7 +751,7 @@
//if voicemail_uuid does not exist then get a new uuid //if voicemail_uuid does not exist then get a new uuid
if (!is_uuid($voicemail_uuid)) { if (!is_uuid($voicemail_uuid)) {
$voicemail_uuid = uuid(); $voicemail_uuid = uuid();
$voicemail_tutorial = 'true'; $voicemail_tutorial = true;
//if adding a mailbox and don't have the transcription permission, set the default transcribe behavior //if adding a mailbox and don't have the transcription permission, set the default transcribe behavior
if (!permission_exists('voicemail_transcription_enabled')) { if (!permission_exists('voicemail_transcription_enabled')) {
$voicemail_transcription_enabled = $voicemail_transcription_enabled_default; $voicemail_transcription_enabled = $voicemail_transcription_enabled_default;
@@ -1021,7 +1018,7 @@
//get the device vendors //get the device vendors
$sql = "select name "; $sql = "select name ";
$sql .= "from v_device_vendors "; $sql .= "from v_device_vendors ";
$sql .= "where enabled = 'true' "; $sql .= "where enabled = true ";
$sql .= "order by name asc "; $sql .= "order by name asc ";
$device_vendors = $database->select($sql, null, 'all'); $device_vendors = $database->select($sql, null, 'all');
unset($sql); unset($sql);
@@ -1031,7 +1028,7 @@
$sql = "select u.username, e.user_uuid "; $sql = "select u.username, e.user_uuid ";
$sql .= "from v_extension_users as e, v_users as u "; $sql .= "from v_extension_users as e, v_users as u ";
$sql .= "where e.user_uuid = u.user_uuid "; $sql .= "where e.user_uuid = u.user_uuid ";
$sql .= "and u.user_enabled = 'true' "; $sql .= "and u.user_enabled = true ";
$sql .= "and e.domain_uuid = :domain_uuid "; $sql .= "and e.domain_uuid = :domain_uuid ";
$sql .= "and e.extension_uuid = :extension_uuid "; $sql .= "and e.extension_uuid = :extension_uuid ";
$sql .= "order by u.username asc "; $sql .= "order by u.username asc ";
@@ -1055,7 +1052,7 @@
$parameters['user_uuid_'.$index] = $assigned_user_uuid; $parameters['user_uuid_'.$index] = $assigned_user_uuid;
} }
} }
$sql .= "and user_enabled = 'true' "; $sql .= "and user_enabled = true ";
$sql .= "order by username asc "; $sql .= "order by username asc ";
$parameters['domain_uuid'] = $domain_uuid; $parameters['domain_uuid'] = $domain_uuid;
$users = $database->select($sql, $parameters, 'all'); $users = $database->select($sql, $parameters, 'all');
@@ -1099,18 +1096,27 @@
} }
} }
//set the defaults //set the defaults - extension
if (empty($user_context)) { $user_context = $domain_name; } if (empty($user_context)) { $user_context = $domain_name; }
if (empty($max_registrations)) { $max_registrations = $extension_max_registrations ?? ''; } if (empty($max_registrations)) { $max_registrations = $extension_max_registrations ?? ''; }
if (empty($accountcode)) { $accountcode = get_accountcode(); } if (empty($accountcode)) { $accountcode = get_accountcode(); }
if (empty($limit_max)) { $limit_max = $extension_limit_max; } if (empty($limit_max)) { $limit_max = $extension_limit_max; }
if (empty($limit_destination)) { $limit_destination = '!USER_BUSY'; } if (empty($limit_destination)) { $limit_destination = '!USER_BUSY'; }
if (empty($call_timeout)) { $call_timeout = $extension_call_timeout; } if (empty($call_timeout)) { $call_timeout = $extension_call_timeout; }
if (empty($call_screen_enabled)) { $call_screen_enabled = 'false'; }
if (empty($user_record)) { $user_record = $extension_user_record_default; } if (empty($user_record)) { $user_record = $extension_user_record_default; }
if (empty($voicemail_transcription_enabled)) { $voicemail_transcription_enabled = $voicemail_transcription_enabled_default; } if (!isset($directory_visible)) { $directory_visible = false; }
if (empty($voicemail_enabled)) { $voicemail_enabled = $voicemail_enabled_default; } if (!isset($directory_exten_visible)) { $directory_exten_visible = false; }
if (empty($enabled)) { $enabled = 'true'; } if (!isset($call_screen_enabled)) { $call_screen_enabled = false; }
if (!isset($force_ping)) { $force_ping = false; }
if (!isset($enabled)) { $enabled = true; }
//set the defaults - voicemail
if (!isset($voicemail_local_after_email)) { $voicemail_local_after_email = $settings->get('voicemail','keep_local', true); }
if (!isset($voicemail_enabled)) { $voicemail_enabled = $settings->get('voicemail', 'enabled_default', true); }
if (!isset($voicemail_transcription_enabled)) { $voicemail_transcription_enabled = $settings->get('voicemail', 'transcription_enabled_default', false); }
if (!isset($voicemail_tutorial)) { $voicemail_tutorial = false; }
if (!isset($voicemail_recording_instructions)) { $voicemail_recording_instructions = true; }
if (!isset($voicemail_recording_options)) { $voicemail_recording_options = true; }
//create token //create token
$object = new token; $object = new token;
@@ -1714,17 +1720,16 @@
echo " ".$text['label-directory_visible']."\n"; echo " ".$text['label-directory_visible']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='directory_visible' name='directory_visible' value='true' ".($directory_visible == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='directory_visible' name='directory_visible'>\n"; echo " <select class='formfld' id='directory_visible' name='directory_visible'>\n";
echo " <option value='true' ".($directory_visible == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($directory_visible === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($directory_visible == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($directory_visible === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-directory_visible']."\n"; echo $text['description-directory_visible']."\n";
@@ -1736,17 +1741,16 @@
echo " ".$text['label-directory_exten_visible']."\n"; echo " ".$text['label-directory_exten_visible']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='directory_exten_visible' name='directory_exten_visible' value='true' ".($directory_exten_visible == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='directory_exten_visible' name='directory_exten_visible'>\n"; echo " <select class='formfld' id='directory_exten_visible' name='directory_exten_visible'>\n";
echo " <option value='true' ".($directory_exten_visible == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($directory_exten_visible === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($directory_exten_visible == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($directory_exten_visible === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-directory_exten_visible']."\n"; echo $text['description-directory_exten_visible']."\n";
@@ -1797,17 +1801,16 @@
echo " ".$text['label-voicemail_enabled']."\n"; echo " ".$text['label-voicemail_enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='voicemail_enabled' name='voicemail_enabled' value='true' ".($voicemail_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='voicemail_enabled' name='voicemail_enabled'>\n"; echo " <select class='formfld' id='voicemail_enabled' name='voicemail_enabled'>\n";
echo " <option value='true' ".($voicemail_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($voicemail_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($voicemail_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($voicemail_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-voicemail_enabled']."\n"; echo $text['description-voicemail_enabled']."\n";
@@ -1831,17 +1834,16 @@
echo " ".$text['label-voicemail_transcription_enabled']."\n"; echo " ".$text['label-voicemail_transcription_enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='voicemail_transcription_enabled' name='voicemail_transcription_enabled' value='true' ".($voicemail_transcription_enabled == true ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span> \n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='voicemail_transcription_enabled' name='voicemail_transcription_enabled'>\n"; echo " <select class='formfld' id='voicemail_transcription_enabled' name='voicemail_transcription_enabled'>\n";
echo " <option value='true'>".$text['option-true']."</option>\n"; echo " <option value='true' ".($voicemail_transcription_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($voicemail_transcription_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($voicemail_transcription_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-voicemail_transcription_enabled']."\n"; echo $text['description-voicemail_transcription_enabled']."\n";
@@ -1872,17 +1874,16 @@
echo " ".$text['label-voicemail_local_after_email']."\n"; echo " ".$text['label-voicemail_local_after_email']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='voicemail_local_after_email' name='voicemail_local_after_email' value='true' ".($voicemail_local_after_email == 'true' ? "checked='checked'" : null)." onchange=\"if (!this.checked) { document.getElementById('voicemail_file').selectedIndex = 2; }\">\n";
echo " <span class='slider'></span> \n";
echo " </label>\n";
} }
else { echo " <select class='formfld' id='voicemail_local_after_email' name='voicemail_local_after_email'>\n";
echo " <select class='formfld' id='voicemail_local_after_email' name='voicemail_local_after_email' onchange=\"if (this.selectedIndex == 1) { document.getElementById('voicemail_file').selectedIndex = 2; }\">\n"; echo " <option value='true' ".($voicemail_local_after_email === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='true'>".$text['option-true']."</option>\n"; echo " <option value='false' ".($voicemail_local_after_email === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='false' ".($voicemail_local_after_email == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-voicemail_local_after_email']."\n"; echo $text['description-voicemail_local_after_email']."\n";
@@ -1984,21 +1985,17 @@
echo " ".$text['label-call_screen_enabled']."\n"; echo " ".$text['label-call_screen_enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='call_screen_enabled'>\n"; if ($input_toggle_style_switch) {
echo " <option value=''></option>\n"; echo " <span class='switch'>\n";
if ($call_screen_enabled == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($call_screen_enabled == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
} }
echo " <select class='formfld' id='call_screen_enabled' name='call_screen_enabled'>\n";
echo " <option value='true' ".($call_screen_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($call_screen_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
}
echo "<br />\n"; echo "<br />\n";
echo $text['description-call_screen_enabled']."\n"; echo $text['description-call_screen_enabled']."\n";
echo "</td>\n"; echo "</td>\n";
@@ -2283,11 +2280,17 @@
echo " ".$text['label-force_ping']."\n"; echo " ".$text['label-force_ping']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='force_ping'>\n"; if ($input_toggle_style_switch) {
echo " <option value=''></option>\n"; echo " <span class='switch'>\n";
echo " <option value='true' ".(!empty($force_ping) && $force_ping == "true" ? "selected='selected'" : null).">".$text['label-true']."</option>\n"; }
echo " <option value='false' ".(!empty($force_ping) && $force_ping == "false" ? "selected='selected'" : null).">".$text['label-false']."</option>\n"; echo " <select class='formfld' id='force_ping' name='force_ping'>\n";
echo " <option value='true' ".($force_ping === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($force_ping === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
}
echo "<br />\n"; echo "<br />\n";
echo $text['description-force_ping']."\n"; echo $text['description-force_ping']."\n";
echo "</td>\n"; echo "</td>\n";
@@ -2322,17 +2325,16 @@
echo " ".$text['label-enabled']."\n"; echo " ".$text['label-enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='enabled' name='enabled' value='true' ".($enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='enabled' name='enabled'>\n"; echo " <select class='formfld' id='enabled' name='enabled'>\n";
echo " <option value='true' ".($enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-enabled']."\n"; echo $text['description-enabled']."\n";

View File

@@ -147,7 +147,66 @@
$offset = $rows_per_page * $page; $offset = $rows_per_page * $page;
//get the extensions //get the extensions
$sql = "select e.*, "; $sql = "select ";
$sql .= "e.extension_uuid, ";
$sql .= "e.domain_uuid, ";
$sql .= "e.extension, ";
$sql .= "e.number_alias, ";
$sql .= "e.password, ";
$sql .= "e.accountcode, ";
$sql .= "e.effective_caller_id_name, ";
$sql .= "e.effective_caller_id_number, ";
$sql .= "e.outbound_caller_id_name, ";
$sql .= "e.outbound_caller_id_number, ";
$sql .= "e.emergency_caller_id_name, ";
$sql .= "e.emergency_caller_id_number, ";
$sql .= "e.directory_first_name, ";
$sql .= "e.directory_last_name, ";
$sql .= "e.directory_visible, ";
$sql .= "e.directory_exten_visible, ";
$sql .= "e.limit_max, ";
$sql .= "e.limit_destination, ";
$sql .= "e.missed_call_app, ";
$sql .= "e.missed_call_data, ";
$sql .= "e.user_context, ";
$sql .= "e.toll_allow, ";
$sql .= "e.call_timeout, ";
$sql .= "e.call_group, ";
$sql .= "e.call_screen_enabled, ";
$sql .= "e.user_record, ";
$sql .= "e.hold_music, ";
$sql .= "e.auth_acl, ";
$sql .= "e.cidr, ";
$sql .= "e.sip_force_contact, ";
$sql .= "e.nibble_account, ";
$sql .= "e.sip_force_expires, ";
$sql .= "e.mwi_account, ";
$sql .= "e.sip_bypass_media, ";
$sql .= "e.unique_id, ";
$sql .= "e.dial_string, ";
$sql .= "e.dial_user, ";
$sql .= "e.dial_domain, ";
$sql .= "e.do_not_disturb, ";
$sql .= "e.forward_all_destination, ";
$sql .= "e.forward_all_enabled, ";
$sql .= "e.forward_busy_destination, ";
$sql .= "e.forward_busy_enabled, ";
$sql .= "e.forward_no_answer_destination, ";
$sql .= "e.forward_no_answer_enabled, ";
$sql .= "e.forward_user_not_registered_destination, ";
$sql .= "e.forward_user_not_registered_enabled, ";
$sql .= "e.follow_me_uuid, ";
$sql .= "e.follow_me_enabled, ";
$sql .= "e.follow_me_destinations, ";
$sql .= "cast(e.enabled as text), ";
$sql .= "e.description, ";
$sql .= "e.absolute_codec_string, ";
$sql .= "e.force_ping, ";
$sql .= "e.max_registrations, ";
$sql .= "e.extension_type, ";
$sql .= "e.extension_language, ";
$sql .= "e.extension_dialect, ";
$sql .= "e.extension_voice, ";
$sql .= "( "; $sql .= "( ";
$sql .= " select device_uuid "; $sql .= " select device_uuid ";
$sql .= " from v_device_lines "; $sql .= " from v_device_lines ";
@@ -202,7 +261,6 @@
$sql .= " or lower(call_group) like :search "; $sql .= " or lower(call_group) like :search ";
} }
$sql .= " or lower(user_context) like :search "; $sql .= " or lower(user_context) like :search ";
$sql .= " or lower(enabled) like :search ";
$sql .= " or lower(description) like :search "; $sql .= " or lower(description) like :search ";
$sql .= ") "; $sql .= ") ";
$parameters['search'] = '%'.$search.'%'; $parameters['search'] = '%'.$search.'%';

View File

@@ -598,7 +598,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enable SSL or TLS encryption."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enable SSL or TLS encryption.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "fax_email_connection_validate"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "fax_email_connection_validate";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Validate certificate or not."; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Validate certificate or not.";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "fax_email_connection_username"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "fax_email_connection_username";

View File

@@ -287,10 +287,21 @@
echo " ".$text['label-email_connection_validate']."\n"; echo " ".$text['label-email_connection_validate']."\n";
echo " </td>\n"; echo " </td>\n";
echo " <td class='vtable' align='left'>\n"; echo " <td class='vtable' align='left'>\n";
echo " <select class='formfld' name='fax_email_connection_validate'>\n"; if ($input_toggle_style_switch) {
echo " <option value='true'>".$text['option-true']."</option>\n"; echo " <span class='switch'>\n";
echo " <option value='false' ".(!empty($fax_email_connection_validate) && $fax_email_connection_validate == 'false' ? "selected" : null).">".$text['option-false']."</option>\n"; }
echo " <select class='formfld' id='fax_email_connection_validate' name='fax_email_connection_validate'>\n";
echo " <option value='true' ".($fax_email_connection_validate === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($fax_email_connection_validate === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
}
// echo " <select class='formfld' name='fax_email_connection_validate'>\n";
// echo " <option value='true'>".$text['option-true']."</option>\n";
// echo " <option value='false' ".(!empty($fax_email_connection_validate) && $fax_email_connection_validate == 'false' ? "selected" : null).">".$text['option-false']."</option>\n";
// echo " </select>\n";
echo " <br />\n"; echo " <br />\n";
echo " ".$text['description-email_connection_validate']."\n"; echo " ".$text['description-email_connection_validate']."\n";
echo " </td>\n"; echo " </td>\n";

View File

@@ -195,7 +195,7 @@ if (!function_exists('fax_split_dtmf')) {
$sql = "select domain_enabled::text from v_domains where domain_uuid = :domain_uuid "; $sql = "select domain_enabled::text from v_domains where domain_uuid = :domain_uuid ";
$parameters['domain_uuid'] = $domain_uuid; $parameters['domain_uuid'] = $domain_uuid;
$row = $database->select($sql, $parameters, 'row'); $row = $database->select($sql, $parameters, 'row');
if ($row['domain_enabled'] == "true") { if ($row['domain_enabled']) {
$domain_enabled = true; $domain_enabled = true;
} }
else { else {
@@ -732,7 +732,7 @@ if (!function_exists('fax_split_dtmf')) {
$sql .= " and domain_uuid = :domain_uuid "; $sql .= " and domain_uuid = :domain_uuid ";
$sql .= ") "; $sql .= ") ";
$sql .= "and dialplan_detail_data like 'provider_prefix%' "; $sql .= "and dialplan_detail_data like 'provider_prefix%' ";
$sql .= "and dialplan_detail_enabled = 'true' "; $sql .= "and dialplan_detail_enabled = true ";
$parameters['domain_uuid'] = $domain_uuid; $parameters['domain_uuid'] = $domain_uuid;
$row = $database->select($sql, $parameters, 'row'); $row = $database->select($sql, $parameters, 'row');
$dialplan_detail_data = $row["dialplan_detail_data"]; $dialplan_detail_data = $row["dialplan_detail_data"];

View File

@@ -164,10 +164,10 @@
$dialplan["dialplan_name"] = ($this->fax_name != '') ? $this->fax_name : format_phone($this->destination_number); $dialplan["dialplan_name"] = ($this->fax_name != '') ? $this->fax_name : format_phone($this->destination_number);
$dialplan["dialplan_number"] = $this->fax_extension; $dialplan["dialplan_number"] = $this->fax_extension;
$dialplan["dialplan_context"] = $_SESSION['domain_name']; $dialplan["dialplan_context"] = $_SESSION['domain_name'];
$dialplan["dialplan_continue"] = "false"; $dialplan["dialplan_continue"] = false;
$dialplan["dialplan_xml"] = $dialplan_xml; $dialplan["dialplan_xml"] = $dialplan_xml;
$dialplan["dialplan_order"] = "40"; $dialplan["dialplan_order"] = "40";
$dialplan["dialplan_enabled"] = "true"; $dialplan["dialplan_enabled"] = true;
$dialplan["dialplan_description"] = $this->fax_description; $dialplan["dialplan_description"] = $this->fax_description;
$dialplan_detail_order = 10; $dialplan_detail_order = 10;

View File

@@ -242,7 +242,7 @@
$sql .= " and domain_uuid = :domain_uuid "; $sql .= " and domain_uuid = :domain_uuid ";
$sql .= ") "; $sql .= ") ";
$sql .= "and dialplan_detail_data like 'provider_prefix%' "; $sql .= "and dialplan_detail_data like 'provider_prefix%' ";
$sql .= "and dialplan_detail_enabled = 'true' "; $sql .= "and dialplan_detail_enabled = true ";
$parameters['domain_uuid'] = $domain_uuid; $parameters['domain_uuid'] = $domain_uuid;
$row = $database->select($sql, $parameters, 'row'); $row = $database->select($sql, $parameters, 'row');
$dialplan_detail_data = $row["dialplan_detail_data"]; $dialplan_detail_data = $row["dialplan_detail_data"];
@@ -490,7 +490,7 @@
$sql .= "and template_language = :template_language "; $sql .= "and template_language = :template_language ";
$sql .= "and template_category = :template_category "; $sql .= "and template_category = :template_category ";
$sql .= "and template_type = :template_type "; $sql .= "and template_type = :template_type ";
$sql .= "and template_enabled = 'true' "; $sql .= "and template_enabled = true ";
$parameters['domain_uuid'] = $domain_uuid; $parameters['domain_uuid'] = $domain_uuid;
$parameters['template_language'] = $language_code; $parameters['template_language'] = $language_code;
$parameters['template_category'] = 'fax'; $parameters['template_category'] = 'fax';

View File

@@ -36,7 +36,7 @@
$apps[$x]['destinations'][$y]['label'] = "fifo"; $apps[$x]['destinations'][$y]['label'] = "fifo";
$apps[$x]['destinations'][$y]['name'] = "fifo"; $apps[$x]['destinations'][$y]['name'] = "fifo";
$apps[$x]['destinations'][$y]['sql'] = "select fifo_uuid as uuid, fifo_name as name, fifo_extension as extension, fifo_enabled from v_fifo "; $apps[$x]['destinations'][$y]['sql'] = "select fifo_uuid as uuid, fifo_name as name, fifo_extension as extension, fifo_enabled from v_fifo ";
$apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and fifo_enabled = 'true' "; $apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and fifo_enabled = true ";
$apps[$x]['destinations'][$y]['order_by'] = "natural_sort(fifo_extension) asc"; $apps[$x]['destinations'][$y]['order_by'] = "natural_sort(fifo_extension) asc";
$apps[$x]['destinations'][$y]['field']['uuid'] = "uuid"; $apps[$x]['destinations'][$y]['field']['uuid'] = "uuid";
$apps[$x]['destinations'][$y]['field']['name'] = "name"; $apps[$x]['destinations'][$y]['field']['name'] = "name";

View File

@@ -80,7 +80,7 @@
$fifo_music = $_POST["fifo_music"]; $fifo_music = $_POST["fifo_music"];
$domain_uuid = $_POST["domain_uuid"]; $domain_uuid = $_POST["domain_uuid"];
$fifo_order = $_POST["fifo_order"]; $fifo_order = $_POST["fifo_order"];
$fifo_enabled = $_POST["fifo_enabled"] ?? 'false'; $fifo_enabled = $_POST["fifo_enabled"];
$fifo_description = $_POST["fifo_description"]; $fifo_description = $_POST["fifo_description"];
} }
@@ -102,7 +102,7 @@
$x = 0; $x = 0;
if (is_array($_POST['fifo_members'])) { if (is_array($_POST['fifo_members'])) {
foreach ($_POST['fifo_members'] as $row) { foreach ($_POST['fifo_members'] as $row) {
if (is_uuid($row['fifo_member_uuid']) && $row['checked'] === 'true') { if (is_uuid($row['fifo_member_uuid']) && $row['checked'] == 'true') {
$array['fifo'][$x]['checked'] = $row['checked']; $array['fifo'][$x]['checked'] = $row['checked'];
$array['fifo'][$x]['fifo_members'][]['fifo_member_uuid'] = $row['fifo_member_uuid']; $array['fifo'][$x]['fifo_members'][]['fifo_member_uuid'] = $row['fifo_member_uuid'];
$x++; $x++;
@@ -152,7 +152,7 @@
$fifo_members[$i]['member_contact'] = preg_replace('#[^a-zA-Z0-9/@.\-\*]#', '', $row["member_contact"] ?? ''); $fifo_members[$i]['member_contact'] = preg_replace('#[^a-zA-Z0-9/@.\-\*]#', '', $row["member_contact"] ?? '');
$fifo_members[$i]['member_call_timeout'] = preg_replace('#[^0-9]#', '', $row["member_call_timeout"] ?? '20'); $fifo_members[$i]['member_call_timeout'] = preg_replace('#[^0-9]#', '', $row["member_call_timeout"] ?? '20');
$fifo_members[$i]['member_wrap_up_time'] = preg_replace('#[^0-9]#', '', $row["member_wrap_up_time"] ?? '10'); $fifo_members[$i]['member_wrap_up_time'] = preg_replace('#[^0-9]#', '', $row["member_wrap_up_time"] ?? '10');
$fifo_members[$i]['member_enabled'] = $row["member_enabled"] ?? 'false'; $fifo_members[$i]['member_enabled'] = $row["member_enabled"];
$i++; $i++;
} }
} }
@@ -227,7 +227,7 @@
$array['fifo'][0]['fifo_members'][$y]['member_call_timeout'] = $row["member_call_timeout"] ?? '20'; $array['fifo'][0]['fifo_members'][$y]['member_call_timeout'] = $row["member_call_timeout"] ?? '20';
//$array['fifo'][0]['fifo_members'][$y]['member_simultaneous'] = $row["member_simultaneous"]; //$array['fifo'][0]['fifo_members'][$y]['member_simultaneous'] = $row["member_simultaneous"];
$array['fifo'][0]['fifo_members'][$y]['member_wrap_up_time'] = $row["member_wrap_up_time"] ?? '10'; $array['fifo'][0]['fifo_members'][$y]['member_wrap_up_time'] = $row["member_wrap_up_time"] ?? '10';
$array['fifo'][0]['fifo_members'][$y]['member_enabled'] = $row["member_enabled"] ?? 'false'; $array['fifo'][0]['fifo_members'][$y]['member_enabled'] = $row["member_enabled"];
$y++; $y++;
} }
} }
@@ -397,7 +397,7 @@
$sql .= " fifo_music, "; $sql .= " fifo_music, ";
$sql .= " domain_uuid, "; $sql .= " domain_uuid, ";
$sql .= " fifo_order, "; $sql .= " fifo_order, ";
$sql .= " cast(fifo_enabled as text), "; $sql .= " fifo_enabled, ";
$sql .= " fifo_description "; $sql .= " fifo_description ";
$sql .= "from v_fifo "; $sql .= "from v_fifo ";
$sql .= "where fifo_uuid = :fifo_uuid "; $sql .= "where fifo_uuid = :fifo_uuid ";
@@ -434,7 +434,7 @@
$sql .= " member_call_timeout, "; $sql .= " member_call_timeout, ";
//$sql .= " member_simultaneous, "; //$sql .= " member_simultaneous, ";
$sql .= " member_wrap_up_time, "; $sql .= " member_wrap_up_time, ";
$sql .= " cast(member_enabled as text) "; $sql .= " member_enabled ";
$sql .= "from v_fifo_members "; $sql .= "from v_fifo_members ";
$sql .= "where fifo_uuid = :fifo_uuid "; $sql .= "where fifo_uuid = :fifo_uuid ";
//$sql .= "and domain_uuid = '".$domain_uuid."' "; //$sql .= "and domain_uuid = '".$domain_uuid."' ";
@@ -477,7 +477,7 @@
$fifo_members[$id]['member_call_timeout'] = ''; $fifo_members[$id]['member_call_timeout'] = '';
//$fifo_members[$id]['member_simultaneous'] = ''; //$fifo_members[$id]['member_simultaneous'] = '';
$fifo_members[$id]['member_wrap_up_time'] = ''; $fifo_members[$id]['member_wrap_up_time'] = '';
$fifo_members[$id]['member_enabled'] = ''; $fifo_members[$id]['member_enabled'] = false;
$id++; $id++;
} }
@@ -495,9 +495,6 @@
if (empty($fifo_order)) { if (empty($fifo_order)) {
$fifo_order = 50; $fifo_order = 50;
} }
if (empty($fifo_enabled)) {
$fifo_enabled = true;
}
//show the header //show the header
$document['title'] = $text['title-fifo']; $document['title'] = $text['title-fifo'];
@@ -629,32 +626,31 @@
echo " <td class='formfld'>\n"; echo " <td class='formfld'>\n";
echo " $member_contact\n"; echo " $member_contact\n";
echo " </td>\n"; echo " </td>\n";
echo " <td class='formfld'>\n"; echo " <td class='formfld text-center'>\n";
echo " <input class='formfld' type='text' name='fifo_members[$x][member_call_timeout]' maxlength='255' style='width:55px;' value=\"".escape($row["member_call_timeout"])."\">\n"; echo " <input class='formfld' type='text' name='fifo_members[$x][member_call_timeout]' maxlength='255' style='width:55px;' value=\"".escape($row["member_call_timeout"])."\">\n";
echo " </td>\n"; echo " </td>\n";
//echo " <td class='formfld'>\n"; //echo " <td class='formfld'>\n";
//echo " <input class='formfld' type='text' name='fifo_members[$x][member_simultaneous]' maxlength='255' style='width:55px;' value=\"".escape($row["member_simultaneous"])."\">\n"; //echo " <input class='formfld' type='text' name='fifo_members[$x][member_simultaneous]' maxlength='255' style='width:55px;' value=\"".escape($row["member_simultaneous"])."\">\n";
//echo " </td>\n"; //echo " </td>\n";
echo " <td class='formfld'>\n"; echo " <td class='formfld text-center'>\n";
echo " <input class='formfld' type='text' name='fifo_members[$x][member_wrap_up_time]' maxlength='255' style='width:55px;' value=\"".escape($row["member_wrap_up_time"])."\">\n"; echo " <input class='formfld' type='text' name='fifo_members[$x][member_wrap_up_time]' maxlength='255' style='width:55px;' value=\"".escape($row["member_wrap_up_time"])."\">\n";
echo " </td>\n"; echo " </td>\n";
echo " <td class='formfld'>\n"; echo " <td class='formfld'>\n";
if (substr($input_toggle_style, 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='member_enabled' name='fifo_members[$x][member_enabled]' value='true' ".($row['member_enabled'] == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='member_enabled' name='fifo_members[$x][member_enabled]'>\n"; echo " <select class='formfld' id='member_enabled' name='fifo_members[$x][member_enabled]'>\n";
echo " <option value='true' ".($row['member_enabled'] == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($row['member_enabled'] === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($row['$member_enabled'] == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($row['member_enabled'] === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo " </td>\n"; echo " </td>\n";
if ($show_option_delete && is_array($fifo_members) && @sizeof($fifo_members) > 1 && permission_exists('fifo_member_delete')) { if ($show_option_delete && is_array($fifo_members) && @sizeof($fifo_members) > 1 && permission_exists('fifo_member_delete')) {
if (is_uuid($row['fifo_member_uuid'])) { if (!empty($row['member_contact'])) {
echo " <td class='vtable' style='text-align: center; padding-bottom: 3px;'>\n"; echo " <td style='text-align: center; padding-bottom: 3px;'>\n";
echo " <input type='checkbox' name='fifo_members[".$x."][checked]' value='true' class='chk_delete checkbox_details' onclick=\"checkbox_on_change(this);\">\n"; echo " <input type='checkbox' name='fifo_members[".$x."][checked]' value='true' class='chk_delete checkbox_details' onclick=\"checkbox_on_change(this);\">\n";
echo " </td>\n"; echo " </td>\n";
} }
@@ -775,17 +771,16 @@
echo " ".$text['label-fifo_enabled']."\n"; echo " ".$text['label-fifo_enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n"; echo "<td class='vtable' style='position: relative;' align='left'>\n";
if (substr($input_toggle_style, 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='fifo_enabled' name='fifo_enabled' value='true' ".(!empty($fifo_enabled) && $fifo_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='fifo_enabled' name='fifo_enabled'>\n"; echo " <select class='formfld' id='fifo_enabled' name='fifo_enabled'>\n";
echo " <option value='true' ".($fifo_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($fifo_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($fifo_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($fifo_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-fifo_enabled']."\n"; echo $text['description-fifo_enabled']."\n";

View File

@@ -149,11 +149,11 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "follow_me_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "follow_me_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "follow_me_ignore_busy"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "follow_me_ignore_busy";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date";

View File

@@ -37,7 +37,7 @@
$apps[$x]['destinations'][$y]['name'] = "gateways"; $apps[$x]['destinations'][$y]['name'] = "gateways";
$apps[$x]['destinations'][$y]['sql'] = "select g.gateway_uuid as destination, g.gateway as name, d.domain_name from v_gateways as g "; $apps[$x]['destinations'][$y]['sql'] = "select g.gateway_uuid as destination, g.gateway as name, d.domain_name from v_gateways as g ";
$apps[$x]['destinations'][$y]['sql'] .= "inner join v_domains as d on g.domain_uuid = d.domain_uuid "; $apps[$x]['destinations'][$y]['sql'] .= "inner join v_domains as d on g.domain_uuid = d.domain_uuid ";
$apps[$x]['destinations'][$y]['where'] = "where g.domain_uuid = '\${domain_uuid}' and g.enabled = 'true' "; $apps[$x]['destinations'][$y]['where'] = "where g.domain_uuid = '\${domain_uuid}' and g.enabled = true ";
$apps[$x]['destinations'][$y]['order_by'] = "gateway asc"; $apps[$x]['destinations'][$y]['order_by'] = "gateway asc";
$apps[$x]['destinations'][$y]['field']['name'] = "gateway"; $apps[$x]['destinations'][$y]['field']['name'] = "gateway";
$apps[$x]['destinations'][$y]['field']['destination'] = "gateway_uuid"; $apps[$x]['destinations'][$y]['field']['destination'] = "gateway_uuid";
@@ -129,7 +129,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "distinct_to"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "distinct_to";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "auth_username"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "auth_username";
@@ -171,7 +171,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "register"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "register";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "register_transport"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "register_transport";
@@ -203,15 +203,15 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "contact_in_ping"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "contact_in_ping";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "caller_id_in_from"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "caller_id_in_from";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "supress_cng"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "supress_cng";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "sip_cid_type"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "sip_cid_type";
@@ -244,7 +244,7 @@
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(255)"; $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(255)";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "description"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "description";

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2018 Portions created by the Initial Developer are Copyright (C) 2008-2025
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -65,16 +65,19 @@
$register_proxy = $row["register_proxy"]; $register_proxy = $row["register_proxy"];
$outbound_proxy = $row["outbound_proxy"]; $outbound_proxy = $row["outbound_proxy"];
$expire_seconds = $row["expire_seconds"]; $expire_seconds = $row["expire_seconds"];
$register = $row["register"]; $register = $row["register"] ?? false;
$register_transport = $row["register_transport"]; $register_transport = $row["register_transport"];
$contact_params = $row["contact_params"]; $contact_params = $row["contact_params"];
$retry_seconds = $row["retry_seconds"]; $retry_seconds = $row["retry_seconds"];
$extension = $row["extension"]; $extension = $row["extension"];
$codec_prefs = $row["codec_prefs"]; $codec_prefs = $row["codec_prefs"];
$ping = $row["ping"]; $ping = $row["ping"];
$channels = $row["channels"]; $ping_min = $row["ping_min"];
$caller_id_in_from = $row["caller_id_in_from"]; $ping_max = $row["ping_max"];
$supress_cng = $row["supress_cng"]; $contact_in_ping = $row["contact_in_ping"] ?? false;
// $channels = $row["channels"];
$caller_id_in_from = $row["caller_id_in_from"] ?? false;
$supress_cng = $row["supress_cng"] ?? false;
$sip_cid_type = $row["sip_cid_type"]; $sip_cid_type = $row["sip_cid_type"];
$extension_in_contact = $row["extension_in_contact"]; $extension_in_contact = $row["extension_in_contact"];
$effective_caller_id_name = $row["effective_caller_id_name"]; $effective_caller_id_name = $row["effective_caller_id_name"];
@@ -83,7 +86,7 @@
$outbound_caller_id_number = $row["outbound_caller_id_number"]; $outbound_caller_id_number = $row["outbound_caller_id_number"];
$context = $row["context"]; $context = $row["context"];
$profile = $row["profile"]; $profile = $row["profile"];
$enabled = $row["enabled"]; $enabled = $row["enabled"] ?? false;
$description = $row["description"]." (".$text['label-copy'].")"; $description = $row["description"]." (".$text['label-copy'].")";
} }
unset($sql, $parameters, $row); unset($sql, $parameters, $row);
@@ -118,6 +121,9 @@
$array['gateways'][0]['extension'] = $extension; $array['gateways'][0]['extension'] = $extension;
$array['gateways'][0]['codec_prefs'] = $codec_prefs; $array['gateways'][0]['codec_prefs'] = $codec_prefs;
$array['gateways'][0]['ping'] = $ping; $array['gateways'][0]['ping'] = $ping;
$array['gateways'][0]['ping_min'] = $ping_min;
$array['gateways'][0]['ping_max'] = $ping_max;
$array['gateways'][0]['contact_in_ping'] = $contact_in_ping;
//$array['gateways'][0]['channels'] = $channels; //$array['gateways'][0]['channels'] = $channels;
$array['gateways'][0]['caller_id_in_from'] = $caller_id_in_from; $array['gateways'][0]['caller_id_in_from'] = $caller_id_in_from;
$array['gateways'][0]['supress_cng'] = $supress_cng; $array['gateways'][0]['supress_cng'] = $supress_cng;
@@ -135,7 +141,7 @@
unset($array); unset($array);
//add new gateway to session variable //add new gateway to session variable
if ($enabled == 'true') { if ($enabled == true) {
$_SESSION['gateways'][$gateway_uuid] = $gateway; $_SESSION['gateways'][$gateway_uuid] = $gateway;
} }

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -88,7 +88,7 @@
$register_proxy = $_POST["register_proxy"]; $register_proxy = $_POST["register_proxy"];
$outbound_proxy = $_POST["outbound_proxy"]; $outbound_proxy = $_POST["outbound_proxy"];
$expire_seconds = $_POST["expire_seconds"]; $expire_seconds = $_POST["expire_seconds"];
$register = $_POST["register"] ?? 'false'; $register = $_POST["register"];
$register_transport = $_POST["register_transport"]; $register_transport = $_POST["register_transport"];
$contact_params = $_POST["contact_params"]; $contact_params = $_POST["contact_params"];
$retry_seconds = $_POST["retry_seconds"]; $retry_seconds = $_POST["retry_seconds"];
@@ -106,7 +106,7 @@
$context = $_POST["context"]; $context = $_POST["context"];
$profile = $_POST["profile"]; $profile = $_POST["profile"];
$hostname = $_POST["hostname"]; $hostname = $_POST["hostname"];
$enabled = $_POST["enabled"] ?? 'false'; $enabled = $_POST["enabled"];
$description = $_POST["description"]; $description = $_POST["description"];
} }
@@ -129,7 +129,7 @@
//check for all required data //check for all required data
$msg = ''; $msg = '';
if (empty($gateway)) { $msg .= $text['message-required']." ".$text['label-gateway']."<br>\n"; } if (empty($gateway)) { $msg .= $text['message-required']." ".$text['label-gateway']."<br>\n"; }
if ($register == "true") { if ($register == 'true') {
if (empty($username)) { $msg .= $text['message-required']." ".$text['label-username']."<br>\n"; } if (empty($username)) { $msg .= $text['message-required']." ".$text['label-username']."<br>\n"; }
if (empty($password)) { $msg .= $text['message-required']." ".$text['label-password']."<br>\n"; } if (empty($password)) { $msg .= $text['message-required']." ".$text['label-password']."<br>\n"; }
} }
@@ -198,7 +198,7 @@
$array['gateways'][$x]["description"] = $description; $array['gateways'][$x]["description"] = $description;
//update gateway session variable //update gateway session variable
if ($enabled == 'true') { if ($enabled) {
$_SESSION['gateways'][$gateway_uuid] = $gateway; $_SESSION['gateways'][$gateway_uuid] = $gateway;
} }
else { else {
@@ -216,7 +216,7 @@
$message = $database->message; $message = $database->message;
//remove xml file (if any) if not enabled //remove xml file (if any) if not enabled
if ($enabled != 'true' && !empty($_SESSION['switch']['sip_profiles']['dir'])) { if ($enabled != true && !empty($_SESSION['switch']['sip_profiles']['dir'])) {
$gateway_xml_file = $_SESSION['switch']['sip_profiles']['dir']."/".$profile."/v_".$gateway_uuid.".xml"; $gateway_xml_file = $_SESSION['switch']['sip_profiles']['dir']."/".$profile."/v_".$gateway_uuid.".xml";
if (file_exists($gateway_xml_file)) { if (file_exists($gateway_xml_file)) {
unlink($gateway_xml_file); unlink($gateway_xml_file);
@@ -285,10 +285,10 @@
$ping = $row["ping"]; $ping = $row["ping"];
$ping_min = $row["ping_min"]; $ping_min = $row["ping_min"];
$ping_max = $row["ping_max"]; $ping_max = $row["ping_max"];
$contact_in_ping = $row["contact_in_ping"]; $contact_in_ping = $row["contact_in_ping"] ?? false;
$channels = $row["channels"]; $channels = $row["channels"];
$caller_id_in_from = $row["caller_id_in_from"]; $caller_id_in_from = $row["caller_id_in_from"] ?? false;
$supress_cng = $row["supress_cng"]; $supress_cng = $row["supress_cng"] ?? false;
$sip_cid_type = $row["sip_cid_type"]; $sip_cid_type = $row["sip_cid_type"];
$codec_prefs = $row["codec_prefs"]; $codec_prefs = $row["codec_prefs"];
$extension_in_contact = $row["extension_in_contact"]; $extension_in_contact = $row["extension_in_contact"];
@@ -303,7 +303,7 @@
//get the sip profiles //get the sip profiles
$sql = "select sip_profile_name from v_sip_profiles "; $sql = "select sip_profile_name from v_sip_profiles ";
$sql .= "where sip_profile_enabled = 'true' "; $sql .= "where sip_profile_enabled = true ";
$sql .= "order by sip_profile_name asc "; $sql .= "order by sip_profile_name asc ";
$database = new database; $database = new database;
$sip_profiles = $database->select($sql, null, 'all'); $sip_profiles = $database->select($sql, null, 'all');
@@ -311,13 +311,10 @@
//set defaults //set defaults
if (empty($gateway_uuid)) { $gateway_uuid = ""; } if (empty($gateway_uuid)) { $gateway_uuid = ""; }
if (empty($enabled)) { $enabled = "true"; }
if (empty($register)) { $register = "true"; }
if (empty($retry_seconds)) { $retry_seconds = "30"; } if (empty($retry_seconds)) { $retry_seconds = "30"; }
if (empty($gateway)) { $gateway = ''; } if (empty($gateway)) { $gateway = ''; }
if (empty($username)) { $username = ''; } if (empty($username)) { $username = ''; }
if (empty($password)) { $password = ''; } if (empty($password)) { $password = ''; }
if (empty($distinct_to)) { $distinct_to = ''; }
if (empty($auth_username)) { $auth_username = ''; } if (empty($auth_username)) { $auth_username = ''; }
if (empty($realm)) { $realm = ''; } if (empty($realm)) { $realm = ''; }
if (empty($from_user)) { $from_user = ''; } if (empty($from_user)) { $from_user = ''; }
@@ -333,17 +330,13 @@
if (empty($ping)) { $ping = ''; } if (empty($ping)) { $ping = ''; }
if (empty($ping_min)) { $ping_min = ''; } if (empty($ping_min)) { $ping_min = ''; }
if (empty($ping_max)) { $ping_max = ''; } if (empty($ping_max)) { $ping_max = ''; }
if (empty($contact_in_ping)) { $contact_in_ping = ''; }
if (empty($channels)) { $channels = ''; } if (empty($channels)) { $channels = ''; }
if (empty($caller_id_in_from)) { $caller_id_in_from = ''; }
if (empty($supress_cng)) { $supress_cng = ''; }
if (empty($sip_cid_type)) { $sip_cid_type = ''; } if (empty($sip_cid_type)) { $sip_cid_type = ''; }
if (empty($codec_prefs)) { $codec_prefs = ''; } if (empty($codec_prefs)) { $codec_prefs = ''; }
if (empty($extension_in_contact)) { $extension_in_contact = ''; } if (empty($extension_in_contact)) { $extension_in_contact = ''; }
if (empty($context)) { $context = ''; } if (empty($context)) { $context = ''; }
if (empty($profile)) { $profile = ''; } if (empty($profile)) { $profile = ''; }
if (empty($hostname)) { $hostname = ''; } if (empty($hostname)) { $hostname = ''; }
if (empty($enabled)) { $enabled = 'true'; }
if (empty($description)) { $description = ''; } if (empty($description)) { $description = ''; }
//create token //create token
@@ -489,17 +482,16 @@
echo " ".$text['label-register']."\n"; echo " ".$text['label-register']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' name='register' value='true' ".(empty($register) || $register == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else { echo " <select class='formfld' id='register' name='register'>\n";
echo " <select class='formfld' name='register'>\n"; echo " <option value='true' ".($register === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='true'>".$text['option-true']."</option>\n"; echo " <option value='false' ".($register === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='false' ".(!empty($register) && $register == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-register']."\n"; echo $text['description-register']."\n";
@@ -540,21 +532,17 @@
echo " ".$text['label-distinct_to']."\n"; echo " ".$text['label-distinct_to']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n"; echo "<td width='70%' class='vtable' align='left'>\n";
echo " <select class='formfld' name='distinct_to'>\n"; if ($input_toggle_style_switch) {
echo " <option value=''></option>\n"; echo " <span class='switch'>\n";
if ($distinct_to == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($distinct_to == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
} }
echo " <select class='formfld' id='distinct_to' name='distinct_to'>\n";
echo " <option value='true' ".($distinct_to === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($distinct_to === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
}
echo "<br />\n"; echo "<br />\n";
echo $text['description-distinct_to']."\n"; echo $text['description-distinct_to']."\n";
echo "</td>\n"; echo "</td>\n";
@@ -651,21 +639,17 @@
echo " ".$text['label-caller_id_in_from']."\n"; echo " ".$text['label-caller_id_in_from']."\n";
echo " </td>\n"; echo " </td>\n";
echo " <td class='vtable' align='left'>\n"; echo " <td class='vtable' align='left'>\n";
echo " <select class='formfld' name='caller_id_in_from'>\n"; if ($input_toggle_style_switch) {
echo " <option value=''></option>\n"; echo " <span class='switch'>\n";
if ($caller_id_in_from == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($caller_id_in_from == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
} }
echo " <select class='formfld' id='caller_id_in_from' name='caller_id_in_from'>\n";
echo " <option value='true' ".($caller_id_in_from === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($caller_id_in_from === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
}
echo "<br />\n"; echo "<br />\n";
echo $text['description-caller_id_in_from']."\n"; echo $text['description-caller_id_in_from']."\n";
echo "</td>\n"; echo "</td>\n";
@@ -676,21 +660,17 @@
echo " ".$text['label-supress_cng']."\n"; echo " ".$text['label-supress_cng']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='supress_cng'>\n"; if ($input_toggle_style_switch) {
echo " <option value=''></option>\n"; echo " <span class='switch'>\n";
if ($supress_cng == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($supress_cng == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
} }
echo " <select class='formfld' id='supress_cng' name='supress_cng'>\n";
echo " <option value='true' ".($supress_cng === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($supress_cng === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
}
echo "<br />\n"; echo "<br />\n";
echo $text['description-supress_cng']."\n"; echo $text['description-supress_cng']."\n";
echo "</td>\n"; echo "</td>\n";
@@ -781,21 +761,17 @@
echo " ".$text['label-contact_in_ping']."\n"; echo " ".$text['label-contact_in_ping']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='contact_in_ping'>\n"; if ($input_toggle_style_switch) {
echo " <option value=''></option>\n"; echo " <span class='switch'>\n";
if ($contact_in_ping == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($contact_in_ping == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
} }
echo " <select class='formfld' id='contact_in_ping' name='contact_in_ping'>\n";
echo " <option value='true' ".($contact_in_ping === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($contact_in_ping === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
}
echo "<br />\n"; echo "<br />\n";
echo $text['description-contact_in_ping']."\n"; echo $text['description-contact_in_ping']."\n";
echo "</td>\n"; echo "</td>\n";
@@ -898,17 +874,16 @@
echo " ".$text['label-enabled']."\n"; echo " ".$text['label-enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='enabled' name='enabled' value='true' ".($enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='enabled' name='enabled'>\n"; echo " <select class='formfld' id='enabled' name='enabled'>\n";
echo " <option value='true' ".($enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-enabled']."\n"; echo $text['description-enabled']."\n";

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -141,7 +141,6 @@
$sql .= ") "; $sql .= ") ";
$parameters['search'] = '%'.$search.'%'; $parameters['search'] = '%'.$search.'%';
} }
$database = new database;
$total_gateways = $database->select($sql, $parameters ?? '', 'column'); $total_gateways = $database->select($sql, $parameters ?? '', 'column');
$num_rows = $total_gateways; $num_rows = $total_gateways;
@@ -155,7 +154,20 @@
$offset = $rows_per_page * $page; $offset = $rows_per_page * $page;
//get the list //get the list
$sql = "select * "; $sql = "select ";
$sql .= "gateway_uuid, domain_uuid, gateway, username, password, ";
$sql .= "cast(distinct_to as text), auth_username, realm, from_user, from_domain, ";
$sql .= "proxy, register_proxy,outbound_proxy,expire_seconds, ";
$sql .= "cast(register as text), register_transport, contact_params, retry_seconds, ";
$sql .= "extension, ping, ping_min, ping_max, ";
$sql .= "cast(contact_in_ping as text) , ";
$sql .= "cast(caller_id_in_from as text), ";
$sql .= "cast(supress_cng as text), ";
$sql .= "sip_cid_type, codec_prefs, channels, ";
$sql .= "cast(extension_in_contact as text), ";
$sql .= "context, profile, hostname, ";
$sql .= "cast(enabled as text), ";
$sql .= "description ";
$sql .= "from v_gateways "; $sql .= "from v_gateways ";
$sql .= "where true "; $sql .= "where true ";
if (!($show == "all" && permission_exists('gateway_all'))) { if (!($show == "all" && permission_exists('gateway_all'))) {
@@ -179,7 +191,6 @@
} }
$sql .= order_by($order_by, $order, 'gateway', 'asc'); $sql .= order_by($order_by, $order, 'gateway', 'asc');
$sql .= limit_offset($rows_per_page, $offset); $sql .= limit_offset($rows_per_page, $offset);
$database = new database;
$gateways = $database->select($sql, $parameters ?? '', 'all'); $gateways = $database->select($sql, $parameters ?? '', 'all');
unset($sql, $parameters); unset($sql, $parameters);
@@ -395,4 +406,3 @@
require_once "resources/footer.php"; require_once "resources/footer.php";
?> ?>

View File

@@ -35,7 +35,7 @@
$apps[$x]['destinations'][$y]['type'] = "sql"; $apps[$x]['destinations'][$y]['type'] = "sql";
$apps[$x]['destinations'][$y]['label'] = "ivr_menus"; $apps[$x]['destinations'][$y]['label'] = "ivr_menus";
$apps[$x]['destinations'][$y]['name'] = "ivr_menus"; $apps[$x]['destinations'][$y]['name'] = "ivr_menus";
$apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and ivr_menu_enabled = 'true' "; $apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and ivr_menu_enabled = true ";
$apps[$x]['destinations'][$y]['order_by'] = "natural_sort(ivr_menu_extension) asc"; $apps[$x]['destinations'][$y]['order_by'] = "natural_sort(ivr_menu_extension) asc";
$apps[$x]['destinations'][$y]['field']['ivr_menu_uuid'] = "ivr_menu_uuid"; $apps[$x]['destinations'][$y]['field']['ivr_menu_uuid'] = "ivr_menu_uuid";
$apps[$x]['destinations'][$y]['field']['uuid'] = "ivr_menu_uuid"; $apps[$x]['destinations'][$y]['field']['uuid'] = "ivr_menu_uuid";
@@ -52,7 +52,7 @@
$apps[$x]['destinations'][$y]['label'] = "ivr_menus_sub"; $apps[$x]['destinations'][$y]['label'] = "ivr_menus_sub";
$apps[$x]['destinations'][$y]['name'] = "ivr_menus_sub"; $apps[$x]['destinations'][$y]['name'] = "ivr_menus_sub";
$apps[$x]['destinations'][$y]['sql'] = "select ivr_menu_name as name, ivr_menu_uuid as uuid from v_ivr_menus "; $apps[$x]['destinations'][$y]['sql'] = "select ivr_menu_name as name, ivr_menu_uuid as uuid from v_ivr_menus ";
$apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and ivr_menu_enabled = 'true' "; $apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and ivr_menu_enabled = true ";
$apps[$x]['destinations'][$y]['order_by'] = "natural_sort(ivr_menu_extension) asc"; $apps[$x]['destinations'][$y]['order_by'] = "natural_sort(ivr_menu_extension) asc";
$apps[$x]['destinations'][$y]['field']['name'] = "ivr_menu_name"; $apps[$x]['destinations'][$y]['field']['name'] = "ivr_menu_name";
$apps[$x]['destinations'][$y]['field']['uuid'] = "ivr_menu_uuid"; $apps[$x]['destinations'][$y]['field']['uuid'] = "ivr_menu_uuid";
@@ -370,7 +370,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "ivr_menu_direct_dial"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "ivr_menu_direct_dial";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "ivr_menu_ringback"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "ivr_menu_ringback";
@@ -386,7 +386,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "ivr_menu_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "ivr_menu_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "ivr_menu_description"; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "ivr_menu_description";
@@ -484,9 +484,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "ivr_menu_option_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "ivr_menu_option_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "boolean"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['toggle'] = ['true','false']; $apps[$x]['db'][$y]['fields'][$z]['toggle'] = ['true','false'];
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;

View File

@@ -1,183 +0,0 @@
<?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-2019
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes files
require_once dirname(__DIR__, 2) . "/resources/require.php";
require_once "resources/check_auth.php";
require_once "resources/paging.php";
//check permissions
if (permission_exists('ivr_menu_edit')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//set the http get/post variable(s) to a php variable
$ivr_menu_uuid = $_GET["id"];
if (is_uuid($ivr_menu_uuid)) {
//get the ivr_menus data
$sql = "select * from v_ivr_menus ";
$sql .= "where ivr_menu_uuid = :ivr_menu_uuid ";
$sql .= "and domain_uuid = :domain_uuid ";
$parameters['ivr_menu_uuid'] = $ivr_menu_uuid;
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$ivr_menus = $database->select($sql, $parameters, 'all');
if (!is_array($ivr_menus)) {
echo "access denied";
exit;
}
unset($sql, $parameters);
//get the the ivr menu options
$sql = "select * from v_ivr_menu_options ";
$sql .= "where ivr_menu_uuid = :ivr_menu_uuid ";
$sql .= "and domain_uuid = :domain_uuid ";
$sql .= "order by ivr_menu_uuid asc ";
$parameters['ivr_menu_uuid'] = $ivr_menu_uuid;
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$ivr_menu_options = $database->select($sql, $parameters, 'all');
unset($sql, $parameters);
//create the uuids
$ivr_menu_uuid = uuid();
$dialplan_uuid = uuid();
//set the row id
$x = 0;
//set the variables
$ivr_menu_name = $ivr_menus[$x]['ivr_menu_name'];
$ivr_menu_extension = $ivr_menus[$x]['ivr_menu_extension'];
$ivr_menu_ringback = $ivr_menus[$x]['ivr_menu_ringback'];
$ivr_menu_language = $ivr_menus[$x]['ivr_menu_language'];
$ivr_menu_dialect = $ivr_menus[$x]['ivr_menu_dialect'];
$ivr_menu_voice = $ivr_menus[$x]['ivr_menu_voice'];
$ivr_menu_cid_prefix = $ivr_menus[$x]['ivr_menu_cid_prefix'];
$ivr_menu_context = $ivr_menus[$x]['ivr_menu_context'];
$ivr_menu_description = $ivr_menus[$x]['ivr_menu_description'].' ('.$text['label-copy'].')';
//prepare the ivr menu array
$ivr_menus[$x]['ivr_menu_uuid'] = $ivr_menu_uuid;
$ivr_menus[$x]['dialplan_uuid'] = $dialplan_uuid;
$ivr_menus[$x]['ivr_menu_name'] = $ivr_menu_name;
$ivr_menus[$x]['ivr_menu_description'] = $ivr_menu_description;
//get the the ivr menu options
$y = 0;
foreach ($ivr_menu_options as $row) {
//update the uuids
$row['ivr_menu_uuid'] = $ivr_menu_uuid;
$row['ivr_menu_option_uuid'] = uuid();
//add the row to the array
$ivr_menus[$x]["ivr_menu_options"][$y] = $row;
//increment the ivr menu option row id
$y++;
}
//build the xml dialplan
$dialplan_xml = "<extension name=\"".xml::sanitize($ivr_menu_name)."\" continue=\"\" uuid=\"".xml::sanitize($dialplan_uuid)."\">\n";
$dialplan_xml .= " <condition field=\"destination_number\" expression=\"^".xml::sanitize($ivr_menu_extension)."\">\n";
$dialplan_xml .= " <action application=\"ring_ready\" data=\"\"/>\n";
$dialplan_xml .= " <action application=\"answer\" data=\"\"/>\n";
$dialplan_xml .= " <action application=\"sleep\" data=\"1000\"/>\n";
$dialplan_xml .= " <action application=\"set\" data=\"hangup_after_bridge=true\"/>\n";
$dialplan_xml .= " <action application=\"set\" data=\"ringback=".xml::sanitize($ivr_menu_ringback)."\"/>\n";
$dialplan_xml .= " <action application=\"set\" data=\"transfer_ringback=".xml::sanitize($ivr_menu_ringback)."\"/>\n";
$dialplan_xml .= " <action application=\"set\" data=\"presence_id=".xml::sanitize($ivr_menu_extension)."@".$_SESSION['domain_name']."\"/>\n";
if (!empty($ivr_menu_language)) {
$dialplan_xml .= " <action application=\"set\" data=\"default_language=".xml::sanitize($ivr_menu_language)."\" inline=\"true\"/>\n";
$dialplan_xml .= " <action application=\"set\" data=\"default_dialect=".xml::sanitize($ivr_menu_dialect)."\" inline=\"true\"/>\n";
$dialplan_xml .= " <action application=\"set\" data=\"default_voice=".xml::sanitize($ivr_menu_voice)."\" inline=\"true\"/>\n";
}
$dialplan_xml .= " <action application=\"set\" data=\"ivr_menu_uuid=".xml::sanitize($ivr_menu_uuid)."\"/>\n";
if (!empty($ivr_menu_cid_prefix)) {
$dialplan_xml .= " <action application=\"set\" data=\"caller_id_name=".xml::sanitize($ivr_menu_cid_prefix)."#\${caller_id_name}\"/>\n";
$dialplan_xml .= " <action application=\"set\" data=\"effective_caller_id_name=\${caller_id_name}\"/>\n";
}
$dialplan_xml .= " <action application=\"ivr\" data=\"".xml::sanitize($ivr_menu_uuid)."\"/>\n";
$dialplan_xml .= " <action application=\"hangup\" data=\"\"/>\n";
$dialplan_xml .= " </condition>\n";
$dialplan_xml .= "</extension>\n";
//build the dialplan array
$dialplan[$x]["domain_uuid"] = $_SESSION['domain_uuid'];
$dialplan[$x]["dialplan_uuid"] = $dialplan_uuid;
$dialplan[$x]["dialplan_name"] = $ivr_menu_name;
$dialplan[$x]["dialplan_number"] = $ivr_menu_extension;
$dialplan[$x]["dialplan_context"] = $ivr_menu_context;
$dialplan[$x]["dialplan_continue"] = "false";
$dialplan[$x]["dialplan_xml"] = $dialplan_xml;
$dialplan[$x]["dialplan_order"] = "101";
$dialplan[$x]["dialplan_enabled"] = "true";
$dialplan[$x]["dialplan_description"] = $ivr_menu_description;
$dialplan[$x]["app_uuid"] = "a5788e9b-58bc-bd1b-df59-fff5d51253ab";
//prepare the array
$array['ivr_menus'] = $ivr_menus;
$array['dialplans'] = $dialplan;
//add the dialplan permission
$p = permissions::new();
$p->add("dialplan_add", "temp");
$p->add("dialplan_edit", "temp");
//save the array to the database
$database = new database;
$database->app_name = 'ivr_menus';
$database->app_uuid = 'a5788e9b-58bc-bd1b-df59-fff5d51253ab';
if (is_uuid($ivr_menu_uuid)) {
$database->uuid($ivr_menu_uuid);
}
$database->save($array);
$message = $database->message;
//remove the temporary permission
$p->delete("dialplan_add", "temp");
$p->delete("dialplan_edit", "temp");
//clear the cache
$cache = new cache;
$cache->delete("dialplan:".$ivr_menu_context);
//set message
message::add($text['message-copy']);
}
//redirect the user
header("Location: ivr_menus.php");
?>

View File

@@ -142,10 +142,10 @@
$ivr_menu_max_failures = $_POST["ivr_menu_max_failures"]; $ivr_menu_max_failures = $_POST["ivr_menu_max_failures"];
$ivr_menu_max_timeouts = $_POST["ivr_menu_max_timeouts"]; $ivr_menu_max_timeouts = $_POST["ivr_menu_max_timeouts"];
$ivr_menu_digit_len = $_POST["ivr_menu_digit_len"]; $ivr_menu_digit_len = $_POST["ivr_menu_digit_len"];
$ivr_menu_direct_dial = $_POST["ivr_menu_direct_dial"] ?? 'false'; $ivr_menu_direct_dial = $_POST["ivr_menu_direct_dial"];
$ivr_menu_ringback = $_POST["ivr_menu_ringback"]; $ivr_menu_ringback = $_POST["ivr_menu_ringback"];
$ivr_menu_cid_prefix = $_POST["ivr_menu_cid_prefix"]; $ivr_menu_cid_prefix = $_POST["ivr_menu_cid_prefix"];
$ivr_menu_enabled = $_POST["ivr_menu_enabled"] ?? 'false'; $ivr_menu_enabled = $_POST["ivr_menu_enabled"];
$ivr_menu_description = $_POST["ivr_menu_description"]; $ivr_menu_description = $_POST["ivr_menu_description"];
$ivr_menu_options_delete = $_POST["ivr_menu_options_delete"] ?? null; $ivr_menu_options_delete = $_POST["ivr_menu_options_delete"] ?? null;
$dialplan_uuid = $_POST["dialplan_uuid"] ?? null; $dialplan_uuid = $_POST["dialplan_uuid"] ?? null;
@@ -228,7 +228,7 @@
if (empty($ivr_menu_max_failures)) { $msg .= $text['message-required'].$text['label-max_failures']."<br>\n"; } if (empty($ivr_menu_max_failures)) { $msg .= $text['message-required'].$text['label-max_failures']."<br>\n"; }
if (empty($ivr_menu_max_timeouts)) { $msg .= $text['message-required'].$text['label-max_timeouts']."<br>\n"; } if (empty($ivr_menu_max_timeouts)) { $msg .= $text['message-required'].$text['label-max_timeouts']."<br>\n"; }
if (empty($ivr_menu_digit_len)) { $msg .= $text['message-required'].$text['label-digit_length']."<br>\n"; } if (empty($ivr_menu_digit_len)) { $msg .= $text['message-required'].$text['label-digit_length']."<br>\n"; }
if (empty($ivr_menu_direct_dial)) { $msg .= $text['message-required'].$text['label-direct_dial']."<br>\n"; } //if (empty($ivr_menu_direct_dial)) { $msg .= $text['message-required'].$text['label-direct_dial']."<br>\n"; }
//if (empty($ivr_menu_ringback)) { $msg .= $text['message-required'].$text['label-ring_back']."<br>\n"; } //if (empty($ivr_menu_ringback)) { $msg .= $text['message-required'].$text['label-ring_back']."<br>\n"; }
//if (empty($ivr_menu_description)) { $msg .= $text['message-required'].$text['label-description']."<br>\n"; } //if (empty($ivr_menu_description)) { $msg .= $text['message-required'].$text['label-description']."<br>\n"; }
@@ -343,7 +343,7 @@
} }
$array['ivr_menus'][0]['ivr_menu_options'][$y]["ivr_menu_option_order"] = $row["ivr_menu_option_order"]; $array['ivr_menus'][0]['ivr_menu_options'][$y]["ivr_menu_option_order"] = $row["ivr_menu_option_order"];
$array['ivr_menus'][0]['ivr_menu_options'][$y]["ivr_menu_option_description"] = $row["ivr_menu_option_description"]; $array['ivr_menus'][0]['ivr_menu_options'][$y]["ivr_menu_option_description"] = $row["ivr_menu_option_description"];
$array['ivr_menus'][0]["ivr_menu_options"][$y]["ivr_menu_option_enabled"] = !empty($row['ivr_menu_option_enabled']) ?? 'false'; $array['ivr_menus'][0]["ivr_menu_options"][$y]["ivr_menu_option_enabled"] = $row['ivr_menu_option_enabled'];
$y++; $y++;
} }
} }
@@ -396,7 +396,7 @@
if (isset($ivr_menu_context)) { if (isset($ivr_menu_context)) {
$array['dialplans'][0]["dialplan_context"] = $ivr_menu_context; $array['dialplans'][0]["dialplan_context"] = $ivr_menu_context;
} }
$array['dialplans'][0]["dialplan_continue"] = "false"; $array['dialplans'][0]["dialplan_continue"] = 'false';
$array['dialplans'][0]["dialplan_xml"] = $dialplan_xml; $array['dialplans'][0]["dialplan_xml"] = $dialplan_xml;
$array['dialplans'][0]["dialplan_order"] = "101"; $array['dialplans'][0]["dialplan_order"] = "101";
$array['dialplans'][0]["dialplan_enabled"] = $ivr_menu_enabled; $array['dialplans'][0]["dialplan_enabled"] = $ivr_menu_enabled;
@@ -416,7 +416,7 @@
$database->app_name = 'ivr_menus'; $database->app_name = 'ivr_menus';
$database->app_uuid = 'a5788e9b-58bc-bd1b-df59-fff5d51253ab'; $database->app_uuid = 'a5788e9b-58bc-bd1b-df59-fff5d51253ab';
$database->save($array); $database->save($array);
//$message = $database->message; $message = $database->message;
//remove the temporary permission //remove the temporary permission
$p->delete("dialplan_add", "temp"); $p->delete("dialplan_add", "temp");
@@ -443,12 +443,12 @@
$sql .=" select ivr_menu_parent_uuid "; $sql .=" select ivr_menu_parent_uuid ";
$sql .=" from v_ivr_menus "; $sql .=" from v_ivr_menus ";
$sql .=" where ivr_menu_parent_uuid = :ivr_menu_parent_uuid "; $sql .=" where ivr_menu_parent_uuid = :ivr_menu_parent_uuid ";
$sql .=" and ivr_menu_enabled = 'true' "; $sql .=" and ivr_menu_enabled = true ";
$sql .=" union all "; $sql .=" union all ";
$sql .=" select parent.ivr_menu_parent_uuid "; $sql .=" select parent.ivr_menu_parent_uuid ";
$sql .=" from v_ivr_menus as parent, ivr_menus as child "; $sql .=" from v_ivr_menus as parent, ivr_menus as child ";
$sql .=" where parent.ivr_menu_uuid = child.ivr_menu_parent_uuid "; $sql .=" where parent.ivr_menu_uuid = child.ivr_menu_parent_uuid ";
$sql .=" and parent.ivr_menu_enabled = 'true' "; $sql .=" and parent.ivr_menu_enabled = true ";
$sql .=" ) "; $sql .=" ) ";
$sql .=" select * from ivr_menus "; $sql .=" select * from ivr_menus ";
$parameters['ivr_menu_parent_uuid'] = $ivr_menu_parent_uuid; $parameters['ivr_menu_parent_uuid'] = $ivr_menu_parent_uuid;
@@ -568,7 +568,7 @@
$ivr_menu_options[$id]['ivr_menu_option_param'] = ''; $ivr_menu_options[$id]['ivr_menu_option_param'] = '';
$ivr_menu_options[$id]['ivr_menu_option_order'] = ''; $ivr_menu_options[$id]['ivr_menu_option_order'] = '';
$ivr_menu_options[$id]['ivr_menu_option_description'] = ''; $ivr_menu_options[$id]['ivr_menu_option_description'] = '';
$ivr_menu_options[$id]['ivr_menu_option_enabled'] = ''; $ivr_menu_options[$id]['ivr_menu_option_enabled'] = false;
$id++; $id++;
} }
@@ -612,9 +612,7 @@
} }
} }
if (empty($ivr_menu_digit_len)) { $ivr_menu_digit_len = '5'; } if (empty($ivr_menu_digit_len)) { $ivr_menu_digit_len = '5'; }
if (empty($ivr_menu_direct_dial)) { $ivr_menu_direct_dial = 'false'; }
if (!isset($ivr_menu_context)) { $ivr_menu_context = $_SESSION['domain_name']; } if (!isset($ivr_menu_context)) { $ivr_menu_context = $_SESSION['domain_name']; }
if (empty($ivr_menu_enabled)) { $ivr_menu_enabled = 'true'; }
if (!isset($ivr_menu_exit_action)) { $ivr_menu_exit_action = ''; } if (!isset($ivr_menu_exit_action)) { $ivr_menu_exit_action = ''; }
//get installed languages //get installed languages
@@ -1055,12 +1053,8 @@
if (strlen($field['ivr_menu_option_order']) == 2) { $field['ivr_menu_option_order'] = "0".$field['ivr_menu_option_order']; } if (strlen($field['ivr_menu_option_order']) == 2) { $field['ivr_menu_option_order'] = "0".$field['ivr_menu_option_order']; }
echo " <option value='".escape($field['ivr_menu_option_order'])."'>".escape($field['ivr_menu_option_order'])."</option>\n"; echo " <option value='".escape($field['ivr_menu_option_order'])."'>".escape($field['ivr_menu_option_order'])."</option>\n";
} }
$i=0; for ($i = 0; $i <= 999; $i++) {
while($i<=999) { echo " <option value='".str_pad($i, 3, '0', STR_PAD_LEFT)."'>".str_pad($i, 3, '0', STR_PAD_LEFT)."</option>\n";
if (strlen($i) == 1) { echo " <option value='00$i'>00$i</option>\n"; }
if (strlen($i) == 2) { echo " <option value='0$i'>0$i</option>\n"; }
if (strlen($i) == 3) { echo " <option value='$i'>$i</option>\n"; }
$i++;
} }
echo " </select>\n"; echo " </select>\n";
echo "</td>\n"; echo "</td>\n";
@@ -1069,19 +1063,16 @@
echo " <input class='formfld' style='width:100px' type='text' name='ivr_menu_options[".$x."][ivr_menu_option_description]' maxlength='255' value=\"".escape($field['ivr_menu_option_description'])."\">\n"; echo " <input class='formfld' style='width:100px' type='text' name='ivr_menu_options[".$x."][ivr_menu_option_description]' maxlength='255' value=\"".escape($field['ivr_menu_option_description'])."\">\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='formfld'>\n"; echo "<td class='formfld'>\n";
// switch if ($input_toggle_style_switch) {
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { echo " <span class='switch'>\n";
echo " <label class='switch'>\n";
echo " <input type='checkbox' id='ivr_menu_options_".$x."_ivr_menu_option_enabled' name='ivr_menu_options[".$x."][ivr_menu_option_enabled]' value='true' ".($field['ivr_menu_option_enabled'] == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
// select
else {
echo " <select class='formfld' id='ivr_menu_options_".$x."_ivr_menu_option_enabled' name='ivr_menu_options[".$x."][ivr_menu_option_enabled]'>\n"; echo " <select class='formfld' id='ivr_menu_options_".$x."_ivr_menu_option_enabled' name='ivr_menu_options[".$x."][ivr_menu_option_enabled]'>\n";
echo " <option value='false'>".$text['option-false']."</option>\n"; echo " <option value='false' ".($field['ivr_menu_option_enabled'] === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='true' ".(!empty($field['ivr_menu_option_enabled']) && $field['ivr_menu_option_enabled'] == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($field['ivr_menu_option_enabled'] === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "</td>\n"; echo "</td>\n";
if ($show_option_delete && permission_exists('ivr_menu_option_delete')) { if ($show_option_delete && permission_exists('ivr_menu_option_delete')) {
@@ -1177,17 +1168,16 @@
echo " ".$text['label-direct_dial']."\n"; echo " ".$text['label-direct_dial']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' name='ivr_menu_direct_dial' value='true' ".(!empty($ivr_menu_direct_dial) && $ivr_menu_direct_dial == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else { echo " <select class='formfld' id='ivr_menu_direct_dial' name='ivr_menu_direct_dial'>\n";
echo " <select class='formfld' name='ivr_menu_direct_dial'>\n"; echo " <option value='true' ".($ivr_menu_direct_dial === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='true'>".$text['option-true']."</option>\n"; echo " <option value='false' ".($ivr_menu_direct_dial === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " <option value='false' ".(!empty($ivr_menu_direct_dial) && $ivr_menu_direct_dial == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-direct_dial']."\n"; echo $text['description-direct_dial']."\n";
@@ -1537,17 +1527,16 @@
echo " ".$text['label-enabled']."\n"; echo " ".$text['label-enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td width=\"70%\" class='vtable' align='left'>\n"; echo "<td width=\"70%\" class='vtable' align='left'>\n";
if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='ivr_menu_enabled' name='ivr_menu_enabled' value='true' ".($ivr_menu_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='ivr_menu_enabled' name='ivr_menu_enabled'>\n"; echo " <select class='formfld' id='ivr_menu_enabled' name='ivr_menu_enabled'>\n";
echo " <option value='true' ".($ivr_menu_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($ivr_menu_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($ivr_menu_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($ivr_menu_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-enabled']."\n"; echo $text['description-enabled']."\n";

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2024 Portions created by the Initial Developer are Copyright (C) 2008-2025
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -110,7 +110,6 @@
$sql .= "and ("; $sql .= "and (";
$sql .= " lower(ivr_menu_name) like :search "; $sql .= " lower(ivr_menu_name) like :search ";
$sql .= " or lower(ivr_menu_extension) like :search "; $sql .= " or lower(ivr_menu_extension) like :search ";
$sql .= " or lower(ivr_menu_enabled) like :search ";
$sql .= " or lower(ivr_menu_description) like :search "; $sql .= " or lower(ivr_menu_description) like :search ";
$sql .= ")"; $sql .= ")";
$parameters['search'] = '%'.$search.'%'; $parameters['search'] = '%'.$search.'%';
@@ -129,7 +128,14 @@
$offset = $rows_per_page * $page; $offset = $rows_per_page * $page;
//get the list //get the list
$sql = "select * from v_ivr_menus "; $sql = "select ";
$sql .= "ivr_menu_uuid, ";
$sql .= "domain_uuid, ";
$sql .= "ivr_menu_name, ";
$sql .= "ivr_menu_extension, ";
$sql .= "cast(ivr_menu_enabled as text), ";
$sql .= "ivr_menu_description ";
$sql .= "from v_ivr_menus ";
if ($show == "all" && permission_exists('ivr_menu_all')) { if ($show == "all" && permission_exists('ivr_menu_all')) {
$sql .= "where true "; $sql .= "where true ";
} }
@@ -142,7 +148,6 @@
$sql .= "and ("; $sql .= "and (";
$sql .= " lower(ivr_menu_name) like :search "; $sql .= " lower(ivr_menu_name) like :search ";
$sql .= " or lower(ivr_menu_extension) like :search "; $sql .= " or lower(ivr_menu_extension) like :search ";
$sql .= " or lower(ivr_menu_enabled) like :search ";
$sql .= " or lower(ivr_menu_description) like :search "; $sql .= " or lower(ivr_menu_description) like :search ";
$sql .= ")"; $sql .= ")";
$parameters['search'] = '%'.$search.'%'; $parameters['search'] = '%'.$search.'%';

View File

@@ -159,7 +159,7 @@
} }
unset($sub_sql, $sub_result, $sub_row); unset($sub_sql, $sub_result, $sub_row);
if ($ivr_menu_direct_dial == "true") { if ($ivr_menu_direct_dial == true) {
$tmp .= " <entry action=\"menu-exec-app\" digits=\"/(^\d{3,6}$)/\" param=\"transfer $1 XML ".$ivr_menu_context."\"/>\n"; $tmp .= " <entry action=\"menu-exec-app\" digits=\"/(^\d{3,6}$)/\" param=\"transfer $1 XML ".$ivr_menu_context."\"/>\n";
} }
$tmp .= " </menu>\n"; $tmp .= " </menu>\n";

View File

@@ -79,12 +79,12 @@
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "module_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "module_enabled";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "moduleenabled"; $apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "moduleenabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "module_default_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "module_default_enabled";
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "moduledefaultenabled"; $apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "moduledefaultenabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "module_description"; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "module_description";

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@@ -48,8 +48,6 @@
$module_description = ''; $module_description = '';
$module_category = ''; $module_category = '';
$module_order = ''; $module_order = '';
$module_enabled = '';
$module_default_enabled = '';
//determin the action add or update //determin the action add or update
if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) { if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
@@ -67,8 +65,8 @@
$module_description = $_POST["module_description"]; $module_description = $_POST["module_description"];
$module_category = $_POST["module_category"]; $module_category = $_POST["module_category"];
$module_order = $_POST["module_order"]; $module_order = $_POST["module_order"];
$module_enabled = $_POST["module_enabled"] ?? 'false'; $module_enabled = $_POST["module_enabled"];
$module_default_enabled = $_POST["module_default_enabled"] ?? 'false'; $module_default_enabled = $_POST["module_default_enabled"];
} }
//process the data //process the data
@@ -93,8 +91,8 @@
if (empty($module_name)) { $msg .= $text['message-required'].$text['label-module_name']."<br>\n"; } if (empty($module_name)) { $msg .= $text['message-required'].$text['label-module_name']."<br>\n"; }
//if (empty($module_description)) { $msg .= $text['message-required'].$text['label-description']."<br>\n"; } //if (empty($module_description)) { $msg .= $text['message-required'].$text['label-description']."<br>\n"; }
if (empty($module_category)) { $msg .= $text['message-required'].$text['label-module_category']."<br>\n"; } if (empty($module_category)) { $msg .= $text['message-required'].$text['label-module_category']."<br>\n"; }
if (empty($module_enabled)) { $msg .= $text['message-required'].$text['label-enabled']."<br>\n"; } // if (empty($module_enabled)) { $msg .= $text['message-required'].$text['label-enabled']."<br>\n"; }
if (empty($module_default_enabled)) { $msg .= $text['message-required'].$text['label-default_enabled']."<br>\n"; } // if (empty($module_default_enabled)) { $msg .= $text['message-required'].$text['label-default_enabled']."<br>\n"; }
if (!empty($msg) && empty($_POST["persistformvar"])) { if (!empty($msg) && empty($_POST["persistformvar"])) {
require_once "resources/header.php"; require_once "resources/header.php";
require_once "resources/persist_form_var.php"; require_once "resources/persist_form_var.php";
@@ -169,10 +167,6 @@
unset($sql, $parameters, $row); unset($sql, $parameters, $row);
} }
//set the defaults
if (empty($module_enabled)) { $module_enabled = 'true'; }
if (empty($module_default_enabled)) { $module_default_enabled = 'true'; }
//create token //create token
$object = new token; $object = new token;
$token = $object->create($_SERVER['PHP_SELF']); $token = $object->create($_SERVER['PHP_SELF']);
@@ -253,17 +247,16 @@
echo " ".$text['label-enabled']."\n"; echo " ".$text['label-enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='module_enabled' name='module_enabled' value='true' ".($module_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='module_enabled' name='module_enabled'>\n"; echo " <select class='formfld' id='module_enabled' name='module_enabled'>\n";
echo " <option value='true' ".($module_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($module_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($module_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($module_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
@@ -273,17 +266,16 @@
echo " ".$text['label-default_enabled']."\n"; echo " ".$text['label-default_enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='module_default_enabled' name='module_default_enabled' value='true' ".($module_default_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='module_default_enabled' name='module_default_enabled'>\n"; echo " <select class='formfld' id='module_default_enabled' name='module_default_enabled'>\n";
echo " <option value='true' ".($module_default_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($module_default_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($module_default_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($module_default_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";

View File

@@ -245,7 +245,7 @@
} }
else { else {
echo " <td class='hide-xs'>\n"; echo " <td class='hide-xs'>\n";
echo $row['module_enabled'] == 'true' ? "<strong style='color: red;'>".$text['label-stopped']."</strong>" : $text['label-stopped']." ".escape($notice ?? null); echo $row['module_enabled'] === true ? "<strong style='color: red;'>".$text['label-stopped']."</strong>" : $text['label-stopped']." ".escape($notice ?? null);
echo " </td>\n"; echo " </td>\n";
if (permission_exists('module_edit')) { if (permission_exists('module_edit')) {
echo " <td class='no-link center'>"; echo " <td class='no-link center'>";
@@ -259,11 +259,11 @@
} }
if (permission_exists('module_edit')) { if (permission_exists('module_edit')) {
echo " <td class='no-link center'>"; echo " <td class='no-link center'>";
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.$row['module_enabled']],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]); echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.($row['module_enabled'] ? 'true' : 'false')],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]);
} }
else { else {
echo " <td class='center'>"; echo " <td class='center'>";
echo $text['label-'.$row['module_enabled']]; echo $text['label-'.($row['module_enabled'] ? 'true' : 'false')];
} }
echo " </td>\n"; echo " </td>\n";
echo " <td class='description overflow hide-sm-dn'>".escape($row["module_description"])."&nbsp;</td>\n"; echo " <td class='description overflow hide-sm-dn'>".escape($row["module_description"])."&nbsp;</td>\n";

View File

@@ -76,658 +76,658 @@
$mod['module_label'] = $module_label; $mod['module_label'] = $module_label;
$mod['module_name'] = $name; $mod['module_name'] = $name;
$mod['module_order'] = '800'; $mod['module_order'] = '800';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
$mod['module_description'] = ''; $mod['module_description'] = '';
switch ($name) { switch ($name) {
case "mod_amr": case "mod_amr":
$mod['module_label'] = 'AMR'; $mod['module_label'] = 'AMR';
$mod['module_category'] = 'Codecs'; $mod['module_category'] = 'Codecs';
$mod['module_description'] = 'AMR codec.'; $mod['module_description'] = 'AMR codec.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_av": case "mod_av":
$mod['module_label'] = 'AV'; $mod['module_label'] = 'AV';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Supports libav and RTMP streams.'; $mod['module_description'] = 'Supports libav and RTMP streams.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_avmd": case "mod_avmd":
$mod['module_label'] = 'AVMD'; $mod['module_label'] = 'AVMD';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Advanced voicemail beep detection.'; $mod['module_description'] = 'Advanced voicemail beep detection.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_blacklist": case "mod_blacklist":
$mod['module_label'] = 'Blacklist'; $mod['module_label'] = 'Blacklist';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Blacklist.'; $mod['module_description'] = 'Blacklist.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_b64": case "mod_b64":
$mod['module_label'] = 'B64'; $mod['module_label'] = 'B64';
$mod['module_category'] = 'Codecs'; $mod['module_category'] = 'Codecs';
$mod['module_description'] = 'B64 Codec.'; $mod['module_description'] = 'B64 Codec.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_bcg729": case "mod_bcg729":
$mod['module_label'] = 'BCG729'; $mod['module_label'] = 'BCG729';
$mod['module_category'] = 'Codecs'; $mod['module_category'] = 'Codecs';
$mod['module_description'] = 'G729 Open Source Codec.'; $mod['module_description'] = 'G729 Open Source Codec.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_bv": case "mod_bv":
$mod['module_label'] = 'BV'; $mod['module_label'] = 'BV';
$mod['module_category'] = 'Codecs'; $mod['module_category'] = 'Codecs';
$mod['module_description'] = 'BroadVoice16 and BroadVoice32 audio codecs.'; $mod['module_description'] = 'BroadVoice16 and BroadVoice32 audio codecs.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_cdr_csv": case "mod_cdr_csv":
$mod['module_label'] = 'CDR CSV'; $mod['module_label'] = 'CDR CSV';
$mod['module_category'] = 'Event Handlers'; $mod['module_category'] = 'Event Handlers';
$mod['module_description'] = 'CSV call detail record handler.'; $mod['module_description'] = 'CSV call detail record handler.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_cdr_sqlite": case "mod_cdr_sqlite":
$mod['module_label'] = 'CDR SQLite'; $mod['module_label'] = 'CDR SQLite';
$mod['module_category'] = 'Event Handlers'; $mod['module_category'] = 'Event Handlers';
$mod['module_description'] = 'SQLite call detail record handler.'; $mod['module_description'] = 'SQLite call detail record handler.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_callcenter": case "mod_callcenter":
$mod['module_label'] = 'Call Center'; $mod['module_label'] = 'Call Center';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Call queuing with agents and tiers for call centers.'; $mod['module_description'] = 'Call queuing with agents and tiers for call centers.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_cepstral": case "mod_cepstral":
$mod['module_label'] = 'Cepstral'; $mod['module_label'] = 'Cepstral';
$mod['module_category'] = 'Speech Recognition / Text to Speech'; $mod['module_category'] = 'Speech Recognition / Text to Speech';
$mod['module_description'] = 'Text to Speech engine.'; $mod['module_description'] = 'Text to Speech engine.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_cidlookup": case "mod_cidlookup":
$mod['module_label'] = 'CID Lookup'; $mod['module_label'] = 'CID Lookup';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Lookup caller id info.'; $mod['module_description'] = 'Lookup caller id info.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_cluechoo": case "mod_cluechoo":
$mod['module_label'] = 'Cluechoo'; $mod['module_label'] = 'Cluechoo';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'A framework demo module.'; $mod['module_description'] = 'A framework demo module.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_commands": case "mod_commands":
$mod['module_label'] = 'Commands'; $mod['module_label'] = 'Commands';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'API interface commands.'; $mod['module_description'] = 'API interface commands.';
$mod['module_order'] = 100; $mod['module_order'] = 100;
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_conference": case "mod_conference":
$mod['module_label'] = 'Conference'; $mod['module_label'] = 'Conference';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Conference room module.'; $mod['module_description'] = 'Conference room module.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_console": case "mod_console":
$mod['module_label'] = 'Console'; $mod['module_label'] = 'Console';
$mod['module_category'] = 'Loggers'; $mod['module_category'] = 'Loggers';
$mod['module_description'] = 'Send logs to the console.'; $mod['module_description'] = 'Send logs to the console.';
$mod['module_order'] = 400; $mod['module_order'] = 400;
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_curl": case "mod_curl":
$mod['module_label'] = 'CURL'; $mod['module_label'] = 'CURL';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Allows scripts to make HTTP requests and return responses in plain text or JSON.'; $mod['module_description'] = 'Allows scripts to make HTTP requests and return responses in plain text or JSON.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_db": case "mod_db":
$mod['module_label'] = 'DB'; $mod['module_label'] = 'DB';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Database key / value storage functionality, dialing and limit backend.'; $mod['module_description'] = 'Database key / value storage functionality, dialing and limit backend.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_dialplan_asterisk": case "mod_dialplan_asterisk":
$mod['module_label'] = 'Dialplan Asterisk'; $mod['module_label'] = 'Dialplan Asterisk';
$mod['module_category'] = 'Dialplan Interfaces'; $mod['module_category'] = 'Dialplan Interfaces';
$mod['module_description'] = 'Allows Asterisk dialplans.'; $mod['module_description'] = 'Allows Asterisk dialplans.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_dialplan_xml": case "mod_dialplan_xml":
$mod['module_label'] = 'Dialplan XML'; $mod['module_label'] = 'Dialplan XML';
$mod['module_category'] = 'Dialplan Interfaces'; $mod['module_category'] = 'Dialplan Interfaces';
$mod['module_description'] = 'Provides dialplan functionality in XML.'; $mod['module_description'] = 'Provides dialplan functionality in XML.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_directory": case "mod_directory":
$mod['module_label'] = 'Directory'; $mod['module_label'] = 'Directory';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Dial by name directory.'; $mod['module_description'] = 'Dial by name directory.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_distributor": case "mod_distributor":
$mod['module_label'] = 'Distributor'; $mod['module_label'] = 'Distributor';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Round robin call distribution.'; $mod['module_description'] = 'Round robin call distribution.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_dptools": case "mod_dptools":
$mod['module_label'] = 'Dialplan Plan Tools'; $mod['module_label'] = 'Dialplan Plan Tools';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Provides a number of apps and utilities for the dialplan.'; $mod['module_description'] = 'Provides a number of apps and utilities for the dialplan.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_enum": case "mod_enum":
$mod['module_label'] = 'ENUM'; $mod['module_label'] = 'ENUM';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Route PSTN numbers over internet according to ENUM servers, such as e164.org.'; $mod['module_description'] = 'Route PSTN numbers over internet according to ENUM servers, such as e164.org.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_esf": case "mod_esf":
$mod['module_label'] = 'ESF'; $mod['module_label'] = 'ESF';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Holds the multi cast paging application for SIP.'; $mod['module_description'] = 'Holds the multi cast paging application for SIP.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_event_socket": case "mod_event_socket":
$mod['module_label'] = 'Event Socket'; $mod['module_label'] = 'Event Socket';
$mod['module_category'] = 'Event Handlers'; $mod['module_category'] = 'Event Handlers';
$mod['module_description'] = 'Sends events via a single socket.'; $mod['module_description'] = 'Sends events via a single socket.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_expr": case "mod_expr":
$mod['module_label'] = 'Expr'; $mod['module_label'] = 'Expr';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Expression evaluation library.'; $mod['module_description'] = 'Expression evaluation library.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_fifo": case "mod_fifo":
$mod['module_label'] = 'FIFO'; $mod['module_label'] = 'FIFO';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'FIFO provides custom call queues including call park.'; $mod['module_description'] = 'FIFO provides custom call queues including call park.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_flite": case "mod_flite":
$mod['module_label'] = 'Flite'; $mod['module_label'] = 'Flite';
$mod['module_category'] = 'Speech Recognition / Text to Speech'; $mod['module_category'] = 'Speech Recognition / Text to Speech';
$mod['module_description'] = 'Text to Speech engine.'; $mod['module_description'] = 'Text to Speech engine.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_fsv": case "mod_fsv":
$mod['module_label'] = 'FSV'; $mod['module_label'] = 'FSV';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Video application (Recording and playback).'; $mod['module_description'] = 'Video application (Recording and playback).';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_g723_1": case "mod_g723_1":
$mod['module_label'] = 'G.723.1'; $mod['module_label'] = 'G.723.1';
$mod['module_category'] = 'Codecs'; $mod['module_category'] = 'Codecs';
$mod['module_description'] = 'G.723.1 codec.'; $mod['module_description'] = 'G.723.1 codec.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_g729": case "mod_g729":
$mod['module_label'] = 'G.729'; $mod['module_label'] = 'G.729';
$mod['module_category'] = 'Codecs'; $mod['module_category'] = 'Codecs';
$mod['module_description'] = 'G729 codec supports passthrough mode'; $mod['module_description'] = 'G729 codec supports passthrough mode';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_h26x": case "mod_h26x":
$mod['module_label'] = 'H26x'; $mod['module_label'] = 'H26x';
$mod['module_category'] = 'Codecs'; $mod['module_category'] = 'Codecs';
$mod['module_description'] = 'Video codecs'; $mod['module_description'] = 'Video codecs';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_hash": case "mod_hash":
$mod['module_label'] = 'Hash'; $mod['module_label'] = 'Hash';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Resource limitation.'; $mod['module_description'] = 'Resource limitation.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_httapi": case "mod_httapi":
$mod['module_label'] = 'HT-TAPI'; $mod['module_label'] = 'HT-TAPI';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'HT-TAPI Hypertext Telephony API'; $mod['module_description'] = 'HT-TAPI Hypertext Telephony API';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_http_cache": case "mod_http_cache":
$mod['module_label'] = 'HTTP Cache'; $mod['module_label'] = 'HTTP Cache';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'HTTP GET with caching'; $mod['module_description'] = 'HTTP GET with caching';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_ilbc": case "mod_ilbc":
$mod['module_label'] = 'iLBC'; $mod['module_label'] = 'iLBC';
$mod['module_category'] = 'Codecs'; $mod['module_category'] = 'Codecs';
$mod['module_description'] = 'iLBC codec.'; $mod['module_description'] = 'iLBC codec.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_ladspa": case "mod_ladspa":
$mod['module_label'] = 'Ladspa'; $mod['module_label'] = 'Ladspa';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Auto-tune calls.'; $mod['module_description'] = 'Auto-tune calls.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_lcr": case "mod_lcr":
$mod['module_label'] = 'LCR'; $mod['module_label'] = 'LCR';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Least cost routing.'; $mod['module_description'] = 'Least cost routing.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_local_stream": case "mod_local_stream":
$mod['module_label'] = 'Local Stream'; $mod['module_label'] = 'Local Stream';
$mod['module_category'] = 'Streams / Files'; $mod['module_category'] = 'Streams / Files';
$mod['module_description'] = 'For local streams (play all the files in a directory).'; $mod['module_description'] = 'For local streams (play all the files in a directory).';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_logfile": case "mod_logfile":
$mod['module_label'] = 'Log File'; $mod['module_label'] = 'Log File';
$mod['module_category'] = 'Loggers'; $mod['module_category'] = 'Loggers';
$mod['module_description'] = 'Send logs to the local file system.'; $mod['module_description'] = 'Send logs to the local file system.';
$mod['module_order'] = 400; $mod['module_order'] = 400;
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_loopback": case "mod_loopback":
$mod['module_label'] = 'Loopback'; $mod['module_label'] = 'Loopback';
$mod['module_category'] = 'Endpoints'; $mod['module_category'] = 'Endpoints';
$mod['module_description'] = 'A loopback channel driver to make an outbound call as an inbound call.'; $mod['module_description'] = 'A loopback channel driver to make an outbound call as an inbound call.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_lua": case "mod_lua":
$mod['module_label'] = 'Lua'; $mod['module_label'] = 'Lua';
$mod['module_category'] = 'Languages'; $mod['module_category'] = 'Languages';
$mod['module_description'] = 'Lua script.'; $mod['module_description'] = 'Lua script.';
$mod['module_order'] = 200; $mod['module_order'] = 200;
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_memcache": case "mod_memcache":
$mod['module_label'] = 'Memcached'; $mod['module_label'] = 'Memcached';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'API for memcached.'; $mod['module_description'] = 'API for memcached.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_order'] = 150; $mod['module_order'] = 150;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_native_file": case "mod_native_file":
$mod['module_label'] = 'Native File'; $mod['module_label'] = 'Native File';
$mod['module_category'] = 'File Format Interfaces'; $mod['module_category'] = 'File Format Interfaces';
$mod['module_description'] = 'File interface for codec specific file formats.'; $mod['module_description'] = 'File interface for codec specific file formats.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_nibblebill": case "mod_nibblebill":
$mod['module_label'] = 'Nibblebill'; $mod['module_label'] = 'Nibblebill';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Billing module.'; $mod['module_description'] = 'Billing module.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_opus": case "mod_opus":
$mod['module_label'] = 'Opus'; $mod['module_label'] = 'Opus';
$mod['module_category'] = 'Codecs'; $mod['module_category'] = 'Codecs';
$mod['module_description'] = 'OPUS ultra-low delay audio codec'; $mod['module_description'] = 'OPUS ultra-low delay audio codec';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_park": case "mod_park":
$mod['module_label'] = 'Park'; $mod['module_label'] = 'Park';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Park Calls.'; $mod['module_description'] = 'Park Calls.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_pgsql": case "mod_pgsql":
$mod['module_label'] = 'PGSQL'; $mod['module_label'] = 'PGSQL';
$mod['module_category'] = 'Databases'; $mod['module_category'] = 'Databases';
$mod['module_description'] = 'Client support for PostgreSQL database.'; $mod['module_description'] = 'Client support for PostgreSQL database.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_png": case "mod_png":
$mod['module_label'] = 'PNG'; $mod['module_label'] = 'PNG';
$mod['module_category'] = 'Formats'; $mod['module_category'] = 'Formats';
$mod['module_description'] = 'Image format Portable Network Graphics.'; $mod['module_description'] = 'Image format Portable Network Graphics.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_pocketsphinx": case "mod_pocketsphinx":
$mod['module_label'] = 'PocketSphinx'; $mod['module_label'] = 'PocketSphinx';
$mod['module_category'] = 'Speech Recognition / Text to Speech'; $mod['module_category'] = 'Speech Recognition / Text to Speech';
$mod['module_description'] = 'Speech Recognition.'; $mod['module_description'] = 'Speech Recognition.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_rtc": case "mod_rtc":
$mod['module_label'] = 'RTC'; $mod['module_label'] = 'RTC';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Supports medias streaming for WebRTC and Verto.'; $mod['module_description'] = 'Supports medias streaming for WebRTC and Verto.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_rtmp": case "mod_rtmp":
$mod['module_label'] = 'RTMP'; $mod['module_label'] = 'RTMP';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Real Time Media Protocol'; $mod['module_description'] = 'Real Time Media Protocol';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_say_de": case "mod_say_de":
$mod['module_label'] = 'German'; $mod['module_label'] = 'German';
$mod['module_category'] = 'Say'; $mod['module_category'] = 'Say';
$mod['module_description'] = 'German sound files used for time, date, digits, etc.'; $mod['module_description'] = 'German sound files used for time, date, digits, etc.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_say_en": case "mod_say_en":
$mod['module_label'] = 'English'; $mod['module_label'] = 'English';
$mod['module_category'] = 'Say'; $mod['module_category'] = 'Say';
$mod['module_description'] = 'English sound files used for time, date, digits, etc.'; $mod['module_description'] = 'English sound files used for time, date, digits, etc.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_say_es": case "mod_say_es":
$mod['module_label'] = 'Spanish'; $mod['module_label'] = 'Spanish';
$mod['module_category'] = 'Say'; $mod['module_category'] = 'Say';
$mod['module_description'] = 'Spanish sound files used for time, date, digits, etc.'; $mod['module_description'] = 'Spanish sound files used for time, date, digits, etc.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_say_es_ar": case "mod_say_es_ar":
$mod['module_label'] = 'Spanish AR'; $mod['module_label'] = 'Spanish AR';
$mod['module_category'] = 'Say'; $mod['module_category'] = 'Say';
$mod['module_description'] = 'Spanish AR sound files used for time, date, digits, etc.'; $mod['module_description'] = 'Spanish AR sound files used for time, date, digits, etc.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_say_fr": case "mod_say_fr":
$mod['module_label'] = 'French'; $mod['module_label'] = 'French';
$mod['module_category'] = 'Say'; $mod['module_category'] = 'Say';
$mod['module_description'] = 'Play French phrases using sound files for time, date, digits, and more.'; $mod['module_description'] = 'Play French phrases using sound files for time, date, digits, and more.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_say_he": case "mod_say_he":
$mod['module_label'] = 'Hebrew'; $mod['module_label'] = 'Hebrew';
$mod['module_category'] = 'Say'; $mod['module_category'] = 'Say';
$mod['module_description'] = 'Play Hebrew phrases using sound files for time, date, digits, and more.'; $mod['module_description'] = 'Play Hebrew phrases using sound files for time, date, digits, and more.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_say_hu": case "mod_say_hu":
$mod['module_label'] = 'Hungarian'; $mod['module_label'] = 'Hungarian';
$mod['module_category'] = 'Say'; $mod['module_category'] = 'Say';
$mod['module_description'] = 'Play Hungarian phrases using sound files for time, date, digits, and more.'; $mod['module_description'] = 'Play Hungarian phrases using sound files for time, date, digits, and more.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_say_it": case "mod_say_it":
$mod['module_label'] = 'Italian'; $mod['module_label'] = 'Italian';
$mod['module_category'] = 'Say'; $mod['module_category'] = 'Say';
$mod['module_description'] = 'Play Italian phrases using sound files for time, date, digits, and more.'; $mod['module_description'] = 'Play Italian phrases using sound files for time, date, digits, and more.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_say_nl": case "mod_say_nl":
$mod['module_label'] = 'Dutch'; $mod['module_label'] = 'Dutch';
$mod['module_category'] = 'Say'; $mod['module_category'] = 'Say';
$mod['module_description'] = 'Play Dutch phrases using sound files for time, date, digits, and more.'; $mod['module_description'] = 'Play Dutch phrases using sound files for time, date, digits, and more.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_say_pt": case "mod_say_pt":
$mod['module_label'] = 'Portuguese'; $mod['module_label'] = 'Portuguese';
$mod['module_category'] = 'Say'; $mod['module_category'] = 'Say';
$mod['module_description'] = 'Play Portuguese phrases using sound files for time, date, digits, and more.'; $mod['module_description'] = 'Play Portuguese phrases using sound files for time, date, digits, and more.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_say_ru": case "mod_say_ru":
$mod['module_label'] = 'Russian'; $mod['module_label'] = 'Russian';
$mod['module_category'] = 'Say'; $mod['module_category'] = 'Say';
$mod['module_description'] = 'Play Russian phrases using sound files for time, date, digits, and more.'; $mod['module_description'] = 'Play Russian phrases using sound files for time, date, digits, and more.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_say_th": case "mod_say_th":
$mod['module_label'] = 'Thai'; $mod['module_label'] = 'Thai';
$mod['module_category'] = 'Say'; $mod['module_category'] = 'Say';
$mod['module_description'] = 'Play Thai phrases using sound files for time, date, digits, and more.'; $mod['module_description'] = 'Play Thai phrases using sound files for time, date, digits, and more.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_say_zh": case "mod_say_zh":
$mod['module_label'] = 'Chinese'; $mod['module_label'] = 'Chinese';
$mod['module_category'] = 'Say'; $mod['module_category'] = 'Say';
$mod['module_description'] = 'Play Chinese phrases using sound files for time, date, digits, and more.'; $mod['module_description'] = 'Play Chinese phrases using sound files for time, date, digits, and more.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_shout": case "mod_shout":
$mod['module_label'] = 'Shout'; $mod['module_label'] = 'Shout';
$mod['module_category'] = 'Streams / Files'; $mod['module_category'] = 'Streams / Files';
$mod['module_description'] = 'MP3 files and shoutcast streams.'; $mod['module_description'] = 'MP3 files and shoutcast streams.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_siren": case "mod_siren":
$mod['module_label'] = 'Siren'; $mod['module_label'] = 'Siren';
$mod['module_category'] = 'Codecs'; $mod['module_category'] = 'Codecs';
$mod['module_description'] = 'Siren codec'; $mod['module_description'] = 'Siren codec';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_sms": case "mod_sms":
$mod['module_label'] = 'SMS'; $mod['module_label'] = 'SMS';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Chat messages'; $mod['module_description'] = 'Chat messages';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_sndfile": case "mod_sndfile":
$mod['module_label'] = 'Sound File'; $mod['module_label'] = 'Sound File';
$mod['module_category'] = 'File Format Interfaces'; $mod['module_category'] = 'File Format Interfaces';
$mod['module_description'] = 'Multi-format file format transcoder (WAV, etc).'; $mod['module_description'] = 'Multi-format file format transcoder (WAV, etc).';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_sofia": case "mod_sofia":
$mod['module_label'] = 'Sofia'; $mod['module_label'] = 'Sofia';
$mod['module_category'] = 'Endpoints'; $mod['module_category'] = 'Endpoints';
$mod['module_description'] = 'SIP module.'; $mod['module_description'] = 'SIP module.';
$mod['module_order'] = 300; $mod['module_order'] = 300;
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_spandsp": case "mod_spandsp":
$mod['module_label'] = 'SpanDSP'; $mod['module_label'] = 'SpanDSP';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'FAX provides fax send and receive.'; $mod['module_description'] = 'FAX provides fax send and receive.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_speex": case "mod_speex":
$mod['module_label'] = 'Speex'; $mod['module_label'] = 'Speex';
$mod['module_category'] = 'Codecs'; $mod['module_category'] = 'Codecs';
$mod['module_description'] = 'Speex codec.'; $mod['module_description'] = 'Speex codec.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_spidermonkey": case "mod_spidermonkey":
$mod['module_label'] = 'SpiderMonkey'; $mod['module_label'] = 'SpiderMonkey';
$mod['module_category'] = 'Languages'; $mod['module_category'] = 'Languages';
$mod['module_description'] = 'JavaScript support.'; $mod['module_description'] = 'JavaScript support.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_spidermonkey_core_db": case "mod_spidermonkey_core_db":
$mod['module_label'] = 'SpiderMonkey Core DB'; $mod['module_label'] = 'SpiderMonkey Core DB';
$mod['module_category'] = 'Languages'; $mod['module_category'] = 'Languages';
$mod['module_description'] = 'Javascript support for SQLite.'; $mod['module_description'] = 'Javascript support for SQLite.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_spidermonkey_curl": case "mod_spidermonkey_curl":
$mod['module_label'] = 'SpiderMonkey Curl'; $mod['module_label'] = 'SpiderMonkey Curl';
$mod['module_category'] = 'Languages'; $mod['module_category'] = 'Languages';
$mod['module_description'] = 'Javascript curl support.'; $mod['module_description'] = 'Javascript curl support.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_spidermonkey_socket": case "mod_spidermonkey_socket":
$mod['module_label'] = 'SpiderMonkey Socket'; $mod['module_label'] = 'SpiderMonkey Socket';
$mod['module_category'] = 'Languages'; $mod['module_category'] = 'Languages';
$mod['module_description'] = 'Javascript socket support.'; $mod['module_description'] = 'Javascript socket support.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_spidermonkey_teletone": case "mod_spidermonkey_teletone":
$mod['module_label'] = 'SpiderMonkey Teletone'; $mod['module_label'] = 'SpiderMonkey Teletone';
$mod['module_category'] = 'Languages'; $mod['module_category'] = 'Languages';
$mod['module_description'] = 'Javascript teletone support.'; $mod['module_description'] = 'Javascript teletone support.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_syslog": case "mod_syslog":
$mod['module_label'] = 'Syslog'; $mod['module_label'] = 'Syslog';
$mod['module_category'] = 'Loggers'; $mod['module_category'] = 'Loggers';
$mod['module_description'] = 'Send logs to a remote syslog server.'; $mod['module_description'] = 'Send logs to a remote syslog server.';
$mod['module_order'] = 400; $mod['module_order'] = 400;
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_test": case "mod_test":
$mod['module_label'] = 'Test'; $mod['module_label'] = 'Test';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Test application.'; $mod['module_description'] = 'Test application.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_tone_stream": case "mod_tone_stream":
$mod['module_label'] = 'Tone Stream'; $mod['module_label'] = 'Tone Stream';
$mod['module_category'] = 'Streams / Files'; $mod['module_category'] = 'Streams / Files';
$mod['module_description'] = 'Generate tone streams.'; $mod['module_description'] = 'Generate tone streams.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_tts_commandline": case "mod_tts_commandline":
$mod['module_label'] = 'TTS Commandline'; $mod['module_label'] = 'TTS Commandline';
$mod['module_category'] = 'Speech Recognition / Text to Speech'; $mod['module_category'] = 'Speech Recognition / Text to Speech';
$mod['module_description'] = 'Commandline text to speech engine.'; $mod['module_description'] = 'Commandline text to speech engine.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_unimrcp": case "mod_unimrcp":
$mod['module_label'] = 'MRCP'; $mod['module_label'] = 'MRCP';
$mod['module_category'] = 'Speech Recognition / Text to Speech'; $mod['module_category'] = 'Speech Recognition / Text to Speech';
$mod['module_description'] = 'Media Resource Control Protocol.'; $mod['module_description'] = 'Media Resource Control Protocol.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_valet_parking": case "mod_valet_parking":
$mod['module_label'] = 'Valet Parking'; $mod['module_label'] = 'Valet Parking';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Call parking'; $mod['module_description'] = 'Call parking';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_voicemail": case "mod_voicemail":
$mod['module_label'] = 'Voicemail'; $mod['module_label'] = 'Voicemail';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Full featured voicemail module.'; $mod['module_description'] = 'Full featured voicemail module.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_voicemail_ivr": case "mod_voicemail_ivr":
$mod['module_label'] = 'Voicemail IVR'; $mod['module_label'] = 'Voicemail IVR';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'Voicemail IVR interface.'; $mod['module_description'] = 'Voicemail IVR interface.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_translate": case "mod_translate":
$mod['module_label'] = 'Translate'; $mod['module_label'] = 'Translate';
$mod['module_category'] = 'Applications'; $mod['module_category'] = 'Applications';
$mod['module_description'] = 'format numbers into a specified format.'; $mod['module_description'] = 'format numbers into a specified format.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_xml_cdr": case "mod_xml_cdr":
$mod['module_label'] = 'XML CDR'; $mod['module_label'] = 'XML CDR';
$mod['module_category'] = 'XML Interfaces'; $mod['module_category'] = 'XML Interfaces';
$mod['module_description'] = 'XML based call detail record handler.'; $mod['module_description'] = 'XML based call detail record handler.';
$mod['module_enabled'] = 'true'; $mod['module_enabled'] = true;
$mod['module_default_enabled'] = 'true'; $mod['module_default_enabled'] = true;
break; break;
case "mod_xml_curl": case "mod_xml_curl":
$mod['module_label'] = 'XML Curl'; $mod['module_label'] = 'XML Curl';
$mod['module_category'] = 'XML Interfaces'; $mod['module_category'] = 'XML Interfaces';
$mod['module_description'] = 'Request XML config files dynamically.'; $mod['module_description'] = 'Request XML config files dynamically.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_xml_rpc": case "mod_xml_rpc":
$mod['module_label'] = 'XML RPC'; $mod['module_label'] = 'XML RPC';
$mod['module_category'] = 'XML Interfaces'; $mod['module_category'] = 'XML Interfaces';
$mod['module_description'] = 'XML Remote Procedure Calls. Issue commands from your web application.'; $mod['module_description'] = 'XML Remote Procedure Calls. Issue commands from your web application.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
case "mod_xml_scgi": case "mod_xml_scgi":
$mod['module_label'] = 'XML SCGI'; $mod['module_label'] = 'XML SCGI';
$mod['module_category'] = 'XML Interfaces'; $mod['module_category'] = 'XML Interfaces';
$mod['module_description'] = 'SCGI XML Gateway.'; $mod['module_description'] = 'SCGI XML Gateway.';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
break; break;
default: default:
$mod['module_category'] = 'Auto'; $mod['module_category'] = 'Auto';
$mod['module_enabled'] = 'false'; $mod['module_enabled'] = false;
$mod['module_default_enabled'] = 'false'; $mod['module_default_enabled'] = false;
} }
return $mod; return $mod;
} }
@@ -850,7 +850,7 @@
if ($prev_module_cat != $row['module_category']) { if ($prev_module_cat != $row['module_category']) {
$xml .= "\n <!-- ".$row['module_category']." -->\n"; $xml .= "\n <!-- ".$row['module_category']." -->\n";
} }
if ($row['module_enabled'] == "true"){ if ($row['module_enabled'] == true){
$xml .= " <load module=\"".$row['module_name']."\"/>\n"; $xml .= " <load module=\"".$row['module_name']."\"/>\n";
} }
$prev_module_cat = $row['module_category']; $prev_module_cat = $row['module_category'];

View File

@@ -86,7 +86,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the number translation name.'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the number translation name.';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'number_translation_enabled'; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'number_translation_enabled';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'boolean';
$apps[$x]['db'][$y]['fields'][$z]['toggle'] = ['true','false']; $apps[$x]['db'][$y]['fields'][$z]['toggle'] = ['true','false'];
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the number translation enabled.'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the number translation enabled.';
$z++; $z++;

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> 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. the Initial Developer. All Rights Reserved.
*/ */
@@ -58,7 +58,7 @@
if (!empty($_POST)) { if (!empty($_POST)) {
$number_translation_name = $_POST["number_translation_name"]; $number_translation_name = $_POST["number_translation_name"];
$number_translation_details = $_POST["number_translation_details"]; $number_translation_details = $_POST["number_translation_details"];
$number_translation_enabled = $_POST["number_translation_enabled"] ?? 'false'; $number_translation_enabled = $_POST["number_translation_enabled"];
$number_translation_description = $_POST["number_translation_description"]; $number_translation_description = $_POST["number_translation_description"];
} }
@@ -119,7 +119,7 @@
$msg = ''; $msg = '';
if (empty($number_translation_name)) { $msg .= $text['message-required']." ".$text['label-number_translation_name']."<br>\n"; } if (empty($number_translation_name)) { $msg .= $text['message-required']." ".$text['label-number_translation_name']."<br>\n"; }
//if (empty($number_translation_details)) { $msg .= $text['message-required']." ".$text['label-number_translation_details']."<br>\n"; } //if (empty($number_translation_details)) { $msg .= $text['message-required']." ".$text['label-number_translation_details']."<br>\n"; }
if (empty($number_translation_enabled)) { $msg .= $text['message-required']." ".$text['label-number_translation_enabled']."<br>\n"; } //if (empty($number_translation_enabled)) { $msg .= $text['message-required']." ".$text['label-number_translation_enabled']."<br>\n"; }
//if (empty($number_translation_description)) { $msg .= $text['message-required']." ".$text['label-number_translation_description']."<br>\n"; } //if (empty($number_translation_description)) { $msg .= $text['message-required']." ".$text['label-number_translation_description']."<br>\n"; }
if (!empty($msg) && empty($_POST["persistformvar"])) { if (!empty($msg) && empty($_POST["persistformvar"])) {
require_once "resources/header.php"; require_once "resources/header.php";
@@ -337,17 +337,16 @@
echo " ".$text['label-number_translation_enabled']."\n"; echo " ".$text['label-number_translation_enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n"; echo "<td class='vtable' style='position: relative;' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='number_translation_enabled' name='number_translation_enabled' value='true' ".($number_translation_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='number_translation_enabled' name='number_translation_enabled'>\n"; echo " <select class='formfld' id='number_translation_enabled' name='number_translation_enabled'>\n";
echo " <option value='true' ".($number_translation_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($number_translation_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($number_translation_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($number_translation_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo "<br />\n"; echo "<br />\n";
echo $text['description-number_translation_enabled']."\n"; echo $text['description-number_translation_enabled']."\n";

View File

@@ -35,7 +35,7 @@
$apps[$x]['destinations'][$y]['type'] = "sql"; $apps[$x]['destinations'][$y]['type'] = "sql";
$apps[$x]['destinations'][$y]['label'] = "phrases"; $apps[$x]['destinations'][$y]['label'] = "phrases";
$apps[$x]['destinations'][$y]['name'] = "phrases"; $apps[$x]['destinations'][$y]['name'] = "phrases";
$apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and phrase_enabled = 'true' "; $apps[$x]['destinations'][$y]['where'] = "where domain_uuid = '\${domain_uuid}' and phrase_enabled = true ";
$apps[$x]['destinations'][$y]['order_by'] = "phrase_name asc"; $apps[$x]['destinations'][$y]['order_by'] = "phrase_name asc";
$apps[$x]['destinations'][$y]['field']['uuid'] = "phrase_uuid"; $apps[$x]['destinations'][$y]['field']['uuid'] = "phrase_uuid";
$apps[$x]['destinations'][$y]['field']['name'] = "phrase_name"; $apps[$x]['destinations'][$y]['field']['name'] = "phrase_name";
@@ -115,7 +115,7 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "phrase_enabled"; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "phrase_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "boolean";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "phrase_description"; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "phrase_description";

View File

@@ -81,7 +81,7 @@
} }
$phrase_name = $_POST["phrase_name"]; $phrase_name = $_POST["phrase_name"];
$phrase_language = $_POST["phrase_language"]; $phrase_language = $_POST["phrase_language"];
$phrase_enabled = $_POST["phrase_enabled"] ?? 'false'; $phrase_enabled = $_POST["phrase_enabled"];
$phrase_description = $_POST["phrase_description"]; $phrase_description = $_POST["phrase_description"];
$phrase_details_delete = $_POST["phrase_details_delete"] ?? ''; $phrase_details_delete = $_POST["phrase_details_delete"] ?? '';
@@ -163,7 +163,6 @@
$p = permissions::new(); $p = permissions::new();
$p->add('phrase_detail_add', 'temp'); $p->add('phrase_detail_add', 'temp');
$database = new database;
$database->app_name = 'phrases'; $database->app_name = 'phrases';
$database->app_uuid = '5c6f597c-9b78-11e4-89d3-123b93f75cba'; $database->app_uuid = '5c6f597c-9b78-11e4-89d3-123b93f75cba';
$database->save($array); $database->save($array);
@@ -227,7 +226,6 @@
$p = permissions::new(); $p = permissions::new();
$p->add('phrase_detail_add', 'temp'); $p->add('phrase_detail_add', 'temp');
$database = new database;
$database->app_name = 'phrases'; $database->app_name = 'phrases';
$database->app_uuid = '5c6f597c-9b78-11e4-89d3-123b93f75cba'; $database->app_uuid = '5c6f597c-9b78-11e4-89d3-123b93f75cba';
$database->save($array); $database->save($array);
@@ -276,7 +274,6 @@
$sql .= "and phrase_uuid = :phrase_uuid "; $sql .= "and phrase_uuid = :phrase_uuid ";
$parameters['domain_uuid'] = $domain_uuid; $parameters['domain_uuid'] = $domain_uuid;
$parameters['phrase_uuid'] = $phrase_uuid; $parameters['phrase_uuid'] = $phrase_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row'); $row = $database->select($sql, $parameters, 'row');
if (is_array($row) && @sizeof($row) != 0) { if (is_array($row) && @sizeof($row) != 0) {
$phrase_name = $row["phrase_name"]; $phrase_name = $row["phrase_name"];
@@ -287,9 +284,6 @@
unset($sql, $parameters, $row); unset($sql, $parameters, $row);
} }
//set the defaults
if (empty($phrase_enabled)) { $phrase_enabled = 'true'; }
//get the phrase details //get the phrase details
if (!empty($phrase_uuid)) { if (!empty($phrase_uuid)) {
$sql = "select * from v_phrase_details "; $sql = "select * from v_phrase_details ";
@@ -298,7 +292,6 @@
$sql .= "order by phrase_detail_order asc "; $sql .= "order by phrase_detail_order asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid']; $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['phrase_uuid'] = $phrase_uuid; $parameters['phrase_uuid'] = $phrase_uuid;
$database = new database;
$phrase_details = $database->select($sql, $parameters, 'all'); $phrase_details = $database->select($sql, $parameters, 'all');
unset($sql, $parameters); unset($sql, $parameters);
} }
@@ -308,7 +301,6 @@
$sql .= "where domain_uuid = :domain_uuid "; $sql .= "where domain_uuid = :domain_uuid ";
$sql .= "order by recording_name asc "; $sql .= "order by recording_name asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid']; $parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$database = new database;
$recordings = $database->select($sql, $parameters, 'all'); $recordings = $database->select($sql, $parameters, 'all');
unset($sql, $parameters); unset($sql, $parameters);
@@ -611,17 +603,16 @@
echo " ".$text['label-enabled']."\n"; echo " ".$text['label-enabled']."\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { if ($input_toggle_style_switch) {
echo " <label class='switch'>\n"; echo " <span class='switch'>\n";
echo " <input type='checkbox' id='phrase_enabled' name='phrase_enabled' value='true' ".($phrase_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
} }
else {
echo " <select class='formfld' id='phrase_enabled' name='phrase_enabled'>\n"; echo " <select class='formfld' id='phrase_enabled' name='phrase_enabled'>\n";
echo " <option value='true' ".($phrase_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n"; echo " <option value='true' ".($phrase_enabled === true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($phrase_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n"; echo " <option value='false' ".($phrase_enabled === false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n"; echo " </select>\n";
if ($input_toggle_style_switch) {
echo " <span class='slider'></span>\n";
echo " </span>\n";
} }
echo " <br />\n"; echo " <br />\n";
echo $text['description-enabled']."\n"; echo $text['description-enabled']."\n";

View File

@@ -337,7 +337,7 @@
if (is_array($row) && sizeof($row) != 0) { if (is_array($row) && sizeof($row) != 0) {
//checks either device enabled //checks either device enabled
if ($row['device_enabled'] != 'true') { if ($row['device_enabled'] === false) {
syslog(LOG_WARNING, '['.$_SERVER['REMOTE_ADDR']."] provision attempted but the device is not enabled for ".escape($device_address)); syslog(LOG_WARNING, '['.$_SERVER['REMOTE_ADDR']."] provision attempted but the device is not enabled for ".escape($device_address));
if ($this->settings->get('provision','debug', false)) { if ($this->settings->get('provision','debug', false)) {
echo "<br/>device disabled<br/>"; echo "<br/>device disabled<br/>";
@@ -384,7 +384,7 @@
if (empty($device_template)) { if (empty($device_template)) {
$sql = "select * from v_devices "; $sql = "select * from v_devices ";
$sql .= "where domain_uuid = :domain_uuid "; $sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and device_enabled = 'true' "; $sql .= "and device_enabled = true ";
$sql .= "limit 1 "; $sql .= "limit 1 ";
$parameters['domain_uuid'] = $domain_uuid; $parameters['domain_uuid'] = $domain_uuid;
$row = $this->database->select($sql, $parameters, 'row'); $row = $this->database->select($sql, $parameters, 'row');
@@ -544,7 +544,7 @@
$array['devices'][$x]['device_uuid'] = $device_uuid; $array['devices'][$x]['device_uuid'] = $device_uuid;
$array['devices'][$x]['device_address'] = $device_address; $array['devices'][$x]['device_address'] = $device_address;
$array['devices'][$x]['device_vendor'] = $device_vendor; $array['devices'][$x]['device_vendor'] = $device_vendor;
$array['devices'][$x]['device_enabled'] = 'true'; $array['devices'][$x]['device_enabled'] = true;
$array['devices'][$x]['device_template'] = $device_template; $array['devices'][$x]['device_template'] = $device_template;
$array['devices'][$x]['device_description'] = $_SERVER['HTTP_USER_AGENT']; $array['devices'][$x]['device_description'] = $_SERVER['HTTP_USER_AGENT'];
@@ -573,7 +573,7 @@
if (is_uuid($device_uuid)) { if (is_uuid($device_uuid)) {
$sql = "select * from v_devices "; $sql = "select * from v_devices ";
$sql .= "where device_uuid = :device_uuid "; $sql .= "where device_uuid = :device_uuid ";
$sql .= "and device_enabled = 'true' "; $sql .= "and device_enabled = true ";
$parameters['device_uuid'] = $device_uuid; $parameters['device_uuid'] = $device_uuid;
$row = $this->database->select($sql, $parameters, 'row'); $row = $this->database->select($sql, $parameters, 'row');
if (is_array($row) && sizeof($row) != 0) { if (is_array($row) && sizeof($row) != 0) {
@@ -589,7 +589,7 @@
$parameters['device_uuid'] = $device_uuid; $parameters['device_uuid'] = $device_uuid;
$row = $this->database->select($sql, $parameters, 'row'); $row = $this->database->select($sql, $parameters, 'row');
if (is_array($row) && sizeof($row) != 0) { if (is_array($row) && sizeof($row) != 0) {
if ($row["device_enabled"] == "true") { if ($row["device_enabled"]) {
$device_label = $row["device_label"]; $device_label = $row["device_label"];
//if the device vendor match then use the alternate device template //if the device vendor match then use the alternate device template
@@ -614,7 +614,7 @@
if (is_uuid($device_uuid) && is_uuid($device_profile_uuid)) { if (is_uuid($device_uuid) && is_uuid($device_profile_uuid)) {
$sql = "select * from v_device_profile_settings "; $sql = "select * from v_device_profile_settings ";
$sql .= "where device_profile_uuid = :device_profile_uuid "; $sql .= "where device_profile_uuid = :device_profile_uuid ";
$sql .= "and profile_setting_enabled = 'true' "; $sql .= "and profile_setting_enabled = true ";
$parameters['device_profile_uuid'] = $device_profile_uuid; $parameters['device_profile_uuid'] = $device_profile_uuid;
$device_profile_settings = $this->database->select($sql, $parameters, 'all'); $device_profile_settings = $this->database->select($sql, $parameters, 'all');
if (is_array($device_profile_settings) && sizeof($device_profile_settings) != 0) { if (is_array($device_profile_settings) && sizeof($device_profile_settings) != 0) {
@@ -631,7 +631,7 @@
if (is_uuid($device_uuid)) { if (is_uuid($device_uuid)) {
$sql = "select * from v_device_settings "; $sql = "select * from v_device_settings ";
$sql .= "where device_uuid = :device_uuid "; $sql .= "where device_uuid = :device_uuid ";
$sql .= "and device_setting_enabled = 'true' "; $sql .= "and device_setting_enabled = true ";
$parameters['device_uuid'] = $device_uuid; $parameters['device_uuid'] = $device_uuid;
$device_settings = $this->database->select($sql, $parameters, 'all'); $device_settings = $this->database->select($sql, $parameters, 'all');
if (is_array($device_settings) && sizeof($device_settings) != 0) { if (is_array($device_settings) && sizeof($device_settings) != 0) {
@@ -685,7 +685,7 @@
//get the device lines array //get the device lines array
$sql = "select * from v_device_lines "; $sql = "select * from v_device_lines ";
$sql .= "where device_uuid = :device_uuid "; $sql .= "where device_uuid = :device_uuid ";
$sql .= "and (enabled = 'true' or enabled is null or enabled = '') "; $sql .= "and (enabled = true or enabled is null) ";
$parameters['device_uuid'] = $device_uuid; $parameters['device_uuid'] = $device_uuid;
//$database_device_lines = $this->database->select($sql, $parameters, 'all'); //$database_device_lines = $this->database->select($sql, $parameters, 'all');
foreach ($this->database->select($sql, $parameters, 'all') as $row) { foreach ($this->database->select($sql, $parameters, 'all') as $row) {
@@ -925,7 +925,7 @@
$sql .= "number_alias, extension, call_group "; $sql .= "number_alias, extension, call_group ";
$sql .= "from v_extensions "; $sql .= "from v_extensions ";
$sql .= "where domain_uuid = :domain_uuid "; $sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and enabled = 'true' "; $sql .= "and enabled = true ";
$sql .= "and directory_visible = 'true' "; $sql .= "and directory_visible = 'true' ";
$sql .= "order by directory_first_name, effective_caller_id_name asc "; $sql .= "order by directory_first_name, effective_caller_id_name asc ";
$parameters['domain_uuid'] = $domain_uuid; $parameters['domain_uuid'] = $domain_uuid;
@@ -1409,7 +1409,7 @@
//destination file path //destination file path
$dest_path = path_join($directory, $file_name); $dest_path = path_join($directory, $file_name);
if ($device_enabled == 'true') { if ($device_enabled) {
//output template to string for header processing //output template to string for header processing
$file_contents = $this->render(); $file_contents = $this->render();

Some files were not shown because too many files have changed in this diff Show More