* Fix bug.
This commit is contained in:
+10
-5
@@ -995,11 +995,16 @@ class docModel extends model
|
||||
|
||||
if($type == 'product' or $type == 'project')
|
||||
{
|
||||
$project = $this->loadModel('program')->getPRJByID($this->session->PRJ);
|
||||
$orderBy = $project->model == 'waterfall' ? 'begin_asc,id_asc' : 'begin_desc,id_desc';
|
||||
$table = $type == 'product' ? TABLE_PRODUCT : TABLE_PROJECT;
|
||||
$fields = $type == 'product' ? "createdBy, createdDate" : "openedBy AS createdBy, openedDate AS createdDate";
|
||||
$libs = $this->dao->select("id, name, `order`, {$fields}")->from($table)
|
||||
$orderBy = '`order` desc, id desc';
|
||||
if($type == 'project')
|
||||
{
|
||||
$project = $this->loadModel('program')->getPRJByID($this->session->PRJ);
|
||||
$orderBy = $project->model == 'waterfall' ? 'begin_asc,id_asc' : 'begin_desc,id_desc';
|
||||
}
|
||||
|
||||
$table = $type == 'product' ? TABLE_PRODUCT : TABLE_PROJECT;
|
||||
$fields = $type == 'product' ? "createdBy, createdDate" : "openedBy AS createdBy, openedDate AS createdDate";
|
||||
$libs = $this->dao->select("id, name, `order`, {$fields}")->from($table)
|
||||
->where('id')->in($idList)
|
||||
->beginIF($type == 'project' and strpos($this->config->doc->custom->showLibs, 'unclosed') !== false)->andWhere('status')->notin('done,closed')->fi()
|
||||
->orderBy($orderBy)
|
||||
|
||||
Reference in New Issue
Block a user