$this->_action = CRM_Utils_Request::retrieve('action', 'String',
$this, FALSE, 0
);
+ $this->_context = CRM_Utils_Request::retrieve('context', 'String',
+ $this, FALSE, 0
+ );
if (($this->_action & CRM_Core_Action::COPY) && (!empty($this->_id))) {
try {
if (CRM_Core_Config::environment() != 'Production') {
CRM_Core_Session::setStatus(ts('Execution of scheduled jobs has been turned off by default since this is a non-production environment. You can override this for particular jobs by adding runInNonProductionEnvironment=TRUE as a parameter.'), ts("Non-production Environment"), "warning", array('expires' => 0));
}
+ else {
+ $cronError = Civi\Api4\System::check(FALSE)
+ ->addWhere('name', '=', 'checkLastCron')
+ ->addWhere('severity_id', '>', 1)
+ ->setIncludeDisabled(TRUE)
+ ->execute()
+ ->first();
+ if ($cronError) {
+ CRM_Core_Session::setStatus($cronError['message'], $cronError['title'], 'alert', ['expires' => 0]);
+ }
+ }
$sj = new CRM_Core_JobManager();
- $rows = $temp = [];
+ $rows = [];
foreach ($sj->jobs as $job) {
$action = array_sum(array_keys($this->links()));
// update enable/disable links.
// CRM-9868- remove enable action for jobs that should never be run automatically via execute action or runjobs url
- if ($job->api_action == 'process_membership_reminder_date' || $job->api_action == 'update_greeting') {
+ if ($job->api_action === 'process_membership_reminder_date' || $job->api_action === 'update_greeting') {
$action -= CRM_Core_Action::ENABLE;
$action -= CRM_Core_Action::DISABLE;
}
$action -= CRM_Core_Action::DISABLE;
}
- $job->action = CRM_Core_Action::formLink(self::links(), $action,
- array('id' => $job->id),
+ $job->action = CRM_Core_Action::formLink($this->links(), $action,
+ ['id' => $job->id],
ts('more'),
FALSE,
'job.manage.action',