From 9195e507ee764ed4d6e84f1bca7f408cbb0a5537 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 20 Oct 2023 16:03:22 +0800 Subject: [PATCH] * merge for bug #39682. --- module/program/model.php | 1 - module/project/model.php | 9 ++++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/module/program/model.php b/module/program/model.php index 6114f97bb0..ed9c70f9cf 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -1361,7 +1361,6 @@ class programModel extends model ->fetchGroup('root', 'account'); $stats = $this->appendStatToProjects($projects, 'hours,teamCount,teamMembers,leftTasks', array('hours' => $hours, 'teams' => $teamMembers, 'leftTasks' => $leftTasks)); - foreach($stats as $project) $project->name = htmlspecialchars_decode($project->name, ENT_QUOTES); // Convert predefined HTML entities to characters. return $stats; } diff --git a/module/project/model.php b/module/project/model.php index 89baa0116a..4864da78a6 100755 --- a/module/project/model.php +++ b/module/project/model.php @@ -2011,7 +2011,11 @@ class projectModel extends model /* Get execution of the status is doing. */ $executions = $this->loadModel('execution')->getStatData(0, 'doing', 0, 0, false, 'hasParentName|skipParent'); $projectExecutions = array(); - foreach($executions as $execution) $projectExecutions[$execution->project][$execution->id] = $execution; + foreach($executions as $execution) + { + if(!empty($execution->projectName)) $execution->projectName = htmlspecialchars_decode($execution->projectName); + $projectExecutions[$execution->project][$execution->id] = $execution; + } /* The execution is sorted in reverse order by execution ID. */ $ongoingExecutions = array(); @@ -2027,6 +2031,9 @@ class projectModel extends model /* Only display recent two closed projects. */ $projectsStats = $this->projectTao->sortAndReduceClosedProjects($projectsStats, 2); + /* Convert predefined HTML entities to characters. */ + foreach($projectsStats as $project) $project->name = htmlspecialchars_decode($project->name, ENT_QUOTES); + return array($projectsStats, $ongoingExecutions); }