Skip to content
Snippets Groups Projects

Issue #3364436: Add "Status" checkbox for continuous jobs to allow pausing them

1 file
+ 12
0
Compare changes
  • Side-by-side
  • Inline
+ 12
0
@@ -507,6 +507,14 @@ class JobForm extends TmgmtFormBase {
'#weight' => 45,
);
if ($job->isContinuous()) {
$form['state'] = [
'#type' => 'checkbox',
'#title' => $this->t('Active'),
'#default_value' => $job->isContinuousActive(),
];
}
if (!$job->isContinuous() && $view = Views::getView('tmgmt_job_messages')) {
$output = $view->preview('embed', array($job->id()));
if ($view->result) {
@@ -635,6 +643,10 @@ class JobForm extends TmgmtFormBase {
$job->label = $job->label();
}
if ($job->isContinuous()) {
$job->state->value = $form_state->getValue('state') ? JobInterface::STATE_CONTINUOUS : JobInterface::STATE_CONTINUOUS_INACTIVE;
}
return $job;
}
Loading