From 414829383cf0bc251de77228297cf36b5ee20635 Mon Sep 17 00:00:00 2001 From: chansizzle <14916599+chansizzle@users.noreply.github.com> Date: Wed, 26 Apr 2023 21:47:45 -0600 Subject: [PATCH] Add fax_download_view permission (#6605) * Add fax_download_view permission Add fax_download_view permission to allow hiding the "File Name (Download)" column on Fax Inbox and Fax Sent pages. Some users prefer hiding this field as they also have the "View" column that they can click on to view and download PDFs of the faxes. --- app/fax/app_config.php | 6 +++++- app/fax/fax_files.php | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/fax/app_config.php b/app/fax/app_config.php index 706ced8476..2cf23edd30 100644 --- a/app/fax/app_config.php +++ b/app/fax/app_config.php @@ -197,7 +197,11 @@ $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; $apps[$x]['permissions'][$y]['groups'][] = "user"; - + $y++; + $apps[$x]['permissions'][$y]['name'] = "fax_download_view"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $apps[$x]['permissions'][$y]['groups'][] = "user"; //default settings $y=0; $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "6840bdb0-eb9d-45bd-a79a-ccb64d08fd97"; diff --git a/app/fax/fax_files.php b/app/fax/fax_files.php index db089ea0c9..6cf63eed50 100644 --- a/app/fax/fax_files.php +++ b/app/fax/fax_files.php @@ -322,7 +322,9 @@ if ($_REQUEST['box'] == 'sent') { echo th_order_by('fax_destination', $text['label-fax_destination'], $order_by, $order, "&id=".$fax_uuid."&box=".$_GET['box']."&page=".$_GET['page']); } - echo "".$text['table-file']."\n"; + if (permission_exists('fax_download_view')) { + echo "".$text['table-file']."\n"; + } echo "".$text['table-view']."\n"; echo th_order_by('fax_date', $text['label-fax_date'], $order_by, $order, "&id=".$fax_uuid."&box=".$_GET['box']."&page=".$_GET['page']); echo "\n"; @@ -423,7 +425,9 @@ if ($_REQUEST['box'] == 'sent') { echo " ".escape(format_phone($row['fax_destination']))." \n"; } - echo " ".$file_name."\n"; + if (permission_exists('fax_download_view')) { + echo " ".$file_name."\n"; + } echo " \n"; if ($_REQUEST['box'] == 'inbox') { $dir_fax = $dir_fax_inbox;