From 2d9bec929541027f93033387ec98f6936bad5fb2 Mon Sep 17 00:00:00 2001 From: fusionate Date: Thu, 19 Oct 2023 00:40:50 +0000 Subject: [PATCH] Call Recordings: Added ability to do bulk download. --- app/call_recordings/call_recordings.php | 12 +- .../resources/classes/call_recordings.php | 178 +++++++++++++----- themes/default/template.php | 27 +-- 3 files changed, 145 insertions(+), 72 deletions(-) diff --git a/app/call_recordings/call_recordings.php b/app/call_recordings/call_recordings.php index f868959407..d49fba7f2a 100644 --- a/app/call_recordings/call_recordings.php +++ b/app/call_recordings/call_recordings.php @@ -56,6 +56,12 @@ //process the http post data by action if (!empty($action) && is_array($call_recordings) && @sizeof($call_recordings) != 0) { switch ($action) { + case 'download': + if (permission_exists('call_recording_download')) { + $obj = new call_recordings; + $obj->download($call_recordings); + } + break; case 'delete': if (permission_exists('call_recording_delete')) { $obj = new call_recordings; @@ -171,11 +177,11 @@ echo "
\n"; echo "
".$text['title-call_recordings']."
\n"; echo "
\n"; - if (permission_exists('call_recording_download_add') && $call_recordings) { - echo button::create(['type'=>'button','label'=>$text['button-download'],'icon'=>$_SESSION['theme']['button_icon_download'],'collapse'=>'hide-xs','onclick'=>"list_action_set('download'); list_form_submit('form_list');"]); + if (permission_exists('call_recording_download') && $call_recordings) { + echo button::create(['type'=>'button','label'=>$text['button-download'],'icon'=>$_SESSION['theme']['button_icon_download'],'id'=>'btn_download','name'=>'btn_download','style'=>'display: none;','collapse'=>'hide-xs','onclick'=>"list_action_set('download'); list_form_submit('form_list');"]); } if (permission_exists('call_recording_delete') && $call_recordings) { - echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none; margin-left: 15px;','collapse'=>'hide-xs','onclick'=>"modal_open('modal-delete','btn_delete');"]); + echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none; margin-right: 15px;','collapse'=>'hide-xs','onclick'=>"modal_open('modal-delete','btn_delete');"]); } echo "