* finish task #4810.

This commit is contained in:
wangyidong
2018-09-05 11:23:10 +08:00
parent 10e4df924d
commit f3d9444cfb
2 changed files with 49 additions and 15 deletions
+25 -9
View File
@@ -963,12 +963,13 @@ class bug extends control
{
if(!empty($_POST))
{
$this->bug->resolve($bugID);
$changes = $this->bug->resolve($bugID);
if(dao::isError()) die(js::error(dao::getError()));
$files = $this->loadModel('file')->saveUpload('bug', $bugID);
$fileAction = !empty($files) ? $this->lang->addFiles . join(',', $files) . "\n" : '';
$actionID = $this->action->create('bug', $bugID, 'Resolved', $fileAction . $this->post->comment, $this->post->resolution . ($this->post->duplicateBug ? ':' . (int)$this->post->duplicateBug : ''));
$this->action->logHistory($actionID, $changes);
$bug = $this->bug->getById($bugID);
if($bug->toTask != 0)
@@ -1021,9 +1022,16 @@ class bug extends control
{
$bugIDList = $this->post->bugIDList ? $this->post->bugIDList : die(js::locate($this->session->bugList, 'parent'));
$bugIDList = array_unique($bugIDList);
$bugIDList = $this->bug->batchResolve($bugIDList, $resolution, $resolvedBuild);
$changes = $this->bug->batchResolve($bugIDList, $resolution, $resolvedBuild);
if(dao::isError()) die(js::error(dao::getError()));
foreach($bugIDList as $bugID) $this->action->create('bug', $bugID, 'Resolved', '', $resolution);
foreach($changes as $bugID => $bugChanges)
{
$actionID = $this->action->create('bug', $bugID, 'Resolved', '', $resolution);
$this->action->logHistory($actionID, $bugChanges);
}
$this->loadModel('score')->create('ajax', 'batchOther');
die(js::locate($this->session->bugList, 'parent'));
}
@@ -1039,10 +1047,14 @@ class bug extends control
{
if(!empty($_POST))
{
$this->bug->activate($bugID);
$changes = $this->bug->activate($bugID);
if(dao::isError()) die(js::error(dao::getError()));
$files = $this->loadModel('file')->saveUpload('bug', $bugID);
$this->action->create('bug', $bugID, 'Activated', $this->post->comment);
$actionID = $this->action->create('bug', $bugID, 'Activated', $this->post->comment);
$this->action->logHistory($actionID, $changes);
if(isonlybody()) die(js::closeModal('parent.parent'));
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
}
@@ -1074,9 +1086,12 @@ class bug extends control
{
if(!empty($_POST))
{
$this->bug->close($bugID);
$changes = $this->bug->close($bugID);
if(dao::isError()) die(js::error(dao::getError()));
$this->action->create('bug', $bugID, 'Closed', $this->post->comment);
$actionID = $this->action->create('bug', $bugID, 'Closed', $this->post->comment);
$this->action->logHistory($actionID, $changes);
if(isonlybody()) die(js::closeModal('parent.parent'));
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
}
@@ -1157,9 +1172,10 @@ class bug extends control
continue;
}
$this->bug->close($bugID);
$changes = $this->bug->close($bugID);
$this->action->create('bug', $bugID, 'Closed');
$actionID = $this->action->create('bug', $bugID, 'Closed');
$this->action->logHistory($actionID, $changes);
}
$this->loadModel('score')->create('ajax', 'batchOther');
if(isset($skipBugs)) echo js::alert(sprintf($this->lang->bug->skipClose, join(',', $skipBugs)));