@@ -30,10 +30,15 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig {
3030 */
3131 protected function setEntityFields () {
3232 $ this ->entityFields = [
33- 'name ' => [
33+ 'title ' => [
3434 'required ' => 'TRUE ' ,
35- 'name ' => 'name ' ,
36- 'description ' => ts ("e.g. 'Student', 'Senior', 'Honor Society'... " ),
35+ 'name ' => 'title ' ,
36+ 'description ' => ts ("Internal name, e.g. 'Student', 'Senior', 'Honor Society'... " ),
37+ ],
38+ 'frontend_title ' => [
39+ 'required ' => 'TRUE ' ,
40+ 'name ' => 'frontend_title ' ,
41+ 'description ' => ts ('Name as shown on public pages. ' ),
3742 ],
3843 'description ' => [
3944 'name ' => 'description ' ,
@@ -225,11 +230,8 @@ public function buildQuickForm() {
225230 // Fields in this array have been tested & in the tpl have been switched over to metadata.
226231 // Note this kinda 'works from the top' - ie. once we hit a field that needs some thought we need
227232 // to stop & make that one work.
228- $ this ->assign ('tpl_standardised_fields ' , ['name ' , 'description ' , 'member_of_contact_id ' , 'minimum_fee ' ]);
233+ $ this ->assign ('tpl_standardised_fields ' , ['title ' , ' frontend_title ' , 'description ' , 'member_of_contact_id ' , 'minimum_fee ' ]);
229234
230- $ this ->addRule ('name ' , ts ('A membership type with this name already exists. Please select another name. ' ),
231- 'objectExists ' , ['CRM_Member_DAO_MembershipType ' , $ this ->_id ]
232- );
233235 $ this ->addRule ('minimum_fee ' , ts ('Please enter a monetary value for the Minimum Fee. ' ), 'money ' );
234236
235237 $ props = ['api ' => ['params ' => ['contact_type ' => 'Organization ' ]]];
@@ -292,10 +294,6 @@ public function buildQuickForm() {
292294 public static function formRule ($ params ) {
293295 $ errors = [];
294296
295- if (!$ params ['name ' ]) {
296- $ errors ['name ' ] = ts ('Please enter a membership type name. ' );
297- }
298-
299297 if (($ params ['minimum_fee ' ] > 0 ) && !$ params ['financial_type_id ' ]) {
300298 $ errors ['financial_type_id ' ] = ts ('Please enter the financial Type. ' );
301299 }
0 commit comments