Time Conditions: Revert commit ccd5a11d90.
This commit is contained in:
@@ -135,7 +135,7 @@
|
|||||||
$dialplan_context = $row["dialplan_context"];
|
$dialplan_context = $row["dialplan_context"];
|
||||||
}
|
}
|
||||||
unset($sql, $parameters, $row);
|
unset($sql, $parameters, $row);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -515,10 +515,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//redirect the browser
|
//redirect the browser
|
||||||
if (is_uuid($dialplan_uuid)) {
|
header("Location: time_condition_edit.php?id=".$dialplan_uuid.($app_uuid != '' ? "&app_uuid=".$app_uuid : null));
|
||||||
header("Location: time_condition_edit.php?id=".$dialplan_uuid.($app_uuid != '' ? "&app_uuid=".$app_uuid : null));
|
exit;
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -559,7 +557,7 @@
|
|||||||
$sql .= " ) ";
|
$sql .= " ) ";
|
||||||
$sql .= " or ( ";
|
$sql .= " or ( ";
|
||||||
$sql .= " dialplan_detail_tag = 'action' ";
|
$sql .= " dialplan_detail_tag = 'action' ";
|
||||||
//$sql .= " and dialplan_detail_data not like 'preset=%' ";
|
$sql .= " and dialplan_detail_data not like 'preset=%' ";
|
||||||
$sql .= " ) ";
|
$sql .= " ) ";
|
||||||
$sql .= ") ";
|
$sql .= ") ";
|
||||||
$sql .= "order by dialplan_detail_group asc, dialplan_detail_order asc";
|
$sql .= "order by dialplan_detail_group asc, dialplan_detail_order asc";
|
||||||
@@ -586,25 +584,25 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//find the selected presets
|
// //find the selected presets
|
||||||
if (is_array($available_presets)) {
|
// if (is_array($available_presets)) {
|
||||||
foreach ($available_presets as $preset_number => &$preset) {
|
// foreach ($available_presets as $preset_number => &$preset) {
|
||||||
if (is_array($preset)) {
|
// if (is_array($preset)) {
|
||||||
foreach ($preset as $preset_name => $preset_variables) {
|
// foreach ($preset as $preset_name => $preset_variables) {
|
||||||
$preset_checked[$preset_name] = 'false';
|
// $preset_checked[$preset_name] = 'false';
|
||||||
if (is_array($dialplan_details)) {
|
// if (is_array($dialplan_details)) {
|
||||||
foreach ($dialplan_details as $row) {
|
// foreach ($dialplan_details as $row) {
|
||||||
if ($row['dialplan_detail_tag'] == 'action') {
|
// if ($row['dialplan_detail_tag'] == 'action') {
|
||||||
if ($row['dialplan_detail_data'] == 'preset='.$preset_name) {
|
// if ($row['dialplan_detail_data'] == 'preset='.$preset_name) {
|
||||||
$preset_checked[$preset_name] = 'true';
|
// $preset_checked[$preset_name] = 'true';
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
//loop through available presets (if any)
|
//loop through available presets (if any)
|
||||||
if (is_array($available_presets)) {
|
if (is_array($available_presets)) {
|
||||||
@@ -623,7 +621,7 @@
|
|||||||
}
|
}
|
||||||
//if all preset variables found, then condition is a preset
|
//if all preset variables found, then condition is a preset
|
||||||
if ($matches == sizeof($preset_variables)) {
|
if ($matches == sizeof($preset_variables)) {
|
||||||
|
|
||||||
$current_presets[$preset_number] = $group_id;
|
$current_presets[$preset_number] = $group_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1054,7 +1052,8 @@ if ($action == 'update') {
|
|||||||
foreach ($available_presets as $preset_number => $preset) {
|
foreach ($available_presets as $preset_number => $preset) {
|
||||||
if (is_array($preset)) {
|
if (is_array($preset)) {
|
||||||
foreach ($preset as $preset_name => $preset_variables) {
|
foreach ($preset as $preset_name => $preset_variables) {
|
||||||
$checked = (is_array($current_presets) && $preset_checked[$preset_name] == 'true') ? "checked='checked'" : null;
|
$checked = (is_array($current_presets) && $current_presets[$preset_number] != '') ? "checked='checked'" : null;
|
||||||
|
// $checked = (is_array($current_presets) && $preset_checked[$preset_name] == 'true') ? "checked='checked'" : null;
|
||||||
|
|
||||||
$preset_group_id = ($checked) ? $current_presets[$preset_number] : $preset_group_id = $preset_number * 5 + 100;
|
$preset_group_id = ($checked) ? $current_presets[$preset_number] : $preset_group_id = $preset_number * 5 + 100;
|
||||||
if (strlen($text['label-preset_'.$preset_name]) > 0) {
|
if (strlen($text['label-preset_'.$preset_name]) > 0) {
|
||||||
@@ -1083,7 +1082,7 @@ if ($action == 'update') {
|
|||||||
echo " </table>";
|
echo " </table>";
|
||||||
echo " <br />";
|
echo " <br />";
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
/*****/
|
|
||||||
if ($action == 'update' && is_array($current_presets) && $current_presets[$preset_number] != '') {
|
if ($action == 'update' && is_array($current_presets) && $current_presets[$preset_number] != '') {
|
||||||
//add (potentially customized) preset conditions and populate
|
//add (potentially customized) preset conditions and populate
|
||||||
if (is_array($current_conditions[$preset_group_id])) {
|
if (is_array($current_conditions[$preset_group_id])) {
|
||||||
@@ -1141,7 +1140,7 @@ if ($action == 'update') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1266,4 +1265,4 @@ if ($action == 'update') {
|
|||||||
//include the footer
|
//include the footer
|
||||||
require_once "resources/footer.php";
|
require_once "resources/footer.php";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user