From a2e534cac28c99ea6993b829c9b06befa6ee5e20 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Thu, 16 Jan 2014 19:20:48 +0000 Subject: [PATCH] Set inbound routes default order to 100, and time conditions to 300. --- app/dialplan_inbound/dialplan_inbound_add.php | 86 +++++-------------- app/time_conditions/time_condition_add.php | 25 +++--- 2 files changed, 33 insertions(+), 78 deletions(-) diff --git a/app/dialplan_inbound/dialplan_inbound_add.php b/app/dialplan_inbound/dialplan_inbound_add.php index d27dad6e06..f61b6cf3c4 100644 --- a/app/dialplan_inbound/dialplan_inbound_add.php +++ b/app/dialplan_inbound/dialplan_inbound_add.php @@ -139,6 +139,14 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $dialplan_name = str_replace(" ", "_", $dialplan_name); $dialplan_name = str_replace("/", "", $dialplan_name); + //set the context + if (count($_SESSION["domains"]) > 1) { + $context = 'default'; + } + else { + $context = '$${domain_name}'; + } + //start the atomic transaction $count = $db->exec("BEGIN;"); //returns affected rows @@ -246,60 +254,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { unset($sql); } - //set domain - if (count($_SESSION["domains"]) > 1) { - $dialplan_detail_uuid = uuid(); - $sql = "insert into v_dialplan_details "; - $sql .= "("; - $sql .= "domain_uuid, "; - $sql .= "dialplan_uuid, "; - $sql .= "dialplan_detail_uuid, "; - $sql .= "dialplan_detail_tag, "; - $sql .= "dialplan_detail_type, "; - $sql .= "dialplan_detail_data, "; - $sql .= "dialplan_detail_order "; - $sql .= ") "; - $sql .= "values "; - $sql .= "("; - $sql .= "'$domain_uuid', "; - $sql .= "'$dialplan_uuid', "; - $sql .= "'$dialplan_detail_uuid', "; - $sql .= "'action', "; - $sql .= "'set', "; - $sql .= "'domain=".$_SESSION['domain_name']."', "; - $sql .= "'40' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); - } - - //set domain_name - if (count($_SESSION["domains"]) > 1) { - $dialplan_detail_uuid = uuid(); - $sql = "insert into v_dialplan_details "; - $sql .= "("; - $sql .= "domain_uuid, "; - $sql .= "dialplan_uuid, "; - $sql .= "dialplan_detail_uuid, "; - $sql .= "dialplan_detail_tag, "; - $sql .= "dialplan_detail_type, "; - $sql .= "dialplan_detail_data, "; - $sql .= "dialplan_detail_order "; - $sql .= ") "; - $sql .= "values "; - $sql .= "("; - $sql .= "'$domain_uuid', "; - $sql .= "'$dialplan_uuid', "; - $sql .= "'$dialplan_detail_uuid', "; - $sql .= "'action', "; - $sql .= "'set', "; - $sql .= "'domain_name=".$_SESSION['domain_name']."', "; - $sql .= "'50' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); - } - //set call_direction if (count($_SESSION["domains"]) > 1) { $dialplan_detail_uuid = uuid(); @@ -918,23 +872,23 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; - echo " ".$text['label-order'].":\n"; + echo " ".$text['label-order'].":\n"; echo "\n"; echo "\n"; - echo " \n"; if (strlen(htmlspecialchars($public_order))> 0) { - echo " \n"; + echo " \n"; } - $i=0; - while($i<=999) { - if (strlen($i) == 1) { echo " \n"; } - if (strlen($i) == 2) { echo " \n"; } - if (strlen($i) == 3) { echo " \n"; } - $i++; + $i = 100; + while($i <= 999) { + if (strlen($i) == 1) { echo " \n"; } + if (strlen($i) == 2) { echo " \n"; } + if (strlen($i) == 3) { echo " \n"; } + $i = $i + 10; } - echo " \n"; - echo "
\n"; - echo "\n"; + echo " \n"; + echo "
\n"; + echo " \n"; echo "\n"; echo "\n"; diff --git a/app/time_conditions/time_condition_add.php b/app/time_conditions/time_condition_add.php index 03f7a277a8..076c15ccd9 100644 --- a/app/time_conditions/time_condition_add.php +++ b/app/time_conditions/time_condition_add.php @@ -42,9 +42,9 @@ foreach($text as $key => $value) { $text[$key] = $value[$_SESSION['domain']['language']['code']]; } -$order_by = $_GET["order_by"]; -$order = $_GET["order"]; - +//set the variables + $order_by = check_str($_GET["order_by"]); + $order = check_str($_GET["order"]); //get the post form variables and se them to php variables if (count($_POST)>0) { @@ -1013,18 +1013,19 @@ echo "\n"; echo " ".$text['label-order'].":\n"; echo "\n"; echo "\n"; -echo " \n"; if (strlen(htmlspecialchars($dialplan_order))> 0) { - echo " \n"; + echo " \n"; } -$i=0; -while($i<=999) { - if (strlen($i) == 1) { echo " \n"; } - if (strlen($i) == 2) { echo " \n"; } - if (strlen($i) == 3) { echo " \n"; } - $i++; + +$i = 300; +while($i <= 999) { + if (strlen($i) == 1) { echo " \n"; } + if (strlen($i) == 2) { echo " \n"; } + if (strlen($i) == 3) { echo " \n"; } + $i = $i + 10; } -echo " \n"; +echo " \n"; echo "
\n"; echo "\n"; echo "\n";