Default destination type to inbound. Use is_array where it is required
This commit is contained in:
@@ -100,7 +100,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//set the type
|
//set the type
|
||||||
$destination_type = '';
|
$destination_type = 'inbound';
|
||||||
if (!empty($_REQUEST['type'])) {
|
if (!empty($_REQUEST['type'])) {
|
||||||
switch ($_REQUEST['type']) {
|
switch ($_REQUEST['type']) {
|
||||||
case 'inbound': $destination_type = 'inbound'; break;
|
case 'inbound': $destination_type = 'inbound'; break;
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ if (!class_exists('destinations')) {
|
|||||||
$destination_id = str_replace("]", "", $destination_name);
|
$destination_id = str_replace("]", "", $destination_name);
|
||||||
$destination_id = str_replace("[", "_", $destination_id);
|
$destination_id = str_replace("[", "_", $destination_id);
|
||||||
//$destination_id = preg_replace('/[^a-zA-Z_,.]/', '', $destination_name);
|
//$destination_id = preg_replace('/[^a-zA-Z_,.]/', '', $destination_name);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function get_destinations(id, destination_type, action, search) {
|
function get_destinations(id, destination_type, action, search) {
|
||||||
@@ -482,7 +482,7 @@ if (!class_exists('destinations')) {
|
|||||||
$singular = $this->singular($key);
|
$singular = $this->singular($key);
|
||||||
if (permission_exists("{$singular}_destinations")) {
|
if (permission_exists("{$singular}_destinations")) {
|
||||||
//determine if selected
|
//determine if selected
|
||||||
$selected = ($key == $destination_key) ? "selected='selected'" : '';
|
$selected = ($key == $destination_key) ? "selected='selected'" : '';
|
||||||
|
|
||||||
//add multi-lingual support
|
//add multi-lingual support
|
||||||
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/".$key."/app_languages.php")) {
|
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/".$key."/app_languages.php")) {
|
||||||
@@ -675,7 +675,7 @@ if (!class_exists('destinations')) {
|
|||||||
$select_value = $row['select_value'][$destination_type];
|
$select_value = $row['select_value'][$destination_type];
|
||||||
$select_label = $row['select_label'];
|
$select_label = $row['select_label'];
|
||||||
foreach ($row['field'] as $key => $value) {
|
foreach ($row['field'] as $key => $value) {
|
||||||
if ($key == 'destination' and !empty($value)){
|
if (!empty($key) && $key == 'destination' && !empty($value) && is_array($value)){
|
||||||
if (!empty($value['type']) && $value['type'] == 'csv') {
|
if (!empty($value['type']) && $value['type'] == 'csv') {
|
||||||
$array = explode($value['delimiter'], $data[$key]);
|
$array = explode($value['delimiter'], $data[$key]);
|
||||||
$select_value = str_replace("\${destination}", $array[0], $select_value);
|
$select_value = str_replace("\${destination}", $array[0], $select_value);
|
||||||
@@ -957,7 +957,7 @@ if (!class_exists('destinations')) {
|
|||||||
//$array[$name][$i]['selected'] = $selected;
|
//$array[$name][$i]['selected'] = $selected;
|
||||||
$array[$name][$i]['destination'] = $select_value;
|
$array[$name][$i]['destination'] = $select_value;
|
||||||
$array[$name][$i]["extension"] = $data["extension"];
|
$array[$name][$i]["extension"] = $data["extension"];
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1154,4 +1154,4 @@ echo $obj->select('ivr', 'example5', '');
|
|||||||
echo $obj->select('ivr', 'example6', '');
|
echo $obj->select('ivr', 'example6', '');
|
||||||
*/
|
*/
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user