diff --git a/app/streams/app_config.php b/app/streams/app_config.php index f0f7ca7b03..27f3db6dcd 100644 --- a/app/streams/app_config.php +++ b/app/streams/app_config.php @@ -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++; diff --git a/app/streams/app_languages.php b/app/streams/app_languages.php index d12291d17b..c05eda5508 100644 --- a/app/streams/app_languages.php +++ b/app/streams/app_languages.php @@ -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'] = '스트리밍'; + diff --git a/app/streams/resources/database/views/streams.php b/app/streams/resources/database/views/streams.php new file mode 100644 index 0000000000..d076a9f02d --- /dev/null +++ b/app/streams/resources/database/views/streams.php @@ -0,0 +1,117 @@ + + 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 "
\n"; + echo "
".$text['title-stream_map']."
".number_format($num_rows)."
\n"; + echo "
\n"; + echo "\n"; + echo "
\n"; + echo "
\n"; + echo "
\n"; + + echo $text['title_description-stream_map']."\n"; + echo "

\n"; + + echo "
\n"; + echo "\n"; + echo "\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 "\n"; + echo "\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 "".escape($text2['title-'.$application])."\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + if (permission_exists('extension_view') && $list_row_edit_button == 'true') { + echo " \n"; + } + echo "\n"; + + echo "\n"; + if (!empty($show) && $show == 'all' && permission_exists('dialplan_all')) { + echo " \n"; + } + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + if (permission_exists('extension_view') && $list_row_edit_button == 'true') { + echo " \n"; + } + echo "\n"; + } + + //ad the table row + echo "\n"; + if (!empty($show) && $show == 'all' && permission_exists('dialplan_all')) { + echo " \n"; + } + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + if (permission_exists('extension_edit') && $list_row_edit_button == 'true') { + echo " \n"; + } + echo "\n"; + + //increment the value + $x++; + } + unset($extensions); + } + + echo "
 
".escape($text['label-domain_name'])."".escape($text['label-name'])."".escape($text['label-type'])."".escape($text['label-extension'])."".escape($text['label-stream'])."".escape($text['label-description'])."\n"; + echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]); + echo "
".escape($row['domain_name'])."".escape($row['name'])."".escape($row['type'])."".escape($row['number'])."".escape($row['stream'])."".escape($row['description'])."\n"; + echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]); + echo "
\n"; + echo "
\n"; + echo "
\n"; + + //echo "
".$paging_controls."
\n"; + echo "\n"; + echo "
\n"; + +//include the footer + require_once "resources/footer.php"; + +?> diff --git a/app/streams/streams.php b/app/streams/streams.php index 96238d3ab1..ad3b2ed31e 100644 --- a/app/streams/streams.php +++ b/app/streams/streams.php @@ -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 "