Эх сурвалжийг харах

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
Alex 2 жил өмнө
parent
commit
39c331474f

+ 6 - 3
core/dashboard/dashboard_edit.php

@@ -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";

+ 4 - 1
core/default_settings/default_setting_edit.php

@@ -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']);

+ 3 - 0
core/domain_settings/domain_setting_edit.php

@@ -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']);

+ 3 - 0
core/domains/domain_edit.php

@@ -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']);

+ 4 - 1
core/users/user_edit.php

@@ -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']);