|| ###################################################################
\*=====================================================================*/
-define('SVN', '$Id$');
$focus['showreport'] = 'focus';
require_once('./includes/api_bug.php');
require_once('./includes/api_comment.php');
-require_once('./includes/class_api_error.php');
-APIError(array(new API_Error_Handler($message), 'user_cumulative'));
-
$bug = $db->queryFirst("
SELECT bug.*, user.email, user.displayname, user.showemail
FROM " . TABLE_PREFIX . "bug AS bug
// setup logging
require_once('./includes/class_logging.php');
-$log = new Logging;
-$log->set_bugid($bug['bugid']);
+$log = new Logging();
+$log->setBugId($bug['bugid']);
-$notif = new NotificationCenter;
+$notif = new NotificationCenter();
-$bugapi = new BugAPI($bugsys);
-$bugapi->set('bugid', $input->in['bugid']);
-$bugapi->set_condition();
-$bugapi->dorelations = array();
+$bugapi = new BugAPI();
+$bugapi->set('bugid', $input->in['bugid']);
$bugapi->fetch();
// ###################################################################
$message->errorPermission();
}
- $bugapi->delete();
+ $bugapi->remove();
$message->redirect(T('The entire bug has been deleted.'), 'index.php');
}
if ($_POST['do'] == 'update')
{
- if (!((can_perform('caneditown', $bug['product']) AND bugdar::$userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND bugdar::$userinfo['userid'] != $bug['userid'])) AND !can_perform('canpostcomments', $bug['product']))
+ if (!((can_perform('caneditown', $bug['product']) && bugdar::$userinfo['userid'] == $bug['userid']) || (can_perform('caneditother', $bug['product']) && bugdar::$userinfo['userid'] != $bug['userid'])) && !can_perform('canpostcomments', $bug['product']))
{
$message->errorPermission();
}
- $log->add_data(true, $bugapi->record, $log->getCommonFields(), true);
+ $log->addData(true, $bugapi->record, $log->getCommonFields(), true);
// -------------------------------------------------------------------
// handle automations
$commenttext = $input->in['comment'];
}
- $comment = new CommentAPI($bugsys);
+ $comment = new CommentAPI();
$comment->set('bugid', $input->in['bugid']);
$comment->set('userid', bugdar::$userinfo['userid']);
$comment->set('comment', $commenttext);
$comment->insert();
// we redefine the bug data later, but it needs to be here in order to generate the user list
- $notif->set_bug_data($bugapi->record);
- $notif->send_new_comment_notice($comment->values);
+ $notif->setBugData($bugapi->record);
+ $notif->sendNewCommentNotice($comment->values);
$bugapi->set('lastposttime', $comment->values['dateline']);
$bugapi->set('lastpostby', bugdar::$userinfo['userid']);
$dependencies = preg_split('#([^0-9].*?)#', $input->in['dependency'], -1, PREG_SPLIT_NO_EMPTY);
$dependencies = ((sizeof($dependencies) < 1) ? '' : implode(', ', $dependencies));
- if ((can_perform('caneditown', $bug['product']) AND bugdar::$userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND bugdar::$userinfo['userid'] != $bug['userid']))
+ if ((can_perform('caneditown', $bug['product']) && bugdar::$userinfo['userid'] == $bug['userid']) || (can_perform('caneditother', $bug['product']) && bugdar::$userinfo['userid'] != $bug['userid']))
{
$bugapi->set('summary', $input->in['summary']);
$bugapi->set('severity', $input->in['severity']);
// -------------------------------------------------------------------
// handle logging and perform updates
- $notif->set_bug_data($bugapi->record, array_merge($bugapi->record, $bugapi->values));
- $log->add_data(false, $bugapi->values, $log->getCommonFields(), true);
+ $notif->setBugData($bugapi->record, array_merge($bugapi->record, $bugapi->values));
+ $log->addData(false, $bugapi->values, $log->getCommonFields(), true);
if (!$message->hasErrors())
{
// -------------------------------------------------------------------
// do diff history
- $log->update_history();
+ $log->updateHistory();
- $notif->send_bug_changes_notice();
+ $notif->sendBugChangeNotice();
$notif->finalize();
$message->redirect(T('Your changes to the bug have been saved.'), "showreport.php?bugid=$bug[bugid]");
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file