diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index b8dd6f5a17..ec014d9c80 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -1772,7 +1772,7 @@ echo "\n"; echo "\n"; - if (permission_exists('voicemail_transcription_enabled') && ($_SESSION['voicemail']['transcribe_enabled']['boolean'] ?? '') == "true") { + if (permission_exists('voicemail_transcription_enabled') && ($_SESSION['transcribe']['enabled']['boolean'] ?? '') == "true") { echo "\n"; echo "\n"; echo " ".$text['label-voicemail_transcription_enabled']."\n"; diff --git a/app/switch/resources/scripts/app/voicemail/index.lua b/app/switch/resources/scripts/app/voicemail/index.lua index 7a88d3a17b..30056cbd66 100644 --- a/app/switch/resources/scripts/app/voicemail/index.lua +++ b/app/switch/resources/scripts/app/voicemail/index.lua @@ -567,7 +567,7 @@ if (storage_type == "base64") then table.insert(sql, "message_base64, "); end - if (transcribe_enabled == "true") and (voicemail_transcription_enabled == "true") then + if (voicemail_transcription_enabled == "true") then table.insert(sql, "message_transcription, "); end table.insert(sql, "message_length "); @@ -585,7 +585,7 @@ if (storage_type == "base64") then table.insert(sql, ":message_base64, "); end - if (transcribe_enabled == "true") and (voicemail_transcription_enabled == "true") then + if (voicemail_transcription_enabled == "true") then table.insert(sql, ":transcription, "); end table.insert(sql, ":message_length "); diff --git a/app/switch/resources/scripts/app/voicemail/resources/functions/send_email.lua b/app/switch/resources/scripts/app/voicemail/resources/functions/send_email.lua index 0322a8f7c6..06d98b6cbc 100644 --- a/app/switch/resources/scripts/app/voicemail/resources/functions/send_email.lua +++ b/app/switch/resources/scripts/app/voicemail/resources/functions/send_email.lua @@ -30,9 +30,8 @@ --define a function to send email function send_email(id, uuid) - local db = dbh or Database.new('system') - local settings = Settings.new(db, domain_name, domain_uuid) - local transcribe_enabled = settings:get('voicemail', 'transcribe_enabled', 'boolean'); + local db = dbh or Database.new('system'); + local settings = Settings.new(db, domain_name, domain_uuid); local http_protocol = settings:get('domain', 'http_protocol', 'text') or "https"; local email_queue_enabled = "true"; @@ -185,7 +184,7 @@ sql = sql .. "WHERE (domain_uuid = :domain_uuid or domain_uuid is null) "; sql = sql .. "AND template_language = :template_language "; sql = sql .. "AND template_category = 'voicemail' " - if (transcribe_enabled == 'true' and voicemail_transcription_enabled == 'true') then + if (voicemail_transcription_enabled == 'true') then sql = sql .. "AND template_subcategory = 'transcription' " else sql = sql .. "AND template_subcategory = 'default' " diff --git a/app/voicemails/app_config.php b/app/voicemails/app_config.php index 2d47148345..a34a4091f2 100644 --- a/app/voicemails/app_config.php +++ b/app/voicemails/app_config.php @@ -386,14 +386,6 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; $y++; - $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "5d9a1f93-e163-4c05-a975-bd1e5a045660"; - $apps[$x]['default_settings'][$y]['default_setting_category'] = "voicemail"; - $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "transcribe_enabled"; - $apps[$x]['default_settings'][$y]['default_setting_name'] = "boolean"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "true"; - $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; - $apps[$x]['default_settings'][$y]['default_setting_description'] = "Transcription enabled default false."; - $y++; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "275cf580-7b72-45e4-9af5-b8eed9a45ec0"; $apps[$x]['default_settings'][$y]['default_setting_category'] = "voicemail"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "database_retention_days"; diff --git a/app/voicemails/voicemail_messages.php b/app/voicemails/voicemail_messages.php index cba17c30a5..803d213765 100644 --- a/app/voicemails/voicemail_messages.php +++ b/app/voicemails/voicemail_messages.php @@ -458,10 +458,7 @@ } echo button::create(['type'=>'button','title'=>$text['label-play'].' / '.$text['label-pause'].' '.$text['label-message'],'icon'=>$_SESSION['theme']['button_icon_play'],'id'=>'recording_button_'.escape($row['voicemail_message_uuid']),'onclick'=>"recording_play('".escape($row['voicemail_message_uuid'])."','".$row['voicemail_id'].'|'.$row['voicemail_uuid']."','message');"]); echo button::create(['type'=>'button','title'=>$text['label-download'],'icon'=>$_SESSION['theme']['button_icon_download'],'link'=>"voicemail_messages.php?action=download&id=".urlencode($row['voicemail_id'])."&voicemail_uuid=".escape($row['voicemail_uuid'])."&uuid=".escape($row['voicemail_message_uuid'])."&t=bin&r=".uuid(),'onclick'=>"$(this).closest('tr').children('td').css('font-weight','normal');"]); - if ( - (!empty($_SESSION['voicemail']['transcribe_enabled']['boolean']) && $_SESSION['voicemail']['transcribe_enabled']['boolean'] == 'true' && !empty($row['message_transcription'])) || - ($transcribe_enabled == 'true' && !empty($transcribe_engine) && $transcriptions_exists === true) - ) { + if (!empty($row['message_transcription']) || ($transcribe_enabled == 'true' && !empty($transcribe_engine) && $transcriptions_exists === true)) { echo button::create(['type'=>'button','title'=>$text['label-transcription'],'icon'=>'quote-right','style'=>(empty($row['message_transcription']) ? 'visibility:hidden;' : null),'onclick'=>(!empty($bold) ? "mark_saved('".$row['voicemail_message_uuid']."', '".$row['voicemail_uuid']."');" : null)."document.getElementById('transcription_".$row['voicemail_message_uuid']."').style.display = document.getElementById('transcription_".$row['voicemail_message_uuid']."').style.display == 'none' ? 'table-row' : 'none'; this.blur(); return false;"]); } echo " \n"; @@ -470,10 +467,7 @@ echo " ".escape($row['file_size_label'])."\n"; } echo "\n"; - if ( - (!empty($_SESSION['voicemail']['transcribe_enabled']['boolean']) && $_SESSION['voicemail']['transcribe_enabled']['boolean'] == 'true' && !empty($row['message_transcription'])) || - ($transcribe_enabled == 'true' && !empty($transcribe_engine) && $transcriptions_exists === true) - ) { + if (!empty($row['message_transcription']) || ($transcribe_enabled == 'true' && !empty($transcribe_engine) && $transcriptions_exists === true)) { echo "\n"; // dummy row to maintain same background color for transcription row echo "\n"; echo " \n";