diff --git a/app/extensions/app_languages.php b/app/extensions/app_languages.php index 4aeed699d6..341c4d5563 100644 --- a/app/extensions/app_languages.php +++ b/app/extensions/app_languages.php @@ -342,6 +342,27 @@ $text['label-voicemail_local_after_email']['ru-ru'] = "Сообщение хра $text['label-voicemail_local_after_email']['sv-se'] = "Röstbrevlåda Behåll Lokalt"; $text['label-voicemail_local_after_email']['uk-ua'] = "Залишати голосову пошту локально"; +$text['label-voicemail_transcription_enabled']['en-us'] = "Transcription Enabled"; +$text['label-voicemail_transcription_enabled']['en-gb'] = "Transcription Enabled"; +$text['label-voicemail_transcription_enabled']['ar-eg'] = ""; +$text['label-voicemail_transcription_enabled']['de-at'] = "Übertragung aktiviert"; //copied from de-de +$text['label-voicemail_transcription_enabled']['de-ch'] = "Übertragung aktiviert"; //copied from de-de +$text['label-voicemail_transcription_enabled']['de-de'] = "Übertragung aktiviert"; +$text['label-voicemail_transcription_enabled']['es-cl'] = ""; +$text['label-voicemail_transcription_enabled']['es-mx'] = ""; +$text['label-voicemail_transcription_enabled']['fr-ca'] = "Transcription activée"; +$text['label-voicemail_transcription_enabled']['fr-fr'] = "Transcription activée"; +$text['label-voicemail_transcription_enabled']['he-il'] = ""; +$text['label-voicemail_transcription_enabled']['it-it'] = ""; +$text['label-voicemail_transcription_enabled']['nl-nl'] = "Transscriptie geactiveerd"; +$text['label-voicemail_transcription_enabled']['pl-pl'] = ""; +$text['label-voicemail_transcription_enabled']['pt-br'] = ""; +$text['label-voicemail_transcription_enabled']['pt-pt'] = ""; +$text['label-voicemail_transcription_enabled']['ro-ro'] = ""; +$text['label-voicemail_transcription_enabled']['ru-ru'] = "Транскрипция включена"; +$text['label-voicemail_transcription_enabled']['sv-se'] = "Transcription Aktiverad"; +$text['label-voicemail_transcription_enabled']['uk-ua'] = ""; + $text['label-voicemail_file']['en-us'] = "Voicemail File"; $text['label-voicemail_file']['en-gb'] = "Voicemail File"; $text['label-voicemail_file']['ar-eg'] = ""; @@ -1969,6 +1990,27 @@ $text['description-voicemail_local_after_email']['ru-ru'] = "Выберите, $text['description-voicemail_local_after_email']['sv-se'] = "Välj om du vill behålla röstmeddelande i systemet efter att e-postmeddelandet skickats."; $text['description-voicemail_local_after_email']['uk-ua'] = ""; +$text['description-voicemail_transcription_enabled']['en-us'] = "Choose if voicemail transcription is enabled for this extension"; +$text['description-voicemail_transcription_enabled']['en-gb'] = "Choose if voicemail transcription is enabled for this extension"; +$text['description-voicemail_transcription_enabled']['ar-eg'] = ""; +$text['description-voicemail_transcription_enabled']['de-at'] = "Wählen Sie, ob die Voicemail Übertragung für diese Nebenstelle aktiviert werden soll"; //copied from de-de +$text['description-voicemail_transcription_enabled']['de-ch'] = "Wählen Sie, ob die Voicemail Übertragung für diese Nebenstelle aktiviert werden soll"; //copied from de-de +$text['description-voicemail_transcription_enabled']['de-de'] = "Wählen Sie, ob die Voicemail Übertragung für diese Nebenstelle aktiviert werden soll"; +$text['description-voicemail_transcription_enabled']['es-cl'] = ""; +$text['description-voicemail_transcription_enabled']['es-mx'] = ""; +$text['description-voicemail_transcription_enabled']['fr-ca'] = "Choisissez si la transcription de la messagerie vocale est activée pour cette extension"; +$text['description-voicemail_transcription_enabled']['fr-fr'] = "Choisissez si la transcription de la messagerie vocale est activée pour cette extension"; +$text['description-voicemail_transcription_enabled']['he-il'] = ""; +$text['description-voicemail_transcription_enabled']['it-it'] = ""; +$text['description-voicemail_transcription_enabled']['nl-nl'] = "Kies als antwoordapparaat transscriptie aangezet is voor dit toestel"; +$text['description-voicemail_transcription_enabled']['pl-pl'] = ""; +$text['description-voicemail_transcription_enabled']['pt-br'] = ""; +$text['description-voicemail_transcription_enabled']['pt-pt'] = ""; +$text['description-voicemail_transcription_enabled']['ro-ro'] = ""; +$text['description-voicemail_transcription_enabled']['ru-ru'] = "Выберите, разрешена ли голосовая почта для этого расширения"; +$text['description-voicemail_transcription_enabled']['sv-se'] = "Välj om transcription är aktiverat för denna anknytning "; +$text['description-voicemail_transcription_enabled']['uk-ua'] = ""; + $text['description-voicemail_file']['en-us'] = "Select a listening option to include with the email notification."; $text['description-voicemail_file']['en-gb'] = "Select a listening option to include with the email notification."; $text['description-voicemail_file']['ar-eg'] = ""; diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index a2c40a39d8..5be7c7fb6f 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -110,6 +110,7 @@ $voicemail_password = $_POST["voicemail_password"]; $voicemail_enabled = $_POST["voicemail_enabled"]; $voicemail_mail_to = $_POST["voicemail_mail_to"]; + $voicemail_transcription_enabled = $_POST["voicemail_transcription_enabled"]; $voicemail_file = $_POST["voicemail_file"]; $voicemail_local_after_email = $_POST["voicemail_local_after_email"]; $user_context = $_POST["user_context"]; @@ -657,6 +658,10 @@ if (!is_uuid($voicemail_uuid)) { $voicemail_uuid = uuid(); $voicemail_tutorial = 'true'; + //if adding a mailbox and don't have the transcription permission, set the default transcribe behavior + if (!permission_exists('voicemail_transcription_enabled') && isset($_SESSION['voicemail']['transcription_enabled_default']['boolean'])) { + $voicemail_transcription_enabled = $_SESSION['voicemail']['transcription_enabled_default']['boolean']; + } } //add the voicemail to the array @@ -669,6 +674,7 @@ //$array["voicemails"][$i]["voicemail_alternate_greet_id"] = $alternate_greet_id; $array["voicemails"][$i]["voicemail_mail_to"] = $voicemail_mail_to; //$array["voicemails"][$i]["voicemail_attach_file"] = $voicemail_attach_file; + $array["voicemails"][$i]["voicemail_transcription_enabled"] = $voicemail_transcription_enabled; $array["voicemails"][$i]["voicemail_file"] = $voicemail_file; if (permission_exists('voicemail_local_after_email')) { $array["voicemails"][$i]["voicemail_local_after_email"] = $voicemail_local_after_email; @@ -676,9 +682,6 @@ $array["voicemails"][$i]["voicemail_enabled"] = $voicemail_enabled; $array["voicemails"][$i]["voicemail_description"] = $description; $array["voicemails"][$i]["voicemail_tutorial"] = $voicemail_tutorial; - if ($action == 'add') { - $array["voicemails"][$i]["voicemail_transcription_enabled"] = $_SESSION['voicemail']['transcription_enabled_default']['boolean'] ?: false; - } //make sure the voicemail directory exists if (is_numeric($voicemail_id)) { @@ -869,23 +872,23 @@ //get the voicemail data if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/voicemails')) { - //get the voicemails - $sql = "select * from v_voicemails "; - $sql .= "where domain_uuid = :domain_uuid "; - $sql .= "and voicemail_id = :voicemail_id "; - $parameters['domain_uuid'] = $domain_uuid; - $parameters['voicemail_id'] = is_numeric($number_alias) ? $number_alias : $extension; - $database = new database; - $row = $database->select($sql, $parameters, 'row'); - if (is_array($row) && @sizeof($row) != 0) { - $voicemail_password = str_replace("#", "", $row["voicemail_password"]); - $voicemail_mail_to = str_replace(" ", "", $row["voicemail_mail_to"]); - $voicemail_file = $row["voicemail_file"]; - $voicemail_local_after_email = $row["voicemail_local_after_email"]; - $voicemail_enabled = $row["voicemail_enabled"]; - $voicemail_tutorial = $row["voicemail_tutorial"]; - } - unset($sql, $parameters, $row); + $sql = "select * from v_voicemails "; + $sql .= "where domain_uuid = :domain_uuid "; + $sql .= "and voicemail_id = :voicemail_id "; + $parameters['domain_uuid'] = $domain_uuid; + $parameters['voicemail_id'] = is_numeric($number_alias) ? $number_alias : $extension; + $database = new database; + $row = $database->select($sql, $parameters, 'row'); + if (is_array($row) && @sizeof($row) != 0) { + $voicemail_password = str_replace("#", "", $row["voicemail_password"]); + $voicemail_mail_to = str_replace(" ", "", $row["voicemail_mail_to"]); + $voicemail_transcription_enabled = $row["voicemail_transcription_enabled"]; + $voicemail_file = $row["voicemail_file"]; + $voicemail_local_after_email = $row["voicemail_local_after_email"]; + $voicemail_enabled = $row["voicemail_enabled"]; + $voicemail_tutorial = $row["voicemail_tutorial"]; + } + unset($sql, $parameters, $row); } } @@ -998,6 +1001,7 @@ if (strlen($call_timeout) == 0) { $call_timeout = '30'; } if (strlen($call_screen_enabled) == 0) { $call_screen_enabled = 'false'; } if (strlen($user_record) == 0) { $user_record = $_SESSION['extension']['user_record_default']['text']; } + if (strlen($voicemail_transcription_enabled) == 0) { $voicemail_transcription_enabled = $_SESSION['voicemail']['transcription_enabled_default']['boolean']; } if (strlen($voicemail_enabled) == 0) { $voicemail_enabled = $_SESSION['voicemail']['enabled_default']['boolean']; } //create token @@ -1717,6 +1721,22 @@ echo "\n"; echo "\n"; + if (permission_exists('voicemail_transcription_enabled') && $_SESSION['voicemail']['transcribe_enabled']['boolean'] == "true") { + echo "\n"; + echo "\n"; + echo " ".$text['label-voicemail_transcription_enabled']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-voicemail_transcription_enabled']."\n"; + echo "\n"; + echo "\n"; + } + echo "\n"; echo "\n"; echo " ".$text['label-voicemail_file']."\n"; diff --git a/app/voicemails/app_config.php b/app/voicemails/app_config.php index f1ab1e244e..deb09c60bb 100644 --- a/app/voicemails/app_config.php +++ b/app/voicemails/app_config.php @@ -95,7 +95,7 @@ $apps[$x]['permissions'][$y]['groups'][] = "user"; $apps[$x]['permissions'][$y]['groups'][] = "agent"; $y++; - $apps[$x]['permissions'][$y]['name'] = "voicemail_transcription_edit"; + $apps[$x]['permissions'][$y]['name'] = "voicemail_transcription_enabled"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; $y++; diff --git a/app/voicemails/voicemail_edit.php b/app/voicemails/voicemail_edit.php index 9eed404a15..fa984414fb 100644 --- a/app/voicemails/voicemail_edit.php +++ b/app/voicemails/voicemail_edit.php @@ -138,8 +138,10 @@ //get a new voicemail_uuid if ($action == "add" && permission_exists('voicemail_add')) { $voicemail_uuid = uuid(); - //If adding a mailbox, set the default transcribe behavior - $voicemail_transcription_enabled = $_SESSION['voicemail']['transcription_enabled_default']['boolean']; + //if adding a mailbox and don't have the transcription permission, set the default transcribe behavior + if (!permission_exists('voicemail_transcription_enabled') && isset($_SESSION['voicemail']['transcription_enabled_default']['boolean'])) { + $voicemail_transcription_enabled = $_SESSION['voicemail']['transcription_enabled_default']['boolean']; + } } //add common array fields @@ -315,7 +317,7 @@ //set defaults if (strlen($voicemail_local_after_email) == 0) { $voicemail_local_after_email = "true"; } if (strlen($voicemail_enabled) == 0) { $voicemail_enabled = "true"; } - if (strlen($voicemail_transcription_enabled) == 0) { $voicemail_transcription_enabled = $_SESSION['voicemail']['transcription_enabled_default']['boolean'] ?: "false"; } + if (strlen($voicemail_transcription_enabled) == 0) { $voicemail_transcription_enabled = $_SESSION['voicemail']['transcription_enabled_default']['boolean']; } if (strlen($voicemail_tutorial) == 0) { $voicemail_tutorial = "false"; } //get the greetings list @@ -648,7 +650,7 @@ echo "\n"; } - if (permission_exists('voicemail_transcription_edit') && $_SESSION['voicemail']['transcribe_enabled']['boolean'] == "true") { + if (permission_exists('voicemail_transcription_enabled') && $_SESSION['voicemail']['transcribe_enabled']['boolean'] == "true") { echo "\n"; echo "\n"; echo " ".$text['label-voicemail_transcription_enabled']."\n";