From 1dea5adc42a93a2f57be81f92db8317ff1698cb6 Mon Sep 17 00:00:00 2001 From: Roland Becker Date: Sun, 19 Apr 2020 19:36:02 +0200 Subject: [PATCH] Add attachment settings to "Workflow Thresholds" page Fixes #26892 --- manage_config_work_threshold_page.php | 10 ++++++++++ manage_config_work_threshold_set.php | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/manage_config_work_threshold_page.php b/manage_config_work_threshold_page.php index fc3c0dc1f0..9584eec02f 100644 --- a/manage_config_work_threshold_page.php +++ b/manage_config_work_threshold_page.php @@ -427,6 +427,16 @@ function get_section_end() { get_capability_row( lang_get( 'edit_own_tags' ), 'tag_edit_own_threshold' ); get_section_end(); +# Attachments +if( config_get( 'allow_file_upload' ) == ON ) { + get_section_begin_mcwt( lang_get( 'attachments' ) ); + get_capability_row( lang_get( 'view_list_of_attachments' ), 'view_attachments_threshold' ); + get_capability_row( lang_get( 'download_attachments' ), 'download_attachments_threshold' ); + get_capability_row( lang_get( 'delete_attachments' ), 'delete_attachments_threshold' ); + get_capability_row( lang_get( 'upload_issue_attachments' ), 'upload_bug_file_threshold' ); + get_section_end(); +} + # Others get_section_begin_mcwt( lang_get( 'others' ) ); get_capability_row( lang_get( 'view' ) . ' ' . lang_get( 'changelog_link' ), 'view_changelog_threshold' ); diff --git a/manage_config_work_threshold_set.php b/manage_config_work_threshold_set.php index 51b008dde3..0e8672515f 100644 --- a/manage_config_work_threshold_set.php +++ b/manage_config_work_threshold_set.php @@ -221,6 +221,14 @@ function capability_exists( $p_name ) { set_capability_row( 'tag_edit_threshold' ); set_capability_row( 'tag_edit_own_threshold' ); +# Attachments +if( config_get( 'allow_file_upload' ) == ON ) { + set_capability_row( 'view_attachments_threshold' ); + set_capability_row( 'download_attachments_threshold' ); + set_capability_row( 'delete_attachments_threshold' ); + set_capability_row( 'upload_bug_file_threshold' ); +} + # Others set_capability_row( 'view_changelog_threshold' ); set_capability_row( 'roadmap_view_threshold' );