From 9eaa4d4a114dae2b1b92857c3c49533cbb4483a0 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Sat, 27 Jul 2013 17:59:06 +0000 Subject: [PATCH] Additional adjustments to the destinations edit adding timeout and delay selects. --- .../ring_group_destination_edit.php | 47 +++++++++++++++---- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/app/ring_groups/ring_group_destination_edit.php b/app/ring_groups/ring_group_destination_edit.php index 84bd6627e9..68c5fe2c56 100644 --- a/app/ring_groups/ring_group_destination_edit.php +++ b/app/ring_groups/ring_group_destination_edit.php @@ -63,6 +63,25 @@ else { $destination_prompt = check_str($_POST["destination_prompt"]); } +//define the destination_select function + function destination_select($select_name, $select_value, $select_default) { + if (strlen($select_value) == 0) { $select_value = $select_default; } + echo " \n"; + } + if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $msg = ''; @@ -104,7 +123,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "destination_delay, "; $sql .= "destination_timeout, "; $sql .= "destination_prompt "; - $sql .= ")"; + $sql .= ") "; $sql .= "values "; $sql .= "("; $sql .= "'$domain_uuid', "; @@ -131,15 +150,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update" && permission_exists('ring_group_edit')) { $sql = "update v_ring_group_destinations set "; - $sql .= "ring_group_uuid = '$ring_group_uuid', "; - $sql .= "domain_uuid = '$domain_uuid', "; - $sql .= "ring_group_uuid = '$ring_group_uuid', "; $sql .= "destination_number = '$destination_number', "; $sql .= "destination_delay = '$destination_delay', "; $sql .= "destination_timeout = '$destination_timeout', "; $sql .= "destination_prompt = '$destination_prompt' "; $sql .= "where domain_uuid = '$domain_uuid' "; - $sql .= "and ring_group_destination_uuid = '$ring_group_destination_uuid'"; + $sql .= "and ring_group_destination_uuid = '$ring_group_destination_uuid' "; $db->exec(check_sql($sql)); unset($sql); @@ -169,7 +185,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $destination_delay = $row["destination_delay"]; $destination_timeout = $row["destination_timeout"]; $destination_prompt = $row["destination_prompt"]; - break; //limit to 1 row } unset ($prep_statement); } @@ -208,7 +223,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " ".$text['label-destination_delay'].":\n"; echo "\n"; echo "\n"; - echo " \n"; + destination_select('destination_delay', $destination_delay, '0'); + //echo " \n"; echo "
\n"; echo $text['description-destination_delay']."\n"; echo "\n"; @@ -219,7 +235,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " ".$text['label-destination_timeout'].":\n"; echo "\n"; echo "\n"; - echo " \n"; + destination_select('destination_timeout', $destination_timeout, '30'); + //echo " \n"; echo "
\n"; echo $text['description-destination_timeout']."\n"; echo "\n"; @@ -232,8 +249,18 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo " \n"; echo "
\n"; echo $text['description-destination_prompt']."\n";