From: Glenn H. <thr...@us...> - 2005-06-09 20:04:52
|
Update of /cvsroot/mantisbt/mantisbt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19680 Modified Files: bug_view_advanced_page.php bug_view_page.php Log Message: fix for 0005432: Viewing a bug should change the "current project" - thanks to polzin - prevent problems with access and other calculations that rely on current project setting Index: bug_view_advanced_page.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/bug_view_advanced_page.php,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- bug_view_advanced_page.php 12 Feb 2005 20:01:05 -0000 1.69 +++ bug_view_advanced_page.php 9 Jun 2005 20:04:42 -0000 1.70 @@ -30,6 +30,14 @@ access_ensure_bug_level( VIEWER, $f_bug_id ); $t_bug = bug_prepare_display( bug_get( $f_bug_id, true ) ); + + if( $t_bug->project_id != helper_get_current_project() ) { + # in case the current project is not the same project of the bug we are viewing... + # ... set on fly the current project. This to avoid problems with categories and handlers lists etc. + $t_redirect_url = "set_project.php?project_id=" . $t_bug->project_id . + "&make_default=no&ref=" . urlencode( "bug_view_advanced_page.php?bug_id=" . $f_bug_id ); + print_header_redirect( $t_redirect_url ); + } compress_enable(); Index: bug_view_page.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/bug_view_page.php,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- bug_view_page.php 12 Feb 2005 20:01:05 -0000 1.72 +++ bug_view_page.php 9 Jun 2005 20:04:43 -0000 1.73 @@ -34,6 +34,14 @@ $t_bug = bug_prepare_display( bug_get( $f_bug_id, true ) ); + if( $t_bug->project_id != helper_get_current_project() ) { + # in case the current project is not the same project of the bug we are viewing... + # ... set on fly the current project. This to avoid problems with categories and handlers lists etc. + $t_redirect_url = "set_project.php?project_id=" . $t_bug->project_id . + "&make_default=no&ref=" . urlencode( "bug_view_page.php?bug_id=" . $f_bug_id ); + print_header_redirect( $t_redirect_url ); + } + $t_access_level_needed = config_get( 'view_history_threshold' ); $t_can_view_history = access_has_bug_level( $t_access_level_needed, $f_bug_id ); |