From: vitius1 <36272679+vitius1@users.noreply.github.com>
Date: Thu, 28 Jul 2022 09:21:42 +0000 (+0200)
Subject: CustomDataView.tpl clickable contact reference
X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d621a53d1a3273fccbdb4e2c542b5e2fab42f5af;p=civicrm-core.git

CustomDataView.tpl clickable contact reference

In manage case if we have custom field as contact reference we cant click on this contact. I used same condition as CRM/Custom/Page/CustomDataView.tpl, which create clickable contact reference.
---

diff --git a/templates/CRM/Case/Page/CustomDataView.tpl b/templates/CRM/Case/Page/CustomDataView.tpl
index 2c45673ceb..d8a4e2ba97 100644
--- a/templates/CRM/Case/Page/CustomDataView.tpl
+++ b/templates/CRM/Case/Page/CustomDataView.tpl
@@ -23,13 +23,23 @@
               <td class="label">{$element.field_title}</td>
               <td class="html-adjust">
               {* sort by fails for option per line. Added a variable to iterate through the element array*}
-                {foreach from=$element.field_value item=val}
-                  {$val}<br/>
-                {/foreach}
+                {if $element.field_data_type EQ 'ContactReference' && $element.contact_ref_links}
+                  {', '|implode:$element.contact_ref_links}
+                {else}
+                  {foreach from=$element.field_value item=val}
+                    {$val}<br/>
+                  {/foreach}
+                {/if}
               </td>
               {else}
                 <td class="label">{$element.field_title}</td>
-                <td class="html-adjust">{$element.field_value}</td>
+                <td class="html-adjust">
+                  {if $element.field_data_type EQ 'ContactReference' && $element.contact_ref_links}
+                    {', '|implode:$element.contact_ref_links}
+                  {else}
+                    {$element.field_value}
+                  {/if}
+                </td>
             {/if}
           </tr>
         </table>