Merge branch dev/bug-62945 of zentao/zentaopms (#9019)

This commit is contained in:
刘刚
2025-05-29 15:09:54 +08:00
committed by Gitfox
4 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -1411,7 +1411,7 @@ class docModel extends model
}
if($type == 'project')
{
$projects = $this->loadModel('project')->getListByCurrentUser('*', false);
$projects = $this->loadModel('project')->getListByCurrentUser();
$involvedProjects = $this->project->getInvolvedListByCurrentUser();
$spaceID = $this->project->checkAccess($spaceID, $projects);
+3 -1
View File
@@ -108,7 +108,8 @@ class executionModel extends model
if(!$executionID && $this->session->execution) $executionID = $this->session->execution;
if(!$executionID) $executionID = key($executions);
if($execution->multiple && !$execution->isTpl && !isset($executions[$executionID])) $executionID = key($executions);
if($execution->multiple && !$execution->isTpl && $executions && (!isset($executions[$executionID]) || !$this->checkPriv($executionID))) return $this->accessDenied();
$canAccess = !empty($executions) && isset($executions[$executionID]) && $this->checkPriv($executionID);
if($execution->multiple && !$execution->isTpl && !$canAccess) return $this->accessDenied();
if(empty($executionID)) return;
/* Replaces the iterated language with the stage. */
@@ -589,6 +590,7 @@ class executionModel extends model
public function batchChangeStatus(array $executionIdList, string $status): array
{
/* Sort the IDs, the child stage comes first, and the parent stage follows. */
if(!defined('AUTOTPL')) define('AUTOTPL', false);
$executionList = $this->dao->select('id,name,status,grade,deliverable')->from(TABLE_EXECUTION)->where('id')->in($executionIdList)->orderBy('grade_desc')->fetchAll('id');
$this->loadModel('programplan');
+2 -1
View File
@@ -102,9 +102,10 @@ class project extends control
$_COOKIE['showClosed'] = 1;
$project = $this->project->fetchByID($projectID);
if(!empty($project->isTpl) && !defined('AUTOTPL')) define('AUTOTPL', false);
/* Query user's project and program. */
$projects = $this->project->getListByCurrentUser('*', !$project->isTpl);
$projects = $this->project->getListByCurrentUser();
$involvedProjects = $this->project->getInvolvedListByCurrentUser();
$programs = $this->loadModel('program')->getPairs(true);
+1 -2
View File
@@ -68,11 +68,10 @@ class projectModel extends model
* Get project list by current user.
*
* @param string $fields
* @param bool $autoTpl
* @access public
* @return array
*/
public function getListByCurrentUser(string $fields = '*', bool $autoTpl = true) :array
public function getListByCurrentUser(string $fields = '*') :array
{
return $this->dao->select($fields)->from(TABLE_PROJECT)
->where('type')->eq('project')