* Adjust code.
This commit is contained in:
@@ -404,7 +404,7 @@ class doc extends control
|
||||
$this->view->doc = $doc;
|
||||
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($libID, 'doc', $startModuleID = 0);
|
||||
$this->view->type = $type;
|
||||
$this->view->libs = $this->doc->getCompleteLibName();
|
||||
$this->view->libs = $this->doc->getLibs($type = 'all', $extra = 'withObject');
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->view->users = $this->user->getPairs('noletter', $doc->users);
|
||||
$this->display();
|
||||
|
||||
+16
-21
@@ -157,10 +157,25 @@ class docModel extends model
|
||||
->orderBy('`order`, id desc')->query();
|
||||
}
|
||||
|
||||
if(strpos($extra, 'withObject') !== false)
|
||||
{
|
||||
$products = $this->loadModel('product')->getPairs();
|
||||
$projects = $this->loadModel('project')->getPairs();
|
||||
}
|
||||
|
||||
$libPairs = array();
|
||||
while($lib = $stmt->fetch())
|
||||
{
|
||||
if($this->checkPrivLib($lib, $extra)) $libPairs[$lib->id] = $lib->name;
|
||||
if($this->checkPrivLib($lib, $extra))
|
||||
{
|
||||
if(strpos($extra, 'withObject') !== false)
|
||||
{
|
||||
if($lib->product != 0) $lib->name = zget($products, $lib->product, '') . '/' . $lib->name;
|
||||
if($lib->project != 0) $lib->name = zget($projects, $lib->project, '') . '/' . $lib->name;
|
||||
}
|
||||
|
||||
$libPairs[$lib->id] = $lib->name;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($appendLibs))
|
||||
@@ -1523,24 +1538,4 @@ class docModel extends model
|
||||
|
||||
return $actions;
|
||||
}
|
||||
|
||||
public function getCompleteLibName()
|
||||
{
|
||||
$libPairs = array();
|
||||
$products = $this->loadModel('product')->getPairs();
|
||||
$projects = $this->loadModel('project')->getPairs();
|
||||
$stmt = $this->dao->select('id,project,product,name')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->query();
|
||||
|
||||
while($lib = $stmt->fetch())
|
||||
{
|
||||
if($this->checkPrivLib($lib))
|
||||
{
|
||||
if($lib->product != 0) $lib->name = zget($products, $lib->product) . '/' . $lib->name;
|
||||
if($lib->project != 0) $lib->name = zget($projects, $lib->project) . '/' . $lib->name;
|
||||
$libPairs[$lib->id] = $lib->name;
|
||||
}
|
||||
}
|
||||
|
||||
return $libPairs;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user