Merge pull request '* Revert code and fix bug #34873 again.' (#67) from sprint/scx_revertbug_34873 into 18.4

Reviewed-on: https://git.zcorp.cc/easycorp/zentaopms/pulls/67
This commit is contained in:
孙广明
2023-05-19 14:10:18 +08:00
+17
View File
@@ -1718,6 +1718,20 @@ class docModel extends model
/* Load module. */
$this->loadModel('program');
/* Project permissions for DocLib whitelist. */
if($this->app->tab == 'doc')
{
$myObjects = $this->dao->select('t1.id, t1.name')->from(TABLE_PROJECT)->alias('t1')
->leftjoin(TABLE_DOCLIB)->alias('t2')->on('t2.project=t1.id')
->where("CONCAT(',', t2.users, ',')")->like("%,{$this->app->user->account},%")
->andWhere('t1.vision')->eq($this->config->vision)
->andWhere('t1.deleted')->eq(0)
->beginIF($this->config->vision == 'rnd')->andWhere('model')->ne('kanban')->fi()
->beginIF($append)->orWhere('t1.id')->eq($append)->fi()
->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->projects)->fi()
->fetchPairs();
}
/* Sort project. */
$orderedProjects = array();
@@ -1753,6 +1767,9 @@ class docModel extends model
$closedObjects[$id] = $project->name;
}
}
/* Fix bug #34873. */
ksort($myObjects);
}
elseif($objectType == 'execution')
{