/**
 * close the given bug
 * @param int p_bug_id
 * @param string p_bugnote_text
 * @param bool p_bugnote_private
 * @param string p_time_tracking
 * @return bool (always true)
 * @access public
 */
function bug_close($p_bug_id, $p_bugnote_text = '', $p_bugnote_private = false, $p_time_tracking = '0:00')
{
    $p_bugnote_text = trim($p_bugnote_text);
    # Add bugnote if supplied ignore a false return
    # Moved bugnote_add before bug_set_field calls in case time_tracking_no_note is off.
    # Error condition stopped execution but status had already been changed
    bugnote_add($p_bug_id, $p_bugnote_text, $p_time_tracking, $p_bugnote_private, 0, '', NULL, FALSE);
    bug_set_field($p_bug_id, 'status', config_get('bug_closed_status_threshold'));
    email_close($p_bug_id);
    email_relationship_child_closed($p_bug_id);
    return true;
}
Example #2
0
        bug_monitor($f_bug_id, $t_existing_bug->handler_id);
    }
    bug_monitor_copy($f_bug_id, $t_updated_bug->duplicate_id);
}
event_signal('EVENT_UPDATE_BUG', array($t_existing_bug, $t_updated_bug));
# Allow a custom function to respond to the modifications made to the bug. Note
# that custom functions are being deprecated in MantisBT. You should migrate to
# the new plugin system instead.
helper_call_custom_function('issue_update_notify', array($f_bug_id));
# Send a notification of changes via email.
if ($t_resolve_issue) {
    email_resolved($f_bug_id);
    email_relationship_child_resolved($f_bug_id);
} else {
    if ($t_close_issue) {
        email_close($f_bug_id);
        email_relationship_child_closed($f_bug_id);
    } else {
        if ($t_reopen_issue) {
            email_reopen($f_bug_id);
        } else {
            if ($t_existing_bug->handler_id === NO_USER && $t_updated_bug->handler_id !== NO_USER) {
                email_assign($f_bug_id);
            } else {
                if ($t_existing_bug->status !== $t_updated_bug->status) {
                    $t_new_status_label = MantisEnum::getLabel(config_get('status_enum_string'), $t_updated_bug->status);
                    $t_new_status_label = str_replace(' ', '_', $t_new_status_label);
                    email_generic($f_bug_id, $t_new_status_label, 'email_notification_title_for_status_bug_' . $t_new_status_label);
                } else {
                    email_generic($f_bug_id, 'updated', 'email_notification_title_for_action_bug_updated');
                }
Example #3
0
function bug_close($p_bug_id, $p_bugnote_text = '', $p_bugnote_private = false)
{
    $p_bugnote_text = trim($p_bugnote_text);
    bug_set_field($p_bug_id, 'status', CLOSED);
    # Add bugnote if supplied
    if (!is_blank($p_bugnote_text)) {
        bugnote_add($p_bug_id, $p_bugnote_text, $p_bugnote_private);
    }
    email_close($p_bug_id);
    # MASC RELATIONSHIP
    if (ON == config_get('enable_relationship')) {
        email_relationship_child_closed($p_bug_id);
    }
    # MASC RELATIONSHIP
    return true;
}