From babae7c3770f86aa964ed1b69aaa9098b6150985 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 6 Jan 2014 17:31:04 -0800 Subject: [PATCH] CRM-13863 - Ajax improvements for relationship tab. --- CRM/Contact/Form/Relationship.php | 2 +- CRM/Contact/Page/View/Relationship.php | 2 +- templates/CRM/Contact/Page/View/Relationship.tpl | 11 ++++------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CRM/Contact/Form/Relationship.php b/CRM/Contact/Form/Relationship.php index 8eea3342eb..12076b252a 100644 --- a/CRM/Contact/Form/Relationship.php +++ b/CRM/Contact/Form/Relationship.php @@ -424,7 +424,7 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { } $this->addElement('submit', $this->getButtonName('refresh'), $searchBtn, array('class' => 'form-submit', 'id' => 'search-button')); $this->addElement('submit', $this->getButtonName('refresh', 'save'), 'Quick Save', array('class' => 'form-submit', 'id' => 'quick-save')); - $this->addElement('submit', $this->getButtonName('cancel'), ts('Cancel'), array('class' => 'form-submit')); + $this->addElement('submit', $this->getButtonName('cancel'), ts('Cancel'), array('class' => 'form-submit cancel')); $this->addElement('submit', $this->getButtonName('refresh', 'savedetails'), 'Save Relationship', array('class' => 'form-submit hiddenElement', 'id' => 'details-save')); $this->addElement('checkbox', 'add_current_employer', ts('Current Employer'), NULL); diff --git a/CRM/Contact/Page/View/Relationship.php b/CRM/Contact/Page/View/Relationship.php index 153bdf14f1..0c0763ad8b 100644 --- a/CRM/Contact/Page/View/Relationship.php +++ b/CRM/Contact/Page/View/Relationship.php @@ -268,7 +268,7 @@ class CRM_Contact_Page_View_Relationship extends CRM_Core_Page { } // if this is called from case view, suppress browse relationships form - if (!$this->_caseId) { + else { $this->browse(); } diff --git a/templates/CRM/Contact/Page/View/Relationship.tpl b/templates/CRM/Contact/Page/View/Relationship.tpl index 5a7ab66ed3..7ae47ea55a 100644 --- a/templates/CRM/Contact/Page/View/Relationship.tpl +++ b/templates/CRM/Contact/Page/View/Relationship.tpl @@ -26,13 +26,12 @@ {* 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} -
- {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} +
- {if $action NEQ 1 AND $action NEQ 2 AND $permission EQ 'edit'} + {if $permission EQ 'edit'} @@ -118,7 +117,6 @@ {if $currentRelationships or $inactiveRelationships} {include file="CRM/common/enableDisableApi.tpl"} {else} - {if $action NEQ 1} {* show 'no relationships' message - unless already in 'add' mode. *}
{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} @@ -130,7 +128,6 @@ {ts}There are no Relationships entered for this contact.{/ts} {/if}
- {/if} {/if}
-- 2.25.1