From 0a50f920728fb3796d60c71b9054833bf331fb85 Mon Sep 17 00:00:00 2001 From: Omar Hussein Date: Tue, 26 Sep 2023 17:33:21 +0100 Subject: [PATCH] CIWEMB-475: Update manage instalment screen notification messages --- .../AddNoInstalmentsDonationLineItem.php | 4 ++-- .../AddNoInstalmentsMembershipLineItem.php | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CRM/MembershipExtras/Form/RecurringContribution/AddNoInstalmentsDonationLineItem.php b/CRM/MembershipExtras/Form/RecurringContribution/AddNoInstalmentsDonationLineItem.php index 04bb3449..f58fe3f1 100644 --- a/CRM/MembershipExtras/Form/RecurringContribution/AddNoInstalmentsDonationLineItem.php +++ b/CRM/MembershipExtras/Form/RecurringContribution/AddNoInstalmentsDonationLineItem.php @@ -174,7 +174,7 @@ private function sendConfirmationEmail($contributionId) { private function showOnSuccessNotifications() { CRM_Core_Session::setStatus( - ts('The line item has been added.'), + ts('The line item has been added to payment plan and a payment has been created successfully'), ts('Adding line item'), 'success' ); @@ -182,7 +182,7 @@ private function showOnSuccessNotifications() { private function showErrorNotification(Exception $e) { CRM_Core_Session::setStatus( - ts('An error occurred while trying to add the line item') . ':' . $e->getMessage(), + ts('The line item could not be added to the payment plan. Error reason:') . $e->getMessage(), ts('Error Adding Line item'), 'error' ); diff --git a/CRM/MembershipExtras/Form/RecurringContribution/AddNoInstalmentsMembershipLineItem.php b/CRM/MembershipExtras/Form/RecurringContribution/AddNoInstalmentsMembershipLineItem.php index 6bbdaed5..ac46f7ec 100644 --- a/CRM/MembershipExtras/Form/RecurringContribution/AddNoInstalmentsMembershipLineItem.php +++ b/CRM/MembershipExtras/Form/RecurringContribution/AddNoInstalmentsMembershipLineItem.php @@ -279,8 +279,13 @@ private function sendConfirmationEmail($contributionId) { } private function showOnSuccessNotifications() { + $message = 'The membership has been added to payment plan and a payment has been created successfully'; + if ($this->submittedValues['payment_type'] == self::PAYMENT_TYPE_NO_PAYMENT) { + $message = 'The membership has been added to payment plan but no payment has been created.'; + } + CRM_Core_Session::setStatus( - $this->membershipType->name . ' ' . ts('has been added.'), + $message, ts('Add') . ' ' . $this->membershipType->name, 'success' ); @@ -288,7 +293,7 @@ private function showOnSuccessNotifications() { private function showErrorNotification(Exception $e) { CRM_Core_Session::setStatus( - ts('An error occurred while trying to add') . ' ' . $this->membershipType->name . ':' . $e->getMessage(), + ts('The membership could not be added to the payment plan. Error reason:') . $e->getMessage(), ts('Error Adding') . $this->membershipType->name, 'error' );