Skip to content

Commit

Permalink
* Finish task #5327.
Browse files Browse the repository at this point in the history
  • Loading branch information
sgm0422 committed Mar 18, 2019
1 parent 62249b0 commit 7004af8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions module/task/lang/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
$lang->task->transfer = 'Transfer';
$lang->task->transferTo = 'Transfer To';
$lang->task->children = 'Child Task';
$lang->task->unlinkParent = 'Unlink Parent';
$lang->task->childrenAB = 'Child';
$lang->task->parent = 'Parent Task';
$lang->task->parentAB = 'Parent Task';
Expand Down
1 change: 1 addition & 0 deletions module/task/lang/zh-cn.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
$lang->task->transfer = '转交';
$lang->task->transferTo = '转交给';
$lang->task->children = '子任务';
$lang->task->unlinkParent = '取消子任务';
$lang->task->childrenAB = '';
$lang->task->parent = '父任务';
$lang->task->parentAB = '';
Expand Down
9 changes: 8 additions & 1 deletion module/task/model.php
Original file line number Diff line number Diff line change
Expand Up @@ -617,12 +617,13 @@ public function update($taskID)
->setIF($this->post->assignedTo != $oldTask->assignedTo, 'assignedDate', $now)

->setIF($this->post->status == 'wait' and $this->post->left == $oldTask->left and $this->post->consumed == 0 and $this->post->estimate, 'left', $this->post->estimate)
->setIF(isset($_POST['unlinkParent']), 'parent', 0)

->setDefault('lastEditedBy', $this->app->user->account)
->add('lastEditedDate', $now)
->stripTags($this->config->task->editor->edit['id'], $this->config->allowedTags)
->join('mailto', ',')
->remove('comment,files,labels,uid,multiple,team,teamEstimate,teamConsumed,teamLeft,contactListMenu')
->remove('comment,files,labels,uid,multiple,team,teamEstimate,teamConsumed,teamLeft,contactListMenu,unlinkParent')
->get();

if($task->consumed < $oldTask->consumed) die(js::error($this->lang->task->error->consumedSmall));
Expand Down Expand Up @@ -698,6 +699,7 @@ public function update($taskID)

if($oldTask->parent > 0)
{
if($task->parent == 0) $this->computeWorkingHours($oldTask->parent);
$this->updateParentStatus($taskID);
$this->computeBeginAndEnd($oldTask->parent);
}
Expand Down Expand Up @@ -1652,6 +1654,11 @@ public function getParentTaskPairs($projectID)
->andWhere('project')->eq($projectID)
->fetchPairs();

foreach($tasks as $id => $name)
{
$taskTeam = $this->dao->select('*')->from(TABLE_TEAM)->where('root')->eq($id)->andWhere('type')->eq('task')->fetch();
if(!empty($taskTeam)) unset($tasks[$id]);
}
return array('' => '') + $tasks ;
}

Expand Down
6 changes: 6 additions & 0 deletions module/task/view/edit.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@
<td><?php echo html::select('parent', $tasks, $task->parent, "class='form-control chosen'");?></td>
</tr>
<?php endif;?>
<?php if($task->parent > 0):?>
<tr>
<th><?php echo $lang->task->unlinkParent;?></th>
<td><?php echo html::checkbox('unlinkParent', '');?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->task->assignedTo;?></th>
<td><span id="assignedToIdBox"><?php echo html::select('assignedTo', $members, $task->assignedTo, "class='form-control chosen'");?></span></td>
Expand Down
3 changes: 2 additions & 1 deletion module/testtask/control.php
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,8 @@ public function runCase($runID, $caseID = 0, $version = 0)
$caseResult = $this->testtask->createResult($runID);
if(dao::isError()) die(js::error(dao::getError()));

if($caseResult == 'fail') {
if($caseResult == 'fail')
{

$response['result'] = 'success';
$response['locate'] = $this->createLink('testtask', 'results',"runID=$runID&caseID=$caseID&version=$version");
Expand Down

0 comments on commit 7004af8

Please sign in to comment.