/** * reopen the given bug * @param integer $p_bug_id A bug identifier. * @param string $p_bugnote_text The bugnote text. * @param string $p_time_tracking Time tracking value. * @param boolean $p_bugnote_private Whether this is a private bugnote. * @return boolean (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_bug_reopened($p_bug_id); return true; }
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_bug_reopened($f_bug_id); } else { if ($t_existing_bug->handler_id === NO_USER && $t_updated_bug->handler_id !== NO_USER) { email_bug_assigned($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_bug_status_changed($f_bug_id, $t_new_status_label); } else { email_bug_updated($f_bug_id); } } } } }