diff --git a/app/time_conditions/time_condition_edit.php b/app/time_conditions/time_condition_edit.php index cf6b1e3013..b1eb3c02c6 100644 --- a/app/time_conditions/time_condition_edit.php +++ b/app/time_conditions/time_condition_edit.php @@ -524,6 +524,26 @@ require_once "resources/paging.php"; $x++; } unset($result); + + //get the last action and anti-action + //echo "
\n";
+			//print_r($details);
+			//$detail_anti_action = $row['dialplan_detail_type'].$divider.$row['dialplan_detail_data'];
+			foreach($details as $group) {
+				foreach ($group as $row) {
+					if ($row['dialplan_detail_tag'] == 'action') {
+						//echo $row['dialplan_detail_tag']." ".$row['dialplan_detail_type'].":".$row['dialplan_detail_data']."\n";
+						$detail_action = $row['dialplan_detail_type'].':'.$row['dialplan_detail_data'];
+					}
+					if ($row['dialplan_detail_tag'] == 'anti-action') {
+						//echo $row['dialplan_detail_tag']." ".$row['dialplan_detail_type'].":".$row['dialplan_detail_data']."\n";
+						$detail_anti_action = $row['dialplan_detail_type'].':'.$row['dialplan_detail_data'];
+					}
+				}
+			}
+			//echo "
\n"; + //exit; + //blank row foreach($details as $group => $row) { //set the array key for the empty row @@ -822,26 +842,47 @@ require_once "resources/paging.php"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo " ".$text['label-action']."\n"; - echo "\n"; - echo "\n"; - //switch_select_destination(select_type, select_label, select_name, select_value, select_style, $action); - switch_select_destination("dialplan", $action_1, "action_1", $action_1, "", ""); - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo " ".$text['label-action-alternate']."\n"; - echo "\n"; - echo "\n"; - //switch_select_destination(select_type, select_label, select_name, select_value, select_style, $action); - switch_select_destination("dialplan", $anti_action_1, "anti_action_1", $anti_action_1, "", ""); - echo "
\n"; - echo "\n"; - echo "\n"; + $x = 0; + foreach($details as $group) { + foreach ($group as $row) { + if ($row['dialplan_detail_tag'] == 'action' && $row['dialplan_detail_type'] != 'set') { + echo "\n"; + echo "\n"; + echo " ".$text['label-action']."\n"; + echo "\n"; + echo "\n"; + //switch_select_destination(select_type, select_label, select_name, select_value, select_style, $action); + //switch_select_destination("dialplan", $action_1, "action_1", $action_1, "", ""); + + //echo $row['dialplan_detail_tag']." ".$row['dialplan_detail_type'].":".$row['dialplan_detail_data']."\n"; + $data = $row['dialplan_detail_data']; + $label = explode("XML", $data); + $divider = ($row['dialplan_detail_type'] != '') ? ":" : null; + $detail_action = $row['dialplan_detail_type'].$divider.$row['dialplan_detail_data']; + switch_select_destination("dialplan", $label[0], "dialplan_details[".$x."][action]", $detail_action, "width: 60%;", 'action'); + echo "\n"; + echo "\n"; + } + if ($row['dialplan_detail_tag'] == 'anti-action' && $row['dialplan_detail_type'] != 'set') { + echo "\n"; + echo "\n"; + echo " ".$text['label-action-alternate']."\n"; + echo "\n"; + echo "\n"; + //switch_select_destination(select_type, select_label, select_name, select_value, select_style, $action); + //switch_select_destination("dialplan", $anti_action_1, "anti_action_1", $anti_action_1, "", ""); + + $label = explode("XML", $row['dialplan_detail_data']); + $divider = ($row['dialplan_detail_type'] != '') ? ":" : null; + $detail_action = $row['dialplan_detail_type'].$divider.$row['dialplan_detail_data']; + switch_select_destination("dialplan", $label[0], "dialplan_details[".$x."][anti_action]", $detail_action, "width: 60%;", 'action'); + echo "\n"; + echo "\n"; + } + } + $x++; + } echo "\n"; echo "\n"; @@ -869,13 +910,13 @@ require_once "resources/paging.php"; echo "\n"; echo "