Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion application/controllers/ContactGroupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

$query = Contactgroup::on(Database::get())
->columns(['id', 'name'])
->filter(Filter::equal('id', $groupId));

Check failure on line 37 in application/controllers/ContactGroupController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Parameter #2 $value of static method ipl\Stdlib\Filter::equal() expects array<mixed>|bool|float|int|string, mixed given.

Check failure on line 37 in application/controllers/ContactGroupController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.4 on ubuntu-latest

Parameter #2 $value of static method ipl\Stdlib\Filter::equal() expects array<mixed>|bool|float|int|string, mixed given.

Check failure on line 37 in application/controllers/ContactGroupController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Parameter #2 $value of static method ipl\Stdlib\Filter::equal() expects array<mixed>|bool|float|int|string, mixed given.

$group = $query->first();
if ($group === null) {
Expand All @@ -43,11 +43,11 @@

$this->controls->addAttributes(['class' => 'contactgroup-detail']);

$this->addControl(new HtmlElement('div', new Attributes(['class' => 'header']), Text::create($group->name)));

Check failure on line 46 in application/controllers/ContactGroupController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Parameter #1 $content of static method ipl\Html\Text::create() expects string, mixed given.

Check failure on line 46 in application/controllers/ContactGroupController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.4 on ubuntu-latest

Parameter #1 $content of static method ipl\Html\Text::create() expects string, mixed given.

Check failure on line 46 in application/controllers/ContactGroupController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Parameter #1 $content of static method ipl\Html\Text::create() expects string, mixed given.

$contacts = Contact::on(Database::get())
->filter(Filter::all(
Filter::equal('contactgroup_member.contactgroup_id', $groupId),

Check failure on line 50 in application/controllers/ContactGroupController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Parameter #2 $value of static method ipl\Stdlib\Filter::equal() expects array<mixed>|bool|float|int|string, mixed given.

Check failure on line 50 in application/controllers/ContactGroupController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.4 on ubuntu-latest

Parameter #2 $value of static method ipl\Stdlib\Filter::equal() expects array<mixed>|bool|float|int|string, mixed given.

Check failure on line 50 in application/controllers/ContactGroupController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Parameter #2 $value of static method ipl\Stdlib\Filter::equal() expects array<mixed>|bool|float|int|string, mixed given.
Filter::equal('contactgroup_member.deleted', 'n')
));

Expand All @@ -57,7 +57,7 @@
$this->addContent(
(new ButtonLink(
Text::create(t('Edit Contact Group')),
Links::contactGroupEdit($groupId)->with(['showCompact' => true, '_disableLayout' => 1]),

Check failure on line 60 in application/controllers/ContactGroupController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Parameter #1 $id of static method Icinga\Module\Notifications\Common\Links::contactGroupEdit() expects int, mixed given.

Check failure on line 60 in application/controllers/ContactGroupController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.4 on ubuntu-latest

Parameter #1 $id of static method Icinga\Module\Notifications\Common\Links::contactGroupEdit() expects int, mixed given.

Check failure on line 60 in application/controllers/ContactGroupController.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Parameter #1 $id of static method Icinga\Module\Notifications\Common\Links::contactGroupEdit() expects int, mixed given.
'edit',
['class' => 'add-new-component']
))->openInModal()
Expand Down Expand Up @@ -85,7 +85,7 @@
if ($form->hasBeenRemoved()) {
$form->removeContactgroup();
Notification::success(sprintf(
t('Successfully removed contact group %s'),
t('Deleted contact group "%s" successfully'),
$form->getValue('group_name')
));
$this->switchToSingleColumnLayout();
Expand Down
12 changes: 6 additions & 6 deletions application/forms/ContactGroupForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ protected function assemble(): void
);

if ($this->contactgroupId) {
$removeBtn = new SubmitElement(
'remove',
$deleteBtn = new SubmitElement(
'delete',
[
'label' => $this->translate('Remove'),
'label' => $this->translate('Delete'),
'class' => 'btn-remove',
'formnovalidate' => true
]
);

$this->registerElement($removeBtn);
$this->getElement('submit')->prependWrapper((new HtmlDocument())->setHtmlContent($removeBtn));
$this->registerElement($deleteBtn);
$this->getElement('submit')->prependWrapper((new HtmlDocument())->setHtmlContent($deleteBtn));
}
}

Expand All @@ -107,7 +107,7 @@ public function hasBeenRemoved(): bool
$btn = $this->getPressedSubmitElement();
$csrf = $this->getElement('CSRFToken');

return $csrf !== null && $csrf->isValid() && $btn !== null && $btn->getName() === 'remove';
return $csrf !== null && $csrf->isValid() && $btn !== null && $btn->getName() === 'delete';
}

/**
Expand Down
6 changes: 3 additions & 3 deletions application/forms/ScheduleForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function hasBeenRemoved(): bool
$btn = $this->getPressedSubmitElement();
$csrf = $this->getElement('CSRFToken');

return $csrf !== null && $csrf->isValid() && $btn !== null && $btn->getName() === 'remove';
return $csrf !== null && $csrf->isValid() && $btn !== null && $btn->getName() === 'delete';
}

public function loadSchedule(int $id): void
Expand Down Expand Up @@ -164,8 +164,8 @@ protected function assemble()
]);

if ($this->showRemoveButton) {
$removeBtn = $this->createElement('submit', 'remove', [
'label' => $this->translate('Remove'),
$removeBtn = $this->createElement('submit', 'delete', [
'label' => $this->translate('Delete'),
'class' => 'btn-remove',
'formnovalidate' => true
]);
Expand Down
Loading