Check to see if that features app_config.php file exists before adding it to the switch_select_destination list.

This commit is contained in:
Mark Crane 2014-03-18 06:39:13 +00:00
parent a035c697b6
commit f5adb254f1
1 changed files with 645 additions and 615 deletions

View File

@ -453,6 +453,7 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
echo " <option></option>\n"; echo " <option></option>\n";
//list call center queues //list call center queues
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/call_center/app_config.php")) {
if ($select_type == "dialplan" || $select_type == "ivr") { if ($select_type == "dialplan" || $select_type == "ivr") {
$sql = "select * from v_call_center_queues "; $sql = "select * from v_call_center_queues ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
@ -494,8 +495,10 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
} }
unset ($prep_statement); unset ($prep_statement);
} }
}
//list call flows //list call flows
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/call_flows/app_config.php")) {
if ($select_type == "dialplan" || $select_type == "ivr") { if ($select_type == "dialplan" || $select_type == "ivr") {
$sql = "select * from v_call_flows "; $sql = "select * from v_call_flows ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
@ -529,8 +532,10 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
echo "</optgroup>\n"; echo "</optgroup>\n";
unset ($prep_statement, $call_flow_extension); unset ($prep_statement, $call_flow_extension);
} }
}
//list call groups //list call groups
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/extensions/app_config.php")) {
if ($select_type == "dialplan" || $select_type == "ivr") { if ($select_type == "dialplan" || $select_type == "ivr") {
$sql = "select distinct(call_group) from v_extensions "; $sql = "select distinct(call_group) from v_extensions ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
@ -576,8 +581,10 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
} }
unset ($prep_statement); unset ($prep_statement);
} }
}
//list conference centers //list conference centers
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/conference_centers/app_config.php")) {
if ($select_type == "dialplan" || $select_type == "ivr") { if ($select_type == "dialplan" || $select_type == "ivr") {
$sql = "select * from v_conference_centers "; $sql = "select * from v_conference_centers ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
@ -619,8 +626,10 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
unset ($prep_statement); unset ($prep_statement);
} }
} }
}
//list conferences //list conferences
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/conferences/app_config.php")) {
if ($select_type == "dialplan" || $select_type == "ivr") { if ($select_type == "dialplan" || $select_type == "ivr") {
$sql = "select * from v_conferences "; $sql = "select * from v_conferences ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
@ -662,9 +671,11 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
unset ($prep_statement); unset ($prep_statement);
} }
} }
}
//list destinations //list destinations
/* /*
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/destinations/app_config.php")) {
$sql = "select * from v_destinations "; $sql = "select * from v_destinations ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and destination_enabled = 'true' "; $sql .= "and destination_enabled = 'true' ";
@ -704,9 +715,11 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
echo "</optgroup>\n"; echo "</optgroup>\n";
} }
unset ($prep_statement); unset ($prep_statement);
}
*/ */
//list extensions //list extensions
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/extensions/app_config.php")) {
if ($select_type == "dialplan" || $select_type == "ivr" || $select_type == "call_center_contact") { if ($select_type == "dialplan" || $select_type == "ivr" || $select_type == "call_center_contact") {
$sql = "select * from v_extensions "; $sql = "select * from v_extensions ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
@ -747,8 +760,10 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
echo "</optgroup>\n"; echo "</optgroup>\n";
unset ($prep_statement, $extension); unset ($prep_statement, $extension);
} }
}
//list fax extensions //list fax extensions
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/fax/app_config.php")) {
if ($select_type == "dialplan" || $select_type == "ivr") { if ($select_type == "dialplan" || $select_type == "ivr") {
$sql = "select * from v_fax "; $sql = "select * from v_fax ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
@ -781,8 +796,10 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
echo "</optgroup>\n"; echo "</optgroup>\n";
unset ($prep_statement, $extension); unset ($prep_statement, $extension);
} }
}
//list fifo queues //list fifo queues
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/dialplans/app_config.php")) {
if ($select_type == "dialplan" || $select_type == "ivr") { if ($select_type == "dialplan" || $select_type == "ivr") {
$sql = "select * from v_dialplan_details "; $sql = "select * from v_dialplan_details ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
@ -851,8 +868,10 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
} }
unset ($prep_statement); unset ($prep_statement);
} }
}
//gateways //gateways
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/conference_centers/app_config.php")) {
if (if_group("superadmin")) { if (if_group("superadmin")) {
if ($select_type == "dialplan" || $select_type == "ivr" || $select_type == "call_center_contact" || $select_type == "bridge") { if ($select_type == "dialplan" || $select_type == "ivr" || $select_type == "call_center_contact" || $select_type == "bridge") {
echo "<optgroup label='Gateways'>\n"; echo "<optgroup label='Gateways'>\n";
@ -912,10 +931,11 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
echo "</optgroup>\n"; echo "</optgroup>\n";
} }
} }
}
//list hunt groups //list hunt groups
if ($select_type == "dialplan" || $select_type == "ivr") {
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/hunt_groups/app_config.php")) { if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/hunt_groups/app_config.php")) {
if ($select_type == "dialplan" || $select_type == "ivr") {
$sql = "select * from v_hunt_groups "; $sql = "select * from v_hunt_groups ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and hunt_group_enabled = 'true' "; $sql .= "and hunt_group_enabled = 'true' ";
@ -960,6 +980,7 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
} }
//list ivr menus //list ivr menus
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/ivr_menus/app_config.php")) {
if ($select_type == "dialplan" || $select_type == "ivr") { if ($select_type == "dialplan" || $select_type == "ivr") {
$sql = "select * from v_ivr_menus "; $sql = "select * from v_ivr_menus ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
@ -1002,6 +1023,7 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
} }
unset ($prep_statement, $extension); unset ($prep_statement, $extension);
} }
}
//list ivr menus //list ivr menus
/* /*
@ -1211,6 +1233,7 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
} }
//recordings //recordings
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/recordings/app_config.php")) {
if ($select_type == "dialplan" || $select_type == "ivr") { if ($select_type == "dialplan" || $select_type == "ivr") {
if($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) { if($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
$tmp_selected = false; $tmp_selected = false;
@ -1246,8 +1269,10 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
echo "</optgroup>\n"; echo "</optgroup>\n";
} }
} }
}
//ring groups //ring groups
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/ring_groups/app_config.php")) {
if ($select_type == "dialplan" || $select_type == "ivr") { if ($select_type == "dialplan" || $select_type == "ivr") {
$sql = "select * from v_ring_groups "; $sql = "select * from v_ring_groups ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
@ -1285,8 +1310,10 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
echo "</optgroup>\n"; echo "</optgroup>\n";
} }
} }
}
//list time conditions //list time conditions
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/dialplans/app_config.php")) {
if ($select_type == "dialplan" || $select_type == "ivr") { if ($select_type == "dialplan" || $select_type == "ivr") {
$sql = "select * from v_dialplan_details "; $sql = "select * from v_dialplan_details ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
@ -1386,8 +1413,10 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
} }
unset ($prep_statement); unset ($prep_statement);
} }
}
//list voicemail //list voicemail
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/voicemails/app_config.php")) {
if ($select_type == "dialplan" || $select_type == "ivr") { if ($select_type == "dialplan" || $select_type == "ivr") {
$sql = "select * from v_voicemails "; $sql = "select * from v_voicemails ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
@ -1424,6 +1453,7 @@ function switch_select_destination($select_type, $select_label, $select_name, $s
echo "</optgroup>\n"; echo "</optgroup>\n";
} }
} }
}
//other //other
if ($select_type == "dialplan" || $select_type == "ivr" || $select_type == "call_center_contact") { if ($select_type == "dialplan" || $select_type == "ivr" || $select_type == "call_center_contact") {