From c413aded66c5d9fb47031268de32f8001ce32d98 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Tue, 16 Sep 2025 12:34:48 +0200 Subject: [PATCH] Change `remove` occurrences to `delete` to maintain consistency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - When an entry is being permanently deleted. Example: A contact, the success message, and the button label should use the keyword ‘Delete’. What is changed: - Form button name and labels - From success message - Some variable names --- application/controllers/ContactGroupController.php | 2 +- application/forms/ContactGroupForm.php | 12 ++++++------ application/forms/ScheduleForm.php | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/application/controllers/ContactGroupController.php b/application/controllers/ContactGroupController.php index 7d8198ef3..4d4f06275 100644 --- a/application/controllers/ContactGroupController.php +++ b/application/controllers/ContactGroupController.php @@ -85,7 +85,7 @@ public function editAction(): void 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(); diff --git a/application/forms/ContactGroupForm.php b/application/forms/ContactGroupForm.php index e94985da1..2f85de3fa 100644 --- a/application/forms/ContactGroupForm.php +++ b/application/forms/ContactGroupForm.php @@ -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)); } } @@ -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'; } /** diff --git a/application/forms/ScheduleForm.php b/application/forms/ScheduleForm.php index 68e08d9a8..6f499c06c 100644 --- a/application/forms/ScheduleForm.php +++ b/application/forms/ScheduleForm.php @@ -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 @@ -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 ]);