diff --git a/library/Notifications/Widget/ItemList/ContactGroupList.php b/library/Notifications/Widget/ItemList/ContactGroupList.php index 99fc351ee..ec44ba671 100644 --- a/library/Notifications/Widget/ItemList/ContactGroupList.php +++ b/library/Notifications/Widget/ItemList/ContactGroupList.php @@ -5,6 +5,7 @@ namespace Icinga\Module\Notifications\Widget\ItemList; use ipl\Web\Common\BaseItemList; +use ipl\Web\Url; class ContactGroupList extends BaseItemList { @@ -14,4 +15,10 @@ protected function getItemClass(): string { return ContactGroupListItem::class; } + + protected function init(): void + { + $this->getAttributes() + ->set('data-icinga-detail-url', (string) Url::fromPath('notifications/contact-group')); + } } diff --git a/library/Notifications/Widget/ItemList/ContactGroupListItem.php b/library/Notifications/Widget/ItemList/ContactGroupListItem.php index e792e0666..b408549ae 100644 --- a/library/Notifications/Widget/ItemList/ContactGroupListItem.php +++ b/library/Notifications/Widget/ItemList/ContactGroupListItem.php @@ -10,7 +10,9 @@ use ipl\Html\BaseHtmlElement; use ipl\Html\HtmlElement; use ipl\Html\Text; +use ipl\Stdlib\Filter; use ipl\Web\Common\BaseListItem; +use ipl\Web\Filter\QueryString; use ipl\Web\Widget\Link; class ContactGroupListItem extends BaseListItem @@ -23,7 +25,9 @@ class ContactGroupListItem extends BaseListItem protected function init(): void { - $this->getAttributes()->set('data-action-item', true); + $this->getAttributes() + ->set('data-action-item', true) + ->set('data-icinga-detail-filter', QueryString::render(Filter::equal('id', $this->item->id))); } protected function assembleVisual(BaseHtmlElement $visual): void diff --git a/library/Notifications/Widget/ItemList/ContactList.php b/library/Notifications/Widget/ItemList/ContactList.php index 7735a1154..39264b362 100644 --- a/library/Notifications/Widget/ItemList/ContactList.php +++ b/library/Notifications/Widget/ItemList/ContactList.php @@ -5,6 +5,7 @@ namespace Icinga\Module\Notifications\Widget\ItemList; use ipl\Web\Common\BaseItemList; +use ipl\Web\Url; class ContactList extends BaseItemList { @@ -14,4 +15,10 @@ protected function getItemClass(): string { return ContactListItem::class; } + + protected function init(): void + { + $this->getAttributes() + ->set('data-icinga-detail-url', (string) Url::fromPath('notifications/contact')); + } } diff --git a/library/Notifications/Widget/ItemList/ContactListItem.php b/library/Notifications/Widget/ItemList/ContactListItem.php index e80d6026d..fab2ff9f1 100644 --- a/library/Notifications/Widget/ItemList/ContactListItem.php +++ b/library/Notifications/Widget/ItemList/ContactListItem.php @@ -9,7 +9,9 @@ use ipl\Html\BaseHtmlElement; use ipl\Html\HtmlElement; use ipl\Html\Text; +use ipl\Stdlib\Filter; use ipl\Web\Common\BaseListItem; +use ipl\Web\Filter\QueryString; use ipl\Web\Url; use ipl\Web\Widget\Icon; use ipl\Web\Widget\Link; @@ -28,7 +30,8 @@ class ContactListItem extends BaseListItem protected function init(): void { $this->getAttributes() - ->set('data-action-item', true); + ->set('data-action-item', true) + ->set('data-icinga-detail-filter', QueryString::render(Filter::equal('id', $this->item->id))); } protected function assembleVisual(BaseHtmlElement $visual): void diff --git a/library/Notifications/Widget/ItemList/EventList.php b/library/Notifications/Widget/ItemList/EventList.php index 96d3b9a6c..a53b0eb6e 100644 --- a/library/Notifications/Widget/ItemList/EventList.php +++ b/library/Notifications/Widget/ItemList/EventList.php @@ -4,12 +4,14 @@ namespace Icinga\Module\Notifications\Widget\ItemList; +use Icinga\Module\Notifications\Common\Links; use Icinga\Module\Notifications\Common\LoadMore; use Icinga\Module\Notifications\Common\NoSubjectLink; use Icinga\Module\Notifications\Hook\ObjectsRendererHook; use Icinga\Module\Notifications\Model\Event; use ipl\Orm\ResultSet; use ipl\Web\Common\BaseItemList; +use ipl\Web\Url; class EventList extends BaseItemList { @@ -37,6 +39,9 @@ protected function init(): void $this->on(self::ON_ASSEMBLED, function () { ObjectsRendererHook::load(); }); + + $this->getAttributes() + ->set('data-icinga-detail-url', (string) Url::fromPath('notifications/event')); } protected function getItemClass(): string diff --git a/library/Notifications/Widget/ItemList/EventListItem.php b/library/Notifications/Widget/ItemList/EventListItem.php index 2da23be77..d5faa3a66 100644 --- a/library/Notifications/Widget/ItemList/EventListItem.php +++ b/library/Notifications/Widget/ItemList/EventListItem.php @@ -15,8 +15,10 @@ use ipl\Html\BaseHtmlElement; use ipl\Html\Html; use ipl\Html\HtmlElement; +use ipl\Stdlib\Filter; use ipl\Stdlib\Str; use ipl\Web\Common\BaseListItem; +use ipl\Web\Filter\QueryString; use ipl\Web\Widget\Icon; use ipl\Web\Widget\Link; use ipl\Web\Widget\TimeAgo; @@ -47,6 +49,9 @@ protected function init(): void $this->getAttributes() ->set('data-action-item', true); } + + $this->getAttributes() + ->set('data-icinga-detail-filter', QueryString::render(Filter::equal('id', $this->item->id))); } protected function assembleVisual(BaseHtmlElement $visual): void diff --git a/library/Notifications/Widget/ItemList/EventRuleList.php b/library/Notifications/Widget/ItemList/EventRuleList.php index 533448fcf..d20895c89 100644 --- a/library/Notifications/Widget/ItemList/EventRuleList.php +++ b/library/Notifications/Widget/ItemList/EventRuleList.php @@ -6,6 +6,7 @@ use Icinga\Module\Notifications\Common\LoadMore; use ipl\Web\Common\BaseItemList; +use ipl\Web\Url; class EventRuleList extends BaseItemList { @@ -17,4 +18,10 @@ protected function getItemClass(): string { return EventRuleListItem::class; } + + protected function init(): void + { + $this->getAttributes() + ->set('data-icinga-detail-url', (string) Url::fromPath('notifications/event-rule')); + } } diff --git a/library/Notifications/Widget/ItemList/EventRuleListItem.php b/library/Notifications/Widget/ItemList/EventRuleListItem.php index cb4127a04..371af46e5 100644 --- a/library/Notifications/Widget/ItemList/EventRuleListItem.php +++ b/library/Notifications/Widget/ItemList/EventRuleListItem.php @@ -10,7 +10,9 @@ use Icinga\Module\Notifications\Widget\RuleEscalationRecipientBadge; use ipl\Html\BaseHtmlElement; use ipl\Html\Html; +use ipl\Stdlib\Filter; use ipl\Web\Common\BaseListItem; +use ipl\Web\Filter\QueryString; use ipl\Web\Widget\Icon; use ipl\Web\Widget\Link; @@ -28,7 +30,8 @@ class EventRuleListItem extends BaseListItem protected function init(): void { $this->getAttributes() - ->set('data-action-item', true); + ->set('data-action-item', true) + ->set('data-icinga-detail-filter', QueryString::render(Filter::equal('id', $this->item->id))); } protected function assembleVisual(BaseHtmlElement $visual): void diff --git a/library/Notifications/Widget/ItemList/IncidentList.php b/library/Notifications/Widget/ItemList/IncidentList.php index ba66e37a3..c2570c1b1 100644 --- a/library/Notifications/Widget/ItemList/IncidentList.php +++ b/library/Notifications/Widget/ItemList/IncidentList.php @@ -8,6 +8,7 @@ use Icinga\Module\Notifications\Model\Incident; use ipl\Web\Common\BaseItemList; use Icinga\Module\Notifications\Common\NoSubjectLink; +use ipl\Web\Url; class IncidentList extends BaseItemList { @@ -24,6 +25,9 @@ protected function init(): void $this->on(self::ON_ASSEMBLED, function () { ObjectsRendererHook::load(); }); + + $this->getAttributes() + ->set('data-icinga-detail-url', (string) Url::fromPath('notifications/incident')); } protected function getItemClass(): string diff --git a/library/Notifications/Widget/ItemList/IncidentListItem.php b/library/Notifications/Widget/ItemList/IncidentListItem.php index acf1bc9a4..d31d1a620 100644 --- a/library/Notifications/Widget/ItemList/IncidentListItem.php +++ b/library/Notifications/Widget/ItemList/IncidentListItem.php @@ -16,7 +16,9 @@ use ipl\Html\Html; use ipl\Html\HtmlElement; use ipl\I18n\Translation; +use ipl\Stdlib\Filter; use ipl\Web\Common\BaseListItem; +use ipl\Web\Filter\QueryString; use ipl\Web\Widget\Icon; use ipl\Web\Widget\Link; use ipl\Web\Widget\TimeAgo; @@ -41,6 +43,9 @@ protected function init(): void $this->getAttributes() ->set('data-action-item', true); } + + $this->getAttributes() + ->set('data-icinga-detail-filter', QueryString::render(Filter::equal('id', $this->item->id))); } protected function assembleVisual(BaseHtmlElement $visual): void diff --git a/library/Notifications/Widget/ItemList/ScheduleList.php b/library/Notifications/Widget/ItemList/ScheduleList.php index 983143c8a..c236fb8b4 100644 --- a/library/Notifications/Widget/ItemList/ScheduleList.php +++ b/library/Notifications/Widget/ItemList/ScheduleList.php @@ -5,6 +5,7 @@ namespace Icinga\Module\Notifications\Widget\ItemList; use ipl\Web\Common\BaseItemList; +use ipl\Web\Url; class ScheduleList extends BaseItemList { @@ -14,4 +15,10 @@ protected function getItemClass(): string { return ScheduleListItem::class; } + + protected function init(): void + { + $this->getAttributes() + ->set('data-icinga-detail-url', (string) Url::fromPath('notifications/schedule')); + } } diff --git a/library/Notifications/Widget/ItemList/ScheduleListItem.php b/library/Notifications/Widget/ItemList/ScheduleListItem.php index 24e9f9d80..8a0156da2 100644 --- a/library/Notifications/Widget/ItemList/ScheduleListItem.php +++ b/library/Notifications/Widget/ItemList/ScheduleListItem.php @@ -7,7 +7,9 @@ use Icinga\Module\Notifications\Common\Links; use Icinga\Module\Notifications\Model\Schedule; use ipl\Html\BaseHtmlElement; +use ipl\Stdlib\Filter; use ipl\Web\Common\BaseListItem; +use ipl\Web\Filter\QueryString; use ipl\Web\Widget\Link; /** @@ -24,7 +26,8 @@ class ScheduleListItem extends BaseListItem protected function init(): void { $this->getAttributes() - ->set('data-action-item', true); + ->set('data-action-item', true) + ->set('data-icinga-detail-filter', QueryString::render(Filter::equal('id', $this->item->id))); } protected function assembleTitle(BaseHtmlElement $title): void