From 217fc253131aec61afd930da6b17d40258dffe0e Mon Sep 17 00:00:00 2001 From: Christian Wach Date: Sat, 16 Oct 2021 11:46:51 +0100 Subject: [PATCH] Restrict "Oops" to administrative errors --- CRM/Campaign/Form/Gotv.php | 2 +- CRM/Event/Form/Registration/ParticipantConfirm.php | 4 ++-- CRM/Event/Form/Registration/Register.php | 8 ++++---- templates/CRM/Campaign/Page/Petition/Confirm.tpl | 2 +- templates/CRM/Case/Page/Tab.tpl | 2 +- templates/CRM/Mailing/Page/Confirm.tpl | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CRM/Campaign/Form/Gotv.php b/CRM/Campaign/Form/Gotv.php index 870f0ea381..d2cec45309 100644 --- a/CRM/Campaign/Form/Gotv.php +++ b/CRM/Campaign/Form/Gotv.php @@ -137,7 +137,7 @@ class CRM_Campaign_Form_Gotv extends CRM_Core_Form { $surveys = CRM_Campaign_BAO_Survey::getSurveys(); if (empty($surveys)) { - $errorMessages[] = ts("Oops. It looks like no surveys have been created. Click here to create a new survey.", [1 => CRM_Utils_System::url('civicrm/survey/add', 'reset=1&action=add')]); + $errorMessages[] = ts("It looks like no surveys have been created yet. Click here to create a new survey.", [1 => 'href="' . CRM_Utils_System::url('civicrm/survey/add', 'reset=1&action=add') . '"']); } if ($this->_force && !$this->_surveyId) { diff --git a/CRM/Event/Form/Registration/ParticipantConfirm.php b/CRM/Event/Form/Registration/ParticipantConfirm.php index bf8a79203d..5fed52f49c 100644 --- a/CRM/Event/Form/Registration/ParticipantConfirm.php +++ b/CRM/Event/Form/Registration/ParticipantConfirm.php @@ -101,7 +101,7 @@ class CRM_Event_Form_Registration_ParticipantConfirm extends CRM_Event_Form_Regi $additonalIds = CRM_Event_BAO_Participant::getAdditionalParticipantIds($this->_participantId); $requireSpace = 1 + count($additonalIds); if ($emptySeats !== NULL && ($requireSpace > $emptySeats)) { - $statusMsg = ts("Oops, it looks like there are currently no available spaces for the %1 event.", [1 => $values['title']]); + $statusMsg = ts("Unfortunately there are currently no available spaces for the %1 event.", [1 => $values['title']]); } else { if ($this->_cc == 'fail') { @@ -143,7 +143,7 @@ class CRM_Event_Form_Registration_ParticipantConfirm extends CRM_Event_Form_Regi } } if (!$statusMsg) { - $statusMsg = ts("Oops, it looks like your registration for %1 has already been cancelled.", + $statusMsg = ts("Your registration for %1 has already been cancelled. No further action is needed.", [1 => $values['title']] ); } diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index 163badbf5e..0e8ec10c66 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -840,7 +840,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { is_array($form->_additionalParticipantIds) && $numberAdditionalParticipants > count($form->_additionalParticipantIds) ) { - $errors['additional_participants'] = ts("Oops. It looks like you are trying to increase the number of additional people you are registering for. You can confirm registration for a maximum of %1 additional people.", [1 => count($form->_additionalParticipantIds)]); + $errors['additional_participants'] = ts("It looks like you are trying to increase the number of additional people you are registering for. You can confirm registration for a maximum of %1 additional people.", [1 => count($form->_additionalParticipantIds)]); } //don't allow to register w/ waiting if enough spaces available. @@ -848,7 +848,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { if (!is_numeric($form->_availableRegistrations) || (empty($fields['priceSetId']) && CRM_Utils_Array::value('additional_participants', $fields) < $form->_availableRegistrations) ) { - $errors['bypass_payment'] = ts("Oops. There are enough available spaces in this event. You can not add yourself to the waiting list."); + $errors['bypass_payment'] = ts("You have not been added to the waiting list because there are spaces available for this event. We recommend registering yourself for an available space instead."); } } @@ -1227,7 +1227,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { $status = ts("It looks like you are already registered for this event. If you want to change your registration, or you feel that you've received this message in error, please contact the site administrator."); } $status .= ' ' . ts('You can also register another participant.', [1 => $registerUrl]); - CRM_Core_Session::singleton()->setStatus($status, ts('Oops.'), 'alert'); + CRM_Core_Session::singleton()->setStatus($status, '', 'alert'); $url = CRM_Utils_System::url('civicrm/event/info', "reset=1&id={$form->_values['event']['id']}&noFullMsg=true" ); @@ -1244,7 +1244,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { if ($isAdditional) { $status = ts("It looks like this participant is already registered for this event. If you want to change your registration, or you feel that you've received this message in error, please contact the site administrator."); - CRM_Core_Session::singleton()->setStatus($status, ts('Oops.'), 'alert'); + CRM_Core_Session::singleton()->setStatus($status, '', 'alert'); return $participant->id; } } diff --git a/templates/CRM/Campaign/Page/Petition/Confirm.tpl b/templates/CRM/Campaign/Page/Petition/Confirm.tpl index 193b0aa4ff..b9c4b848d3 100644 --- a/templates/CRM/Campaign/Page/Petition/Confirm.tpl +++ b/templates/CRM/Campaign/Page/Petition/Confirm.tpl @@ -12,7 +12,7 @@ {if $success} {ts 1=$display_name 2=$email}%1 - your email address '%2' has been successfully verified.{/ts} {else} - {ts}Oops. We encountered a problem in processing your email verification. Please contact the site administrator.{/ts} + {ts}Unfortunately we encountered a problem in processing your email verification. Please contact the site administrator.{/ts} {/if} diff --git a/templates/CRM/Case/Page/Tab.tpl b/templates/CRM/Case/Page/Tab.tpl index 66ec5e72b0..ac1a4e2b44 100644 --- a/templates/CRM/Case/Page/Tab.tpl +++ b/templates/CRM/Case/Page/Tab.tpl @@ -13,7 +13,7 @@ {elseif $redirectToCaseAdmin}
{icon icon="fa-info-circle"}{/icon} - {ts}Oops, It looks like there are no active case types.{/ts} + {ts}It looks like there are no active case types yet.{/ts} {if call_user_func(array('CRM_Core_Permission','check'), ' administer CiviCase')} {capture assign=adminCaseTypeURL}{crmURL p='civicrm/a/#/caseType'} {/capture} diff --git a/templates/CRM/Mailing/Page/Confirm.tpl b/templates/CRM/Mailing/Page/Confirm.tpl index d466cf7d42..06746d5052 100644 --- a/templates/CRM/Mailing/Page/Confirm.tpl +++ b/templates/CRM/Mailing/Page/Confirm.tpl @@ -12,6 +12,6 @@ {if $success} {ts 1=$display_name 2=$email 3=$group}%1 (%2) has been successfully subscribed to the %3 mailing list.{/ts} {else} - {ts}Oops. We encountered a problem in processing your subscription confirmation. Please contact the site administrator.{/ts} + {ts}Unfortunately we encountered a problem in processing your subscription confirmation. Please contact the site administrator.{/ts} {/if}
-- 2.25.1