Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
wangyidong
2018-11-12 14:18:26 +08:00
4 changed files with 31 additions and 4 deletions
+4 -4
View File
@@ -24,10 +24,10 @@ $lang->group->manageMember = 'Member';
$lang->group->confirmDelete = 'Do you want to delete this User Group?';
$lang->group->successSaved = 'Saved.';
$lang->group->errorNotSaved = 'Failed. Please select actions and groups.';
$lang->group->viewList = 'Views can be accessed.';
$lang->group->productList = 'Products can be accessed.';
$lang->group->projectList = 'Projects can be accessed.';
$lang->group->noticeVisit = 'Empty means you have no access.';
$lang->group->viewList = 'View';
$lang->group->productList = 'Product';
$lang->group->projectList = 'Project';
$lang->group->noticeVisit = 'Empty means no access.';
$lang->group->id = 'ID';
$lang->group->name = 'Name';
+1
View File
@@ -341,6 +341,7 @@ class task extends control
$this->view->position[] = $this->lang->task->common;
$this->view->position[] = $this->lang->task->edit;
$this->view->stories = $this->story->getProjectStoryPairs($this->view->project->id);
$this->view->tasks = $this->task->getParentTaskPairs($this->view->project->id);
$this->view->users = $this->loadModel('user')->getPairs('nodeleted', "{$this->view->task->openedBy},{$this->view->task->canceledBy},{$this->view->task->closedBy}");
$this->view->modules = $this->tree->getTaskOptionMenu($this->view->task->project);
$this->display();
+20
View File
@@ -683,6 +683,7 @@ class taskModel extends model
{
if($task->status == 'done') $this->loadModel('score')->create('task', 'finish', $taskID);
if($task->status == 'closed') $this->loadModel('score')->create('task', 'close', $taskID);
if($task->parent) $this->dao->update(TABLE_TASK)->set('parent')->eq(-1)->where('id')->eq($task->parent)->exec();
$this->file->updateObjectID($this->post->uid, $taskID, 'task');
return common::createChanges($oldTask, $task);
}
@@ -1598,6 +1599,25 @@ class taskModel extends model
return $tasks;
}
/**
* Get project parent tasks pairs.
*
* @param int $projectID
* @access public
* @return array
*/
public function getParentTaskPairs($projectID)
{
$tasks = $this->dao->select('id, name')->from(TABLE_TASK)
->where('deleted')->eq(0)
->andWhere('parent')->le(0)
->andWhere('status')->notin('cancel,closed')
->andWhere('project')->eq($projectID)
->fetchPairs();
return array('' => '') + $tasks ;
}
/**
* Get tasks of a user.
*
+6
View File
@@ -103,6 +103,12 @@
<td><span id="storyIdBox"><?php echo html::select('story', $stories, $task->story, "class='form-control chosen'");?></span></td>
</tr>
<?php endif;?>
<?php if($task->parent == 0):?>
<tr>
<th><?php echo $lang->task->parent;?></th>
<td><?php echo html::select('parent', $tasks, $task->parent, "class='form-control chosen'");?></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>