From 7964663eec3e91c75ce0c289629d3258f291dde2 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Thu, 27 Apr 2017 18:05:28 -0600 Subject: [PATCH] Update extension_dashboard.php Finish up the Caller ID dashboard.php. --- app/extensions/extension_dashboard.php | 56 +++++++++++++++++--------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/app/extensions/extension_dashboard.php b/app/extensions/extension_dashboard.php index 57db96015f..df8193895e 100644 --- a/app/extensions/extension_dashboard.php +++ b/app/extensions/extension_dashboard.php @@ -59,12 +59,17 @@ //build the array on what is allowed. if ($found) { - $caller_id = explode('@', $row['outbound_caller_id']); - $outbound_caller_id_name = $caller_id[0]; - $outbound_caller_id_number = $caller_id[1]; - + if (permission_exists('outbound_caller_id_select')) { + $caller_id = explode('@', $row['outbound_caller_id']); + $outbound_caller_id_name = $caller_id[0]; + $outbound_caller_id_number = $caller_id[1]; + } + else { + $outbound_caller_id_name = $row['outbound_caller_id_name']; + $outbound_caller_id_number = $row['outbound_caller_id_number']; + } $array['extensions'][$x]['extension_uuid'] = $row['extension_uuid']; - $array['extensions'][$x]['outbound_caller_id_name'] = $caller_id[0]; + $array['extensions'][$x]['outbound_caller_id_name'] = $outbound_caller_id_name; if (is_numeric($outbound_caller_id_number)) { $array['extensions'][$x]['outbound_caller_id_number'] = $outbound_caller_id_number; } @@ -101,11 +106,10 @@ $p->delete("extension_edit", "temp"); //clear the cache - //$cache = new cache; - //$cache->delete("directory:".$extension."@".$user_context); - //if (permission_exists('number_alias') && strlen($number_alias) > 0) { - // $cache->delete("directory:".$number_alias."@".$user_context); - //} + $cache = new cache; + foreach($_SESSION['user']['extension'] as $field) { + $cache->delete("directory:".$_SESSION['user']['destination']."@".$_SESSION['user']['user_context']); + } //set the message if (!isset($_SESSION['message'])) { @@ -163,12 +167,14 @@ $destination = $row['destination']; $outbound_caller_id_name = $row['outbound_caller_id_name']; $outbound_caller_id_number = $row['outbound_caller_id_number']; + $description = $row['description']; //set the column names if ($x === 0 && $previous_extension_uuid != $row['extension_uuid']) { echo " \n"; echo " ".$text['label-extension']."\n"; echo " ".$text['label-caller_id']."\n"; + echo " ".$text['label-description']."\n"; echo " \n"; } @@ -190,37 +196,51 @@ echo " \n"; } + //show the destination echo " \n"; echo " ".$row['destination']; echo " \n"; - echo " \n"; + //caller id form input if (permission_exists('outbound_caller_id_select')) { + //caller id select + echo " \n"; if (count($destinations) > 0) { echo " \n"; } + echo " \n"; } else { - echo " \n"; + //caller id name an number input text + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; } + + //show the description + echo " \n"; + echo " ".$row['description']; echo " \n"; //end the row echo " \n"; //set the previous extension_uuid - $previous_extension_uuid = $row['extension_uuid']; + $previous_extension_uuid = $extension_uuid; //increment the array key $x++; //alternate the value