From ffc90c7d5827c76c364939e2fa7fba33c0f90bc2 Mon Sep 17 00:00:00 2001 From: wangyuting2 <851424971@qq.com> Date: Tue, 27 Sep 2022 06:07:49 +0000 Subject: [PATCH] * Hide lean mode features. --- module/custom/model.php | 64 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 6 deletions(-) diff --git a/module/custom/model.php b/module/custom/model.php index 227e1e4e0a..87de231e46 100644 --- a/module/custom/model.php +++ b/module/custom/model.php @@ -903,7 +903,7 @@ class customModel extends model $disabledFeatures = ''; if($mode == 'lean') { - $features = array('opportunity'); + $features = array('scrumOpportunity', 'scrumMeeting', 'scrumAuditplan', 'scrumProcess'); foreach($features as $feature) { $function = 'has' . ucfirst($feature) . 'Data'; @@ -914,20 +914,72 @@ class customModel extends model } /** - * Verify whether there is opportunity data + * Verify whether there is scrum opportunity data * * @access public * @return bool */ - public function hasOpportunityData() + public function hasScrumOpportunityData() { if($this->config->edition == 'max') { - return $this->dao->select('id')->from(TABLE_OPPORTUNITY)->count(); + return $this->dao->select('id')->from(TABLE_OPPORTUNITY)->where('execution')->ne('0')->andWhere('deleted')->eq('0')->count(); } - else + return false; + } + + /** + * Verify whether there is scrum meeting data. + * + * @access public + * @return bool + */ + public function hasScrumMeetingData() + { + if($this->config->edition == 'max') { - return false; + return $this->dao->select('id')->from(TABLE_EXECUTION)->alias('t1') + ->leftJoin(TABLE_MEETING)->alias('t2')->on('t1.id = t2.project') + ->where('t1.model')->eq('scrum') + ->andWhere('t1.deleted')->eq('0') + ->andWhere('t2.deleted')->eq('0') + ->count(); } + return false; + } + + /** + * Verify whether there is scrum auditplan data. + * + * @access public + * @return bool + */ + public function hasScrumAuditplanData() + { + if($this->config->edition == 'max') + { + return $this->dao->select('id')->from(TABLE_EXECUTION)->alias('t1') + ->leftJoin(TABLE_AUDITPLAN)->alias('t2')->on('t1.id = t2.project') + ->where('t1.model')->eq('scrum') + ->andWhere('t1.deleted')->eq('0') + ->andWhere('t2.deleted')->eq('0') + ->count(); + } + return false; + } + + /** + * Verify whether there is scrum process data. + * + * @access public + * @return bool + */ + public function hasScrumProcessData() + { + if($this->config->edition == 'max') + { + return $this->dao->select('id')->from(TABLE_PROGRAMACTIVITY)->where('execution')->ne('0')->andWhere('deleted')->eq('0')->count(); + } + return false; } }