Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 25f2af8
Choose a base ref
...
head repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ce56bd5
Choose a head ref
  • 4 commits
  • 6 files changed
  • 1 contributor

Commits on Oct 21, 2011

  1. Correct naming of attachments column

    Commit 97b67e4 introduced some changes to the
    BugData class: the 'attachment' column was renamed to 'attachment_count'. This
    change was not cascaded everywhere, which resulted in the column not being
    displayed by default (as the now-invalid column named 'attachment' was
    automatically removed)
    
    This then hid the fact that $g_show_attachment_indicator was actually not
    working as advertised, i.e. the attachments column is always displayed; when
    ON the field contains the paperclip bitmap, and when OFF the actual number of
    attachments for the corresponding issue.
    
    Affects issue #13276
    
    This is porting d86ba72 to master
    dregad committed Oct 21, 2011
    Copy the full SHA
    d5a0ea7 View commit details
  2. Update list of standard columns in config_defaults_inc.php

    The list now matches what is actually available in the manage columns pages
    
    Porting ad006ff to master
    dregad committed Oct 21, 2011
    Copy the full SHA
    a143371 View commit details
  3. Removed obsolete comment

    file_can_view_bug_attachments does check for allow_view_own_attachments
    dregad committed Oct 21, 2011
    Copy the full SHA
    791b936 View commit details
  4. Obsolete $g_show_attachment_indicator option

    Following discussion with dhx on IRC on 31-Aug-2011, this setting is
    not necessary.
    
    There is no point or advantage in displaying a paperclip bitmap as opposed to
    the actual number of attachments; furthermore, the option was inconsistently
    used, in one instance it was actually hiding the attachments column completely
    
    Affects issue #13276
    
    Porting 3323204 to master
    dregad committed Oct 21, 2011
    Copy the full SHA
    ce56bd5 View commit details
Showing with 19 additions and 32 deletions.
  1. +9 −18 config_defaults_inc.php
  2. +1 −8 core/columns_api.php
  3. +2 −2 core/filter_api.php
  4. +2 −2 core/helper_api.php
  5. +4 −1 core/obsolete.php
  6. +1 −1 view_filters_page.php
27 changes: 9 additions & 18 deletions config_defaults_inc.php
Original file line number Diff line number Diff line change
@@ -871,18 +871,18 @@
* include the column name as 'custom_xyz'.
*
* Standard Column Names (i.e. names to choose from):
* selection, edit, id, project_id, reporter_id, handler_id, priority,
* reproducibility, projection, eta, resolution, fixed_in_version, view_state,
* os, os_build, build (for product build), platform, version, date_submitted,
* attachment, category, sponsorship_total, severity, status, last_updated,
* summary, bugnotes_count, description, steps_to_reproduce,
* additional_information
* id, project_id, reporter_id, handler_id, duplicate_id, priority, severity,
* reproducibility, status, resolution, category_id, date_submitted, last_updated,
* os, os_build, platform, version, fixed_in_version, target_version, view_state,
* summary, sponsorship_total, due_date, description, steps_to_reproduce,
* additional_information, attachment_count, bugnotes_count, selection, edit,
* overdue
*
* @global array $g_view_issues_page_columns
*/
$g_view_issues_page_columns = array (
'selection', 'edit', 'priority', 'id', 'sponsorship_total',
'bugnotes_count', 'attachment', 'category_id', 'severity', 'status',
'bugnotes_count', 'attachment_count', 'category_id', 'severity', 'status',
'last_updated', 'summary'
);

@@ -894,7 +894,8 @@
*/
$g_print_issues_page_columns = array (
'selection', 'priority', 'id', 'sponsorship_total', 'bugnotes_count',
'attachment', 'category_id', 'severity', 'status', 'last_updated', 'summary'
'attachment_count', 'category_id', 'severity', 'status', 'last_updated',
'summary'
);

/**
@@ -2061,16 +2062,6 @@
*/
$g_preview_max_height = 250;

/**
* Show an attachment indicator on bug list. Show a clickable attachment
* indicator on the bug list page if the bug has one or more files attached.
* Note: This option is disabled by default since it adds 1 database query per
* bug listed and thus might slow down the page display.
*
* @global int $g_show_attachment_indicator
*/
$g_show_attachment_indicator = OFF;

/**
* access level needed to view bugs attachments. View means to see the file
* names, sizes, and timestamps of the attachments.
9 changes: 1 addition & 8 deletions core/columns_api.php
Original file line number Diff line number Diff line change
@@ -1064,8 +1064,6 @@ function print_column_attachment_count( $p_bug, $p_columns_target = COLUMNS_TARG
global $t_icon_path;

# Check for attachments
# TODO: factor in the allow_view_own_attachments configuration option
# instead of just using a global check.
$t_attachment_count = 0;
if( file_can_view_bug_attachments( $p_bug->id, null ) ) {
$t_attachment_count = file_bug_attachment_count( $p_bug->id );
@@ -1076,12 +1074,7 @@ function print_column_attachment_count( $p_bug, $p_columns_target = COLUMNS_TARG
if ( $t_attachment_count > 0 ) {
$t_href = string_get_bug_view_url( $p_bug->id ) . '#attachments';
$t_href_title = sprintf( lang_get( 'view_attachments_for_issue' ), $t_attachment_count, $p_bug->id );
if ( config_get( 'show_attachment_indicator' ) ) {
$t_alt_text = $t_attachment_count . lang_get( 'word_separator' ) . lang_get( 'attachments' );
echo "<a href=\"$t_href\" title=\"$t_href_title\"><img src=\"${t_icon_path}attachment.png\" alt=\"$t_alt_text\" title=\"$t_alt_text\" /></a>";
} else {
echo "<a href=\"$t_href\" title=\"$t_href_title\">$t_attachment_count</a>";
}
echo "<a href=\"$t_href\" title=\"$t_href_title\">$t_attachment_count</a>";
} else {
echo ' &#160; ';
}
4 changes: 2 additions & 2 deletions core/filter_api.php
Original file line number Diff line number Diff line change
@@ -620,7 +620,7 @@ function filter_ensure_valid_filter( $p_filter_arr ) {
$t_fields = helper_get_columns_to_view();
$t_n_fields = count( $t_fields );
for( $i = 0;$i < $t_n_fields;$i++ ) {
if( isset( $t_fields[$i] ) && in_array( $t_fields[$i], array( 'selection', 'edit', 'bugnotes_count', 'attachment' ) ) ) {
if( isset( $t_fields[$i] ) && in_array( $t_fields[$i], array( 'selection', 'edit', 'bugnotes_count', 'attachment_count' ) ) ) {
unset( $t_fields[$i] );
}
}
@@ -4043,7 +4043,7 @@ function print_filter_show_sort() {
$t_n_fields = count( $t_fields );
$t_shown_fields[''] = '';
for( $i = 0;$i < $t_n_fields;$i++ ) {
if( !in_array( $t_fields[$i], array( 'selection', 'edit', 'bugnotes_count', 'attachment' ) ) ) {
if( !in_array( $t_fields[$i], array( 'selection', 'edit', 'bugnotes_count', 'attachment_count' ) ) ) {
if( strpos( $t_fields[$i], 'custom_' ) === 0 ) {
$t_field_name = string_display( lang_get_defaulted( utf8_substr( $t_fields[$i], utf8_strlen( 'custom_' ) ) ) );
} else {
4 changes: 2 additions & 2 deletions core/helper_api.php
Original file line number Diff line number Diff line change
@@ -494,8 +494,8 @@ function helper_get_columns_to_view( $p_columns_target = COLUMNS_TARGET_VIEW_PAG
$t_keys_to_remove[] = 'overdue';
}

if( $p_columns_target == COLUMNS_TARGET_CSV_PAGE || $p_columns_target == COLUMNS_TARGET_EXCEL_PAGE || OFF == config_get( 'show_attachment_indicator' ) ) {
$t_keys_to_remove[] = 'attachment';
if( $p_columns_target == COLUMNS_TARGET_CSV_PAGE || $p_columns_target == COLUMNS_TARGET_EXCEL_PAGE ) ) {
$t_keys_to_remove[] = 'attachment_count';
}

$t_current_project_id = helper_get_current_project();
5 changes: 4 additions & 1 deletion core/obsolete.php
Original file line number Diff line number Diff line change
@@ -139,7 +139,10 @@
config_obsolete( 'graph_font', '' );
config_obsolete( 'graph_colors', '' );

#changes in 1.3.0dev
# changes in 1.2.8
config_obsolete( 'show_attachment_indicator' );

# changes in 1.3.0dev
config_obsolete( 'bugnote_allow_user_edit_delete', '' );
config_obsolete( 'password_confirm_hash_magic_string', 'crypto_master_salt' );
config_obsolete( 'rss_key_seed', 'crypto_master_salt' );
2 changes: 1 addition & 1 deletion view_filters_page.php
Original file line number Diff line number Diff line change
@@ -93,7 +93,7 @@
$t_fields = helper_get_columns_to_view();
$t_n_fields = count( $t_fields );
for ( $i=0; $i < $t_n_fields; $i++ ) {
if ( in_array( $t_fields[$i], array( 'selection', 'edit', 'bugnotes_count', 'attachment' ) ) ) {
if ( in_array( $t_fields[$i], array( 'selection', 'edit', 'bugnotes_count', 'attachment_count' ) ) ) {
unset( $t_fields[$i] );
}
}