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?> |