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

Commits on Dec 15, 2011

  1. Correct display custom status in cross-project relationships

    In the bug relationships section in view.php, the target bug's status
    was incorrectly displayed as "@x@" (where X is the status_enum id) if
    the following conditions were true:
     - the target bug is in a different project
     - it is a custom status
    
    This commit fixes the behavior, and displays the corresponding enum
    element's language string.
    
    2 new parameters have been added to function get_enum_element(): user
    and project id (defaulted to null to preserve existing behavior). These
    parameters are passed on to config_get() call, allowing to specify the
    context for retrieving the enum element.
    
    The call to get_enum_element() in function relationship_get_details()
    has been altered to specify the target bug's project id.
    
    Fixes #11323
    dregad committed Dec 15, 2011
    Copy the full SHA
    f33c0f8 View commit details
  2. Additional fixes for display of custom status

    Resolves additional display issues of custom status cross-project, similar
    to what was fixed in 324dbb4681255b7a1fa4cc309ab8742f028dbf43. These
    can occur when "All Projects" is selected and one or more projects have
    custom statuses not defined globally, in the following pages:
    
     - View Issues
     - Change Log
     - Roadmap
     - Sponsorship
    
    Affects #11323
    dregad committed Dec 15, 2011
    Copy the full SHA
    02fed50 View commit details
  3. Code cleanup and optimization

     - fix whitespace errors
     - align to coding guidelines
     - moved variable initialization out of for loop
    dregad committed Dec 15, 2011
    Copy the full SHA
    52dbd32 View commit details
  4. Fix cross-project display of custom status colors

    When a custom status is defined in a different project, its custom
    color was not used (displayed white) in the following cases
    
    - view issue details page, relationship
    - View Issues
    - My View
    - Sponsorship
    - Bug group action list
    
    Fixes #13682
    dregad committed Dec 15, 2011
    Copy the full SHA
    7dfab37 View commit details

Commits on Jan 1, 2012

  1. Fix cross-project display of custom resolution codes

    When a custom resolution is defined in a different project, its code
    was displayed as @x@ instead of the corresponding string in the
    resolution column, as well as when hovering over the status in the view
    issues page.
    
    Fixes #13707
    dregad committed Jan 1, 2012
    Copy the full SHA
    b764401 View commit details

Commits on Jan 13, 2012

  1. Fix cross-project display of custom severity and priority

    When a custom severity is defined in a different project, its code
    was displayed as @x@ instead of the corresponding string in the
    severity column on the View Issues page.
    
    The same problem applied to custom priorities
    
    Fixes #13718
    dregad committed Jan 13, 2012
    Copy the full SHA
    8538a5d View commit details
  2. More fixes of custom enum types across projects

    Fixes #13728
    dregad committed Jan 13, 2012
    Copy the full SHA
    735506c View commit details
  3. Fix custom enum types across projects in exports

    The CSV and Excel exports, as well as printing a report to Word now
    properly handle custom enums when dealing with bugs from different
    projects.
    
    Fixes #13728
    dregad committed Jan 13, 2012
    Copy the full SHA
    a39a948 View commit details

Commits on Jan 30, 2012

  1. Fix use of undefined $t_bug variable instead of $p_bug

    Copy/paste error introduced in 735506c
    
    Affects #11323
    dregad committed Jan 30, 2012
    Copy the full SHA
    8d115d9 View commit details

Commits on Feb 28, 2012

  1. Merge branch 'fix-11323-cross-proj-rel'

    Conflicts:
    	excel_xml_export.php
    dregad committed Feb 28, 2012
    4
    Copy the full SHA
    9a069ce View commit details
  2. Extra column in csv export when sponsorship_total >= 1000

    Bug introduced by commit a786f9b.
    
    Due to the use of number_format() function with default parameters, PHP
    outputs the sponsorship amount formatted with ',' as a thousands
    separator, which also happens to be MantisBT's default csv separator.
    Since the fields are not escaped, this causes an extra column to be
    generated.
    
    Call to number_format() was removed, as it makes more sense to output
    raw data in csv exports.
    
    Fixes #13958
    dregad committed Feb 28, 2012
    Copy the full SHA
    0791a49 View commit details
  3. Add function to handle Excel formatting of sponsorship

    When exporting issues in Excel format a fatal error is thrown if the
    export includes sponsorship totals. This is due to a missing
    excel_format_sponsorship_total() function.
    
    Fixes #13959
    dregad committed Feb 28, 2012
    Copy the full SHA
    087b1fc View commit details
  4. Fix bug in access_has_bug_level() for private issues

    When private_bug_threshold is defined as an array instead of a single
    access level, e.g. array(0=>40, 1=>70, 2=>90) to prevent developers
    from seeing private bugs while granting that privilege to updaters,
    access_has_bug_level() incorrectly returned true.
    
    The consequence is that unwanted access to Private bugs was granted to
    users who are allowed to view them, e.g. allowing them to delete or
    perform other restricted actions.
    
    Fixes #10124
    dregad committed Feb 28, 2012
    Copy the full SHA
    ae8be02 View commit details
14 changes: 7 additions & 7 deletions account_sponsor_page.php
Original file line number Diff line number Diff line change
@@ -127,16 +127,16 @@
$t_sponsor = sponsorship_get( $row['sponsor'] );

# describe bug
$t_status = string_attribute( get_enum_element( 'status', $t_bug->status ) );
$t_resolution = string_attribute( get_enum_element( 'resolution', $t_bug->resolution ) );
$t_status = string_attribute( get_enum_element( 'status', $t_bug->status, auth_get_current_user_id(), $t_bug->project_id ) );
$t_resolution = string_attribute( get_enum_element( 'resolution', $t_bug->resolution, auth_get_current_user_id(), $t_bug->project_id ) );
$t_version_id = version_get_id( $t_bug->fixed_in_version, $t_project );
if ( ( false !== $t_version_id ) && ( VERSION_RELEASED == version_get_field( $t_version_id, 'released' ) ) ) {
$t_released_label = '<a title="' . lang_get( 'released' ) . '">' . $t_bug->fixed_in_version . '</a>';
} else {
$t_released_label = $t_bug->fixed_in_version;
}

echo '<tr bgcolor="' . get_status_color( $t_bug->status ) . '">';
echo '<tr bgcolor="' . get_status_color( $t_bug->status, auth_get_current_user_id(), $t_bug->project_id ) . '">';
echo '<td><a href="' . string_get_bug_view_url( $row['bug'] ) . '">' . bug_format_id( $row['bug'] ) . '</a></td>';
echo '<td>' . project_get_field( $t_bug->project_id, 'name' ) . '&#160;</td>';
echo '<td class="right">' . $t_released_label . '&#160;</td>';
@@ -191,7 +191,7 @@

$query = "SELECT b.id as bug, s.id as sponsor, s.paid, b.project_id, b.fixed_in_version, b.status
FROM $t_bug_table b, $t_sponsor_table s
WHERE b.handler_id=" . db_param() . " AND s.bug_id = b.id " .
WHERE b.handler_id=" . db_param() . " AND s.bug_id = b.id " .
( $t_show_all ? '' : 'AND ( b.status < ' . db_param() . ' OR s.paid < ' . SPONSORSHIP_PAID . ')' ) . "
AND $t_project_clause
ORDER BY s.paid ASC, b.project_id ASC, b.fixed_in_version ASC, b.status ASC, b.id DESC";
@@ -237,16 +237,16 @@
$t_buglist[] = $row['bug'] . ':' . $row['sponsor'];

# describe bug
$t_status = string_attribute( get_enum_element( 'status', $t_bug->status ) );
$t_resolution = string_attribute( get_enum_element( 'resolution', $t_bug->resolution ) );
$t_status = string_attribute( get_enum_element( 'status', $t_bug->status, auth_get_current_user_id(), $t_bug->project_id ) );
$t_resolution = string_attribute( get_enum_element( 'resolution', $t_bug->resolution, auth_get_current_user_id(), $t_bug->project_id ) );
$t_version_id = version_get_id( $t_bug->fixed_in_version, $t_project );
if ( ( false !== $t_version_id ) && ( VERSION_RELEASED == version_get_field( $t_version_id, 'released' ) ) ) {
$t_released_label = '<a title="' . lang_get( 'released' ) . '">' . $t_bug->fixed_in_version . '</a>';
} else {
$t_released_label = $t_bug->fixed_in_version;
}

echo '<tr bgcolor="' . get_status_color( $t_bug->status ) . '">';
echo '<tr bgcolor="' . get_status_color( $t_bug->status, auth_get_current_user_id(), $t_bug->project_id ) . '">';
echo '<td><a href="' . string_get_bug_view_url( $row['bug'] ) . '">' . bug_format_id( $row['bug'] ) . '</a></td>';
echo '<td>' . project_get_field( $t_bug->project_id, 'name' ) . '&#160;</td>';
echo '<td class="right">' . $t_released_label . '&#160;</td>';
8 changes: 5 additions & 3 deletions core/access_api.php
Original file line number Diff line number Diff line change
@@ -425,10 +425,12 @@ function access_has_bug_level( $p_access_level, $p_bug_id, $p_user_id = null ) {
return false;
}

# If the bug is private and the user is not the reporter, then the
# the user must also have higher access than private_bug_threshold
# If the bug is private and the user is not the reporter, then
# they must also have higher access than private_bug_threshold
if( VS_PRIVATE == bug_get_field( $p_bug_id, 'view_state' ) && !bug_is_user_reporter( $p_bug_id, $p_user_id ) ) {
$p_access_level = max( $p_access_level, config_get( 'private_bug_threshold' ) );
$t_access_level = access_get_project_level( $t_project_id, $p_user_id );
return access_compare_level( $t_access_level, config_get( 'private_bug_threshold' ) )
&& access_compare_level( $t_access_level, $p_access_level );
}

return access_has_project_level( $p_access_level, $t_project_id, $p_user_id );
5 changes: 4 additions & 1 deletion core/bug_group_action_api.php
Original file line number Diff line number Diff line change
@@ -80,7 +80,10 @@ function bug_group_action_print_bug_list( $p_bug_ids_array ) {

foreach( $p_bug_ids_array as $t_bug_id ) {
$t_class = sprintf( "row-%d", ( $t_i++ % 2 ) + 1 );
echo sprintf( "<tr bgcolor=\"%s\"> <td>%s</td> <td>%s</td> </tr>\n", get_status_color( bug_get_field( $t_bug_id, 'status' ) ), string_get_bug_view_link( $t_bug_id ), string_attribute( bug_get_field( $t_bug_id, 'summary' ) ) );
echo sprintf( "<tr bgcolor=\"%s\"> <td>%s</td> <td>%s</td> </tr>\n",
get_status_color( bug_get_field( $t_bug_id, 'status' ), auth_get_current_user_id(), bug_get_field( $t_bug_id, 'project_id' ) ),
string_get_bug_view_link( $t_bug_id ),
string_attribute( bug_get_field( $t_bug_id, 'summary' ) ) );
}

echo '</table>';
19 changes: 12 additions & 7 deletions core/columns_api.php
Original file line number Diff line number Diff line change
@@ -940,7 +940,7 @@ function print_column_edit( $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE
function print_column_priority( $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<td>';
if( ON == config_get( 'show_priority_text' ) ) {
print_formatted_priority_string( $p_bug->status, $p_bug->priority );
print_formatted_priority_string( $p_bug );
} else {
print_status_icon( $p_bug->priority );
}
@@ -1079,7 +1079,7 @@ function print_column_category_id( $p_bug, $p_columns_target = COLUMNS_TARGET_VI
*/
function print_column_severity( $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<td class="center">';
print_formatted_severity_string( $p_bug->status, $p_bug->severity );
print_formatted_severity_string( $p_bug );
echo '</td>';
}

@@ -1091,7 +1091,7 @@ function print_column_severity( $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_
* @access public
*/
function print_column_eta( $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<td class="center">', get_enum_element( 'eta', $p_bug->eta ), '</td>';
echo '<td class="center">', get_enum_element( 'eta', $p_bug->eta, auth_get_current_user_id(), $p_bug->project_id ), '</td>';
}

/**
@@ -1102,7 +1102,7 @@ function print_column_eta( $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE
* @access public
*/
function print_column_projection( $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<td class="center">', get_enum_element( 'projection', $p_bug->projection ), '</td>';
echo '<td class="center">', get_enum_element( 'projection', $p_bug->projection, auth_get_current_user_id(), $p_bug->project_id ), '</td>';
}

/**
@@ -1113,7 +1113,7 @@ function print_column_projection( $p_bug, $p_columns_target = COLUMNS_TARGET_VIE
* @access public
*/
function print_column_reproducibility( $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<td class="center">', get_enum_element( 'reproducibility', $p_bug->reproducibility ), '</td>';
echo '<td class="center">', get_enum_element( 'reproducibility', $p_bug->reproducibility, auth_get_current_user_id(), $p_bug->project_id ), '</td>';
}

/**
@@ -1124,7 +1124,9 @@ function print_column_reproducibility( $p_bug, $p_columns_target = COLUMNS_TARGE
* @access public
*/
function print_column_resolution( $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<td class="center">', get_enum_element( 'resolution', $p_bug->resolution ), '</td>';
echo '<td class="center">',
get_enum_element( 'resolution', $p_bug->resolution, auth_get_current_user_id(), $p_bug->project_id ),
'</td>';
}

/**
@@ -1136,7 +1138,10 @@ function print_column_resolution( $p_bug, $p_columns_target = COLUMNS_TARGET_VIE
*/
function print_column_status( $p_bug, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<td class="center">';
printf( '<span class="issue-status" title="%s">%s</span>', get_enum_element( 'resolution', $p_bug->resolution ), get_enum_element( 'status', $p_bug->status ) );
printf( '<span class="issue-status" title="%s">%s</span>',
get_enum_element( 'resolution', $p_bug->resolution, auth_get_current_user_id(), $p_bug->project_id ),
get_enum_element( 'status', $p_bug->status, auth_get_current_user_id(), $p_bug->project_id )
);

# print username instead of status
if(( ON == config_get( 'show_assigned_names' ) ) && ( $p_bug->handler_id > 0 ) && ( access_has_project_level( config_get( 'view_handler_threshold' ), $p_bug->project_id ) ) ) {
Loading