Skip to content

Commit

Permalink
Merge pull request #21838 from christianwach/lab-core-2917
Browse files Browse the repository at this point in the history
Restrict "Oops" to administrative errors
  • Loading branch information
colemanw authored Oct 18, 2021
2 parents 8c54895 + 217fc25 commit 2670f1f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CRM/Campaign/Form/Gotv.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function validateIds() {

$surveys = CRM_Campaign_BAO_Survey::getSurveys();
if (empty($surveys)) {
$errorMessages[] = ts("Oops. It looks like no surveys have been created. <a href='%1'>Click here to create a new survey.</a>", [1 => CRM_Utils_System::url('civicrm/survey/add', 'reset=1&action=add')]);
$errorMessages[] = ts("It looks like no surveys have been created yet. <a %1>Click here to create a new survey.</a>", [1 => 'href="' . CRM_Utils_System::url('civicrm/survey/add', 'reset=1&action=add') . '"']);
}

if ($this->_force && !$this->_surveyId) {
Expand Down
4 changes: 2 additions & 2 deletions CRM/Event/Form/Registration/ParticipantConfirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function buildQuickForm() {
$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') {
Expand Down Expand Up @@ -143,7 +143,7 @@ public function buildQuickForm() {
}
}
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']]
);
}
Expand Down
8 changes: 4 additions & 4 deletions CRM/Event/Form/Registration/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -840,15 +840,15 @@ public static function formRule($fields, $files, $form) {
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.
if (!empty($fields['bypass_payment']) && $form->_allowConfirmation) {
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.");
}
}

Expand Down Expand Up @@ -1227,7 +1227,7 @@ public static function checkRegistration($fields, $form, $isAdditional = FALSE)
$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 <a href="%1">register another participant</a>.', [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"
);
Expand All @@ -1244,7 +1244,7 @@ public static function checkRegistration($fields, $form, $isAdditional = FALSE)

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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Campaign/Page/Petition/Confirm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{if $success}
{ts 1=$display_name 2=$email}<strong>%1 - your email address '%2' has been successfully verified.</strong>{/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}
</div>

Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Case/Page/Tab.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{elseif $redirectToCaseAdmin}
<div class="messages status no-popup">
{icon icon="fa-info-circle"}{/icon}
<strong>{ts}Oops, It looks like there are no active case types.{/ts}</strong>
<strong>{ts}It looks like there are no active case types yet.{/ts}</strong>
{if call_user_func(array('CRM_Core_Permission','check'), ' administer CiviCase')}
{capture assign=adminCaseTypeURL}{crmURL p='civicrm/a/#/caseType'}
{/capture}
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Mailing/Page/Confirm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
{if $success}
{ts 1=$display_name 2=$email 3=$group}<strong>%1 (%2)</strong> has been successfully subscribed to the <strong>%3</strong> 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}
</div>

0 comments on commit 2670f1f

Please sign in to comment.