From b659e51f37f8da6ca9ad3cf14d1de39db8335698 Mon Sep 17 00:00:00 2001 From: Wenrui LI Date: Wed, 12 Jan 2022 09:09:50 +0800 Subject: [PATCH 1/6] * tweak assignToMe block for lite vision, task #47138. --- .../block/ext/view/printassigntomeblock.lite.html.hook.php | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 extension/lite/block/ext/view/printassigntomeblock.lite.html.hook.php diff --git a/extension/lite/block/ext/view/printassigntomeblock.lite.html.hook.php b/extension/lite/block/ext/view/printassigntomeblock.lite.html.hook.php new file mode 100644 index 0000000000..d0992c9834 --- /dev/null +++ b/extension/lite/block/ext/view/printassigntomeblock.lite.html.hook.php @@ -0,0 +1,3 @@ + From 2be74edf4d3336cf69a031b2b0788eb7b52f4a66 Mon Sep 17 00:00:00 2001 From: Wenrui LI Date: Wed, 12 Jan 2022 14:05:27 +0800 Subject: [PATCH 2/6] * tweak project list block for lite vision, task #47140. --- extension/lite/block/ext/view/main.lite.html.hook.php | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 extension/lite/block/ext/view/main.lite.html.hook.php diff --git a/extension/lite/block/ext/view/main.lite.html.hook.php b/extension/lite/block/ext/view/main.lite.html.hook.php new file mode 100644 index 0000000000..9ac355ac44 --- /dev/null +++ b/extension/lite/block/ext/view/main.lite.html.hook.php @@ -0,0 +1,4 @@ + From 84ce58756388753524942a8d700cb26b2be0e48e Mon Sep 17 00:00:00 2001 From: Wenrui LI Date: Wed, 12 Jan 2022 14:29:01 +0800 Subject: [PATCH 3/6] * tweak my/task for lite vision, task #47143. --- extension/lite/common/ext/lang/zh-cn/lite.php | 2 +- extension/lite/my/ext/view/task.html.php | 319 ++++++++++++++++++ 2 files changed, 320 insertions(+), 1 deletion(-) create mode 100644 extension/lite/my/ext/view/task.html.php diff --git a/extension/lite/common/ext/lang/zh-cn/lite.php b/extension/lite/common/ext/lang/zh-cn/lite.php index 95e0dfb6ba..f3d07a2aa5 100644 --- a/extension/lite/common/ext/lang/zh-cn/lite.php +++ b/extension/lite/common/ext/lang/zh-cn/lite.php @@ -12,7 +12,7 @@ $lang->mainNav->menuOrder[65] = 'admin'; $lang->my->menu = new stdclass(); $lang->my->menu->index = array('link' => "$lang->dashboard|my|index"); $lang->my->menu->calendar = array('link' => "$lang->calendar|my|calendar|", 'subModule' => 'todo', 'alias' => 'todo'); -$lang->my->menu->task = array('link' => "{$lang->task->common}|my|task|", 'subModule' => 'task'); +$lang->my->menu->task = array('link' => "{$lang->task->common}|my|contribute|mode=task&type=assignedTo", 'subModule' => 'task'); /* My menu order. */ $lang->my->menuOrder = array(); diff --git a/extension/lite/my/ext/view/task.html.php b/extension/lite/my/ext/view/task.html.php new file mode 100644 index 0000000000..b240a99e6d --- /dev/null +++ b/extension/lite/my/ext/view/task.html.php @@ -0,0 +1,319 @@ + + * @package dashboard + * @version $Id: task.html.php 5101 2013-07-12 00:44:27Z chencongzhi520@gmail.com $ + * @link http://www.zentao.net + */ +?> +app->getModuleRoot() . '/common/view/header.html.php';?> + +recTotal);?> +rawMethod);?> + +
+ +
+

task->noTask;?>

+
+ +
+ + + + + + + + + + systemMode == 'new'):?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + systemMode == 'new'):?> + + + + + + + + + + + + + + + + + + + + children)):?> + + children as $key => $child):?> + + children)) ? ' table-child-bottom' : '';?> + + + + + systemMode == 'new'):?> + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + idAB);?> +
priAB);?>task->name);?>my->projects);?>my->executions);?>openedByAB);?>task->deadlineAB);?>task->assignedTo);?>task->finishedBy);?>task->estimateAB);?>task->consumedAB);?>task->leftAB);?>statusAB);?>actions;?>
+ +
+ /> + +
+ + id);?> +
pri;?>' title='task->priList, $task->pri);?>'>task->priList, $task->pri);?>' title='name?>'> + team)) echo '' . $this->lang->task->multipleAB . ' ';?> + parent > 0) + { + echo '' . $this->lang->task->childrenAB . ' ' . html::a($this->createLink('task', 'view', "taskID=$task->id", '', '', $task->project), $task->parentName . ' / '. $task->name, '', "title='{$task->parentName} / {$task->name}'"); + } + else + { + echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', '', $task->project), $task->name, null, "style='color: $task->color'"); + } + ?> + children)) echo '';?> + createLink('project', 'index', "projectID=$task->project"), $task->projectName);?>createLink('execution', 'task', "executionID=$task->execution"), $task->executionName, '');?>openedBy);?>deadline, 0, 4) > 0) echo substr($task->deadline, 5, 6);?> task->printAssignedHtml($task, $users);?>finishedBy);?>estimate, 1) . $lang->execution->workHourUnit;?>consumed, 1) . $lang->execution->workHourUnit;?>left, 1) . $lang->execution->workHourUnit;?> + storyStatus) and $task->storyStatus == 'active' and $task->latestStoryVersion > $task->storyVersion and !in_array($task->status, array('cancel', 'closed')));?> + {$this->lang->my->storyChanged}") : print(" " . $this->processStatus('task', $task) . "");?> + + needConfirm) + { + $this->lang->task->confirmStoryChange = $this->lang->confirm; + common::printIcon('task', 'confirmStoryChange', "taskid=$task->id", '', 'list', '', 'hiddenwin', '', '', '', '', $task->project); + } + else + { + if($task->status != 'pause') common::printIcon('task', 'start', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, '', '', $task->project); + if($task->status == 'pause') common::printIcon('task', 'restart', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, '', '', $task->project); + common::printIcon('task', 'close', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, '', '', $task->project); + common::printIcon('task', 'finish', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, '', '', $task->project); + + common::printIcon('task', 'recordEstimate', "taskID=$task->id", $task, 'list', 'time', '', 'iframe', true, '', '', $task->project); + common::printIcon('task', 'edit', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, "data-width='95%'", '', $task->project); + common::printIcon('task', 'batchCreate', "executionID=$task->execution&storyID=$task->story&moduleID=$task->module&taskID=$task->id&ifame=true", $task, 'list', 'split', '', 'iframe', true, "data-width='95%'", $this->lang->task->children, $task->project); + } + } + ?> +
+ +
+ /> + +
+ + id);?> +
pri;?>' title='task->priList, $child->pri);?>'>task->priList, $child->pri);?> + parent > 0) echo '' . $this->lang->task->childrenAB . ' ';?> + createLink('task', 'view', "taskID=$child->id", '', '', $child->project), $child->name, null, "style='color: $child->color'");?> + createLink('project', 'view', "projectID=$child->project"), $child->projectName);?>createLink('execution', 'task', "executionID=$child->project"), $child->executionName, '');?>openedBy);?>deadline, 0, 4) > 0) echo substr($child->deadline, 5, 6);?> task->printAssignedHtml($child, $users);?>finishedBy);?>estimate, 1) . ' ' . $lang->execution->workHourUnit;?>consumed, 1) . ' ' . $lang->execution->workHourUnit;?>left, 1) . ' ' . $lang->execution->workHourUnit;?> + storyStatus) and $child->storyStatus == 'active' and $child->latestStoryVersion > $child->storyVersion and !in_array($child->status, array('cancel', 'closed')));?> + {$this->lang->my->storyChanged}") : print(" " . $this->processStatus('task', $child) . "");?> + + needConfirm) + { + $this->lang->task->confirmStoryChange = $this->lang->confirm; + common::printIcon('task', 'confirmStoryChange', "taskid=$child->id", '', 'list', '', 'hiddenwin', '', '', '', '', $child->project); + } + else + { + if($child->status != 'pause') common::printIcon('task', 'start', "taskID=$child->id", $child, 'list', '', '', 'iframe', true, '', '', $child->project); + if($child->status == 'pause') common::printIcon('task', 'restart', "taskID=$child->id", $child, 'list', '', '', 'iframe', true, '', '', $child->project); + common::printIcon('task', 'close', "taskID=$child->id", $child, 'list', '', '', 'iframe', true, '', '', $child->project); + common::printIcon('task', 'finish', "taskID=$child->id", $child, 'list', '', '', 'iframe', true, '', '', $child->project); + + common::printIcon('task', 'recordEstimate', "taskID=$child->id", $child, 'list', 'time', '', 'iframe', true, '', '', $child->project); + common::printIcon('task', 'edit', "taskID=$child->id", $child, 'list', '', '', '', '', '', '', $child->project); + common::printIcon('task', 'batchCreate', "executionID=$child->execution&storyID=$child->story&moduleID=$child->module&taskID=$child->id&iframe=true", $child, 'list', 'split', '', 'iframe', true, '', $this->lang->task->children, $child->project); + } + } + ?> +
+ +
+ +
+ + +app->getModuleRoot() . '/common/view/footer.html.php';?> From fb0c6444c67ea1ae9886ceffec9d5b198b1a081a Mon Sep 17 00:00:00 2001 From: Wenrui LI Date: Wed, 12 Jan 2022 14:36:01 +0800 Subject: [PATCH 4/6] * add vision for tasks. --- db/update16.1.sql | 1 + db/zentao.sql | 1 + 2 files changed, 2 insertions(+) diff --git a/db/update16.1.sql b/db/update16.1.sql index c22e0238a8..fdde99425c 100644 --- a/db/update16.1.sql +++ b/db/update16.1.sql @@ -1 +1,2 @@ ALTER TABLE `zt_project` ADD `vision` varchar(10) NOT NULL DEFAULT 'common' AFTER `order`; +ALTER TABLE `zt_task` ADD `vision` varchar(10) NOT NULL DEFAULT 'common' AFTER `v2`; diff --git a/db/zentao.sql b/db/zentao.sql index 71d6b5a28f..157128fa12 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -1370,6 +1370,7 @@ CREATE TABLE IF NOT EXISTS `zt_task` ( `lines` varchar(10) NOT NULL, `v1` varchar(40) NOT NULL, `v2` varchar(40) NOT NULL, + `vision` varchar(10) NOT NULL DEFAULT 'common', `deleted` enum('0','1') NOT NULL default '0', PRIMARY KEY (`id`), KEY `execution` (`execution`), From 7f0f0fa2eb0d315152e245254a898928aed252e3 Mon Sep 17 00:00:00 2001 From: Wenrui LI Date: Wed, 12 Jan 2022 14:44:08 +0800 Subject: [PATCH 5/6] * check for vision when querying tasks. --- module/task/model.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/task/model.php b/module/task/model.php index e1116c3b5a..2a4d661e34 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -2150,6 +2150,7 @@ class taskModel extends model ->leftJoin(TABLE_STORY)->alias('t3')->on('t1.story = t3.id') ->leftJoin(TABLE_PROJECT)->alias('t4')->on("t1.project = t4.id") ->where('t1.deleted')->eq(0) + ->beginIF($this->config->vision)->andWhere('t1.vision')->eq($this->config->vision)->fi() ->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('t1.status')->ne('closed')->fi() ->beginIF($projectID)->andWhere('t1.project')->eq($projectID)->fi() ->beginIF($type == 'finishedBy') @@ -2197,6 +2198,7 @@ class taskModel extends model ->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.execution = t2.id') ->where('t1.assignedTo')->eq($account) ->andWhere('t1.deleted')->eq(0) + ->beginIF($this->config->vision)->andWhere('t1.vision')->eq($this->config->vision)->fi() ->beginIF($status != 'all')->andWhere('t1.status')->in($status)->fi() ->beginIF(!empty($skipExecutionIDList))->andWhere('t1.execution')->notin($skipExecutionIDList)->fi() ->query(); @@ -2227,6 +2229,7 @@ class taskModel extends model ->orWhere('t3.status')->eq('suspended') ->markRight(1) ->andWhere('t1.deleted')->eq(0) + ->beginIF($this->config->vision)->andWhere('t1.vision')->eq($this->config->vision)->fi() ->andWhere('t2.deleted')->eq(0) ->beginIF($this->config->systemMode == 'new')->andWhere('t3.deleted')->eq(0)->fi() ->fetchAll('id'); From bee665aeaaaa96807d26c95f1d16a88886606278 Mon Sep 17 00:00:00 2001 From: Wenrui LI Date: Wed, 12 Jan 2022 15:48:54 +0800 Subject: [PATCH 6/6] * add vision field for task creation. --- extension/lite/task/ext/view/batchcreate.lite.html.hook.php | 6 ++++++ extension/lite/task/ext/view/create.lite.html.hook.php | 6 ++++++ module/task/model.php | 1 + 3 files changed, 13 insertions(+) create mode 100644 extension/lite/task/ext/view/batchcreate.lite.html.hook.php create mode 100644 extension/lite/task/ext/view/create.lite.html.hook.php diff --git a/extension/lite/task/ext/view/batchcreate.lite.html.hook.php b/extension/lite/task/ext/view/batchcreate.lite.html.hook.php new file mode 100644 index 0000000000..44c6f727db --- /dev/null +++ b/extension/lite/task/ext/view/batchcreate.lite.html.hook.php @@ -0,0 +1,6 @@ + diff --git a/extension/lite/task/ext/view/create.lite.html.hook.php b/extension/lite/task/ext/view/create.lite.html.hook.php new file mode 100644 index 0000000000..5b499a0677 --- /dev/null +++ b/extension/lite/task/ext/view/create.lite.html.hook.php @@ -0,0 +1,6 @@ + diff --git a/module/task/model.php b/module/task/model.php index 2a4d661e34..2095d2b8c0 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -316,6 +316,7 @@ class taskModel extends model $data[$i]->openedBy = $this->app->user->account; $data[$i]->openedDate = $now; $data[$i]->parent = $tasks->parent[$i]; + $data[$i]->vision = isset($tasks->vision[$i]) ? $tasks->vision[$i] : 'common'; if($story) $data[$i]->storyVersion = $this->loadModel('story')->getVersion($data[$i]->story); if($assignedTo) $data[$i]->assignedDate = $now; if(strpos($this->config->task->create->requiredFields, 'estStarted') !== false and empty($estStarted)) $data[$i]->estStarted = '';