/*=====================================================================*\
|| ###################################################################
|| # Bugdar
-|| # Copyright ©2002-2007 Blue Static
+|| # Copyright (c)2004-2009 Blue Static
|| #
|| # This program is free software; you can redistribute it and/or modify
|| # it under the terms of the GNU General Public License as published by
'newreport',
);
-define('SVN', '$Id$');
$focus['newreport'] = 'focus';
require_once('./includes/api_bug.php');
require_once('./includes/api_comment.php');
-require_once('./includes/class_api_error.php');
$product = explode(',', $input->in['product']);
if (!can_perform('cansubmitbugs', $product[0]))
if ($_POST['do'] == 'insert')
{
- $bug = new BugAPI($bugsys);
- $comment = new CommentAPI($bugsys);
+ $bug = new BugAPI();
+ $comment = new CommentAPI();
$notif = new NotificationCenter();
$comment->set('bugid', $bug->insertid);
$comment->insert();
- $notif->send_new_bug_notice($bug->values, $comment->values);
+ $notif->sendNewBugNotice($bug->values, $comment->values);
- $bug = new BugAPI($bugsys); // need to destroy because update will think the insert fields need to be changed, too
- $bug->dorelations = array();
+ $bug = new BugAPI(); // need to destroy because update will think the insert fields need to be changed, too
$bug->set('bugid', $comment->values['bugid']);
- $bug->set_condition();
$bug->fetch();
$bug->set('dateline', $comment->values['dateline']);
$bug->set('initialreport', $comment->insertid);
$bug->set('hiddenlastpostbyname', bugdar::$userinfo['displayname']);
$bug->update();
- $notif->set_bug_data($bug->objdata);
+ $notif->setBugData($bug->record);
$notif->finalize();
if (can_perform('canassign'))
{
- foreach (bugdar::$datastore['assignto'] AS $dev)
+ foreach (bugdar::$datastore['assignto'] as $dev)
{
- $value = $dev['userid'];
- $label = construct_user_display($dev, false);
- $selected = ($input->in['assignedto'] ? ($input->in['assignedto'] == $dev['userid']) : ($dev['userid'] == bugdar::$options['defaultassign']));
- eval('$select[dev] .= "' . $template->fetch('selectoption') . '";');
+ $tpl = new BSTemplate('selectoption');
+ $tpl->vars = array(
+ 'value' => $dev['userid'],
+ 'label' => construct_user_display($dev, false),
+ 'selected' => ($input->in['assignedto'] ? ($input->in['assignedto'] == $dev['userid']) : ($dev['userid'] == bugdar::$options['defaultassign']))
+ );
+ $select['dev'] = $tpl->evaluate()->getTemplate();
}
}
// custom fields
- $fields = construct_custom_fields($bugsys->in, true);
+ $fields = construct_custom_fields($input->in, true);
$i = 0;
foreach ($fields AS $field)
{
$tpl = new BSTemplate('newreport');
$tpl->vars = array(
'reporter' => construct_user_display(bugdar::$userinfo),
- 'productSelect' => ConstructProductSelect('cansubmitbugs', $input->in['product'], false),
+ 'productSelect' => construct_product_select('cansubmitbugs', $input->in['product'], false),
'select' => $select,
'customfields' => $customfields
);
$tpl->evaluate()->flush();
}
-/*=====================================================================*\
-|| ###################################################################
-|| # $HeadURL$
-|| # $Id$
-|| ###################################################################
-\*=====================================================================*/
?>
\ No newline at end of file