fixed enable action for past relationships CRM-14201
authorkurund <kurund@civicrm.org>
Sun, 2 Mar 2014 09:24:41 +0000 (14:54 +0530)
committerkurund <kurund@civicrm.org>
Sun, 2 Mar 2014 09:24:41 +0000 (14:54 +0530)
----------------------------------------
* CRM-14201: Contact Relationships tab needs pagination
  http://issues.civicrm.org/jira/browse/CRM-14201

CRM/Contact/BAO/Relationship.php
CRM/Contact/Page/AJAX.php
templates/CRM/Contact/Page/View/RelationshipSelector.tpl

index a1106b6dc744edce1701c3ae03823b433eac70f4..ff62ead6704b27e62b08acea3d533385088fe76b 100644 (file)
@@ -1713,6 +1713,7 @@ AND cc.sort_name LIKE '%$name%'";
         $contactRelationships[$relationshipId]['phone'] = $values['phone'];
         $contactRelationships[$relationshipId]['links'] = $values['action'];
         $contactRelationships[$relationshipId]['id'] = $values['id'];
+        $contactRelationships[$relationshipId]['is_active'] = $values['is_active'];
       }
     }
     return $contactRelationships;
index 79f5670af918786b229147121dd4101333b75692..70a273dfa5aeb453eb8164c8271f5df4284491b3 100644 (file)
@@ -1201,6 +1201,7 @@ LIMIT {$offset}, {$rowCount}
       7 => 'phone',
       8 => 'links',
       9 => '',
+      10 => '',
     );
 
     $sEcho     = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
@@ -1235,6 +1236,7 @@ LIMIT {$offset}, {$rowCount}
       'phone',
       'links',
       'id',
+      'is_active',
     );
 
     echo CRM_Utils_JSON::encodeDataTableSelector($relationships, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
index 116390a015911054cf80490c203082702c3b4142..e030d0246a862d25c854ad58d8b49a0112232250 100644 (file)
@@ -79,6 +79,7 @@
         {sClass: 'crm-contact-relationship-email'},
         {sClass: 'crm-contact-relationship-phone'},
         {sClass: 'crm-contact-relationship-links', bSortable: false},
+        {sClass: 'hiddenElement', bSortable: false},
         {sClass: 'hiddenElement', bSortable: false}
       ],
       "bProcessing": true,
         {/literal}{/if}{literal}
       },
       "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull) {
-        cj(nRow).addClass('crm-entity');
         cj(nRow).attr('id', 'relationship-'+ aData[9]);
+        if (aData[10] == 0) {
+          cj(nRow).addClass('crm-entity disabled');
+        }
+        else {
+          cj(nRow).addClass('crm-entity');
+        }
       }
     });
   }