From b27f479b24e35c57f046b45aabfa66ca85d9e35d Mon Sep 17 00:00:00 2001 From: Mattias Michaux Date: Mon, 9 Nov 2015 20:37:56 +0100 Subject: [PATCH] Reworked patch to be smaller and error proof. --- .../Page/MultipleRecordFieldsListing.php | 50 +++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/CRM/Profile/Page/MultipleRecordFieldsListing.php b/CRM/Profile/Page/MultipleRecordFieldsListing.php index 808a5f9bde..09644e0801 100644 --- a/CRM/Profile/Page/MultipleRecordFieldsListing.php +++ b/CRM/Profile/Page/MultipleRecordFieldsListing.php @@ -337,33 +337,31 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { // TODO: Not all widget types and validation rules are supported by crmEditable so some fields will not be in-place editable $fieldAttributes = array('class' => "crmf-custom_{$fieldId}_$recId"); $editable = FALSE; - if ($linkAction & CRM_Core_Action::UPDATE) { + if (!$options[$fieldId]['attributes']['is_view'] && $linkAction & CRM_Core_Action::UPDATE) { $spec = $options[$fieldId]['attributes']; - if ($spec['is_view'] == '0') { - switch ($spec['html_type']) { - case 'Text': - // Other data types like money would require some extra validation - // FIXME: crmEditable currently does not support any validation rules :( - $supportedDataTypes = array('Float', 'String', 'Int'); - $editable = in_array($spec['data_type'], $supportedDataTypes); - break; - - case 'TextArea': - $editable = TRUE; - $fieldAttributes['data-type'] = 'textarea'; - break; - - case 'Radio': - case 'Select': - case 'Select Country': - case 'Select State/Province': - $editable = TRUE; - $fieldAttributes['data-type'] = $spec['data_type'] == 'Boolean' ? 'boolean' : 'select'; - if (!$spec['is_required']) { - $fieldAttributes['data-empty-option'] = ts('- none -'); - } - break; - } + switch ($spec['html_type']) { + case 'Text': + // Other data types like money would require some extra validation + // FIXME: crmEditable currently does not support any validation rules :( + $supportedDataTypes = array('Float', 'String', 'Int'); + $editable = in_array($spec['data_type'], $supportedDataTypes); + break; + + case 'TextArea': + $editable = TRUE; + $fieldAttributes['data-type'] = 'textarea'; + break; + + case 'Radio': + case 'Select': + case 'Select Country': + case 'Select State/Province': + $editable = TRUE; + $fieldAttributes['data-type'] = $spec['data_type'] == 'Boolean' ? 'boolean' : 'select'; + if (!$spec['is_required']) { + $fieldAttributes['data-empty-option'] = ts('- none -'); + } + break; } } if ($editable) { -- 2.25.1