Refactor PHP code (#7574)

* Use settings-get method
- get default, domain and user settings
- Replace _SESSION

* Simplify get domain paging

* Change isset using empty

* Fix token name and hash

* Add new default settings category: contact, name: default_sort_column, and default_sort_order

* Update app_config.php

* Update footer.php

* Fix require.php and core/dashboard/index.php (#7563)

* Fix require.php and core/dashboard/index.php

* Fix require.php and core/dashboard/index.php

* Fix require.php and core/dashboard/index.php

* Fix require.php and core/dashboard/index.php

* Fix require.php and core/dashboard/index.php

* Fix require.php and core/dashboard/index.php

* Fix require.php and core/dashboard/index.php

* Fix require.php and core/dashboard/index.php

* Fix require.php and core/dashboard/index.php

* Update destinations.php

* Update permission.php

* Update require.php

---------

Co-authored-by: FusionPBX <markjcrane@gmail.com>
Co-authored-by: FusionPBX <mark@fusionpbx.com>

* Update header.php

* Use settings get classes (#7567)

* access_control

* azure

* azure

* basic_operator_panel

* bridges

* call_block

* call_broadcast

* call_center

* call_flows

* call_forward

* call_recordings

* do_not_disturb

* feature_event_notify

* follow_me

* remove unused object properties

* fix esl command

* fix esl command

* conference_centers

* conference_centers - remove whitespace

* conference_controls

* conference_profiles

* conference_profiles

* Delete core/websockets/resources/classes/socket_exception.php.original~

* Delete core/websockets/resources/classes/websocket_server.php.original~

* conferences

* destinations

* device

* dialplan

* email_queue

* event_guard

* extension_settings

* extension

* fax

* fax_queue

* fifo

* gateways

* ivr_menu

* modules

* switch_music_on_hold

* number_translations

* phrases

* pin_numbers

* provision

* switch_recordings

* registrations

* ring_groups

* sip_profiles

* sofia_global_settings

* streams

* presence

* switch_files

* time_conditions

* vars

* voicemail_greetings

* voicemail

* ringbacks

* contacts

* xml_cdr

* authentication

* dashboard

* default_settings

* domain_settings

* email_templates

* permission

* user_logs

* user_settings

* users

* button

* cache

* captcha

* remove cli_option

* remove directory.php for switch_directory class

* email

* file

* groups

* event_socket use config object

* Use intval to give an integer port

* switch_settings

* tones

* fix object used before initialization

* menu

* fix copy paste error for switch_files.php

* always include require.php for framework files

* Fix missing properties

* set the action

* Use the $database object

* Add missing class properties

* Fix the domain_name

* Use public scope for domain_uuid and domain_name

* Add missing parameters

* Correct the user_uuid parameter

* Add json_validate and use it in the dashboard
update indentation on functions.php

* Intialize the active_registrations variable

* Define the $parameters

* Set a default value for user_setting_enabled

* Add condition domain_uuid not empty

* Add not empty condition for domain_uuid

* Declare the global variables

* Update how the defaults are set use ??

* Use ?? to set the default values

* Update call_center_queue_edit.php

* Prevent an error

* Add domain_name property

* Fix the null coalescing operator

* Removed domain_uuid from the URL

* Change condition to check sip_profile_domain_name

* Refactor domain_uuid declaration and comments

Removed redundant domain_uuid declaration and updated comments.

* Account for an empty value

* Refactor constructor to use settings array

Updated constructor to accept settings array for domain UUID and database initialization.

* Refactor xml_cdr.php to improve variable organization

Removed duplicate domain_uuid declaration and reorganized private variables for better structure.

* Enhance transcription button logic and icon display

Updated transcription button visibility conditions and improved application icon handling in the call flow summary.

* Refactor settings initialization in domains.php

Updated settings initialization to include domain_uuid and user_uuid.

* Modify domain change condition in require.php

Updated condition to check if 'domain_change' is not empty before proceeding.

* Set default_setting_enabled to true by default

* Enhance domain UUID check in access controls

* Enhance domain UUID check in settings list

* Refactor category display logic in vars.php

* Simplify list row URL generation

Removed domain UUID check from list row URL construction.

* Refactor module category display logic

* Fix SQL query by removing parameters variable

* Initialize result_count variable for call recordings

* Refactor leg variable usage in xml_cdr_details.php

* Update conference_room_edit.php

* Change GET to REQUEST for order and search variables

* Set timezone and SQL time format in recordings.php

Added timezone and SQL time format settings.

* Set default for ring group greeting

* Improve domain UUID check in stream listing

* Handle null voicemail_option_param safely

* Add file existence check for greeting files

Check if greeting file exists before getting size and date.

* Improve domain UUID check in email templates

* Update FIFO strategy dropdown and description text

* Add multilingual agent descriptions

Added multilingual descriptions for agents in the app_languages.php file.

* Add music on hold descriptions

* Add the chime list description

Updated copyright year from 2024 to 2025.

* Fix domain UUID check and handle email subject decoding

* Add null coalescing for $value in email_test.php

Ensure $value is not null by providing a default empty string.

* Handle undefined dialplan_uuid in input field

* Add translations for 'Status' label in multiple languages

* Fix typo in config instance check

---------

Co-authored-by: frytimo <tim@fusionpbx.com>
This commit is contained in:
FusionPBX
2025-10-15 21:24:59 -06:00
committed by GitHub
parent e4ca0bf47d
commit dda18481ec
249 changed files with 5180 additions and 4798 deletions

View File

@@ -378,6 +378,33 @@ $text['label-stereo']['zh-cn'] = "立体声";
$text['label-stereo']['ja-jp'] = "ステレオ";
$text['label-stereo']['ko-kr'] = "스테레오";
$text['description-music_on_hold_name']['en-us'] = "A unique music on hold category name.";
$text['description-music_on_hold_name']['en-gb'] = "A unique music on hold category name.";
$text['description-music_on_hold_name']['ar-eg'] = "اسم فئة الموسيقى على الخط الخاص بك مميز.";
$text['description-music_on_hold_name']['de-at'] = "Einzigartiger Name für eine Musik auf Halt Kategorie.";
$text['description-music_on_hold_name']['de-ch'] = "Einzigartiger Name für eine Musik auf Halt Kategorie.";
$text['description-music_on_hold_name']['de-de'] = "Einzigartiger Name für eine Musik auf Halt Kategorie.";
$text['description-music_on_hold_name']['el-gr'] = "Αναλλοίωτος όνομα για μια κατηγορία μουσικής στάσεως.";
$text['description-music_on_hold_name']['es-cl'] = "Un nombre único para una categoría de música en espera.";
$text['description-music_on_hold_name']['es-mx'] = "Un nombre único para una categoría de música en espera.";
$text['description-music_on_hold_name']['fr-ca'] = "Un nom unique pour une catégorie de musique en attente.";
$text['description-music_on_hold_name']['fr-fr'] = "Un nom unique pour une catégorie de musique en attente.";
$text['description-music_on_hold_name']['he-il'] = "שם ייחודי לענף מוזיקה בהלם.";
$text['description-music_on_hold_name']['it-it'] = "Un nome unico per una categoria di musica in attesa.";
$text['description-music_on_hold_name']['ka-ge'] = "ერთნაირობიანი სახელი მუსიკის გადაშენის კატეგორიათათვის.";
$text['description-music_on_hold_name']['nl-nl'] = "Een unieke naam voor een muziek op houding categorie.";
$text['description-music_on_hold_name']['pl-pl'] = "Jedyny nazwa dla kategorii muzyki na pauzie.";
$text['description-music_on_hold_name']['pt-br'] = "Um nome único para uma categoria de música em espera.";
$text['description-music_on_hold_name']['pt-pt'] = "Um nome único para uma categoria de música em espera.";
$text['description-music_on_hold_name']['ro-ro'] = "Un nume unic pentru o categorie de muzică în așteptare.";
$text['description-music_on_hold_name']['ru-ru'] = "Одинаковый уникальный название для категории музыки на паузе.";
$text['description-music_on_hold_name']['sv-se'] = "En unik namn för en pausmusik-kategori.";
$text['description-music_on_hold_name']['uk-ua'] = "Одинаковий унікальний назва для категорії музики на паузі.";
$text['description-music_on_hold_name']['tr-tr'] = "Beklentilmeyen bir müzik bekletme kategorisi ismi.";
$text['description-music_on_hold_name']['zh-cn'] = "一个独特的音乐暂停类别名称.";
$text['description-music_on_hold_name']['ja-jp'] = "音楽保留カテゴリのユニークな名称.";
$text['description-music_on_hold_name']['ko-kr'] = "음악 대기 카테고리의 독특한 이름.";
$text['label-shuffle']['en-us'] = "Shuffle";
$text['label-shuffle']['en-gb'] = "Shuffle";
$text['label-shuffle']['ar-eg'] = "حلق";
@@ -405,6 +432,33 @@ $text['label-shuffle']['zh-cn'] = "洗牌";
$text['label-shuffle']['ja-jp'] = "シャッフル";
$text['label-shuffle']['ko-kr'] = "혼합";
$text['description-music_on_hold_shuffle']['en-us'] = "When true is selected the audio files will play in random order.";
$text['description-music_on_hold_shuffle']['en-gb'] = "When true is selected the audio files will play in random order.";
$text['description-music_on_hold_shuffle']['ar-eg'] = "عندما يتم اختيار القيمة صحيح، سيموت الأغاني الصوتية في ترتيب عشوائي.";
$text['description-music_on_hold_shuffle']['de-at'] = "Wenn true ausgewählt sind, werden die Audiodateien in zufälliger Reihenfolge abgespielt.";
$text['description-music_on_hold_shuffle']['de-ch'] = "Wenn true ausgewählt sind, werden die Audiodateien in zufälliger Reihenfolge abgespielt.";
$text['description-music_on_hold_shuffle']['de-de'] = "Wenn true ausgewählt sind, werden die Audiodateien in zufälliger Reihenfolge abgespielt.";
$text['description-music_on_hold_shuffle']['el-gr'] = "Όταν επιλέγεται το true, οι ακουστικές αρχεία θα παίζονται σε συνοριακή σειρά.";
$text['description-music_on_hold_shuffle']['es-cl'] = "Cuando se selecciona true, los archivos de audio se reproducirán en orden aleatorio.";
$text['description-music_on_hold_shuffle']['es-mx'] = "Cuando se selecciona true, los archivos de audio se reproducirán en orden aleatorio.";
$text['description-music_on_hold_shuffle']['fr-ca'] = "Lorsque true est sélectionné, les fichiers audio seront joués dans un ordre aléatoire.";
$text['description-music_on_hold_shuffle']['fr-fr'] = "Lorsque true est sélectionné, les fichiers audio seront joués dans un ordre aléatoire.";
$text['description-music_on_hold_shuffle']['he-il'] = "כשהוא מוגדר כ-true, המאגרים האודיו יוקלטו בסדר אקראי.";
$text['description-music_on_hold_shuffle']['it-it'] = "Quando true è selezionato, i file audio saranno riprodotti in ordine casuale.";
$text['description-music_on_hold_shuffle']['ka-ge'] = "თუ თქვენ არჩევთ true, აუდიო ფაილები იქნება არასამართლიან სარტყლით გამოიყენება.";
$text['description-music_on_hold_shuffle']['nl-nl'] = "Wanneer true geselecteerd is, zullen de audiobestanden in een willekeurige volgorde afgespeeld worden.";
$text['description-music_on_hold_shuffle']['pl-pl'] = "Kiedy true jest wybrane, pliki dźwiękowe będą odtwarzane w losowej kolejności.";
$text['description-music_on_hold_shuffle']['pt-br'] = "Quando true for selecionado, os arquivos de áudio serão reproduzidos em ordem aleatória.";
$text['description-music_on_hold_shuffle']['pt-pt'] = "Quando true for selecionado, os arquivos de áudio serão reproduzidos em ordem aleatória.";
$text['description-music_on_hold_shuffle']['ro-ro'] = "Când true este selectat, fișierele audio vor fi reproducute în ordine casuală.";
$text['description-music_on_hold_shuffle']['ru-ru'] = "Когда true выбрано, аудиофайлы будут воспроизводиться в случайном порядке.";
$text['description-music_on_hold_shuffle']['sv-se'] = "När true är valt kommer ljudfilerna att spelas upp i slumpad ordning.";
$text['description-music_on_hold_shuffle']['uk-ua'] = "Якщо true вибрано, аудіофайли будуть відтворюватися випадковим порядком.";
$text['description-music_on_hold_shuffle']['tr-tr'] = "True seçildiğinde ses dosyaları rastgele sırayla oynanacaktır.";
$text['description-music_on_hold_shuffle']['zh-cn'] = "当选择 true 时,音频文件将按随机顺序播放.";
$text['description-music_on_hold_shuffle']['ja-jp'] = "true が選択された場合、音声ファイルはランダムな順序で再生されます。";
$text['description-music_on_hold_shuffle']['ko-kr'] = "true가 선택되면 음성 파일은 무작위 순서로 재생됩니다.";
$text['label-select_a_file']['en-us'] = "Select a file...";
$text['label-select_a_file']['en-gb'] = "Select a file...";
$text['label-select_a_file']['ar-eg'] = "اختيار ملف...";
@@ -459,6 +513,33 @@ $text['label-rate']['zh-cn'] = "采样";
$text['label-rate']['ja-jp'] = "サンプリング";
$text['label-rate']['ko-kr'] = "견본 추출";
$text['description-music_on_hold_rate']['en-us'] = "Select the sample rate. Options 8000, 16000, 32000, 48000 and default.";
$text['description-music_on_hold_rate']['en-gb'] = "Select the sample rate. Options 8000, 16000, 32000, 48000 and default";
$text['description-music_on_hold_rate']['ar-eg'] = "اختر معدل العينة. الخيارات 8000، 16000، 32000، 48000 و 기본값.";
$text['description-music_on_hold_rate']['de-at'] = "Wählen Sie die Abtastrate aus. Optionen: 8000, 16000, 32000, 48000 und Standard.";
$text['description-music_on_hold_rate']['de-ch'] = "Wählen Sie die Abtastrate aus. Optionen: 8000, 16000, 32000, 48000 und Standard.";
$text['description-music_on_hold_rate']['de-de'] = "Wählen Sie die Abtastrate aus. Optionen: 8000, 16000, 32000, 48000 und Standard.";
$text['description-music_on_hold_rate']['el-gr'] = "Επιλέξτε το ρυθμό αντλίας. Οι διαθέσιμες ορισμένες είναι 8000, 16000, 32000, 48000 και προσωρινό.";
$text['description-music_on_hold_rate']['es-cl'] = "Seleccione la tasa de muestreo. Opciones 8000, 16000, 32000, 48000 y predeterminado.";
$text['description-music_on_hold_rate']['es-mx'] = "Seleccione la tasa de muestreo. Opciones 8000, 16000, 32000, 48000 y predeterminado.";
$text['description-music_on_hold_rate']['fr-ca'] = "Sélectionnez la fréquence d'échantillonnage. Options 8000, 16000, 32000, 48000 et par défaut.";
$text['description-music_on_hold_rate']['fr-fr'] = "Sélectionnez la fréquence d'échantillonnage. Options 8000, 16000, 32000, 48000 et par défaut.";
$text['description-music_on_hold_rate']['he-il'] = "בחר את המינוח הממוצע. אפשרויות: 8000, 16000, 32000, 48000 ו Mặcון.";
$text['description-music_on_hold_rate']['it-it'] = "Seleziona la frequenza di campionamento. Opzioni: 8000, 16000, 32000, 48000 e predefinito.";
$text['description-music_on_hold_rate']['ka-ge'] = "დაირჩეთ გამოყენების ფრენი. პოსტონება: 8000, 16000, 32000, 48000 და დადგენილი.";
$text['description-music_on_hold_rate']['nl-nl'] = "Selecteer de opnamefrequentie. Opties: 8000, 16000, 32000, 48000 en standaard.";
$text['description-music_on_hold_rate']['pl-pl'] = "Wybierz częstotliwość próbkowania. Opcje: 8000, 16000, 32000, 48000 i domyślne.";
$text['description-music_on_hold_rate']['pt-br'] = "Selecione a taxa de amostragem. Opções: 8000, 16000, 32000, 48000 e padrão.";
$text['description-music_on_hold_rate']['pt-pt'] = "Selecione a taxa de amostragem. Opções: 8000, 16000, 32000, 48000 e padrão.";
$text['description-music_on_hold_rate']['ro-ro'] = "Selectați taxa de campionare. Opțiuni: 8000, 16000, 32000, 48000 și predefinit.";
$text['description-music_on_hold_rate']['ru-ru'] = "Выберите частоту дискретизации. Возможные значения: 8000, 16000, 32000, 48000 и по умолчанию.";
$text['description-music_on_hold_rate']['sv-se'] = "Välj samplingsfrekvens. Alternativ: 8000, 16000, 32000, 48000 och standard.";
$text['description-music_on_hold_rate']['uk-ua'] = "Оберіть частоту дискретизації. Опції: 8000, 16000, 32000, 48000 та за замовчуванням.";
$text['description-music_on_hold_rate']['tr-tr'] = "Düşüm frekansını seçin. Seçenekler: 8000, 16000, 32000, 48000 ve varsayılan.";
$text['description-music_on_hold_rate']['zh-cn'] = "请选择采样率。选项8000, 16000, 32000, 48000 和默认.";
$text['description-music_on_hold_rate']['ja-jp'] = "サンプルレートを選択してください。オプション8000, 16000, 32000, 48000 およびデフォルト.";
$text['description-music_on_hold_rate']['ko-kr'] = "샘플링 레이트를 선택하세요. 옵션: 8000, 16000, 32000, 48000 및 기본값.";
$text['label-play']['en-us'] = "Play";
$text['label-play']['en-gb'] = "Play";
$text['label-play']['ar-eg'] = "اللعب";
@@ -648,6 +729,33 @@ $text['label-interval']['zh-cn'] = "间隔";
$text['label-interval']['ja-jp'] = "間隔";
$text['label-interval']['ko-kr'] = "간격";
$text['description-music_on_hold_interval']['en-us'] = "Set the interval to the number milliseconds between the sound files.";
$text['description-music_on_hold_interval']['en-gb'] = "Set the interval to the number milliseconds between the sound files.";
$text['description-music_on_hold_interval']['ar-eg'] = "حدد الفاصل الزمني بالعدد من ملي ثواني بين ملفات الصوت.";
$text['description-music_on_hold_interval']['de-at'] = "Setze den Intervallwert auf die Anzahl Millisekunden zwischen den Audiodateien.";
$text['description-music_on_hold_interval']['de-ch'] = "Setze den Intervallwert auf die Anzahl Millisekunden zwischen den Audiodateien.";
$text['description-music_on_hold_interval']['de-de'] = "Setze den Intervallwert auf die Anzahl Millisekunden zwischen den Audiodateien.";
$text['description-music_on_hold_interval']['el-gr'] = "Συμπληρώστε τον χρόνο ενός διαστήματος μεταξύ των ακουστικών αρχείων.";
$text['description-music_on_hold_interval']['es-cl'] = "Establezca el intervalo en el número de milisegundos entre los archivos de sonido.";
$text['description-music_on_hold_interval']['es-mx'] = "Establezca el intervalo en el número de milisegundos entre los archivos de sonido.";
$text['description-music_on_hold_interval']['fr-ca'] = "Définissez l'intervalle en millisecondes entre les fichiers sonores.";
$text['description-music_on_hold_interval']['fr-fr'] = "Définissez l'intervalle en millisecondes entre les fichiers sonores.";
$text['description-music_on_hold_interval']['he-il'] = "הגדילו את הפער בינהם של הקטעים האודיו ב-";
$text['description-music_on_hold_interval']['it-it'] = "Imposta l'intervallo in millisecondi tra i file audio.";
$text['description-music_on_hold_interval']['ka-ge'] = "დაარსეთ განახლების პასუხები მილისეკონდებში შემოსავლებს აკუსტიკურ ფაილებს";
$text['description-music_on_hold_interval']['nl-nl'] = "Stel het interval in op de aantallen milliseconden tussen de geluidbestanden.";
$text['description-music_on_hold_interval']['pl-pl'] = "Ustaw interwał na liczbę milisekund między plikami dźwiękowymi.";
$text['description-music_on_hold_interval']['pt-br'] = "Defina o intervalo em milissegundos entre os arquivos de áudio.";
$text['description-music_on_hold_interval']['pt-pt'] = "Defina o intervalo em milissegundos entre os arquivos de áudio.";
$text['description-music_on_hold_interval']['ro-ro'] = "Setați intervalul în milisecunde între fișierele audio.";
$text['description-music_on_hold_interval']['ru-ru'] = "Установите интервал в миллисекундах между звуковыми файлами.";
$text['description-music_on_hold_interval']['sv-se'] = "Ställ in intervalltiden till antalet milisegunder mellan ljudfiler.";
$text['description-music_on_hold_interval']['uk-ua'] = "Задайте інтервал в мілісекундах між аудіофайлами.";
$text['description-music_on_hold_interval']['tr-tr'] = "Ses dosyası aralarındaki milisaniye aralığı ayarlayın.";
$text['description-music_on_hold_interval']['zh-cn'] = "设置间隔为音频文件之间的毫秒数.";
$text['description-music_on_hold_interval']['ja-jp'] = "音声ファイル間のミリ秒数を設定します。";
$text['description-music_on_hold_interval']['ko-kr'] = "음성 파일 간의 밀리초 수를 설정합니다.";
$text['label-timer_name']['en-us'] = "Timer Name";
$text['label-timer_name']['en-gb'] = "Timer Name";
$text['label-timer_name']['ar-eg'] = "اسم الوقت";
@@ -675,6 +783,33 @@ $text['label-timer_name']['zh-cn'] = "定时器名称";
$text['label-timer_name']['ja-jp'] = "タイマー名";
$text['label-timer_name']['ko-kr'] = "타이머 이름";
$text['description-music_on_hold_timer_name']['en-us'] = "Set the timer name. Default: soft";
$text['description-music_on_hold_timer_name']['en-gb'] = "Set the timer name. Default: soft";
$text['description-music_on_hold_timer_name']['ar-eg'] = "حدد اسم التimer. القيمة الافتراضية: soft";
$text['description-music_on_hold_timer_name']['de-at'] = "Setze den Timername. Standard: soft";
$text['description-music_on_hold_timer_name']['de-ch'] = "Setze den Timername. Standard: soft";
$text['description-music_on_hold_timer_name']['de-de'] = "Setze den Timername. Standard: soft";
$text['description-music_on_hold_timer_name']['el-gr'] = "Συμπληρώστε το όνομα του χρονομέτρου. Προσθετικό: soft";
$text['description-music_on_hold_timer_name']['es-cl'] = "Especifique el nombre del temporizador. Predeterminado: soft";
$text['description-music_on_hold_timer_name']['es-mx'] = "Especifique el nombre del temporizador. Predeterminado: soft";
$text['description-music_on_hold_timer_name']['fr-ca'] = "Définissez le nom du timer. Par défaut: soft";
$text['description-music_on_hold_timer_name']['fr-fr'] = "Définissez le nom du timer. Par défaut: soft";
$text['description-music_on_hold_timer_name']['he-il'] = "הגדיר את שם התаймер. התייעך: soft";
$text['description-music_on_hold_timer_name']['it-it'] = "Imposta il nome del timer. Predefinito: soft";
$text['description-music_on_hold_timer_name']['ka-ge'] = "განაცხადეთ ტიმერის სახელი. დადგენილი: soft";
$text['description-music_on_hold_timer_name']['nl-nl'] = "Voer de timernaam in. Standaard: soft";
$text['description-music_on_hold_timer_name']['pl-pl'] = "Podaj nazwę timera. Domyślnie: soft";
$text['description-music_on_hold_timer_name']['pt-br'] = "Insira o nome do temporizador. Predefinido: soft";
$text['description-music_on_hold_timer_name']['pt-pt'] = "Insira o nome do temporizador. Predefinido: soft";
$text['description-music_on_hold_timer_name']['ro-ro'] = "Introduceți numele temporizatorului. Predefinit: soft";
$text['description-music_on_hold_timer_name']['ru-ru'] = "Укажите имя таймера. По умолчанию: soft";
$text['description-music_on_hold_timer_name']['sv-se'] = "Sätt in timernamnet. Standard: soft";
$text['description-music_on_hold_timer_name']['uk-ua'] = "Задайте ім'я таймера. Загальний: soft";
$text['description-music_on_hold_timer_name']['tr-tr'] = "Timer adını girin. Standart: soft";
$text['description-music_on_hold_timer_name']['zh-cn'] = "设置定时器名称。默认soft";
$text['description-music_on_hold_timer_name']['ja-jp'] = "タイマーネームを設定してください。デフォルトsoft";
$text['description-music_on_hold_timer_name']['ko-kr'] = "타이머 이름을 설정하세요. 기본값: soft";
$text['label-global']['en-us'] = "Global";
$text['label-global']['en-gb'] = "Global";
$text['label-global']['ar-eg'] = "عالمي";
@@ -783,6 +918,33 @@ $text['label-file-path']['zh-cn'] = "文件路径";
$text['label-file-path']['ja-jp'] = "ファイルパス";
$text['label-file-path']['ko-kr'] = "파일 경로";
$text['description-music_on_hold_path']['en-us'] = "Set the path to the hold music files.";
$text['description-music_on_hold_path']['en-gb'] = "Set the path to the hold music files.";
$text['description-music_on_hold_path']['ar-eg'] = "حدد مسار الملفات الموسيقية على المكالمة.";
$text['description-music_on_hold_path']['de-at'] = "Setze den Pfad zu den Wartemusikdateien.";
$text['description-music_on_hold_path']['de-ch'] = "Setze den Pfad zu den Wartemusikdateien.";
$text['description-music_on_hold_path']['de-de'] = "Setze den Pfad zu den Wartemusikdateien.";
$text['description-music_on_hold_path']['el-gr'] = "Αναθέστε τον δρόμο των αρχείων μουσικής στο κατάσταση αναμονής.";
$text['description-music_on_hold_path']['es-cl'] = "Establezca la ruta a los archivos de música en espera.";
$text['description-music_on_hold_path']['es-mx'] = "Establezca la ruta a los archivos de música en espera.";
$text['description-music_on_hold_path']['fr-ca'] = "Définissez le chemin vers les fichiers de musique en attente.";
$text['description-music_on_hold_path']['fr-fr'] = "Définissez le chemin vers les fichiers de musique en attente.";
$text['description-music_on_hold_path']['he-il'] = "הגדיל את המסלול לFILES של מוזיקה.";
$text['description-music_on_hold_path']['it-it'] = "Imposta il percorso dei file di musica in attesa.";
$text['description-music_on_hold_path']['ka-ge'] = "დაართულეთ გამოყენების მუსიკალური ფაილების გზად.";
$text['description-music_on_hold_path']['nl-nl'] = "Stel de pad in voor de wachtmuziekbestanden.";
$text['description-music_on_hold_path']['pl-pl'] = "Ustaw ścieżkę do plików muzyki w czekaniu.";
$text['description-music_on_hold_path']['pt-br'] = "Defina o caminho para os arquivos de música em espera.";
$text['description-music_on_hold_path']['pt-pt'] = "Defina o caminho para os arquivos de música em espera.";
$text['description-music_on_hold_path']['ro-ro'] = "Seteți ruta pentru fișierele de muzică în așteptare.";
$text['description-music_on_hold_path']['ru-ru'] = "Установите путь к файлам музыки на ожидании.";
$text['description-music_on_hold_path']['sv-se'] = "Ställ in vägen till väntemusikfilerna.";
$text['description-music_on_hold_path']['uk-ua'] = "Задайте шлях до файлів музики на очікуванні.";
$text['description-music_on_hold_path']['tr-tr'] = "Bekleme müzik dosyalarının yolu belirleyin.";
$text['description-music_on_hold_path']['zh-cn'] = "设置等待音乐文件的路径.";
$text['description-music_on_hold_path']['ja-jp'] = "待ち音楽ファイルのパスを設定します。";
$text['description-music_on_hold_path']['ko-kr'] = "대기 음악 파일 경로 설정.";
$text['label-download']['en-us'] = "Download";
$text['label-download']['en-gb'] = "Download";
$text['label-download']['ar-eg'] = "تحميل";
@@ -918,6 +1080,33 @@ $text['label-chime_maximum']['zh-cn'] = "最大钟声";
$text['label-chime_maximum']['ja-jp'] = "チャイム最大値";
$text['label-chime_maximum']['ko-kr'] = "차임 최대";
$text['description-music_on_hold_chime_max']['en-us'] = "Enter the maximum number of time to play time chime.";
$text['description-music_on_hold_chime_max']['en-gb'] = "Enter the maximum number of time to play time chime.";
$text['description-music_on_hold_chime_max']['ar-eg'] = "أدخل العدد الأقصى للمرة التي يتم تشغيل فيها الصوت.";
$text['description-music_on_hold_chime_max']['de-at'] = "Geben Sie den maximalen Wert an, um wie oft die Zeitton abgespielt werden soll.";
$text['description-music_on_hold_chime_max']['de-ch'] = "Geben Sie den maximalen Wert an, um wie oft die Zeitton abgespielt werden soll.";
$text['description-music_on_hold_chime_max']['de-de'] = "Geben Sie den maximalen Wert an, um wie oft die Zeitton abgespielt werden soll.";
$text['description-music_on_hold_chime_max']['el-gr'] = "Εισάγετε το μέγιστο αριθμό φορών που θέλετε να ακούσετε το χρονικό σήμα.";
$text['description-music_on_hold_chime_max']['es-cl'] = "Ingrese el número máximo de veces que desea que se reproduzca el timbre de espera.";
$text['description-music_on_hold_chime_max']['es-mx'] = "Ingrese el número máximo de veces que desea que se reproduzca el timbre de espera.";
$text['description-music_on_hold_chime_max']['fr-ca'] = "Entrez le nombre maximum de fois que vous souhaitez que le son de la sonnerie soit joué.";
$text['description-music_on_hold_chime_max']['fr-fr'] = "Entrez le nombre maximum de fois que vous souhaitez que le son de la sonnerie soit joué.";
$text['description-music_on_hold_chime_max']['he-il'] = "הכנס את מספר הפעמים המקסימלי שהצופר יוקלט.";
$text['description-music_on_hold_chime_max']['it-it'] = "Inserire il numero massimo di volte in cui si desidera che il suono del segnale di attesa venga riprodotto.";
$text['description-music_on_hold_chime_max']['ka-ge'] = "ჩაითავაზოთ მაქსიმალური რიცხვი, რომელსაც გსურთ გამოიყენოთ დასავლეთის გამოსახულება.";
$text['description-music_on_hold_chime_max']['nl-nl'] = "Voer het maximale aantal keer in dat u de tijdklank wilt laten afspelen.";
$text['description-music_on_hold_chime_max']['pl-pl'] = "Wprowadź maksymalną liczbę razy, w której chcesz, aby dźwięk oczekiwania był odtwarzany.";
$text['description-music_on_hold_chime_max']['pt-br'] = "Insira o número máximo de vezes que deseja que o timbre de espera seja reproduzido.";
$text['description-music_on_hold_chime_max']['pt-pt'] = "Insira o número máximo de vezes que deseja que o timbre de espera seja reproduzido.";
$text['description-music_on_hold_chime_max']['ro-ro'] = "Introduceți numărul maxim de ori în care doriți să se reproducă sunetul de așteptare.";
$text['description-music_on_hold_chime_max']['ru-ru'] = "Введите максимальное количество раз, при котором звук ожидания будет воспроизведен.";
$text['description-music_on_hold_chime_max']['sv-se'] = "Ange antalet gånger du vill att tidslarmet ska spelas igen.";
$text['description-music_on_hold_chime_max']['uk-ua'] = "Введіть максимальну кількість разів, в яких ви хочете, щоб звук очікування був відтворений.";
$text['description-music_on_hold_chime_max']['tr-tr'] = "Beğendiğiniz zamanlama tonu oynatılacak maksimum defa sayısını girin.";
$text['description-music_on_hold_chime_max']['zh-cn'] = "请输入时间提示音播放的最大次数.";
$text['description-music_on_hold_chime_max']['ja-jp'] = "待ち音の再生回数を最大で入力してください。";
$text['description-music_on_hold_chime_max']['ko-kr'] = "대기음 재생 횟수를 최대로 입력해 주세요.";
$text['label-chime_list']['en-us'] = "Chime File";
$text['label-chime_list']['en-gb'] = "Chime File";
$text['label-chime_list']['ar-eg'] = "الملف تتناغم";
@@ -945,6 +1134,33 @@ $text['label-chime_list']['zh-cn'] = "编钟文件";
$text['label-chime_list']['ja-jp'] = "チャイムファイル";
$text['label-chime_list']['ko-kr'] = "차임 파일";
$text['description-music_on_hold_chime_list']['en-us'] = "Select the audio file to play periodically.";
$text['description-music_on_hold_chime_list']['en-gb'] = "Select the audio file to play periodically.";
$text['description-music_on_hold_chime_list']['ar-eg'] = "اختر ملف الصوت الذي تريد تشغيله بشكل منتظم.";
$text['description-music_on_hold_chime_list']['de-at'] = "Wählen Sie das Audio-Datei aus, die periodisch abgespielt werden soll.";
$text['description-music_on_hold_chime_list']['de-ch'] = "Wählen Sie die Audio-Datei aus, die periodisch abgespielt werden soll.";
$text['description-music_on_hold_chime_list']['de-de'] = "Wählen Sie die Audio-Datei aus, die periodisch abgespielt werden soll.";
$text['description-music_on_hold_chime_list']['el-gr'] = "Επιλέξτε το ακουστικό αρχείο που θέλετε να ακούεται περιοδικά.";
$text['description-music_on_hold_chime_list']['es-cl'] = "Seleccione el archivo de audio para reproducir de manera periódica.";
$text['description-music_on_hold_chime_list']['es-mx'] = "Seleccione el archivo de audio para reproducir de manera periódica.";
$text['description-music_on_hold_chime_list']['fr-ca'] = "Sélectionnez le fichier audio à jouer de manière périodique.";
$text['description-music_on_hold_chime_list']['fr-fr'] = "Sélectionnez le fichier audio à jouer de manière périodique.";
$text['description-music_on_hold_chime_list']['he-il'] = "בחר את 파일 האודיו שתרצה לשחק באופן תקופתי.";
$text['description-music_on_hold_chime_list']['it-it'] = "Seleziona il file audio da riprodurre periodicamente.";
$text['description-music_on_hold_chime_list']['ka-ge'] = "ჩაირჩით აუდიო ფილია, რომელიც პერიოდულად გამოიყენება.";
$text['description-music_on_hold_chime_list']['nl-nl'] = "Selecteer het audio-bestand dat periodiek moet worden afgespeeld.";
$text['description-music_on_hold_chime_list']['pl-pl'] = "Wybierz plik dźwiękowy, który ma być regularnie odtwarzany.";
$text['description-music_on_hold_chime_list']['pt-br'] = "Selecione o arquivo de áudio para reproduzir periodicamente.";
$text['description-music_on_hold_chime_list']['pt-pt'] = "Selecione o arquivo de áudio para reproduzir periodicamente.";
$text['description-music_on_hold_chime_list']['ro-ro'] = "Selectați fișierul audio care trebuie să fie reproducut periodic.";
$text['description-music_on_hold_chime_list']['ru-ru'] = "Выберите аудиофайл для периодической воспроизведения.";
$text['description-music_on_hold_chime_list']['sv-se'] = "Välj ljudfilen du vill spela upp periodiskt.";
$text['description-music_on_hold_chime_list']['uk-ua'] = "Виберіть аудіофайл для періодичного відтворення.";
$text['description-music_on_hold_chime_list']['tr-tr'] = "Dönüşümlü olarak oynatılacak ses dosyasını seçin.";
$text['description-music_on_hold_chime_list']['zh-cn'] = "选择周期性播放的音频文件.";
$text['description-music_on_hold_chime_list']['ja-jp'] = "定期的に再生する音声ファイルを選択してください。";
$text['description-music_on_hold_chime_list']['ko-kr'] = "주기적으로 재생할 음성 파일을 선택하세요.";
$text['label-chime_frequency']['en-us'] = "Chime Frequency";
$text['label-chime_frequency']['en-gb'] = "Chime Frequency";
$text['label-chime_frequency']['ar-eg'] = "تردد الرنين";
@@ -972,6 +1188,33 @@ $text['label-chime_frequency']['zh-cn'] = "奇梅频率";
$text['label-chime_frequency']['ja-jp'] = "煙の頻度";
$text['label-chime_frequency']['ko-kr'] = "차임 주파수";
$text['description-music_on_hold_chime_freq']['en-us'] = "Enter the number of seconds to wait until playing the chime.";
$text['description-music_on_hold_chime_freq']['en-gb'] = "Enter the number of seconds to wait until playing the chime.";
$text['description-music_on_hold_chime_freq']['ar-eg'] = "أدخل عدد الثواني التي ترغب في انتظارها حتى يتم تشغيل النغمة.";
$text['description-music_on_hold_chime_freq']['de-at'] = "Geben Sie die Anzahl der Sekunden an, die Sie warten möchten, bis die Melodie abgespielt wird.";
$text['description-music_on_hold_chime_freq']['de-ch'] = "Geben Sie die Anzahl der Sekunden an, die Sie warten möchten, bis die Melodie abgespielt wird.";
$text['description-music_on_hold_chime_freq']['de-de'] = "Geben Sie die Anzahl der Sekunden an, die Sie warten möchten, bis die Melodie abgespielt wird.";
$text['description-music_on_hold_chime_freq']['el-gr'] = "Εισάγετε τον αριθμό δευτερολέπτων που θέλετε να περιμένετε μέχρι να ακούσετε το κουδούματο.";
$text['description-music_on_hold_chime_freq']['es-cl'] = "Ingrese el número de segundos que desea esperar hasta que se reproduzca el timbre.";
$text['description-music_on_hold_chime_freq']['es-mx'] = "Ingrese el número de segundos que desea esperar hasta que se reproduzca el timbre.";
$text['description-music_on_hold_chime_freq']['fr-ca'] = "Entrez le nombre de secondes à attendre avant de jouer le son.";
$text['description-music_on_hold_chime_freq']['fr-fr'] = "Entrez le nombre de secondes à attendre avant de jouer le son.";
$text['description-music_on_hold_chime_freq']['he-il'] = "הכנס את מספר הsekonds שתרצה להמתין עד שיגיע הצלר.";
$text['description-music_on_hold_chime_freq']['it-it'] = "Inserire il numero di secondi da attendere prima di riprodurre il suono.";
$text['description-music_on_hold_chime_freq']['ka-ge'] = "ჩაითავაზეთ მინიჭებული მიწურულების რიცხვი, რომლის შემდეგ გამოიმართა მუსიკა.";
$text['description-music_on_hold_chime_freq']['nl-nl'] = "Voer het aantal seconden in dat u wilt wachten voordat de bel wordt afgespeeld.";
$text['description-music_on_hold_chime_freq']['pl-pl'] = "Wprowadź liczbę sekund, która powinna upłynąć przed odegraniem melodii.";
$text['description-music_on_hold_chime_freq']['pt-br'] = "Insira o número de segundos que deseja esperar até que o timbre seja tocado.";
$text['description-music_on_hold_chime_freq']['pt-pt'] = "Insira o número de segundos que deseja esperar até que o timbre seja tocado.";
$text['description-music_on_hold_chime_freq']['ro-ro'] = "Introduceți numărul de secunde pe care doriți să le așteptați până când sunetul este reproducut.";
$text['description-music_on_hold_chime_freq']['ru-ru'] = "Введите количество секунд, которое вы хотите ожидать до воспроизведения звонка.";
$text['description-music_on_hold_chime_freq']['sv-se'] = "Ange antalet sekunder du vill vänta innan du lyssnar på chime.";
$text['description-music_on_hold_chime_freq']['uk-ua'] = "Введіть кількість секунд, яку ви хочете чекати до того, як відтворити звук.";
$text['description-music_on_hold_chime_freq']['tr-tr'] = "Zaman dilimini belirtin, belin çalınca kadar bekleyin.";
$text['description-music_on_hold_chime_freq']['zh-cn'] = "请输入等待播放提示音的秒数.";
$text['description-music_on_hold_chime_freq']['ja-jp'] = "音を再生するまで待ち時間を入力してください。";
$text['description-music_on_hold_chime_freq']['ko-kr'] = "음이 재생될 때까지 기다리는 시간을 입력하세요.";
$text['label-channels']['en-us'] = "Channels";
$text['label-channels']['en-gb'] = "Channels";
$text['label-channels']['ar-eg'] = "قنوات";
@@ -999,6 +1242,33 @@ $text['label-channels']['zh-cn'] = "频道";
$text['label-channels']['ja-jp'] = "チャンネル";
$text['label-channels']['ko-kr'] = "채널";
$text['description-music_on_hold_channels']['en-us'] = "Select the number of channels in the audio. Options: Mono, Stereo";
$text['description-music_on_hold_channels']['en-gb'] = "Select the number of channels in the audio. Options: Mono, Stereo";
$text['description-music_on_hold_channels']['ar-eg'] = "اختر عدد القنوات في الصوت. الخيارات: مono، Stereo";
$text['description-music_on_hold_channels']['de-at'] = "Wählen Sie die Anzahl der Kanäle im Audio. Optionen: Mono, Stereo";
$text['description-music_on_hold_channels']['de-ch'] = "Wählen Sie die Anzahl der Kanäle im Audio. Optionen: Mono, Stereo";
$text['description-music_on_hold_channels']['de-de'] = "Wählen Sie die Anzahl der Kanäle im Audio. Optionen: Mono, Stereo";
$text['description-music_on_hold_channels']['el-gr'] = "Επιλέξτε τον αριθμό των καναλιών στο ήχο. Οι επιλογές είναι: Mono, Stereo";
$text['description-music_on_hold_channels']['es-cl'] = "Seleccione el número de canales en el audio. Opciones: Mono, Stereo";
$text['description-music_on_hold_channels']['es-mx'] = "Seleccione el número de canales en el audio. Opciones: Mono, Stereo";
$text['description-music_on_hold_channels']['fr-ca'] = "Sélectionnez le nombre de canaux dans l'audio. Options: Mono, Stereo";
$text['description-music_on_hold_channels']['fr-fr'] = "Sélectionnez le nombre de canaux dans l'audio. Options: Mono, Stereo";
$text['description-music_on_hold_channels']['he-il'] = "בחר את מספר התחנות בצליל. אפשרויות: Mono, Stereo";
$text['description-music_on_hold_channels']['it-it'] = "Seleziona il numero di canali nell'audio. Opzioni: Mono, Stereo";
$text['description-music_on_hold_channels']['ka-ge'] = "აირჩიეთ აუდიოს ჩარჩოების რიცხვი. არჩევნები: Mono, Stereo";
$text['description-music_on_hold_channels']['nl-nl'] = "Selecteer het aantal kanaals in het audio. Opties: Mono, Stereo";
$text['description-music_on_hold_channels']['pl-pl'] = "Wybierz liczbę kanałów w dźwięku. Opcje: Mono, Stereo";
$text['description-music_on_hold_channels']['pt-br'] = "Selecione o número de canais no áudio. Opções: Mono, Stereo";
$text['description-music_on_hold_channels']['pt-pt'] = "Selecione o número de canais no áudio. Opções: Mono, Stereo";
$text['description-music_on_hold_channels']['ro-ro'] = "Selectați numărul de canale în audio. Opțiuni: Mono, Stereo";
$text['description-music_on_hold_channels']['ru-ru'] = "Выберите количество каналов в аудио. Опции: Mono, Stereo";
$text['description-music_on_hold_channels']['sv-se'] = "Välj antalet kanaler i ljudet. Alternativ: Mono, Stereo";
$text['description-music_on_hold_channels']['uk-ua'] = "Оберіть кількість каналів в аудіо. Опції: Mono, Stereo";
$text['description-music_on_hold_channels']['tr-tr'] = "Sesin kanal sayısını seçin. Seçenekler: Mono, Stereo";
$text['description-music_on_hold_channels']['zh-cn'] = "请选择音频的通道数。选项MonoStereo";
$text['description-music_on_hold_channels']['ja-jp'] = "オーディオのチャンネル数を選択してください。オプションMono, Stereo";
$text['description-music_on_hold_channels']['ko-kr'] = "오디오의 채널 수를 선택하세요. 옵션: Mono, Stereo";
$text['header-music_on_hold_settings']['en-us'] = "Music on Hold Settings";
$text['header-music_on_hold_settings']['en-gb'] = "Music on Hold Settings";
$text['header-music_on_hold_settings']['ar-eg'] = 'الموسيقى في "هولد ستينغز"';

View File

@@ -105,7 +105,7 @@
}
//replace the sounds_dir variable in the path
$stream_path = str_replace('$${sounds_dir}', $_SESSION['switch']['sounds']['dir'], $stream_path);
$stream_path = str_replace('$${sounds_dir}', $settings->get('switch', 'sounds'), $stream_path);
$stream_path = str_replace('..', '', $stream_path);
//get the file and sanitize it
@@ -236,7 +236,7 @@
//define default path
if ($action == "add") {
$stream_path = path_join($_SESSION['switch']['sounds']['dir'], 'music', $_SESSION['domain_name'], $stream_name, $path_rate);
$stream_path = path_join($settings->get('switch', 'sounds'), 'music', $_SESSION['domain_name'], $stream_name, $path_rate);
$stream_path = str_replace('.loc', '._loc', $stream_path); // 14.03.22 freeswitch bug
}
@@ -244,7 +244,7 @@
$stream_new_name = true;
if (!empty($streams) && @sizeof($streams) != 0) {
foreach ($streams as $row) {
$alternate_path = str_replace('$${sounds_dir}', $_SESSION['switch']['sounds']['dir'], $row['music_on_hold_path']);
$alternate_path = str_replace('$${sounds_dir}', $settings->get('switch', 'sounds'), $row['music_on_hold_path']);
if ($stream_path == $row['music_on_hold_path'] || $stream_path == $alternate_path) {
$stream_new_name = false;
break;
@@ -253,7 +253,7 @@
}
//set the variables
$stream_path = str_replace('$${sounds_dir}', $_SESSION['switch']['sounds']['dir'], $stream_path);
$stream_path = str_replace('$${sounds_dir}', $settings->get('switch', 'sounds'), $stream_path);
//add new path
if ($stream_new_name) {
@@ -525,7 +525,7 @@
}
//get the music on hold path and files
$stream_path = str_replace("\$\${sounds_dir}",$_SESSION['switch']['sounds']['dir'] ?? '', $row['music_on_hold_path']);
$stream_path = str_replace("\$\${sounds_dir}",$settings->get('switch', 'sounds') ?? '', $row['music_on_hold_path']);
if (file_exists($stream_path)) {
$stream_files = array_merge(glob($stream_path.'/*.wav'), glob($stream_path.'/*.mp3'), glob($stream_path.'/*.ogg'));
}

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2016-2024
Portions created by the Initial Developer are Copyright (C) 2016-2025
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -369,9 +369,9 @@
foreach ($recordings as $row) {
$recording_name = $row["recording_name"];
$recording_filename = $row["recording_filename"];
if ($music_on_hold_chime_list == $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename && !empty($music_on_hold_chime_list)) {
if ($music_on_hold_chime_list == $settings->get('switch', 'recordings')."/".$_SESSION['domain_name']."/".$recording_filename && !empty($music_on_hold_chime_list)) {
$tmp_selected = true;
echo " <option value='".escape($_SESSION['switch']['recordings']['dir'])."/".escape($_SESSION['domain_name'])."/".escape($recording_filename)."' selected='selected'>".escape($recording_name)."</option>\n";
echo " <option value='".escape($settings->get('switch', 'recordings'))."/".escape($_SESSION['domain_name'])."/".escape($recording_filename)."' selected='selected'>".escape($recording_name)."</option>\n";
}
else if ($music_on_hold_chime_list == $recording_filename && !empty($music_on_hold_chime_list)) {
$tmp_selected = true;
@@ -429,8 +429,8 @@
if (if_group("superadmin")) {
if (!$tmp_selected && !empty($music_on_hold_chime_list)) {
echo "<optgroup label='Selected'>\n";
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$music_on_hold_chime_list)) {
echo " <option value='".escape($_SESSION['switch']['recordings']['dir'])."/".escape($_SESSION['domain_name'])."/".escape($music_on_hold_chime_list)."' selected='selected'>".escape($music_on_hold_chime_list)."</option>\n";
if (file_exists($settings->get('switch', 'recordings')."/".$_SESSION['domain_name']."/".$music_on_hold_chime_list)) {
echo " <option value='".escape($settings->get('switch', 'recordings'))."/".escape($_SESSION['domain_name'])."/".escape($music_on_hold_chime_list)."' selected='selected'>".escape($music_on_hold_chime_list)."</option>\n";
}
else if (substr($music_on_hold_chime_list, -3) == "wav" || substr($music_on_hold_chime_list, -3) == "mp3") {
echo " <option value='".escape($music_on_hold_chime_list)."' selected='selected'>".escape($music_on_hold_chime_list)."</option>\n";
@@ -440,6 +440,8 @@
unset($tmp_selected);
}
echo " </select>\n";
echo "<br />\n";
echo $text['description-music_on_hold_chime_list']."\n";
echo "</td>\n";
echo "</tr>\n";

View File

@@ -35,13 +35,48 @@
const app_name = 'music_on_hold';
const app_uuid = '1dafe0f8-c08a-289b-0312-15baf4f20f81';
/**
* Set in the constructor. Must be a database object and cannot be null.
* @var database Database Object
*/
private $database;
/**
* Settings object set in the constructor. Must be a settings object and cannot be null.
* @var settings Settings Object
*/
private $settings;
/**
* User UUID set in the constructor. This can be passed in through the $settings_array associative array or set in the session global array
* @var string
*/
private $user_uuid;
/**
* Username set in the constructor. This can be passed in through the $settings_array associative array or set in the session global array
* @var string
*/
private $username;
/**
* Domain UUID set in the constructor. This can be passed in through the $settings_array associative array or set in the session global array
* @var string
*/
private $domain_uuid;
/**
* Domain name set in the constructor. This can be passed in through the $settings_array associative array or set in the session global array
* @var string
*/
private $domain_name;
/**
* declare private variables
*/
private $xml;
private $app_name;
private $app_uuid;
private $database;
private $permission_prefix;
private $list_page;
private $table;
@@ -50,19 +85,20 @@
/**
* called when the object is created
*/
public function __construct() {
public function __construct(array $setting_array = []) {
//set domain and user UUIDs
$this->domain_uuid = $setting_array['domain_uuid'] ?? $_SESSION['domain_uuid'] ?? '';
$this->user_uuid = $setting_array['user_uuid'] ?? $_SESSION['user_uuid'] ?? '';
//set objects
$this->database = $setting_array['database'] ?? database::new();
$this->settings = $setting_array['settings'] ?? new settings(['database' => $this->database, 'domain_uuid' => $this->domain_uuid, 'user_uuid' => $this->user_uuid]);
//assign private variables
$this->permission_prefix = 'music_on_hold_';
$this->list_page = 'music_on_hold.php';
$this->table = 'music_on_hold';
$this->uuid_prefix = 'music_on_hold_';
//connect to the database
if (empty($this->database)) {
$this->database = database::new();
}
}
public function select($name, $selected, $options) {
@@ -110,7 +146,7 @@
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
$sql .= "and stream_enabled = 'true' ";
$sql .= "order by stream_name asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['domain_uuid'] = $this->domain_uuid;
$streams = $this->database->select($sql, $parameters, 'all');
if (is_array($streams) && @sizeof($streams) != 0) {
$select .= " <optgroup label='".$text['label-streams']."'>";
@@ -146,7 +182,7 @@
$sql .= "left join v_domains as d on d.domain_uuid = m.domain_uuid ";
$sql .= "where (m.domain_uuid = :domain_uuid or m.domain_uuid is null) ";
$sql .= "order by m.domain_uuid desc, music_on_hold_name asc, music_on_hold_rate asc ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['domain_uuid'] = $this->domain_uuid;
return $this->database->select($sql, $parameters, 'all');
unset($sql, $parameters);
}
@@ -168,7 +204,7 @@
public function xml() {
//build the list of categories
$music_on_hold_dir = $_SESSION['switch']['sounds']['dir'].'/music';
$music_on_hold_dir = $settings->get('switch', 'sounds').'/music';
//default category (note: GLOB_BRACE doesn't work on some systems)
$array_1 = glob($music_on_hold_dir."/8000".$class_name.".php", GLOB_ONLYDIR);
$array_2 = glob($music_on_hold_dir."/16000".$class_name.".php", GLOB_ONLYDIR);
@@ -218,7 +254,7 @@
}
//check where the default music is stored
$default_moh_prefix = 'music/default';
if(file_exists($_SESSION['switch']['sounds']['dir'].'/music/8000')) {
if(file_exists($settings->get('switch', 'sounds').'/music/8000')) {
$default_moh_prefix = 'music';
}
//replace the variables
@@ -226,7 +262,7 @@
$file_contents = preg_replace("/[\t ]*(?:<!--)?{v_moh_categories}(?:-->)?/", $this->xml, $file_contents);
//write the XML config file
$fout = fopen($_SESSION['switch']['conf']['dir']."/autoload_configs/local_stream.conf.xml","w");
$fout = fopen($settings->get('switch', 'conf')."/autoload_configs/local_stream.conf.xml","w");
fwrite($fout, $file_contents);
fclose($fout);
@@ -250,7 +286,7 @@
unset($sql);
//build an array of the sound files
$music_directory = $_SESSION['switch']['sounds']['dir'].'/music';
$music_directory = $settings->get('switch', 'sounds').'/music';
if (file_exists($music_directory)) {
$files = array_merge(glob($music_directory.'/*/*/*.wav'), glob($music_directory.'/*/*/*/*.wav'), glob($stream_path.'/*/*/*/*.mp3'), glob($stream_path.'/*/*/*/*.ogg'));
}
@@ -362,7 +398,7 @@
$sql = "select * from v_music_on_hold ";
$sql .= "where (domain_uuid = :domain_uuid ".(!permission_exists('music_on_hold_domain') ? "": "or domain_uuid is null ").") ";
$sql .= "and music_on_hold_uuid in ('".implode("','", array_keys($moh))."') ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['domain_uuid'] = $this->domain_uuid;
$rows = $this->database->select($sql, $parameters, 'all');
if (is_array($rows) && @sizeof($rows) != 0) {
foreach ($rows as $row) {
@@ -378,7 +414,7 @@
//prepare path
$stream_path = $streams[$music_on_hold_uuid]['music_on_hold_path'];
$stream_path = str_replace('$${sounds_dir}', $_SESSION['switch']['sounds']['dir'], $stream_path);
$stream_path = str_replace('$${sounds_dir}', $settings->get('switch', 'sounds'), $stream_path);
//delete checked files
foreach ($row as $key => $stream_file) {
@@ -396,7 +432,7 @@
//build delete array
$array[$this->table][$x][$this->uuid_prefix.'uuid'] = $music_on_hold_uuid;
if (!permission_exists('music_on_hold_domain')) {
$array[$this->table][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
$array[$this->table][$x]['domain_uuid'] = $this->domain_uuid;
}
$x++;

View File

@@ -57,7 +57,7 @@
unset($sql, $parameters);
//replace the sounds_dir variable in the path
$stream_path = str_replace('$${sounds_dir}', $_SESSION['switch']['sounds']['dir'], $stream_path);
$stream_path = str_replace('$${sounds_dir}', $settings->get('switch', 'sounds'), $stream_path);
$stream_path = str_replace('..', '', $stream_path);
//get the file and sanitize it
@@ -81,13 +81,13 @@
$waveform = new Waveform($stream_full_path);
Waveform::$linesPerPixel = 1; // default: 8
Waveform::$samplesPerLine = 512; // default: 512
Waveform::$colorA = !empty($_SESSION['theme']['audio_player_waveform_color_a_leg']['text']) ? color_to_rgba_array($_SESSION['theme']['audio_player_waveform_color_a_leg']['text']) : [32,134,37,0.6]; // array rgba, left (a-leg) wave color
Waveform::$colorB = !empty($_SESSION['theme']['audio_player_waveform_color_b_leg']['text']) ? color_to_rgba_array($_SESSION['theme']['audio_player_waveform_color_b_leg']['text']) : [0,125,232,0.6]; // array rgba, right (b-leg) wave color
Waveform::$backgroundColor = !empty($_SESSION['theme']['audio_player_waveform_color_background']['text']) ? color_to_rgba_array($_SESSION['theme']['audio_player_waveform_color_background']['text']) : [0,0,0,0]; // array rgba, default: transparent
Waveform::$axisColor = !empty($_SESSION['theme']['audio_player_waveform_color_axis']['text']) ? color_to_rgba_array($_SESSION['theme']['audio_player_waveform_color_axis']['text']) : [0,0,0,0.3]; // array rgba
Waveform::$singlePhase = filter_var($_SESSION['theme']['audio_player_waveform_single_phase']['boolean'] ?? false, FILTER_VALIDATE_BOOL) ? 'true': 'false'; // positive phase only - left (a-leg) top, right (b-leg) bottom
Waveform::$singleAxis = Waveform::$singlePhase === true ? false : (filter_var($_SESSION['theme']['audio_player_waveform_single_axis']['boolean'] ?? false, FILTER_VALIDATE_BOOL) ? 'true': 'false'); // combine channels into single axis
$height = !empty($_SESSION['theme']['audio_player_waveform_height']['text']) && is_numeric(str_replace('px','',$_SESSION['theme']['audio_player_waveform_height']['text'])) ? 2.2 * (int) str_replace('px','',$_SESSION['theme']['audio_player_waveform_height']['text']) : null;
Waveform::$colorA = !empty($settings->get('theme', 'audio_player_waveform_color_a_leg')) ? color_to_rgba_array($settings->get('theme', 'audio_player_waveform_color_a_leg')) : [32,134,37,0.6]; // array rgba, left (a-leg) wave color
Waveform::$colorB = !empty($settings->get('theme', 'audio_player_waveform_color_b_leg')) ? color_to_rgba_array($settings->get('theme', 'audio_player_waveform_color_b_leg')) : [0,125,232,0.6]; // array rgba, right (b-leg) wave color
Waveform::$backgroundColor = !empty($settings->get('theme', 'audio_player_waveform_color_background')) ? color_to_rgba_array($settings->get('theme', 'audio_player_waveform_color_background')) : [0,0,0,0]; // array rgba, default: transparent
Waveform::$axisColor = !empty($settings->get('theme', 'audio_player_waveform_color_axis')) ? color_to_rgba_array($settings->get('theme', 'audio_player_waveform_color_axis')) : [0,0,0,0.3]; // array rgba
Waveform::$singlePhase = filter_var($settings->get('theme', 'audio_player_waveform_single_phase') ?? false, FILTER_VALIDATE_BOOL) ? 'true': 'false'; // positive phase only - left (a-leg) top, right (b-leg) bottom
Waveform::$singleAxis = Waveform::$singlePhase === true ? false : (filter_var($settings->get('theme', 'audio_player_waveform_single_axis') ?? false, FILTER_VALIDATE_BOOL) ? 'true': 'false'); // combine channels into single axis
$height = !empty($settings->get('theme', 'audio_player_waveform_height')) && is_numeric(str_replace('px','',$settings->get('theme', 'audio_player_waveform_height'))) ? 2.2 * (int) str_replace('px','',$settings->get('theme', 'audio_player_waveform_height')) : null;
$wf = $waveform->getWaveform($temp_filename, 1600, $height ?? 180); // input: png filename returns boolean true/false, or 'base64' returns base64 string
}