Skip to content

Commit 51ff1f9

Browse files
authored
Improve the ScheduleForm (#294)
resolves #275
2 parents c649892 + 9bf0558 commit 51ff1f9

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

application/forms/ScheduleForm.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
use Icinga\Module\Notifications\Model\RuleEscalationRecipient;
1111
use Icinga\Module\Notifications\Model\Schedule;
1212
use Icinga\Web\Session;
13+
use ipl\Html\Attributes;
1314
use ipl\Html\HtmlDocument;
15+
use ipl\Html\HtmlElement;
16+
use ipl\Html\Text;
1417
use ipl\Sql\Connection;
1518
use ipl\Stdlib\Filter;
1619
use ipl\Web\Common\CsrfCounterMeasure;
@@ -154,9 +157,22 @@ public function removeSchedule(int $id): void
154157

155158
protected function assemble()
156159
{
160+
if (! $this->showRemoveButton) {
161+
$this->addHtml(new HtmlElement(
162+
'p',
163+
new Attributes(['class' => 'description']),
164+
new Text($this->translate(
165+
'Organize contacts and contact groups in time-based schedules and let them rotate'
166+
. ' automatically. You can define multiple rotations with different patterns to set'
167+
. ' priorities. Schedules can also be used as recipients for event rules.'
168+
))
169+
));
170+
}
171+
157172
$this->addElement('text', 'name', [
158-
'required' => true,
159-
'label' => $this->translate('Name')
173+
'required' => true,
174+
'label' => $this->translate('Schedule Name'),
175+
'placeholder' => $this->translate('e.g. working hours, on call, etc ...')
160176
]);
161177

162178
$this->addElement('submit', 'submit', [

0 commit comments

Comments
 (0)