Add a streams map

This commit is contained in:
FusionPBX
2026-04-04 19:29:29 +00:00
committed by GitHub
parent fabfefa9bb
commit e93edddbda
5 changed files with 488 additions and 1 deletions

View File

@@ -29,6 +29,10 @@
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'stream_map';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'stream_all';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
$y++;

View File

@@ -297,4 +297,81 @@ $text['description-stream_description']['zh-cn'] = "输入说明。";
$text['description-stream_description']['ja-jp'] = "説明を入力してください。";
$text['description-stream_description']['ko-kr'] = "설명을 입력합니다.";
?>
$text['title-stream_map']['en-us'] = 'Streams Map';
$text['title-stream_map']['en-gb'] = 'Streams Map';
$text['title-stream_map']['ar-eg'] = 'خريطة الأنهار';
$text['title-stream_map']['de-at'] = 'Streams-Karte';
$text['title-stream_map']['de-ch'] = 'Streams-Karte';
$text['title-stream_map']['de-de'] = 'Streams-Karte';
$text['title-stream_map']['el-gr'] = 'Χάρτης Ρευμάτων';
$text['title-stream_map']['es-cl'] = 'Mapa de Corrientes';
$text['title-stream_map']['es-mx'] = 'Mapa de Corrientes';
$text['title-stream_map']['fr-ca'] = 'Carte des flux';
$text['title-stream_map']['fr-fr'] = 'Carte des flux';
$text['title-stream_map']['he-il'] = 'מפת הזרמים';
$text['title-stream_map']['it-it'] = 'Mappa dei flussi';
$text['title-stream_map']['nl-nl'] = 'Stroomkaart';
$text['title-stream_map']['pl-pl'] = 'Mapa Strumieni';
$text['title-stream_map']['pt-br'] = 'Mapa de Fluxos';
$text['title-stream_map']['pt-pt'] = 'Mapa de Fluxos';
$text['title-stream_map']['ro-ro'] = 'Hartă a Fluxurilor';
$text['title-stream_map']['ru-ru'] = 'Карта потоков';
$text['title-stream_map']['sv-se'] = 'Flödeskarta';
$text['title-stream_map']['uk-ua'] = 'Карта потоків';
$text['title-stream_map']['tr-tr'] = 'Akış Haritası';
$text['title-stream_map']['zh-cn'] = '流程图';
$text['title-stream_map']['ja-jp'] = 'ストリームマップ';
$text['title-stream_map']['ko-kr'] = '스트림 맵';
$text['title_description-stream_map']['en-us'] = 'The streams map is a searchable directory of all locations where streams are being used. It simplifies maintenance by offering a centralized view of these locations to update them as needed.';
$text['title_description-stream_map']['en-gb'] = 'The streams map is a searchable directory of all locations where streams are being used. It simplifies maintenance by offering a centralised view of these locations to update them as needed.';
$text['title_description-stream_map']['ar-eg'] = 'خريطة الأنهار هي دليل قابل للبحث لجميع المواقع التي يتم فيها استخدام الأنهار. تبسط الصيانة من خلال تقديم رؤية مركزية لهذه المواقع لتحديثها حسب الحاجة.';
$text['title_description-stream_map']['de-at'] = 'Die Stream-Karte ist ein durchsuchbares Verzeichnis aller Standorte, an denen Streams genutzt werden. Sie vereinfacht die Wartung, indem sie eine zentrale Übersicht dieser Standorte bietet, um sie bei Bedarf zu aktualisieren.';
$text['title_description-stream_map']['de-ch'] = 'Die Stream-Karte ist ein durchsuchbares Verzeichnis aller Standorte, an denen Streams genutzt werden. Sie vereinfacht die Wartung, indem sie eine zentrale Übersicht dieser Standorte bietet, um sie bei Bedarf zu aktualisieren.';
$text['title_description-stream_map']['de-de'] = 'Die Stream-Karte ist ein durchsuchbares Verzeichnis aller Standorte, an denen Streams genutzt werden. Sie vereinfacht die Wartung, indem sie eine zentrale Übersicht dieser Standorte bietet, um sie bei Bedarf zu aktualisieren.';
$text['title_description-stream_map']['el-gr'] = 'Ο χάρτης ροών είναι ένα αναζητήσιμο κατάλογο όλων των τοποθεσιών όπου χρησιμοποιούνται ροές. Απλοποιεί τη συντήρηση προσφέροντας μια κεντρική θέα αυτών των τοποθεσιών για να τις ενημερώσετε όπως χρειάζεται.';
$text['title_description-stream_map']['es-cl'] = 'El mapa de streams es un directorio buscable de todas las ubicaciones donde se utilizan streams. Simplifica el mantenimiento ofreciendo una vista centralizada de estas ubicaciones para actualizarlas según sea necesario.';
$text['title_description-stream_map']['es-mx'] = 'El mapa de streams es un directorio buscable de todas las ubicaciones donde se utilizan streams. Simplifica el mantenimiento al ofrecer una vista centralizada de estas ubicaciones para actualizarlas según sea necesario.';
$text['title_description-stream_map']['fr-ca'] = 'La carte des flux est un répertoire consultable de tous les endroits où les flux sont utilisés. Elle simplifie la maintenance en offrant une vue centralisée de ces endroits pour les mettre à jour selon les besoins.';
$text['title_description-stream_map']['fr-fr'] = 'La carte des flux est un répertoire consultable de tous les lieux où les flux sont utilisés. Elle simplifie la maintenance en offrant une vue centralisée de ces lieux pour les mettre à jour selon les besoins.';
$text['title_description-stream_map']['he-il'] = 'מפת הזרמים היא מדריך חיפושי של כל המיקומים בהם משתמשים בזרמים. היא מקלה על תחזוקה על ידי הצעת תצוגה מרכזית של מיקומים אלה לעדכן אותם לפי הצורך.';
$text['title_description-stream_map']['it-it'] = 'La mappa dei flussi è un directory ricercabile di tutte le località in cui vengono utilizzati i flussi. Semplifica la manutenzione offrendo una visualizzazione centralizzata di queste località per aggiornarle secondo necessità.';
$text['title_description-stream_map']['nl-nl'] = 'De streamkaart is een zoekbaar register van alle locaties waar streams worden gebruikt. Het vereenvoudigt het onderhoud door een centrale weergave van deze locaties te bieden om ze bij te werken wanneer nodig.';
$text['title_description-stream_map']['pl-pl'] = 'Mapa strumieni to przezroczysty katalog wszystkich lokalizacji, w których wykorzystywane są strumienie. Ułatwia konserwację, oferując centralne widoki tych lokalizacji do ich aktualizacji w razie potrzeby.';
$text['title_description-stream_map']['pt-br'] = 'O mapa de streams é um diretório pesquisável de todos os locais onde streams estão sendo usados. Simplifica a manutenção oferecendo uma visão centralizada desses locais para atualizá-los conforme necessário.';
$text['title_description-stream_map']['pt-pt'] = 'O mapa de streams é um diretório pesquisável de todos os locais onde os streams estão a ser utilizados. Simplifica a manutenção ao oferecer uma visão centralizada destes locais para os atualizar conforme necessário.';
$text['title_description-stream_map']['ro-ro'] = 'Harta fluxurilor este un director de căutare pentru toate locațiile unde sunt utilizate fluxuri. Simplifică întreținerea prin oferirea unei viziuni centralizate a acestor locații pentru a le actualiza după cum este necesar.';
$text['title_description-stream_map']['ru-ru'] = 'Карта стримов — это поисковый справочник всех мест, где используются стримы. Она упрощает обслуживание, предоставляя централизованный обзор этих мест для их обновления по мере необходимости.';
$text['title_description-stream_map']['sv-se'] = 'Streamkartan är en sökbar katalog över alla platser där streams används. Den förenklar underhållet genom att erbjuda en centraliserad vy av dessa platser för att uppdatera dem vid behov.';
$text['title_description-stream_map']['uk-ua'] = 'Карта стрімів — це пошуковий довідник усіх місць, де використовуються стріми. Вона спрощує обслуговування, надаючи централізований огляд цих місць для їх оновлення за необхідності.';
$text['title_description-stream_map']['tr-tr'] = 'Akış haritası, akışların kullanıldığı tüm konumların aranabilir bir rehberidir. Bu konumların ihtiyaç duyulduğunda güncellenebilmesi için merkezi bir görünüm sunarak bakım işlemlerini basitleştirir.';
$text['title_description-stream_map']['zh-cn'] = '流媒体地图是一个可搜索的目录,包含所有使用流媒体的位置。它通过提供这些位置的集中视图来简化维护,以便根据需要更新它们。';
$text['title_description-stream_map']['ja-jp'] = 'ストリームマップは、ストリームが使用されているすべての場所の検索可能なディレクトリです。これらの場所を必要に応じて更新するために、中央集権的なビューを提供することで、メンテナンスを簡素化します。';
$text['title_description-stream_map']['ko-kr'] = '스트림 맵은 스트림이 사용되는 모든 위치의 검색 가능한 디렉토리입니다. 이 위치들을 필요에 따라 업데이트할 수 있도록 중앙 집중식 뷰를 제공하여 유지 보수를 간소화합니다.';
$text['label-stream']['en-us'] = 'Stream';
$text['label-stream']['en-gb'] = 'Stream';
$text['label-stream']['ar-eg'] = 'نقل مباشر';
$text['label-stream']['de-at'] = 'Stream';
$text['label-stream']['de-ch'] = 'Stream';
$text['label-stream']['de-de'] = 'Stream';
$text['label-stream']['el-gr'] = 'Ρεύμα';
$text['label-stream']['es-cl'] = 'Transmisión';
$text['label-stream']['es-mx'] = 'Transmisión';
$text['label-stream']['fr-ca'] = 'Diffusion';
$text['label-stream']['fr-fr'] = 'Diffusion';
$text['label-stream']['he-il'] = 'סטרימינג';
$text['label-stream']['it-it'] = 'Stream';
$text['label-stream']['nl-nl'] = 'Stream';
$text['label-stream']['pl-pl'] = 'Strumień';
$text['label-stream']['pt-br'] = 'Transmissão ao vivo';
$text['label-stream']['pt-pt'] = 'Transmissão';
$text['label-stream']['ro-ro'] = 'Stream';
$text['label-stream']['ru-ru'] = 'Трансляция';
$text['label-stream']['sv-se'] = 'Stream';
$text['label-stream']['uk-ua'] = 'Трансляція';
$text['label-stream']['tr-tr'] = 'Yayın';
$text['label-stream']['zh-cn'] = '直播';
$text['label-stream']['ja-jp'] = 'ストリーミング';
$text['label-stream']['ko-kr'] = '스트리밍';

View File

@@ -0,0 +1,117 @@
<?php
$view['name'] = "view_stream_map";
$view['version'] = "20260303";
$view['description'] = "Show all the stream locations throughougt the system where they are being used.";
$view['sql'] = "select \n";
$view['sql'] .= " 'extensions' as application, \n";
$view['sql'] .= " 'hold_music' as type, \n";
$view['sql'] .= " e.extension_uuid as uuid, \n";
$view['sql'] .= " e.domain_uuid, \n";
$view['sql'] .= " d.domain_name, \n";
$view['sql'] .= " e.effective_caller_id_name as name, \n";
$view['sql'] .= " e.extension as number, \n";
$view['sql'] .= " e.hold_music as music, \n";
$view['sql'] .= " e.description \n";
$view['sql'] .= "from v_extensions as e, v_domains as d \n";
$view['sql'] .= "where hold_music like '%shout%' \n";
$view['sql'] .= "and e.domain_uuid = d.domain_uuid \n";
$view['sql'] .= "union \n";
$view['sql'] .= "select \n";
$view['sql'] .= " 'ring_groups' as application, \n";
$view['sql'] .= " 'ringback' as type, \n";
$view['sql'] .= " r.ring_group_uuid as uuid, \n";
$view['sql'] .= " r.domain_uuid, \n";
$view['sql'] .= " d.domain_name, \n";
$view['sql'] .= " r.ring_group_name as name, \n";
$view['sql'] .= " r.ring_group_extension as number, \n";
$view['sql'] .= " r.ring_group_ringback as music, \n";
$view['sql'] .= " r.ring_group_description as description \n";
$view['sql'] .= "from v_ring_groups as r, v_domains as d \n";
$view['sql'] .= "where ring_group_ringback like '%shout%' \n";
$view['sql'] .= "and r.domain_uuid = d.domain_uuid \n";
$view['sql'] .= "union \n";
$view['sql'] .= "select \n";
$view['sql'] .= " 'ivr_menus' as application, \n";
$view['sql'] .= " 'ringback' as type, \n";
$view['sql'] .= " i.ivr_menu_uuid as uuid, \n";
$view['sql'] .= " i.domain_uuid, \n";
$view['sql'] .= " d.domain_name, \n";
$view['sql'] .= " i.ivr_menu_name as name, \n";
$view['sql'] .= " i.ivr_menu_extension as number, \n";
$view['sql'] .= " i.ivr_menu_ringback as music, \n";
$view['sql'] .= " i.ivr_menu_description as description \n";
$view['sql'] .= "from v_ivr_menus as i, v_domains as d \n";
$view['sql'] .= "where ivr_menu_ringback like '%shout%' \n";
$view['sql'] .= "and i.domain_uuid = d.domain_uuid \n";
$view['sql'] .= "union \n";
$view['sql'] .= "select \n";
$view['sql'] .= " 'call_center_queues' as application, \n";
$view['sql'] .= " 'hold_music' as type, \n";
$view['sql'] .= " q.call_center_queue_uuid as uuid, \n";
$view['sql'] .= " q.domain_uuid, \n";
$view['sql'] .= " d.domain_name, \n";
$view['sql'] .= " q.queue_name as name, \n";
$view['sql'] .= " q.queue_extension as number, \n";
$view['sql'] .= " q.queue_moh_sound as music, \n";
$view['sql'] .= " q.queue_description as description \n";
$view['sql'] .= "from v_call_center_queues as q, v_domains as d \n";
$view['sql'] .= "where queue_moh_sound like '%shout%' \n";
$view['sql'] .= "and q.domain_uuid = d.domain_uuid \n";
$view['sql'] .= "union \n";
$view['sql'] .= "select \n";
$view['sql'] .= " 'fifo' as application, \n";
$view['sql'] .= " 'hold_music' as type, \n";
$view['sql'] .= " f.fifo_uuid as uuid, \n";
$view['sql'] .= " f.domain_uuid, \n";
$view['sql'] .= " d.domain_name, \n";
$view['sql'] .= " f.fifo_name as name, \n";
$view['sql'] .= " f.fifo_extension as number, \n";
$view['sql'] .= " f.fifo_music as music, \n";
$view['sql'] .= " f.fifo_description as description \n";
$view['sql'] .= "from v_fifo as f, v_domains as d \n";
$view['sql'] .= "where fifo_music like '%shout%' \n";
$view['sql'] .= "and f.domain_uuid = d.domain_uuid \n";
$view['sql'] .= "union \n";
$view['sql'] .= "select \n";
$view['sql'] .= " 'destinations' as application, \n";
$view['sql'] .= " 'hold_music' as type, \n";
$view['sql'] .= " e.destination_uuid as uuid, \n";
$view['sql'] .= " e.domain_uuid, \n";
$view['sql'] .= " d.domain_name, \n";
$view['sql'] .= " '' as name, \n";
$view['sql'] .= " e.destination_number as number, \n";
$view['sql'] .= " e.destination_hold_music as music, \n";
$view['sql'] .= " e.destination_description as description \n";
$view['sql'] .= "from v_destinations as e, v_domains as d \n";
$view['sql'] .= "where destination_hold_music like '%shout%' \n";
$view['sql'] .= "and e.domain_uuid = d.domain_uuid \n";
$view['sql'] .= "union \n";
$view['sql'] .= "select \n";
$view['sql'] .= " 'destinations' as application, \n";
$view['sql'] .= " 'ringback' as type, \n";
$view['sql'] .= " e.destination_uuid as uuid, \n";
$view['sql'] .= " e.domain_uuid, \n";
$view['sql'] .= " d.domain_name, \n";
$view['sql'] .= " '' as name, \n";
$view['sql'] .= " e.destination_number as number, \n";
$view['sql'] .= " e.destination_ringback as music, \n";
$view['sql'] .= " e.destination_description as description \n";
$view['sql'] .= "from v_destinations as e, v_domains as d \n";
$view['sql'] .= "where destination_ringback like '%shout%' \n";
$view['sql'] .= "and e.domain_uuid = d.domain_uuid \n";
$view['sql'] .= "union \n";
$view['sql'] .= "select \n";
$view['sql'] .= " 'dialplans' as application, \n";
$view['sql'] .= " 'unknown' as type, \n";
$view['sql'] .= " dl.dialplan_uuid as uuid, \n";
$view['sql'] .= " dl.domain_uuid, \n";
$view['sql'] .= " d.domain_name, \n";
$view['sql'] .= " dl.dialplan_name as name, \n";
$view['sql'] .= " dl.dialplan_number as number, \n";
$view['sql'] .= " de.dialplan_detail_data as music, \n";
$view['sql'] .= " dl.dialplan_description as description \n";
$view['sql'] .= "from v_dialplan_details as de, v_domains as d, v_dialplans as dl \n";
$view['sql'] .= "where dialplan_detail_data like '%shout%' \n";
$view['sql'] .= "and de.domain_uuid = d.domain_uuid \n";
$view['sql'] .= "and dl.dialplan_uuid = de.dialplan_uuid \n";

286
app/streams/stream_map.php Normal file
View File

@@ -0,0 +1,286 @@
<?php
/*
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>
Portions created by the Initial Developer are Copyright (C) 2026
the Initial Developer. All Rights Reserved.
*/
//set the include path
$conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
set_include_path(parse_ini_file($conf[0])['document.root']);
//includes files
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (!permission_exists('stream_map)) {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//connect to the database
$database = database::new();
//add the settings object
$settings = new settings(["domain_uuid" => $_SESSION['domain_uuid'], "user_uuid" => $_SESSION['user_uuid']]);
//set from session variables
$list_row_edit_button = $settings->get('theme', 'list_row_edit_button', 'false');
//get order and order by
$order_by = $_GET["order_by"] ?? null;
$order = $_GET["order"] ?? null;
//define the variables
$search = '';
$show = '';
$list_row_url = '';
//add the search variable
if (!empty($_GET["search"])) {
$search = strtolower($_GET["search"]);
}
//add the show variable
if (!empty($_GET["show"])) {
$show = $_GET["show"];
}
//prepare the excluded applications array based on permission exists
$excluded_app_array = [];
if (!permission_exists('extension_view')) {
$excluded_app_array[] = 'extensions';
}
if (!permission_exists('ring_group_view')) {
$excluded_app_array[] = 'ring_groups';
}
if (!permission_exists('ivr_menu_view')) {
$excluded_app_array[] = 'ivr_menus';
}
if (!permission_exists('call_center_queue_view')) {
$excluded_app_array[] = 'call_center_queues';
}
if (!permission_exists('fifo_view')) {
$excluded_app_array[] = 'fifo';
}
if (!permission_exists('destination_view')) {
$excluded_app_array[] = 'destinations';
}
if (!permission_exists('dialplan_view')) {
$excluded_app_array[] = 'dialplans';
}
$excluded_applications = implode(',', $excluded_app_array);
//get the stream map
$sql = "select ";
$sql .= " application, ";
$sql .= " type, ";
$sql .= " uuid, ";
$sql .= " domain_uuid, ";
$sql .= " domain_name, ";
$sql .= " name, ";
$sql .= " number, ";
$sql .= " stream, ";
$sql .= " description \n";
$sql .= "from view_stream_map \n";
$sql .= "where true \n";
if (!empty($show) && $show === "all" && permission_exists('dialplan_all')) {
//show all
}
else {
$sql .= "and domain_uuid = :domain_uuid \n";
$parameters['domain_uuid'] = $domain_uuid;
}
if (!empty($search)) {
$sql .= "and ( \n";
$sql .= " application like :search \n";
$sql .= " or name like :search \n";
$sql .= " or number like :search \n";
$sql .= " or stream like :search \n";
$sql .= " or description like :search \n";
$sql .= ") \n";
$parameters['search'] = '%'.$search.'%';
}
if (!empty($excluded_applications)) {
$sql .= "AND application NOT IN ('" . implode("','", $excluded_app_array) . "') \n";
}
$sql .= "ORDER BY application, domain_name ASC \n";
//get the list
$results = $database->select($sql, $parameters ?? null, 'all');
$num_rows = count($results);
unset($sql, $parameters);
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
//create the text object
$text_language = new text;
//get the language
$language = $settings->get('domain', 'language', 'en-us');
//additional includes
$document['title'] = $text['title-stream_map'];
require_once "resources/header.php";
//show the content
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-stream_map']."</b><div class='count'>".number_format($num_rows)."</div></div>\n";
echo " <div class='actions'>\n";
echo "<form id='form_search' class='inline' method='get'>\n";
if (permission_exists('dialplan_all')) {
if ($show == 'all') {
echo " <input type='hidden' name='show' value='all'>\n";
}
else {
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'link'=>'?show=all&search='.urlencode($search)]);
}
}
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']);
// if ($paging_controls_mini != '') {
// echo "<span style='margin-left: 15px;'>".$paging_controls_mini."</span>\n";
// }
echo " </form>\n";
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
echo $text['title_description-stream_map']."\n";
echo "<br /><br />\n";
echo "<form id='form_list' method='post'>\n";
echo "<input type='hidden' id='action' name='action' value=''>\n";
echo "<input type='hidden' name='search' value=\"".escape($search ?? '')."\">\n";
if (!empty($results) && is_array($results) && @sizeof($results) != 0) {
$previous_application = '';
$x = 0;
foreach ($results as $row) {
if ($row['application'] == 'extensions' && permission_exists('extension_edit')) {
$list_row_url = "/app/extensions/extension_edit.php?id=".urlencode($row['uuid']);
}
if ($row['application'] == 'ivr_menus' && permission_exists('ivr_menu_edit')) {
$list_row_url = "/app/ivr_menus/ivr_menu_edit.php?id=".urlencode($row['uuid']);
}
if ($row['application'] == 'dialplans' && permission_exists('dialplan_edit')) {
$list_row_url = "/app/dialplans/dialplan_edit.php?id=".urlencode($row['uuid']);
}
if ($row['application'] == 'fifo' && permission_exists('fifo_edit')) {
$list_row_url = "/app/fifo/fifo_edit.php?id=".urlencode($row['uuid']);
}
if ($row['application'] == 'call_center_queues' && permission_exists('call_center_queue_edit')) {
$list_row_url = "/app/call_centers/call_center_queue_edit.php?id=".urlencode($row['uuid']);
}
if ($row['application'] == 'ring_groups' && permission_exists('call_center_queue_edit')) {
$list_row_url = "/app/ring_groups/ring_group_edit.php?id=".urlencode($row['uuid']);
}
if ($row['application'] == 'destinations' && permission_exists('destination_edit')) {
$list_row_url = "/app/destinations/destination_edit.php?id=".urlencode($row['uuid']);
}
if ($row['domain_uuid'] != $_SESSION['domain_uuid'] && permission_exists('domain_select')) {
$list_row_url .= '&domain_uuid='.urlencode($row['domain_uuid']).'&domain_change=true';
}
//add the table header
if ($previous_application != $row['application']) {
$previous_application = $row['application'];
if ($x > 0) {
echo "</table>\n";
echo "</div>\n";
}
$application = $row['application'];
if ($application == 'call_center_queues') {
$application = 'call_centers';
}
//add multi-lingual support
if (file_exists(dirname(__DIR__, 2)."/app/".$application."/app_languages.php")) {
$text2 = $text_language->get($settings->get('domain', 'language', 'en-us'), 'app/'.$application);
}
echo "<strong>".escape($text2['title-'.$application])."</strong>\n";
echo "<div class='card'>\n";
echo "<table class='list'>\n";
echo "<tr class='list-header'>\n";
if (permission_exists('extension_view') && $list_row_edit_button == 'true') {
echo " <td class='action-button'>&nbsp;</td>\n";
}
echo "</tr>\n";
echo "<tr class='list-header' href='".$list_row_url."'>\n";
if (!empty($show) && $show == 'all' && permission_exists('dialplan_all')) {
echo " <th class='' style='width: 150px;'>".escape($text['label-domain_name'])."</th>\n";
}
echo " <th class='' style='width: 150px;'>".escape($text['label-name'])."</th>\n";
echo " <th class='' style='width: 150px;'>".escape($text['label-type'])."</th>\n";
echo " <th class='' style='width: 150px;'>".escape($text['label-extension'])."</th>\n";
echo " <th class='hide-sm-dn' style='width: 400px;'>".escape($text['label-stream'])."</th>\n";
echo " <th class='hide-sm-dn' style='width:'>".escape($text['label-description'])."</th>\n";
if (permission_exists('extension_view') && $list_row_edit_button == 'true') {
echo " <th class='action-button'>\n";
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
echo " </th>\n";
}
echo "</tr>\n";
}
//ad the table row
echo "<tr class='list-row' href='".$list_row_url."'>\n";
if (!empty($show) && $show == 'all' && permission_exists('dialplan_all')) {
echo " <td class=''>".escape($row['domain_name'])."</td>\n";
}
echo " <td class=''>".escape($row['name'])."</td>\n";
echo " <td class=''>".escape($row['type'])."</td>\n";
echo " <td class=''>".escape($row['number'])."</td>\n";
echo " <td class='hide-sm-dn'>".escape($row['stream'])."</td>\n";
echo " <td class='hide-sm-dn'>".escape($row['description'])."</td>\n";
if (permission_exists('extension_edit') && $list_row_edit_button == 'true') {
echo " <td class='action-button'>\n";
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
echo " </td>\n";
}
echo "</tr>\n";
//increment the value
$x++;
}
unset($extensions);
}
echo "</table>\n";
echo "</div>\n";
echo "<br />\n";
//echo "<div align='center'>".$paging_controls."</div>\n";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "</form>\n";
//include the footer
require_once "resources/footer.php";
?>

View File

@@ -186,6 +186,9 @@
if (permission_exists('stream_delete') && $streams) {
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$settings->get('theme', 'button_icon_delete'),'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
}
if (permission_exists('stream_map') && $streams) {
echo button::create(['type'=>'button','label'=>$text['button-map'],'icon'=>$settings->get('theme', 'button_icon_map'),'id'=>'btn_back','style'=>'margin-right: 15px;','link'=>'stream_map.php']);
}
echo "<form id='form_search' class='inline' method='get'>\n";
if (permission_exists('stream_all')) {
if ($show == 'all') {