From c8fcf59875019a7b8037f4b3b033703e15560958 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 23 Feb 2021 13:46:21 +0800 Subject: [PATCH 01/14] * Code for task #36042. --- module/product/config.php | 9 +++++++-- module/product/control.php | 7 ++++++- module/product/view/all.html.php | 15 ++++++++++++--- module/product/view/create.html.php | 6 ++++-- module/product/view/edit.html.php | 2 ++ 5 files changed, 31 insertions(+), 8 deletions(-) diff --git a/module/product/config.php b/module/product/config.php index 4181e48150..97935c7ffa 100644 --- a/module/product/config.php +++ b/module/product/config.php @@ -83,8 +83,13 @@ $config->product->search['params']['lastEditedDate'] = array('operator' => '=', $config->product->create = new stdclass(); $config->product->edit = new stdclass(); -$config->product->create->requiredFields = 'name,program'; -$config->product->edit->requiredFields = 'name,program'; +$config->product->create->requiredFields = 'name'; +$config->product->edit->requiredFields = 'name'; +if($config->global->mode == 'new') +{ + $config->product->create->requiredFields .= ',program'; + $config->product->edit->requiredFields .= ',program'; +} $config->product->editor = new stdclass(); $config->product->editor->create = array('id' => 'desc', 'tools' => 'simpleTools'); diff --git a/module/product/control.php b/module/product/control.php index e9d4d82462..f929a4c248 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -333,6 +333,7 @@ class product extends control $this->view->rdUsers = $rdUsers; $this->view->users = $this->user->getPairs('nodeleted|noclosed'); $this->view->programs = array('') + $this->loadModel('program')->getTopPGMPairs('', 'noclosed'); + $this->view->lines = $this->config->global->mode == 'new' ? array() : array('' => '') + $this->product->getLinePairs(); $this->view->URSRPairs = $this->loadModel('custom')->getURSRPairs(); unset($this->lang->product->typeList['']); @@ -467,6 +468,10 @@ class product extends control $rdUsers = $this->user->getPairs('nodeleted|devfirst', $product->RD, $this->config->maxCount); if(!empty($this->config->user->moreLink)) $this->config->moreLinks["RD"] = $this->config->user->moreLink; + $lines = array(); + if($product->program) $lines = array('') + $this->product->getLinePairs($product->program); + if($this->config->global->mode == 'old') $lines = array('') + $this->product->getLinePairs(); + $this->view->title = $this->lang->product->edit . $this->lang->colon . $product->name; $this->view->position[] = html::a($this->createLink($this->moduleName, 'browse'), $product->name); $this->view->position[] = $this->lang->product->edit; @@ -480,7 +485,7 @@ class product extends control $this->view->rdUsers = $rdUsers; $this->view->users = $this->user->getPairs('nodeleted|noclosed'); $this->view->programs = array('') + $this->loadModel('program')->getTopPGMPairs(); - $this->view->lines = $product->program ? array('') + $this->product->getLinePairs($product->program) : array(); + $this->view->lines = $lines; $this->view->URSRPairs = $this->loadModel('custom')->getURSRPairs(); $this->view->canChangePGM = $canChangePGM; $this->view->singleLinkProjects = $singleLinkProjects; diff --git a/module/product/view/all.html.php b/module/product/view/all.html.php index f3e08c9b3b..e9dbdfce47 100644 --- a/module/product/view/all.html.php +++ b/module/product/view/all.html.php @@ -80,9 +80,18 @@ $line):?> config->global->mode == 'new') + { + $trAttrs = "data-id='line.$lineID' data-parent='program.$programID'"; + $trClass .= ' is-nest-child table-nest'; + $trAttrs .= " data-nest-parent='program.$programID' data-nest-path='program.$programID,$lineID'"; + } + else + { + $trAttrs = "data-id='line.$lineID' data-parent='0' data-nested='true'"; + $trClass = 'is-top-level table-nest-child'; + $trAttrs .= " class='$trClass'"; + } ?>