2012-06-04 14:58:40 +00:00
|
|
|
<?php
|
2012-10-23 10:00:03 +00:00
|
|
|
/*
|
|
|
|
|
FusionPBX
|
|
|
|
|
Version: MPL 1.1
|
|
|
|
|
|
|
|
|
|
The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
|
1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
http://www.mozilla.org/MPL/
|
|
|
|
|
|
|
|
|
|
Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
|
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
|
for the specific language governing rights and limitations under the
|
|
|
|
|
License.
|
|
|
|
|
|
|
|
|
|
The Original Code is FusionPBX
|
|
|
|
|
|
|
|
|
|
The Initial Developer of the Original Code is
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
2021-06-10 00:04:27 -06:00
|
|
|
Portions created by the Initial Developer are Copyright (C) 2008-2021
|
2012-10-23 10:00:03 +00:00
|
|
|
the Initial Developer. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
Contributor(s):
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
|
|
|
|
*/
|
2017-04-04 23:39:51 -06:00
|
|
|
|
|
|
|
|
//includes
|
|
|
|
|
require_once "root.php";
|
|
|
|
|
require_once "resources/require.php";
|
|
|
|
|
require_once "resources/check_auth.php";
|
2019-11-06 11:29:11 -07:00
|
|
|
require_once "resources/paging.php";
|
2017-04-04 23:39:51 -06:00
|
|
|
|
|
|
|
|
//check permissions
|
|
|
|
|
if (permission_exists('destination_view')) {
|
|
|
|
|
//access granted
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "access denied";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
2013-05-07 23:38:12 +00:00
|
|
|
|
|
|
|
|
//add multi-lingual support
|
2015-01-18 10:33:34 +00:00
|
|
|
$language = new text;
|
|
|
|
|
$text = $language->get();
|
2013-05-07 23:38:12 +00:00
|
|
|
|
2019-11-06 11:29:11 -07:00
|
|
|
//get posted data
|
|
|
|
|
if (is_array($_POST['destinations'])) {
|
|
|
|
|
$action = $_POST['action'];
|
|
|
|
|
$search = $_POST['search'];
|
|
|
|
|
$destinations = $_POST['destinations'];
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-30 14:18:00 -07:00
|
|
|
//process the http post data by action
|
2019-11-30 11:12:41 -07:00
|
|
|
if ($action != '' && is_array($destinations) && @sizeof($destinations) != 0) {
|
|
|
|
|
switch ($action) {
|
|
|
|
|
case 'toggle':
|
|
|
|
|
if (permission_exists('destination_edit')) {
|
2019-11-30 14:18:00 -07:00
|
|
|
$obj = new destinations;
|
2019-11-30 11:12:41 -07:00
|
|
|
$obj->toggle($destinations);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 'delete':
|
|
|
|
|
if (permission_exists('destination_delete')) {
|
2019-11-30 14:18:00 -07:00
|
|
|
$obj = new destinations;
|
2019-11-30 11:12:41 -07:00
|
|
|
$obj->delete($destinations);
|
|
|
|
|
}
|
|
|
|
|
break;
|
2017-12-21 01:35:35 -07:00
|
|
|
}
|
2019-11-30 11:12:41 -07:00
|
|
|
|
|
|
|
|
header('Location: destinations.php'.($search != '' ? '?search='.urlencode($search) : null));
|
|
|
|
|
exit;
|
2017-12-21 01:35:35 -07:00
|
|
|
}
|
|
|
|
|
|
2019-11-06 11:29:11 -07:00
|
|
|
//get the destination select list
|
|
|
|
|
$destination = new destinations;
|
|
|
|
|
$destination_array = $destination->all('dialplan');
|
|
|
|
|
|
|
|
|
|
//add a function to return the action_name
|
|
|
|
|
function action_name($destination_array, $detail_action) {
|
|
|
|
|
if (is_array($destination_array)) {
|
|
|
|
|
foreach($destination_array as $group => $row) {
|
|
|
|
|
if (is_array($row)) {
|
|
|
|
|
foreach ($row as $key => $value) {
|
|
|
|
|
if ($value == $detail_action) {
|
|
|
|
|
//add multi-lingual support
|
|
|
|
|
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/".$group."/app_languages.php")) {
|
|
|
|
|
$language2 = new text;
|
|
|
|
|
$text2 = $language2->get($_SESSION['domain']['language']['code'], 'app/'.$group);
|
|
|
|
|
}
|
|
|
|
|
//return the group and destination name
|
|
|
|
|
return trim($text2['title-'.$group].' '.$key);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-06-06 18:55:59 -06:00
|
|
|
|
2017-07-30 11:42:29 -06:00
|
|
|
//set the type
|
2021-06-10 00:04:27 -06:00
|
|
|
switch ($_REQUEST['type']) {
|
2019-07-29 13:18:48 -06:00
|
|
|
case 'inbound': $destination_type = 'inbound'; break;
|
|
|
|
|
case 'outbound': $destination_type = 'outbound'; break;
|
2020-07-13 11:21:42 -06:00
|
|
|
case 'local': $destination_type = 'local'; break;
|
2019-07-29 13:18:48 -06:00
|
|
|
default: $destination_type = 'inbound';
|
2017-07-30 11:42:29 -06:00
|
|
|
}
|
|
|
|
|
|
2019-11-06 11:29:11 -07:00
|
|
|
//get variables used to control the order
|
|
|
|
|
$order_by = $_GET["order_by"];
|
|
|
|
|
$order = $_GET["order"];
|
|
|
|
|
|
2017-12-21 01:35:35 -07:00
|
|
|
//add the search term
|
2019-06-28 09:43:32 -06:00
|
|
|
$search = strtolower($_GET["search"]);
|
2017-12-21 01:35:35 -07:00
|
|
|
|
2019-11-06 11:29:11 -07:00
|
|
|
//prepare to page the results
|
|
|
|
|
$sql = "select count(*) from v_destinations ";
|
|
|
|
|
$sql .= "where destination_type = :destination_type ";
|
|
|
|
|
if ($_GET['show'] != "all" || !permission_exists('destination_all')) {
|
|
|
|
|
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
2019-06-13 20:02:21 -06:00
|
|
|
$parameters['domain_uuid'] = $domain_uuid;
|
2015-09-04 23:18:13 -06:00
|
|
|
}
|
2021-03-06 08:16:30 -07:00
|
|
|
if (strlen($search) > 0) {
|
|
|
|
|
$sql .= "and (";
|
|
|
|
|
$sql .= "lower(destination_type) like :search ";
|
|
|
|
|
$sql .= "or lower(destination_number) like :search ";
|
|
|
|
|
$sql .= "or lower(destination_context) like :search ";
|
|
|
|
|
$sql .= "or lower(destination_accountcode) like :search ";
|
|
|
|
|
if (permission_exists('outbound_caller_id_select')) {
|
|
|
|
|
$sql .= "or lower(destination_caller_id_name) like :search ";
|
|
|
|
|
$sql .= "or destination_caller_id_number like :search ";
|
|
|
|
|
}
|
|
|
|
|
$sql .= "or lower(destination_enabled) like :search ";
|
|
|
|
|
$sql .= "or lower(destination_description) like :search ";
|
|
|
|
|
$sql .= "or lower(destination_data) like :search ";
|
|
|
|
|
$sql .= ") ";
|
|
|
|
|
$parameters['search'] = '%'.$search.'%';
|
|
|
|
|
}
|
2019-06-28 09:43:32 -06:00
|
|
|
$parameters['destination_type'] = $destination_type;
|
2019-06-06 18:55:59 -06:00
|
|
|
$database = new database;
|
|
|
|
|
$num_rows = $database->select($sql, $parameters, 'column');
|
2015-09-04 23:18:13 -06:00
|
|
|
|
|
|
|
|
//prepare to page the results
|
2016-03-28 23:02:11 -06:00
|
|
|
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
2021-06-10 00:04:27 -06:00
|
|
|
$param = "&search=".urlencode($search);
|
|
|
|
|
$param .= "&type=".$destination_type;
|
2017-12-16 22:04:25 -07:00
|
|
|
if ($_GET['show'] == "all" && permission_exists('destination_all')) {
|
2017-12-09 12:19:00 -07:00
|
|
|
$param .= "&show=all";
|
2015-09-04 23:18:13 -06:00
|
|
|
}
|
|
|
|
|
$page = $_GET['page'];
|
|
|
|
|
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
2019-11-06 11:29:11 -07:00
|
|
|
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
|
|
|
|
|
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
|
2015-09-04 23:18:13 -06:00
|
|
|
$offset = $rows_per_page * $page;
|
|
|
|
|
|
|
|
|
|
//get the list
|
2021-03-06 08:16:30 -07:00
|
|
|
$sql = "select * from v_destinations ";
|
|
|
|
|
$sql .= "where destination_type = :destination_type ";
|
|
|
|
|
if ($_GET['show'] != "all" || !permission_exists('destination_all')) {
|
|
|
|
|
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
|
|
|
|
$parameters['domain_uuid'] = $domain_uuid;
|
|
|
|
|
}
|
|
|
|
|
if (strlen($search) > 0) {
|
|
|
|
|
$sql .= "and (";
|
|
|
|
|
$sql .= "lower(destination_type) like :search ";
|
|
|
|
|
$sql .= "or lower(destination_number) like :search ";
|
|
|
|
|
$sql .= "or lower(destination_context) like :search ";
|
|
|
|
|
$sql .= "or lower(destination_accountcode) like :search ";
|
|
|
|
|
if (permission_exists('outbound_caller_id_select')) {
|
|
|
|
|
$sql .= "or lower(destination_caller_id_name) like :search ";
|
|
|
|
|
$sql .= "or destination_caller_id_number like :search ";
|
|
|
|
|
}
|
|
|
|
|
$sql .= "or lower(destination_enabled) like :search ";
|
|
|
|
|
$sql .= "or lower(destination_description) like :search ";
|
|
|
|
|
$sql .= "or lower(destination_data) like :search ";
|
|
|
|
|
$sql .= ") ";
|
|
|
|
|
$parameters['search'] = '%'.$search.'%';
|
|
|
|
|
}
|
|
|
|
|
$sql .= order_by($order_by, $order, 'destination_number, destination_order ', 'asc');
|
2019-07-29 13:18:48 -06:00
|
|
|
$sql .= limit_offset($rows_per_page, $offset);
|
2019-06-06 18:55:59 -06:00
|
|
|
$database = new database;
|
|
|
|
|
$destinations = $database->select($sql, $parameters, 'all');
|
2019-11-06 11:29:11 -07:00
|
|
|
unset($sql, $parameters);
|
2018-10-16 00:30:40 -06:00
|
|
|
|
2019-11-06 11:29:11 -07:00
|
|
|
//create token
|
|
|
|
|
$object = new token;
|
|
|
|
|
$token = $object->create($_SERVER['PHP_SELF']);
|
2017-12-21 01:35:35 -07:00
|
|
|
|
2019-06-28 09:43:32 -06:00
|
|
|
//include the header
|
2020-01-06 10:24:49 -07:00
|
|
|
$document['title'] = $text['title-destinations'];
|
2019-06-28 09:43:32 -06:00
|
|
|
require_once "resources/header.php";
|
|
|
|
|
|
2012-06-04 14:58:40 +00:00
|
|
|
//show the content
|
2019-11-06 11:29:11 -07:00
|
|
|
echo "<div class='action_bar' id='action_bar'>\n";
|
|
|
|
|
echo " <div class='heading'><b>".$text['title-destinations']." (".$num_rows.")</b></div>\n";
|
|
|
|
|
echo " <div class='actions'>\n";
|
2019-11-07 23:27:47 -07:00
|
|
|
echo button::create(['type'=>'button','label'=>$text['button-inbound'],'icon'=>'location-arrow fa-rotate-90','link'=>'?type=inbound'.($_GET['show'] == 'all' ? '&show=all' : null).($search != '' ? "&search=".urlencode($search) : null)]);
|
|
|
|
|
echo button::create(['type'=>'button','label'=>$text['button-outbound'],'icon'=>'location-arrow','link'=>'?type=outbound'.($_GET['show'] == 'all' ? '&show=all' : null).($search != '' ? "&search=".urlencode($search) : null)]);
|
2020-07-13 11:21:42 -06:00
|
|
|
echo button::create(['type'=>'button','label'=>$text['button-local'],'icon'=>'vector-square','link'=>'?type=local'.($_GET['show'] == 'all' ? '&show=all' : null).($search != '' ? "&search=".urlencode($search) : null)]);
|
2019-11-07 23:27:47 -07:00
|
|
|
if (permission_exists('destination_import')) {
|
|
|
|
|
echo button::create(['type'=>'button','label'=>$text['button-import'],'icon'=>$_SESSION['theme']['button_icon_import'],'link'=>'destination_imports.php']);
|
|
|
|
|
}
|
2021-05-12 15:45:07 -06:00
|
|
|
if (permission_exists('destination_export')) {
|
|
|
|
|
echo button::create(['type'=>'button','label'=>$text['button-export'],'icon'=>$_SESSION['theme']['button_icon_export'],'link'=>'destination_download.php']);
|
|
|
|
|
}
|
2019-11-06 11:29:11 -07:00
|
|
|
if (permission_exists('destination_add')) {
|
2020-03-05 00:05:45 -07:00
|
|
|
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'id'=>'btn_add','style'=>'margin-left: 15px;','link'=>'destination_edit.php']);
|
2017-12-21 01:35:35 -07:00
|
|
|
}
|
2019-11-06 11:29:11 -07:00
|
|
|
if (permission_exists('destination_delete') && $destinations) {
|
2022-01-13 11:37:59 -07:00
|
|
|
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
|
2019-11-06 11:29:11 -07:00
|
|
|
}
|
|
|
|
|
echo "<form id='form_search' class='inline' method='get'>\n";
|
2015-03-29 01:33:56 +00:00
|
|
|
if (permission_exists('destination_all')) {
|
2017-12-09 12:19:00 -07:00
|
|
|
if ($_GET['show'] == 'all') {
|
|
|
|
|
echo " <input type='hidden' name='show' value='all'>";
|
2015-03-23 16:33:16 +00:00
|
|
|
}
|
|
|
|
|
else {
|
2019-11-06 11:29:11 -07:00
|
|
|
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?type='.urlencode($destination_type).'&show=all'.($search != '' ? "&search=".urlencode($search) : null)]);
|
2015-03-10 05:10:22 +00:00
|
|
|
}
|
2015-03-07 12:59:53 +00:00
|
|
|
}
|
2021-06-10 00:04:27 -06:00
|
|
|
echo " <input type='hidden' name='type' value=\"".escape($destination_type)."\">\n";
|
2022-01-12 16:00:01 -07:00
|
|
|
echo " <input type='text' class='txt list-search' name='search' id='search' value=\"".escape($search)."\" placeholder=\"".$text['label-search']."\" onkeydown=''>";
|
|
|
|
|
echo button::create(['label'=>$text['button-search'],'icon'=>$_SESSION['theme']['button_icon_search'],'type'=>'submit','id'=>'btn_search']);
|
|
|
|
|
//echo button::create(['label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'type'=>'button','id'=>'btn_reset','link'=>'destinations.php','style'=>($search == '' ? 'display: none;' : null)]);
|
2019-08-22 09:17:52 -04:00
|
|
|
if ($paging_controls_mini != '') {
|
2019-11-06 11:29:11 -07:00
|
|
|
echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>";
|
|
|
|
|
}
|
2017-12-21 01:35:35 -07:00
|
|
|
echo " </form>\n";
|
2019-11-06 11:29:11 -07:00
|
|
|
echo " </div>\n";
|
|
|
|
|
echo " <div style='clear: both;'></div>\n";
|
|
|
|
|
echo "</div>\n";
|
|
|
|
|
|
2020-03-26 07:49:37 -06:00
|
|
|
if (permission_exists('destination_delete') && $destinations) {
|
|
|
|
|
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('delete'); list_form_submit('form_list');"])]);
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-06 11:29:11 -07:00
|
|
|
echo $text['description-destinations']."\n";
|
|
|
|
|
echo "<br /><br />\n";
|
|
|
|
|
|
2021-06-19 12:08:57 -06:00
|
|
|
echo "<form id='form_list' method='POST'>\n";
|
2019-11-06 11:29:11 -07:00
|
|
|
echo "<input type='hidden' id='action' name='action' value=''>\n";
|
2021-06-10 00:04:27 -06:00
|
|
|
echo "<input type='hidden' name='type' value=\"".escape($destination_type)."\">\n";
|
2019-11-06 11:29:11 -07:00
|
|
|
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
|
2012-06-04 14:58:40 +00:00
|
|
|
|
2019-11-06 11:29:11 -07:00
|
|
|
echo "<table class='list'>\n";
|
|
|
|
|
echo "<tr class='list-header'>\n";
|
|
|
|
|
if (permission_exists('destination_delete')) {
|
|
|
|
|
echo " <th class='checkbox'>\n";
|
2022-01-13 11:37:59 -07:00
|
|
|
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($destinations ?: "style='visibility: hidden;'").">\n";
|
2019-11-06 11:29:11 -07:00
|
|
|
echo " </th>\n";
|
|
|
|
|
}
|
2018-03-01 22:58:10 -07:00
|
|
|
if ($_GET['show'] == "all" && permission_exists('destination_all')) {
|
2019-11-06 11:29:11 -07:00
|
|
|
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, $param, "class='shrink'");
|
2018-03-01 22:58:10 -07:00
|
|
|
}
|
2019-11-06 11:29:11 -07:00
|
|
|
echo th_order_by('destination_type', $text['label-destination_type'], $order_by, $order, $param, "class='shrink'");
|
2020-06-18 08:08:26 -06:00
|
|
|
echo th_order_by('destination_prefix', $text['label-destination_prefix'], $order_by, $order, $param, "class='shrink'");
|
2020-08-26 22:05:11 -06:00
|
|
|
if (permission_exists('destination_trunk_prefix')) {
|
|
|
|
|
echo th_order_by('destination_trunk_prefix', '', $order_by, $order, $param, "class='shrink'");
|
|
|
|
|
}
|
|
|
|
|
if (permission_exists('destination_area_code')) {
|
|
|
|
|
echo th_order_by('destination_area_code', '', $order_by, $order, $param, "class='shrink'");
|
|
|
|
|
}
|
2019-11-06 11:29:11 -07:00
|
|
|
echo th_order_by('destination_number', $text['label-destination_number'], $order_by, $order, $param, "class='shrink'");
|
2019-08-23 12:11:21 -06:00
|
|
|
if (!$_GET['show'] == "all") {
|
|
|
|
|
echo "<th>". $text['label-detail_action']."</th>";
|
|
|
|
|
}
|
2019-08-16 11:35:10 -06:00
|
|
|
if (permission_exists("destination_context")) {
|
|
|
|
|
echo th_order_by('destination_context', $text['label-destination_context'], $order_by, $order, $param);
|
|
|
|
|
}
|
2018-01-10 13:21:36 -07:00
|
|
|
if (permission_exists('outbound_caller_id_select')) {
|
2018-08-23 11:20:14 -06:00
|
|
|
echo th_order_by('destination_caller_id_name', $text['label-destination_caller_id_name'], $order_by, $order, $param);
|
|
|
|
|
echo th_order_by('destination_caller_id_number', $text['label-destination_caller_id_number'], $order_by, $order, $param);
|
2018-01-10 13:21:36 -07:00
|
|
|
}
|
2018-08-23 11:20:14 -06:00
|
|
|
echo th_order_by('destination_enabled', $text['label-destination_enabled'], $order_by, $order, $param);
|
2019-11-06 11:29:11 -07:00
|
|
|
echo th_order_by('destination_description', $text['label-destination_description'], $order_by, $order, $param, "class='hide-sm-dn'");
|
|
|
|
|
if (permission_exists('destination_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
|
|
|
|
echo " <td class='action-button'> </td>\n";
|
2015-03-22 08:17:04 +00:00
|
|
|
}
|
2019-11-06 11:29:11 -07:00
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2019-07-29 13:18:48 -06:00
|
|
|
if (is_array($destinations) && @sizeof($destinations) != 0) {
|
2017-12-21 01:35:35 -07:00
|
|
|
$x = 0;
|
2018-03-01 22:58:10 -07:00
|
|
|
foreach($destinations as $row) {
|
2017-12-21 01:35:35 -07:00
|
|
|
if (permission_exists('destination_edit')) {
|
2019-11-06 11:29:11 -07:00
|
|
|
$list_row_url = "destination_edit.php?id=".urlencode($row['destination_uuid']);
|
|
|
|
|
}
|
|
|
|
|
echo "<tr class='list-row' href='".$list_row_url."'>\n";
|
|
|
|
|
if (permission_exists('destination_delete')) {
|
|
|
|
|
echo " <td class='checkbox'>\n";
|
2022-01-13 11:37:59 -07:00
|
|
|
echo " <input type='checkbox' name='destinations[$x][checked]' id='checkbox_".$x."' value='true' onclick=\"checkbox_on_change(this); if (!this.checked) { document.getElementById('checkbox_all').checked = false; }\">\n";
|
2019-11-06 11:29:11 -07:00
|
|
|
echo " <input type='hidden' name='destinations[$x][uuid]' value='".escape($row['destination_uuid'])."' />\n";
|
|
|
|
|
echo " </td>\n";
|
2015-03-07 21:35:18 +00:00
|
|
|
}
|
2018-03-01 22:58:10 -07:00
|
|
|
if ($_GET['show'] == "all" && permission_exists('destination_all')) {
|
|
|
|
|
if (strlen($_SESSION['domains'][$row['domain_uuid']]['domain_name']) > 0) {
|
2019-08-11 08:47:04 -06:00
|
|
|
$domain = $_SESSION['domains'][$row['domain_uuid']]['domain_name'];
|
2018-03-01 22:58:10 -07:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$domain = $text['label-global'];
|
|
|
|
|
}
|
2019-11-06 11:29:11 -07:00
|
|
|
echo " <td>".escape($domain)."</td>\n";
|
2018-03-01 22:58:10 -07:00
|
|
|
}
|
2019-11-06 11:29:11 -07:00
|
|
|
echo " <td>".escape($row['destination_type'])." </td>\n";
|
2020-08-26 22:05:11 -06:00
|
|
|
|
2020-06-18 08:08:26 -06:00
|
|
|
echo " <td>".escape($row['destination_prefix'])." </td>\n";
|
2020-08-26 22:05:11 -06:00
|
|
|
if (permission_exists('destination_trunk_prefix')) {
|
|
|
|
|
echo " <td>".escape($row['destination_trunk_prefix'])." </td>\n";
|
|
|
|
|
}
|
|
|
|
|
if (permission_exists('destination_area_code')) {
|
|
|
|
|
echo " <td>".escape($row['destination_area_code'])." </td>\n";
|
|
|
|
|
}
|
2020-06-18 08:08:26 -06:00
|
|
|
|
|
|
|
|
echo " <td class='no-wrap'>\n";
|
2019-11-06 11:29:11 -07:00
|
|
|
if (permission_exists('destination_edit')) {
|
2020-06-18 08:08:26 -06:00
|
|
|
echo " <a href='".$list_row_url."'>".escape(format_phone($row['destination_number']))."</a>\n";
|
2019-11-06 11:29:11 -07:00
|
|
|
}
|
|
|
|
|
else {
|
2020-06-18 08:08:26 -06:00
|
|
|
echo " ".escape(format_phone($row['destination_number']));
|
2019-11-06 11:29:11 -07:00
|
|
|
}
|
|
|
|
|
echo " </td>\n";
|
2020-06-18 08:08:26 -06:00
|
|
|
|
2019-08-23 12:11:21 -06:00
|
|
|
if (!$_GET['show'] == "all") {
|
2019-11-06 11:29:11 -07:00
|
|
|
echo " <td class='overflow' style='min-width: 125px;'>".action_name($destination_array, $row['destination_app'].':'.$row['destination_data'])." </td>\n";
|
2019-08-23 12:11:21 -06:00
|
|
|
}
|
2019-08-16 11:35:10 -06:00
|
|
|
if (permission_exists("destination_context")) {
|
2019-11-06 11:29:11 -07:00
|
|
|
echo " <td>".escape($row['destination_context'])." </td>\n";
|
2019-08-16 11:35:10 -06:00
|
|
|
}
|
2018-01-10 13:21:36 -07:00
|
|
|
if (permission_exists('outbound_caller_id_select')) {
|
2019-11-06 11:29:11 -07:00
|
|
|
echo " <td>".escape($row['destination_caller_id_name'])." </td>\n";
|
|
|
|
|
echo " <td>".escape($row['destination_caller_id_number'])." </td>\n";
|
2018-01-10 13:21:36 -07:00
|
|
|
}
|
2019-11-06 11:29:11 -07:00
|
|
|
echo " <td>".escape($text['label-'.$row['destination_enabled']])." </td>\n";
|
|
|
|
|
echo " <td class='description overflow hide-sm-dn'>".escape($row['destination_description'])." </td>\n";
|
|
|
|
|
if (permission_exists('destination_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
|
|
|
|
echo " <td class='action-button'>";
|
|
|
|
|
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
|
|
|
|
echo " </td>\n";
|
2015-03-22 08:17:04 +00:00
|
|
|
}
|
2012-06-04 14:58:40 +00:00
|
|
|
echo "</tr>\n";
|
2017-12-21 01:35:35 -07:00
|
|
|
$x++;
|
2019-11-06 11:29:11 -07:00
|
|
|
}
|
|
|
|
|
unset($destinations);
|
2015-03-22 08:17:04 +00:00
|
|
|
}
|
2019-11-06 11:29:11 -07:00
|
|
|
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo "<div align='center'>".$paging_controls."</div>\n";
|
|
|
|
|
|
|
|
|
|
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
|
|
|
|
|
2017-12-21 01:35:35 -07:00
|
|
|
echo "</form>\n";
|
2012-06-04 14:58:40 +00:00
|
|
|
|
|
|
|
|
//include the footer
|
2013-07-06 06:29:50 +00:00
|
|
|
require_once "resources/footer.php";
|
2017-04-04 23:42:36 -06:00
|
|
|
|
2020-06-18 08:08:26 -06:00
|
|
|
?>
|