Compress the vertical spacing default settings code. Display the category API in upper case.

This commit is contained in:
Mark Crane 2015-03-21 05:36:52 +00:00
parent 96fcd2d098
commit 2661f7f6e5
1 changed files with 211 additions and 225 deletions

View File

@ -40,7 +40,6 @@ else {
//get posted values, if any
if (sizeof($_REQUEST) > 0) {
$action = check_str($_REQUEST["action"]);
$default_setting_uuids = $_REQUEST["id"];
$enabled = check_str($_REQUEST['enabled']);
@ -59,13 +58,10 @@ if (sizeof($_REQUEST) > 0) {
}
if ($action == 'copy' && permission_exists('domain_setting_add')) {
$target_domain_uuid = check_str($_POST["target_domain_uuid"]);
if ($target_domain_uuid != '' && sizeof($default_setting_uuids) > 0) {
$settings_copied = 0;
foreach ($default_setting_uuids as $default_setting_uuid) {
// get default setting from db
@ -111,9 +107,8 @@ if (sizeof($_REQUEST) > 0) {
// fix null
$default_setting_order = ($default_setting_order != '') ? $default_setting_order : 'null';
if ($action == "add" && permission_exists("domain_select") && permission_exists("domain_setting_add") && count($_SESSION['domains']) > 1) {
// insert for target domain
if ($action == "add" && permission_exists("domain_select") && permission_exists("domain_setting_add") && count($_SESSION['domains']) > 1) {
$sql = "insert into v_domain_settings ";
$sql .= "(";
$sql .= "domain_uuid, ";
@ -142,11 +137,9 @@ if (sizeof($_REQUEST) > 0) {
unset($sql);
$settings_copied++;
} // add
if ($action == "update" && permission_exists('domain_setting_edit')) {
$sql = "update v_domain_settings set ";
$sql .= "domain_setting_category = '".$default_setting_category."', ";
$sql .= "domain_setting_subcategory = '".$default_setting_subcategory."', ";
@ -161,14 +154,11 @@ if (sizeof($_REQUEST) > 0) {
unset($sql);
$settings_copied++;
} // update
} // foreach
// set message
$_SESSION["message"] = $text['message-copy'].": ".$settings_copied;
}
else {
// set message
@ -177,11 +167,9 @@ if (sizeof($_REQUEST) > 0) {
header("Location: default_settings.php");
exit;
}
if ($action == 'delete' && permission_exists('default_setting_delete')) {
if (sizeof($default_setting_uuids) > 0) {
foreach ($default_setting_uuids as $default_setting_uuid) {
//delete default_setting(s)
@ -203,16 +191,12 @@ if (sizeof($_REQUEST) > 0) {
header("Location: default_settings.php");
exit;
}
} // post
//header and paging
require_once "resources/header.php";
$document['title'] = $text['title-default_settings'];
require_once "resources/paging.php";
//get variables used to control the order
@ -345,6 +329,9 @@ if (permission_exists("domain_select") && permission_exists("domain_setting_add"
}
echo " <br />\n";
echo " <b>\n";
if (strtolower($row['default_setting_category']) == "api") {
echo " API";
}
if (strtolower($row['default_setting_category']) == "cdr") {
echo " CDR";
}
@ -380,7 +367,6 @@ if (permission_exists("domain_select") && permission_exists("domain_setting_add"
echo "</tr>\n";
}
$tr_link = (permission_exists('default_setting_edit')) ? "href='default_setting_edit.php?id=".$row['default_setting_uuid']."'" : null;
echo "<tr ".$tr_link.">\n";
if (