/**
 * reopen the given bug
 * @param int p_bug_id
 * @param string p_bugnote_text
 * @param string p_time_tracking
 * @param bool p_bugnote_private
 * @return bool (always true)
 * @access public
 * @uses database_api.php
 * @uses email_api.php
 * @uses bugnote_api.php
 * @uses config_api.php
 */
function bug_reopen($p_bug_id, $p_bugnote_text = '', $p_time_tracking = '0:00', $p_bugnote_private = false)
{
    $p_bugnote_text = trim($p_bugnote_text);
    # Add bugnote if supplied
    # 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_reopen_status'));
    bug_set_field($p_bug_id, 'resolution', config_get('bug_reopen_resolution'));
    email_reopen($p_bug_id);
    return true;
}
Example #2
0
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_reopen($p_bug_id, $p_bugnote_text = '', $p_bugnote_private = false)
{
    $p_bugnote_text = trim($p_bugnote_text);
    bug_set_field($p_bug_id, 'status', config_get('bug_reopen_status'));
    bug_set_field($p_bug_id, 'resolution', config_get('bug_reopen_resolution'));
    # Add bugnote if supplied
    if (!is_blank($p_bugnote_text)) {
        bugnote_add($p_bug_id, $p_bugnote_text, $p_bugnote_private);
    }
    email_reopen($p_bug_id);
    return true;
}