mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 01:04:12 +02:00
DirectorObjectForm: handle ordering before setup
This commit is contained in:
parent
970d2aa435
commit
712dc6c9b7
@ -711,24 +711,13 @@ abstract class DirectorObjectForm extends QuickForm
|
||||
list($set[$key + 1], $set[$key]) = array($set[$key], $set[$key + 1]);
|
||||
}
|
||||
|
||||
protected function onRequest()
|
||||
protected function beforeSetup()
|
||||
{
|
||||
$values = array();
|
||||
|
||||
$object = $this->object();
|
||||
if ($this->hasBeenSent()) {
|
||||
|
||||
if ($this->shouldBeDeleted()) {
|
||||
$this->deleteObject($object);
|
||||
if (!$this->hasBeenSent()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$post = $this->getRequest()->getPost();
|
||||
foreach ($post as $key => $value) {
|
||||
$el = $this->getElement($key);
|
||||
if ($el && ! $el->getIgnore()) {
|
||||
$values[$key] = $value;
|
||||
}
|
||||
}
|
||||
$post = $values = $this->getRequest()->getPost();
|
||||
|
||||
foreach ($post as $key => $value) {
|
||||
|
||||
@ -750,6 +739,26 @@ abstract class DirectorObjectForm extends QuickForm
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function onRequest()
|
||||
{
|
||||
$values = array();
|
||||
|
||||
$object = $this->object();
|
||||
if ($this->hasBeenSent()) {
|
||||
|
||||
if ($this->shouldBeDeleted()) {
|
||||
$this->deleteObject($object);
|
||||
}
|
||||
|
||||
$post = $this->getRequest()->getPost();
|
||||
foreach ($post as $key => $value) {
|
||||
$el = $this->getElement($key);
|
||||
if ($el && ! $el->getIgnore()) {
|
||||
$values[$key] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($object instanceof IcingaObject) {
|
||||
$this->handleProperties($object, $values);
|
||||
$this->handleCustomVars($object, $post);
|
||||
|
Loading…
x
Reference in New Issue
Block a user