* adjust for task #6174.
This commit is contained in:
@@ -355,8 +355,10 @@ class doc extends control
|
||||
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$libID"), $lib->name);
|
||||
$this->view->position[] = $this->lang->doc->create;
|
||||
|
||||
$unclosed = strpos($this->config->doc->custom->showLibs, 'unclosed') !== false ? 'unclosedProject' : '';
|
||||
|
||||
$this->view->libID = $libID;
|
||||
$this->view->libs = $this->doc->getLibs($type = 'all', $extra = 'withObject');
|
||||
$this->view->libs = $this->doc->getLibs($type = 'all', $extra = "withObject,$unclosed", $libID);
|
||||
$this->view->libName = $this->dao->findByID($libID)->from(TABLE_DOCLIB)->fetch('name');
|
||||
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($libID, 'doc', $startModuleID = 0);
|
||||
$this->view->moduleID = $moduleID;
|
||||
|
||||
@@ -148,11 +148,15 @@ class docModel extends model
|
||||
elseif($type == 'all')
|
||||
{
|
||||
/* Associated display Settings -> shows only unclosed projects.*/
|
||||
$stmt = $this->dao->select('distinct t1.*')->from(TABLE_DOCLIB)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on("t1.project = '' || t1.project = t2.id")
|
||||
->where('t1.deleted')->eq(0)
|
||||
->beginIF(strpos($this->config->doc->custom->showLibs,'unclosed') !== false)->andWhere('t2.status')->notin('done,closed')->fi()
|
||||
->orderBy('t1.order,t1.id desc')
|
||||
$undoneSql = $this->dao->select('id')->from(TABLE_PROJECT)->where('deleted')->eq(0)->andWhere('status')->notin('done,closed')->get();
|
||||
$stmt = $this->dao->select('*')->from(TABLE_DOCLIB)
|
||||
->where('deleted')->eq(0)
|
||||
->beginIF(strpos($extra, 'unclosedProject') !== false)
|
||||
->andWhere('project', true)->eq('0')
|
||||
->orWhere("project IN ($undoneSql)")
|
||||
->markRight(1)
|
||||
->fi()
|
||||
->orderBy('`order`,id desc')
|
||||
->query();
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user