CustomDataView.tpl clickable contact reference
authorvitius1 <36272679+vitius1@users.noreply.github.com>
Thu, 28 Jul 2022 09:21:42 +0000 (11:21 +0200)
committerGitHub <noreply@github.com>
Thu, 28 Jul 2022 09:21:42 +0000 (11:21 +0200)
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.

templates/CRM/Case/Page/CustomDataView.tpl

index 2c45673ceb13c1f5a16344d0c5d831e131b93c72..d8a4e2ba978dbeb4d74199bcf0483797aa83a29e 100644 (file)
               <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>