Merge branch 'zentaopms_239_task#71648' into 'zentaopms_239'
* Finish task #71648. See merge request easycorp/zentaopms!5693
This commit is contained in:
+25
-1
@@ -917,8 +917,13 @@ 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, ','));
|
||||
|
||||
$disabledFeatures = rtrim($disabledFeatures, ',');
|
||||
$this->loadModel('setting')->setItem('system.common.disabledFeatures', $disabledFeatures);
|
||||
|
||||
$this->processMeasrecordCron($disabledFeatures);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1064,4 +1069,23 @@ class customModel extends model
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process measrecord cron.
|
||||
*
|
||||
* @param string $disabledFeatures
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function processMeasrecordCron($disabledFeatures)
|
||||
{
|
||||
$cronStatus = 'normal';
|
||||
if(strpos(",$disabledFeatures,", ',waterfall,') !== false and strpos(",$disabledFeatures,", ',scrumMeasrecord,') !== false) $cronStatus = 'stop';
|
||||
|
||||
$this->loadModel('cron');
|
||||
$cron = $this->dao->select('id,status')->from(TABLE_CRON)->where('command')->like('%methodName=initCrontabQueue')->fetch();
|
||||
if($cron and $cron->status != $cronStatus) $this->cron->changeStatus($cron->id, $cronStatus);
|
||||
$cron = $this->dao->select('id,status')->from(TABLE_CRON)->where('command')->like('%methodName=execCrontabQueue')->fetch();
|
||||
if($cron and $cron->status != $cronStatus) $this->cron->changeStatus($cron->id, $cronStatus);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user