mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34: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]);
|
list($set[$key + 1], $set[$key]) = array($set[$key], $set[$key + 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function onRequest()
|
protected function beforeSetup()
|
||||||
{
|
{
|
||||||
$values = array();
|
if (!$this->hasBeenSent()) {
|
||||||
|
return;
|
||||||
$object = $this->object();
|
|
||||||
if ($this->hasBeenSent()) {
|
|
||||||
|
|
||||||
if ($this->shouldBeDeleted()) {
|
|
||||||
$this->deleteObject($object);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$post = $this->getRequest()->getPost();
|
$post = $values = $this->getRequest()->getPost();
|
||||||
foreach ($post as $key => $value) {
|
|
||||||
$el = $this->getElement($key);
|
|
||||||
if ($el && ! $el->getIgnore()) {
|
|
||||||
$values[$key] = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($post as $key => $value) {
|
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) {
|
if ($object instanceof IcingaObject) {
|
||||||
$this->handleProperties($object, $values);
|
$this->handleProperties($object, $values);
|
||||||
$this->handleCustomVars($object, $post);
|
$this->handleCustomVars($object, $post);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user