From c4653c063c4289b12002c967117333a90fb94552 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Wed, 18 Jun 2025 09:37:15 +0800 Subject: [PATCH 01/25] * [task#145545,doing,0.5h,2h] Add execution template gantt menu. --- module/execution/model.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/module/execution/model.php b/module/execution/model.php index 7e6f0fd893..1efa765452 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -148,12 +148,13 @@ class executionModel extends model if(!empty($execution->isTpl)) { dao::$filterTpl = 'never'; + + /* 设置模板执行的AppName。 */ $this->lang->execution->common = $this->lang->execution->toTemplate; if(empty($execution->multiple)) $this->lang->project->common = $this->lang->project->template; unset($this->lang->execution->menu->burn); unset($this->lang->execution->menu->kanban); - unset($this->lang->execution->menu->view); unset($this->lang->execution->menu->story); unset($this->lang->execution->menu->qa); unset($this->lang->execution->menu->devops); @@ -162,6 +163,22 @@ class executionModel extends model unset($this->lang->execution->menu->effort); unset($this->lang->execution->menu->more); + if(!empty($this->lang->execution->menu->view['subMenu']->gantt)) + { + $this->lang->execution->menu->gantt = $this->lang->execution->menu->view['subMenu']->gantt; + + $taskOrder = 0; + foreach($this->lang->execution->menuOrder as $order => $menu) if($menu == 'task') $taskOrder = $order; + $this->lang->execution->menuOrder[$taskOrder + 1] = 'gantt'; + + if(!empty($this->lang->project->menuOrder)) + { + $taskOrder = 0; + foreach($this->lang->project->menuOrder as $order => $menu) if($menu == 'task') $taskOrder = $order; + $this->lang->project->menuOrder[$taskOrder + 1] = 'gantt'; + } + } + if(!empty($this->lang->execution->menu->other['dropMenu']->pssp)) { $this->lang->execution->menu->pssp = $this->lang->execution->menu->other['dropMenu']->pssp; @@ -181,6 +198,7 @@ class executionModel extends model } } + unset($this->lang->execution->menu->view); unset($this->lang->execution->menu->other); if(isset($this->lang->execution->menu->settings['subMenu']->products)) unset($this->lang->execution->menu->settings['subMenu']->products); // 模板下隐藏产品 if(isset($this->lang->execution->menu->settings['subMenu']->whitelist)) unset($this->lang->execution->menu->settings['subMenu']->whitelist); // 模板下隐藏白名单 From 9d7e49c6741a4c6e2b7b952f569401696f36ad54 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Wed, 18 Jun 2025 05:02:30 +0000 Subject: [PATCH 02/25] * [task#145284,done,0.2h] add copy PM/budget. --- module/project/ui/create.field.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/project/ui/create.field.php b/module/project/ui/create.field.php index 96f4811844..d4617538ca 100644 --- a/module/project/ui/create.field.php +++ b/module/project/ui/create.field.php @@ -51,6 +51,8 @@ $fields->field('days') $fields->field('productsBox')->hidden(data('copyProject') && data('copyProject.hasProduct') == 0); +$fields->field('PM')->value(data('copyProject.PM')); +$fields->field('budget')->value(data('copyProject.budget')); $fields->field('budget')->foldable(); From 242cff7daf1eb46913b7e13c69aab10ec73a0a59 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Wed, 18 Jun 2025 06:25:03 +0000 Subject: [PATCH 03/25] * [task#145273,done,0.5h] tranfer module method in workflow. --- lib/form/form.class.php | 3 +++ lib/zin/wg/formpanel/v1.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/form/form.class.php b/lib/form/form.class.php index 2ac9718ddb..d3662dc3e5 100644 --- a/lib/form/form.class.php +++ b/lib/form/form.class.php @@ -119,6 +119,9 @@ class form extends fixer if($moduleName == 'projectrelease') $moduleName = 'release'; if($moduleName == 'projectbuild') $moduleName = 'build'; + /* 项目复制用项目创建的工作流。 */ + if($moduleName == 'project' && $methodName == 'copyconfirm') $methodName = 'create'; + /* 用户需求和业务需求用自己的工作流。*/ if($moduleName == 'story' && $app->rawModule == 'requirement') $moduleName = 'requirement'; if($moduleName == 'story' && $app->rawModule == 'epic') $moduleName = 'epic'; diff --git a/lib/zin/wg/formpanel/v1.php b/lib/zin/wg/formpanel/v1.php index 816a1095e2..477b02c654 100644 --- a/lib/zin/wg/formpanel/v1.php +++ b/lib/zin/wg/formpanel/v1.php @@ -104,6 +104,9 @@ class formPanel extends panel } } + if($moduleName == 'project' && $methodName == 'createtemplate') $methodName = 'create'; + if($moduleName == 'project' && $methodName == 'edittemplate') $methodName = 'edit'; + /* 反馈转化。 */ if($moduleName == 'feedback') { From c961dc441ea97aa6ff109ad65e25c69c98360223 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Wed, 18 Jun 2025 16:35:37 +0800 Subject: [PATCH 04/25] * [task#145540,done,1.5h,0h] Remove project template create doc priv. --- module/doc/control.php | 7 ++++--- module/doc/ui/app.html.php | 19 ++++++++++--------- module/doc/ui/createlib.html.php | 1 + 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index f6b3bf117a..0b68457f6f 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -308,10 +308,10 @@ class doc extends control } $objects = array(); - if($type == 'project' && $this->app->tab == 'doc') + if($type == 'project') { - $this->view->executionPairs = $this->execution->getPairs($objectID, 'all', 'multiple,leaf,noprefix'); - $this->view->project = $this->project->getById($objectID); + $this->view->project = $this->project->getById($objectID); + if($this->app->tab == 'doc') $this->view->executionPairs = $this->execution->getPairs($objectID, 'all', 'multiple,leaf,noprefix'); } if($type == 'execution') @@ -1804,6 +1804,7 @@ class doc extends control $this->doc->setMenuByType($type, $spaceID, $libID); $objectKey = $type . 'ID'; $this->view->$objectKey = $spaceID; + $this->view->$type = $this->doc->fetchByID($spaceID, $type); } if($type == 'mine') $menuType = 'my'; diff --git a/module/doc/ui/app.html.php b/module/doc/ui/app.html.php index 156f19e25b..432bf06f47 100644 --- a/module/doc/ui/app.html.php +++ b/module/doc/ui/app.html.php @@ -25,26 +25,27 @@ if($type === 'project') * 定义文档界面上的权限。 * Define the privs of doc app. */ -$hasCustomSpace = $type == 'mine' || $type == 'custom'; +$hasCustomSpace = $type == 'mine' || $type == 'custom'; +$projectTemplate = $type === 'project' && !empty($project->isTpl); $privs = array(); -$privs['create'] = hasPriv('doc', 'create'); -$privs['edit'] = hasPriv('doc', 'edit'); -$privs['delete'] = hasPriv('doc', 'delete'); +$privs['create'] = hasPriv('doc', 'create') && !$projectTemplate; +$privs['edit'] = hasPriv('doc', 'edit') && !$projectTemplate; +$privs['delete'] = hasPriv('doc', 'delete') && !$projectTemplate; $privs['view'] = hasPriv('doc', 'view'); $privs['effort'] = $this->config->edition != 'open' && hasPriv('effort', 'createForObject'); -$privs['exportDoc'] = $this->config->edition != 'open' && hasPriv('doc', $type . '2export'); +$privs['exportDoc'] = $this->config->edition != 'open' && hasPriv('doc', $type . '2export') && !$projectTemplate; $privs['exportApi'] = $this->config->edition != 'open' && hasPriv('api', 'export'); -$privs['moveDoc'] = hasPriv('doc', 'moveDoc'); +$privs['moveDoc'] = hasPriv('doc', 'moveDoc') && !$projectTemplate; $privs['collect'] = hasPriv('doc', 'collect'); $privs['createLib'] = hasPriv('doc', 'createLib'); $privs['editLib'] = hasPriv('doc', 'editLib'); -$privs['moveLib'] = hasPriv('doc', 'moveLib'); +$privs['moveLib'] = hasPriv('doc', 'moveLib') && !$projectTemplate; $privs['deleteLib'] = hasPriv('doc', 'deleteLib'); $privs['sortDocLib'] = hasPriv('doc', 'sortDocLib'); -$privs['uploadFile'] = hasPriv('doc', 'create'); +$privs['uploadFile'] = hasPriv('doc', 'create') && !$projectTemplate; $privs['editFile'] = hasPriv('file', 'edit'); $privs['deleteFile'] = hasPriv('doc', 'deleteFile'); -$privs['exportFiles'] = hasPriv('doc', 'exportFiles'); +$privs['exportFiles'] = hasPriv('doc', 'exportFiles') && !$projectTemplate; $privs['createSpace'] = $hasCustomSpace && hasPriv('doc', 'createSpace'); $privs['deleteSpace'] = $hasCustomSpace && hasPriv('doc', 'deleteSpace'); $privs['editSpace'] = $hasCustomSpace && hasPriv('doc', 'editSpace'); diff --git a/module/doc/ui/createlib.html.php b/module/doc/ui/createlib.html.php index dcadcd160f..121cb7b93c 100644 --- a/module/doc/ui/createlib.html.php +++ b/module/doc/ui/createlib.html.php @@ -26,6 +26,7 @@ $renderObjectBox = function(string $type) use ($lang, $objects, $objectID) return formRow( setClass('objectBox'), formGroup( + set::id('object'), set::width('5/6'), set::label($lang->doc->{$type}), set::name($type), From b94c610469a63b07348998def1aa43c934eb0978 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Wed, 18 Jun 2025 08:37:58 +0000 Subject: [PATCH 05/25] * [tsak#145273,doing,0.5h] transfer workflow. --- lib/form/form.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/form/form.class.php b/lib/form/form.class.php index d3662dc3e5..5445321855 100644 --- a/lib/form/form.class.php +++ b/lib/form/form.class.php @@ -120,7 +120,8 @@ class form extends fixer if($moduleName == 'projectbuild') $moduleName = 'build'; /* 项目复制用项目创建的工作流。 */ - if($moduleName == 'project' && $methodName == 'copyconfirm') $methodName = 'create'; + if($moduleName == 'project' && $methodName == 'copyconfirm') $methodName = 'create'; + if($moduleName == 'project' && $methodName == 'edittemplate') $methodName = 'edit'; /* 用户需求和业务需求用自己的工作流。*/ if($moduleName == 'story' && $app->rawModule == 'requirement') $moduleName = 'requirement'; From 8dcbee1754b058d3c20586a3aa65a0d222ed8beb Mon Sep 17 00:00:00 2001 From: wangyuting Date: Wed, 18 Jun 2025 16:57:45 +0800 Subject: [PATCH 06/25] * [task#145540,done,0.2h,0h] Fix execution template create doclib error. --- module/doc/control.php | 2 ++ module/doc/ui/app.html.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/module/doc/control.php b/module/doc/control.php index 0b68457f6f..63e5c7b261 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -289,6 +289,7 @@ class doc extends control public function createLib(string $type = '', int $objectID = 0, int $libID = 0) { $this->app->loadLang('api'); + $this->doc->setMenuByType($type, (int)$objectID, (int)$libID); if(!empty($_POST)) { @@ -319,6 +320,7 @@ class doc extends control $objects = $this->execution->getPairs(0, 'all', 'multiple,leaf,noprefix,withobject'); $execution = $this->execution->getByID($objectID); if($execution->type == 'stage') $this->lang->doc->execution = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->doc->execution); + $this->view->execution = $this->doc->fetchByID($objectID, 'execution'); } if($type == 'custom' || $type == 'mine' || $type == 'doctemplate') diff --git a/module/doc/ui/app.html.php b/module/doc/ui/app.html.php index 432bf06f47..0c3744883f 100644 --- a/module/doc/ui/app.html.php +++ b/module/doc/ui/app.html.php @@ -26,7 +26,7 @@ if($type === 'project') * Define the privs of doc app. */ $hasCustomSpace = $type == 'mine' || $type == 'custom'; -$projectTemplate = $type === 'project' && !empty($project->isTpl); +$projectTemplate = ($type === 'project' && !empty($project->isTpl)) || ($type == 'execution' && !empty($execution->isTpl)); $privs = array(); $privs['create'] = hasPriv('doc', 'create') && !$projectTemplate; $privs['edit'] = hasPriv('doc', 'edit') && !$projectTemplate; From 0dd9aecee0d434a858a6cf118aad8b483ca1a668 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Thu, 19 Jun 2025 13:15:58 +0800 Subject: [PATCH 07/25] * [task#145544,done,0.1h,0h] Add project template acl field. --- db/update21.7.2.sql | 2 ++ db/zentao.sql | 2 ++ module/group/packagemanager.php | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 db/update21.7.2.sql diff --git a/db/update21.7.2.sql b/db/update21.7.2.sql new file mode 100644 index 0000000000..fd05c17b26 --- /dev/null +++ b/db/update21.7.2.sql @@ -0,0 +1,2 @@ +ALTER TABLE `zt_project` ADD `templateAcl` char(30) NOT NULL DEFAULT 'open' AFTER `whitelist`; +ALTER TABLE `zt_project` ADD `templateWhite` text NULL AFTER `templateAcl`; diff --git a/db/zentao.sql b/db/zentao.sql index 8c2a88a33f..9c77a0ce20 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -1602,6 +1602,8 @@ CREATE TABLE IF NOT EXISTS `zt_project` ( `team` varchar(90) NOT NULL DEFAULT '', `acl` char(30) NOT NULL DEFAULT 'open', `whitelist` text NULL, + `templateAcl` char(30) NOT NULL DEFAULT 'open', + `templateWhite` text NULL, `order` mediumint(8) unsigned NOT NULL DEFAULT '0', `vision` varchar(10) NOT NULL DEFAULT 'rnd', `stageBy` enum('project','product') NOT NULL DEFAULT 'product', diff --git a/module/group/packagemanager.php b/module/group/packagemanager.php index e44a8e5e3d..48d008b51e 100644 --- a/module/group/packagemanager.php +++ b/module/group/packagemanager.php @@ -1076,7 +1076,8 @@ $config->group->package->projectTemplate->subset = 'projectTemplate'; $config->group->package->projectTemplate->privs = array(); $config->group->package->projectTemplate->privs['project-template'] = array('edition' => 'max,ipd', 'vision' => 'rnd', 'order' => 5, 'depend' => array('project-index')); $config->group->package->projectTemplate->privs['project-createTemplate'] = array('edition' => 'max,ipd', 'vision' => 'rnd', 'order' => 10, 'depend' => array('project-index', 'project-template')); -$config->group->package->projectTemplate->privs['project-deleteTemplate'] = array('edition' => 'max,ipd', 'vision' => 'rnd', 'order' => 15, 'depend' => array('project-index', 'project-template')); +$config->group->package->projectTemplate->privs['project-templatePriv'] = array('edition' => 'max,ipd', 'vision' => 'rnd', 'order' => 15, 'depend' => array('project-index', 'project-template')); +$config->group->package->projectTemplate->privs['project-deleteTemplate'] = array('edition' => 'max,ipd', 'vision' => 'rnd', 'order' => 20, 'depend' => array('project-index', 'project-template')); $config->group->package->browseExecution = new stdclass(); $config->group->package->browseExecution->order = 5; From 8524c3fe12f3d6927d58bbf66fa264881637a807 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Thu, 19 Jun 2025 13:30:12 +0800 Subject: [PATCH 08/25] * [task#145542,done,0.1h,0h] Remove project template deliverable. --- module/project/ui/execution.html.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/project/ui/execution.html.php b/module/project/ui/execution.html.php index 931b2f54e0..16cb76f598 100644 --- a/module/project/ui/execution.html.php +++ b/module/project/ui/execution.html.php @@ -60,6 +60,8 @@ if($canBatchAction) $fieldList = $config->project->execution->dtable->fieldList; $fieldList['status']['statusMap']['changed'] = $lang->task->storyChange; +if(!empty($project->isTpl)) unset($fieldList['deliverable']); + /* waterfall & waterfallplus & ipd model with different edit link. */ if(in_array($project->model, array('waterfall', 'waterfallplus', 'ipd'))) { From 2f207158e40f1ef2d349f2464cc7577f75250934 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Thu, 19 Jun 2025 16:13:06 +0800 Subject: [PATCH 09/25] * [task#145544,done,0.1h,0h] Adjust templateAcl to tplAcl. --- db/update21.7.2.sql | 4 ++-- db/zentao.sql | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/db/update21.7.2.sql b/db/update21.7.2.sql index fd05c17b26..1cb9c17e91 100644 --- a/db/update21.7.2.sql +++ b/db/update21.7.2.sql @@ -1,2 +1,2 @@ -ALTER TABLE `zt_project` ADD `templateAcl` char(30) NOT NULL DEFAULT 'open' AFTER `whitelist`; -ALTER TABLE `zt_project` ADD `templateWhite` text NULL AFTER `templateAcl`; +ALTER TABLE `zt_project` ADD `tplAcl` char(30) NOT NULL DEFAULT 'open' AFTER `whitelist`; +ALTER TABLE `zt_project` ADD `tplWhiteList` text NULL AFTER `tplAcl`; diff --git a/db/zentao.sql b/db/zentao.sql index 9c77a0ce20..b55a03a700 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -1602,8 +1602,8 @@ CREATE TABLE IF NOT EXISTS `zt_project` ( `team` varchar(90) NOT NULL DEFAULT '', `acl` char(30) NOT NULL DEFAULT 'open', `whitelist` text NULL, - `templateAcl` char(30) NOT NULL DEFAULT 'open', - `templateWhite` text NULL, + `tplAcl` char(30) NOT NULL DEFAULT 'open', + `tplWhiteList` text NULL, `order` mediumint(8) unsigned NOT NULL DEFAULT '0', `vision` varchar(10) NOT NULL DEFAULT 'rnd', `stageBy` enum('project','product') NOT NULL DEFAULT 'product', From a966e587dc4ca0369ac276b794ec3084906e43e7 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Fri, 20 Jun 2025 00:30:20 +0000 Subject: [PATCH 10/25] * [task#145275,doing,0.2h] add isclickable. --- module/project/model.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/project/model.php b/module/project/model.php index aba9b20e91..e7e8dfc0de 100755 --- a/module/project/model.php +++ b/module/project/model.php @@ -189,6 +189,9 @@ class projectModel extends model $action = strtolower($action); + if($action == 'publishtemplate') return $project->status == 'wait' || $project->status == 'closed'; + if($action == 'disabletemplate') return $project->status == 'doing'; + if($action == 'close') return $project->status != 'closed'; if($action == 'group') return $project->model != 'kanban'; if($action == 'start') return $project->status == 'wait' || $project->status == 'suspended'; From be980b0da8ee96a1efe08f048c45165a5ef35d65 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Fri, 20 Jun 2025 01:22:51 +0000 Subject: [PATCH 11/25] * [task#145275,done,0.2h] add privs. --- module/group/packagemanager.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/module/group/packagemanager.php b/module/group/packagemanager.php index 48d008b51e..dde59494dc 100644 --- a/module/group/packagemanager.php +++ b/module/group/packagemanager.php @@ -1074,10 +1074,13 @@ $config->group->package->projectTemplate = new stdclass(); $config->group->package->projectTemplate->order = 5; $config->group->package->projectTemplate->subset = 'projectTemplate'; $config->group->package->projectTemplate->privs = array(); -$config->group->package->projectTemplate->privs['project-template'] = array('edition' => 'max,ipd', 'vision' => 'rnd', 'order' => 5, 'depend' => array('project-index')); -$config->group->package->projectTemplate->privs['project-createTemplate'] = array('edition' => 'max,ipd', 'vision' => 'rnd', 'order' => 10, 'depend' => array('project-index', 'project-template')); -$config->group->package->projectTemplate->privs['project-templatePriv'] = array('edition' => 'max,ipd', 'vision' => 'rnd', 'order' => 15, 'depend' => array('project-index', 'project-template')); -$config->group->package->projectTemplate->privs['project-deleteTemplate'] = array('edition' => 'max,ipd', 'vision' => 'rnd', 'order' => 20, 'depend' => array('project-index', 'project-template')); +$config->group->package->projectTemplate->privs['project-template'] = array('edition' => 'max,ipd', 'vision' => 'rnd', 'order' => 5, 'depend' => array('project-index')); +$config->group->package->projectTemplate->privs['project-createTemplate'] = array('edition' => 'max,ipd', 'vision' => 'rnd', 'order' => 10, 'depend' => array('project-index', 'project-template')); +$config->group->package->projectTemplate->privs['project-editTemplate'] = array('edition' => 'max,ipd', 'vision' => 'rnd', 'order' => 15, 'depend' => array('project-index', 'project-template')); +$config->group->package->projectTemplate->privs['project-publishTemplate'] = array('edition' => 'max,ipd', 'vision' => 'rnd', 'order' => 20, 'depend' => array('project-index', 'project-template')); +$config->group->package->projectTemplate->privs['project-disableTemplate'] = array('edition' => 'max,ipd', 'vision' => 'rnd', 'order' => 25, 'depend' => array('project-index', 'project-template')); +$config->group->package->projectTemplate->privs['project-templatePriv'] = array('edition' => 'max,ipd', 'vision' => 'rnd', 'order' => 30, 'depend' => array('project-index', 'project-template')); +$config->group->package->projectTemplate->privs['project-deleteTemplate'] = array('edition' => 'max,ipd', 'vision' => 'rnd', 'order' => 35, 'depend' => array('project-index', 'project-template')); $config->group->package->browseExecution = new stdclass(); $config->group->package->browseExecution->order = 5; From 9c37678fc7f6829a080cbc2cff0dc46db8c537f0 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Fri, 20 Jun 2025 09:59:28 +0800 Subject: [PATCH 12/25] * [task#145541,done,0.5h,0h] Finish copy project extra fields. --- framework/control.class.php | 10 ++++++++++ lib/zin/wg/formpanel/v1.php | 2 ++ 2 files changed, 12 insertions(+) diff --git a/framework/control.class.php b/framework/control.class.php index 8bf985df95..648b4f68e5 100644 --- a/framework/control.class.php +++ b/framework/control.class.php @@ -534,6 +534,16 @@ class control extends baseControl $uiID = $this->loadModel('workflowlayout')->getUIByData($flow->module, $action->action, $object); $fieldList = $this->workflowaction->getPageFields($flow->module, $action->action, true, null, $uiID, $groupID); + + /* 复制项目时显示被复制项目的工作流字段值。*/ + if($moduleName == 'project' && $methodName == 'create') + { + foreach($fieldList as $field) + { + $objectValue = zget($object, $field->field, ''); + if($objectValue) $field->default = $objectValue; + } + } return $this->loadModel('flow')->buildFormFields($fields, $fieldList, array(), $object); } diff --git a/lib/zin/wg/formpanel/v1.php b/lib/zin/wg/formpanel/v1.php index 477b02c654..33714ae279 100644 --- a/lib/zin/wg/formpanel/v1.php +++ b/lib/zin/wg/formpanel/v1.php @@ -77,11 +77,13 @@ class formPanel extends panel { global $app; $moduleName = $app->getModuleName(); + $methodName = $app->getMethodName(); if($moduleName == 'caselib') return data('lib'); if($moduleName == 'flow') return data('data'); if($moduleName == 'productplan') return data('plan'); if($moduleName == 'projectrelease') return data('release'); if($moduleName == 'projectbuild') return data('build'); + if($moduleName == 'project' && ($methodName == 'create' or $methodName == 'createtemplate')) return data('copyProject'); return data($moduleName); } From 26f53ff81d2bbff8dc466ca153e6914873808fbe Mon Sep 17 00:00:00 2001 From: wangyuting Date: Mon, 23 Jun 2025 10:12:02 +0800 Subject: [PATCH 13/25] * [bug#63539,done,0.5h,0h] Remove execution template deliverable field. --- module/datatable/control.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/module/datatable/control.php b/module/datatable/control.php index a0d30c76c1..b28de93029 100644 --- a/module/datatable/control.php +++ b/module/datatable/control.php @@ -211,6 +211,12 @@ class datatable extends control if(!$execution->hasProduct) unset($cols['branch']); } + if($module == 'project' && $method == 'execution') + { + $project = $this->datatable->fetchByID($this->session->project, 'project'); + if(!empty($project->isTpl)) unset($cols['deliverable']); + } + if($extra == 'unsetStory' && isset($cols['story'])) unset($cols['story']); if($this->config->edition == 'ipd' && $module == 'product' && $method == 'browse' && $extra == 'story') unset($cols['roadmap']); From 48dd1a195bc4a3d5fe69af0d96a153c5bf57784d Mon Sep 17 00:00:00 2001 From: wangyuting Date: Mon, 23 Jun 2025 10:53:10 +0800 Subject: [PATCH 14/25] * [bug#63549,done,0.1h,0h] Fix edit doc lib menu. --- module/doc/control.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/doc/control.php b/module/doc/control.php index 0aac7ceb1e..01b55bc286 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -431,6 +431,7 @@ class doc extends control { if(!common::hasPriv('doc', 'editSpace') && !common::hasPriv('doc', 'editLib')) return; $lib = $this->doc->getLibByID($libID); + $this->doc->setMenuByType($lib->type, (int)zget($lib, $lib->type, 0), (int)$libID); if(!empty($_POST)) { $this->lang->doc->name = $this->lang->nameAB; @@ -475,6 +476,7 @@ class doc extends control } $this->docZen->setAclForEditLib($lib); + $this->docZen->setAclForCreateLib($lib->type); $this->view->lib = $lib; $this->view->groups = $this->loadModel('group')->getPairs(); From db16157ce27f19905e7e504672fe4ec9ccfe05f0 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Mon, 23 Jun 2025 13:46:40 +0800 Subject: [PATCH 15/25] * [bug#63557,done,0.3h,0h] Fix return bool error. --- lib/zin/wg/formpanel/v1.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/zin/wg/formpanel/v1.php b/lib/zin/wg/formpanel/v1.php index 33714ae279..f4d4c00788 100644 --- a/lib/zin/wg/formpanel/v1.php +++ b/lib/zin/wg/formpanel/v1.php @@ -83,7 +83,7 @@ class formPanel extends panel if($moduleName == 'productplan') return data('plan'); if($moduleName == 'projectrelease') return data('release'); if($moduleName == 'projectbuild') return data('build'); - if($moduleName == 'project' && ($methodName == 'create' or $methodName == 'createtemplate')) return data('copyProject'); + if($moduleName == 'project' && ($methodName == 'create' or $methodName == 'createtemplate')) return data('copyProject') ? data('copyProject') : NULL; return data($moduleName); } From 9372a645386a43eb8beabd599f506b4ec0f0ae18 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Mon, 23 Jun 2025 14:25:16 +0800 Subject: [PATCH 16/25] * Optimize code. --- lib/zin/wg/formpanel/v1.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/zin/wg/formpanel/v1.php b/lib/zin/wg/formpanel/v1.php index f4d4c00788..4be8c68c2b 100644 --- a/lib/zin/wg/formpanel/v1.php +++ b/lib/zin/wg/formpanel/v1.php @@ -83,7 +83,7 @@ class formPanel extends panel if($moduleName == 'productplan') return data('plan'); if($moduleName == 'projectrelease') return data('release'); if($moduleName == 'projectbuild') return data('build'); - if($moduleName == 'project' && ($methodName == 'create' or $methodName == 'createtemplate')) return data('copyProject') ? data('copyProject') : NULL; + if($moduleName == 'project' && ($methodName == 'create' or $methodName == 'createtemplate')) return data('copyProject') ? data('copyProject') : null; return data($moduleName); } From 4bd422d43285c30660e949e534f95f7511518d62 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Mon, 23 Jun 2025 15:39:22 +0800 Subject: [PATCH 17/25] * [bug#63544,done,0.4h,0h] Filter project template kanban execution. --- module/execution/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/control.php b/module/execution/control.php index ea79720c68..44bf585d72 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2736,7 +2736,7 @@ class execution extends control $executionGroups = $this->dao->select('*')->from(TABLE_EXECUTION) /* 按照项目分组,获取有权限访问的执行列表。*/ ->where('deleted')->eq('0') ->andWhere('multiple')->eq('1') - ->andWhere('type')->in('sprint,stage,kanban') + ->andWhere('type')->in(!empty($execution->isTpl) ? 'sprint,stage' : 'sprint,stage,kanban') ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi() ->beginIF(!empty($execution->isTpl))->andWhere('isTpl')->eq('1')->fi() ->andWhere('project')->in(array_keys($projects)) From 3a7de1432acb7a220ea0f137991fd30c3f88cda2 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Tue, 24 Jun 2025 03:24:29 +0000 Subject: [PATCH 18/25] * [misc] transfer method. --- lib/dao/dao.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/dao/dao.class.php b/lib/dao/dao.class.php index 35f277dc9f..47435fbc0e 100644 --- a/lib/dao/dao.class.php +++ b/lib/dao/dao.class.php @@ -225,6 +225,7 @@ class dao extends baseDAO $method = $this->app->getMethodName(); if($module == 'story' && $this->app->rawModule == 'requirement') $module = 'requirement'; if($module == 'story' && $this->app->rawModule == 'epic') $module = 'epic'; + if($module == 'project' && $method == 'createtemplate') $method = 'create'; $flowAction = $this->dbh->query("SELECT * FROM " . TABLE_WORKFLOWACTION . " WHERE `module` = '{$module}' AND `action` = '{$method}' AND `buildin` = '1' AND `extensionType` = 'extend' AND `vision` = '{$this->config->vision}'")->fetch(PDO::FETCH_OBJ); if(!$flowAction) return $this; From 06bbaea87d98007e8c65d40ddb45125c2a9133b4 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Wed, 25 Jun 2025 10:02:59 +0800 Subject: [PATCH 19/25] * [bug#63531,done,0.5h,0h] Fix template project 1.5 menu link error. --- module/project/view/ajaxgetolddropmenu.html.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/module/project/view/ajaxgetolddropmenu.html.php b/module/project/view/ajaxgetolddropmenu.html.php index 3d81502e2a..c74ee50d09 100644 --- a/module/project/view/ajaxgetolddropmenu.html.php +++ b/module/project/view/ajaxgetolddropmenu.html.php @@ -110,6 +110,11 @@ foreach($projects as $programID => $programProjects) { $link = $indexLink; } + elseif(!empty($project->isTpl)) + { + + $link = helper::createLink('project', 'execution', "status=undone&projectID={$project->id}"); + } else { $link = $defaultLink; From 05fc872e6cd6118995a4910b0757287cc7e9a2cc Mon Sep 17 00:00:00 2001 From: wangyuting Date: Wed, 25 Jun 2025 10:32:53 +0800 Subject: [PATCH 20/25] * [bug#63596,done,1h,0h] Fix execution template doc lang. --- module/doc/control.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index 01b55bc286..f3241154cc 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -431,7 +431,11 @@ class doc extends control { if(!common::hasPriv('doc', 'editSpace') && !common::hasPriv('doc', 'editLib')) return; $lib = $this->doc->getLibByID($libID); + + if($lib->type != 'project') $this->docZen->setAclForEditLib($lib); $this->doc->setMenuByType($lib->type, (int)zget($lib, $lib->type, 0), (int)$libID); + if($lib->type == 'project') $this->docZen->setAclForEditLib($lib); + if(!empty($_POST)) { $this->lang->doc->name = $this->lang->nameAB; @@ -475,9 +479,6 @@ class doc extends control $this->view->object = $execution; } - $this->docZen->setAclForEditLib($lib); - $this->docZen->setAclForCreateLib($lib->type); - $this->view->lib = $lib; $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->users = $this->user->getPairs('noletter|noclosed', $lib->users); From 66476c4edf8618ba045d8cce152564035bbba769 Mon Sep 17 00:00:00 2001 From: daitingting Date: Wed, 25 Jun 2025 10:20:07 +0800 Subject: [PATCH 21/25] * [task#145697,done,2h] Remove high light of featureBar when search. --- module/bug/ui/browse.html.php | 3 ++- module/caselib/ui/browse.html.php | 3 ++- module/execution/ui/story.html.php | 3 ++- module/execution/ui/task.html.php | 3 ++- module/product/ui/browse.html.php | 3 ++- module/productplan/ui/browsebylist.html.php | 3 ++- module/projectstory/ui/story.html.php | 3 ++- module/release/ui/browse.html.php | 3 ++- 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/module/bug/ui/browse.html.php b/module/bug/ui/browse.html.php index 3845dca15b..ad59b5e648 100644 --- a/module/bug/ui/browse.html.php +++ b/module/bug/ui/browse.html.php @@ -79,7 +79,8 @@ featureBar ( set::simple($isFromDoc), set::open($browseType == 'bysearch'), - $isFromDoc ? set::target('#docSearchForm') : null + $isFromDoc ? set::target('#docSearchForm') : null, + $isFromDoc ? set::onSearch(jsRaw('function(){$(this.element).closest(".modal").find("#featureBar .nav-item>.active").removeClass("active").find(".label").hide()}')) : null )) ); diff --git a/module/caselib/ui/browse.html.php b/module/caselib/ui/browse.html.php index a35147b70c..1500642786 100644 --- a/module/caselib/ui/browse.html.php +++ b/module/caselib/ui/browse.html.php @@ -101,7 +101,8 @@ featureBar set::simple($isFromDoc), set::module('caselib'), set::open(strtolower($browseType) == 'bysearch'), - $isFromDoc ? set::target('#docSearchForm') : null + $isFromDoc ? set::target('#docSearchForm') : null, + $isFromDoc ? set::onSearch(jsRaw('function(){$(this.element).closest(".modal").find("#featureBar .nav-item>.active").removeClass("active").find(".label").hide()}')) : null )) ); diff --git a/module/execution/ui/story.html.php b/module/execution/ui/story.html.php index c9886a14ad..23010f82fd 100644 --- a/module/execution/ui/story.html.php +++ b/module/execution/ui/story.html.php @@ -114,7 +114,8 @@ featureBar set::simple($isFromDoc), set::module('executionStory'), set::open($type == 'bysearch'), - $isFromDoc ? set::target('#docSearchForm') : null + $isFromDoc ? set::target('#docSearchForm') : null, + $isFromDoc ? set::onSearch(jsRaw('function(){$(this.element).closest(".modal").find("#featureBar .nav-item>.active").removeClass("active").find(".label").hide()}')) : null )) ); diff --git a/module/execution/ui/task.html.php b/module/execution/ui/task.html.php index 693534ab50..7a81bcbe68 100644 --- a/module/execution/ui/task.html.php +++ b/module/execution/ui/task.html.php @@ -77,7 +77,8 @@ featureBar set::simple($isFromDoc), set::module('task'), set::open($browseType == 'bysearch'), - $isFromDoc ? set::target('#docSearchForm') : null + $isFromDoc ? set::target('#docSearchForm') : null, + $isFromDoc ? set::onSearch(jsRaw('function(){$(this.element).closest(".modal").find("#featureBar .nav-item>.active").removeClass("active").find(".label").hide()}')) : null )) ); diff --git a/module/product/ui/browse.html.php b/module/product/ui/browse.html.php index de83057d6a..d4ae4470e5 100644 --- a/module/product/ui/browse.html.php +++ b/module/product/ui/browse.html.php @@ -479,7 +479,8 @@ featureBar set::simple($isFromDoc), set::open($browseType == 'bysearch' || $storyBrowseType == 'bysearch'), set::module($config->product->search['module']), - $isFromDoc ? set::target('#docSearchForm') : null + $isFromDoc ? set::target('#docSearchForm') : null, + $isFromDoc ? set::onSearch(jsRaw('function(){$(this.element).closest(".modal").find("#featureBar .nav-item>.active").removeClass("active").find(".label").hide()}')) : null )) ); diff --git a/module/productplan/ui/browsebylist.html.php b/module/productplan/ui/browsebylist.html.php index 08261a318c..df799105b5 100644 --- a/module/productplan/ui/browsebylist.html.php +++ b/module/productplan/ui/browsebylist.html.php @@ -80,7 +80,8 @@ featureBar set::simple($isFromDoc), set::module('productplan'), set::open($browseType == 'bySearch'), - $isFromDoc ? set::target('#docSearchForm') : null + $isFromDoc ? set::target('#docSearchForm') : null, + $isFromDoc ? set::onSearch(jsRaw('function(){$(this.element).closest(".modal").find("#featureBar .nav-item>.active").removeClass("active").find(".label").hide()}')) : null )) ); diff --git a/module/projectstory/ui/story.html.php b/module/projectstory/ui/story.html.php index 1258a5ddd5..979219db63 100644 --- a/module/projectstory/ui/story.html.php +++ b/module/projectstory/ui/story.html.php @@ -69,7 +69,8 @@ featureBar set::simple(), set::open($browseType == 'bysearch'), set::module($config->product->search['module']), - set::target('#docSearchForm') + set::target('#docSearchForm'), + set::onSearch(jsRaw('function(){$(this.element).closest(".modal").find("#featureBar .nav-item>.active").removeClass("active").find(".label").hide()}')) )) ); diff --git a/module/release/ui/browse.html.php b/module/release/ui/browse.html.php index 6500008995..1273b36fa8 100644 --- a/module/release/ui/browse.html.php +++ b/module/release/ui/browse.html.php @@ -74,7 +74,8 @@ featureBar set::simple($isFromDoc), set::open(strtolower($type) == 'bysearch'), set::module('release'), - $isFromDoc ? set::target('#docSearchForm') : null + $isFromDoc ? set::target('#docSearchForm') : null, + $isFromDoc ? set::onSearch(jsRaw('function(){$(this.element).closest(".modal").find("#featureBar .nav-item>.active").removeClass("active").find(".label").hide()}')) : null )) ); From 626c7341b18588d9587092c79eb1e090ea5968bd Mon Sep 17 00:00:00 2001 From: wangyuting Date: Thu, 26 Jun 2025 09:49:53 +0800 Subject: [PATCH 22/25] * Optimize code. --- module/project/view/ajaxgetolddropmenu.html.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/project/view/ajaxgetolddropmenu.html.php b/module/project/view/ajaxgetolddropmenu.html.php index c74ee50d09..f8a7430b64 100644 --- a/module/project/view/ajaxgetolddropmenu.html.php +++ b/module/project/view/ajaxgetolddropmenu.html.php @@ -112,7 +112,6 @@ foreach($projects as $programID => $programProjects) } elseif(!empty($project->isTpl)) { - $link = helper::createLink('project', 'execution', "status=undone&projectID={$project->id}"); } else From 79e0163efae048340fd306194a7b3e1be70c08e9 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Mon, 30 Jun 2025 07:02:46 +0000 Subject: [PATCH 23/25] * [bug#145772,done,0.2h] fix bug. --- lib/zin/wg/dropmenu/css/v1.css | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/zin/wg/dropmenu/css/v1.css b/lib/zin/wg/dropmenu/css/v1.css index 9904ddbb1d..bd76831963 100644 --- a/lib/zin/wg/dropmenu/css/v1.css +++ b/lib/zin/wg/dropmenu/css/v1.css @@ -3,3 +3,4 @@ #pick-pop-admin-menu .dropmenu-item + .dropmenu-item {margin-top: 4px} #pick-pop-admin-menu .dropmenu-item.active {background-color: unset;} #pick-pop-admin-menu .dropmenu-item:hover {color: rgba(var(--color-primary-500-rgb),var(--tw-text-opacity)); background-color: rgba(var(--color-primary-50-rgb),var(--tw-bg-opacity));} +.dropmenu-item .item-content .label {flex-shrink: 0;} \ No newline at end of file From 7929f20a3e194baad0e96661d2be0ee76583a8bb Mon Sep 17 00:00:00 2001 From: sunguangming Date: Mon, 30 Jun 2025 07:55:18 +0000 Subject: [PATCH 24/25] * [bug#145815,done,0.2h] fix bug. --- module/project/ui/common.field.php | 16 ++++++++++++++-- module/project/ui/create.field.php | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/module/project/ui/common.field.php b/module/project/ui/common.field.php index 0850f765ae..ff355add40 100644 --- a/module/project/ui/common.field.php +++ b/module/project/ui/common.field.php @@ -46,6 +46,18 @@ $fields->field('PM')->control('picker')->items(data('PMUsers')); unset($lang->project->endList[999]); $isLongTime = data('project.end') == LONG_TIME; +$copyProject = data('copyProject'); +if($copyProject) +{ + $beginValue = $copyProject->begin; + $endValue = $copyProject->end == LONG_TIME ? '' : $copyProject->end; +} +else +{ + $beginValue = data('project.begin') ? data('project.begin') : date('Y-m-d'); + $endValue = data('project.end') == LONG_TIME ? '' : data('project.end'); +} + $fields->field('begin') ->label($lang->project->planDate) ->required() @@ -54,10 +66,10 @@ $fields->field('begin') ->control('dateRangePicker') ->beginName('begin') ->beginPlaceholder($lang->project->begin) - ->beginValue(data('project.begin') ? data('project.begin') : date('Y-m-d')) + ->beginValue($beginValue) ->endName('end') ->endPlaceholder($lang->project->end) - ->endValue(data('project.end') == LONG_TIME ? '' : data('project.end')) + ->endValue($endValue) ->endDisabled($isLongTime) ->endList($lang->project->endList) ->itemEnd() diff --git a/module/project/ui/create.field.php b/module/project/ui/create.field.php index d4617538ca..0c01915beb 100644 --- a/module/project/ui/create.field.php +++ b/module/project/ui/create.field.php @@ -47,6 +47,7 @@ $fields->field('days') ->control('input', array('className' => $copyProject ? 'has-warning' : '')) ->className($copyProject ? 'has-warning' : '') ->tip($copyProject ? $lang->project->copyProject->daysTips : null) + ->value($copyProject ? data('copyProject.days') : '') ->tipClass($copyProject ? 'text-warning' : null); $fields->field('productsBox')->hidden(data('copyProject') && data('copyProject.hasProduct') == 0); From 5c8f89ac78aab6260bb3cc844b940de0fc22dc52 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Mon, 30 Jun 2025 08:48:09 +0000 Subject: [PATCH 25/25] * [bug#145819,done,0.2h] fix bug. --- module/project/ui/common.field.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/ui/common.field.php b/module/project/ui/common.field.php index ff355add40..69ebd09d5e 100644 --- a/module/project/ui/common.field.php +++ b/module/project/ui/common.field.php @@ -9,7 +9,7 @@ $fields = defineFieldList('project'); $model = data('model'); $hasCode = !empty($config->setCode); $currency = data('parentProgram') ? data('parentProgram.budgetUnit') : $config->project->defaultCurrency; -$disableStageBy = !empty(data('executions')) || data('app.rawMethod') == 'edit' ? true : false; +$disableStageBy = !empty(data('executions')) || data('app.rawMethod') == 'edit' || !empty(data('copyProject')); $fields->field('parent') ->control('picker', array('required' => true))