--CRM-15989, Added code to show (deceased) for Contact taged as deceased
authorPradeep Nayak <pradpnayak@gmail.com>
Wed, 18 Feb 2015 22:37:29 +0000 (04:07 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Mon, 2 Mar 2015 21:20:43 +0000 (02:50 +0530)
CRM/Contact/Form/Contact.php
CRM/Contact/Page/View.php
templates/CRM/Contact/Page/Inline/Demographics.tpl

index 86247c0dc418e5790f8235dc483ed9f7061ee611..69ccda51da7e533201498a0e1a9c563ffe84fb1b 100644 (file)
@@ -196,7 +196,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
       if ($this->_contactId) {
         $defaults = array();
         $params = array('id' => $this->_contactId);
-        $returnProperities = array('id', 'contact_type', 'contact_sub_type', 'modified_date');
+        $returnProperities = array('id', 'contact_type', 'contact_sub_type', 'modified_date', 'is_deceased');
         CRM_Core_DAO::commonRetrieve('CRM_Contact_DAO_Contact', $params, $defaults, $returnProperities);
 
         if (empty($defaults['id'])) {
@@ -213,6 +213,10 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
         }
 
         $displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
+        if ($defaults['is_deceased']) {
+          $displayName .= '  <font color=red>(deceased)</font>';
+        }
+        
         $displayName = ts('Edit %1', array(1 => $displayName));
 
         // Check if this is default domain contact CRM-10482
index 433601177bef37e6f9396bcc353e6dae7d966c11..26f97bd21fe17f0b8da634c282a06b77929ada90 100644 (file)
@@ -322,6 +322,7 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
       $contactDetails[$contactId] = array(
         'displayName' => $displayName,
         'contactImage' => $contactImage,
+        'isDeceased' => (bool) CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $contactId, 'is_deceased'),
       );
     }
     else {
@@ -331,6 +332,10 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
 
     // set page title
     $title = "{$contactImage} {$displayName}";
+    if ($contactDetails[$contactId]['isDeceased']) {
+      $title .= '  <font color=red>(deceased)</font>';
+    }
+    
     if ($isDeleted) {
       $title = "<del>{$title}</del>";
     }
index e76ac87f5ba0cb2f0016e5e29004d219508c57a7..fa2b12c977eb8b6ccf7c746bbe3e4c0827ad0a01 100644 (file)
@@ -23,7 +23,7 @@
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
 *}
-<div id="crm-demographic-content" {if $permission EQ 'edit'} class="crm-inline-edit" data-edit-params='{ldelim}"cid": "{$contactId}", "class_name": "CRM_Contact_Form_Inline_Demographics"{rdelim}'{/if}>
+<div id="crm-demographic-content" {if $permission EQ 'edit'} class="crm-inline-edit" data-dependent-fields='["#crm-contactname-content"]' data-edit-params='{ldelim}"cid": "{$contactId}", "class_name": "CRM_Contact_Form_Inline_Demographics"{rdelim}'{/if}>
   <div class="crm-clear crm-inline-block-content" {if $permission EQ 'edit'}title="{ts}Edit demographics{/ts}"{/if}>
     {if $permission EQ 'edit'}
     <div class="crm-edit-help">