From b7045176acb0e8e1d1f3bbe0543b179fed12d5b3 Mon Sep 17 00:00:00 2001 From: fusionate Date: Tue, 30 Jan 2024 17:10:19 +0000 Subject: [PATCH] Voicemail - Edit: Manage recorded name for Company Directory. --- app/voicemails/app_languages.php | 48 +++++++++++++++++++++++++++++++ app/voicemails/voicemail_edit.php | 38 ++++++++++++++++++++++-- 2 files changed, 83 insertions(+), 3 deletions(-) diff --git a/app/voicemails/app_languages.php b/app/voicemails/app_languages.php index 2ec31042d6..932f3fdb24 100644 --- a/app/voicemails/app_languages.php +++ b/app/voicemails/app_languages.php @@ -1298,6 +1298,30 @@ $text['label-caller_id_name']['zh-cn'] = "来电显示名称"; $text['label-caller_id_name']['ja-jp'] = "発信者ID名"; $text['label-caller_id_name']['ko-kr'] = "발신자 ID 이름"; +$text['label-recorded_name']['en-us'] = "Name"; +$text['label-recorded_name']['en-gb'] = "Name"; +$text['label-recorded_name']['ar-eg'] = "اسم"; +$text['label-recorded_name']['de-at'] = "Name"; +$text['label-recorded_name']['de-ch'] = "Name"; +$text['label-recorded_name']['de-de'] = "Name"; +$text['label-recorded_name']['es-cl'] = "Nombre"; +$text['label-recorded_name']['es-mx'] = "Nombre"; +$text['label-recorded_name']['fr-ca'] = "Nom"; +$text['label-recorded_name']['fr-fr'] = "Nom"; +$text['label-recorded_name']['he-il'] = "שֵׁם"; +$text['label-recorded_name']['it-it'] = "Nome"; +$text['label-recorded_name']['nl-nl'] = "Naam"; +$text['label-recorded_name']['pl-pl'] = "Nazwa"; +$text['label-recorded_name']['pt-br'] = "Nome"; +$text['label-recorded_name']['pt-pt'] = "Nome"; +$text['label-recorded_name']['ro-ro'] = "Nume"; +$text['label-recorded_name']['ru-ru'] = "Имя"; +$text['label-recorded_name']['sv-se'] = "Namn"; +$text['label-recorded_name']['uk-ua'] = "Назва"; +$text['label-recorded_name']['zh-cn'] = "姓名"; +$text['label-recorded_name']['ja-jp'] = "名前"; +$text['label-recorded_name']['ko-kr'] = "이름"; + $text['header-voicemail_import']['en-us'] = "Voicemail Import"; $text['header-voicemail_import']['en-gb'] = "Voicemail Import"; $text['header-voicemail_import']['ar-eg'] = "استيراد البريد الصوتي"; @@ -1972,6 +1996,30 @@ $text['description-recording_options']['zh-cn'] = "播放錄音選項。"; $text['description-recording_options']['ja-jp'] = "録音オプションを再生します。"; $text['description-recording_options']['ko-kr'] = "녹음 옵션을 재생합니다."; +$text['description-recorded_name']['en-us'] = "Manage the extension's recorded name in the Company Directory."; +$text['description-recorded_name']['en-gb'] = "Manage the extension's recorded name in the Company Directory."; +$text['description-recorded_name']['ar-eg'] = "إدارة الاسم المسجل للامتداد في دليل الشركة."; +$text['description-recorded_name']['de-at'] = "Verwalten Sie den aufgezeichneten Namen der Nebenstelle im Firmenverzeichnis."; +$text['description-recorded_name']['de-ch'] = "Verwalten Sie den aufgezeichneten Namen der Nebenstelle im Firmenverzeichnis."; +$text['description-recorded_name']['de-de'] = "Verwalten Sie den aufgezeichneten Namen der Nebenstelle im Firmenverzeichnis."; +$text['description-recorded_name']['es-cl'] = "Administre el nombre registrado de la extensión en el Directorio de la empresa."; +$text['description-recorded_name']['es-mx'] = "Administre el nombre registrado de la extensión en el Directorio de la empresa."; +$text['description-recorded_name']['fr-ca'] = "Gérez le nom enregistré de l'extension dans l'annuaire de l'entreprise."; +$text['description-recorded_name']['fr-fr'] = "Gérez le nom enregistré de l'extension dans l'annuaire de l'entreprise."; +$text['description-recorded_name']['he-il'] = "נהל את השם המתועד של התוסף בספריית החברה."; +$text['description-recorded_name']['it-it'] = "Gestisci il nome registrato dell'interno nella Directory aziendale."; +$text['description-recorded_name']['nl-nl'] = "Beheer de opgenomen naam van het toestel in de Bedrijfsmap."; +$text['description-recorded_name']['pl-pl'] = "Zarządzaj zarejestrowaną nazwą rozszerzenia w katalogu firmowym."; +$text['description-recorded_name']['pt-br'] = "Gerencie o nome registrado do ramal no Diretório da Empresa."; +$text['description-recorded_name']['pt-pt'] = "Gerencie o nome registrado do ramal no Diretório da Empresa."; +$text['description-recorded_name']['ro-ro'] = "Gestionați numele înregistrat al extensiei în Directorul companiei."; +$text['description-recorded_name']['ru-ru'] = "Управляйте записанным именем расширения в каталоге компании."; +$text['description-recorded_name']['sv-se'] = "Hantera tilläggets registrerade namn i företagskatalogen."; +$text['description-recorded_name']['uk-ua'] = "Керуйте іменем розширення, записаним у довіднику компанії."; +$text['description-recorded_name']['zh-cn'] = "管理公司目录中分机的记录名称。"; +$text['description-recorded_name']['ja-jp'] = "社内ディレクトリで内線番号の録音名を管理します。"; +$text['description-recorded_name']['ko-kr'] = "회사 디렉토리에서 확장 프로그램의 기록된 이름을 관리합니다."; + $text['button-toggle']['en-us'] = "Toggle"; $text['button-toggle']['en-gb'] = "Toggle"; $text['button-toggle']['ar-eg'] = "تبديل"; diff --git a/app/voicemails/voicemail_edit.php b/app/voicemails/voicemail_edit.php index cd62bf525b..aaa8c2da68 100644 --- a/app/voicemails/voicemail_edit.php +++ b/app/voicemails/voicemail_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2023 + Portions created by the Initial Developer are Copyright (C) 2008-2024 the Initial Developer. All Rights Reserved. Contributor(s): @@ -281,6 +281,16 @@ unset($_SESSION['destinations']['array']); } + //delete record name if requested + if ( + $_POST['recorded_name'] == 1 and + !empty($_SESSION['switch']['storage']['dir']) && + file_exists($_SESSION['switch']['storage']['dir'].'/voicemail/default/'.$_SESSION['domain_name'].'/'.$voicemail_id.'/recorded_name.wav') && + (permission_exists('voicemail_greeting_play') || permission_exists('voicemail_greeting_download')) + ) { + @unlink($_SESSION['switch']['storage']['dir'].'/voicemail/default/'.$_SESSION['domain_name'].'/'.$voicemail_id.'/recorded_name.wav'); + } + //set message if ($action == "add" && permission_exists('voicemail_add')) { message::add($text['message-add']); @@ -301,7 +311,7 @@ } //pre-populate the form - if (!empty($_GET)&& is_uuid($_GET["id"]) && empty($_POST["persistformvar"])) { + if (!empty($_GET) && is_uuid($_GET["id"]) && empty($_POST["persistformvar"])) { $voicemail_uuid = $_GET["id"]; $sql = "select * from v_voicemails "; $sql .= "where domain_uuid = :domain_uuid "; @@ -561,7 +571,29 @@ echo $text['description-voicemail_tutorial']."\n"; echo "\n"; echo "\n"; - + + if ( + !empty($_SESSION['switch']['storage']['dir']) && + file_exists($_SESSION['switch']['storage']['dir'].'/voicemail/default/'.$_SESSION['domain_name'].'/'.$voicemail_id.'/recorded_name.wav') && + (permission_exists('voicemail_greeting_play') || permission_exists('voicemail_greeting_download')) + ) { + echo "\n"; + echo "\n"; + echo " ".$text['label-recorded_name']."\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; + echo button::create(['type'=>'button','title'=>$text['label-play'].' / '.$text['label-pause'],'icon'=>$_SESSION['theme']['button_icon_play'],'id'=>'recording_button_recorded_name','style'=>'display: inline-block; margin-right: 15px; margin-top: -2px;','onclick'=>"recording_play('recorded_name')"]); + echo ""; + echo "
\n"; + echo $text['description-recorded_name']."\n"; + echo "\n"; + echo "\n"; + } + echo "\n"; echo "\n"; echo " ".$text['label-greeting']."\n";