Default destination type to inbound. Use is_array where it is required

This commit is contained in:
markjcrane 2023-05-17 16:03:36 -06:00
parent 74959e69c7
commit 10a4ceae65
2 changed files with 6 additions and 6 deletions

View File

@ -100,7 +100,7 @@
}
//set the type
$destination_type = '';
$destination_type = 'inbound';
if (!empty($_REQUEST['type'])) {
switch ($_REQUEST['type']) {
case 'inbound': $destination_type = 'inbound'; break;

View File

@ -433,7 +433,7 @@ if (!class_exists('destinations')) {
$destination_id = str_replace("]", "", $destination_name);
$destination_id = str_replace("[", "_", $destination_id);
//$destination_id = preg_replace('/[^a-zA-Z_,.]/', '', $destination_name);
?>
<script type="text/javascript">
function get_destinations(id, destination_type, action, search) {
@ -482,7 +482,7 @@ if (!class_exists('destinations')) {
$singular = $this->singular($key);
if (permission_exists("{$singular}_destinations")) {
//determine if selected
$selected = ($key == $destination_key) ? "selected='selected'" : '';
$selected = ($key == $destination_key) ? "selected='selected'" : '';
//add multi-lingual support
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_label = $row['select_label'];
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') {
$array = explode($value['delimiter'], $data[$key]);
$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]['destination'] = $select_value;
$array[$name][$i]["extension"] = $data["extension"];
$i++;
}
@ -1154,4 +1154,4 @@ echo $obj->select('ivr', 'example5', '');
echo $obj->select('ivr', 'example6', '');
*/
?>
?>