Set default for enabled (#6556)

* Set default for enabled

* Update conference_profile_edit.php

* Update call_block_edit.php

* Update conference_control_edit.php

* Update conference_control_detail_edit.php

* Update conference_profile_edit.php

* Update conference_profile_param_edit.php

* Update conference_edit.php

* Update destination_edit.php

* Update device_edit.php

* Update device_profile_edit.php

* Update device_vendor_edit.php

* Update email_template_edit.php

* Update extension_edit.php

* Update module_edit.php

* Update phrase_edit.php

* Update ring_group_edit.php

* Update sip_profile_edit.php

* Update stream_edit.php

* Update time_condition_edit.php

* Update var_edit.php

* Update voicemail_edit.php

* Update call_block_edit.php

* Update default_setting_edit.php

* Update domain_setting_edit.php

* Update domain_edit.php

* Update user_edit.php

* Update bridge_edit.php

* Update sip_profile_edit.php

* Update sofia_global_setting_edit.php

* Update call_flow_edit.php

* Update email_template_edit.php

* Update call_flow_edit.php

* Update bridge_edit.php

* Update email_template_edit.php

* Update sip_profile_edit.php

* Update sofia_global_setting_edit.php

* Update bridge_edit.php

* Update call_flow_edit.php

* Update conference_control_edit.php

* Update sip_profile_edit.php

* Update stream_edit.php

* Update default_setting_edit.php

* Update email_template_edit.php

* Update extension_setting_edit.php

* Update default_setting_edit.php

* Update dashboard_edit.php

* Update dashboard_edit.php

* Update default_setting_edit.php
This commit is contained in:
Alex
2023-02-17 14:21:41 -07:00
committed by GitHub
parent ef866e12d7
commit 7326cb845a
29 changed files with 124 additions and 42 deletions

View File

@@ -50,11 +50,11 @@
}
//get http post variables and set them to php variables
if (is_array($_POST)) {
if (count($_POST) > 0) {
$bridge_uuid = $_POST["bridge_uuid"];
$bridge_name = $_POST["bridge_name"];
$bridge_destination = $_POST["bridge_destination"];
$bridge_enabled = $_POST["bridge_enabled"];
$bridge_enabled = $_POST["bridge_enabled"] ?: 'false';
$bridge_description = $_POST["bridge_description"];
}
@@ -162,6 +162,9 @@
unset($sql, $parameters, $row);
}
//set the defaults
if (strlen($bridge_enabled) == 0) { $bridge_enabled = 'true'; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);

View File

@@ -264,6 +264,9 @@
unset($sql, $parameters, $row);
}
//set the defaults
if (strlen($call_block_enabled) == 0) { $call_block_enabled = 'true'; }
//get the extensions
if (permission_exists('call_block_all') || permission_exists('call_block_extension')) {
$sql = "select extension_uuid, extension, number_alias, user_context, description from v_extensions ";

View File

@@ -59,7 +59,7 @@
$destination = new destinations;
//get http post variables and set them to php variables
if (is_array($_POST)) {
if (count($_POST) > 0) {
//set the variables from the http values
$call_flow_uuid = $_POST["call_flow_uuid"];
@@ -76,7 +76,7 @@
$call_flow_alternate_sound = $_POST["call_flow_alternate_sound"];
$call_flow_alternate_destination = $_POST["call_flow_alternate_destination"];
$call_flow_context = $_POST["call_flow_context"];
$call_flow_enabled = $_POST["call_flow_enabled"];
$call_flow_enabled = $_POST["call_flow_enabled"] ?: 'false';
$call_flow_description = $_POST["call_flow_description"];
//seperate the action and the param
@@ -356,6 +356,9 @@
$call_flow_context = $_SESSION['domain_name'];
}
//set the defaults
if (strlen($call_flow_enabled) == 0) { $call_flow_enabled = 'true'; }
//get the recordings
$sql = "select recording_name, recording_filename from v_recordings ";
$sql .= "where domain_uuid = :domain_uuid ";

View File

@@ -130,6 +130,9 @@
unset($sql, $parameters, $row);
}
//set the defaults
if (strlen($control_enabled) == 0) { $control_enabled = 'true'; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);

View File

@@ -31,9 +31,9 @@
}
//get http post variables and set them to php variables
if (is_array($_POST)) {
if (count($_POST) > 0) {
$control_name = $_POST["control_name"];
$control_enabled = $_POST["control_enabled"];
$control_enabled = $_POST["control_enabled"] ?: 'false';
$control_description = $_POST["control_description"];
}
@@ -123,6 +123,9 @@
unset($sql, $parameters, $row);
}
//set the defaults
if (strlen($control_enabled) == 0) { $control_enabled = 'true'; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);

View File

@@ -33,7 +33,7 @@
//get http post variables and set them to php variables
if (count($_POST) > 0) {
$profile_name = $_POST["profile_name"];
$profile_enabled = $_POST["profile_enabled"];
$profile_enabled = $_POST["profile_enabled"] ?: 'false';
$profile_description = $_POST["profile_description"];
}
//check to see if the http post exists
@@ -120,6 +120,9 @@
unset($sql, $parameters);
}
//set the defaults
if (strlen($profile_enabled) == 0) { $profile_enabled = 'true'; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
@@ -158,10 +161,18 @@
echo " ".$text['label-profile_enabled']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='profile_enabled'>\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['label-false']."</option>\n";
echo " </select>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') {
echo " <label 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' name='profile_enabled'>\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['label-false']."</option>\n";
echo " </select>\n";
}
echo "<br />\n";
echo $text['description-profile_enabled']."\n";
echo "</td>\n";

View File

@@ -128,6 +128,9 @@
unset($sql, $parameters);
}
//set the defaults
if (strlen($profile_param_enabled) == 0) { $profile_param_enabled = 'true'; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);

View File

@@ -296,6 +296,9 @@
unset($sql, $parameters, $row);
}
//set the defaults
if (strlen($conference_enabled) == 0) { $conference_enabled = 'true'; }
//get the conference profiles
$sql = "select * ";
$sql .= "from v_conference_profiles ";

View File

@@ -1127,6 +1127,7 @@
if (strlen($destination_order) == 0) { $destination_order = '100'; }
if (strlen($destination_type) == 0) { $destination_type = 'inbound'; }
if (strlen($destination_context) == 0) { $destination_context = 'public'; }
if (strlen($destination_enabled) == 0) { $destination_enabled = 'true'; }
if ($destination_type =="outbound") { $destination_context = $_SESSION['domain_name']; }
if ($destination_type =="local") { $destination_context = $_SESSION['domain_name']; }

View File

@@ -527,6 +527,9 @@
unset($sql, $parameters, $row);
}
//set the defaults
if (strlen($device_enabled) == 0) { $device_enabled = 'true'; }
//use the mac address to get the vendor
if (strlen($device_vendor) == 0) {
//get the device vendor using the mac address

View File

@@ -242,6 +242,9 @@
unset ($sql, $parameters);
}
//set the defaults
if (strlen($device_profile_enabled) == 0) { $device_profile_enabled = 'true'; }
//get the child data
if (strlen($device_profile_uuid) > 0) {
$sql = "select * from v_device_profile_keys ";

View File

@@ -140,6 +140,9 @@
unset($sql, $parameters, $row);
}
//set the defaults
if (strlen($enabled) == 0) { $enabled = true; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);

View File

@@ -52,7 +52,7 @@
}
//get http post variables and set them to php variables
if (is_array($_POST)) {
if (count($_POST) > 0) {
$domain_uuid = $_POST["domain_uuid"];
$template_language = $_POST["template_language"];
$template_category = $_POST["template_category"];
@@ -60,7 +60,7 @@
$template_subject = $_POST["template_subject"];
$template_body = $_POST["template_body"];
$template_type = $_POST["template_type"];
$template_enabled = $_POST["template_enabled"];
$template_enabled = $_POST["template_enabled"] ?: 'false';
$template_description = $_POST["template_description"];
}
@@ -168,6 +168,9 @@
unset($sql, $parameters, $row);
}
//set the defaults
if (strlen($template_enabled) == 0) { $template_enabled = 'true'; }
//load editor preferences/defaults
$setting_size = $_SESSION["editor"]["font_size"]["text"] != '' ? $_SESSION["editor"]["font_size"]["text"] : '12px';
$setting_theme = $_SESSION["editor"]["theme"]["text"] != '' ? $_SESSION["editor"]["theme"]["text"] : 'cobalt';

View File

@@ -61,12 +61,12 @@
}
//get http post variables and set them to php variables
if (is_array($_POST)) {
if (count($_POST) > 0) {
$domain_uuid = $_POST["domain_uuid"];
$extension_setting_type = $_POST["extension_setting_type"];
$extension_setting_name = $_POST["extension_setting_name"];
$extension_setting_value = $_POST["extension_setting_value"];
$extension_setting_enabled = $_POST["extension_setting_enabled"];
$extension_setting_enabled = $_POST["extension_setting_enabled"] ?: 'false';
$extension_setting_description = $_POST["extension_setting_description"];
}
@@ -213,6 +213,9 @@
unset($sql, $parameters, $row);
}
//set the defaults
if (strlen($extension_setting_enabled) == 0) { $extension_setting_enabled = 'true'; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);

View File

@@ -136,7 +136,7 @@
$absolute_codec_string = $_POST["absolute_codec_string"];
$force_ping = $_POST["force_ping"];
$dial_string = $_POST["dial_string"];
$enabled = $_POST["enabled"];
$enabled = $_POST["enabled"] ?: 'false';
$description = $_POST["description"];
//outbound caller id number - only allow numeric and +
@@ -1005,6 +1005,7 @@
if (strlen($user_record) == 0) { $user_record = $_SESSION['extension']['user_record_default']['text']; }
if (strlen($voicemail_transcription_enabled) == 0) { $voicemail_transcription_enabled = $_SESSION['voicemail']['transcription_enabled_default']['boolean']; }
if (strlen($voicemail_enabled) == 0) { $voicemail_enabled = $_SESSION['voicemail']['enabled_default']['boolean']; }
if (strlen($enabled) == 0) { $enabled = 'true'; }
//create token
$object = new token;

View File

@@ -163,6 +163,10 @@
unset($sql, $parameters, $row);
}
//set the defaults
if (strlen($module_enabled) == 0) { $module_enabled = 'true'; }
if (strlen($module_default_enabled) == 0) { $module_default_enabled = 'true'; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);

View File

@@ -286,6 +286,9 @@
unset($sql, $parameters, $row);
}
//set the defaults
if (strlen($phrase_enabled) == 0) { $phrase_enabled = 'true'; }
//get the phrase details
if (is_uuid($phrase_uuid)) {
$sql = "select * from v_phrase_details ";

View File

@@ -503,7 +503,7 @@
}
}
//set the default
//set the defaults
$destination_delay_max = $_SESSION['ring_group']['destination_delay_max']['numeric'];
$destination_timeout_max = $_SESSION['ring_group']['destination_timeout_max']['numeric'];
if (strlen($ring_group_ringback) == 0) {
@@ -512,6 +512,7 @@
if (strlen($ring_group_call_timeout) == 0) {
$ring_group_call_timeout = '30';
}
if (strlen($ring_group_enabled) == 0) { $ring_group_enabled = 'true'; }
//get the ring group destination array
if ($action == "add") {

View File

@@ -55,7 +55,7 @@
}
//get http post variables and set them to php variables
if (is_array($_POST)) {
if (count($_POST) > 0) {
//process the http post data by submitted action
if ($_POST['action'] != '' && is_uuid($_POST['sip_profile_uuid'])) {
@@ -259,6 +259,9 @@
unset($sql, $parameters, $row);
}
//set the defaults
if (strlen($sip_profile_enabled) == 0) { $sip_profile_enabled = 'true'; }
//get the child data
$sql = "select * from v_sip_profile_settings ";
$sql .= "where sip_profile_uuid = :sip_profile_uuid ";

View File

@@ -156,6 +156,9 @@
unset($sql, $parameters, $row);
}
//set the defaults
if (strlen($global_setting_enabled) == 0) { $global_setting_enabled = true; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
@@ -226,21 +229,18 @@
echo " ".$text['label-global_setting_enabled']."\n";
echo "</td>\n";
echo "<td class='vtable' style='position: relative;' align='left'>\n";
echo " <select class='formfld' name='global_setting_enabled'>\n";
echo " <option value=''></option>\n";
if ($global_setting_enabled == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') {
echo " <label class='switch'>\n";
echo " <input type='checkbox' id='global_setting_enabled' name='global_setting_enabled' value='true' ".($global_setting_enabled == true ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
echo " <select class='formfld' name='global_setting_enabled'>\n";
echo " <option value='true' ".($global_setting_enabled == "true" ? "selected='selected'" : null).">".$text['label-true']."</option>\n";
echo " <option value='false' ".($global_setting_enabled == "false" ? "selected='selected'" : null).">".$text['label-false']."</option>\n";
echo " </select>\n";
}
if ($global_setting_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>\n";
echo "<br />\n";
echo $text['description-global_setting_enabled']."\n";
echo "</td>\n";
@@ -267,4 +267,4 @@
//include the footer
require_once "resources/footer.php";
?>
?>

View File

@@ -53,12 +53,12 @@
}
//get http post variables and set them to php variables
if (is_array($_POST)) {
if (count($_POST) > 0) {
$domain_uuid = $_POST['domain_uuid'];
$stream_uuid = $_POST["stream_uuid"];
$stream_name = $_POST["stream_name"];
$stream_location = $_POST["stream_location"];
$stream_enabled = $_POST["stream_enabled"];
$stream_enabled = $_POST["stream_enabled"] ?: 'false';
$stream_description = $_POST["stream_description"];
}
@@ -154,6 +154,9 @@
unset($sql, $parameters, $row);
}
//set the defaults
if (strlen($stream_enabled) == 0) { $stream_enabled = 'true'; }
//need stream_all permission to edit a global stream
if (!permission_exists('stream_all') && $domain_uuid == null) {
header('Location: streams.php');

View File

@@ -664,6 +664,7 @@
//set the defaults
if (strlen($dialplan_context) == 0) { $dialplan_context = $_SESSION['domain_name']; }
if (strlen($dialplan_enabled) == 0) { $dialplan_enabled = 'true'; }
//create token
$object = new token;

View File

@@ -178,6 +178,9 @@
unset($sql, $parameters);
}
//set the defaults
if (strlen($var_enabled) == 0) { $var_enabled = 'true'; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);

View File

@@ -319,11 +319,11 @@
//remove the spaces
$voicemail_mail_to = str_replace(" ", "", $voicemail_mail_to);
//set defaults
if (strlen($voicemail_local_after_email) == 0) { $voicemail_local_after_email = "true"; }
if (strlen($voicemail_enabled) == 0) { $voicemail_enabled = "true"; }
//set the defaults
if (strlen($voicemail_local_after_email) == 0) { $voicemail_local_after_email = 'true'; }
if (strlen($voicemail_enabled) == 0) { $voicemail_enabled = 'true'; }
if (strlen($voicemail_transcription_enabled) == 0) { $voicemail_transcription_enabled = $_SESSION['voicemail']['transcription_enabled_default']['boolean']; }
if (strlen($voicemail_tutorial) == 0) { $voicemail_tutorial = "false"; }
if (strlen($voicemail_tutorial) == 0) { $voicemail_tutorial = 'false'; }
//get the greetings list
$sql = "select * from v_voicemail_greetings ";

View File

@@ -54,7 +54,7 @@
}
//get http post variables and set them to php variables
if (is_array($_POST)) {
if (count($_REQUEST) > 0) {
$dashboard_name = $_POST["dashboard_name"];
$dashboard_path = $_POST["dashboard_path"];
$dashboard_groups = $_POST["dashboard_groups"];
@@ -224,6 +224,9 @@
unset($sql, $parameters, $row);
}
//set the defaults
if (strlen($dashboard_enabled) == 0) { $dashboard_enabled = true; }
//get the child data
if (is_uuid($dashboard_uuid)) {
$sql = "select ";
@@ -477,8 +480,8 @@
}
else {
echo " <select class='formfld' id='dashboard_enabled' name='dashboard_enabled'>\n";
echo " <option value='false'>".$text['option-false']."</option>\n";
echo " <option value='true' ".($dashboard_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='true' ".($dashboard_enabled == true ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($dashboard_enabled == false ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n";
}
echo "<br />\n";

View File

@@ -62,7 +62,7 @@
$default_setting_name = strtolower($_POST["default_setting_name"]);
$default_setting_value = $_POST["default_setting_value"];
$default_setting_order = $_POST["default_setting_order"];
$default_setting_enabled = $_POST["default_setting_enabled"];
$default_setting_enabled = $_POST["default_setting_enabled"] ?: 'false';
$default_setting_description = $_POST["default_setting_description"];
}
@@ -246,6 +246,9 @@
unset($sql, $parameters);
}
//set the defaults
if (strlen($default_setting_enabled) == 0) { $default_setting_enabled = 'true'; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);

View File

@@ -348,6 +348,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
unset($sql, $parameters);
}
//set the defaults
if (strlen($domain_setting_enabled) == 0) { $domain_setting_enabled = 'true'; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);

View File

@@ -570,6 +570,9 @@
unset($sql, $parameters, $row);
}
//set the defaults
if (strlen($domain_enabled) == 0) { $domain_enabled = 'true'; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);

View File

@@ -137,7 +137,7 @@
$contact_name_family = $_POST["contact_name_family"];
}
$group_uuid_name = $_POST["group_uuid_name"];
$user_enabled = $_POST["user_enabled"];
$user_enabled = $_POST["user_enabled"] ?: 'false';
if (permission_exists('api_key')) {
$api_key = $_POST["api_key"];
}
@@ -638,6 +638,9 @@
}
}
//set the defaults
if (strlen($user_enabled) == 0) { $user_enabled = "true"; }
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);