* finish task #1826.

This commit is contained in:
wyd621
2014-03-11 03:36:49 +00:00
parent 2f06f1b11f
commit 4e73e16d1a
3 changed files with 14 additions and 2 deletions
+11
View File
@@ -77,6 +77,11 @@ class bugModel extends model
$now = helper::now();
$data = fixer::input('post')->get();
$actions = array();
$stmt = $this->dbh->query($this->loadModel('tree')->buildMenuQuery($productID, 'bug', $startModuleID = 0));
$moduleOwners = array();
while($module = $stmt->fetch()) $moduleOwners[$module->id] = $module->owner;
for($i = 0; $i < $this->config->bug->batchCreate; $i++)
{
if(empty($data->titles[$i])) continue;
@@ -94,6 +99,12 @@ class bugModel extends model
$bug->os = $data->oses[$i];
$bug->browser = $data->browsers[$i];
if(!empty($moduleOwners[$bug->module]))
{
$bug->assignedTo = $moduleOwners[$bug->module];
$bug->assignedDate = $now;
}
$this->dao->insert(TABLE_BUG)->data($bug)->autoCheck()->batchCheck($this->config->bug->create->requiredFields, 'notempty')->exec();
$bugID = $this->dao->lastInsertID();
+1 -2
View File
@@ -434,7 +434,6 @@ class story extends control
$this->story->activate($storyID);
if(dao::isError()) die(js::error(dao::getError()));
$actionID = $this->action->create('story', $storyID, 'Activated', $this->post->comment);
$this->action->logHistory($actionID, $changes);
$this->sendmail($storyID, $actionID);
if(isonlybody()) die(js::closeColorbox('parent.parent'));
@@ -655,7 +654,7 @@ class story extends control
foreach($allChanges as $storyID => $changes)
{
$actionID = $this->action->create('story', $storyID, 'Closed', htmlspecialchars($this->post->comments[$storyID]), ucfirst($this->post->closedReasons[$storyID]));
$this->action->logHistory($actionID);
$this->action->logHistory($actionID, $changes);
$this->sendmail($storyID, $actionID);
}
}
+2
View File
@@ -148,6 +148,7 @@ class storyModel extends model
if($bugID > 0)
{
$bug = new stdclass();
$bug->toStory = $storyID;
$bug->status = 'closed';
$bug->resolution = 'tostory';
@@ -595,6 +596,7 @@ class storyModel extends model
$oldStory = $this->getById($storyID);
if($oldStory->status == 'closed') continue;
$story = new stdclass();
$story->lastEditedBy = $this->app->user->account;
$story->lastEditedDate = $now;
$story->closedBy = $this->app->user->account;