diff --git a/module/doc/control.php b/module/doc/control.php index df3cab5819..28e22d3b34 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -168,11 +168,24 @@ class doc extends control $this->view->itemCounts = $this->doc->statLibCounts(array_keys($libs)); } + $attachLibs = array(); + if(!empty($lib) and (!empty($lib->product) or !empty($lib->project)) and $browseType != 'bymodule') + { + $count = $this->dao->select('count(*) as count')->from(TABLE_DOCLIB)->where('project')->eq($lib->project)->andWhere('product')->eq($lib->product)->fetch('count'); + if($count == 1 and $type and isset($lib->$type)) + { + $objectLibs = $this->doc->getLibsByObject($type, $lib->$type); + if(isset($objectLibs['project'])) $attachLibs['project'] = $objectLibs['project']; + if(isset($objectLibs['files'])) $attachLibs['files'] = $objectLibs['files']; + } + } + $this->view->breadTitle = $title; $this->view->libID = $libID; $this->view->moduleID = $moduleID; $this->view->modules = $this->doc->getDocMenu($libID, $moduleID, '`order`', $browseType); $this->view->docs = $this->doc->getDocsByBrowseType($libID, $browseType, $queryID, $moduleID, $sort, $pager); + $this->view->attachLibs = $attachLibs; $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->orderBy = $orderBy; $this->view->browseType = $browseType; diff --git a/module/doc/model.php b/module/doc/model.php index 6dc1252e5b..674d03b25e 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -51,7 +51,12 @@ class docModel extends model $mainLib = $this->lang->doc->libTypeList[$type]; $selectHtml .= "
"; $selectHtml .= "
"; - $selectHtml .= "" . $mainLib . ""; + $selectHtml .= "" . $mainLib . " "; + $selectHtml .= "
'; }