. /** * @package MantisBT * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org * @copyright Copyright (C) 2002 - 2014 MantisBT Team - mantisbt-dev@lists.sourceforge.net * @link http://www.mantisbt.org */ /** * MantisBT Core API's */ $g_allow_browser_cache = 1; require_once( 'core.php' ); require_once( 'bug_api.php' ); require_once( 'custom_field_api.php' ); require_once( 'relationship_api.php' ); define ( 'BUG_VIEW_INC_ALLOW', true ); $f_bug_id = gpc_get_int( 'id' ); $t_bug = bug_get( $f_bug_id ); $tpl_file = __FILE__; $tpl_mantis_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR; $tpl_show_page_header = false; $tpl_force_readonly = true; $tpl_fields_config_option = 'bug_change_status_page_fields'; 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... # ... override the current project. This to avoid problems with categories and handlers lists etc. $g_project_override = $t_bug->project_id; } $f_new_status = gpc_get_int( 'new_status' ); $f_reopen_flag = gpc_get_int( 'reopen_flag', OFF ); $t_reopen = config_get( 'bug_reopen_status', null, null, $t_bug->project_id ); $t_resolved = config_get( 'bug_resolved_status_threshold', null, null, $t_bug->project_id ); $t_closed = config_get( 'bug_closed_status_threshold', null, null, $t_bug->project_id ); $t_current_user_id = auth_get_current_user_id(); # Ensure user has proper access level before proceeding if( $f_new_status == $t_reopen && $f_reopen_flag ) { access_ensure_can_reopen_bug( $t_bug, $t_current_user_id ); } else if( $f_new_status == $t_closed ) { access_ensure_can_close_bug( $t_bug, $t_current_user_id ); } else if ( bug_is_readonly( $f_bug_id ) || !access_has_bug_level( access_get_status_threshold( $f_new_status, $t_bug->project_id ), $f_bug_id, $t_current_user_id ) ) { access_denied(); } $t_can_update_due_date = access_has_bug_level( config_get( 'due_date_update_threshold' ), $f_bug_id ); # get new issue handler if set, otherwise default to original handler $f_handler_id = gpc_get_int( 'handler_id', $t_bug->handler_id ); if ( config_get( 'bug_assigned_status' ) == $f_new_status ) { $t_bug_sponsored = sponsorship_get_amount( sponsorship_get_all_ids( $f_bug_id ) ) > 0; if ( $t_bug_sponsored ) { if ( !access_has_bug_level( config_get( 'assign_sponsored_bugs_threshold' ), $f_bug_id ) ) { trigger_error( ERROR_SPONSORSHIP_ASSIGNER_ACCESS_LEVEL_TOO_LOW, ERROR ); } } if ( $f_handler_id != NO_USER ) { if ( !access_has_bug_level( config_get( 'handle_bug_threshold' ), $f_bug_id, $f_handler_id ) ) { trigger_error( ERROR_HANDLER_ACCESS_TOO_LOW, ERROR ); } if ( $t_bug_sponsored ) { if ( !access_has_bug_level( config_get( 'handle_sponsored_bugs_threshold' ), $f_bug_id, $f_handler_id ) ) { trigger_error( ERROR_SPONSORSHIP_HANDLER_ACCESS_LEVEL_TOO_LOW, ERROR ); } } } } $t_status_label = str_replace( " ", "_", MantisEnum::getLabel( config_get( 'status_enum_string' ), $f_new_status ) ); html_page_top( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) ); print_recently_visited(); ?>
"; } } ?> resolution; $t_bug_is_open = in_array( $t_current_resolution, array( config_get( 'default_bug_resolution' ), config_get( 'bug_reopen_resolution' ) ) ); if ( ( $t_resolved <= $f_new_status ) && ( ( $t_closed > $f_new_status ) || ( $t_bug_is_open ) ) ) { ?> > $f_new_status ) ) { ?> > handler_id; if ( $t_suggested_handler_id == NO_USER && access_has_bug_level( config_get( 'handle_bug_threshold' ), $f_bug_id ) ) { $t_suggested_handler_id = $t_current_user_id; } ?> > due_date ) ) { $t_date_to_display = date( config_get( 'calendar_date_format' ), $t_bug->due_date ); } ?> > $f_new_status ) ) { $t_custom_status_label = "resolved"; } if ( $t_closed == $f_new_status ) { $t_custom_status_label = "closed"; } $t_related_custom_field_ids = custom_field_get_linked_ids( $t_bug->project_id ); foreach( $t_related_custom_field_ids as $t_id ) { $t_def = custom_field_get_definition( $t_id ); $t_display = $t_def['display_' . $t_custom_status_label]; $t_require = $t_def['require_' . $t_custom_status_label]; if ( ( "update" == $t_custom_status_label ) && ( !$t_require ) ) { continue; } if ( in_array( $t_custom_status_label, array( "resolved", "closed" ) ) && !( $t_display || $t_require ) ) { continue; } if ( custom_field_has_write_access( $t_id, $f_bug_id ) ) { ?> > > = $t_resolved ) ) { if ( version_should_show_product_version( $t_bug->project_id ) && !bug_is_readonly( $f_bug_id ) && access_has_bug_level( config_get( 'update_bug_threshold' ), $f_bug_id ) ) { ?> > = $t_resolved ) && ( $t_closed > $f_new_status ) ) { ?> project_id ), $f_bug_id ) ) ) { ?> > \n", config_get( 'bug_reopen_resolution' ) ); } ?> > > >
" . lang_get( 'relationship_warning_blocking_bugs_not_resolved_2' ) . "
"; date_print_calendar(); ?>
*
/>
(HH:MM)
'; include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'bug_view_inc.php' );