From 82b7246b8d6ebc5ffc8b88e0c99d676bb8b37e33 Mon Sep 17 00:00:00 2001 From: wangyuting2 <851424971@qq.com> Date: Sun, 9 Oct 2022 07:44:39 +0000 Subject: [PATCH] * Finish task #71648. --- module/custom/control.php | 2 ++ module/custom/model.php | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/module/custom/control.php b/module/custom/control.php index 9afe6c757e..8532402f2d 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -645,6 +645,8 @@ class custom extends control if($mode == 'lean') $this->custom->processProjectAcl(); + $this->custom->processMeasrecordCron(); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'top')); } diff --git a/module/custom/model.php b/module/custom/model.php index 9302ab26f1..26db867b7f 100644 --- a/module/custom/model.php +++ b/module/custom/model.php @@ -917,6 +917,7 @@ class customModel extends model $function = 'has' . ucfirst($feature) . 'Data'; if(!$this->$function()) $disabledFeatures .= "$feature,"; } + $disabledFeatures .= 'scrumMeasrecord,'; } $this->loadModel('setting')->setItem('system.common.disabledFeatures', rtrim($disabledFeatures, ',')); } @@ -1064,4 +1065,23 @@ class customModel extends model } return false; } + + /** + * Process measrecord cron. + * + * @access public + * @return void + */ + public function processMeasrecordCron() + { + $disabledFeatures = $this->loadModel('setting')->getItem('owner=system&module=common§ion=&key=disabledFeatures'); + + $cronStatus = 'normal'; + if(strpos(",$disabledFeatures,", ',waterfall,') !== false and strpos(",$disabledFeatures,", ',scrumMeasrecord,') !== false) $cronStatus = 'stop'; + + $cronID = $this->dao->select('id')->from(TABLE_CRON)->where('command')->like('%methodName=initCrontabQueue')->fetch('id'); + if($cronID) $this->loadModel('cron')->changeStatus($cronID, $cronStatus); + $cronID = $this->dao->select('id')->from(TABLE_CRON)->where('command')->like('%methodName=execCrontabQueue')->fetch('id'); + if($cronID) $this->cron->changeStatus($cronID, $cronStatus); + } }