From: Coleman Watts Date: Thu, 13 Feb 2014 19:43:36 +0000 (-0800) Subject: CRM-13929 Update contactRef renderer X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=549be786a9fd04db38f4c992de041d8a8798a34f;p=civicrm-core.git CRM-13929 Update contactRef renderer --- diff --git a/CRM/Core/Form/Renderer.php b/CRM/Core/Form/Renderer.php index e619497dea..02b6e74cc4 100644 --- a/CRM/Core/Form/Renderer.php +++ b/CRM/Core/Form/Renderer.php @@ -119,7 +119,7 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty { // Display-only (frozen) elements if (!empty($el['frozen'])) { - if ($element->getAttribute('data-api-params') && $element->getAttribute('data-entity-value')) { + if ($element->getAttribute('data-api-entity') && $element->getAttribute('data-entity-value')) { $this->renderFrozenEntityRef($el, $element); } $el['html'] = '
' . $el['html'] . '
'; @@ -203,7 +203,7 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty { * @param $field HTML_QuickForm_element */ function renderFrozenEntityRef(&$el, $field) { - $api = json_decode($field->getAttribute('data-api-params'), TRUE); + $entity = $field->getAttribute('data-api-entity'); $vals = json_decode($field->getAttribute('data-entity-value'), TRUE); if (isset($vals['id'])) { $vals = array($vals); @@ -211,11 +211,11 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty { $display = array(); foreach ($vals as $val) { // Format contact as link - if ($api['entity'] == 'contact' && CRM_Contact_BAO_Contact_Permission::allow($val['id'], CRM_Core_Permission::VIEW)) { + if ($entity == 'contact' && CRM_Contact_BAO_Contact_Permission::allow($val['id'], CRM_Core_Permission::VIEW)) { $url = CRM_Utils_System::url("civicrm/contact/view", array('reset' => 1, 'cid' => $val['id'])); - $val['text'] = '' . $val['text'] . ''; + $val['label'] = '' . $val['label'] . ''; } - $display[] = $val['text']; + $display[] = $val['label']; } $el['html'] = implode('; ', $display) . '';