diff --git a/module/doc/model.php b/module/doc/model.php index 2f626db056..5a801ce31f 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -3144,17 +3144,16 @@ class docModel extends model * Print create document button. * * @param object $lib - * @param type $type project|product|custom - * @param int $objectID * @param int $moduleID * @param string $from list * @access public * @return string */ - public function printCreateBtn($lib, $type, $objectID, $moduleID, $from = '') + public function printCreateBtn($lib, $moduleID, $from = '') { if(!common::hasPriv('doc', 'create') or !isset($lib->id)) return null; + $objectID = zget($lib, $lib->type, 0); $class = $from == 'list' ? 'btn-info' : 'btn-primary'; $html = " diff --git a/module/doc/view/tablecontents.html.php b/module/doc/view/tablecontents.html.php index 5efa90d57e..6167492df2 100644 --- a/module/doc/view/tablecontents.html.php +++ b/module/doc/view/tablecontents.html.php @@ -56,7 +56,7 @@ } elseif($libID and common::hasPriv('doc', 'create')) { - echo $this->doc->printCreateBtn($lib, $type, $objectID, $moduleID); + echo $this->doc->printCreateBtn($lib, $moduleID); } ?> diff --git a/module/doc/view/view.html.php b/module/doc/view/view.html.php index a0d1d36c89..6741efc53c 100644 --- a/module/doc/view/view.html.php +++ b/module/doc/view/view.html.php @@ -37,7 +37,7 @@
createLink('doc', $exportMethod, "libID=$libID&moduleID=0&docID=$docID"), " " . $lang->export, 'hiddenwin', "class='btn btn-link' id='docExport'"); - if(common::hasPriv('doc', 'create')) echo $this->doc->printCreateBtn($lib, $type, $objectID, $moduleID); + if(common::hasPriv('doc', 'create')) echo $this->doc->printCreateBtn($lib, $moduleID); ?>