mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2026-05-28 04:35:53 -04:00
parent
2c000d4160
commit
d0a29d4716
2 changed files with 5 additions and 2 deletions
|
|
@ -24,6 +24,7 @@ use Icinga\Module\Director\Web\Table\SyncpropertyTable;
|
|||
use Icinga\Module\Director\Web\Table\SyncRunTable;
|
||||
use Icinga\Module\Director\Web\Tabs\SyncRuleTabs;
|
||||
use Icinga\Module\Director\Web\Widget\SyncRunDetails;
|
||||
use ipl\Html\Form;
|
||||
use ipl\Html\Html;
|
||||
use gipfl\IcingaWeb2\Link;
|
||||
|
||||
|
|
@ -509,6 +510,9 @@ class SyncruleController extends ActionController
|
|||
|
||||
$form = new CloneSyncRuleForm($rule);
|
||||
$this->content()->add($form);
|
||||
$form->on(Form::ON_SUCCESS, function (CloneSyncRuleForm $form) {
|
||||
$this->getResponse()->redirectAndExit($form->getSuccessUrl());
|
||||
});
|
||||
$form->handleRequest($this->getServerRequest());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class CloneSyncRuleForm extends Form
|
|||
|
||||
protected function assemble()
|
||||
{
|
||||
$this->addElement('rule_name', 'text', [
|
||||
$this->addElement('text', 'rule_name', [
|
||||
'label' => $this->translate('New name'),
|
||||
'value' => $this->rule->get('rule_name'),
|
||||
]);
|
||||
|
|
@ -59,7 +59,6 @@ class CloneSyncRuleForm extends Form
|
|||
}
|
||||
$this->newRule = SyncRule::import($export, $this->getTargetDb());
|
||||
$this->newRule->store();
|
||||
$this->redirectOnSuccess();
|
||||
}
|
||||
|
||||
public function getSuccessUrl()
|
||||
|
|
|
|||
Loading…
Reference in a new issue