fixed enable/disable actions, CRM-14201
authorkurund <kurund@civicrm.org>
Sat, 1 Mar 2014 21:21:58 +0000 (02:51 +0530)
committerkurund <kurund@civicrm.org>
Sat, 1 Mar 2014 21:21:58 +0000 (02:51 +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 41deda8d4e02c13e9a8c787ed0fb34c017074805..ba4fb7a13e7283f33fc6df6683095790901b6b7d 100644 (file)
@@ -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;
index 2dfdbf0c2eb17ba42175ceae75262df279cc73ff..79f5670af918786b229147121dd4101333b75692 100644 (file)
@@ -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);
index 425f436195a881235be6862e02b7e772828ab398..78e428b3a8c3d2cec2e490f48776be845efd8d43 100644 (file)
@@ -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},
           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]);
       }
     });
   }