Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split View Relationship tpl ito own file #22617

Merged
merged 1 commit into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 0 additions & 59 deletions templates/CRM/Contact/Form/Relationship.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,65 +9,6 @@
*}
{* this template is used for adding/editing/viewing relationships *}

{if $action eq 4 } {* action = view *}
<div class="crm-block crm-content-block crm-relationship-view-block">
<table class="crm-info-panel">
{foreach from=$viewRelationship item="row"}
<tr>
<td class="label">{$row.relation}</td>
<td><a class="no-popup" href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.cid`"}">{$row.name}</a></td>
</tr>
{if $isCurrentEmployer}
<tr><td class="label">{ts}Current Employee?{/ts}</td><td>{ts}Yes{/ts}</td></tr>
{/if}
{if $row.start_date}
<tr><td class="label">{ts}Start Date{/ts}</td><td>{$row.start_date|crmDate}</td></tr>
{/if}
{if $row.end_date}
<tr><td class="label">{ts}End Date{/ts}</td><td>{$row.end_date|crmDate}</td></tr>
{/if}
{if $row.description}
<tr><td class="label">{ts}Description{/ts}</td><td>{$row.description}</td></tr>
{/if}
{foreach from=$viewNote item="rec"}
{if $rec }
<tr><td class="label">{ts}Note{/ts}</td><td>{$rec}</td></tr>
{/if}
{/foreach}
<tr>
<td class="label"><label>{ts}Permissions{/ts}</label></td>
<td>
{if $row.is_permission_a_b or $row.is_permission_b_a}
{if $row.is_permission_a_b}
<div>
{if $row.rtype EQ 'a_b' AND $is_contact_id_a}
{include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=$row.is_permission_a_b permDisplayName=$displayName otherDisplayName=$row.display_name displayText=true}
{else}
{include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=$row.is_permission_a_b otherDisplayName=$displayName permDisplayName=$row.display_name displayText=true}
{/if}
</div>
{/if}
{if $row.is_permission_b_a}
<div>
{if $row.rtype EQ 'a_b' AND $is_contact_id_a}
{include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=$row.is_permission_b_a otherDisplayName=$displayName permDisplayName=$row.display_name displayText=true}
{else}
{include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=$row.is_permission_b_a permDisplayName=$displayName otherDisplayName=$row.display_name displayText=true}
{/if}
</div>
{/if}
{else}
{ts}None{/ts}
{/if}
</td>
</tr>
<tr><td class="label">{ts}Status{/ts}</td><td>{if $row.is_active}{ts}Enabled{/ts}{else}{ts}Disabled{/ts}{/if}</td></tr>
{/foreach}
</table>
{include file="CRM/Custom/Page/CustomDataView.tpl"}
</div>
{/if}

{if $action eq 2 or $action eq 1} {* add and update actions *}
<div class="crm-block crm-form-block crm-relationship-form-block">
<table class="form-layout-compressed">
Expand Down
4 changes: 3 additions & 1 deletion templates/CRM/Contact/Page/View/Relationship.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
+--------------------------------------------------------------------+
*}
{* Relationship tab within View Contact - browse, and view relationships for a contact *}
{if $action neq 16} {* add, update or view *}
{if $action eq 4 } {* action = view *}
{include file="CRM/Contact/Page/View/ViewRelationship.tpl"}
{elseif $action neq 16} {* add, update *}
{include file="CRM/Contact/Form/Relationship.tpl"}
{else}
<div id="contact-summary-relationship-tab" class="view-content">
Expand Down
58 changes: 58 additions & 0 deletions templates/CRM/Contact/Page/View/ViewRelationship.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<div class="crm-block crm-content-block crm-relationship-view-block">
<table class="crm-info-panel">
{foreach from=$viewRelationship item="row"}
<tr>
<td class="label">{$row.relation}</td>
<td><a class="no-popup" href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.cid`"}">{$row.name}</a></td>
</tr>
{if $isCurrentEmployer}
<tr><td class="label">{ts}Current Employee?{/ts}</td><td>{ts}Yes{/ts}</td></tr>
{/if}
{if $row.start_date}
<tr><td class="label">{ts}Start Date{/ts}</td><td>{$row.start_date|crmDate}</td></tr>
{/if}
{if $row.end_date}
<tr><td class="label">{ts}End Date{/ts}</td><td>{$row.end_date|crmDate}</td></tr>
{/if}
{if $row.description}
<tr><td class="label">{ts}Description{/ts}</td><td>{$row.description}</td></tr>
{/if}
{foreach from=$viewNote item="rec"}
{if $rec }
<tr><td class="label">{ts}Note{/ts}</td><td>{$rec}</td></tr>
{/if}
{/foreach}
<tr>
<td class="label"><label>{ts}Permissions{/ts}</label></td>
<td>
{if $row.is_permission_a_b or $row.is_permission_b_a}
{if $row.is_permission_a_b}
<div>
{if $row.rtype EQ 'a_b' AND $is_contact_id_a}
{include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=$row.is_permission_a_b permDisplayName=$displayName otherDisplayName=$row.display_name displayText=true}
{else}
{include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=$row.is_permission_a_b otherDisplayName=$displayName permDisplayName=$row.display_name displayText=true}
{/if}
</div>
{/if}
{if $row.is_permission_b_a}
<div>
{if $row.rtype EQ 'a_b' AND $is_contact_id_a}
{include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=$row.is_permission_b_a otherDisplayName=$displayName permDisplayName=$row.display_name displayText=true}
{else}
{include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=$row.is_permission_b_a permDisplayName=$displayName otherDisplayName=$row.display_name displayText=true}
{/if}
</div>
{/if}
{else}
{ts}None{/ts}
{/if}
</td>
</tr>
<tr><td class="label">{ts}Status{/ts}</td><td>{if $row.is_active}{ts}Enabled{/ts}{else}{ts}Disabled{/ts}{/if}</td></tr>
{/foreach}
</table>
{include file="CRM/Custom/Page/CustomDataView.tpl"}
</div>

<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>