From cf1182e65c6eca96fe984ac932410ae7f6d1df49 Mon Sep 17 00:00:00 2001 From: Nileema Date: Tue, 29 Apr 2014 20:17:18 +0530 Subject: [PATCH] HR-345 Fix the broken edit link on profileSelector for support of case sub type --- CRM/UF/Page/ProfileEditor.php | 7 +++++++ js/model/crm.uf.js | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/CRM/UF/Page/ProfileEditor.php b/CRM/UF/Page/ProfileEditor.php index 57160bf18e..582315d17a 100644 --- a/CRM/UF/Page/ProfileEditor.php +++ b/CRM/UF/Page/ProfileEditor.php @@ -154,6 +154,13 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page { $availableFields ); break; + case 'CaseModel': + $civiSchema[$entityType] = self::convertCiviModelToBackboneModel( + 'Case', + ts('Case'), + $availableFields + ); + break; default: throw new CRM_Core_Exception("Unrecognized entity type: $entityType"); } diff --git a/js/model/crm.uf.js b/js/model/crm.uf.js index ca9fdd255d..d94bc677c7 100644 --- a/js/model/crm.uf.js +++ b/js/model/crm.uf.js @@ -87,6 +87,8 @@ return 'membership_1'; case 'Participant': return 'participant_1'; + case 'Case': + return 'case_1'; default: throw "Cannot guess entity name for field_type=" + field_type; } @@ -687,7 +689,11 @@ // set proper entity model based on selected profile var contactTypes = ['Individual', 'Household', 'Organization']; var profileType = ufGroupModel.get('group_type') || ''; + if (profileType[0]) { + profileType = profileType[0]; + } profileType = profileType.split(','); + var ufEntityModel; _.each(profileType, function (ptype) { if ($.inArray(ptype, contactTypes) > -1) { -- 2.25.1