From c232ec7c7de2fc88ba3f1bc2de0278ecd31e3827 Mon Sep 17 00:00:00 2001 From: Yagami Date: Mon, 24 Oct 2022 15:43:36 +0800 Subject: [PATCH 001/114] * Code for task #73233. --- db/update18.0.sql | 1 + module/programplan/model.php | 8 +++++--- module/programplan/view/create.html.php | 2 +- module/project/control.php | 9 +++++++++ module/project/js/create.js | 4 ++++ module/project/lang/de.php | 4 ++++ module/project/lang/en.php | 4 ++++ module/project/lang/fr.php | 4 ++++ module/project/lang/vi.php | 1 + module/project/lang/zh-cn.php | 4 ++++ module/project/view/create.html.php | 4 ++++ module/project/view/edit.html.php | 6 ++++++ module/stage/model.php | 27 +++++++++++++++---------- 13 files changed, 63 insertions(+), 15 deletions(-) create mode 100644 db/update18.0.sql diff --git a/db/update18.0.sql b/db/update18.0.sql new file mode 100644 index 0000000000..61c3416fb5 --- /dev/null +++ b/db/update18.0.sql @@ -0,0 +1 @@ +ALTER TABLE `zt_project` ADD `division` enum('0','1') COLLATE 'utf8_general_ci' NOT NULL DEFAULT '1'; diff --git a/module/programplan/model.php b/module/programplan/model.php index a3d20ecfad..da8c42342c 100755 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -727,7 +727,8 @@ class programplanModel extends model $datas[] = $plan; } - $project = $this->loadModel('project')->getByID($projectID); + $project = $this->loadModel('project')->getByID($projectID); + $productList = $this->loadModel('product')->getProductPairsByProject($projectID); $totalPercent = 0; $totalDevType = 0; @@ -928,8 +929,9 @@ class programplanModel extends model $this->setTreePath($stageID); if($data->acl != 'open') $this->user->updateUserView($stageID, 'sprint'); - - $this->post->set('products', array(0 => $productID)); + + $linkProducts = $project->division ? array(0 => $productID) : array_keys($productList); + $this->post->set('products', $linkProducts); $this->execution->updateProducts($stageID); /* Record version change information. */ diff --git a/module/programplan/view/create.html.php b/module/programplan/view/create.html.php index 9779a0db69..783ff44094 100644 --- a/module/programplan/view/create.html.php +++ b/module/programplan/view/create.html.php @@ -22,7 +22,7 @@ echo "{$title}"; ?> - + division):?>
diff --git a/module/project/control.php b/module/project/control.php index cd216bd8cf..f2a9437eee 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -2042,6 +2042,7 @@ class project extends control { $this->loadModel('product'); $this->loadModel('program'); + $this->loadModel('execution'); if(!empty($_POST)) { @@ -2058,6 +2059,14 @@ class project extends control $oldProducts = array_keys($oldProducts); $newProducts = $this->product->getProducts($projectID); $newProducts = array_keys($newProducts); + + if(!$project->division and $newProducts) + { + $stages = $this->execution->getPairs($projectID); + $this->post->set('products', $newProducts); + foreach($stages as $stageID => $name) $this->execution->updateProducts($stageID); + } + $diffProducts = array_merge(array_diff($oldProducts, $newProducts), array_diff($newProducts, $oldProducts)); if($diffProducts) $this->loadModel('action')->create('project', $projectID, 'Managed', '', !empty($_POST['products']) ? join(',', $_POST['products']) : ''); diff --git a/module/project/js/create.js b/module/project/js/create.js index fe2a8db61c..4ae6217d3e 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -253,9 +253,11 @@ function setAclList(programID) */ function loadBranches(product) { + var chosenProducts = 0; $("#productsBox select[name^='products']").each(function() { var $product = $(product); + if($(this).val() > 0) chosenProducts ++; if($product.val() != 0 && $product.val() == $(this).val() && $product.attr('id') != $(this).attr('id') && !multiBranchProducts[$product.val()]) { bootbox.alert(errorSameProducts); @@ -265,6 +267,8 @@ function loadBranches(product) } }); + chosenProducts > 1 ? $('.division').removeClass('hide') : $('.division').addClass('hide'); + if($('#productsBox .row .input-group:last select:first').val() != 0) { var length = $('#productsBox .row .input-group').size(); diff --git a/module/project/lang/de.php b/module/project/lang/de.php index b00209d457..b59dea8fb2 100644 --- a/module/project/lang/de.php +++ b/module/project/lang/de.php @@ -127,6 +127,7 @@ $lang->project->realBeganAB = 'Actual Begin'; $lang->project->realEndAB = 'Actual End'; $lang->project->realBegan = 'Actual Began'; $lang->project->realEnd = 'Actual End'; +$lang->project->division = 'Create Stages by Product'; $lang->project->bygrid = 'Kanban'; $lang->project->bylist = 'List'; $lang->project->bycard = 'Card'; @@ -177,6 +178,9 @@ $lang->project->typeList = array(); $lang->project->typeList['my'] = 'Projects Ownedbyme'; $lang->project->typeList['other'] = 'Other Projects'; +$lang->project->divisionList['0'] = 'Disable'; +$lang->project->divisionList['1'] = 'Enable'; + $lang->project->waitProjects = 'Waiting Projects'; $lang->project->doingProjects = 'Ongoing Projects'; $lang->project->doingExecutions = 'Ongoing Executions'; diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 544f00918f..e2e896ec13 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -127,6 +127,7 @@ $lang->project->realBeganAB = 'Actual Begin'; $lang->project->realEndAB = 'Actual End'; $lang->project->realBegan = 'Actual Begin'; $lang->project->realEnd = 'Actual End'; +$lang->project->division = 'Create Stages by Product'; $lang->project->bygrid = 'Kanban'; $lang->project->bylist = 'List'; $lang->project->bycard = 'Card'; @@ -177,6 +178,9 @@ $lang->project->typeList = array(); $lang->project->typeList['my'] = 'Projects Ownedbyme'; $lang->project->typeList['other'] = 'Other Projects'; +$lang->project->divisionList['0'] = 'Disable'; +$lang->project->divisionList['1'] = 'Enable'; + $lang->project->waitProjects = 'Waiting Projects'; $lang->project->doingProjects = 'Ongoing Projects'; $lang->project->doingExecutions = 'Ongoing Executions'; diff --git a/module/project/lang/fr.php b/module/project/lang/fr.php index 7168356f4d..0f5591b24d 100644 --- a/module/project/lang/fr.php +++ b/module/project/lang/fr.php @@ -127,6 +127,7 @@ $lang->project->realBeganAB = 'Actual Begin'; $lang->project->realEndAB = 'Actual End'; $lang->project->realBegan = 'Actual Began'; $lang->project->realEnd = 'Actual End'; +$lang->project->division = 'Create Stages by Product'; $lang->project->bygrid = 'Kanban'; $lang->project->bylist = 'List'; $lang->project->bycard = 'Card'; @@ -177,6 +178,9 @@ $lang->project->typeList = array(); $lang->project->typeList['my'] = 'Projects Ownedbyme'; $lang->project->typeList['other'] = 'Other Projects'; +$lang->project->divisionList['0'] = 'Disable'; +$lang->project->divisionList['1'] = 'Enable'; + $lang->project->waitProjects = 'Waiting Projects'; $lang->project->doingProjects = 'Ongoing Projects'; $lang->project->doingExecutions = 'Ongoing Executions'; diff --git a/module/project/lang/vi.php b/module/project/lang/vi.php index 7c3bd62dcd..8b3fec9d3a 100644 --- a/module/project/lang/vi.php +++ b/module/project/lang/vi.php @@ -75,6 +75,7 @@ $lang->project->dateRange = 'Duration'; $lang->project->to = ' to '; $lang->project->realEnd = 'Actual End'; $lang->project->realBegan = 'Actual Began'; +$lang->project->division = 'Create Stages by Product'; $lang->project->bygrid = 'Kanban'; $lang->project->bylist = 'List'; $lang->project->bycard = 'Card'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 1d0e642dd1..5965287bd9 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -127,6 +127,7 @@ $lang->project->realBeganAB = '实际开始'; $lang->project->realEndAB = '实际完成'; $lang->project->realBegan = '实际开始日期'; $lang->project->realEnd = '实际完成日期'; +$lang->project->division = '按产品创建阶段'; $lang->project->bygrid = '看板'; $lang->project->bylist = '列表'; $lang->project->bycard = '卡片'; @@ -177,6 +178,9 @@ $lang->project->typeList = array(); $lang->project->typeList['my'] = '我负责的项目'; $lang->project->typeList['other'] = '其他项目'; +$lang->project->divisionList['0'] = '关闭'; +$lang->project->divisionList['1'] = '开启'; + $lang->project->waitProjects = '未开始的项目'; $lang->project->doingProjects = '进行中的项目'; $lang->project->doingExecutions = '进行中的执行(最近1个)'; diff --git a/module/project/view/create.html.php b/module/project/view/create.html.php index d994c4f549..5c9a32a140 100755 --- a/module/project/view/create.html.php +++ b/module/project/view/create.html.php @@ -175,6 +175,10 @@
+ + project->division;?> + project->divisionList, '0');?> + execution->team;?> diff --git a/module/project/view/edit.html.php b/module/project/view/edit.html.php index d787c89338..00ece4458c 100755 --- a/module/project/view/edit.html.php +++ b/module/project/view/edit.html.php @@ -175,6 +175,12 @@ + division):?> + + project->division;?> + project->divisionList, $project->division);?> + + model == 'kanban'):?> execution->team;?> diff --git a/module/stage/model.php b/module/stage/model.php index 86c3fb0b88..92fca02779 100644 --- a/module/stage/model.php +++ b/module/stage/model.php @@ -123,17 +123,22 @@ class stageModel extends model */ public function getStages($orderBy = 'id_desc', $projectID = 0) { - $stages = $this->dao->select('id,name,type,percent,openedBy as createdBy,begin as createdDate,lastEditedBy as editedBy,end as editedDate,deleted') - ->from(TABLE_EXECUTION) - ->where('type')->in('sprint,stage,kanban') - ->andWhere('deleted')->eq('0') - ->andWhere('vision')->eq($this->config->vision) - ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi() - ->beginIF($projectID)->andWhere('project')->eq($projectID)->fi() - ->orderBy($orderBy) - ->fetchAll('id'); - $stages = !empty($stages) ? $stages : $this->dao->select('*')->from(TABLE_STAGE)->where('deleted')->eq(0)->orderBy($orderBy)->fetchAll('id'); - return $stages; + if($projectID) + { + return $this->dao->select('id,name,type,percent,openedBy as createdBy,begin as createdDate,lastEditedBy as editedBy,end as editedDate,deleted') + ->from(TABLE_EXECUTION) + ->where('type')->in('sprint,stage,kanban') + ->andWhere('deleted')->eq('0') + ->andWhere('vision')->eq($this->config->vision) + ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi() + ->andWhere('project')->eq($projectID) + ->orderBy($orderBy) + ->fetchAll('id'); + } + else + { + return $this->dao->select('*')->from(TABLE_STAGE)->where('deleted')->eq(0)->orderBy($orderBy)->fetchAll('id'); + } } /** From 1875b5be0ee32980a8db145414776c774c80dbbd Mon Sep 17 00:00:00 2001 From: Yagami Date: Tue, 25 Oct 2022 09:25:07 +0800 Subject: [PATCH 002/114] * Fix bug #73233. --- module/project/control.php | 4 +++- module/project/lang/de.php | 1 + module/project/lang/en.php | 1 + module/project/lang/fr.php | 1 + module/project/lang/vi.php | 1 + module/project/lang/zh-cn.php | 1 + module/project/model.php | 2 ++ module/project/view/manageproducts.html.php | 16 ++++++++++++++++ 8 files changed, 26 insertions(+), 1 deletion(-) diff --git a/module/project/control.php b/module/project/control.php index f2a9437eee..64c64facf5 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -2044,6 +2044,8 @@ class project extends control $this->loadModel('program'); $this->loadModel('execution'); + $project = $this->project->getById($projectID); + if(!empty($_POST)) { if(!isset($_POST['products'])) @@ -2075,7 +2077,6 @@ class project extends control return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locateLink)); } - $project = $this->project->getById($projectID); if($this->app->tab == 'program') { $this->program->setMenu($project->parent); @@ -2120,6 +2121,7 @@ class project extends control $this->view->linkedProducts = $linkedProducts; $this->view->linkedBranches = $linkedBranches; $this->view->branches = $branches; + $this->view->project = $project; $this->view->unmodifiableProducts = $unmodifiableProducts; $this->view->unmodifiableBranches = $unmodifiableBranches; $this->view->unmodifiableMainBranches = $unmodifiableMainBranches; diff --git a/module/project/lang/de.php b/module/project/lang/de.php index b59dea8fb2..c51d365559 100644 --- a/module/project/lang/de.php +++ b/module/project/lang/de.php @@ -196,6 +196,7 @@ $lang->project->changeProgram = '%s > Change project'; $lang->project->changeProgramTip = 'After modifying the project set, the products linked with the project will also modify the project set to which it belongs. Please confirm whether to modify it.'; $lang->project->linkedProjectsTip = 'Linked projects are as follows'; $lang->project->multiLinkedProductsTip = 'The following products linked to this project are also linked to other projects, please unlink before proceeding.'; +$lang->project->noticeDivsion = "The current project is associated with multiple products, you can click Confirm to open the mode by {$lang->productCommon} creation stage, click Cancel to keep the status quo."; $lang->project->linkStoryByPlanTips = "This action will associate all {$lang->SRCommon} under the selected plan to this project"; $lang->project->createExecution = "There is no {$lang->executionCommon} under this project, please create {$lang->executionCommon} first"; $lang->project->unlinkExecutionMember = "The user participated in %s executions such as %s%s. Do you want to remove the user from those executions as well? (The data related to this user will not be deleted.)"; diff --git a/module/project/lang/en.php b/module/project/lang/en.php index e2e896ec13..ebc9540e26 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -196,6 +196,7 @@ $lang->project->changeProgram = '%s > Change project'; $lang->project->changeProgramTip = 'Once the program is edited, the product that is linked to this program will be changed. Do you want to edit it?'; $lang->project->linkedProjectsTip = 'Linked projects are as follows'; $lang->project->multiLinkedProductsTip = 'The following products linked to this project are also linked to other projects, please unlink before proceeding.'; +$lang->project->noticeDivsion = "The current project is associated with multiple products, you can click Confirm to open the mode by {$lang->productCommon} creation stage, click Cancel to keep the status quo."; $lang->project->linkStoryByPlanTips = "This action will associate all {$lang->SRCommon} under the selected plan to this project"; $lang->project->createExecution = "There is no {$lang->executionCommon} under this project, please create {$lang->executionCommon} first"; $lang->project->unlinkExecutionMember = "The user participated in %s executions such as %s%s. Do you want to remove the user from those executions as well? (The data related to this user will not be deleted.)"; diff --git a/module/project/lang/fr.php b/module/project/lang/fr.php index 0f5591b24d..3e86cd7cc7 100644 --- a/module/project/lang/fr.php +++ b/module/project/lang/fr.php @@ -196,6 +196,7 @@ $lang->project->changeProgram = '%s > Change project'; $lang->project->changeProgramTip = 'After modifying the project set, the products linked with the project will also modify the project set to which it belongs. Please confirm whether to modify it.'; $lang->project->linkedProjectsTip = 'Linked projects are as follows'; $lang->project->multiLinkedProductsTip = 'The following products linked to this project are also linked to other projects, please unlink before proceeding.'; +$lang->project->noticeDivsion = "The current project is associated with multiple products, you can click Confirm to open the mode by {$lang->productCommon} creation stage, click Cancel to keep the status quo."; $lang->project->linkStoryByPlanTips = "This action will associate all {$lang->SRCommon} under the selected plan to this project"; $lang->project->createExecution = "There is no {$lang->executionCommon} under this project, please create {$lang->executionCommon} first"; $lang->project->unlinkExecutionMember = "The user participated in %s executions such as %s%s. Do you want to remove the user from those executions as well? (The data related to this user will not be deleted.)"; diff --git a/module/project/lang/vi.php b/module/project/lang/vi.php index 8b3fec9d3a..2aed7d8d15 100644 --- a/module/project/lang/vi.php +++ b/module/project/lang/vi.php @@ -116,6 +116,7 @@ $lang->project->changeProgram = '%s > Change project'; $lang->project->changeProgramTip = 'After modifying the project set, the products linked with the project will also modify the project set to which it belongs. Please confirm whether to modify it.'; $lang->project->linkedProjectsTip = 'Linked projects are as follows'; $lang->project->multiLinkedProductsTip = 'The following products linked to this project are also linked to other projects, please unlink before proceeding.'; +$lang->project->noticeDivsion = "The current project is associated with multiple products, you can click Confirm to open the mode by {$lang->productCommon} creation stage, click Cancel to keep the status quo."; $lang->project->linkStoryByPlanTips = "This action will associate all {$lang->SRCommon} under the selected plan to this project"; $lang->project->createExecution = "There is no {$lang->executionCommon} under this project, please create {$lang->executionCommon} first"; $lang->project->noDevStage = 'There is no R&D stage under this project, or you do not have access permissions. The creation of builds is not supported at the moment.'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 5965287bd9..8d691dc9f8 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -196,6 +196,7 @@ $lang->project->changeProgram = '%s > 修改项目集'; $lang->project->changeProgramTip = '修改项目集后,该项目关联产品的项目集也会被修改,请确认是否修改。'; $lang->project->linkedProjectsTip = '关联的项目如下'; $lang->project->multiLinkedProductsTip = '该项目关联的如下产品还关联了其他项目,请取消关联后再操作'; +$lang->project->noticeDivsion = '当前项目关联多个产品,可以点击确认开启按产品创建阶段的模式,点击取消则保持现状。'; $lang->project->linkStoryByPlanTips = "此操作会将所选计划下面的{$lang->SRCommon}全部关联到此项目中"; $lang->project->createExecution = "该项目下没有{$lang->executionCommon},请先创建{$lang->executionCommon}"; $lang->project->unlinkExecutionMember = "该用户参与了%s%s%s个{$lang->execution->common},是否同时将其移除?(该用户所产生的数据不会受影响。)"; diff --git a/module/project/model.php b/module/project/model.php index 94c8d58ae7..84be5de600 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2164,6 +2164,8 @@ class projectModel extends model { $executions = $this->dao->select('id')->from(TABLE_EXECUTION)->where('project')->eq((int)$projectID)->fetchPairs('id'); $this->dao->delete()->from(TABLE_PROJECTPRODUCT)->where('project')->in($executions)->andWhere('product')->notin($products)->exec(); + + if(isset($_POST['division'])) $this->dao->update(TABLE_PROJECT)->set('division')->eq('1')->where('id')->eq((int)$projectID)->exec(); } $oldProductKeys = array_keys($oldProjectProducts); diff --git a/module/project/view/manageproducts.html.php b/module/project/view/manageproducts.html.php index 1a214f23ff..8059e09759 100644 --- a/module/project/view/manageproducts.html.php +++ b/module/project/view/manageproducts.html.php @@ -75,4 +75,20 @@ +division and count($linkedProducts) == 1):?> +project->noticeDivsion);?> + + From e06a98bd09eb59bdd888d4db5843c0f08875d796 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Tue, 25 Oct 2022 16:26:10 +0800 Subject: [PATCH 003/114] * Code for task #73235. --- module/programplan/control.php | 46 +++++++++++----- module/programplan/lang/de.php | 2 + module/programplan/lang/en.php | 2 + module/programplan/lang/fr.php | 2 + module/programplan/lang/zh-cn.php | 2 + module/programplan/view/gantt.html.php | 72 +++++++++++++++----------- module/project/view/execution.html.php | 4 ++ 7 files changed, 88 insertions(+), 42 deletions(-) diff --git a/module/programplan/control.php b/module/programplan/control.php index 2c66ab4dfa..d607021d95 100644 --- a/module/programplan/control.php +++ b/module/programplan/control.php @@ -119,6 +119,7 @@ class programplan extends control $this->view->position[] = $this->lang->programplan->browse; $this->view->projectID = $projectID; $this->view->productID = $this->productID; + $this->view->productList = $this->loadModel('product')->getProductPairsByProject($projectID); $this->view->type = $type; $this->view->plans = $plans; $this->view->orderBy = $orderBy; @@ -245,19 +246,40 @@ class programplan extends control */ public function ajaxCustom() { - $data = fixer::input('post')->get(); - $owner = $this->app->user->account; - $module = 'programplan'; - $section = 'browse'; - $object = 'stageCustom'; - $setting = $this->loadModel('setting'); - $custom = empty($data->stageCustom) ? '' : implode(',', $data->stageCustom); - $setting->setItem("$owner.$module.$section.$object", $custom); + $owner = $this->app->user->account; + $module = 'programplan'; + $this->app->loadLang('execution'); + $this->loadModel('datatable'); + $this->loadModel('setting'); - $response = array(); - $response['result'] = 'success'; - $response['message'] = ''; - return $this->send($response); + $stageCustom = $this->setting->getItem("owner=$owner&module=$module§ion=browse&key=stageCustom"); + $ganttFields = $this->setting->getItem("owner=$owner&module=$module§ion=ganttCustom&key=ganttFields"); + $zooming = $this->setting->getItem("owner=$owner&module=$module§ion=ganttCustom&key=zooming"); + + if($_POST) + { + $data = fixer::input('post')->get(); + $zooming = empty($data->zooming) ? '' : $data->zooming; + $stageCustom = empty($data->stageCustom) ? '' : implode(',', $data->stageCustom); + $ganttFields = empty($data->ganttFields) ? '' : implode(',', $data->ganttFields); + + $this->setting->setItem("$owner.$module.browse.stageCustom", $stageCustom); + $this->setting->setItem("$owner.$module.ganttCustom.ganttFields", $ganttFields); + $this->setting->setItem("$owner.$module.ganttCustom.zooming", $zooming); + + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); + } + + /* Set Custom. */ + foreach(explode(',', $this->config->programplan->custom->customGanttFields) as $field) $customFields[$field] = $this->lang->programplan->ganttCustom[$field]; + + $this->view->zooming = $zooming; + $this->view->customFields = $customFields; + $this->view->showFields = $this->config->programplan->ganttCustom->ganttFields; + $this->view->ganttFields = $ganttFields; + $this->view->stageCustom = $stageCustom; + + $this->display(); } /** diff --git a/module/programplan/lang/de.php b/module/programplan/lang/de.php index 889b03bcaa..a186daf4c5 100644 --- a/module/programplan/lang/de.php +++ b/module/programplan/lang/de.php @@ -62,6 +62,8 @@ $lang->programplan->hideCriticalPath = 'Hide Critical Path'; $lang->programplan->showCriticalPath = 'Show Critical Path'; $lang->programplan->delay = 'Delay'; $lang->programplan->delayDays = 'Delay days'; +$lang->programplan->settingGantt = 'Gantt Setting'; +$lang->programplan->viewSetting = 'Setting'; $lang->programplan->errorBegin = "Project begin date: %s, begin date should be >= project begin date."; $lang->programplan->errorEnd = "Project end date: %s, end date should be <= project end date."; diff --git a/module/programplan/lang/en.php b/module/programplan/lang/en.php index 6ed9867b61..b2084c75f4 100644 --- a/module/programplan/lang/en.php +++ b/module/programplan/lang/en.php @@ -62,6 +62,8 @@ $lang->programplan->hideCriticalPath = 'Hide Critical Path'; $lang->programplan->showCriticalPath = 'Show Critical Path'; $lang->programplan->delay = 'Delay'; $lang->programplan->delayDays = 'Delay days'; +$lang->programplan->settingGantt = 'Gantt Setting'; +$lang->programplan->viewSetting = 'Setting'; $lang->programplan->errorBegin = "Project begin date: %s, begin date should be >= project begin date."; $lang->programplan->errorEnd = "Project end date: %s, end date should be <= project end date."; diff --git a/module/programplan/lang/fr.php b/module/programplan/lang/fr.php index 889b03bcaa..a186daf4c5 100644 --- a/module/programplan/lang/fr.php +++ b/module/programplan/lang/fr.php @@ -62,6 +62,8 @@ $lang->programplan->hideCriticalPath = 'Hide Critical Path'; $lang->programplan->showCriticalPath = 'Show Critical Path'; $lang->programplan->delay = 'Delay'; $lang->programplan->delayDays = 'Delay days'; +$lang->programplan->settingGantt = 'Gantt Setting'; +$lang->programplan->viewSetting = 'Setting'; $lang->programplan->errorBegin = "Project begin date: %s, begin date should be >= project begin date."; $lang->programplan->errorEnd = "Project end date: %s, end date should be <= project end date."; diff --git a/module/programplan/lang/zh-cn.php b/module/programplan/lang/zh-cn.php index 1e4fdfbacd..b3f4b04429 100644 --- a/module/programplan/lang/zh-cn.php +++ b/module/programplan/lang/zh-cn.php @@ -62,6 +62,8 @@ $lang->programplan->hideCriticalPath = '隐藏关键路径'; $lang->programplan->showCriticalPath = '显示关键路径'; $lang->programplan->delay = '是否延期'; $lang->programplan->delayDays = '延期天数'; +$lang->programplan->settingGantt = '设置甘特图'; +$lang->programplan->viewSetting = '显示设置'; $lang->programplan->errorBegin = '阶段的开始时间不能小于所属项目的开始时间%s'; $lang->programplan->errorEnd = '阶段的结束时间不能大于所属项目的结束时间%s'; diff --git a/module/programplan/view/gantt.html.php b/module/programplan/view/gantt.html.php index 6b1f88c074..e68b128d0e 100644 --- a/module/programplan/view/gantt.html.php +++ b/module/programplan/view/gantt.html.php @@ -45,7 +45,7 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;} .gantt_row.task-item{cursor: pointer;} #ganttDownload, #ganttHeader {display: none;} -#ganttContainer {margin-top: 10px;} +#ganttContainer {margin-top: 40px;} #mainContent:before {background: #fff;} #mainContent.loading {overflow: hidden} #mainContent.loading #ganttView {overflow: hidden} @@ -65,6 +65,9 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;} .gantt_task_line.gantt_task_inline_color{border:0px;} .gantt_grid_scale, .gantt_task_scale, .gantt_task_vscroll{background-color: #F2F7FF;} #myCover {display:none;left:12px!important;z-index:10!important;top:9px!important;height:unset!important;} +.button-group{position: relative;} +.flax{display: flex; margin-bottom: 10px;} +.switchBtn > i {padding-left: 7px;} createLink('programplan', 'ajaxCustom'));?> @@ -74,34 +77,43 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;} config->programplan->ganttCustom->ganttFields);?>
-
- app->getModuleName() == 'programplan') - { - $customLink = $this->createLink('custom', 'ajaxSaveCustomFields', 'module=programplan§ion=ganttCustom&key=ganttFields'); - include '../../common/view/customfield.html.php'; - } - ?> -
-
-
- programplan->full, 'id="fullScreenBtn"', 'btn btn-primary btn-sm')?> - rawModule == 'review' and $app->rawMethod == 'assess') unset($lang->programplan->stageCustom->date); ?> - programplan->stageCustom, $selectCustom);?> - - + app->getModuleName() == 'programplan'):?> +
+
+ product->allProduct;?> + +
- +
+
+
+ createLink('project', 'execution', "status=all&projectID=$projectID"),"  ", '', "class='btn btn-icon switchBtn' title='{$lang->project->bylist}'");?> +  ", '', "class='btn btn-icon text-primary switchBtn' title='{$lang->programplan->gantt}'");?> +
+ programplan->full;?> + + ' . $lang->settings, '', "class='iframe btn btn-link' data-width='30%'"); + if(common::hasPriv('programplan', 'create')) echo html::a($this->createLink('programplan', 'create', "projectID=$projectID"), " " . $this->lang->programplan->create, '', "class='btn btn-primary'"); + ?> +
+
@@ -145,7 +157,7 @@ gantt.init("gantt_here"); gantt.attachEvent("onBeforeExpand",function(){ $('#myCover').css('display', 'unset'); $('#mainContent .pull-right').css('opacity', '0'); - $('.example').css('display', 'none'); + $('.btn-toolbar').css('display', 'none'); return true; }); @@ -153,7 +165,7 @@ gantt.attachEvent("onBeforeExpand",function(){ gantt.attachEvent("onCollapse", function (){ $('#myCover').css('display', 'none'); $('#mainContent .pull-right').css('opacity', '1'); - $('.example').css('display', 'block'); + $('.btn-toolbar').css('display', 'flex'); }); /** diff --git a/module/project/view/execution.html.php b/module/project/view/execution.html.php index 0c47eaabf2..d349c0629b 100644 --- a/module/project/view/execution.html.php +++ b/module/project/view/execution.html.php @@ -40,6 +40,10 @@ $lang->programplan->stageCustom->task), '', $this->cookie->showTask ? 'checked=checked' : '');?>
+
+  ", '', "class='btn btn-icon text-primary switchBtn' title='{$lang->project->bylist}'");?> + createLink('programplan', 'browse', "projectID=$projectID&productID=$productID&type=gantt"), "  ", '', "class='btn btn-icon switchBtn' title='{$lang->programplan->gantt}'");?> +
" . $lang->export, '', "class='btn btn-link export'")?> createLink('programplan', 'create', "projectID=$projectID&productID=$productID"), " " . $lang->programplan->create, '', "class='btn btn-primary'");?> From dc2745f5ba086b72e1830d97f353e6e495234fc8 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Tue, 25 Oct 2022 16:35:26 +0800 Subject: [PATCH 004/114] * Add view.html.php for gantt setting. --- module/programplan/control.php | 8 ---- module/programplan/view/ajaxcustom.html.php | 44 +++++++++++++++++++++ 2 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 module/programplan/view/ajaxcustom.html.php diff --git a/module/programplan/control.php b/module/programplan/control.php index d607021d95..efb2988be9 100644 --- a/module/programplan/control.php +++ b/module/programplan/control.php @@ -64,14 +64,6 @@ class programplan extends control $products = $this->loadModel('product')->getProducts($projectID); $this->lang->modulePageNav = $this->product->select($products, $this->productID, 'programplan', 'browse', $type, 0, 0, '', false); - $this->lang->TRActions = ""; - $this->lang->TRActions .= ""; - - if(common::hasPriv('programplan', 'create')) $this->lang->TRActions .= html::a($this->createLink('programplan', 'create', "projectID=$projectID"), " " . $this->lang->programplan->create, '', "class='btn btn-primary'"); - $selectCustom = 0; // Display date and task settings. $dateDetails = 1; // Gantt chart detail date display. if($type == 'gantt') diff --git a/module/programplan/view/ajaxcustom.html.php b/module/programplan/view/ajaxcustom.html.php new file mode 100644 index 0000000000..dd0e8c015c --- /dev/null +++ b/module/programplan/view/ajaxcustom.html.php @@ -0,0 +1,44 @@ + + * @package programplan + * @version $Id: ajaxcustom.html.php 935 2022-10-25 16:15:24Z $ + * @link https://www.zentao.net + */ +?> + + + +
+
+

programplan->settingGantt;?>

+
+
+ + + + + + + + + + + + + + + + +
execution->gantt->format;?>execution->gantt->zooming, $zooming ? $zooming : 'day');?>
programplan->viewSetting;?>programplan->stageCustom, $stageCustom);?>
customField;?>
+ +
+
+
+ From 0df7b3ec6d5a2de78d7ee299c6f4333e5542d6b2 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 25 Oct 2022 17:19:47 +0800 Subject: [PATCH 005/114] * task #73243 --- module/port/model.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/module/port/model.php b/module/port/model.php index 0f30d9aa1a..8e71df1d80 100644 --- a/module/port/model.php +++ b/module/port/model.php @@ -808,10 +808,25 @@ class portModel extends model */ public function getQueryDatas($model = '') { - $queryCondition = $this->session->{$model . 'QueryCondition'}; - $onlyCondition = $this->session->{$model . 'OnlyCondition'}; + $queryCondition = $this->session->{$model . 'QueryCondition'}; + $onlyCondition = $this->session->{$model . 'OnlyCondition'}; + $transferCondition = $this->session->{$model . 'TransferCondition'}; $modelDatas = array(); + + if($transferCondition) + { + $selectKey = 'id'; + $stmt = $this->dbh->query($transferCondition); + while($row = $stmt->fetch()) + { + if($selectKey !== 't1.id' and isset($row->$model) and isset($row->id)) $row->id = $row->$model; + $modelDatas[$row->id] = $row; + } + + return $modelDatas; + } + if($onlyCondition and $queryCondition) { $table = zget($this->config->objectTables, $model); From cf00a736a1cc72146302f5ea4ac520a42d468fb4 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Wed, 26 Oct 2022 09:03:24 +0800 Subject: [PATCH 006/114] * Finish task #73241. --- module/execution/model.php | 3 +++ module/execution/view/edit.html.php | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/module/execution/model.php b/module/execution/model.php index c72f62c2a5..d60d43d29a 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -64,6 +64,9 @@ class executionModel extends model public function setMenu($executionID, $buildID = 0, $extra = '') { $execution = $this->getByID($executionID); + + if($execution->type == 'stage') unset($this->lang->execution->menu->settings['subMenu']->products); + if($execution and $execution->type == 'kanban') { global $lang; diff --git a/module/execution/view/edit.html.php b/module/execution/view/edit.html.php index 27a7b10be2..1e6bb50aaa 100644 --- a/module/execution/view/edit.html.php +++ b/module/execution/view/edit.html.php @@ -142,7 +142,7 @@ execution->manageProducts;?> - grade == 2 ? "readonly='readonly'" : '';?> + grade == 2 or $execution->type == 'stage') ? "disabled" : '';?>
@@ -165,12 +165,14 @@ ?> + type != 'stage'):?>
+
From e24e771dee07db0e5781e15d6f6b888288adaeba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Wed, 26 Oct 2022 09:27:04 +0800 Subject: [PATCH 007/114] * Code for task #73233. --- module/project/js/common.js | 4 ++++ module/project/model.php | 2 +- module/project/view/edit.html.php | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/module/project/js/common.js b/module/project/js/common.js index a0c7b3c6fc..11023d7c65 100644 --- a/module/project/js/common.js +++ b/module/project/js/common.js @@ -150,9 +150,11 @@ function loadBranches(product) /* When selecting a product, delete a plan that is empty by default. */ $("#planDefault").remove(); + var chosenProducts = 0; $("#productsBox select[name^='products']").each(function() { var $product = $(product); + if($(this).val() > 0) chosenProducts ++; if($product.val() != 0 && $product.val() == $(this).val() && $product.attr('id') != $(this).attr('id') && !multiBranchProducts[$product.val()]) { bootbox.alert(errorSameProducts); @@ -162,6 +164,8 @@ function loadBranches(product) } }); + chosenProducts > 1 ? $('.division').removeClass('hide') : $('.division').addClass('hide'); + if($('#productsBox .input-group:last select:first').val() != 0) { var length = $('#productsBox .input-group').size(); diff --git a/module/project/model.php b/module/project/model.php index 84be5de600..9e1f45844c 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2165,7 +2165,7 @@ class projectModel extends model $executions = $this->dao->select('id')->from(TABLE_EXECUTION)->where('project')->eq((int)$projectID)->fetchPairs('id'); $this->dao->delete()->from(TABLE_PROJECTPRODUCT)->where('project')->in($executions)->andWhere('product')->notin($products)->exec(); - if(isset($_POST['division'])) $this->dao->update(TABLE_PROJECT)->set('division')->eq('1')->where('id')->eq((int)$projectID)->exec(); + if(!empty($_POST['division'])) $this->dao->update(TABLE_PROJECT)->set('division')->eq('1')->where('id')->eq((int)$projectID)->exec(); } $oldProductKeys = array_keys($oldProjectProducts); diff --git a/module/project/view/edit.html.php b/module/project/view/edit.html.php index 00ece4458c..79bc96f872 100755 --- a/module/project/view/edit.html.php +++ b/module/project/view/edit.html.php @@ -175,8 +175,8 @@
- division):?> - + model == 'waterfall'):?> + project->division;?> project->divisionList, $project->division);?> From 2f0471084314e99926a0b54455eadbd6b3f05ef9 Mon Sep 17 00:00:00 2001 From: Yagami Date: Wed, 26 Oct 2022 15:41:53 +0800 Subject: [PATCH 008/114] * Finish task #73233. --- module/project/control.php | 11 +++++++++++ module/project/js/create.js | 2 +- module/project/model.php | 7 +++++++ module/project/view/create.html.php | 2 ++ module/project/view/edit.html.php | 6 ++++-- 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/module/project/control.php b/module/project/control.php index 64c64facf5..db36c579eb 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -704,6 +704,16 @@ class project extends control if($project->model != 'kanban') $canChangeModel = $this->project->checkCanChangeModel($projectID, $project->model); + /* Get stages group by project's product. */ + $productStages = $this->dao->select('t1.product,t1.project')->from(TABLE_PROJECTPRODUCT)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') + ->where('t2.deleted')->eq('0') + ->andWhere('t2.type')->ne('project') + ->andWhere('t2.project')->eq($projectID) + ->andWhere('t1.product')->in($linkedProductIdList) + ->groupBy('t1.product') + ->fetchGroup('product'); + $this->view->title = $this->lang->project->edit; $this->view->position[] = $this->lang->project->edit; @@ -719,6 +729,7 @@ class project extends control $this->view->linkedProducts = $linkedProducts; $this->view->linkedBranches = $linkedBranches; $this->view->branches = $branches; + $this->view->multiProductStages = ($project->division and count($linkedProducts) > 1 and count($productStages) > 1); $this->view->unmodifiableProducts = $unmodifiableProducts; $this->view->unmodifiableBranches = $unmodifiableBranches; $this->view->unmodifiableMainBranches = $unmodifiableMainBranches; diff --git a/module/project/js/create.js b/module/project/js/create.js index 4ae6217d3e..947f2257bb 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -267,7 +267,7 @@ function loadBranches(product) } }); - chosenProducts > 1 ? $('.division').removeClass('hide') : $('.division').addClass('hide'); + (chosenProducts > 1 && model == 'waterfall') ? $('.division').removeClass('hide') : $('.division').addClass('hide'); if($('#productsBox .row .input-group:last select:first').val() != 0) { diff --git a/module/project/model.php b/module/project/model.php index 9e1f45844c..afc399e1dd 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1469,6 +1469,13 @@ class projectModel extends model $this->updateProducts($projectID, $_POST['products']); $this->file->updateObjectID($this->post->uid, $projectID, 'project'); + /* Link project's products to project's stages when project's division is closed and products has changed. */ + if(!$project->division and $_POST['products'] != $linkedProducts and $oldProject->model == 'waterfall') + { + $stages = $this->loadModel('execution')->getPairs($projectID); + foreach($stages as $stageID => $name) $this->execution->updateProducts($stageID); + } + $whitelist = explode(',', $project->whitelist); $this->loadModel('personnel')->updateWhitelist($whitelist, 'project', $projectID); if($project->acl != 'open') diff --git a/module/project/view/create.html.php b/module/project/view/create.html.php index 5c9a32a140..fd2f8b7424 100755 --- a/module/project/view/create.html.php +++ b/module/project/view/create.html.php @@ -175,10 +175,12 @@
+ project->division;?> project->divisionList, '0');?> + execution->team;?> diff --git a/module/project/view/edit.html.php b/module/project/view/edit.html.php index 79bc96f872..d937e56c53 100755 --- a/module/project/view/edit.html.php +++ b/module/project/view/edit.html.php @@ -176,9 +176,11 @@ model == 'waterfall'):?> - + division and count($linkedProducts) < 2) ? 'hide' : '';?> + + project->division;?> - project->divisionList, $project->division);?> + project->divisionList, $project->division, $disabled);?> model == 'kanban'):?> From 7299a84a973cb0aed7b7f355a6a9558b06b24313 Mon Sep 17 00:00:00 2001 From: Yagami Date: Wed, 26 Oct 2022 16:53:01 +0800 Subject: [PATCH 009/114] * Finish task #73238. --- module/execution/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 module/execution/model.php diff --git a/module/execution/model.php b/module/execution/model.php old mode 100644 new mode 100755 index dfebc4e9be..1c3810d128 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1635,7 +1635,7 @@ class executionModel extends model ->beginIF($limit)->limit($limit)->fi() ->fetchAll('id'); - if(isset($project->model) and $project->model == 'waterfall') + if(isset($project->model) and $project->model == 'waterfall' and $project->division) { $executionList = array(); $executionProducts = $this->dao->select('t1.project,t1.product')->from(TABLE_PROJECTPRODUCT)->alias('t1') From d96d6bb803a5ffdda5ac9efff6c898789f753929 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Thu, 27 Oct 2022 08:09:26 +0800 Subject: [PATCH 010/114] * Finish task #73234,73242. --- module/execution/control.php | 20 ++++++++++++++++++++ module/execution/js/common.js | 16 +++++++++------- module/execution/model.php | 9 ++++++++- module/execution/view/create.html.php | 7 ++++++- module/programplan/control.php | 1 + module/programplan/view/gantt.html.php | 4 ++++ module/project/control.php | 13 +++++++++++-- module/project/css/execution.css | 1 + module/project/view/execution.html.php | 4 ++++ 9 files changed, 64 insertions(+), 11 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 5068b485e1..4bd148740c 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1646,6 +1646,26 @@ class execution extends control $this->view->linkedBranches = $linkedBranches; } + if(!$project->division) + { + $products = $this->loadModel('product')->getProducts($projectID); + $branches = $this->project->getBranchesByProject($projectID); + $plans = $this->loadModel('productplan')->getGroupByProduct(array_keys($products), 'skipParent|unexpired'); + + $linkedBranches = array(); + foreach($products as $productID => $product) + { + foreach($branches[$productID] as $branchID => $branch) + { + $linkedBranches[$productID][$branchID] = $branchID; + $productPlans[$productID][$branchID] = isset($plans[$productID][$branchID]) ? $plans[$productID][$branchID] : array(); + } + } + + $this->view->branches = $branches; + $this->view->linkedBranches = $linkedBranches; + } + if(!empty($_POST)) { $executionID = $this->execution->create($copyExecutionID); diff --git a/module/execution/js/common.js b/module/execution/js/common.js index 1ede120620..499bff5775 100644 --- a/module/execution/js/common.js +++ b/module/execution/js/common.js @@ -124,13 +124,15 @@ function loadBranches(product) { if($('#productsBox .input-group:last select:first').val() != 0) { - var length = $('#productsBox .input-group').size(); - $('#productsBox .row').append('
' + $('#productsBox .col-sm-4:last').html().replace('required', '') + '
'); - if($('#productsBox .input-group:last select').size() >= 2) $('#productsBox .input-group:last select:last').remove(); - $('#productsBox .input-group:last .chosen-container').remove(); - $('#productsBox .input-group:last select:first').attr('name', 'products[' + length + ']').attr('id', 'products' + length); - $('#productsBox .input-group:last .chosen').chosen(); - + if(model !== 'waterfall') + { + var length = $('#productsBox .input-group').size(); + $('#productsBox .row').append('
' + $('#productsBox .col-sm-4:last').html().replace('required', '') + '
'); + if($('#productsBox .input-group:last select').size() >= 2) $('#productsBox .input-group:last select:last').remove(); + $('#productsBox .input-group:last .chosen-container').remove(); + $('#productsBox .input-group:last select:first').attr('name', 'products[' + length + ']').attr('id', 'products' + length); + $('#productsBox .input-group:last .chosen').chosen(); + } adjustProductBoxMargin(); } diff --git a/module/execution/model.php b/module/execution/model.php index d60d43d29a..eefd118e6f 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -339,6 +339,12 @@ class executionModel extends model $type = 'sprint'; if($project) $type = zget($this->config->execution->modelList, $project->model, 'sprint'); + if($project->model == 'waterfall') + { + $this->checkWorkload('create', $_POST['percent'], $project); + if(dao::isError()) return false; + } + $this->config->execution->create->requiredFields .= ',project'; } @@ -1175,7 +1181,7 @@ class executionModel extends model } /* The total workload of the first stage should not exceed 100%. */ - if($type == 'create' or (empty($oldExecution) and $oldExecution->grade == 1)) + if($type == 'create' or (!empty($oldExecution) and $oldExecution->grade == 1)) { $oldPercentTotal = $this->dao->select('SUM(t2.percent) as total')->from(TABLE_PROJECTPRODUCT)->alias('t1') ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.project=t2.id') @@ -4616,6 +4622,7 @@ class executionModel extends model $burns = join(',', $execution->burns); echo ""; + if(!empty($execution->division)) echo "{$execution->productName}"; echo ""; if(common::hasPriv('execution', 'batchEdit')) echo "id class='table-nest-icon icon table-nest-toggle'>"; if($this->config->systemMode == 'new') diff --git a/module/execution/view/create.html.php b/module/execution/view/create.html.php index 4da8c28962..25bc3cdfe3 100644 --- a/module/execution/view/create.html.php +++ b/module/execution/view/create.html.php @@ -48,6 +48,7 @@ execution->cancelCopy);?> execution->copyNoExecution);?> +model);?>
@@ -137,12 +138,14 @@
+ division ? '' : 'disabled';?> type != 'normal' and isset($branchGroups[$product->id]));?> id] as $branchID => $branch):?>
- id, "class='form-control chosen' onchange='loadBranches(this)' data-last='" . $product->id . "'");?> + id, "class='form-control chosen' $class onchange='loadBranches(this)' data-last='" . $product->id . "'");?> + id);?> id], $branchID, "class='form-control chosen' onchange=\"loadPlans('#products{$i}', this.value)\"");?>
@@ -150,12 +153,14 @@ + division):?>
+
diff --git a/module/programplan/control.php b/module/programplan/control.php index efb2988be9..e0414d396e 100644 --- a/module/programplan/control.php +++ b/module/programplan/control.php @@ -110,6 +110,7 @@ class programplan extends control $this->view->title = $this->lang->programplan->browse; $this->view->position[] = $this->lang->programplan->browse; $this->view->projectID = $projectID; + $this->view->project = $this->project->getByID($projectID); $this->view->productID = $this->productID; $this->view->productList = $this->loadModel('product')->getProductPairsByProject($projectID); $this->view->type = $type; diff --git a/module/programplan/view/gantt.html.php b/module/programplan/view/gantt.html.php index e68b128d0e..f766ce1705 100644 --- a/module/programplan/view/gantt.html.php +++ b/module/programplan/view/gantt.html.php @@ -80,6 +80,7 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;} app->getModuleName() == 'programplan'):?>
+ division) or !empty($project->hasProduct)):?> product->allProduct;?> + + programplan->gantt;?> +
diff --git a/module/project/control.php b/module/project/control.php index 64c64facf5..656ab48760 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1035,10 +1035,19 @@ class project extends control $this->view->title = $this->lang->execution->allExecutions; $this->view->position[] = $this->lang->execution->allExecutions; - $executionStats = $this->execution->getStatData($projectID, $status, $productID, 0, $this->cookie->showTask, '', $orderBy, $pager); - $showToggleIcon = false; + $executionStats = $this->execution->getStatData($projectID, $status, $productID, 0, $this->cookie->showTask, '', $orderBy, $pager); + $showToggleIcon = false; + $productNameList = $this->dao->select('t1.id,GROUP_CONCAT(t3.`name`) as productName')->from(TABLE_EXECUTION)->alias('t1') + ->leftjoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.id=t2.project') + ->leftjoin(TABLE_PRODUCT)->alias('t3')->on('t2.product=t3.id') + ->where('t1.project')->eq($projectID) + ->andWhere('t1.type')->eq('stage') + ->groupBy('t1.id') + ->fetchPairs(); + foreach($executionStats as $execution) { + $execution->productName = isset($productNameList[$execution->id]) ? $productNameList[$execution->id] : ''; if(!empty($execution->tasks) or !empty($execution->children)) { $showToggleIcon = true; diff --git a/module/project/css/execution.css b/module/project/css/execution.css index 71939a8e6b..4c3cddba23 100644 --- a/module/project/css/execution.css +++ b/module/project/css/execution.css @@ -13,6 +13,7 @@ th.table-nest-title .check-all {position: absolute; left: 15px; top: 7px;} #executionTableList > tr:not(.has-nest-child) .project-type-label {margin-left: 22px;} .table-statistic {padding-left: 10px;} td.flex {display: flex; flex-flow: row nowrap; justify-content: flex-start; align-items: center; margin-bottom: 0px;} +th.c-name {width: 80px;} td.c-name > .project-type-label {flex: 0 0 36px; padding-right: 2px;} .c-name > a, .table-children .text-left > a, .c-name > span.text-ellipsis { padding-left: 5px; text-overflow: clip;} span.table-nest-icon.table-nest-toggle {min-width: 22px; max-width: 22px;} diff --git a/module/project/view/execution.html.php b/module/project/view/execution.html.php index d349c0629b..af18757430 100644 --- a/module/project/view/execution.html.php +++ b/module/project/view/execution.html.php @@ -14,6 +14,7 @@ execution->checkedExecutions);?>