CRM-16353 - Remaining Contact DataTables refactoring, in addition to initial refactoring
authorJoseph Lacey <joseph@palantetech.coop>
Thu, 30 Apr 2015 02:42:11 +0000 (20:42 -0600)
committerJoseph Lacey <joseph@palantetech.coop>
Thu, 30 Apr 2015 02:42:11 +0000 (20:42 -0600)
----------------------------------------
* CRM-16353: Upgrade datatables integration to use v2 api
  https://issues.civicrm.org/jira/browse/CRM-16353

CRM/Contact/Form/DedupeRules.php
templates/CRM/Activity/Selector/Selector.tpl
templates/CRM/Contact/Page/DedupeException.tpl
templates/CRM/Contact/Page/View/Note.tpl

index d7df3d47d016c9214f2add353066dc0278b4fb79..6d487960f98eb25db3496dab46400bdf72a16079 100644 (file)
@@ -115,7 +115,7 @@ class CRM_Contact_Form_DedupeRules extends CRM_Admin_Form {
     $disabled = array();
     $reserved = $this->addField('is_reserved', array('label' => ts('Reserved?')));
     if (!empty($this->_defaults['is_reserved'])) {
-      $reserved->freeze();
+      //$reserved->freeze();
       $disabled = array('disabled' => TRUE);
     }
 
index 8061466bf68ed67752e1774badccfc58c3591cae..f6a214dc733bfdf34688d7aea549acf35b624494 100644 (file)
@@ -44,7 +44,7 @@
     <thead>
     <tr>
       <th data-data="activity_type" class="crm-contact-activity-activity_type">{ts}Type{/ts}</th>
-      <th data-data="subject" cell-class="crmf-subject crm-editable" cell-data-type="text" class="crm-contact-activity_subject">{ts}Subject{/ts}</th>
+      <th data-data="subject" cell-class="crmf-subject crm-editable" class="crm-contact-activity_subject">{ts}Subject{/ts}</th>
       <th data-data="source_contact_name" class="crm-contact-activity-source_contact">{ts}Added By{/ts}</th>
       <th data-data="target_contact_name" data-orderable="false" class="crm-contact-activity-target_contact">{ts}With{/ts}</th>
       <th data-data="assignee_contact_name" data-orderable="false" class="crm-contact-activity-assignee_contact">{ts}Assigned{/ts}</th>
index 396e45f1400e6649d3c3f199027fcbdb7294bde9..c22d547d0454b321d7b1f8ff2c5934ebc0186167 100644 (file)
  +--------------------------------------------------------------------+
 *}
 
-<table id="dedupeExceptions" class="display">
-    <thead>
-       <tr class="columnheader">
-          <th>{ts}Contact 1{/ts}</th>
-          <th>{ts}Contact 2 (Duplicate){/ts}</th>
-    <th></th>
-       </tr>
-    </thead>
-    <tbody>
-       {foreach from=$dedupeExceptions item=exception key=id}
-       <tr id="dupeRow_{$id}" class="{cycle values="odd-row,even-row"}">
-     <td>{$exception.main.name}</td>
-     <td>{$exception.other.name}</td>
-     <td><a id='duplicateContacts' href="#" title={ts}Remove Exception{/ts} onClick="processDupes( {$exception.main.id}, {$exception.other.id}, 'nondupe-dupe', 'dedupe-exception' );return false;">&raquo; {ts}Remove Exception{/ts}</a></td>
-       </tr>
-       {/foreach}
-    </tbody>
+<table id="dedupeExceptions" class="display crm-sortable">
+  <thead>
+    <tr class="columnheader">
+      <th>{ts}Contact 1{/ts}</th>
+      <th>{ts}Contact 2 (Duplicate){/ts}</th>
+      <th data-orderable="false"></th>
+    </tr>
+  </thead>
+  <tbody>
+    {foreach from=$dedupeExceptions item=exception key=id}
+      <tr id="dupeRow_{$id}" class="{cycle values="odd-row,even-row"}">
+        <td>{$exception.main.name}</td>
+        <td>{$exception.other.name}</td>
+        <td><a id='duplicateContacts' href="#" title={ts}Remove Exception{/ts} onClick="processDupes( {$exception.main.id}, {$exception.other.id}, 'nondupe-dupe', 'dedupe-exception' );return false;">&raquo; {ts}Remove Exception{/ts}</a></td>
+      </tr>
+    {/foreach}
+  </tbody>
 </table>
 <div class="clear"><br /></div>
 <div class="action-link">
-    {crmButton p="civicrm/contact/deduperules" q="reset=1" icon="close"}{ts}Done{/ts}{/crmButton}
+  {crmButton p="civicrm/contact/deduperules" q="reset=1" icon="close"}{ts}Done{/ts}{/crmButton}
 </div>
 
-
-{literal}
-<script type="text/javascript">
-  //load jQuery data table.
-        cj('#dedupeExceptions').dataTable( {
-    "sPaginationType": "full_numbers",
-    "aaSorting": [[0,'asc'], [1,'asc']],
-    "aoColumns": [{sClass:""},{sClass:""},{bSortable:false}],
-        });
-</script>
-{/literal}
-
 {* process the dupe contacts *}
 {include file="CRM/common/dedupe.tpl"}
index fd581fc01521a8432f1351f14bb0e256cc304525..22fc2fe36b70af0a67974de4d8c6123abcb8ef8e 100644 (file)
 {* show browse table for any action *}
 <div id="notes">
     {strip}
-    {include file="CRM/common/jsortable.tpl"}
-
-    <script type="text/javascript">
-    {literal}
-      CRM.$(function($) {
-        var tabId = $('.dataTable').attr('id');
-
-        $('table#'+ tabId).dataTable().fnSettings().aoDrawCallback.push( {
-          "fn": function () {
-            $('#'+ tabId +' tr').each( function() {
-              drawCommentRows(this.id)
-            });
-          },
-          "sName": "user"
-        } );
-      });
-
-    {/literal}
-    </script>
-
-        <table id="options" class="display">
+        <table id="options" class="display crm-sortable" data-order='[[3,"desc"]]'>
         <thead>
         <tr>
-          <th></th>
+          <th data-orderable="false"></th>
           <th>{ts}Note{/ts}</th>
           <th>{ts}Subject{/ts}</th>
           <th>{ts}Date{/ts}</th>
           <th>{ts}Created By{/ts}</th>
-          <th>{ts}Attachment(s){/ts}</th>
-          <th></th>
+          <th data-orderable="false">{ts}Attachment(s){/ts}</th>
+          <th data-orderable="false"></th>
         </tr>
         </thead>