CRM-13819 - Remove jsortable from tables with weight controls
authorColeman Watts <coleman@civicrm.org>
Sat, 9 Aug 2014 15:23:36 +0000 (16:23 +0100)
committerColeman Watts <coleman@civicrm.org>
Sat, 9 Aug 2014 15:23:36 +0000 (16:23 +0100)
12 files changed:
templates/CRM/Admin/Page/LabelFormats.tpl
templates/CRM/Admin/Page/Options.tpl
templates/CRM/Admin/Page/PdfFormats.tpl
templates/CRM/Campaign/Page/SurveyType.tpl
templates/CRM/Custom/Page/Field.tpl
templates/CRM/Custom/Page/Group.tpl
templates/CRM/Member/Page/MembershipType.tpl
templates/CRM/Price/Page/Field.tpl
templates/CRM/Price/Page/Option.tpl
templates/CRM/Report/Page/Options.tpl
templates/CRM/UF/Page/Field.tpl
templates/CRM/common/jsortable.tpl

index 218f5c271ba5a963cf6c259f92b29d37ae3930f6..f300210fe5657ee7e7217a31af7564268724b83c 100644 (file)
   {if $rows}
     <div id="ltype">
       {strip}
-        {include file="CRM/common/jsortable.tpl"}
-        <table id="labelFormats" class="display">
+        <table id="labelFormats" class="row-highlight">
           <thead>
           <tr class="columnheader">
-            <th class="sortable">{ts}Name{/ts}</th>
-            <th class="sortable">{ts}Used for{/ts}</th>
-            <th class="sortable">{ts}Grouping{/ts}</th>
+            <th>{ts}Name{/ts}</th>
+            <th>{ts}Used for{/ts}</th>
+            <th>{ts}Order{/ts}</th>
+            <th>{ts}Grouping{/ts}</th>
             <th>{ts}Default?{/ts}</th>
             <th>{ts}Reserved?{/ts}</th>
-            <th id="order" class="sortable">{ts}Order{/ts}</th>
-            <th class="hiddenElement"></th>
             <th></th>
           </tr>
           </thead>
             <tr id="row_{$row.id}" class="crm-labelFormat {cycle values="odd-row,even-row"} {$row.class}">
               <td class="crm-labelFormat-name">{$row.label}</td>
               <td class="crm-labelFormat-name">{$row.groupName}</td>
+              <td class="crm-labelFormat-order nowrap">{$row.weight}</td>
               <td class="crm-labelFormat-description">{$row.grouping}</td>
               <td class="crm-labelFormat-is_default">{if $row.is_default eq 1}<img
                 src="{$config->resourceBase}i/check.gif" alt="{ts}Default{/ts}"/>{/if}&nbsp;</td>
               <td class="crm-labelFormat-is_reserved">{if $row.is_reserved eq 1}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}
                 &nbsp;</td>
-              <td class="crm-labelFormat-order nowrap">{$row.order}</td>
-              <td class="order hiddenElement">{$row.weight}</td>
               <td>{$row.action|replace:'xx':$row.id}</td>
             </tr>
           {/foreach}
index 2c23219f92b8cde1bde0624a8a77a0f2ba891505..b68715bead9c9d10961ae5c130de216e3e089851 100644 (file)
@@ -79,8 +79,7 @@
         {strip}
   {* handle enable/disable actions*}
   {include file="CRM/common/enableDisableApi.tpl"}
-    {include file="CRM/common/jsortable.tpl"}
-        <table id="options" class="display">
+        <table id="options" class="row-highlight">
          <thead>
          <tr>
             {if $showComponent}
             {if $showCounted}<th>{ts}Counted?{/ts}</th>{/if}
             {if $showVisibility}<th>{ts}Visibility{/ts}</th>{/if}
             <th id="nosort">{ts}Description{/ts}</th>
-            <th id="order">{ts}Order{/ts}</th>
+            <th>{ts}Order{/ts}</th>
             {if $showIsDefault}<th>{ts}Default{/ts}</th>{/if}
             <th>{ts}Reserved{/ts}</th>
             <th>{ts}Enabled?{/ts}</th>
-            <th class="hiddenElement"></th>
             <th></th>
           </tr>
           </thead>
             {/if}
             {if $showVisibility}<td class="crm-admin-visibility_label">{$row.visibility_label}</td>{/if}
             <td class="crm-admin-options-description crm-editable" data-field="description" data-type="textarea">{$row.description}</td>
-            <td class="nowrap crm-admin-options-order">{$row.order}</td>
+            <td class="nowrap crm-admin-options-order">{$row.weight}</td>
             {if $showIsDefault}
               <td class="crm-admin-options-is_default" align="center">{if $row.is_default eq 1}<img src="{$config->resourceBase}i/check.gif" alt="{ts}Default{/ts}" />{/if}&nbsp;</td>
             {/if}
             <td class="crm-admin-options-is_reserved">{if $row.is_reserved eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
             <td class="crm-admin-options-is_active" id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
             <td>{$row.action|replace:'xx':$row.id}</td>
-            <td class="order hiddenElement">{$row.weight}</td>
           </tr>
         {/foreach}
         </tbody>
index bbd64c962f2bc7b28a0181446fc71430e5fcce96..8fc34c94d7b58bc5736da298a86bef4d732619dd 100644 (file)
 {if $rows}
     <div id="ltype">
         {strip}
-        {include file="CRM/common/jsortable.tpl"}
-        <table id="pdfFormats" class="display">
+        <table id="pdfFormats" class="row-highlight">
         <thead>
         <tr class="columnheader">
-            <th  class="sortable">{ts}Name{/ts}</th>
-            <th id="nosort">{ts}Description{/ts}</th>
+            <th>{ts}Name{/ts}</th>
+            <th>{ts}Description{/ts}</th>
             <th >{ts}Default?{/ts}</th>
-            <th id="order" class="sortable">{ts}Order{/ts}</th>
-            <th class="hiddenElement"></th>
+            <th>{ts}Order{/ts}</th>
             <th ></th>
         </tr>
         </thead>
@@ -52,8 +50,7 @@
             <td class="crm-pdfFormat-name">{$row.name}</td>
             <td class="crm-pdfFormat-description">{$row.description}</td>
             <td class="crm-pdfFormat-is_default">{if $row.is_default eq 1}<img src="{$config->resourceBase}i/check.gif" alt="{ts}Default{/ts}" />{/if}&nbsp;</td>
-          <td class="crm-pdfFormat-order nowrap">{$row.order}</td>
-          <td class="order hiddenElement">{$row.weight}</td>
+          <td class="crm-pdfFormat-order nowrap">{$row.weight}</td>
           <td>{$row.action|replace:'xx':$row.id}</td>
         </tr>
         {/foreach}
index 2724483a84d425087aa3704153fb767ff19663d6..129ba414fbd6cc89ea403041ba40e3e74bbfd0b7 100644 (file)
@@ -12,8 +12,7 @@
   {* handle enable/disable actions*}
   {include file="CRM/common/enableDisableApi.tpl"}
   {include file="CRM/common/crmeditable.tpl"}
-        {include file="CRM/common/jsortable.tpl"}
-        <table class="display">
+        <table class="row-highlight">
          <thead>
          <tr>
                  <th>
                  <th>
                    {ts}Value{/ts}
                  </th>
-                 <th id="nosort">{ts}Description{/ts}</th>
-                 <th id="order" class="sortable">{ts}Order{/ts}</th>
+                 <th>{ts}Description{/ts}</th>
+                 <th>{ts}Order{/ts}</th>
                  <th>{ts}Reserved{/ts}</th>
                  <th>{ts}Enabled?{/ts}</th>
                  <th></th>
-     <th class="hiddenElement"></th>
                  </tr>
         </thead>
         {foreach from=$rows item=row}
           <td class="crm-admin-options-label crm-editable" data-field="label">{$row.label}</td>
           <td class="crm-admin-options-value">{$row.value}</td>
           <td class="crm-admin-options-description">{$row.description}</td>
-          <td class="nowrap crm-admin-options-order">{$row.order}</td>
+          <td class="nowrap crm-admin-options-order">{$row.weight}</td>
           <td class="crm-admin-options-is_reserved">{if $row.is_reserved eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
           <td class="crm-admin-options-is_active" id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
           <td>{$row.action|replace:'xx':$row.id}</td>
-    <td class="order hiddenElement">{$row.weight}</td>
         </tr>
         {/foreach}
         </table>
index 14f9a511e3d10026c4f1f12855fb4847b4c6fe3c..24e2378a5950a914bd5fd5708fcdb33fb7dd8bc9 100644 (file)
         {strip}
       {* handle enable/disable actions*}
         {include file="CRM/common/enableDisableApi.tpl"}
-        {include file="CRM/common/jsortable.tpl"}
-         <table id="options" class="display">
+         <table id="options" class="row-highlight">
          <thead>
          <tr>
             <th>{ts}Field Label{/ts}</th>
             <th>{ts}Data Type{/ts}</th>
             <th>{ts}Field Type{/ts}</th>
-            <th id="order" class="sortable">{ts}Order{/ts}</th>
+            <th>{ts}Order{/ts}</th>
             <th>{ts}Req?{/ts}</th>
             <th>{ts}Searchable?{/ts}</th>
             <th>{ts}Enabled?{/ts}</th>
             <th></th>
-      <th class="hiddenElement"></th>
         </tr>
         </thead>
         <tbody>
             <td><span class="crm-editable crmf-label">{$row.label}</span></td>
             <td>{$row.data_type}</td>
             <td>{$row.html_type}</td>
-            <td class="nowrap">{$row.order}</td>
+            <td class="nowrap">{$row.weight}</td>
             <td>{if $row.is_required eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
             <td>{if $row.is_searchable eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
             <td id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
             <td>{$row.action|replace:'xx':$row.id}</td>
-            <td class="order hiddenElement">{$row.weight}</td>
         </tr>
         {/foreach}
         </tbody>
index 117c217ed1e2d646465939a06b801aa496163482..90e9170210173b81a31fc488b93b1057fb0a138e 100644 (file)
    {* handle enable/disable actions*}
    {include file="CRM/common/enableDisableApi.tpl"}
    {include file="CRM/common/crmeditable.tpl"}
-   {include file="CRM/common/jsortable.tpl"}
-      <table id="options" class="display">
+      <table id="options" class="row-highlight">
         <thead>
           <tr>
             <th>{ts}Set{/ts}</th>
             <th>{ts}Enabled?{/ts}</th>
             <th>{ts}Used For{/ts}</th>
             <th>{ts}Type{/ts}</th>
-            <th id="order" class="sortable">{ts}Order{/ts}</th>
+            <th>{ts}Order{/ts}</th>
             <th>{ts}Style{/ts}</th>
             <th></th>
-            <th class='hiddenElement'></th>
           </tr>
         </thead>
         <tbody>
           <td id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
           <td>{if $row.extends eq 'Contact'}{ts}All Contact Types{/ts}{else}{$row.extends_display}{/if}</td>
           <td>{$row.extends_entity_column_value}</td>
-          <td class="nowrap">{$row.order}</td>
+          <td class="nowrap">{$row.weight}</td>
           <td>{$row.style_display}</td>
           <td>{$row.action|replace:'xx':$row.id}</td>
-          <td class="order hiddenElement">{$row.weight}</td>
         </tr>
         {/foreach}
         </tbody>
index 1ba52d061fc59c2cb2b4ade3fe18e4f3d2e6253b..1dcdbf63b9a18096de0973543911bb0707d97963 100644 (file)
@@ -36,8 +36,7 @@
   {* handle enable/disable actions*}
   {include file="CRM/common/enableDisableApi.tpl"}
   {include file="CRM/common/crmeditable.tpl"}
-  {include file="CRM/common/jsortable.tpl"}
-    <table id="options" class="display">
+    <table id="options" class="row-highlight">
       <thead>
       <tr>
         <th>{ts}Membership{/ts}</th>
         <th>{ts}Related{/ts}</th>
         <th>{ts}Max{/ts}</th>
         <th>{ts}Visibility{/ts}</th>
-        <th id="order" class="sortable">{ts}Order{/ts}</th>
+        <th>{ts}Order{/ts}</th>
         <th>{ts}Enabled?{/ts}</th>
         <th></th>
-        <th class="hiddenElement"></th>
       </tr>
       </thead>
       {foreach from=$rows item=row}
           <td class="crm-membership-type-relationship_type_name">{$row.relationshipTypeName}</td>
           <td class="crm-membership-type-max_related" align="right">{$row.maxRelated}</td>
           <td class="crm-membership-type-visibility">{$row.visibility}</td>
-          <td class="nowrap crm-membership_type-order">{$row.order}</td>
+          <td class="nowrap crm-membership_type-order">{$row.weight}</td>
           <td class="crm-membership-type-status_{$row.id}" id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
           <td>{$row.action|replace:'xx':$row.id}</td>
-          <td class="order hiddenElement">{$row.weight}</td>
         </tr>
       {/foreach}
     </table>
index 84159ad0cea29a5c53abec2e29bff6ac248b7dc9..424be8aa9845201a9f3e6b7ef10b4e0b3d646294 100644 (file)
   {* handle enable/disable actions*}
    {include file="CRM/common/enableDisableApi.tpl"}
    {include file="CRM/common/crmeditable.tpl"}
-    {include file="CRM/common/jsortable.tpl"}
-         <table id="options" class="display">
+         <table id="options" class="row-highlight">
          <thead>
          <tr>
             <th>{ts}Field Label{/ts}</th>
             <th>{ts}Field Type{/ts}</th>
-            <th id="order" class="sortable">{ts}Order{/ts}</th>
+            <th>{ts}Order{/ts}</th>
             <th>{ts}Req?{/ts}</th>
             <th>{ts}Enabled?{/ts}</th>
             <th>{ts}Active On{/ts}</th>
             <th>{ts}Expire On{/ts}</th>
-            <th id="nosort">{ts}Price{/ts}</th>
+            <th>{ts}Price{/ts}</th>
             <th></th>
-            <th class="hiddenElement"></th>
         </tr>
         </thead>
         {foreach from=$priceField key=fid item=row}
       <tr id="price_field-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
             <td class="crm-editable" data-field="label">{$row.label}</td>
             <td>{$row.html_type}</td>
-            <td class="nowrap">{$row.order}</td>
+            <td class="nowrap">{$row.weight}</td>
             <td>{if $row.is_required eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
             <td id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
             <td>{if $row.active_on}{$row.active_on|date_format:"%Y-%m-%d %T"}{/if}</td>
             <td>{if $row.expire_on}{$row.expire_on|date_format:"%Y-%m-%d %T"}{/if}</td>
             <td>{if $row.html_type eq "Text / Numeric Quantity"}{$row.price|crmMoney}{else}<a href="{crmURL p="civicrm/admin/price/field/option" q="action=browse&reset=1&sid=$sid&fid=$fid"}">{if $isReserved}{ts}View Price Options{/ts}{else}{ts}Edit Price Options{/ts}{/if}</a>{/if}</td>
             <td class="field-action">{$row.action|replace:'xx':$row.id}</td>
-            <td class="order hiddenElement">{$row.weight}</td>
         </tr>
         {/foreach}
         </table>
index 7419811118cf6f00444c8cec3291c46eb6a0073d..99d3d0270e64fc9d597f6e5dc39d13e1b83f53e7 100644 (file)
   {* handle enable/disable actions*}
    {include file="CRM/common/enableDisableApi.tpl"}
    {include file="CRM/common/crmeditable.tpl"}
-   {include file="CRM/common/jsortable.tpl"}
-        <table id="options" class="display">
+        <table id="options" class="row-highlight">
         <thead>
          <tr>
             <th>{ts}Option Label{/ts}</th>
             <th>{ts}Option Amount{/ts}</th>
           <th>{ts}Default{/ts}</th>
           <th>{ts}Financial Type{/ts}</th>
-            <th id="order" class="sortable">{ts}Order{/ts}</th>
+            <th>{ts}Order{/ts}</th>
           <th>{ts}Enabled?{/ts}</th>
             <th></th>
-            <th class="hiddenElement"></th>
          </tr>
         </thead>
         {foreach from=$customOption item=row}
@@ -75,7 +73,6 @@
             <td class="nowrap crm-price-option-order">{$row.weight}</td>
             <td id="row_{$row.id}_status" class="crm-price-option-is_active">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
             <td>{$row.action|replace:'xx':$row.id}</td>
-            <td class="order hiddenElement">{$row.weight}</td>
         </tr>
         {/foreach}
         </tbody>
index db9c22b103fba0ef91d35a9fca2b7867efbd9522..e4898a0ae6f4a3273b1eb104a075f3a862189957 100644 (file)
   {* handle enable/disable actions*}
    {include file="CRM/common/enableDisableApi.tpl"}
    {include file="CRM/common/crmeditable.tpl"}
-   {include file="CRM/common/jsortable.tpl"}
-       <table id="options" class="display">
+       <table id="options" class="row-highlight">
        <thead>
     <tr>
         <th>{ts}Label{/ts}</th>
         <th>{ts}URL{/ts}</th>
-        <th id="nosort">{ts}Description{/ts}</th>
-        <th id="order" class="sortable">{ts}Order{/ts}</th>
+        <th>{ts}Description{/ts}</th>
+        <th>{ts}Order{/ts}</th>
         {if $showIsDefault}
             <th>{ts}Default{/ts}</th>
         {/if}
@@ -61,7 +60,7 @@
              <td class="crm-report-optionList-label crm-editable" data-field="label">{$row.label}</td>
             <td class="crm-report-optionList-value">{$row.value}</td>
             <td class="crm-report-optionList-description">{$row.description}</td>
-            <td class="nowrap crm-report-optionList-order">{$row.order}</td>
+            <td class="nowrap crm-report-optionList-order">{$row.weight}</td>
             {if $showIsDefault}
                 <td class="crm-report-optionList-default_value">{$row.default_value}</td>
             {/if}
@@ -69,7 +68,6 @@
           <td class="crm-report-optionList-is_active" id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
           <td class="crm-report-optionList-component_name">{$row.component_name}</td>
             <td class="crm-report-optionList-action">{$row.action}</td>
-                        <td class="order hiddenElement">{$row.weight}</td>
         </tr>
     {/foreach}
       </table>
index 9ff5e779d140231126c002c9c2a6c2ca438d61cd..c14f9d797a819953125ad401dbbecf907daadebb 100644 (file)
@@ -45,8 +45,7 @@
         {* handle enable/disable actions*}
    {include file="CRM/common/enableDisableApi.tpl"}
    {include file="CRM/common/crmeditable.tpl"}
-   {include file="CRM/common/jsortable.tpl"}
-        <table id="options" class="display">
+        <table id="options" class="row-highlight">
             <thead>
             <tr>
                 <th>{ts}Field Name{/ts}</th>
                 <th>{ts}Searchable?{/ts}</th>
                 <th>{ts}In Selector?{/ts}</th>
                 {/if}
-                <th id="order" class="sortable">{ts}Order{/ts}</th>
+                <th>{ts}Order{/ts}</th>
                 <th>{ts}Required{/ts}</th>
                 <th>{ts}View Only{/ts}</th>
                 <th>{ts}Reserved{/ts}</th>
                 <th></th>
-                <th class="hiddenElement"></th>
             </tr>
             </thead>
             {foreach from=$ufField item=row}
                 <td class="crmf-is_searchable">{if $row.is_searchable   eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
                 <td class="crmf-in_selector">{if $row.in_selector     eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
                 {/if}
-                <td class="nowrap">{$row.order}</td>
+                <td class="nowrap">{$row.weight}</td>
                 <td class="crmf-is_required">{if $row.is_required     eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
                 <td>{if $row.is_view         eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
                 <td>{if $row.is_reserved     eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
                 <td>{$row.action|replace:'xx':$row.id}</td>
-                <td class="order hiddenElement">{$row.weight}</td>
             </tr>
             {/foreach}
         </table>
index 44da77eec7a1e01ba57b183518985ff96681d19a..bfcb5b3995324f8679a778a7a3795bf99667ab53 100644 (file)
@@ -44,7 +44,6 @@
     
     // for date sorting see http://wiki.civicrm.org/confluence/display/CRMDOC/Sorting+Date+Fields+in+dataTables+Widget
     var useAjax = {/literal}{if $useAjax}1{else}0{/if}{literal};
-    var sortEnabled = true;
     var sourceUrl = '';
     var useClass  = 'display';
 
@@ -92,7 +91,6 @@
               sortColumn += '[' + count + ', "asc" ],';
             }
             sortId   = getRowId(tdObject, $(this).attr('id') +' hiddenElement' );
-            sortEnabled = true;
             columns += '{ "render": function ( data, type, row ) { return "<div style=\'display:none\'>"+ data +"</div>" + row[sortId] ; }, "targets": sortColumn,"bUseRendered": false},';
             break;
           case 'nosort':
           "asStripClasses" : [ "odd-row", "even-row" ],
           "bAutoWidth"   : false,
           "aoColumns"   : columns,
-          "bSort" : sortEnabled,
+          "bSort" : true,
           "oLanguage":{"sEmptyTable"  : noRecordFoundMsg,
             "sZeroRecords" : noRecordFoundMsg }
         });