mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-27 07:44:05 +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\Forms\DirectorJobForm;
|
||||||
use Icinga\Module\Director\Web\Controller\ActionController;
|
use Icinga\Module\Director\Web\Controller\ActionController;
|
||||||
use Icinga\Module\Director\Objects\DirectorJob;
|
use Icinga\Module\Director\Objects\DirectorJob;
|
||||||
|
use Icinga\Module\Director\Web\Controller\BranchHelper;
|
||||||
use Icinga\Module\Director\Web\Widget\JobDetails;
|
use Icinga\Module\Director\Web\Widget\JobDetails;
|
||||||
|
|
||||||
class JobController extends ActionController
|
class JobController extends ActionController
|
||||||
{
|
{
|
||||||
|
use BranchHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Icinga\Exception\MissingParameterException
|
* @throws \Icinga\Exception\MissingParameterException
|
||||||
* @throws \Icinga\Exception\NotFoundError
|
* @throws \Icinga\Exception\NotFoundError
|
||||||
@ -29,8 +32,12 @@ class JobController extends ActionController
|
|||||||
{
|
{
|
||||||
$this
|
$this
|
||||||
->addSingleTab($this->translate('New Job'))
|
->addSingleTab($this->translate('New Job'))
|
||||||
->addTitle($this->translate('Add a new Job'))
|
->addTitle($this->translate('Add a new Job'));
|
||||||
->content()->add(
|
if ($this->showNotInBranch($this->translate('Creating Jobs'))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->content()->add(
|
||||||
DirectorJobForm::load()
|
DirectorJobForm::load()
|
||||||
->setSuccessUrl('director/job')
|
->setSuccessUrl('director/job')
|
||||||
->setDb($this->db())
|
->setDb($this->db())
|
||||||
@ -45,16 +52,19 @@ class JobController extends ActionController
|
|||||||
public function editAction()
|
public function editAction()
|
||||||
{
|
{
|
||||||
$job = $this->requireJob();
|
$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()
|
$form = DirectorJobForm::load()
|
||||||
->setListUrl('director/jobs')
|
->setListUrl('director/jobs')
|
||||||
->setObject($job)
|
->setObject($job)
|
||||||
->handleRequest();
|
->handleRequest();
|
||||||
|
$this->content()->add($form);
|
||||||
$this
|
|
||||||
->addJobTabs($job, 'edit')
|
|
||||||
->addTitle($this->translate('Job: %s'), $job->get('job_name'))
|
|
||||||
->addToBasketLink()
|
|
||||||
->content()->add($form);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user