* Fix code error.
This commit is contained in:
@@ -230,3 +230,18 @@ $config->task->datatable->fieldList['actions']['title'] = 'actions';
|
||||
$config->task->datatable->fieldList['actions']['fixed'] = 'right';
|
||||
$config->task->datatable->fieldList['actions']['width'] = '180';
|
||||
$config->task->datatable->fieldList['actions']['required'] = 'yes';
|
||||
|
||||
$config->task->create->template = new stdclass();
|
||||
$config->task->create->template->module = 0;
|
||||
$config->task->create->template->mode = '';
|
||||
$config->task->create->template->assignedTo = '';
|
||||
$config->task->create->template->name = '';
|
||||
$config->task->create->template->story = 0;
|
||||
$config->task->create->template->type = '';
|
||||
$config->task->create->template->pri = 3;
|
||||
$config->task->create->template->estimate = '';
|
||||
$config->task->create->template->desc = '';
|
||||
$config->task->create->template->estStarted = null;
|
||||
$config->task->create->template->deadline = null;
|
||||
$config->task->create->template->mailto = '';
|
||||
$config->task->create->template->color = '';
|
||||
|
||||
@@ -42,6 +42,10 @@ class task extends control
|
||||
*/
|
||||
public function create(string $executionID = '0', string $storyID = '0', string $moduleID = '0', string $taskID = '0', string $todoID = '0', string $extra = '', string $bugID = '0')
|
||||
{
|
||||
/* Analytic parameter. */
|
||||
$extra = str_replace(array(',', ' '), array('&', ''), $extra);
|
||||
parse_str($extra, $output);
|
||||
|
||||
/* If you do not have permission to access any execution, go to the create execution page. */
|
||||
if(empty($this->app->user->view->sprints) and !$executionID) $this->locate($this->createLink('execution', 'create'));
|
||||
|
||||
@@ -85,9 +89,7 @@ class task extends control
|
||||
}
|
||||
|
||||
/* Shows the variables needed to create the task page. */
|
||||
$this->taskZen->showCreateVars($execution, $storyID, $moduleID, $taskID, $todoID, $bugID, $extra);
|
||||
|
||||
$this->display();
|
||||
$this->taskZen->showCreateVars($execution, $storyID, $moduleID, $taskID, $todoID, $bugID, $output);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1706,7 +1708,7 @@ class task extends control
|
||||
|
||||
/* Get related objects title or names. */
|
||||
$relatedStories = $this->dao->select('id,title')->from(TABLE_STORY)->where('id')->in($relatedStoryIdList)->fetchPairs();
|
||||
$relatedFiles = $this->dao->select('id, objectID, pathname, title')->from(TABLE_FILE)->where('objectType')->eq('task')->andWhere('objectID')->in(@array_keys($tasks))->andWhere('extra')->ne('editor')->fetchGroup('objectID');
|
||||
$relatedFiles = $this->dao->select('id, objectID, pathname, title')->from(TABLE_FILE)->where('objectType')->eq('task')->andWhere('objectID')->in(array_keys($tasks))->andWhere('extra')->ne('editor')->fetchGroup('objectID');
|
||||
$relatedModules = $this->loadModel('tree')->getAllModulePairs('task');
|
||||
|
||||
if($tasks)
|
||||
|
||||
+8
-12
@@ -147,9 +147,7 @@ class taskModel extends model
|
||||
$this->loadModel('score');
|
||||
$this->loadModel('action');
|
||||
$this->loadModel('kanban');
|
||||
$now = helper::now();
|
||||
$mails = array();
|
||||
$preStory = 0;
|
||||
$mails = array();
|
||||
|
||||
/* 运营管理界面移除泳道和泳道列。 */
|
||||
if($this->config->vision == 'lite')
|
||||
@@ -562,7 +560,7 @@ class taskModel extends model
|
||||
{
|
||||
$efforts = $this->getTaskEfforts($taskID);
|
||||
$doingUsers = array();
|
||||
foreach($efforts as $i => $effort)
|
||||
foreach($efforts as $effort)
|
||||
{
|
||||
if($effort->left != 0) $doingUsers[$effort->account] = $effort->account;
|
||||
if($effort->left == 0) unset($doingUsers[$effort->account]);
|
||||
@@ -816,7 +814,7 @@ class taskModel extends model
|
||||
if($this->post->team and count(array_filter($this->post->team)) > 1)
|
||||
{
|
||||
$teams = $this->manageTaskTeam($oldTask->mode, $taskID, $task->status);
|
||||
if(!empty($teams)) $task = $this->computeHours4Multiple($oldTask, $task, array(), $autoStatus = false);
|
||||
if(!empty($teams)) $task = $this->computeHours4Multiple($oldTask, $task, array(), false);
|
||||
}
|
||||
if(empty($teams)) $task->mode = '';
|
||||
|
||||
@@ -1059,7 +1057,7 @@ class taskModel extends model
|
||||
foreach($extendFields as $extendField)
|
||||
{
|
||||
$task->{$extendField->field} = $this->post->{$extendField->field}[$taskID];
|
||||
if(is_array($task->{$extendField->field})) $task->{$extendField->field} = join(',', $task->{$extendField->field});
|
||||
if(is_array($task->{$extendField->field})) $task->{$extendField->field} = implode(',', $task->{$extendField->field});
|
||||
|
||||
$task->{$extendField->field} = htmlSpecialString($task->{$extendField->field});
|
||||
}
|
||||
@@ -1447,7 +1445,7 @@ class taskModel extends model
|
||||
{
|
||||
$task->status = 'done';
|
||||
$task->finishedBy = $this->app->user->account;
|
||||
$task->finishedDate = $task->finishedDate;
|
||||
$task->finishedDate = $now;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1503,7 +1501,7 @@ class taskModel extends model
|
||||
foreach($record->dates as $id => $item) if($item > $today) dao::$errors[] = 'ID #' . $id . ' ' . $this->lang->task->error->date;
|
||||
if(dao::isError()) return false;
|
||||
|
||||
$task = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($taskID)->fetch();;
|
||||
$task = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($taskID)->fetch();
|
||||
$task->team = $this->dao->select('*')->from(TABLE_TASKTEAM)->where('task')->eq($taskID)->orderBy('order')->fetchAll('id');
|
||||
|
||||
/* Check if the current user is in the team. */
|
||||
@@ -1548,8 +1546,7 @@ class taskModel extends model
|
||||
|
||||
$this->loadModel('action');
|
||||
|
||||
$allChanges = array();;
|
||||
$left = $task->left;
|
||||
$allChanges = array();
|
||||
$now = helper::now();
|
||||
$oldStatus = $task->status;
|
||||
$lastDate = $this->dao->select('*')->from(TABLE_EFFORT)->where('objectID')->eq($taskID)->andWhere('objectType')->eq('task')->orderBy('date_desc,id_desc')->limit(1)->fetch('date');
|
||||
@@ -1580,7 +1577,7 @@ class taskModel extends model
|
||||
$currentTeam = $this->getTeamByAccount($task->team, $this->app->user->account, $extra);
|
||||
}
|
||||
|
||||
if($newTask->left == 0 and ((empty($currentTeam) and strpos('done,cancel,closed', $task->status) === false) or (!empty($currentTeam) and $currentTeam->status != 'done')))
|
||||
if(!$newTask->left and ((empty($currentTeam) and in_array($task->status, array('done', 'cancel', 'closed'))) or (!empty($currentTeam) and $currentTeam->status != 'done')))
|
||||
{
|
||||
$newTask->status = 'done';
|
||||
$newTask->assignedTo = $task->openedBy;
|
||||
@@ -1686,7 +1683,6 @@ class taskModel extends model
|
||||
|
||||
$oldTask = $this->getById($taskID);
|
||||
$now = helper::now();
|
||||
$today = helper::today();
|
||||
|
||||
if($extra != 'DEVOPS' and strpos($this->config->task->finish->requiredFields, 'comment') !== false and !$this->post->comment)
|
||||
{
|
||||
|
||||
+30
-60
@@ -294,53 +294,20 @@ class taskZen extends task
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化任务信息。
|
||||
* Initialize task information.
|
||||
* 通过传入的对象ID设置任务信息。
|
||||
* Set task information through the incoming object ID.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @param int $moduleID
|
||||
* @param int $taskID
|
||||
* @param int $todoID
|
||||
* @param int $bugID
|
||||
* @access protected
|
||||
* @return object
|
||||
*/
|
||||
protected function initTaskData(int $storyID, int $moduleID, int $taskID, int $todoID, int $bugID): object
|
||||
{
|
||||
/* Init task data. */
|
||||
$task = new stdClass();
|
||||
$task->module = 0;
|
||||
$task->mode = '';
|
||||
$task->assignedTo = '';
|
||||
$task->name = '';
|
||||
$task->story = 0;
|
||||
$task->type = '';
|
||||
$task->pri = 3;
|
||||
$task->estimate = '';
|
||||
$task->desc = '';
|
||||
$task->estStarted = null;
|
||||
$task->deadline = null;
|
||||
$task->mailto = '';
|
||||
$task->color = '';
|
||||
|
||||
return $this->setTaskInfoByObjectID($task, $storyID, $moduleID, $taskID, $todoID, $bugID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过传入的对象ID初始化任务信息。
|
||||
* Set task information by incoming object id.
|
||||
*
|
||||
* @param object $task
|
||||
* @param int $storyID
|
||||
* @param int $moduleID
|
||||
* @param int $taskID
|
||||
* @param int $todoID
|
||||
* @param int $bugID
|
||||
* @access protected
|
||||
* @access private
|
||||
* @return object
|
||||
*/
|
||||
protected function setTaskInfoByObjectID(object $task, int $storyID, int $moduleID, int $taskID, int $todoID, int $bugID): object
|
||||
private function setTaskInfoByObjectID(int $storyID, int $moduleID, int $taskID, int $todoID, int $bugID): object
|
||||
{
|
||||
$task = $config->task->create->template;
|
||||
$task->module = $moduleID;
|
||||
|
||||
/* If exist task, copy task information by task id. */
|
||||
@@ -392,17 +359,18 @@ class taskZen extends task
|
||||
* 展示看板相关变量。
|
||||
* Show related variable about the Kanban.
|
||||
*
|
||||
* @param array $output
|
||||
* @access protected
|
||||
* @param int $executionID
|
||||
* @param array $output
|
||||
* @access private
|
||||
* @return void
|
||||
*/
|
||||
protected function showKanbanRelatedVars(array $output): void
|
||||
private function showKanbanRelatedVars(int $executionID, array $output): void
|
||||
{
|
||||
$this->loadModel('kanban');
|
||||
|
||||
$regionID = isset($output['regionID']) ? (int)$output['regionID'] : 0;
|
||||
$laneID = isset($output['laneID']) ? (int)$output['laneID'] : 0;
|
||||
$regionPairs = $this->kanban->getRegionPairs($execution->id, 0, 'execution');
|
||||
$regionPairs = $this->kanban->getRegionPairs($executionID, 0, 'execution');
|
||||
$regionID = $regionID ? $regionID : key($regionPairs);
|
||||
$lanePairs = $this->kanban->getLanePairsByRegion($regionID, 'task');
|
||||
$laneID = $laneID ? $laneID : key($lanePairs);
|
||||
@@ -414,13 +382,13 @@ class taskZen extends task
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置地盘待处理区块的ID。
|
||||
* Set the ID of the block to be processed on the my.
|
||||
* 展示地盘待处理区块的ID。
|
||||
* Show the ID of the block to be processed on the my.
|
||||
*
|
||||
* @access protected
|
||||
* @access private
|
||||
* @return void
|
||||
*/
|
||||
protected function setAssignedToMeBlockID(): void
|
||||
private function showAssignedToMeBlockID(): void
|
||||
{
|
||||
/* Get block id of assinge to me. */
|
||||
$blockID = 0;
|
||||
@@ -438,14 +406,14 @@ class taskZen extends task
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置执行相关数据。
|
||||
* Set execution related data.
|
||||
* 展示执行相关数据。
|
||||
* Show execution related data.
|
||||
*
|
||||
* @param object $execution
|
||||
* @access protected
|
||||
* @access private
|
||||
* @return void
|
||||
*/
|
||||
protected function setExecutionData(object $execution): void
|
||||
private function showExecutionData(object $execution): void
|
||||
{
|
||||
$projectID = $execution ? $execution->project : 0;
|
||||
$lifetimeList = array();
|
||||
@@ -795,26 +763,26 @@ class taskZen extends task
|
||||
* @param int $taskID
|
||||
* @param int $todoID
|
||||
* @param int $bugID
|
||||
* @param string $extra
|
||||
* @param array $output
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function showCreateVars(object $execution, int $storyID, int $moduleID, int $taskID, int $todoID, int $bugID, string $extra)
|
||||
protected function showCreateVars(object $execution, int $storyID, int $moduleID, int $taskID, int $todoID, int $bugID, array $output): void
|
||||
{
|
||||
$extra = str_replace(array(',', ' '), array('&', ''), $extra);
|
||||
parse_str($extra, $output);
|
||||
|
||||
/* Get information about the task. */
|
||||
$executionID = $execution->id;
|
||||
$task = $this->initTaskData($storyID, $moduleID, $taskID, $todoID, $bugID);
|
||||
$task = $this->setTaskInfoByObjectID($storyID, $moduleID, $taskID, $todoID, $bugID);
|
||||
|
||||
/* Get module information. */
|
||||
$showAllModule = isset($this->config->execution->task->allModule) ? $this->config->execution->task->allModule : '';
|
||||
$moduleOptionMenu = $this->tree->getTaskOptionMenu($executionID, 0, 0, $showAllModule ? 'allModule' : '');
|
||||
if(!$storyID and !isset($moduleOptionMenu[$task->module])) $task->module = 0;
|
||||
|
||||
$this->setAssignedToMeBlockID();
|
||||
$this->setExecutionData($execution);
|
||||
/* Display relevant variables. */
|
||||
$this->showAssignedToMeBlockID();
|
||||
$this->showExecutionData($execution);
|
||||
$this->showStoryVars($executionID);
|
||||
if($execution->type == 'kanban') $this->taskZen->showKanbanRelatedVars($output);
|
||||
if($execution->type == 'kanban') $this->showKanbanRelatedVars($executionID, $output);
|
||||
|
||||
/* Set Custom fields. */
|
||||
foreach(explode(',', $this->config->task->customCreateFields) as $field) $customFields[$field] = $this->lang->task->$field;
|
||||
@@ -828,6 +796,8 @@ class taskZen extends task
|
||||
$this->view->execution = $execution;
|
||||
$this->view->task = $task;
|
||||
$this->view->storyID = $storyID;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -929,7 +899,7 @@ class taskZen extends task
|
||||
protected function buildBatchCreateForm(object $execution, int $storyID, int $moduleID, int $taskID, array $output): void
|
||||
{
|
||||
/* 获取区域和泳道下拉数据,并设置区域和泳道的默认值。*/
|
||||
if($execution->type == 'kanban') $this->taskZen->showKanbanRelatedVars($output);
|
||||
if($execution->type == 'kanban') $this->taskZen->showKanbanRelatedVars($execution->id, $output);
|
||||
|
||||
/* 任务拆解。 */
|
||||
if($taskID)
|
||||
|
||||
Reference in New Issue
Block a user