servicegroup: Add missing details to pdf exports

This commit is contained in:
Johannes Meyer 2022-03-03 09:17:12 +01:00
parent 44754948b3
commit e293a8cbb0

View file

@ -11,6 +11,7 @@ use Icinga\Module\Icingadb\Redis\VolatileStateResults;
use Icinga\Module\Icingadb\Web\Controller;
use Icinga\Module\Icingadb\Widget\ItemList\ServiceList;
use Icinga\Module\Icingadb\Widget\ItemList\ServicegroupList;
use ipl\Html\Html;
use ipl\Stdlib\Filter;
class ServicegroupController extends Controller
@ -40,6 +41,7 @@ class ServicegroupController extends Controller
}
$this->servicegroup = $servicegroup;
$this->view->title = $servicegroup->display_name;
}
public function indexAction()
@ -67,10 +69,20 @@ class ServicegroupController extends Controller
yield $this->export($services);
$this->addControl((new ServicegroupList([$this->servicegroup]))
->setViewMode('minimal')
->setDetailActionsDisabled()
->setNoSubjectLink());
// ICINGAWEB_EXPORT_FORMAT is not set yet and $this->format is inaccessible, yeah...
if ($this->getRequest()->getParam('format') === 'pdf') {
$this->addContent((new ServicegroupList([$this->servicegroup]))
->setViewMode('minimal')
->setDetailActionsDisabled()
->setNoSubjectLink());
$this->addContent(Html::tag('h2', null, t('Services')));
} else {
$this->addControl((new ServicegroupList([$this->servicegroup]))
->setViewMode('minimal')
->setDetailActionsDisabled()
->setNoSubjectLink());
}
$this->addControl($paginationControl);
$this->addControl($viewModeSwitcher);
$this->addControl($limitControl);