From bcfdfff86b4d4e6ffae5a2d02dca7d71a35949f6 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Tue, 9 Aug 2011 15:51:03 +0200 Subject: [PATCH] Fix #11458: Missing attachments can not be deleted --- 12x | 117 +++++++++++++++++++++++++++++++++++++++++++++ core/print_api.php | 20 ++++---- 2 files changed, 129 insertions(+), 8 deletions(-) create mode 100644 12x diff --git a/12x b/12x new file mode 100644 index 0000000000..991599b8a0 --- /dev/null +++ b/12x @@ -0,0 +1,117 @@ +'; +$g_from_name = 'MantisBT release 1.2.x'; +$g_from_email = 'noreply-athenabt@merckserono.net'; # the "From: " field in emails +$g_return_path_email = ''; # the return address for bounced mail +$g_email_receive_own = OFF; +$g_email_send_using_cronjob = OFF; +$g_allow_blank_email = OFF; + +# --- Attachments / File Uploads --- +$g_allow_file_upload = ON; +$g_file_upload_method = DISK; # or DISK +$g_absolute_path_default_upload_folder = '/tmp/attach/'; # used with DISK, must contain trailing \ or /. +$g_max_file_size = 5000000; # in bytes +$g_preview_attachments_inline_max_size = 256 * 1024; +$g_allowed_files = ''; # extensions comma separated, e.g. 'php,html,java,exe,pl' +$g_disallowed_files = ''; # extensions comma separated + +# --- Branding --- +$g_window_title = 'MantisBT release 1.2.x'; +#$g_logo_image = 'images/AthenaBT.gif'; +#$g_page_title = 'THIS IS THE TEST ENVIRONMENT'; +#$g_favicon_image = 'images/AthenaBTicon.ico'; + +# --- Real names --- +$g_show_realname = ON; +$g_show_user_realname_threshold = REPORTER; # Set to access level (e.g. VIEWER, REPORTER, DEVELOPER, MANAGER, etc) +$g_show_user_email_threshold = DEVELOPER; + +# --- Logging and error checking --- +# Values below can be OR'ed +# LOG_NONE or LOG_EMAIL LOG_EMAIL_RECIPIENT LOG_FILTERING LOG_AJAX LOG_LDAP LOG_DATABASE +$g_log_level = LOG_LDAP | LOG_DATABASE; +$g_log_destination = 'file:/tmp/mantis.log'; +$g_show_detailed_errors = OFF; + +# --- Bug Workflow --- +$g_status_enum_workflow[NEW_] ='20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved'; +$g_status_enum_workflow[FEEDBACK] ='30:acknowledged,40:confirmed,50:assigned,80:resolved'; +$g_status_enum_workflow[ACKNOWLEDGED] ='20:feedback,40:confirmed,50:assigned,80:resolved'; +$g_status_enum_workflow[CONFIRMED] ='20:feedback,50:assigned,80:resolved'; +$g_status_enum_workflow[ASSIGNED] ='20:feedback,80:resolved'; +$g_status_enum_workflow[RESOLVED] ='20:feedback,50:assigned,90:closed'; +$g_status_enum_workflow[CLOSED] ='20:feedback,50:assigned'; + + +# --- Others --- +$g_show_timer = ON; +$g_default_home_page = 'my_view_page.php'; # Set to name of page to go to after login +$g_show_priority_text = ON; +$g_status_percentage_legend = ON; +$g_default_bugnote_order = 'DESC'; # Most recent notes first +$g_history_order = 'DESC'; + +$g_cookie_prefix = 'MANTIS123'; + +$g_monitor_delete_others_bug_threshold = MANAGER; +$g_delete_bug_threshold = ADMINISTRATOR; +$g_roadmap_update_threshold = MANAGER; +$g_show_version_dates_threshold = NOBODY; +$g_show_changelog_dates = ON; +$g_show_roadmap_dates = ON; +$g_allow_reporter_close = ON; + +$g_reauthentication = OFF; + +$g_display_errors = array( + E_WARNING => 'halt', + E_NOTICE => 'warn', + E_USER_ERROR => 'halt', + E_USER_WARNING => 'warn', + E_USER_NOTICE => 'warn' +); + diff --git a/core/print_api.php b/core/print_api.php index 08334a4495..4cebac4cac 100644 --- a/core/print_api.php +++ b/core/print_api.php @@ -1501,18 +1501,22 @@ function print_bug_attachment_header( $p_attachment ) { } echo lang_get( 'word_separator' ) . '(' . number_format( $p_attachment['size'] ) . lang_get( 'word_separator' ) . lang_get( 'bytes' ) . ')'; echo lang_get( 'word_separator' ) . '' . date( config_get( 'normal_date_format' ), $p_attachment['date_added'] ) . ''; - if ( $p_attachment['can_delete'] ) { - echo lang_get( 'word_separator' ) . '['; - print_link( 'bug_file_delete.php?file_id=' . $p_attachment['id'] . form_security_param( 'bug_file_delete' ), lang_get( 'delete_link' ), false, 'small' ); - echo ']'; - } - if ( config_get( 'file_upload_method' ) == FTP ) { - echo lang_get( 'word_separator' ) . '(' . lang_get( 'cached' ) . ')'; - } } else { print_file_icon( $p_attachment['display_name'] ); echo lang_get( 'word_separator' ) . '' . string_display_line( $p_attachment['display_name'] ) . '' . lang_get( 'word_separator' ) . '(' . lang_get( 'attachment_missing' ) . ')'; } + + if ( $p_attachment['can_delete'] ) { + echo lang_get( 'word_separator' ) . '['; + print_link( 'bug_file_delete.php?file_id=' . $p_attachment['id'] . form_security_param( 'bug_file_delete' ), lang_get( 'delete_link' ), false, 'small' ); + echo ']'; + } + + if ( $p_attachment['exists'] ) { + if ( config_get( 'file_upload_method' ) == FTP ) { + echo lang_get( 'word_separator' ) . '(' . lang_get( 'cached' ) . ')'; + } + } } /**