* finish the task #609.
This commit is contained in:
@@ -470,6 +470,18 @@ class bug extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendmail($bugID, $actionID);
|
||||
}
|
||||
|
||||
$bug = $this->bug->getById($bugID);
|
||||
if($bug->toTask != 0)
|
||||
{
|
||||
foreach($changes as $change)
|
||||
{
|
||||
if($change['field'] == 'status')
|
||||
{
|
||||
echo js::alert($this->lang->bug->remindTask . $bug->toTask);
|
||||
}
|
||||
}
|
||||
}
|
||||
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
|
||||
}
|
||||
|
||||
@@ -575,6 +587,12 @@ class bug extends control
|
||||
$actionID = $this->action->create('bug', $bugID, 'Resolved', $this->post->comment, $this->post->resolution);
|
||||
}
|
||||
$this->sendmail($bugID, $actionID);
|
||||
|
||||
$bug = $this->bug->getById($bugID);
|
||||
if($bug->toTask != 0)
|
||||
{
|
||||
echo js::alert($this->lang->bug->remindTask . $bug->toTask);
|
||||
}
|
||||
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
|
||||
}
|
||||
|
||||
@@ -685,6 +703,7 @@ class bug extends control
|
||||
*/
|
||||
public function delete($bugID, $confirm = 'no')
|
||||
{
|
||||
$bug = $this->bug->getById($bugID);
|
||||
if($confirm == 'no')
|
||||
{
|
||||
die(js::confirm($this->lang->bug->confirmDelete, inlink('delete', "bugID=$bugID&confirm=yes")));
|
||||
@@ -692,6 +711,7 @@ class bug extends control
|
||||
else
|
||||
{
|
||||
$this->bug->delete(TABLE_BUG, $bugID);
|
||||
if($bug->toTask != 0) echo js::alert($this->lang->bug->remindTask . $bug->toTask);
|
||||
die(js::locate($this->session->bugList, 'parent'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,6 +141,7 @@ $lang->bug->buttonCreateTestcase = 'Create case';
|
||||
$lang->bug->confirmChangeProduct = 'Change product will change project, task and story also, are you sure?';
|
||||
$lang->bug->confirmDelete = 'Are you sure to delete this bug?';
|
||||
$lang->bug->setTemplateTitle = 'Please input the template title:';
|
||||
$lang->bug->remindTask = 'This bug has been to be a task, please update the task:';
|
||||
|
||||
/* Templates. */
|
||||
$lang->bug->tplStep = "<p>[Steps]</p>";
|
||||
|
||||
@@ -141,6 +141,7 @@ $lang->bug->buttonCreateTestcase = '创建用例';
|
||||
$lang->bug->confirmChangeProduct = '修改产品会导致相应的项目、需求和任务发生变化,确定吗?';
|
||||
$lang->bug->confirmDelete = '您确认要删除该Bug吗?';
|
||||
$lang->bug->setTemplateTitle = '请输入bug模板标题(保存之前请先填写bug重现步骤):';
|
||||
$lang->bug->remindTask = '该Bug已经转化为任务,请及时更新任务状态。任务:';
|
||||
|
||||
/* 模板。*/
|
||||
$lang->bug->tplStep = "<p>[步骤]</p>";
|
||||
|
||||
@@ -210,9 +210,10 @@ class bugModel extends model
|
||||
public function resolve($bugID)
|
||||
{
|
||||
$now = helper::now();
|
||||
$oldBug = $this->getById($bugID);
|
||||
$storyID = 0;
|
||||
if($this->post->resolution == 'tostory')
|
||||
{
|
||||
$oldBug = $this->getById($bugID);
|
||||
$story->product = $oldBug->product;
|
||||
$story->module = $oldBug->module;
|
||||
$story->source = 'bug';
|
||||
|
||||
@@ -173,6 +173,7 @@ class task extends control
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$files = $this->loadModel('file')->saveUpload('task', $taskID);
|
||||
|
||||
$task = $this->task->getById($taskID);
|
||||
if($this->post->comment != '' or !empty($changes) or !empty($files))
|
||||
{
|
||||
$action = !empty($changes) ? 'Edited' : 'Commented';
|
||||
@@ -182,6 +183,17 @@ class task extends control
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendmail($taskID, $actionID);
|
||||
}
|
||||
|
||||
if($task->fromBug != 0)
|
||||
{
|
||||
foreach($changes as $change)
|
||||
{
|
||||
if($change['field'] == 'status')
|
||||
{
|
||||
echo js::alert($this->lang->task->remindBug . $task->fromBug);
|
||||
}
|
||||
}
|
||||
}
|
||||
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
|
||||
}
|
||||
|
||||
@@ -313,12 +325,24 @@ class task extends control
|
||||
$changes = $this->task->finish($taskID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
$task = $this->task->getById($taskID);
|
||||
if($this->post->comment != '' or !empty($changes))
|
||||
{
|
||||
$actionID = $this->action->create('task', $taskID, 'Finished', $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendmail($taskID, $actionID);
|
||||
}
|
||||
|
||||
if($task->fromBug != 0)
|
||||
{
|
||||
foreach($changes as $change)
|
||||
{
|
||||
if($change['field'] == 'status')
|
||||
{
|
||||
echo js::alert($this->lang->task->remindBug . $task->fromBug);
|
||||
}
|
||||
}
|
||||
}
|
||||
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
|
||||
}
|
||||
|
||||
@@ -468,6 +492,7 @@ class task extends control
|
||||
*/
|
||||
public function delete($projectID, $taskID, $confirm = 'no')
|
||||
{
|
||||
$task = $this->task->getById($taskID);
|
||||
if($confirm == 'no')
|
||||
{
|
||||
die(js::confirm($this->lang->task->confirmDelete, inlink('delete', "projectID=$projectID&taskID=$taskID&confirm=yes")));
|
||||
@@ -476,6 +501,7 @@ class task extends control
|
||||
{
|
||||
$story = $this->dao->select('story')->from(TABLE_TASK)->where('id')->eq($taskID)->fetch('story');
|
||||
$this->task->delete(TABLE_TASK, $taskID);
|
||||
if($task->fromBug != 0) $this->dao->update(TABLE_BUG)->set('toTask')->eq(0)->where('id')->eq($task->fromBug)->exec();
|
||||
if($story) $this->loadModel('story')->setStage($story);
|
||||
die(js::locate($this->session->taskList, 'parent'));
|
||||
}
|
||||
|
||||
@@ -126,6 +126,7 @@ $lang->task->copyStoryTitle = "Same as story";
|
||||
$lang->task->afterSubmit = "After created";
|
||||
$lang->task->successSaved = "Success saved";
|
||||
$lang->task->delayWarning = " <strong class='delayed f-14px'> Postponed %s days </strong>";
|
||||
$lang->task->remindBug = "This task from Bug, please update the Bug:";
|
||||
|
||||
/* Report. */
|
||||
$lang->task->report->common = 'Report';
|
||||
|
||||
@@ -126,6 +126,7 @@ $lang->task->copyStoryTitle = "同需求";
|
||||
$lang->task->afterSubmit = "添加之后";
|
||||
$lang->task->successSaved = "成功添加,";
|
||||
$lang->task->delayWarning = " <strong class='delayed f-14px'> 延期%s天 </strong>";
|
||||
$lang->task->remindBug = "该需求为Bug转化得到,请及时更新相关Bug。来源Bug:";
|
||||
|
||||
/* 统计报表。*/
|
||||
$lang->task->report->common = '统计报表';
|
||||
|
||||
Reference in New Issue
Block a user