Use the new destinations php class for ivr menu and destinations.

This commit is contained in:
markjcrane
2015-08-07 13:13:55 -05:00
parent 0719fe2465
commit 28ad9a34af
4 changed files with 17 additions and 12 deletions

View File

@@ -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 " </td>\n";
echo " <td class='list_control_icons' style='width: 25px;'>";
if (strlen($row['destination_uuid']) > 0) {

View File

@@ -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;

View File

@@ -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 " <input class='formfld' style='width:70px' type='text' name='ivr_menu_options[".$c."][ivr_menu_option_digits]' maxlength='255' value='$ivr_menu_option_digits'>\n";
echo "</td>\n";
echo "<td class='vtable' align='left' nowrap='nowrap'>\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 "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select name='ivr_menu_options[".$c."][ivr_menu_option_order]' class='formfld' style='width:55px'>\n";
@@ -731,8 +733,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo " ".$text['label-exit_action']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
//switch_select_destination(select_type, select_label, select_name, select_value, select_style, action);
switch_select_destination("dialplan", "", "ivr_menu_exit_action", $ivr_menu_exit_action, "", "");
$destination->select('dialplan', 'ivr_menu_exit_action', $ivr_menu_exit_action);
echo " <br />\n";
echo " ".$text['description-exit_action']."\n";
echo "</td>\n";

View File

@@ -278,13 +278,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
//switch_select_destination($select_type, $select_label, $select_name, $select_value, $select_style, $action='')
$tmp_select_value = '';
$destination_action = '';
if (strlen($ivr_menu_option_action.$ivr_menu_option_param) > 0) {
$tmp_select_value = $ivr_menu_option_action.':'.$ivr_menu_option_param;
$destination_action = $ivr_menu_option_action.':'.$ivr_menu_option_param;
}
switch_select_destination("ivr", $ivr_menu_options_label, "ivr_menu_option_param", $tmp_select_value, "width: 350px;", $ivr_menu_option_action);
unset($tmp_select_value);
$destination->select('ivr', 'ivr_menu_option_param', $destination_action);
unset($destination_action);
echo "<br />\n";
echo $text['description-destination']."\n";