Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: mantisbt/mantisbt
base: 25f2af8
...
head fork: mantisbt/mantisbt
compare: ce56bd5
  • 4 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
Commits on Oct 21, 2011
@dregad dregad 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
d5a0ea7
@dregad dregad 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
a143371
@dregad dregad Removed obsolete comment
file_can_view_bug_attachments does check for allow_view_own_attachments
791b936
@dregad dregad 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
ce56bd5
View
27 config_defaults_inc.php
@@ -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'
);
/**
@@ -2062,16 +2063,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.
* @global int $g_view_attachments_threshold
View
9 core/columns_api.php
@@ -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; ';
}
View
4 core/filter_api.php
@@ -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 {
View
4 core/helper_api.php
@@ -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();
View
5 core/obsolete.php
@@ -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' );
View
2  view_filters_page.php
@@ -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] );
}
}

No commit comments for this range

Something went wrong with that request. Please try again.