From 3a82313815a311c0bb9cfdf69a8e447887b68888 Mon Sep 17 00:00:00 2001 From: Muhammad Shahrukh <> Date: Fri, 2 Aug 2024 14:53:37 +0500 Subject: [PATCH] COMCL-649: Fix custom group page --- .../Hook/BuildForm/AddStyleFieldToCaseCustomGroups.php | 8 +++++--- js/custom-group-form.js | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CRM/Civicase/Hook/BuildForm/AddStyleFieldToCaseCustomGroups.php b/CRM/Civicase/Hook/BuildForm/AddStyleFieldToCaseCustomGroups.php index dc44a29a3..7670bc5e7 100644 --- a/CRM/Civicase/Hook/BuildForm/AddStyleFieldToCaseCustomGroups.php +++ b/CRM/Civicase/Hook/BuildForm/AddStyleFieldToCaseCustomGroups.php @@ -28,15 +28,17 @@ public function run($form, $formName) { return; } - $contactTypes = json_decode($form->get_template_vars('contactTypes')); + $multipleTypes = $form->get_template_vars('allowMultiple'); $caseEntityNames = CaseType::buildOptions('case_type_category', 'validate'); // This is the generic entity for all cases. $caseEntityNames[] = 'Case'; - $contactTypes = array_merge($contactTypes, $caseEntityNames); + foreach ($caseEntityNames as $caseEntityName) { + $multipleTypes[$caseEntityName] = TRUE; + } - $form->assign('contactTypes', json_encode($contactTypes)); + $form->assign('allowMultiple', $multipleTypes); CRM_Core_Resources::singleton()->addSetting([ 'caseEntityNames' => $caseEntityNames, ]); diff --git a/js/custom-group-form.js b/js/custom-group-form.js index d659ae5e7..7cb2726f6 100644 --- a/js/custom-group-form.js +++ b/js/custom-group-form.js @@ -1,8 +1,8 @@ (function ($, _, caseEntityNames) { $(document).on('crmLoad', function () { - var $multipleRecordsCheckboxRow = $('#is_multiple_row'); + var $multipleRecordsCheckboxRow = $('tr.field-is_multiple'); var $styleSelectTabWithTableOption = $('select[name="style"] option[value="Tab with table"]'); - var $extendSelect = $('#extends_0'); + var $extendSelect = $('#extends'); (function init () { hideShowElementsNotRelevantWhenExtendingCases();