CRM-13863 - Ajax improvements for relationship tab.
authorColeman Watts <coleman@civicrm.org>
Tue, 7 Jan 2014 01:31:04 +0000 (17:31 -0800)
committerColeman Watts <coleman@civicrm.org>
Tue, 7 Jan 2014 01:31:04 +0000 (17:31 -0800)
CRM/Contact/Form/Relationship.php
CRM/Contact/Page/View/Relationship.php
templates/CRM/Contact/Page/View/Relationship.tpl

index 8eea3342eb2fec0d20417edfa03631c04490b443..12076b252a0a5bdc80421a9ecb87f8a71d241368 100644 (file)
@@ -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);
index 153bdf14f1d0bb64c54b87db315b9ccf2b7ded02..0c0763ad8be69855c95ad56a5e7b984bdb14acb5 100644 (file)
@@ -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();
     }
 
index 5a7ab66ed366e2c6c042bc741763cd859593a0cb..7ae47ea55af28567f926260700736e9fb988ce58 100644 (file)
 {* 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>
 {if $currentRelationships or $inactiveRelationships}
   {include file="CRM/common/enableDisableApi.tpl"}
 {else}
-  {if $action NEQ 1} {* show 'no relationships' message - unless already in 'add' mode. *}
        <div class="messages status no-popup">
             <div class="icon inform-icon"></div>
            {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}
                     {ts}There are no Relationships entered for this contact.{/ts}
                 {/if}
         </div>
-  {/if}
 {/if}
 </div>
 <div class="spacer"></div>