From 7570923bc0c64d82842fdd212b71a84dd6ff5abb Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 6 Dec 2019 13:12:26 +0800 Subject: [PATCH] * finish task #6651. --- module/bug/model.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/module/bug/model.php b/module/bug/model.php index 977d0cb15c..a0fa3f3800 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1668,7 +1668,13 @@ class bugModel extends model $datas = $this->dao->select('project as name, count(project) as value')->from(TABLE_BUG)->where($this->reportCondition())->groupBy('project')->orderBy('value DESC')->fetchAll('name'); if(!$datas) return array(); $projects = $this->loadModel('project')->getPairs(); - foreach($datas as $projectID => $data) $data->name = isset($projects[$projectID]) ? $projects[$projectID] : $this->lang->report->undefined; + + $maxLength = 12; + foreach($datas as $projectID => $data) + { + $data->name = isset($projects[$projectID]) ? $projects[$projectID] : $this->lang->report->undefined; + if(mb_strlen($data->name) > $maxLength) $data->name = mb_substr($data->name, 0, $maxLength) . '...'; + } return $datas; }