From 4366aa083ad958a5b2e4cb58a79e6da91b4850ca Mon Sep 17 00:00:00 2001 From: markjcrane Date: Fri, 7 Aug 2015 13:13:55 -0500 Subject: [PATCH] Use the new destinations php class for ivr menu and destinations. --- app/destinations/destination_edit.php | 7 +++++-- app/gateways/app_config.php | 2 ++ app/ivr_menus/ivr_menu_edit.php | 11 ++++++----- app/ivr_menus/ivr_menu_option_edit.php | 9 ++++----- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index 9fcf6629cc..c1eb925e54 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -476,6 +476,10 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { } //if ($_POST["persistformvar"] != "true") } //(count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) + +//initialize the destinations object + $destination = new destinations; + //pre-populate the form if (count($_GET) > 0 && $_POST["persistformvar"] != "true") { $destination_uuid = $_GET["id"]; @@ -651,8 +655,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $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."][dialplan_detail_data]", $detail_action, "width: 60%;", $row['dialplan_detail_type']); - + $destination->select('dialplan', 'dialplan_details['.$x.'][dialplan_detail_data]', $detail_action); echo " \n"; echo " "; if (strlen($row['destination_uuid']) > 0) { diff --git a/app/gateways/app_config.php b/app/gateways/app_config.php index 26fa5a8560..f193de9caa 100644 --- a/app/gateways/app_config.php +++ b/app/gateways/app_config.php @@ -21,6 +21,7 @@ $apps[$x]['description']['pt-br'] = ""; //destination details + /* $y = 0; $apps[$x]['destinations'][$y]['type'] = "sql"; $apps[$x]['destinations'][$y]['label'] = "gateways"; @@ -38,6 +39,7 @@ $apps[$x]['destinations'][$y]['select_value']['dialplan'] = "bridge:sofia/gateway/\${destination}/"; $apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:bridge sofia/gateway/\${destination}/"; $apps[$x]['destinations'][$y]['select_label'] = "\${name}@\${domain_name} \${description}"; + */ //permission details $y = 0; diff --git a/app/ivr_menus/ivr_menu_edit.php b/app/ivr_menus/ivr_menu_edit.php index 8ae74dcdf3..8693b78845 100644 --- a/app/ivr_menus/ivr_menu_edit.php +++ b/app/ivr_menus/ivr_menu_edit.php @@ -259,6 +259,10 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { } //if ($_POST["persistformvar"] != "true") } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) + +//initialize the destinations object + $destination = new destinations; + //pre-populate the form if (strlen($ivr_menu_uuid) == 0) { $ivr_menu_uuid = check_str($_REQUEST["id"]); } if (strlen($ivr_menu_uuid) > 0 && $_POST["persistformvar"] != "true") { @@ -674,9 +678,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo "\n"; echo "\n"; - $tmp_select_value = ''; - switch_select_destination("ivr", $ivr_menu_options_label, 'ivr_menu_options['.$c.'][ivr_menu_option_param]', $tmp_select_value, "width:175px", $ivr_menu_option_action); - unset($tmp_select_value); + $destination->select('ivr', 'ivr_menu_options['.$c.'][ivr_menu_option_param]', $destination_action); echo "\n"; echo "\n"; echo "