Transmit the user who cancels a downtime

This commit is contained in:
Johannes Meyer 2020-05-14 13:58:03 +02:00
parent 287edb7932
commit 08bc671fb7
4 changed files with 8 additions and 3 deletions

View File

@ -94,6 +94,7 @@ class DeleteDowntimeCommandForm extends CommandForm
{
$cmd = new DeleteDowntimeCommand();
$cmd
->setAuthor($this->Auth()->getUser()->getUsername())
->setDowntimeId($this->getElement('downtime_id')->getValue())
->setDowntimeName($this->getElement('downtime_name')->getValue())
->setIsService($this->getElement('downtime_is_service')->getValue());

View File

@ -73,6 +73,7 @@ class DeleteDowntimesCommandForm extends CommandForm
$delDowntime
->setDowntimeId($downtime->id)
->setDowntimeName($downtime->name)
->setAuthor($this->Auth()->getUser()->getUsername())
->setIsService(isset($downtime->service_description));
$this->getTransport($this->request)->send($delDowntime);
}

View File

@ -10,6 +10,8 @@ use Icinga\Module\Monitoring\Command\IcingaCommand;
*/
class DeleteDowntimeCommand extends IcingaCommand
{
use CommandAuthor;
/**
* ID of the downtime that is to be deleted
*

View File

@ -247,9 +247,10 @@ class IcingaApiCommandRenderer implements IcingaCommandRendererInterface
public function renderDeleteDowntime(DeleteDowntimeCommand $command)
{
$endpoint = 'actions/remove-downtime';
$data = array(
'downtime' => $command->getDowntimeName()
);
$data = [
'author' => $command->getAuthor(),
'downtime' => $command->getDowntimeName()
];
return IcingaApiCommand::create($endpoint, $data);
}