Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms into sprint/244_tianshujie_70498
This commit is contained in:
+49
-49
@@ -51,7 +51,7 @@ $config->task->custom->batchEditFields = 'module,assignedTo,status,pri,estimat
|
||||
$config->task->excludeCheckFileds = ',pri,estStartedDitto,deadlineDitto,parent,regions,lanes,vision,region,';
|
||||
|
||||
$config->task->datatable = new stdclass();
|
||||
$config->task->datatable->defaultField = array('id', 'pri', 'name', 'status', 'assignedTo', 'finishedBy', 'estimate', 'consumed', 'left', 'progress', 'deadline', 'actions');
|
||||
$config->task->datatable->defaultField = array('id', 'name', 'pri', 'assignedTo', 'status', 'finishedBy', 'deadline', 'estimate', 'consumed', 'left', 'progress', 'actions');
|
||||
|
||||
global $lang;
|
||||
$config->task->datatable->fieldList['id']['title'] = 'idAB';
|
||||
@@ -59,19 +59,10 @@ $config->task->datatable->fieldList['id']['fixed'] = 'left';
|
||||
$config->task->datatable->fieldList['id']['width'] = '70';
|
||||
$config->task->datatable->fieldList['id']['required'] = 'yes';
|
||||
|
||||
$config->task->datatable->fieldList['module']['title'] = 'idAB';
|
||||
$config->task->datatable->fieldList['module']['control'] = 'select';
|
||||
$config->task->datatable->fieldList['module']['dataSource'] = array('module' => 'tree', 'method' => 'getTaskOptionMenu', 'params' => '$executionID');
|
||||
|
||||
$config->task->datatable->fieldList['execution']['title'] = 'idAB';
|
||||
$config->task->datatable->fieldList['execution']['control'] = 'hidden';
|
||||
$config->task->datatable->fieldList['execution']['dataSource'] = array('module' => 'execution', 'method' => 'getPairs');
|
||||
|
||||
$config->task->datatable->fieldList['mode']['title'] = 'idAB';
|
||||
$config->task->datatable->fieldList['mode']['control'] = 'hidden';
|
||||
|
||||
$config->task->datatable->fieldList['desc']['title'] = 'idAB';
|
||||
$config->task->datatable->fieldList['desc']['control'] = 'textarea';
|
||||
$config->task->datatable->fieldList['name']['title'] = 'name';
|
||||
$config->task->datatable->fieldList['name']['fixed'] = 'left';
|
||||
$config->task->datatable->fieldList['name']['width'] = 'auto';
|
||||
$config->task->datatable->fieldList['name']['required'] = 'yes';
|
||||
|
||||
$config->task->datatable->fieldList['pri']['title'] = 'priAB';
|
||||
$config->task->datatable->fieldList['pri']['fixed'] = 'left';
|
||||
@@ -79,10 +70,17 @@ $config->task->datatable->fieldList['pri']['width'] = '35';
|
||||
$config->task->datatable->fieldList['pri']['required'] = 'no';
|
||||
$config->task->datatable->fieldList['pri']['name'] = $lang->task->pri;
|
||||
|
||||
$config->task->datatable->fieldList['name']['title'] = 'name';
|
||||
$config->task->datatable->fieldList['name']['fixed'] = 'left';
|
||||
$config->task->datatable->fieldList['name']['width'] = 'auto';
|
||||
$config->task->datatable->fieldList['name']['required'] = 'yes';
|
||||
$config->task->datatable->fieldList['assignedTo']['title'] = 'assignedTo';
|
||||
$config->task->datatable->fieldList['assignedTo']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['assignedTo']['width'] = '100';
|
||||
$config->task->datatable->fieldList['assignedTo']['required'] = 'no';
|
||||
$config->task->datatable->fieldList['assignedTo']['control'] = 'select';
|
||||
$config->task->datatable->fieldList['assignedTo']['dataSource'] = array('module' => 'user', 'method' => 'getTeamMemberPairs', 'params' => '$executionID&execution');
|
||||
|
||||
$config->task->datatable->fieldList['assignedDate']['title'] = 'assignedDate';
|
||||
$config->task->datatable->fieldList['assignedDate']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['assignedDate']['width'] = '110';
|
||||
$config->task->datatable->fieldList['assignedDate']['required'] = 'no';
|
||||
|
||||
$config->task->datatable->fieldList['type']['title'] = 'typeAB';
|
||||
$config->task->datatable->fieldList['type']['fixed'] = 'no';
|
||||
@@ -94,18 +92,17 @@ $config->task->datatable->fieldList['status']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['status']['width'] = '60';
|
||||
$config->task->datatable->fieldList['status']['required'] = 'no';
|
||||
|
||||
$config->task->datatable->fieldList['assignedTo']['title'] = 'assignedTo';
|
||||
$config->task->datatable->fieldList['assignedTo']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['assignedTo']['width'] = '100';
|
||||
$config->task->datatable->fieldList['assignedTo']['required'] = 'no';
|
||||
$config->task->datatable->fieldList['assignedTo']['control'] = 'select';
|
||||
$config->task->datatable->fieldList['assignedTo']['dataSource'] = array('module' => 'user', 'method' => 'getTeamMemberPairs', 'params' => '$executionID&execution');
|
||||
|
||||
$config->task->datatable->fieldList['finishedBy']['title'] = 'finishedByAB';
|
||||
$config->task->datatable->fieldList['finishedBy']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['finishedBy']['width'] = '80';
|
||||
$config->task->datatable->fieldList['finishedBy']['required'] = 'no';
|
||||
|
||||
$config->task->datatable->fieldList['deadline']['title'] = 'deadlineAB';
|
||||
$config->task->datatable->fieldList['deadline']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['deadline']['width'] = '70';
|
||||
$config->task->datatable->fieldList['deadline']['required'] = 'no';
|
||||
$config->task->datatable->fieldList['deadline']['control'] = 'date';
|
||||
|
||||
$config->task->datatable->fieldList['estimate']['title'] = 'estimateAB';
|
||||
$config->task->datatable->fieldList['estimate']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['estimate']['width'] = '55';
|
||||
@@ -128,12 +125,6 @@ $config->task->datatable->fieldList['progress']['required'] = 'no';
|
||||
$config->task->datatable->fieldList['progress']['sort'] = 'no';
|
||||
$config->task->datatable->fieldList['progress']['name'] = $lang->task->progress;
|
||||
|
||||
$config->task->datatable->fieldList['deadline']['title'] = 'deadlineAB';
|
||||
$config->task->datatable->fieldList['deadline']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['deadline']['width'] = '65';
|
||||
$config->task->datatable->fieldList['deadline']['required'] = 'no';
|
||||
$config->task->datatable->fieldList['deadline']['control'] = 'date';
|
||||
|
||||
$config->task->datatable->fieldList['openedBy']['title'] = 'openedByAB';
|
||||
$config->task->datatable->fieldList['openedBy']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['openedBy']['width'] = '90';
|
||||
@@ -155,11 +146,6 @@ $config->task->datatable->fieldList['realStarted']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['realStarted']['width'] = '95';
|
||||
$config->task->datatable->fieldList['realStarted']['required'] = 'no';
|
||||
|
||||
$config->task->datatable->fieldList['assignedDate']['title'] = 'assignedDate';
|
||||
$config->task->datatable->fieldList['assignedDate']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['assignedDate']['width'] = '110';
|
||||
$config->task->datatable->fieldList['assignedDate']['required'] = 'no';
|
||||
|
||||
$config->task->datatable->fieldList['finishedDate']['title'] = 'finishedDateAB';
|
||||
$config->task->datatable->fieldList['finishedDate']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['finishedDate']['width'] = '105';
|
||||
@@ -191,19 +177,6 @@ $config->task->datatable->fieldList['closedReason']['width'] = '120';
|
||||
$config->task->datatable->fieldList['closedReason']['required'] = 'no';
|
||||
$config->task->datatable->fieldList['closedReason']['dataSource'] = array('lang' => 'reasonList');
|
||||
|
||||
$config->task->datatable->fieldList['story']['title'] = "storyAB";
|
||||
$config->task->datatable->fieldList['story']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['story']['width'] = '70';
|
||||
$config->task->datatable->fieldList['story']['required'] = 'no';
|
||||
$config->task->datatable->fieldList['story']['name'] = $lang->task->story;
|
||||
$config->task->datatable->fieldList['story']['control'] = 'select';
|
||||
$config->task->datatable->fieldList['story']['dataSource'] = array('module' => 'story', 'method' => 'getExecutionStories', 'params' => '$executionID', 'pairs' => array('id', 'title'));
|
||||
|
||||
$config->task->datatable->fieldList['mailto']['title'] = 'mailto';
|
||||
$config->task->datatable->fieldList['mailto']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['mailto']['width'] = '100';
|
||||
$config->task->datatable->fieldList['mailto']['required'] = 'no';
|
||||
|
||||
$config->task->datatable->fieldList['lastEditedBy']['title'] = 'lastEditedBy';
|
||||
$config->task->datatable->fieldList['lastEditedBy']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['lastEditedBy']['width'] = '95';
|
||||
@@ -219,6 +192,33 @@ $config->task->datatable->fieldList['activatedDate']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['activatedDate']['width'] = '90';
|
||||
$config->task->datatable->fieldList['activatedDate']['required'] = 'no';
|
||||
|
||||
$config->task->datatable->fieldList['story']['title'] = "storyAB";
|
||||
$config->task->datatable->fieldList['story']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['story']['width'] = '70';
|
||||
$config->task->datatable->fieldList['story']['required'] = 'no';
|
||||
$config->task->datatable->fieldList['story']['name'] = $lang->task->story;
|
||||
$config->task->datatable->fieldList['story']['control'] = 'select';
|
||||
$config->task->datatable->fieldList['story']['dataSource'] = array('module' => 'story', 'method' => 'getExecutionStories', 'params' => '$executionID', 'pairs' => array('id', 'title'));
|
||||
|
||||
$config->task->datatable->fieldList['mailto']['title'] = 'mailto';
|
||||
$config->task->datatable->fieldList['mailto']['fixed'] = 'no';
|
||||
$config->task->datatable->fieldList['mailto']['width'] = '100';
|
||||
$config->task->datatable->fieldList['mailto']['required'] = 'no';
|
||||
|
||||
$config->task->datatable->fieldList['module']['title'] = 'idAB';
|
||||
$config->task->datatable->fieldList['module']['control'] = 'select';
|
||||
$config->task->datatable->fieldList['module']['dataSource'] = array('module' => 'tree', 'method' => 'getTaskOptionMenu', 'params' => '$executionID');
|
||||
|
||||
$config->task->datatable->fieldList['execution']['title'] = 'idAB';
|
||||
$config->task->datatable->fieldList['execution']['control'] = 'hidden';
|
||||
$config->task->datatable->fieldList['execution']['dataSource'] = array('module' => 'execution', 'method' => 'getPairs');
|
||||
|
||||
$config->task->datatable->fieldList['mode']['title'] = 'idAB';
|
||||
$config->task->datatable->fieldList['mode']['control'] = 'hidden';
|
||||
|
||||
$config->task->datatable->fieldList['desc']['title'] = 'idAB';
|
||||
$config->task->datatable->fieldList['desc']['control'] = 'textarea';
|
||||
|
||||
$config->task->datatable->fieldList['actions']['title'] = 'actions';
|
||||
$config->task->datatable->fieldList['actions']['fixed'] = 'right';
|
||||
$config->task->datatable->fieldList['actions']['width'] = '180';
|
||||
|
||||
+28
-2
@@ -291,7 +291,22 @@ class task extends control
|
||||
/* Set Custom*/
|
||||
foreach(explode(',', $this->config->task->customCreateFields) as $field) $customFields[$field] = $this->lang->task->$field;
|
||||
|
||||
$executions = $this->config->systemMode == 'classic' ? $executions : $this->execution->getByProject($projectID, 'noclosed', 0, true);
|
||||
$executionAll = array();
|
||||
if(!empty($projectID))
|
||||
{
|
||||
$executionList = $this->execution->getByProject($projectID, 'noclosed', 0, true);
|
||||
$project = $this->loadModel('project')->getByID($projectID);
|
||||
$replace = substr(current($executionList), 0, strpos(current($executionList), '/'));
|
||||
if(isset($project->model) and $project->model == 'waterfall')
|
||||
{
|
||||
foreach($executionList as $key => $val)
|
||||
{
|
||||
$values = str_replace($replace, $project->name, $val);
|
||||
$executionAll[$key] = $values;
|
||||
}
|
||||
}
|
||||
}
|
||||
$executions = $this->config->systemMode == 'classic' ? $executions : $executionAll;
|
||||
|
||||
$testStoryIdList = $this->loadModel('story')->getTestStories(array_keys($stories), $execution->id);
|
||||
/* Stories that can be used to create test tasks. */
|
||||
@@ -1196,7 +1211,18 @@ class task extends control
|
||||
if(isonlybody()) $this->session->set('estimateList', $uri . (strpos($uri, '?') === false ? '?' : '&') . 'onlybody=yes', 'execution');
|
||||
|
||||
$task = $this->task->getById($taskID);
|
||||
if(!empty($task->team) and $task->mode == 'linear' and !$orderBy) $orderBy = 'order_asc';
|
||||
if(!empty($task->team) and $task->mode == 'linear')
|
||||
{
|
||||
if(empty($orderBy))
|
||||
{
|
||||
$orderBy = 'order_asc,id';
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The id sort with order or date style. */
|
||||
$orderBy .= preg_replace('/(order_|date_)/', ',id_', $orderBy);
|
||||
}
|
||||
}
|
||||
if(!$orderBy) $orderBy = 'date_asc';
|
||||
|
||||
$this->view->title = $this->lang->task->record;
|
||||
|
||||
@@ -392,11 +392,11 @@ function addItem(obj)
|
||||
}
|
||||
if($nextTr.find('.deadlineBox').length == 0)
|
||||
{
|
||||
$nextTr.find('.deadlineInput').after('<span class="input-group-addon deadlineBox"><input type="checkbox" name="deadlineDitto[]" id="deadlineDitto" checked/> ' + ditto + '</span>');
|
||||
$nextTr.find('.deadlineInput').after('<span class="input-group-addon deadlineBox"><input type="checkbox" name="deadlineDitto[' + index + ']" id="deadlineDitto" checked/> ' + ditto + '</span>');
|
||||
}
|
||||
if($nextTr.find('.estStartedBox').length == 0)
|
||||
{
|
||||
$nextTr.find('.startInput').after('<span class="input-group-addon estStartedBox"><input type="checkbox" name="estStartedDitto[] id="estStartedDitto" checked/> ' + ditto + '</span>');
|
||||
$nextTr.find('.startInput').after('<span class="input-group-addon estStartedBox"><input type="checkbox" name="estStartedDitto[' + index + '] id="estStartedDitto" checked/> ' + ditto + '</span>');
|
||||
}
|
||||
|
||||
if($nextTr.find('.deadlineBox').is(':hidden'))
|
||||
@@ -409,6 +409,7 @@ function addItem(obj)
|
||||
$nextTr.find('.estStartedBox').show();
|
||||
$nextTr.find(".estStartedBox input[type='checkBox']").attr('checked', true);
|
||||
}
|
||||
index ++;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -116,6 +116,7 @@ $lang->task->assignedTo = 'Zuständiger';
|
||||
$lang->task->assignedToAB = 'Zuständiger';
|
||||
$lang->task->assignedDate = 'Zugewisen am';
|
||||
$lang->task->openedBy = 'Ersteller';
|
||||
$lang->task->openedByAB = 'Created';
|
||||
$lang->task->openedDate = 'Erstellt am';
|
||||
$lang->task->openedDateAB = 'Hinzufügen';
|
||||
$lang->task->finishedBy = 'Abgeschlossen';
|
||||
|
||||
@@ -116,6 +116,7 @@ $lang->task->assignedTo = 'AssignTo';
|
||||
$lang->task->assignedToAB = 'AssignedTo';
|
||||
$lang->task->assignedDate = 'AssignedDate';
|
||||
$lang->task->openedBy = 'CreatedBy';
|
||||
$lang->task->openedByAB = 'Created';
|
||||
$lang->task->openedDate = 'CreatedDate';
|
||||
$lang->task->openedDateAB = 'CreatedOn';
|
||||
$lang->task->finishedBy = 'FinishedBy';
|
||||
|
||||
@@ -116,6 +116,7 @@ $lang->task->assignedTo = 'Affectée à';
|
||||
$lang->task->assignedToAB = 'Assigné à';
|
||||
$lang->task->assignedDate = 'Date Assign.';
|
||||
$lang->task->openedBy = 'Créé par';
|
||||
$lang->task->openedByAB = 'Créer';
|
||||
$lang->task->openedDate = 'Date création';
|
||||
$lang->task->openedDateAB = 'Date création';
|
||||
$lang->task->finishedBy = 'Terminé par';
|
||||
|
||||
@@ -116,6 +116,7 @@ $lang->task->assignedTo = '指派给';
|
||||
$lang->task->assignedToAB = '指派给';
|
||||
$lang->task->assignedDate = '指派日期';
|
||||
$lang->task->openedBy = '由谁创建';
|
||||
$lang->task->openedByAB = '创建者';
|
||||
$lang->task->openedDate = '创建日期';
|
||||
$lang->task->openedDateAB = '创建';
|
||||
$lang->task->finishedBy = '由谁完成';
|
||||
|
||||
+43
-20
@@ -29,7 +29,11 @@ class taskModel extends model
|
||||
}
|
||||
|
||||
$executionID = (int)$executionID;
|
||||
$estStarted = '0000-00-00';
|
||||
$deadline = '0000-00-00';
|
||||
$assignedTo = '';
|
||||
$taskIdList = array();
|
||||
$taskDatas = array();
|
||||
$taskFiles = array();
|
||||
$requiredFields = "," . $this->config->task->create->requiredFields . ",";
|
||||
|
||||
@@ -38,26 +42,31 @@ class taskModel extends model
|
||||
foreach($this->post->testStory as $i => $storyID)
|
||||
{
|
||||
if(empty($storyID)) continue;
|
||||
if($this->post->testEstStarted[$i] > $this->post->testDeadline[$i])
|
||||
{
|
||||
dao::$errors[] = "ID: $storyID {$this->lang->task->error->deadlineSmall}";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check required fields when create test task. */
|
||||
foreach($this->post->testStory as $i => $storyID)
|
||||
{
|
||||
if(empty($storyID)) continue;
|
||||
$estStarted = (!isset($this->post->testEstStarted[$i]) or (isset($this->post->estStartedDitto[$i]) and $this->post->estStartedDitto[$i] == 'on')) ? $estStarted : $this->post->testEstStarted[$i];
|
||||
$deadline = (!isset($this->post->testDeadline[$i]) or (isset($this->post->deadlineDitto[$i]) and $this->post->deadlineDitto[$i] == 'on')) ? $deadline : $this->post->testDeadline[$i];
|
||||
$assignedTo = (!isset($this->post->testAssignedTo[$i]) or $this->post->testAssignedTo[$i] == 'ditto') ? $assignedTo : $this->post->testAssignedTo[$i];
|
||||
|
||||
if($estStarted > $deadline)
|
||||
{
|
||||
dao::$errors[] = "ID: $storyID {$this->lang->task->error->deadlineSmall}";
|
||||
return false;
|
||||
}
|
||||
|
||||
$task = new stdclass();
|
||||
$task->pri = $this->post->testPri[$i];
|
||||
$task->estStarted = $this->post->testEstStarted[$i];
|
||||
$task->deadline = $this->post->testDeadline[$i];
|
||||
$task->assignedTo = $this->post->testAssignedTo[$i];
|
||||
$task->estStarted = $estStarted;
|
||||
$task->deadline = $deadline;
|
||||
$task->assignedTo = $assignedTo;
|
||||
$task->estimate = $this->post->testEstimate[$i];
|
||||
$task->left = $this->post->testEstimate[$i];
|
||||
|
||||
/* Check requiredFields */
|
||||
$this->dao->insert(TABLE_TASK)->data($task)->batchCheck($requiredFields, 'notempty');
|
||||
if(dao::isError())
|
||||
{
|
||||
@@ -67,6 +76,7 @@ class taskModel extends model
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$taskDatas[$i] = $task;
|
||||
}
|
||||
|
||||
$requiredFields = str_replace(",estimate,", ',', "$requiredFields");
|
||||
@@ -187,10 +197,6 @@ class taskModel extends model
|
||||
$this->loadModel('action');
|
||||
if($this->post->testStory)
|
||||
{
|
||||
$assignedTo = '';
|
||||
$testEstStarted = '0000-00-00';
|
||||
$testDeadline = '0000-00-00';
|
||||
|
||||
foreach($this->post->testStory as $storyID)
|
||||
{
|
||||
if($storyID) $testStoryIdList[$storyID] = $storyID;
|
||||
@@ -200,9 +206,9 @@ class taskModel extends model
|
||||
{
|
||||
if(!isset($testStories[$storyID])) continue;
|
||||
|
||||
$assignedTo = (!isset($this->post->testAssignedTo[$i]) or $this->post->testAssignedTo[$i] == 'ditto') ? $assignedTo : $this->post->testAssignedTo[$i];
|
||||
$testEstStarted = (!isset($this->post->testEstStarted[$i]) or (isset($this->post->estStartedDitto[$i]) and $this->post->estStartedDitto[$i] == 'on')) ? $testEstStarted : $this->post->testEstStarted[$i];
|
||||
$testDeadline = (!isset($this->post->testDeadline[$i]) or (isset($this->post->deadlineDitto[$i]) and $this->post->deadlineDitto[$i] == 'on')) ? $testDeadline : $this->post->testDeadline[$i];
|
||||
$assignedTo = $taskDatas[$i]->assignedTo;
|
||||
$testEstStarted = $taskDatas[$i]->estStarted;
|
||||
$testDeadline = $taskDatas[$i]->deadline;
|
||||
|
||||
$task->parent = $taskID;
|
||||
$task->story = $storyID;
|
||||
@@ -1059,7 +1065,7 @@ class taskModel extends model
|
||||
}
|
||||
|
||||
/* If a multiple task is assigned to a team member who is not the task, assign to the team member instead. */
|
||||
if(!$this->post->assignedTo and !empty($_POST['team'])) $_POST['assignedTo'] = $this->getAssignedTo4Multi($_POST['team'], $oldTask);
|
||||
if(!$this->post->assignedTo and !empty($oldTask->team) and !empty($_POST['team'])) $_POST['assignedTo'] = $this->getAssignedTo4Multi($_POST['team'], $oldTask);
|
||||
|
||||
/* When the selected parent task is a common task and has consumption, select other parent tasks. */
|
||||
if($this->post->parent > 0)
|
||||
@@ -2609,7 +2615,7 @@ class taskModel extends model
|
||||
->fi()
|
||||
->beginIF($type == 'assignedTo' and ($this->app->rawModule == 'my' or $this->app->rawModule == 'block'))->andWhere('t2.status', true)->ne('suspended')->orWhere('t4.status')->ne('suspended')->markRight(1)->fi()
|
||||
->beginIF($type != 'all' and $type != 'finishedBy' and $type != 'assignedTo')->andWhere("t1.`$type`")->eq($account)->fi()
|
||||
->beginIF($type == 'assignedTo')->andWhere("(t1.assignedTo = '{$account}' or (t1.mode = 'multi' and t5.`account` = '{$account}') )")->fi()
|
||||
->beginIF($type == 'assignedTo')->andWhere("(t1.assignedTo = '{$account}' or (t1.mode = 'multi' and t5.`account` = '{$account}' and t1.status != 'closed') )")->fi()
|
||||
->beginIF($type == 'assignedTo' and $this->app->rawModule == 'my' and $this->app->rawMethod == 'work')->andWhere('t1.status')->notin('closed,cancel,pause')->fi()
|
||||
->orderBy($orderBy)
|
||||
->beginIF($limit > 0)->limit($limit)->fi()
|
||||
@@ -2896,8 +2902,11 @@ class taskModel extends model
|
||||
public function updateEstimate($estimateID)
|
||||
{
|
||||
$oldEstimate = $this->getEstimateById($estimateID);
|
||||
$estimate = fixer::input('post')->cleanINT('consumed,left')->get();
|
||||
$today = helper::today();
|
||||
$estimate = fixer::input('post')
|
||||
->setIF(is_numeric($this->post->consumed), 'consumed', (float)$this->post->consumed)
|
||||
->setIF(is_numeric($this->post->left), 'left', (float)$this->post->left)
|
||||
->get();
|
||||
|
||||
if(helper::isZeroDate($estimate->date)) return dao::$errors[] = $this->lang->task->error->dateEmpty;
|
||||
if($estimate->date > $today) return dao::$errors[] = $this->lang->task->error->date;
|
||||
@@ -3768,7 +3777,7 @@ class taskModel extends model
|
||||
echo round($task->progress, 2) . '%';
|
||||
break;
|
||||
case 'deadline':
|
||||
if(substr($task->deadline, 0, 4) > 0) echo substr($task->deadline, 5, 6);
|
||||
if(substr($task->deadline, 0, 4) > 0) echo '<span>' . substr($task->deadline, 5, 6) . '</span>';
|
||||
break;
|
||||
case 'openedBy':
|
||||
echo zget($users, $task->openedBy);
|
||||
@@ -4140,10 +4149,24 @@ class taskModel extends model
|
||||
$storyChanged = !empty($task->storyStatus) && $task->storyStatus == 'active' && $task->latestStoryVersion > $task->storyVersion && !in_array($task->status, array('cancel', 'closed'));
|
||||
if($storyChanged) return $this->buildMenu('task', 'confirmStoryChange', $params, $task, 'browse', '', 'hiddenwin');
|
||||
|
||||
$canStart = ($task->status != 'pause' and common::hasPriv('task', 'start'));
|
||||
$canRestart = ($task->status == 'pause' and common::hasPriv('task', 'restart'));
|
||||
$canFinish = common::hasPriv('task', 'finish');
|
||||
$canClose = common::hasPriv('task', 'close');
|
||||
$canRecordEstimate = common::hasPriv('task', 'recordEstimate');
|
||||
$canEdit = common::hasPriv('task', 'edit');
|
||||
$canBatchCreate = ($this->config->vision == 'rnd' and common::hasPriv('task', 'batchCreate'));
|
||||
|
||||
if($task->status != 'pause') $menu .= $this->buildMenu('task', 'start', $params, $task, 'browse', '', '', 'iframe', true);
|
||||
if($task->status == 'pause') $menu .= $this->buildMenu('task', 'restart', $params, $task, 'browse', '', '', 'iframe', true);
|
||||
$menu .= $this->buildMenu('task', 'close', $params, $task, 'browse', '', '', 'iframe', true);
|
||||
$menu .= $this->buildMenu('task', 'finish', $params, $task, 'browse', '', '', 'iframe', true);
|
||||
$menu .= $this->buildMenu('task', 'close', $params, $task, 'browse', '', '', 'iframe', true);
|
||||
|
||||
if(($canStart or $canRestart or $canFinish or $canClose) and ($canRecordEstimate or $canEdit or $canBatchCreate))
|
||||
{
|
||||
$menu .= "<div class='dividing-line'></div>";
|
||||
}
|
||||
|
||||
$menu .= $this->buildMenu('task', 'recordEstimate', $params, $task, 'browse', 'time', '', 'iframe', true);
|
||||
$menu .= $this->buildMenu('task', 'edit', $params, $task, 'browse');
|
||||
if($this->config->vision == 'rnd')
|
||||
|
||||
@@ -136,25 +136,25 @@ foreach(explode(',', $config->task->create->requiredFields) as $field)
|
||||
<?php foreach($testStories as $storyID => $storyTitle):?>
|
||||
<?php if($i > 0) $members['ditto'] = $lang->task->ditto;?>
|
||||
<tr>
|
||||
<td><?php echo html::select("testStory[]", array($storyID => $storyTitle), $storyID, "class='form-control chosen'");?></td>
|
||||
<td><?php echo html::select("testPri[]", $lang->task->priList, $task->pri, "class='form-control chosen'");?></td>
|
||||
<td><?php echo html::select("testStory[$i]", array($storyID => $storyTitle), $storyID, "class='form-control chosen'");?></td>
|
||||
<td><?php echo html::select("testPri[$i]", $lang->task->priList, $task->pri, "class='form-control chosen'");?></td>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php
|
||||
echo html::input("testEstStarted[]", $task->estStarted, "class='startInput form-control form-date' onchange='hiddenDitto(this)' placeholder='{$lang->task->estStarted}'");
|
||||
if($i != 0) echo "<span class='input-group-addon estStartedBox'><input type='checkbox' name='estStartedDitto[]' id='estStartedDitto' " . ($i > 0 ? "checked" : '') . " /> {$lang->task->ditto}</span>";
|
||||
echo html::input("testEstStarted[$i]", $task->estStarted, "class='startInput form-control form-date' onchange='hiddenDitto(this)' placeholder='{$lang->task->estStarted}'");
|
||||
if($i != 0) echo "<span class='input-group-addon estStartedBox'><input type='checkbox' name='estStartedDitto[$i]' id='estStartedDitto' " . ($i > 0 ? "checked" : '') . " /> {$lang->task->ditto}</span>";
|
||||
?>
|
||||
</div>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php
|
||||
echo html::input("testDeadline[]", $task->deadline, "class='deadlineInput form-control form-date' onchange='hiddenDitto(this)' placeholder='{$lang->task->deadline}'");
|
||||
if($i != 0) echo "<span class='input-group-addon deadlineBox'><input type='checkbox' name='deadlineDitto[]' id='deadlineDitto' " . ($i > 0 ? "checked" : '') . " /> {$lang->task->ditto}</span>";
|
||||
echo html::input("testDeadline[$i]", $task->deadline, "class='deadlineInput form-control form-date' onchange='hiddenDitto(this)' placeholder='{$lang->task->deadline}'");
|
||||
if($i != 0) echo "<span class='input-group-addon deadlineBox'><input type='checkbox' name='deadlineDitto[$i]' id='deadlineDitto' " . ($i > 0 ? "checked" : '') . " /> {$lang->task->ditto}</span>";
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
<td><?php echo html::select("testAssignedTo[]", $members, $i == 0 ? $task->assignedTo : 'ditto', "class='form-control chosen'");?></td>
|
||||
<td><?php echo html::input("testEstimate[]", '', "class='form-control'");?></td>
|
||||
<td><?php echo html::select("testAssignedTo[$i]", $members, $i == 0 ? $task->assignedTo : 'ditto', "class='form-control chosen'");?></td>
|
||||
<td><?php echo html::input("testEstimate[$i]", '', "class='form-control'");?></td>
|
||||
<td class='text-center'>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-sm" tabindex="-1" onclick='addItem(this)'><i class="icon icon-plus"></i></button>
|
||||
@@ -165,6 +165,7 @@ foreach(explode(',', $config->task->create->requiredFields) as $field)
|
||||
<?php $i++;?>
|
||||
<?php if($i > 30) break;?>
|
||||
<?php endforeach;?>
|
||||
<?php js::set('index', $i);?>
|
||||
<?php unset($members['ditto']);?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -13,12 +13,15 @@ $this->app->loadLang('execution');
|
||||
$teamOrders = array();
|
||||
foreach($task->team as $team) $teamOrders[$team->order] = $team->account;
|
||||
|
||||
$myOrders = array();
|
||||
$allEfforts = array();
|
||||
$recorders = array();
|
||||
$index = 0;
|
||||
$allOrders = array();
|
||||
$efforts = array_values($efforts);
|
||||
$index = 0;
|
||||
$efforts = array_values($efforts);
|
||||
$recorders = array();
|
||||
$allOrders = array();
|
||||
$allEfforts = array();
|
||||
$myOrders = array();
|
||||
$myLastID = array();
|
||||
$myEfforts = array();
|
||||
$myLastOrder = 0;
|
||||
foreach($efforts as $key => $effort)
|
||||
{
|
||||
$prevEffort = $key > 0 ? $efforts[$key - 1] : null;
|
||||
@@ -27,12 +30,15 @@ foreach($efforts as $key => $effort)
|
||||
|
||||
$allEfforts[$order][] = $effort;
|
||||
$recorders[$order][$account] = $account;
|
||||
|
||||
$allOrders[$order] = $effort->order + 1;
|
||||
if($app->user->account == $account)
|
||||
{
|
||||
if(!isset($myOrders[$order])) $myOrders[$order] = 0;
|
||||
$myOrders[$order] += 1;
|
||||
if($allOrders[$myLastOrder] != $effort->order + 1) $myLastOrder = $order;
|
||||
$myOrders[$myLastOrder] = isset($myOrders[$myLastOrder]) ? ++$myOrders[$myLastOrder] : 1;
|
||||
$myLastID[$myLastOrder] = isset($myLastID[$myLastOrder]) ? ($myLastID[$myLastOrder] < $effort->id ? $effort->id : $myLastID[$myLastOrder]) : $effort->id;
|
||||
$myEfforts[$myLastOrder][] = $effort;
|
||||
}
|
||||
$allOrders[$order] = $effort->order + 1;
|
||||
}
|
||||
?>
|
||||
<div id='linearefforts'>
|
||||
@@ -65,8 +71,7 @@ foreach($efforts as $key => $effort)
|
||||
<tbody>
|
||||
<?php foreach($myOrders as $order => $count):?>
|
||||
<?php $showOrder = false;?>
|
||||
<?php $index = 1;?>
|
||||
<?php foreach($allEfforts[$order] as $effort):?>
|
||||
<?php foreach($myEfforts[$order] as $effort):?>
|
||||
<?php if($effort->account != $this->app->user->account) continue;?>
|
||||
<tr class="text-center">
|
||||
<?php if(!$showOrder):?>
|
||||
@@ -83,12 +88,11 @@ foreach($efforts as $key => $effort)
|
||||
$canOperateEffort = $this->task->canOperateEffort($task, $effort);
|
||||
common::printIcon($this->config->edition == 'open' ? 'task' : 'effort', $this->config->edition == 'open' ? 'editEstimate' : 'edit', "effortID=$effort->id", '', 'list', 'edit', '', 'showinonlybody', true, $canOperateEffort ? '' : 'disabled');
|
||||
$deleteDisable = false;
|
||||
if(!$canOperateEffort or ($index == $count and $effort->left == 0)) $deleteDisable = true;
|
||||
if(!$canOperateEffort or ($myLastID[$order] == $effort->id and $effort->left == 0)) $deleteDisable = true;
|
||||
common::printIcon($this->config->edition == 'open' ? 'task' : 'effort', $this->config->edition == 'open' ? 'deleteEstimate' : 'delete', "effortID=$effort->id", '', 'list', 'trash', 'hiddenwin', 'showinonlybody', false, $deleteDisable ? 'disabled' : '');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $index ++;?>
|
||||
<?php endforeach;?>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
@@ -111,7 +115,6 @@ foreach($efforts as $key => $effort)
|
||||
<tbody>
|
||||
<?php foreach($recorders as $order => $accounts):?>
|
||||
<?php $showOrder = false;?>
|
||||
<?php $index = 1;?>
|
||||
<?php $count = count($allEfforts[$order]);?>
|
||||
<?php foreach($allEfforts[$order] as $effort):?>
|
||||
<tr class="text-center">
|
||||
@@ -125,7 +128,6 @@ foreach($efforts as $key => $effort)
|
||||
<td title="<?php echo $effort->consumed . ' ' . $lang->execution->workHour;?>"><?php echo $effort->consumed . ' ' . $lang->execution->workHourUnit;?></td>
|
||||
<td title="<?php echo $effort->left . ' ' . $lang->execution->workHour;?>"><?php echo $effort->left . ' ' . $lang->execution->workHourUnit;?></td>
|
||||
</tr>
|
||||
<?php $index ++;?>
|
||||
<?php endforeach;?>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user