mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
parent
24b14184be
commit
34a0179103
@ -97,6 +97,16 @@ class IcingaMultiEditForm extends DirectorObjectForm
|
|||||||
*/
|
*/
|
||||||
protected function onRequest()
|
protected function onRequest()
|
||||||
{
|
{
|
||||||
|
if ($this->hasBeenSent()) {
|
||||||
|
$this->handlePost();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function handlePost()
|
||||||
|
{
|
||||||
|
if ($this->shouldBeDeleted()) {
|
||||||
|
$this->deleteObjects();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setSubmittedMultiValue($key, $value)
|
protected function setSubmittedMultiValue($key, $value)
|
||||||
@ -277,4 +287,23 @@ class IcingaMultiEditForm extends DirectorObjectForm
|
|||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function deleteObjects()
|
||||||
|
{
|
||||||
|
$msg = sprintf(
|
||||||
|
'%d objects of type "%s" have been removed',
|
||||||
|
count($this->objects),
|
||||||
|
$this->translate($this->object->getShortTableName())
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($this->objects as $object) {
|
||||||
|
$object->delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->listUrl) {
|
||||||
|
$this->setSuccessUrl($this->listUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->redirectOnSuccess($msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user