* Finish task #71648.
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user