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: dc0c718
Choose a base ref
...
head repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7c34919
Choose a head ref
  • 5 commits
  • 6 files changed
  • 1 contributor

Commits on Aug 31, 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 commit also removes some trailing whitespace
    dregad committed Aug 31, 2011
    Copy the full SHA
    d86ba72 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
    dregad committed Aug 31, 2011
    Copy the full SHA
    ad006ff View commit details
  3. Removed obsolete comment

    file_can_view_bug_attachments does check for allow_view_own_attachments
    dregad committed Aug 31, 2011
    Copy the full SHA
    a1b29d2 View commit details

Commits on Oct 20, 2011

  1. Obsolete $g_show_attachment_indicator option

    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
    dregad committed Oct 20, 2011

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3323204 View commit details
  2. Merge branch 'remove-show_attachment_indicator'

    Conflicts:
    	config_defaults_inc.php
    dregad committed Oct 20, 2011

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7c34919 View commit details
Showing with 23 additions and 37 deletions.
  1. +8 −18 config_defaults_inc.php
  2. +5 −12 core/columns_api.php
  3. +2 −2 core/filter_api.php
  4. +4 −4 core/helper_api.php
  5. +3 −0 core/obsolete.php
  6. +1 −1 view_filters_page.php
26 changes: 8 additions & 18 deletions config_defaults_inc.php
Original file line number Diff line number Diff line change
@@ -823,22 +823,24 @@
* To include custom field 'xyz', 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', 'last_updated', 'summary' );
$g_view_issues_page_columns = array ( 'selection', 'edit', 'priority', 'id', 'sponsorship_total', 'bugnotes_count', 'attachment_count', 'category_id', 'severity', 'status', 'last_updated', 'summary' );

/**
* The default columns to be included in the Print Issues Page.
* This can be overriden using Manage -> Manage Configuration -> Manage Columns
* Also each user can configure their own columns using My Account -> Manage Columns
* @global array $g_print_issues_page_columns
*/
$g_print_issues_page_columns = array ( 'selection', 'priority', 'id', 'sponsorship_total', 'bugnotes_count', 'attachment', 'category_id', 'severity', 'status', 'last_updated', 'summary' );
$g_print_issues_page_columns = array ( 'selection', 'priority', 'id', 'sponsorship_total', 'bugnotes_count', 'attachment_count', 'category_id', 'severity', 'status', 'last_updated', 'summary' );

/**
* The default columns to be included in the CSV export.
@@ -1917,18 +1919,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.
17 changes: 5 additions & 12 deletions core/columns_api.php
Original file line number Diff line number Diff line change
@@ -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':
@@ -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'] );
}
@@ -1016,8 +1016,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 );
@@ -1028,12 +1026,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
@@ -597,7 +597,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] );
}
}
@@ -4065,7 +4065,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 {
8 changes: 4 additions & 4 deletions core/helper_api.php
Original file line number Diff line number Diff line change
@@ -149,7 +149,7 @@ function check_selected( $p_var, $p_val = true ) {
* @param mixed $p_var
* @param mixed $p_val
* @return null
*/
*/
function check_checked( $p_var, $p_val = true ) {
if( $p_var == $p_val ) {
echo ' checked="checked" ';
@@ -360,7 +360,7 @@ function helper_project_specific_where( $p_project_id, $p_user_id = null ) {
}

/**
*
*
* @param int $p_columns_target
* @param bool $p_viewable_only
* @param int $p_user_id
@@ -400,8 +400,8 @@ 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' ) ) {
$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_keys_to_remove[] = 'duplicate_id';
3 changes: 3 additions & 0 deletions core/obsolete.php
Original file line number Diff line number Diff line change
@@ -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' );
2 changes: 1 addition & 1 deletion view_filters_page.php
Original file line number Diff line number Diff line change
@@ -113,7 +113,7 @@ function SwitchDateFields() {
$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] );
}
}