diff --git a/app/destinations/resources/classes/destinations.php b/app/destinations/resources/classes/destinations.php index 5a118f47d..de8a2418f 100644 --- a/app/destinations/resources/classes/destinations.php +++ b/app/destinations/resources/classes/destinations.php @@ -400,17 +400,20 @@ $response .= " \n"; foreach ($this->destinations as $row) { + //set variables to simplify the code $name = $row['name']; $label = $row['label']; - $destination = $row['field']['destination'] ?? ''; //add multi-lingual support if (file_exists(dirname(__DIR__, 4)."/app/".$name."/app_languages.php")) { $text2 = $language2->get($this->language, 'app/'.$name); } + //set the group label + $group_label = ($text2['label-'.$name] ?? $text2['title-'.$name]); + if (!empty($row['result']['data']) && !empty($row['select_value'][$destination_type])) { - $response .= " \n"; + $response .= " \n"; $label2 = $label; foreach ($row['result']['data'] as $data) { $select_value = $row['select_value'][$destination_type]; @@ -530,6 +533,9 @@ //add the language object $language2 = new text; + //pre-define the array + $text2 = []; + //build the destination select list in html $response .= " \n"; diff --git a/app/recordings/app_config.php b/app/recordings/app_config.php index ab8692345..e41de4118 100644 --- a/app/recordings/app_config.php +++ b/app/recordings/app_config.php @@ -45,6 +45,34 @@ $apps[$x]['destinations'][$y]['select_value']['dialplan'] = "lua:streamfile.lua \${destination}"; $apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:lua streamfile.lua \${destination}"; $apps[$x]['destinations'][$y]['select_label'] = "\${name}"; + $y++; + $apps[$x]['destinations'][$y]['type'] = "sql"; + $apps[$x]['destinations'][$y]['label'] = "playback"; + $apps[$x]['destinations'][$y]['name'] = "playback"; + $apps[$x]['destinations'][$y]['sql'] = "SELECT "; + $apps[$x]['destinations'][$y]['sql'] .= " r.recording_uuid, r.recording_name AS name, "; + $apps[$x]['destinations'][$y]['sql'] .= " s.recording_path || '/' || d.domain_name || '/' || r.recording_filename AS destination "; + $apps[$x]['destinations'][$y]['sql'] .= "FROM "; + $apps[$x]['destinations'][$y]['sql'] .= " v_recordings AS r "; + $apps[$x]['destinations'][$y]['sql'] .= "INNER JOIN "; + $apps[$x]['destinations'][$y]['sql'] .= " v_domains AS d ON r.domain_uuid = d.domain_uuid "; + $apps[$x]['destinations'][$y]['sql'] .= "CROSS JOIN ( "; + $apps[$x]['destinations'][$y]['sql'] .= " SELECT default_setting_value AS recording_path "; + $apps[$x]['destinations'][$y]['sql'] .= " FROM v_default_settings "; + $apps[$x]['destinations'][$y]['sql'] .= " WHERE default_setting_category = 'switch' "; + $apps[$x]['destinations'][$y]['sql'] .= " AND default_setting_subcategory = 'recordings' "; + $apps[$x]['destinations'][$y]['sql'] .= ") AS s "; + $apps[$x]['destinations'][$y]['sql'] .= "WHERE "; + $apps[$x]['destinations'][$y]['sql'] .= " r.domain_uuid = '\${domain_uuid}' "; + $apps[$x]['destinations'][$y]['sql'] .= " AND d.domain_uuid = '\${domain_uuid}' "; + $apps[$x]['destinations'][$y]['order_by'] = "recording_name asc"; + $apps[$x]['destinations'][$y]['field']['uuid'] = "recording_uuid"; + $apps[$x]['destinations'][$y]['field']['name'] = "recording_name"; + $apps[$x]['destinations'][$y]['field']['destination'] = "recording_filename"; + $apps[$x]['destinations'][$y]['field']['description'] = "recording_description"; + $apps[$x]['destinations'][$y]['select_value']['dialplan'] = "playback:\${destination}"; + $apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:playback \${destination}"; + $apps[$x]['destinations'][$y]['select_label'] = "\${name}"; //permission details $y=0; @@ -90,6 +118,11 @@ $apps[$x]['permissions'][$y]['name'] = "recording_password"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $y++; + $apps[$x]['permissions'][$y]['name'] = "playback_destinations"; + $apps[$x]['permissions'][$y]['groups'][] = "user"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; //default settings $y=0; diff --git a/resources/app_languages.php b/resources/app_languages.php index 50da3eaa0..122f1fdb2 100644 --- a/resources/app_languages.php +++ b/resources/app_languages.php @@ -4507,6 +4507,33 @@ $text['label-recordings']['zh-cn'] = "录音"; $text['label-recordings']['ja-jp'] = "録音"; $text['label-recordings']['ko-kr'] = "녹음"; +$text['label-playback']['en-us'] = "Playback"; +$text['label-playback']['en-gb'] = "Playback"; +$text['label-playback']['ka-ge'] = "დაკვრა"; +$text['label-playback']['ar-eg'] = "التشغيل"; +$text['label-playback']['de-at'] = "Wiedergabe"; +$text['label-playback']['de-ch'] = "Wiedergabe"; +$text['label-playback']['de-de'] = "Wiedergabe"; +$text['label-playback']['el-gr'] = "Αναπαραγωγή"; +$text['label-playback']['es-cl'] = "Reproducción"; +$text['label-playback']['es-mx'] = "Reproducción"; +$text['label-playback']['fr-ca'] = "Lecture"; +$text['label-playback']['fr-fr'] = "Lecture"; +$text['label-playback']['he-il'] = "הפעלה"; +$text['label-playback']['it-it'] = "Riproduzione"; +$text['label-playback']['nl-nl'] = "Afspelen"; +$text['label-playback']['pl-pl'] = "Odtwarzanie"; +$text['label-playback']['pt-br'] = "Reprodução"; +$text['label-playback']['pt-pt'] = "Reprodução"; +$text['label-playback']['ro-ro'] = "Redare"; +$text['label-playback']['ru-ru'] = "Воспроизведение"; +$text['label-playback']['sv-se'] = "Uppspelning"; +$text['label-playback']['uk-ua'] = "Відтворення"; +$text['label-playback']['tr-tr'] = "Oynatma"; +$text['label-playback']['zh-cn'] = "播放"; +$text['label-playback']['ja-jp'] = "再生"; +$text['label-playback']['ko-kr'] = "재생"; + $text['label-ringtones']['en-us'] = "Ringtones"; $text['label-ringtones']['ka-ge'] = "ზარის მელოდიები"; $text['label-ringtones']['en-gb'] = "Ringtones";