|
8 | 8 | use Icinga\Module\Notifications\Common\Links; |
9 | 9 | use Icinga\Module\Notifications\Forms\ContactGroupForm; |
10 | 10 | use Icinga\Module\Notifications\Model\Contactgroup; |
| 11 | +use Icinga\Module\Notifications\Web\Control\SearchBar\ObjectSuggestions; |
11 | 12 | use Icinga\Module\Notifications\Widget\ItemList\ContactGroupList; |
12 | 13 | use Icinga\Module\Notifications\Widget\MemberSuggestions; |
13 | 14 | use Icinga\Web\Notification; |
|
18 | 19 | use ipl\Web\Common\BaseItemList; |
19 | 20 | use ipl\Web\Compat\CompatController; |
20 | 21 | use ipl\Web\Compat\SearchControls; |
| 22 | +use ipl\Web\Control\LimitControl; |
| 23 | +use ipl\Web\Control\SortControl; |
21 | 24 | use ipl\Web\Filter\QueryString; |
22 | 25 | use ipl\Web\Widget\ButtonLink; |
23 | 26 | use ipl\Web\Widget\Tabs; |
@@ -122,6 +125,28 @@ public function addAction(): void |
122 | 125 | $this->setTitle(t('Add Contact Group')); |
123 | 126 | } |
124 | 127 |
|
| 128 | + public function completeAction(): void |
| 129 | + { |
| 130 | + $suggestions = new ObjectSuggestions(); |
| 131 | + $suggestions->setModel(Contactgroup::class); |
| 132 | + $suggestions->forRequest($this->getServerRequest()); |
| 133 | + $this->getDocument()->add($suggestions); |
| 134 | + } |
| 135 | + |
| 136 | + public function searchEditorAction(): void |
| 137 | + { |
| 138 | + $editor = $this->createSearchEditor( |
| 139 | + Contactgroup::on(Database::get()), |
| 140 | + [ |
| 141 | + LimitControl::DEFAULT_LIMIT_PARAM, |
| 142 | + SortControl::DEFAULT_SORT_PARAM, |
| 143 | + ] |
| 144 | + ); |
| 145 | + |
| 146 | + $this->getDocument()->add($editor); |
| 147 | + $this->setTitle($this->translate('Adjust Filter')); |
| 148 | + } |
| 149 | + |
125 | 150 | public function suggestMemberAction(): void |
126 | 151 | { |
127 | 152 | $members = new MemberSuggestions(); |
|
0 commit comments