Ejemplo n.º 1
0
/**
 * print ALL the RELATIONSHIPS OF A SPECIFIC BUG
 * @param integer $p_bug_id A bug identifier.
 * @return string
 */
function relationship_get_summary_html_preview($p_bug_id)
{
    $t_summary = '';
    $t_show_project = false;
    $t_relationship_all = relationship_get_all($p_bug_id, $t_show_project);
    $t_relationship_all_count = count($t_relationship_all);
    # prepare the relationships table
    for ($i = 0; $i < $t_relationship_all_count; $i++) {
        $t_summary .= relationship_get_details($p_bug_id, $t_relationship_all[$i], true, true, $t_show_project);
    }
    if (!is_blank($t_summary)) {
        if (relationship_can_resolve_bug($p_bug_id) == false) {
            $t_summary .= '<tr class="print"><td class="print" colspan=' . (5 + $t_show_project) . '><strong>' . lang_get('relationship_warning_blocking_bugs_not_resolved') . '</strong></td></tr>';
        }
        $t_summary = '<table width="100%" cellpadding="0" cellspacing="1">' . $t_summary . '</table>';
    }
    return $t_summary;
}
Ejemplo n.º 2
0
$t_reopen_issue = false;
if ( $t_existing_bug->status < $t_resolved_status &&
     $t_updated_bug->status >= $t_resolved_status &&
     $t_updated_bug->status < $t_closed_status ) {
	$t_resolve_issue = true;
} else if ( $t_existing_bug->status < $t_closed_status &&
            $t_updated_bug->status >= $t_closed_status ) {
	$t_close_issue = true;
} else if ( $t_existing_bug->status >= $t_resolved_status &&
            $t_updated_bug->status <= config_get( 'bug_reopen_status' ) ) {
	$t_reopen_issue = true;
}

# If resolving or closing, ensure that all dependant issues have been resolved.
if ( ( $t_resolve_issue || $t_close_issue ) &&
     !relationship_can_resolve_bug( $f_bug_id ) ) {
	trigger_error( ERROR_BUG_RESOLVE_DEPENDANTS_BLOCKING, ERROR );
}

# Validate any change to the status of the issue.
if ( $t_existing_bug->status !== $t_updated_bug->status ) {
	access_ensure_bug_level( config_get( 'update_bug_status_threshold' ), $f_bug_id );
	if ( !bug_check_workflow( $t_existing_bug->status, $t_updated_bug->status ) ) {
		error_parameters( lang_get( 'status' ) );
		trigger_error( ERROR_CUSTOM_FIELD_INVALID_VALUE, ERROR );
	}
	if ( !access_has_bug_level( access_get_status_threshold( $t_updated_bug->status, $t_updated_bug->project_id ), $f_bug_id ) ) {
		# The reporter may be allowed to close or reopen the issue regardless.
		$t_can_bypass_status_access_thresholds = false;
		if ( $t_close_issue &&
		     $t_existing_bug->status >= $t_resolved_status &&
Ejemplo n.º 3
0
$t_resolve_issue = false;
$t_close_issue = false;
$t_reopen_issue = false;
if ($t_existing_bug->status < $t_resolved_status && $t_updated_bug->status >= $t_resolved_status && $t_updated_bug->status < $t_closed_status) {
    $t_resolve_issue = true;
} else {
    if ($t_existing_bug->status < $t_closed_status && $t_updated_bug->status >= $t_closed_status) {
        $t_close_issue = true;
    } else {
        if ($t_existing_bug->status >= $t_resolved_status && $t_updated_bug->status <= config_get('bug_reopen_status')) {
            $t_reopen_issue = true;
        }
    }
}
# If resolving or closing, ensure that all dependant issues have been resolved.
if (($t_resolve_issue || $t_close_issue) && !relationship_can_resolve_bug($f_bug_id)) {
    trigger_error(ERROR_BUG_RESOLVE_DEPENDANTS_BLOCKING, ERROR);
}
# Validate any change to the status of the issue.
if ($t_existing_bug->status !== $t_updated_bug->status) {
    access_ensure_bug_level(config_get('update_bug_status_threshold'), $f_bug_id);
    if (!bug_check_workflow($t_existing_bug->status, $t_updated_bug->status)) {
        error_parameters(lang_get('status'));
        trigger_error(ERROR_CUSTOM_FIELD_INVALID_VALUE, ERROR);
    }
    if (!access_has_bug_level(access_get_status_threshold($t_updated_bug->status, $t_updated_bug->project_id), $f_bug_id)) {
        # The reporter may be allowed to close or reopen the issue regardless.
        $t_can_bypass_status_access_thresholds = false;
        if ($t_close_issue && $t_existing_bug->status >= $t_resolved_status && $t_existing_bug->reporter_id === auth_get_current_user_id() && config_get('allow_reporter_close')) {
            $t_can_bypass_status_access_thresholds = true;
        } else {
Ejemplo n.º 4
0
echo $f_bug_id;
?>
" />
		<input type="hidden" name="status" value="<?php 
echo $f_new_status;
?>
" />
		<?php 
echo lang_get($t_status_label . '_bug_title');
?>
	</td>
</tr>

<?php 
if ($f_new_status >= $t_resolved) {
    if (relationship_can_resolve_bug($f_bug_id) == false) {
        echo "<tr><td colspan=\"2\">" . lang_get('relationship_warning_blocking_bugs_not_resolved_2') . "</td></tr>";
    }
}
?>

<?php 
$t_current_resolution = $t_bug->resolution;
$t_bug_is_open = $t_current_resolution < $t_resolved;
if ($f_new_status >= $t_resolved && ($f_new_status < $t_closed || $t_bug_is_open)) {
    ?>
<!-- Resolution -->
<tr <?php 
    echo helper_alternate_class();
    ?>
>