From: kurund Date: Sat, 1 Mar 2014 21:21:58 +0000 (+0530) Subject: fixed enable/disable actions, CRM-14201 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e1cad72507dd73d16a17c823cb9ab17338cfb4dc;p=civicrm-core.git fixed enable/disable actions, 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 41deda8d4e..ba4fb7a13e 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -1692,6 +1692,7 @@ AND cc.sort_name LIKE '%$name%'"; $contactRelationships[$relationshipId]['email'] = $values['email']; $contactRelationships[$relationshipId]['phone'] = $values['phone']; $contactRelationships[$relationshipId]['links'] = $values['action']; + $contactRelationships[$relationshipId]['id'] = $values['id']; } } return $contactRelationships; diff --git a/CRM/Contact/Page/AJAX.php b/CRM/Contact/Page/AJAX.php index 2dfdbf0c2e..79f5670af9 100644 --- a/CRM/Contact/Page/AJAX.php +++ b/CRM/Contact/Page/AJAX.php @@ -1200,6 +1200,7 @@ LIMIT {$offset}, {$rowCount} 6 => 'email', 7 => 'phone', 8 => 'links', + 9 => '', ); $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer'); @@ -1233,6 +1234,7 @@ LIMIT {$offset}, {$rowCount} 'email', 'phone', 'links', + 'id', ); 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 425f436195..78e428b3a8 100644 --- a/templates/CRM/Contact/Page/View/RelationshipSelector.tpl +++ b/templates/CRM/Contact/Page/View/RelationshipSelector.tpl @@ -71,6 +71,7 @@ {sClass: 'crm-contact-relationship-email'}, {sClass: 'crm-contact-relationship-phone'}, {sClass: 'crm-contact-relationship-links', bSortable: false}, + {sClass: 'hiddenElement', bSortable: false} ], "bProcessing": true, "sPaginationType": "full_numbers", @@ -78,7 +79,7 @@ "bServerSide": true, "bJQueryUI": true, "sAjaxSource": sourceUrl, - "iDisplayLength": 5, + "iDisplayLength": 25, "oLanguage": { "sZeroRecords": ZeroRecordText, "sProcessing": {/literal}"{ts escape='js'}Processing...{/ts}"{literal}, @@ -100,6 +101,10 @@ CRM.tabHeader.updateCount(cj('#tab_rel'), currentoTable.fnSettings().fnRecordsTotal()); } {/literal}{/if}{literal} + }, + "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull) { + cj(nRow).addClass('crm-entity'); + cj(nRow).attr('id', 'relationship-'+ aData[9]); } }); }