mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-26 23:34:10 +02:00
JobController: not in Branches, formatting
This commit is contained in:
parent
2dc83478ae
commit
098f620802
@ -6,10 +6,13 @@ use gipfl\IcingaWeb2\Link;
|
||||
use Icinga\Module\Director\Forms\DirectorJobForm;
|
||||
use Icinga\Module\Director\Web\Controller\ActionController;
|
||||
use Icinga\Module\Director\Objects\DirectorJob;
|
||||
use Icinga\Module\Director\Web\Controller\BranchHelper;
|
||||
use Icinga\Module\Director\Web\Widget\JobDetails;
|
||||
|
||||
class JobController extends ActionController
|
||||
{
|
||||
use BranchHelper;
|
||||
|
||||
/**
|
||||
* @throws \Icinga\Exception\MissingParameterException
|
||||
* @throws \Icinga\Exception\NotFoundError
|
||||
@ -29,13 +32,17 @@ class JobController extends ActionController
|
||||
{
|
||||
$this
|
||||
->addSingleTab($this->translate('New Job'))
|
||||
->addTitle($this->translate('Add a new Job'))
|
||||
->content()->add(
|
||||
DirectorJobForm::load()
|
||||
->setSuccessUrl('director/job')
|
||||
->setDb($this->db())
|
||||
->handleRequest()
|
||||
);
|
||||
->addTitle($this->translate('Add a new Job'));
|
||||
if ($this->showNotInBranch($this->translate('Creating Jobs'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->content()->add(
|
||||
DirectorJobForm::load()
|
||||
->setSuccessUrl('director/job')
|
||||
->setDb($this->db())
|
||||
->handleRequest()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -45,16 +52,19 @@ class JobController extends ActionController
|
||||
public function editAction()
|
||||
{
|
||||
$job = $this->requireJob();
|
||||
$this
|
||||
->addJobTabs($job, 'edit')
|
||||
->addTitle($this->translate('Job: %s'), $job->get('job_name'))
|
||||
->addToBasketLink();
|
||||
if ($this->showNotInBranch($this->translate('Modifying Jobs'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
$form = DirectorJobForm::load()
|
||||
->setListUrl('director/jobs')
|
||||
->setObject($job)
|
||||
->handleRequest();
|
||||
|
||||
$this
|
||||
->addJobTabs($job, 'edit')
|
||||
->addTitle($this->translate('Job: %s'), $job->get('job_name'))
|
||||
->addToBasketLink()
|
||||
->content()->add($form);
|
||||
$this->content()->add($form);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user