From bc3fc9e4eb52f45f57c069c0616aecc236fccb11 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Fri, 11 Feb 2022 10:02:52 +0800 Subject: [PATCH 01/57] * remove product for execution treeview. --- extension/lite/execution/ext/model/lite.php | 45 +++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/extension/lite/execution/ext/model/lite.php b/extension/lite/execution/ext/model/lite.php index 95f97b295d..a4c0406aea 100644 --- a/extension/lite/execution/ext/model/lite.php +++ b/extension/lite/execution/ext/model/lite.php @@ -32,3 +32,48 @@ public function setMenu($executionID, $buildID = 0, $extra = '') $this->lang->modulePageNav = $modulePageNav; } + +public function getTree($executionID) +{ + $fullTrees = $this->loadModel('tree')->getTaskStructure($executionID, 0); + + array_unshift($fullTrees, array('id' => 0, 'name' => '/', 'type' => 'task', 'actions' => false, 'root' => $executionID)); + + foreach($fullTrees as $i => $tree) + { + $tree = (object)$tree; + + if($tree->type == 'product') array_unshift($tree->children, array('id' => 0, 'name' => '/', 'type' => 'story', 'actions' => false, 'root' => $tree->root)); + $fullTree = $this->fillTasksInTree($tree, $executionID); + + if(empty($fullTree->children)) + { + unset($fullTrees[$i]); + } + else + { + $fullTrees[$i] = $fullTree; + } + } + + if(isset($fullTrees[0]) and empty($fullTrees[0]->children)) array_shift($fullTrees); + + $newTrees = array(); + + foreach($fullTrees as $i => $tree) + { + if($tree->type == 'product') + { + foreach($tree->children as $value) + { + $newTrees[] = $value; + } + } + else + { + $newTrees[] = $tree; + } + } + + return array_values($newTrees); +} From 7f0e43d14abd2c50d4b0c7bb5d4a1e371dd3009e Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Fri, 11 Feb 2022 11:25:03 +0800 Subject: [PATCH 02/57] * adjust for browsetask. --- .../lite/tree/ext/view/browsetask.html.php | 248 ++++++++++++++++++ 1 file changed, 248 insertions(+) create mode 100644 extension/lite/tree/ext/view/browsetask.html.php diff --git a/extension/lite/tree/ext/view/browsetask.html.php b/extension/lite/tree/ext/view/browsetask.html.php new file mode 100644 index 0000000000..9e8cb51984 --- /dev/null +++ b/extension/lite/tree/ext/view/browsetask.html.php @@ -0,0 +1,248 @@ + + * @package tree + * @version $Id: browse.html.php 4796 2013-06-06 02:21:59Z zhujinyonging@gmail.com $ + * @link http://www.zentao.net + */ +?> +app->getModuleRoot() . 'common/view/header.html.php';?> +tab);?> + + +
+
+
+
+
+
+
+
    +
    +
    +
    +
    +
    id}&viewType=task");?>'> +
    +
    +
    tree->manageTaskChild;?>
    +
    +
    + + + + + + + + + +
    + " . html::a($this->createLink('tree', 'browsetask', "root={$root->id}&productID=$productID&viewType=task"), $root->name, '', "data-app='{$app->tab}'") . ""; + foreach($parentModules as $module) + { + echo "" . html::a($this->createLink('tree', 'browsetask', "root={$root->id}&productID=$productID&moduleID=$module->id"), $module->name, '', "data-app='{$app->tab}'") . " "; + } + ?> + +
    + + + +
    +
    id]", $product->name, 'class=form-control disabled="true"')?>
    +
    + + + + order > $maxOrder) $maxOrder = $sonModule->order; + $disabled = $sonModule->type == 'task' ? '' : 'disabled'; + ?> +
    +
    id]", $sonModule->name, "class='form-control' placeholder='{$lang->tree->name}' $disabled")?>
    +
    + id]", $sonModule->short, "class='form-control' placeholder='{$lang->tree->short}' $disabled"); + echo html::hidden("order[id$sonModule->id]", $sonModule->order); + ?> +
    +
    +
    + + +
    +
    tree->name}'")?>
    +
    tree->short}'")?>
    +
    + + +
    + branch);?> +
    + +
    +
    +
    +
    tree->name}'");?>
    +
    tree->short}'");?>
    +
    + + +
    + branch);?> +
    +
    +
    + goback, '', "class='btn btn-wide'"); + echo html::hidden('parentModuleID', $currentModuleID); + echo html::hidden('maxOrder', $maxOrder); + ?> + +
    +
    +
    +
    +
    +
    + +app->getModuleRoot() . 'common/view/footer.html.php';?> From 23fca1b799172199f9baaaf77ac29ccdc78707b8 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Fri, 11 Feb 2022 13:07:07 +0800 Subject: [PATCH 03/57] * Finish task #48872. --- extension/lite/project/ext/view/edit.lite.html.hook.php | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 extension/lite/project/ext/view/edit.lite.html.hook.php diff --git a/extension/lite/project/ext/view/edit.lite.html.hook.php b/extension/lite/project/ext/view/edit.lite.html.hook.php new file mode 100644 index 0000000000..34dd0ee86d --- /dev/null +++ b/extension/lite/project/ext/view/edit.lite.html.hook.php @@ -0,0 +1,6 @@ + From ea1319a3605990b587c9e9bef0e5600dc162c2dd Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Fri, 11 Feb 2022 14:00:51 +0800 Subject: [PATCH 04/57] * adjust code. --- extension/lite/story/ext/view/create.html.php | 2 +- module/story/model.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extension/lite/story/ext/view/create.html.php b/extension/lite/story/ext/view/create.html.php index 96ed248326..b4caabe660 100644 --- a/extension/lite/story/ext/view/create.html.php +++ b/extension/lite/story/ext/view/create.html.php @@ -131,7 +131,7 @@ story->spec;?> fetch('user', 'ajaxPrintTemplates', 'type=story&link=spec');?> - story->specTemplate . "\n" . $lang->noticePasteImg) . "'");?> + noticePasteImg) . "'");?> diff --git a/module/story/model.php b/module/story/model.php index 7a83289a76..930336bb6f 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3889,7 +3889,7 @@ class storyModel extends model } break; case 'taskCount': - $tasksLink = helper::createLink('story', 'tasks', "storyID=$story->id"); + $tasksLink = helper::createLink('story', 'tasks', "storyID=$story->id&isonlybody=yes"); $storyTasks[$story->id] > 0 ? print(html::a($tasksLink, $storyTasks[$story->id], '', 'class="iframe"')) : print(0); break; case 'bugCount': From 16d623740d53081136456283b0fee4015317488e Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Fri, 11 Feb 2022 14:33:10 +0800 Subject: [PATCH 05/57] * adjust code. --- extension/lite/story/ext/view/review.lite.html.hook.php | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 extension/lite/story/ext/view/review.lite.html.hook.php diff --git a/extension/lite/story/ext/view/review.lite.html.hook.php b/extension/lite/story/ext/view/review.lite.html.hook.php new file mode 100644 index 0000000000..13d0ce6107 --- /dev/null +++ b/extension/lite/story/ext/view/review.lite.html.hook.php @@ -0,0 +1,4 @@ + From 7b8bef02cdd82475de5f4e21d936601ed00c65a0 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Fri, 11 Feb 2022 14:48:05 +0800 Subject: [PATCH 06/57] * fix refresh for story. --- module/index/js/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/module/index/js/index.js b/module/index/js/index.js index 2a7ed483bf..72d58ff2b2 100644 --- a/module/index/js/index.js +++ b/module/index/js/index.js @@ -115,6 +115,7 @@ return link.prj ? 'project' : 'report'; } } + if(moduleName === 'story' && vision === 'lite') return 'project' if(moduleName === 'story' && methodLowerCase === 'zerocase') { return link.params.from == 'project' ? 'project' : 'qa'; From 940ae5f653f3d822402a398e6e84a8496b317249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Fri, 11 Feb 2022 16:52:22 +0800 Subject: [PATCH 07/57] * finish task #48868. --- extension/lite/story/ext/view/close.lite.html.hook.php | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 extension/lite/story/ext/view/close.lite.html.hook.php diff --git a/extension/lite/story/ext/view/close.lite.html.hook.php b/extension/lite/story/ext/view/close.lite.html.hook.php new file mode 100644 index 0000000000..e1c92f8639 --- /dev/null +++ b/extension/lite/story/ext/view/close.lite.html.hook.php @@ -0,0 +1,9 @@ + From a2ce091868d7cfa92e1693ca657289b535c16d77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Fri, 11 Feb 2022 17:32:00 +0800 Subject: [PATCH 08/57] * code for task #49079. --- extension/lite/execution/ext/view/kanban.lite.html.hook.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extension/lite/execution/ext/view/kanban.lite.html.hook.php b/extension/lite/execution/ext/view/kanban.lite.html.hook.php index b4e48e22c1..4e62f06cb1 100644 --- a/extension/lite/execution/ext/view/kanban.lite.html.hook.php +++ b/extension/lite/execution/ext/view/kanban.lite.html.hook.php @@ -1,3 +1,7 @@ + From 416d8fc646ddd74c063e1430bea7dc02acbbde57 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Mon, 14 Feb 2022 08:23:59 +0800 Subject: [PATCH 09/57] adjust for company. --- extension/lite/company/ext/lang/zh-cn/lite.php | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 extension/lite/company/ext/lang/zh-cn/lite.php diff --git a/extension/lite/company/ext/lang/zh-cn/lite.php b/extension/lite/company/ext/lang/zh-cn/lite.php new file mode 100644 index 0000000000..f09b1918cf --- /dev/null +++ b/extension/lite/company/ext/lang/zh-cn/lite.php @@ -0,0 +1,3 @@ +company->execution = '看板'; +$lang->company->product = '项目'; From 987bb95ce8cb7c25120ac02e5161f17c10dcfe86 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Mon, 14 Feb 2022 09:04:01 +0800 Subject: [PATCH 10/57] * finish task #49091. --- extension/lite/user/ext/model/lite.php | 106 ++++++++++++++++++ .../lite/user/ext/view/execution.html.php | 63 +++++++++++ 2 files changed, 169 insertions(+) create mode 100644 extension/lite/user/ext/model/lite.php create mode 100644 extension/lite/user/ext/view/execution.html.php diff --git a/extension/lite/user/ext/model/lite.php b/extension/lite/user/ext/model/lite.php new file mode 100644 index 0000000000..8f74ddca58 --- /dev/null +++ b/extension/lite/user/ext/model/lite.php @@ -0,0 +1,106 @@ +dao->select('t1.*,t2.*')->from(TABLE_TEAM)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.root = t2.id') + ->where('t1.type')->eq($type) + ->andWhere('t2.type')->in($objectType) + ->beginIF(strpos('doing|wait|suspended|closed', $status) !== false)->andWhere('status')->eq($status)->fi() + ->beginIF($status == 'done')->andWhere('status')->in('done,closed')->fi() + ->beginIF($status == 'undone')->andWhere('status')->notin('done,closed')->fi() + ->beginIF($status == 'openedbyme')->andWhere('openedBy')->eq($account)->fi() + ->beginIF($type == 'execution' and !$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi() + ->beginIF($type == 'project' and !$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->projects)->fi() + ->andWhere('t1.account')->eq($account) + ->andWhere('t2.deleted')->eq(0) + ->andWhere('t2.vision')->eq($this->config->vision) + ->orderBy("t2.$orderBy") + ->page($pager) + ->fetchAll('root'); + + $objectIdList = array(); + $projectIdList = array(); + foreach($myObjectsList as $object) + { + $objectIdList[] = $object->id; + $projectIdList[] = $object->project; + } + + /* Get all tasks and compute totalConsumed, totalLeft, totalWait, progress according to them. */ + $hours = array(); + $emptyHour = array('totalConsumed' => 0, 'totalLeft' => 0, 'progress' => 0, 'waitTasks' => 0, 'assignedToMeTasks' => 0, 'doneTasks' => 0, 'taskTotal' => 0); + $searchField = $type == 'project' ? 'project' : 'execution'; + $tasks = $this->dao->select('id, project, execution, consumed, `left`, status, assignedTo,finishedBy') + ->from(TABLE_TASK) + ->where('parent')->lt(1) + ->andWhere($searchField)->in($objectIdList)->fi() + ->andWhere('deleted')->eq(0) + ->fetchGroup($searchField, 'id'); + + /* Compute totalEstimate, totalConsumed, totalLeft. */ + foreach($tasks as $objectID => $objectTasks) + { + $hour = (object)$emptyHour; + $hour->taskTotal = count($objectTasks); + foreach($objectTasks as $task) + { + if($task->status == 'wait') $hour->waitTasks += 1; + if($task->finishedBy != '') $hour->doneTasks += 1; + if($task->status != 'cancel') $hour->totalConsumed += $task->consumed; + if($task->status != 'cancel' and $task->status != 'closed') $hour->totalLeft += $task->left; + if($task->assignedTo == $account) $hour->assignedToMeTasks += 1; + } + $hours[$objectID] = $hour; + } + + /* Compute totalReal and progress. */ + foreach($hours as $hour) + { + $hour->totalConsumed = round($hour->totalConsumed, 1); + $hour->totalLeft = round($hour->totalLeft, 1); + $hour->totalReal = $hour->totalConsumed + $hour->totalLeft; + $hour->progress = $hour->totalReal ? round($hour->totalConsumed / $hour->totalReal, 2) * 100 : 0; + } + + $myObjects = array(); + $projectList = $this->loadModel('project')->getByIdList($projectIdList); + foreach($myObjectsList as $object) + { + /* Judge whether the project or execution is delayed. */ + if($object->status != 'done' and $object->status != 'closed' and $object->status != 'suspended') + { + $delay = helper::diffDate(helper::today(), $object->end); + if($delay > 0) $object->delay = $delay; + } + + /* Process the hours. */ + $object->progress = isset($hours[$object->id]) ? $hours[$object->id]->progress : 0; + $object->waitTasks = isset($hours[$object->id]) ? $hours[$object->id]->waitTasks : 0; + $object->doneTasks = isset($hours[$object->id]) ? $hours[$object->id]->doneTasks : 0; + $object->taskTotal = isset($hours[$object->id]) ? $hours[$object->id]->taskTotal : 0; + $object->totalConsumed = isset($hours[$object->id]) ? $hours[$object->id]->totalConsumed : 0; + $object->assignedToMeTasks = isset($hours[$object->id]) ? $hours[$object->id]->assignedToMeTasks : 0; + + if($object->project) + { + $parentProject = zget($projectList, $object->project, ''); + $object->projectName = $parentProject ? $parentProject->name : ''; + } + $myObjects[$object->id] = $object; + } + + return $myObjects; +} + diff --git a/extension/lite/user/ext/view/execution.html.php b/extension/lite/user/ext/view/execution.html.php new file mode 100644 index 0000000000..6b6c8d08f8 --- /dev/null +++ b/extension/lite/user/ext/view/execution.html.php @@ -0,0 +1,63 @@ + + * @package dashboard + * @version $Id: project.html.php 4129 2013-01-18 01:58:14Z wwccss $ + * @link http://www.zentao.net + */ +?> +app->getModuleRoot() . 'common/view/header.html.php';?> +app->getModuleRoot() . 'common/view/tablesorter.html.php';?> +app->getModuleRoot() . 'user/view/featurebar.html.php';?> +
    +
    + + id}&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"; ?> + + + + + + + + + + + + + + + createLink('execution', 'view', "executionID=$execution->id");?> + config->vision == 'lite') $executionLink = $this->createLink('execution', 'kanban', "kanbanID=$execution->id");?> + + + + delay)):?> + + + + + + + + + + + + +
    idAB);?>user->name);?> statusAB);?> team->role;?> execution->begin);?> execution->end);?> team->join;?> team->hours;?>
    id);?> + maxVersion)):?> + user->executionTypeList, $execution->type);?> + + name);?> + execution->delayed;?>processStatus('execution', $execution);?>role;?>begin;?>end;?>join;?>hours;?>
    + + + +
    +
    +app->getModuleRoot() . 'common/view/footer.html.php';?> From c7fab53ed1bb038e5d58b4bfb6ef44173f240635 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Mon, 14 Feb 2022 09:57:10 +0800 Subject: [PATCH 11/57] * finish task #49090. --- module/project/model.php | 4 ++-- module/story/model.php | 1 + module/user/view/story.html.php | 10 +++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index 73debb0fd4..27c63ec8bf 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -902,7 +902,7 @@ class projectModel extends model $lib->main = '1'; $lib->acl = $project->acl != 'program' ? $project->acl : 'custom'; $lib->users = ',' . implode(',', array_filter($authorizedUsers)) . ','; - $lib->vision = zget($project, 'vision', 'common'); + $lib->vision = zget($project, 'vision', 'rnd'); $this->dao->insert(TABLE_DOCLIB)->data($lib)->exec(); $this->updateProducts($projectID); @@ -920,7 +920,7 @@ class projectModel extends model $product->createdDate = helper::now(); $product->status = 'normal'; $product->createdVersion = $this->config->version; - $product->vision = zget($project, 'vision', 'common'); + $product->vision = zget($project, 'vision', 'rnd'); $this->dao->insert(TABLE_PRODUCT)->data($product)->exec(); $productID = $this->dao->lastInsertId(); diff --git a/module/story/model.php b/module/story/model.php index 930336bb6f..457e150e66 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2877,6 +2877,7 @@ class storyModel extends model $stories = $sql->where('t1.deleted')->eq(0) ->andWhere('t1.type')->eq($storyType) + ->andWhere('t1.vision')->eq($this->config->vision) ->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('t1.status')->ne('closed')->fi() ->beginIF($type != 'all') ->beginIF($type == 'assignedTo')->andWhere('assignedTo')->eq($account)->fi() diff --git a/module/user/view/story.html.php b/module/user/view/story.html.php index 6968bf2550..7f478fb0ec 100644 --- a/module/user/view/story.html.php +++ b/module/user/view/story.html.php @@ -43,9 +43,13 @@ idAB);?> priAB);?> + config->vision == 'lite'):?> + story->project);?> + story->product);?> + story->title);?> - + config->vision != 'lite'):?> story->plan);?> openedByAB);?> @@ -56,13 +60,13 @@ $story):?> - createLink('story', 'view', "id=$story->id");?> + createLink('story', 'view', "id=$story->id");?> id));?> story->priList, $story->pri, $story->pri);?>'>story->priList, $story->pri, $story->pri);?> productTitle;?> title);?> - + config->vision != 'lite'):?> planTitle;?> openedBy);?> From 41e0b66473f138db560151502808156b86080d2b Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Mon, 14 Feb 2022 13:17:56 +0800 Subject: [PATCH 12/57] * finish task #49013. --- extension/lite/task/ext/lang/zh-cn/lite.php | 1 + module/block/lang/en.php | 1 + module/block/lang/zh-cn.php | 1 + module/block/view/scrumoverviewblock.html.php | 17 ++++++++----- module/project/model.php | 25 +++++++++++++++++++ 5 files changed, 39 insertions(+), 6 deletions(-) diff --git a/extension/lite/task/ext/lang/zh-cn/lite.php b/extension/lite/task/ext/lang/zh-cn/lite.php index 33e7713e1b..c5f9ea5457 100644 --- a/extension/lite/task/ext/lang/zh-cn/lite.php +++ b/extension/lite/task/ext/lang/zh-cn/lite.php @@ -26,6 +26,7 @@ $lang->task->exportAction = "导出卡片"; $lang->task->copy = '复制卡片'; $lang->task->waitTask = '未开始的卡片'; +$lang->task->module = '所属目录'; $lang->task->common = '卡片'; $lang->task->name = '卡片名称'; $lang->task->type = '卡片类型'; diff --git a/module/block/lang/en.php b/module/block/lang/en.php index 28d45685d1..2568dd918c 100644 --- a/module/block/lang/en.php +++ b/module/block/lang/en.php @@ -99,6 +99,7 @@ $lang->block->productName = $lang->productCommon . ' Name'; $lang->block->totalStory = 'The Total ' . $lang->SRCommon; $lang->block->totalBug = 'The Total Bug'; $lang->block->totalRelease = 'Release The Number'; +$lang->block->totalTask = 'The Total ' . $lang->task->common; $lang->block->totalInvestment = 'Total investment'; $lang->block->totalPeople = 'Total number'; diff --git a/module/block/lang/zh-cn.php b/module/block/lang/zh-cn.php index 4827aab636..1b6fbdc54b 100644 --- a/module/block/lang/zh-cn.php +++ b/module/block/lang/zh-cn.php @@ -99,6 +99,7 @@ $lang->block->productName = $lang->productCommon . '名称'; $lang->block->totalStory = '总' . $lang->SRCommon; $lang->block->totalBug = '总Bug'; $lang->block->totalRelease = '发布次数'; +$lang->block->totalTask = '总' . $lang->task->common; $lang->block->totalInvestment = '总投入'; $lang->block->totalPeople = '总人数'; diff --git a/module/block/view/scrumoverviewblock.html.php b/module/block/view/scrumoverviewblock.html.php index fcf990cc03..cf05b83451 100644 --- a/module/block/view/scrumoverviewblock.html.php +++ b/module/block/view/scrumoverviewblock.html.php @@ -10,6 +10,7 @@ * @link http://www.zentao.net */ ?> +config->vision;?>
    " . $lang->project->create, '', "class='btn btn-primary'")?>
    @@ -22,7 +23,11 @@ workingHour;?> + + block->taskCount;?> + block->bugCount;?> + @@ -34,8 +39,8 @@ teamCount ? html::a($this->createLink('project', 'team', 'projectID=' . $projectID), $totalData[$projectID]->teamCount) : 0;?> block->estimatedHours . ':';?> estimate . $lang->execution->workHour;?> - block->totalBug. ':';?> - allBugs;?> + block->totalTask : $lang->block->totalBug) . ':';?> + allTasks : $totalData[$projectID]->allBugs;?> block->done . ':';?> @@ -44,8 +49,8 @@ block->consumedHours . ':';?> consumed . $lang->execution->workHour;?> - bug->statusList['resolved'] . ':';?> - doneBugs;?> + block->done : $lang->bug->statusList['resolved']) . ':';?> + doneTasks : $totalData[$projectID]->doneBugs;?> block->left . ':';?> @@ -54,8 +59,8 @@ - bug->unResolved . ':';?> - leftBugs;?> + block->undone : $lang->bug->unResolved) . ':';?> + leftTasks : $totalData[$projectID]->leftBugs;?> diff --git a/module/project/model.php b/module/project/model.php index 27c63ec8bf..f448e0f3a6 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -310,6 +310,10 @@ class projectModel extends model $allBugs = $this->getTotalBugByProject($projectIdList, 'all'); $doneBugs = $this->getTotalBugByProject($projectIdList, 'resolved'); + $leftTasks = $this->getTotalTaskByProject($projectIdList, 'doing'); + $allTasks = $this->getTotalTaskByProject($projectIdList, 'all'); + $doneTasks = $this->getTotalTaskByProject($projectIdList, 'done'); + foreach($projects as $projectID => $project) { $project->consumed = isset($hours[$projectID]) ? (float)$hours[$projectID]->consumed : 0; @@ -322,6 +326,9 @@ class projectModel extends model $project->allStories = $allStories[$projectID]; $project->doneStories = $doneStories[$projectID]; $project->leftStories = $leftStories[$projectID]; + $project->leftTasks = isset($leftTasks[$projectID]) ? $leftTasks[$projectID] : 0; + $project->allTasks = isset($allTasks[$projectID]) ? $allTasks[$projectID] : 0; + $project->doneTasks = isset($doneTasks[$projectID]) ? $doneTasks[$projectID] : 0; if(is_float($project->consumed)) $project->consumed = round($project->consumed, 1); if(is_float($project->estimate)) $project->estimate = round($project->estimate, 1); @@ -551,6 +558,24 @@ class projectModel extends model ->fetchPairs('project'); } + /** + * Get associated tasks by project. + * + * @param array $projectIdList + * @param string $status + * @access public + * @return array + */ + public function getTotalTaskByProject($projectIdList, $status) + { + return $this->dao->select('project, count(*) as tasks')->from(TABLE_TASK) + ->where('project')->in($projectIdList) + ->andWhere('deleted')->eq(0) + ->beginIF($status != 'all')->andWhere('status')->eq($status)->fi() + ->groupBy('project') + ->fetchPairs('project'); + } + /** * Get branches by project id. * From ca0ac94d9236b17f681599e5af077678f1031a8c Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Mon, 14 Feb 2022 13:23:51 +0800 Subject: [PATCH 13/57] * code for task#49013. --- module/project/model.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index f448e0f3a6..19d9d14538 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -310,7 +310,7 @@ class projectModel extends model $allBugs = $this->getTotalBugByProject($projectIdList, 'all'); $doneBugs = $this->getTotalBugByProject($projectIdList, 'resolved'); - $leftTasks = $this->getTotalTaskByProject($projectIdList, 'doing'); + $leftTasks = $this->getTotalTaskByProject($projectIdList, 'undone'); $allTasks = $this->getTotalTaskByProject($projectIdList, 'all'); $doneTasks = $this->getTotalTaskByProject($projectIdList, 'done'); @@ -562,7 +562,7 @@ class projectModel extends model * Get associated tasks by project. * * @param array $projectIdList - * @param string $status + * @param string $status all|done|undone * @access public * @return array */ @@ -571,7 +571,8 @@ class projectModel extends model return $this->dao->select('project, count(*) as tasks')->from(TABLE_TASK) ->where('project')->in($projectIdList) ->andWhere('deleted')->eq(0) - ->beginIF($status != 'all')->andWhere('status')->eq($status)->fi() + ->beginIF($status == 'done')->andWhere('status')->in('done,closed')->fi() + ->beginIF($status == 'undone')->andWhere('status')->in('wait,pause,cancel')->fi() ->groupBy('project') ->fetchPairs('project'); } From 2379c9cf28a3db3059e946544016b0834d852878 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Mon, 14 Feb 2022 13:28:38 +0800 Subject: [PATCH 14/57] =?UTF-8?q?*=20replace=20`=E5=8D=A1=E7=89=87`=20to?= =?UTF-8?q?=20`=E4=BB=BB=E5=8A=A1`=20for=20lite.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extension/lite/action/ext/lang/zh-cn/lite.php | 4 +- extension/lite/block/ext/lang/zh-cn/lite.php | 6 +- extension/lite/common/ext/lang/zh-cn/lite.php | 8 +- extension/lite/custom/ext/lang/zh-cn/lite.php | 4 +- extension/lite/dev/ext/lang/zh-cn/lite.php | 2 +- .../lite/execution/ext/lang/zh-cn/lite.php | 4 +- extension/lite/search/ext/lang/zh-cn/lite.php | 2 +- extension/lite/task/ext/lang/zh-cn/lite.php | 104 +++++++++--------- extension/lite/todo/ext/lang/zh-cn/lite.php | 2 +- extension/lite/user/ext/lang/zh-cn/lite.php | 2 +- 10 files changed, 69 insertions(+), 69 deletions(-) diff --git a/extension/lite/action/ext/lang/zh-cn/lite.php b/extension/lite/action/ext/lang/zh-cn/lite.php index 20d56c85f2..8bb9e00e85 100644 --- a/extension/lite/action/ext/lang/zh-cn/lite.php +++ b/extension/lite/action/ext/lang/zh-cn/lite.php @@ -1,8 +1,8 @@ action->label->execution = "看板|execution|task|executionID=%s"; -$lang->action->label->task = '卡片|task|view|taskID=%s'; +$lang->action->label->task = '任务|task|view|taskID=%s'; -$lang->action->objectTypes['task'] = '卡片'; +$lang->action->objectTypes['task'] = '任务'; unset($lang->action->dynamicAction->program); unset($lang->action->dynamicAction->product); diff --git a/extension/lite/block/ext/lang/zh-cn/lite.php b/extension/lite/block/ext/lang/zh-cn/lite.php index 7ce135d69e..4d2c0d93f4 100644 --- a/extension/lite/block/ext/lang/zh-cn/lite.php +++ b/extension/lite/block/ext/lang/zh-cn/lite.php @@ -11,9 +11,9 @@ $lang->block->delayed = '已延期'; $lang->block->titleList['scrumlist'] = '看板列表'; $lang->block->titleList['sprint'] = '看板总览'; -$lang->block->myTask = '我的卡片'; +$lang->block->myTask = '我的任务'; -$lang->block->finishedTasks = '完成的卡片数'; +$lang->block->finishedTasks = '完成的任务数'; $lang->block->story = '目标'; @@ -44,7 +44,7 @@ $lang->block->modules['execution']->availableBlocks = new stdclass(); $lang->block->modules['execution']->availableBlocks->statistic = $lang->execution->common . '统计'; $lang->block->modules['execution']->availableBlocks->overview = $lang->execution->common . '总览'; $lang->block->modules['execution']->availableBlocks->list = $lang->execution->common . '列表'; -$lang->block->modules['execution']->availableBlocks->task = '卡片列表'; +$lang->block->modules['execution']->availableBlocks->task = '任务列表'; unset($lang->block->moduleList['product']); unset($lang->block->moduleList['qa']); diff --git a/extension/lite/common/ext/lang/zh-cn/lite.php b/extension/lite/common/ext/lang/zh-cn/lite.php index cfeb6f2052..6e9dba0e88 100644 --- a/extension/lite/common/ext/lang/zh-cn/lite.php +++ b/extension/lite/common/ext/lang/zh-cn/lite.php @@ -1,7 +1,7 @@ execution->common = '看板'; $lang->executionCommon = '看板'; -$lang->task->common = '卡片'; +$lang->task->common = '任务'; $lang->story->common = '目标'; /* Main Navigation. */ @@ -46,7 +46,7 @@ else $lang->dividerMenu = ',doc,admin,'; } -$lang->task->common = '卡片'; +$lang->task->common = '任务'; /* My menu. */ $lang->my->menu = new stdclass(); @@ -204,7 +204,7 @@ $lang->admin->dividerMenu = ',company,message,system,'; $lang->searchObjects['all'] = '全部'; $lang->searchObjects['todo'] = '待办'; $lang->searchObjects['story'] = '目标'; -$lang->searchObjects['task'] = '卡片'; +$lang->searchObjects['task'] = '任务'; $lang->searchObjects['doc'] = '文档'; $lang->searchObjects['project'] = '项目'; $lang->searchObjects['execution'] = '看板'; @@ -247,7 +247,7 @@ unset($lang->createIcons['kanbanspace']); unset($lang->createIcons['kanban']); $lang->createObjects['story'] = '目标'; -$lang->createObjects['task'] = '卡片'; +$lang->createObjects['task'] = '任务'; $lang->createObjects['execution'] = '看板'; $lang->createIcons['execution'] = 'kanban'; diff --git a/extension/lite/custom/ext/lang/zh-cn/lite.php b/extension/lite/custom/ext/lang/zh-cn/lite.php index 0e6d7a8036..9d1feed8cd 100644 --- a/extension/lite/custom/ext/lang/zh-cn/lite.php +++ b/extension/lite/custom/ext/lang/zh-cn/lite.php @@ -1,7 +1,7 @@ custom->execution = '看板'; $lang->custom->closedExecution = '已关闭' . $lang->custom->execution; -$lang->custom->notice->readOnlyOfExecution = "禁止修改后,已关闭{$lang->custom->execution}下的卡片、日志以及关联目标都禁止修改。"; +$lang->custom->notice->readOnlyOfExecution = "禁止修改后,已关闭{$lang->custom->execution}下的任务、日志以及关联目标都禁止修改。"; $lang->custom->moduleName['execution'] = $lang->custom->execution; @@ -9,7 +9,7 @@ $lang->custom->object = array(); $lang->custom->object['project'] = '项目'; $lang->custom->object['execution'] = $lang->custom->execution; $lang->custom->object['story'] = $lang->SRCommon; -$lang->custom->object['task'] = '卡片'; +$lang->custom->object['task'] = '任务'; $lang->custom->object['todo'] = '待办'; $lang->custom->object['user'] = '用户'; $lang->custom->object['block'] = '区块'; diff --git a/extension/lite/dev/ext/lang/zh-cn/lite.php b/extension/lite/dev/ext/lang/zh-cn/lite.php index a640e108fb..9ef59bcb45 100644 --- a/extension/lite/dev/ext/lang/zh-cn/lite.php +++ b/extension/lite/dev/ext/lang/zh-cn/lite.php @@ -22,7 +22,7 @@ $lang->dev->tableList['projectstory'] = '项目' . $lang->SRCommon; $lang->dev->tableList['execution'] = $lang->executionCommon; $lang->dev->tableList['story'] = $lang->SRCommon; $lang->dev->tableList['storyspec'] = "{$lang->SRCommon}描述"; -$lang->dev->tableList['task'] = '卡片'; +$lang->dev->tableList['task'] = '任务'; $lang->dev->tableList['taskestimate'] = '任务预计'; $lang->dev->tableList['team'] = '团队'; $lang->dev->tableList['todo'] = '待办'; diff --git a/extension/lite/execution/ext/lang/zh-cn/lite.php b/extension/lite/execution/ext/lang/zh-cn/lite.php index 5334815f50..02424e8f9f 100644 --- a/extension/lite/execution/ext/lang/zh-cn/lite.php +++ b/extension/lite/execution/ext/lang/zh-cn/lite.php @@ -5,8 +5,8 @@ unset($lang->execution->featureBar['all']['suspended']); $lang->execution->createKanban = '创建看板'; $lang->execution->noExecution = "暂时没有看板。"; -$lang->execution->importTask = '转入卡片'; -$lang->execution->batchCreateTask = '批量创建卡片'; +$lang->execution->importTask = '转入任务'; +$lang->execution->batchCreateTask = '批量创建任务'; $lang->execution->kanbanGroup['default'] = '默认方式'; $lang->execution->kanbanGroup['story'] = '目标'; diff --git a/extension/lite/search/ext/lang/zh-cn/lite.php b/extension/lite/search/ext/lang/zh-cn/lite.php index fa6a21ff59..7d7c6c1faf 100644 --- a/extension/lite/search/ext/lang/zh-cn/lite.php +++ b/extension/lite/search/ext/lang/zh-cn/lite.php @@ -1,5 +1,5 @@ search->modules['task'] = '卡片'; +$lang->search->modules['task'] = '任务'; $lang->search->modules['execution'] = '看板'; $lang->search->modules['story'] = '目标'; diff --git a/extension/lite/task/ext/lang/zh-cn/lite.php b/extension/lite/task/ext/lang/zh-cn/lite.php index c5f9ea5457..aee0d15ed5 100644 --- a/extension/lite/task/ext/lang/zh-cn/lite.php +++ b/extension/lite/task/ext/lang/zh-cn/lite.php @@ -9,69 +9,69 @@ * @version $Id: zh-cn.php 5040 2013-07-06 06:22:18Z zhujinyonging@gmail.com $ * @link http://www.zentao.net */ -$lang->task->index = "卡片一览"; -$lang->task->create = "建卡片"; -$lang->task->batchCreateChildren = "批量建子卡片"; -$lang->task->edit = "编辑卡片"; -$lang->task->deleteAction = "删除卡片"; -$lang->task->view = "查看卡片"; -$lang->task->startAction = "开始卡片"; -$lang->task->restartAction = "继续卡片"; -$lang->task->finishAction = "完成卡片"; -$lang->task->pauseAction = "暂停卡片"; -$lang->task->closeAction = "关闭卡片"; -$lang->task->cancelAction = "取消卡片"; -$lang->task->activateAction = "激活卡片"; -$lang->task->exportAction = "导出卡片"; -$lang->task->copy = '复制卡片'; -$lang->task->waitTask = '未开始的卡片'; +$lang->task->index = "任务一览"; +$lang->task->create = "建任务"; +$lang->task->batchCreateChildren = "批量建子任务"; +$lang->task->edit = "编辑任务"; +$lang->task->deleteAction = "删除任务"; +$lang->task->view = "查看任务"; +$lang->task->startAction = "开始任务"; +$lang->task->restartAction = "继续任务"; +$lang->task->finishAction = "完成任务"; +$lang->task->pauseAction = "暂停任务"; +$lang->task->closeAction = "关闭任务"; +$lang->task->cancelAction = "取消任务"; +$lang->task->activateAction = "激活任务"; +$lang->task->exportAction = "导出任务"; +$lang->task->copy = '复制任务'; +$lang->task->waitTask = '未开始的任务'; $lang->task->module = '所属目录'; -$lang->task->common = '卡片'; -$lang->task->name = '卡片名称'; -$lang->task->type = '卡片类型'; -$lang->task->status = '卡片状态'; -$lang->task->desc = '卡片描述'; -$lang->task->assignAction = '指派卡片'; -$lang->task->multiple = '多人卡片'; -$lang->task->children = '子卡片'; -$lang->task->parent = '父卡片'; +$lang->task->common = '任务'; +$lang->task->name = '任务名称'; +$lang->task->type = '任务类型'; +$lang->task->status = '任务状态'; +$lang->task->desc = '任务描述'; +$lang->task->assignAction = '指派任务'; +$lang->task->multiple = '多人任务'; +$lang->task->children = '子任务'; +$lang->task->parent = '父任务'; /* Fields of zt_taskestimate. */ -$lang->task->task = '卡片'; +$lang->task->task = '任务'; -$lang->task->dittoNotice = "该卡片与上一卡片不属于同一%s!"; -$lang->task->yesterdayFinished = '昨日完成卡片数'; -$lang->task->allTasks = '总卡片'; +$lang->task->dittoNotice = "该任务与上一任务不属于同一%s!"; +$lang->task->yesterdayFinished = '昨日完成任务数'; +$lang->task->allTasks = '总任务'; -$lang->task->afterChoices['continueAdding'] = "继续为该{$lang->SRCommon}添加卡片"; -$lang->task->afterChoices['toTaskList'] = '返回卡片列表'; +$lang->task->afterChoices['continueAdding'] = "继续为该{$lang->SRCommon}添加任务"; +$lang->task->afterChoices['toTaskList'] = '返回任务列表'; -$lang->task->legendLife = '卡片的一生'; -$lang->task->legendDesc = '卡片描述'; -$lang->task->legendDetail = '卡片详情'; +$lang->task->legendLife = '任务的一生'; +$lang->task->legendDesc = '任务描述'; +$lang->task->legendDetail = '任务详情'; -$lang->task->confirmDelete = "您确定要删除这个卡片吗?"; +$lang->task->confirmDelete = "您确定要删除这个任务吗?"; $lang->task->confirmDeleteEstimate = "您确定要删除这个记录吗?"; -$lang->task->confirmFinish = '"预计剩余"为0,确认将卡片状态改为"已完成"吗?'; -$lang->task->confirmRecord = '"剩余"为0,卡片将标记为"已完成",您确定吗?'; -$lang->task->confirmTransfer = '"当前剩余"为0,卡片将被转交,您确定吗?'; -$lang->task->noTask = '暂时没有卡片。'; +$lang->task->confirmFinish = '"预计剩余"为0,确认将任务状态改为"已完成"吗?'; +$lang->task->confirmRecord = '"剩余"为0,任务将标记为"已完成",您确定吗?'; +$lang->task->confirmTransfer = '"当前剩余"为0,任务将被转交,您确定吗?'; +$lang->task->noTask = '暂时没有任务。'; $lang->task->kanbanDenied = '请先创建看板'; -$lang->task->createDenied = '你不能在该项目添加卡片'; -$lang->task->cannotDeleteParent = '不能删除父卡片。'; -$lang->task->addChildTask = '因该卡片已经产生消耗,为保证数据一致性,我们会帮您创建一条同名子卡片记录该消耗。'; +$lang->task->createDenied = '你不能在该项目添加任务'; +$lang->task->cannotDeleteParent = '不能删除父任务。'; +$lang->task->addChildTask = '因该任务已经产生消耗,为保证数据一致性,我们会帮您创建一条同名子任务记录该消耗。'; -$lang->task->error->skipClose = '卡片:%s 不是“已完成”或“已取消”状态,确定要关闭吗?'; -$lang->task->error->consumed = '卡片:%s工时不能小于0,忽略该卡片工时的改动'; -$lang->task->error->assignedTo = '当前状态的多人卡片不能指派给卡片团队外的成员。'; -$lang->task->error->alreadyStarted = '此卡片已被启动,不能重复启动!'; -$lang->task->error->alreadyConsumed = '当前选中的父卡片已有消耗。'; +$lang->task->error->skipClose = '任务:%s 不是“已完成”或“已取消”状态,确定要关闭吗?'; +$lang->task->error->consumed = '任务:%s工时不能小于0,忽略该任务工时的改动'; +$lang->task->error->assignedTo = '当前状态的多人任务不能指派给任务团队外的成员。'; +$lang->task->error->alreadyStarted = '此任务已被启动,不能重复启动!'; +$lang->task->error->alreadyConsumed = '当前选中的父任务已有消耗。'; /* Report. */ -$lang->task->report->value = '卡片数'; +$lang->task->report->value = '任务数'; -$lang->task->report->charts['tasksPerExecution'] = '按' . $lang->executionCommon . '卡片数统计'; -$lang->task->report->charts['tasksPerModule'] = '按模块卡片数统计'; -$lang->task->report->charts['tasksPerType'] = '按卡片类型统计'; -$lang->task->report->charts['tasksPerStatus'] = '按卡片状态统计'; +$lang->task->report->charts['tasksPerExecution'] = '按' . $lang->executionCommon . '任务数统计'; +$lang->task->report->charts['tasksPerModule'] = '按模块任务数统计'; +$lang->task->report->charts['tasksPerType'] = '按任务类型统计'; +$lang->task->report->charts['tasksPerStatus'] = '按任务状态统计'; diff --git a/extension/lite/todo/ext/lang/zh-cn/lite.php b/extension/lite/todo/ext/lang/zh-cn/lite.php index f520b30c77..9e1dc51122 100644 --- a/extension/lite/todo/ext/lang/zh-cn/lite.php +++ b/extension/lite/todo/ext/lang/zh-cn/lite.php @@ -1,4 +1,4 @@ todo->typeList['task'] = '卡片'; +$lang->todo->typeList['task'] = '任务'; unset($lang->todo->typeList['bug']); unset($lang->todo->typeList['testtask']); diff --git a/extension/lite/user/ext/lang/zh-cn/lite.php b/extension/lite/user/ext/lang/zh-cn/lite.php index 9adf4eb7fe..d2f5818794 100644 --- a/extension/lite/user/ext/lang/zh-cn/lite.php +++ b/extension/lite/user/ext/lang/zh-cn/lite.php @@ -1,2 +1,2 @@ user->task = '卡片'; +$lang->user->task = '任务'; From 5916ca0d8979b66ce2e4cd6d29cea6a05df73b68 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Mon, 14 Feb 2022 13:57:03 +0800 Subject: [PATCH 15/57] * finish task #48861. --- extension/lite/product/ext/view/browse.html.php | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/extension/lite/product/ext/view/browse.html.php b/extension/lite/product/ext/view/browse.html.php index 3ca43fa507..fcaa1d5269 100644 --- a/extension/lite/product/ext/view/browse.html.php +++ b/extension/lite/product/ext/view/browse.html.php @@ -42,7 +42,6 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : ''; .btn-group button.dropdown-toggle.btn-secondary, .btn-group button.dropdown-toggle.btn-primary {padding:6px;} - diff --git a/extension/lite/todo/ext/view/batchcreate.lite.html.hook.php b/extension/lite/todo/ext/view/batchcreate.lite.html.hook.php index 93373fe779..f9ced5a133 100644 --- a/extension/lite/todo/ext/view/batchcreate.lite.html.hook.php +++ b/extension/lite/todo/ext/view/batchcreate.lite.html.hook.php @@ -1,6 +1,8 @@ +';?> diff --git a/module/program/model.php b/module/program/model.php index df0c013409..6f886c80c2 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -133,6 +133,7 @@ class programModel extends model return $this->dao->select('*')->from(TABLE_PROGRAM) ->where('type')->in('program,project') ->andWhere('deleted')->eq(0) + ->andWhere('vision')->eq($this->config->vision) ->beginIF(!$this->app->user->admin) ->andWhere('(id')->in($this->app->user->view->programs) ->orWhere('id')->in($this->app->user->view->projects) diff --git a/module/story/model.php b/module/story/model.php index 37d1b07a71..dc2a1f3e46 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3982,9 +3982,9 @@ class storyModel extends model common::printIcon('story', 'recall', $vars, $story, 'list', 'back', 'hiddenwin', '', '', '', $this->lang->story->recall); common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); common::printIcon('story', 'edit', $vars . "&from=$story->from", $story, 'list', '', '', '', false, "data-group=$story->from"); - if($story->type != 'requirement') common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap', '', '', false, "data-app='qa'"); + if($story->type != 'requirement' and $this->config->vision != 'lite') common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap', '', '', false, "data-app='qa'"); if($this->app->rawModule != 'projectstory' OR $this->config->vision == 'lite') common::printIcon('story', 'batchCreate', "productID=$story->product&branch=$story->branch&module=$story->module&storyID=$story->id", $story, 'list', 'split', '', '', '', '', $this->lang->story->subdivide); - if($this->app->rawModule == 'projectstory') common::printIcon('projectstory', 'unlinkStory', "projectID={$this->session->project}&storyID=$story->id", '', 'list', 'unlink', 'hiddenwin'); + if($this->app->rawModule == 'projectstory' and $this->config->vision != 'lite') common::printIcon('projectstory', 'unlinkStory', "projectID={$this->session->project}&storyID=$story->id", '', 'list', 'unlink', 'hiddenwin'); } else { From 3dbbc4b3f06a2a116a4c7e4bb562cdf20f51af9d Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Thu, 17 Feb 2022 15:02:18 +0800 Subject: [PATCH 46/57] *Finish task 49286. --- module/search/control.php | 4 ++-- module/search/lang/en.php | 1 + module/search/lang/zh-cn.php | 1 + module/search/view/savequery.html.php | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/module/search/control.php b/module/search/control.php index 85de079e65..89673a6f17 100644 --- a/module/search/control.php +++ b/module/search/control.php @@ -103,12 +103,12 @@ class search extends control if($_POST) { $queryID = $this->search->saveQuery(); - if(!$queryID) die(js::error(dao::getError())); + if(!$queryID) return print(js::error(dao::getError())); $data = fixer::input('post')->get(); $shortcut = empty($data->onMenuBar) ? 0 : 1; - die(js::closeModal('parent.parent', '', "function(){parent.parent.loadQueries($queryID, $shortcut, '{$data->title}')}")); + return print(js::closeModal('parent.parent', '', "function(){parent.parent.loadQueries($queryID, $shortcut, '{$data->title}')}")); } $this->view->module = $module; $this->view->onMenuBar = $onMenuBar; diff --git a/module/search/lang/en.php b/module/search/lang/en.php index 78e4db7e8f..1c2c8d9f9a 100644 --- a/module/search/lang/en.php +++ b/module/search/lang/en.php @@ -29,6 +29,7 @@ $lang->search->me = 'Me'; $lang->search->noQuery = 'No query is saved yet!'; $lang->search->onMenuBar = 'Show in Menu'; $lang->search->custom = 'Custom'; +$lang->search->setCommon = 'Set as public query criteria'; $lang->search->account = 'Account'; $lang->search->module = 'Module'; diff --git a/module/search/lang/zh-cn.php b/module/search/lang/zh-cn.php index c7d5f00f49..ad6c1812bc 100644 --- a/module/search/lang/zh-cn.php +++ b/module/search/lang/zh-cn.php @@ -29,6 +29,7 @@ $lang->search->me = '自己'; $lang->search->noQuery = '还没有保存查询!'; $lang->search->onMenuBar = '显示在菜单栏'; $lang->search->custom = '自定义'; +$lang->search->setCommon = '设为公共查询条件'; $lang->search->account = '用户名'; $lang->search->module = '模块'; diff --git a/module/search/view/savequery.html.php b/module/search/view/savequery.html.php index 10fc96a318..6f1de90691 100644 --- a/module/search/view/savequery.html.php +++ b/module/search/view/savequery.html.php @@ -17,7 +17,7 @@
    - +
    From aae63736d36e99a23b8967914a94a834aef6eefa Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Thu, 17 Feb 2022 15:05:22 +0800 Subject: [PATCH 47/57] *Finish task #49307. --- module/story/control.php | 7 +++++-- module/story/view/batchedit.html.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 39c5db8eb8..317171157f 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -832,8 +832,11 @@ class story extends control foreach($branchList as $branchInfo) $branches[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : ''); $branchTagOption[$linkedProduct->id] = array(BRANCH_MAIN => $this->lang->branch->main) + $branches; - $modules[$linkedProduct->id] = $this->tree->getOptionMenu($linkedProduct->id, 'story', 0, array_keys($branchList)); - $plans[$linkedProduct->id] = $this->productplan->getBranchPlanPairs($linkedProduct->id, array_keys($branchList), true); + + $moduleList = $this->tree->getOptionMenu($linkedProduct->id, 'story', 0, array_keys($branchList)); + $modules[$linkedProduct->id] = $linkedProduct->type != 'normal' ? $moduleList : array(0 => $moduleList); + + $plans[$linkedProduct->id] = $this->productplan->getBranchPlanPairs($linkedProduct->id, array_keys($branchList), true); if(empty($plans[$linkedProduct->id])) $plans[$linkedProduct->id][0] = $plans[$linkedProduct->id]; if($linkedProduct->type != 'normal') $branchProduct = true; diff --git a/module/story/view/batchedit.html.php b/module/story/view/batchedit.html.php index 8f558508cb..eddc905b92 100644 --- a/module/story/view/batchedit.html.php +++ b/module/story/view/batchedit.html.php @@ -77,7 +77,7 @@ foreach(explode(',', $showFields) as $field) '> - product]->type == 'normal' ? (isset($modules[$story->product][$story->module])?$modules[$story->product][$story->module] : array('0' => '/')) : (isset($modules[$story->product][$story->branch][$story->module]) ? $modules[$story->product][$story->branch][$story->module] : array('0' => '/')), $story->module, "class='form-control chosen'");?> + product][$story->branch]) ? $modules[$story->product][$story->branch] : array('0' => '/'), $story->module, "class='form-control chosen'");?> '> product][$story->branch]) ? array('' => '') + $plans[$story->product][$story->branch] : '', $story->plan, "class='form-control chosen'");?> From c6174efcea9ba81f55cc91d70784fcb5f5201887 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 17 Feb 2022 15:06:48 +0800 Subject: [PATCH 48/57] * Finish task #49371. --- extension/lite/execution/ext/control/kanban.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extension/lite/execution/ext/control/kanban.php b/extension/lite/execution/ext/control/kanban.php index 478bb47c80..d56d524c6c 100644 --- a/extension/lite/execution/ext/control/kanban.php +++ b/extension/lite/execution/ext/control/kanban.php @@ -17,10 +17,11 @@ class myExecution extends execution $TRActions .= ""; $TRActions .= html::a('javascript:fullScreen()', " " . $this->lang->kanban->fullScreen, '', "class='btn btn-link'"); From 99fa22440426d59191ffe2a5392c2e07d343d7e1 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 17 Feb 2022 15:07:51 +0800 Subject: [PATCH 49/57] * Finish task #49371. --- .../lite/execution/ext/view/kanban.lite.html.hook.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/extension/lite/execution/ext/view/kanban.lite.html.hook.php b/extension/lite/execution/ext/view/kanban.lite.html.hook.php index 4e62f06cb1..9f92ca776a 100644 --- a/extension/lite/execution/ext/view/kanban.lite.html.hook.php +++ b/extension/lite/execution/ext/view/kanban.lite.html.hook.php @@ -1,6 +1,9 @@ From 20732c0d2af6a3e4ab4a540df2a3c89642e0ed02 Mon Sep 17 00:00:00 2001 From: Zongjun Lan Date: Thu, 17 Feb 2022 17:32:12 +0800 Subject: [PATCH 55/57] * Fix bug #49422 --- extension/lite/story/ext/view/change.lite.html.hook.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extension/lite/story/ext/view/change.lite.html.hook.php b/extension/lite/story/ext/view/change.lite.html.hook.php index 93f4c1b583..0d60003fee 100644 --- a/extension/lite/story/ext/view/change.lite.html.hook.php +++ b/extension/lite/story/ext/view/change.lite.html.hook.php @@ -1,6 +1,6 @@ From 3082abe478df30aa98e3873e16958895a1648221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Fri, 18 Feb 2022 08:36:54 +0800 Subject: [PATCH 56/57] * adjust for set vision. --- framework/base/router.class.php | 9 ++++++++- module/block/control.php | 1 + module/bug/model.php | 5 +++-- module/my/control.php | 4 ++++ module/user/control.php | 1 + module/user/model.php | 7 +++++++ 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/framework/base/router.class.php b/framework/base/router.class.php index f01484d775..2edcc0d071 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -694,11 +694,18 @@ class baseRouter public function setVision() { $account = isset($_SESSION['user']) ? $_SESSION['user']->account : ''; + if(empty($account) and isset($_POST['account'])) $account = $_POST['account']; + if(empty($account) and isset($_GET['account'])) $account = $_GET['account']; + $vision = ''; if($this->config->installed) $vision = $this->dbh->query("SELECT * FROM " . TABLE_CONFIG . " WHERE owner = '$account' AND `key` = 'vision' LIMIT 1")->fetch(); + if($vision) $vision = $vision->value; if(!empty($_SESSION['user']->visions) and empty($vision)) list($vision) = explode(',', $_SESSION['user']->visions); - $this->config->vision = $vision ? $vision->value : 'rnd'; + list($defaultVision) = explode(',', trim($this->config->visions, ',')); + if($vision and strpos($this->config->visions, ",{$vision},") === false) $vision = $defaultVision; + + $this->config->vision = $vision ? $vision : $defaultVision; } /** diff --git a/module/block/control.php b/module/block/control.php index 37051d7726..f0c3690fb1 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -1701,6 +1701,7 @@ class block extends control */ public function printAssignToMeBlock($longBlock = true) { + $hasViewPriv = array(); if(common::hasPriv('todo', 'view')) $hasViewPriv['todo'] = true; if(common::hasPriv('task', 'view')) $hasViewPriv['task'] = true; if(common::hasPriv('bug', 'view')) $hasViewPriv['bug'] = true; diff --git a/module/bug/model.php b/module/bug/model.php index 65a8a45bcb..ad7f3f6425 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1357,15 +1357,16 @@ class bugModel extends model * @param int $bugID * @param string $browseType * @param int $queryID + * @param object $pager * @access public * @return array */ - public function getBugs2Link($bugID, $browseType = 'bySearch', $queryID = 0, $pager) + public function getBugs2Link($bugID, $browseType = 'bySearch', $queryID = 0, $pager = null) { if($browseType == 'bySearch') { $bug = $this->getById($bugID); - $bugIDList = $bug->id . ',' . $bug->linkBug; + $bugIDList = $bug->id . ',' . $bug->linkBug; $bugs2Link = $this->getBySearch($bug->product, 'all', $queryID, 'id', $bugIDList, $pager); return $bugs2Link; } diff --git a/module/my/control.php b/module/my/control.php index 42ba8edbea..72d2cb2056 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -1273,6 +1273,10 @@ EOF; { $_SESSION['vision'] = $vision; $this->loadModel('setting')->setItem("{$this->app->user->account}.common.global.vision", $vision); + $this->config->vision = $vision; + + $_SESSION['user']->rights = $this->loadModel('user')->authorize($this->app->user->account); + echo js::locate($this->createLink('my', 'index'), 'parent'); } } diff --git a/module/user/control.php b/module/user/control.php index 40fde16ca4..21651689b9 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -977,6 +977,7 @@ class user extends control /* Check deny type. */ $rights = $this->app->user->rights['rights']; $acls = $this->app->user->rights['acls']; + $module = strtolower($module); $method = strtolower($method); diff --git a/module/user/model.php b/module/user/model.php index 75a1839fcd..0d09c394ec 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -1026,6 +1026,13 @@ class userModel extends model $projectAdminGroupID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('projectAdmin')->fetch('id'); $canManageProjects = $this->dao->select('project')->from(TABLE_USERGROUP)->where('`group`')->eq($projectAdminGroupID)->andWhere('account')->eq($account)->fetch('project'); } + + /* Set basic priv when no any priv. */ + if(empty($rights)) + { + $rights['index']['index'] = 1; + $rights['my']['index'] = 1; + } return array('rights' => $rights, 'acls' => $acls, 'projects' => $canManageProjects); } From 45900728ebfbdca78af7f8e5f1e11267a74af327 Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Fri, 18 Feb 2022 09:19:21 +0800 Subject: [PATCH 57/57] *Add sql --- db/update16.4.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/update16.4.sql b/db/update16.4.sql index 106d70915b..3bea7756a8 100644 --- a/db/update16.4.sql +++ b/db/update16.4.sql @@ -1,4 +1,4 @@ -ALTER TABLE `zt_userquery` MODIFY COLUMN `common` enum('0','1') NOT NULL DEFAULT '0'; +ALTER TABLE `zt_userquery` ADD `common` enum('0','1') NOT NULL DEFAULT '0'; ALTER TABLE `zt_project` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `order`; ALTER TABLE `zt_product` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `order`; @@ -20,4 +20,4 @@ ALTER TABLE `zt_effort` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `i ALTER TABLE `zt_story` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `id`; ALTER TABLE `zt_user` ADD `visions` varchar(20) NOT NULL AFTER `visits`; -UPDATE `zt_user` SET `visions`='rnd,lite'; \ No newline at end of file +UPDATE `zt_user` SET `visions`='rnd,lite';