Add voicemail_transcription_enabled to extension_edit.php (#6265)

* Rename permission to voicemail_transcription_enabled

* Update voicemail_edit.php

* Add voicemail_transcription_enabled

* Update app_languages.php

* Update voicemail_edit.php
This commit is contained in:
FusionPBX
2022-01-29 02:28:07 -07:00
committed by GitHub
parent 2fb7a5a29c
commit 8e530abb0d
4 changed files with 89 additions and 25 deletions

View File

@@ -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'] = "";

View File

@@ -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 "</td>\n";
echo "</tr>\n";
if (permission_exists('voicemail_transcription_enabled') && $_SESSION['voicemail']['transcribe_enabled']['boolean'] == "true") {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-voicemail_transcription_enabled']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='voicemail_transcription_enabled' id='voicemail_transcription_enabled'>\n";
echo " <option value='true' ".(($voicemail_transcription_enabled == "true") ? "selected='selected'" : null).">".$text['label-true']."</option>\n";
echo " <option value='false' ".(($voicemail_transcription_enabled == "false") ? "selected='selected'" : null).">".$text['label-false']."</option>\n";
echo " </select>\n";
echo "<br />\n";
echo $text['description-voicemail_transcription_enabled']."\n";
echo "</td>\n";
echo "</tr>\n";
}
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-voicemail_file']."\n";

View File

@@ -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++;

View File

@@ -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 "</tr>\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 "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-voicemail_transcription_enabled']."\n";