Skip to content

Commit

Permalink
Obsolete $g_show_attachment_indicator option
Browse files Browse the repository at this point in the history
Following discussion with dhx on IRC today, 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

Commit also removes trailing whitespace in columns_api.php
  • Loading branch information
dregad committed Oct 20, 2011
1 parent a1b29d2 commit 3323204
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 23 deletions.
12 changes: 0 additions & 12 deletions config_defaults_inc.php
Expand Up @@ -1902,18 +1902,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.
Expand Down
15 changes: 5 additions & 10 deletions core/columns_api.php
Expand Up @@ -32,7 +32,7 @@
function columns_filter_disabled( $p_columns ) {
$t_columns = array();
$t_enable_profiles = ( config_get( 'enable_profiles' ) == ON );

foreach ( $p_columns as $t_column ) {
switch( $t_column ) {
case 'os':
Expand Down Expand Up @@ -94,11 +94,11 @@ function columns_get_standard() {
if( config_get( 'enable_eta' ) == OFF ) {
unset( $t_columns['eta'] );
}
if( config_get( 'enable_projection' ) == OFF ) {

if( config_get( 'enable_projection' ) == OFF ) {
unset( $t_columns['projection'] );
}

if( config_get( 'enable_product_build' ) == OFF ) {
unset( $t_columns['build'] );
}
Expand Down Expand Up @@ -1013,12 +1013,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; ';
}
Expand Down
2 changes: 1 addition & 1 deletion core/helper_api.php
Expand Up @@ -400,7 +400,7 @@ function helper_get_columns_to_view( $p_columns_target = COLUMNS_TARGET_VIEW_PAG
$t_keys_to_remove[] = 'sponsorship_total';
}

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

Expand Down
3 changes: 3 additions & 0 deletions core/obsolete.php
Expand Up @@ -138,3 +138,6 @@
config_obsolete( 'default_graph_type', '' );
config_obsolete( 'graph_font', '' );
config_obsolete( 'graph_colors', '' );

# changes in 1.2.8
config_obsolete( 'show_attachment_indicator' );

0 comments on commit 3323204

Please sign in to comment.