From 242ceb7ccb9308163bf60665766023f9eb5adb48 Mon Sep 17 00:00:00 2001 From: fusionate Date: Wed, 1 Mar 2023 22:35:44 +0000 Subject: [PATCH] Voicemails - List: Additional permission check. --- app/voicemails/voicemails.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/voicemails/voicemails.php b/app/voicemails/voicemails.php index 877a33d794..40535828e9 100644 --- a/app/voicemails/voicemails.php +++ b/app/voicemails/voicemails.php @@ -294,15 +294,17 @@ if (is_array($_SESSION['voicemail']['transcribe_enabled']) && $_SESSION['voicemail']['transcribe_enabled']['boolean'] == 'true') { echo " ".ucwords(escape($row['voicemail_transcription_enabled']))." \n"; } - echo " \n"; - if (permission_exists('voicemail_greeting_view')) { - echo " ".$text['label-greetings']."\n"; + if (permission_exists('voicemail_message_view') || permission_exists('voicemail_greeting_view')) { + echo " \n"; + if (permission_exists('voicemail_greeting_view')) { + echo " ".$text['label-greetings']."\n"; + } + if (permission_exists('voicemail_message_view')) { + $tmp_voicemail_string = (array_key_exists($row['voicemail_uuid'], $voicemails_count)) ? " (" . $voicemails_count[$row['voicemail_uuid']] . ")" : " (0)"; + echo " ".$text['label-messages'].$tmp_voicemail_string."\n"; + } + echo " \n"; } - if (permission_exists('voicemail_message_view')) { - $tmp_voicemail_string = (array_key_exists($row['voicemail_uuid'], $voicemails_count)) ? " (" . $voicemails_count[$row['voicemail_uuid']] . ")" : " (0)"; - echo " ".$text['label-messages'].$tmp_voicemail_string."\n"; - } - echo " \n"; if (permission_exists('voicemail_edit')) { echo " \n"; echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.$row['voicemail_enabled']],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]);