From d6d6bc9669b1f633bf0f57ca076cd1056a464864 Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Fri, 15 Mar 2013 14:44:28 -0700 Subject: [PATCH] CRM-12113 Extend status message when attempting to deleting membership type to explain that contacts in trash may have membership type assigned. This has come up as a question several times on the forums. --- CRM/Member/BAO/MembershipType.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CRM/Member/BAO/MembershipType.php b/CRM/Member/BAO/MembershipType.php index 76efdf999b..3f1f48c9ae 100644 --- a/CRM/Member/BAO/MembershipType.php +++ b/CRM/Member/BAO/MembershipType.php @@ -155,14 +155,15 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { $cnt = 1; $message = ts('This membership type cannot be deleted due to following reason(s):'); if (in_array('Membership', $status)) { - $deleteURL = CRM_Utils_System::url('civicrm/member/search', 'reset=1'); - $message .= '
' . ts('%2. There are some contacts who have this membership type assigned to them. Search for contacts with this membership type on the CiviMember >> Find Members page. If you delete all memberships of this type, you will then be able to delete the membership type on this page. To delete the membership type, all memberships of this type should be deleted.', array(1 => $deleteURL, 2 => $cnt)); + $findMembersURL = CRM_Utils_System::url('civicrm/member/search', 'reset=1'); + $deleteURL = CRM_Utils_System::url('civicrm/contact/search/advanced', 'reset=1'); + $message .= '
' . ts('%3. There are some contacts who have this membership type assigned to them. Search for contacts with this membership type from Find Members. If you are still getting this message after deleting these memberships, there may be contacts in the Trash (deleted) with this membership type. Try using Advanced Search and checking "Search in Trash".', array(1 => $findMembersURL, 2 => $deleteURL, 3 => $cnt)); $cnt++; } if (in_array('MembershipBlock', $status)) { $deleteURL = CRM_Utils_System::url('civicrm/admin/contribute', 'reset=1'); - $message .= '
' . ts('%2. This Membership Type is being link to Online Contribution page. Please change/delete it in order to delete this Membership Type.', array(1 => $deleteURL, 2 => $cnt)); + $message .= '
' . ts('%2. This Membership Type is used in an Online Contribution page. Uncheck this membership type in the Memberships tab.', array(1 => $deleteURL, 2 => $cnt)); } if (!$skipRedirect) { $session = CRM_Core_Session::singleton(); -- 2.25.1