diff --git a/app/voicemails/app_config.php b/app/voicemails/app_config.php index 40434891e0..933ffef18c 100644 --- a/app/voicemails/app_config.php +++ b/app/voicemails/app_config.php @@ -101,6 +101,9 @@ $apps[$x]['permissions'][$y]['groups'][] = "user"; $apps[$x]['permissions'][$y]['groups'][] = "agent"; $y++; + $apps[$x]['permissions'][$y]['name'] = "voicemail_message_transcribe"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $y++; $apps[$x]['permissions'][$y]['name'] = "voicemail_option_add"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; diff --git a/app/voicemails/voicemail_messages.php b/app/voicemails/voicemail_messages.php index f292da5ae6..375887d550 100644 --- a/app/voicemails/voicemail_messages.php +++ b/app/voicemails/voicemail_messages.php @@ -140,7 +140,7 @@ // no return, exit exit; case 'transcribe': - if ($transcribe_enabled == 'true' && !empty($transcribe_engine) && is_array($voicemail_messages) && @sizeof($voicemail_messages) != 0) { + if (permission_exists('voicemail_message_transcribe') && $transcribe_enabled == 'true' && !empty($transcribe_engine) && is_array($voicemail_messages) && @sizeof($voicemail_messages) != 0) { $messages_transcribed = 0; foreach ($voicemail_messages as $voicemail_message) { if (!empty($voicemail_message['checked']) && $voicemail_message['checked'] == 'true' && is_uuid($voicemail_message['uuid']) && is_uuid($voicemail_message['voicemail_uuid'])) { @@ -281,16 +281,6 @@ unset($num_rows); //get the voicemail - //running $vm->messages() is used to get the count and then that information is used for paging and then we need to run $vm->messages() again to get the results with the paging - //when the messages method is run twice on the same object the second time fails so creating a new object resolves this issue. - $vm = new voicemail; - $vm->domain_uuid = $_SESSION['domain_uuid']; - if (!empty($voicemail_uuid) && is_uuid($voicemail_uuid)) { - $vm->voicemail_uuid = $voicemail_uuid; - } - else if (!empty($voicemail_id) && is_numeric($voicemail_id)) { - $vm->voicemail_id = $voicemail_id; - } $vm->order_by = $order_by; $vm->order = $order; $vm->offset = $offset; @@ -329,7 +319,7 @@ echo "