From: kurund Date: Sun, 2 Mar 2014 09:24:41 +0000 (+0530) Subject: fixed enable action for past relationships CRM-14201 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f1321272d33a167b2ee6c75b0151bc3017f08341;p=civicrm-core.git fixed enable action for past relationships CRM-14201 ---------------------------------------- * CRM-14201: Contact Relationships tab needs pagination http://issues.civicrm.org/jira/browse/CRM-14201 --- 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'); + } } }); }