diff --git a/app/voicemails/voicemail_messages.php b/app/voicemails/voicemail_messages.php index 3f4e385bb1..77f498466e 100644 --- a/app/voicemails/voicemail_messages.php +++ b/app/voicemails/voicemail_messages.php @@ -274,10 +274,6 @@ echo "".$text['label-message_size']."\n"; $col_count++; } - if ($_SESSION['voicemail']['transcribe_enabled']['boolean'] == 'true') { - echo "".$text['label-transcription']."\n"; - $col_count++; - } echo "\n"; } @@ -311,15 +307,24 @@ echo ""; echo button::create(['type'=>'button','title'=>$text['label-play'].' / '.$text['label-pause'],'icon'=>$_SESSION['theme']['button_icon_play'],'id'=>'recording_button_'.escape($row['voicemail_message_uuid']),'onclick'=>"recording_play('".escape($row['voicemail_message_uuid'])."');"]); 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 ($_SESSION['voicemail']['transcribe_enabled']['boolean'] == 'true' && $row['message_transcription'] != '') { + echo button::create(['type'=>'button','title'=>$text['label-transcription'],'icon'=>'quote-right','onclick'=>"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"; echo " ".escape($row['message_length_label'])."\n"; if ($_SESSION['voicemail']['storage_type']['text'] != 'base64') { echo " ".escape($row['file_size_label'])."\n"; } - if ($_SESSION['voicemail']['transcribe_enabled']['boolean'] == 'true') { - echo " ".escape($row['message_transcription'])."\n"; - } echo "\n"; + if ($_SESSION['voicemail']['transcribe_enabled']['boolean'] == 'true' && $row['message_transcription'] != '') { + echo "\n"; // dummy row to maintain same background color for transcription row + echo "\n"; + echo " \n"; + echo " ".$text['label-transcription']."...
\n"; + echo escape($row['message_transcription'])."\n"; + echo " \n"; + echo "\n"; + } $x++; } unset($row); @@ -363,4 +368,4 @@ //include the footer require_once "resources/footer.php"; -?> +?> \ No newline at end of file