From f1321272d33a167b2ee6c75b0151bc3017f08341 Mon Sep 17 00:00:00 2001 From: kurund Date: Sun, 2 Mar 2014 14:54:41 +0530 Subject: [PATCH] fixed enable action for past relationships CRM-14201 ---------------------------------------- * CRM-14201: Contact Relationships tab needs pagination http://issues.civicrm.org/jira/browse/CRM-14201 --- CRM/Contact/BAO/Relationship.php | 1 + CRM/Contact/Page/AJAX.php | 2 ++ templates/CRM/Contact/Page/View/RelationshipSelector.tpl | 8 +++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index a1106b6dc7..ff62ead670 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -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; diff --git a/CRM/Contact/Page/AJAX.php b/CRM/Contact/Page/AJAX.php index 79f5670af9..70a273dfa5 100644 --- a/CRM/Contact/Page/AJAX.php +++ b/CRM/Contact/Page/AJAX.php @@ -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); diff --git a/templates/CRM/Contact/Page/View/RelationshipSelector.tpl b/templates/CRM/Contact/Page/View/RelationshipSelector.tpl index 116390a015..e030d0246a 100644 --- a/templates/CRM/Contact/Page/View/RelationshipSelector.tpl +++ b/templates/CRM/Contact/Page/View/RelationshipSelector.tpl @@ -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, @@ -111,8 +112,13 @@ {/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'); + } } }); } -- 2.25.1