{*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
{* Relationship tab within View Contact - browse, and view relationships for a contact *}
{if !empty($cdType) }
{include file="CRM/Custom/Form/CustomData.tpl"}
+{elseif $action neq 16} {* add, update or view *}
+ {include file="CRM/Contact/Form/Relationship.tpl"}
{else}
- <div class="view-content">
- {if $action eq 1 or $action eq 2 or $action eq 4 or $action eq 8} {* add, update or view *}
- {include file="CRM/Contact/Form/Relationship.tpl"}
- {/if}
+<div class="view-content">
<div class="crm-block crm-content-block">
- {if $action NEQ 1 AND $action NEQ 2 AND $permission EQ 'edit'}
+ {if $permission EQ 'edit'}
<div class="action-link">
<a accesskey="N" href="{crmURL p='civicrm/contact/view/rel' q="cid=`$contactId`&action=add&reset=1"}" class="button"><span><div class="icon add-icon"></div>{ts}Add Relationship{/ts}</span></a>
</div>
{assign var = "rtype" value = "b_a" }
{/if*}
- <tr id="rel_{$rel.id}" class="{cycle values="odd-row,even-row"} row-relationship {if $rel.is_permission_a_b eq 1 or $rel.is_permission_b_a eq 1}row-highlight{/if}">
+ <tr id="relationship-{$rel.id}" class="crm-entity {cycle values="odd-row,even-row"} row-relationship {if $rel.is_permission_a_b eq 1 or $rel.is_permission_b_a eq 1}row-highlight{/if}">
{if $relationshipTabContext}
<td class="bold">
{/if}
{* end of code to show current relationships *}
-{if NOT ($currentRelationships or $inactiveRelationships) }
-
- {if $action NEQ 1} {* show 'no relationships' message - unless already in 'add' mode. *}
+{if $currentRelationships or $inactiveRelationships}
+ {include file="CRM/common/enableDisableApi.tpl"}
+{else}
<div class="messages status no-popup">
<div class="icon inform-icon"></div>
- {capture assign=crmURL}{crmURL p='civicrm/contact/view/rel' q="cid=`$contactId`&action=add&reset=1"}{/capture}
+ {capture assign=link}accesskey="N" class="action-item action-item-first" href="{crmURL p='civicrm/contact/view/rel' q="cid=`$contactId`&action=add&reset=1"}"{/capture}
{if $permission EQ 'edit'}
- {ts 1=$crmURL}There are no Relationships entered for this contact. You can <a accesskey="N" href='%1'>add one</a>.{/ts}
+ {ts 1=$link}There are no Relationships entered for this contact. You can <a %1>add one</a>.{/ts}
{elseif ! $relationshipTabContext}
{ts}There are no related contacts / organizations on record for you.{/ts}
{else}
{ts}There are no Relationships entered for this contact.{/ts}
{/if}
</div>
- {/if}
{/if}
</div>
<div class="spacer"></div>
{else}
{assign var = "rtype" value = "a_b" }
{/if}
- <tr id="rel_{$rel.id}" class="{cycle values="odd-row,even-row"}">
+ <tr id="relationship-{$rel.id}" class="crm-entity {cycle values="odd-row,even-row"}">
<td class="bold">
{$rel.relation}
{if $rel.description}<p class='description'>{$rel.description}</p>{/if}