From cb7bde31c8e1a819b02962361acf99ad1cd11b66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Thu, 7 Dec 2017 14:38:41 +0800 Subject: [PATCH] * Task#3496 --- module/doc/control.php | 19 +++++++++++++------ module/doc/view/createlib.html.php | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index 44d25f0675..0523918d42 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -194,12 +194,19 @@ class doc extends control echo js::error(dao::getError()); } } - $this->view->groups = $this->loadModel('group')->getPairs(); - $this->view->users = $this->user->getPairs('nocode'); - $this->view->products = $this->product->getPairs('nocode'); - $this->view->projects = $this->project->getPairs('nocode'); - $this->view->type = $type; - $this->view->objectID = $objectID; + $libTypeList = $this->lang->doc->libTypeList; + $products = $this->product->getPairs('nocode'); + $projects = $this->project->getPairs('nocode'); + if(empty($products)) unset($libTypeList['product']); + if(empty($projects)) unset($libTypeList['project']); + + $this->view->groups = $this->loadModel('group')->getPairs(); + $this->view->users = $this->user->getPairs('nocode'); + $this->view->products = $products; + $this->view->projects = $projects; + $this->view->type = $type; + $this->view->libTypeList = $libTypeList; + $this->view->objectID = $objectID; die($this->display()); } diff --git a/module/doc/view/createlib.html.php b/module/doc/view/createlib.html.php index b45422bbf5..1ee8f24820 100644 --- a/module/doc/view/createlib.html.php +++ b/module/doc/view/createlib.html.php @@ -23,7 +23,7 @@ - +
doc->libType?>doc->libTypeList, $type, "class='form-control'")?>
doc->product?>