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

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