From e5e1786f6957192f0fc0443f8a94813f97083dbe Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sat, 9 Aug 2014 16:23:36 +0100 Subject: [PATCH] CRM-13819 - Remove jsortable from tables with weight controls --- templates/CRM/Admin/Page/LabelFormats.tpl | 15 ++++++--------- templates/CRM/Admin/Page/Options.tpl | 9 +++------ templates/CRM/Admin/Page/PdfFormats.tpl | 13 +++++-------- templates/CRM/Campaign/Page/SurveyType.tpl | 11 ++++------- templates/CRM/Custom/Page/Field.tpl | 9 +++------ templates/CRM/Custom/Page/Group.tpl | 9 +++------ templates/CRM/Member/Page/MembershipType.tpl | 9 +++------ templates/CRM/Price/Page/Field.tpl | 11 ++++------- templates/CRM/Price/Page/Option.tpl | 7 ++----- templates/CRM/Report/Page/Options.tpl | 10 ++++------ templates/CRM/UF/Page/Field.tpl | 9 +++------ templates/CRM/common/jsortable.tpl | 4 +--- 12 files changed, 41 insertions(+), 75 deletions(-) diff --git a/templates/CRM/Admin/Page/LabelFormats.tpl b/templates/CRM/Admin/Page/LabelFormats.tpl index 218f5c271b..f300210fe5 100644 --- a/templates/CRM/Admin/Page/LabelFormats.tpl +++ b/templates/CRM/Admin/Page/LabelFormats.tpl @@ -35,17 +35,15 @@ {if $rows}
{strip} - {include file="CRM/common/jsortable.tpl"} - +
- - - + + + + - - @@ -53,13 +51,12 @@ + - - {/foreach} diff --git a/templates/CRM/Admin/Page/Options.tpl b/templates/CRM/Admin/Page/Options.tpl index 2c23219f92..b68715bead 100644 --- a/templates/CRM/Admin/Page/Options.tpl +++ b/templates/CRM/Admin/Page/Options.tpl @@ -79,8 +79,7 @@ {strip} {* handle enable/disable actions*} {include file="CRM/common/enableDisableApi.tpl"} - {include file="CRM/common/jsortable.tpl"} -
{ts}Name{/ts}{ts}Used for{/ts}{ts}Grouping{/ts}{ts}Name{/ts}{ts}Used for{/ts}{ts}Order{/ts}{ts}Grouping{/ts} {ts}Default?{/ts} {ts}Reserved?{/ts}{ts}Order{/ts}
{$row.label} {$row.groupName}{$row.weight} {$row.grouping} {if $row.is_default eq 1}{ts}Default{/ts}{/if}  {if $row.is_reserved eq 1}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}  {$row.order}{$row.weight} {$row.action|replace:'xx':$row.id}
+
{if $showComponent} @@ -111,11 +110,10 @@ {if $showCounted}{/if} {if $showVisibility}{/if} - + {if $showIsDefault}{/if} - @@ -138,14 +136,13 @@ {/if} {if $showVisibility}{/if} - + {if $showIsDefault} {/if} - {/foreach} diff --git a/templates/CRM/Admin/Page/PdfFormats.tpl b/templates/CRM/Admin/Page/PdfFormats.tpl index bbd64c962f..8fc34c94d7 100644 --- a/templates/CRM/Admin/Page/PdfFormats.tpl +++ b/templates/CRM/Admin/Page/PdfFormats.tpl @@ -35,15 +35,13 @@ {if $rows}
{strip} - {include file="CRM/common/jsortable.tpl"} -
{ts}Counted?{/ts}{ts}Visibility{/ts}{ts}Description{/ts}{ts}Order{/ts}{ts}Order{/ts}{ts}Default{/ts}{ts}Reserved{/ts} {ts}Enabled?{/ts}
{$row.visibility_label}{$row.description}{$row.order}{$row.weight}{if $row.is_default eq 1}{ts}Default{/ts}{/if} {if $row.is_reserved eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {$row.action|replace:'xx':$row.id}{$row.weight}
+
- - + + - - + @@ -52,8 +50,7 @@ - - + {/foreach} diff --git a/templates/CRM/Campaign/Page/SurveyType.tpl b/templates/CRM/Campaign/Page/SurveyType.tpl index 2724483a84..129ba414fb 100644 --- a/templates/CRM/Campaign/Page/SurveyType.tpl +++ b/templates/CRM/Campaign/Page/SurveyType.tpl @@ -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"} -
{ts}Name{/ts}{ts}Description{/ts}{ts}Name{/ts}{ts}Description{/ts} {ts}Default?{/ts}{ts}Order{/ts}{ts}Order{/ts}
{$row.name} {$row.description} {if $row.is_default eq 1}{ts}Default{/ts}{/if} {$row.order}{$row.weight}{$row.weight} {$row.action|replace:'xx':$row.id}
+
- - + + - {foreach from=$rows item=row} @@ -35,11 +33,10 @@ - + - {/foreach}
@@ -22,12 +21,11 @@ {ts}Value{/ts} {ts}Description{/ts}{ts}Order{/ts}{ts}Description{/ts}{ts}Order{/ts} {ts}Reserved{/ts} {ts}Enabled?{/ts}
{$row.label} {$row.value} {$row.description}{$row.order}{$row.weight} {if $row.is_reserved eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {$row.action|replace:'xx':$row.id}{$row.weight}
diff --git a/templates/CRM/Custom/Page/Field.tpl b/templates/CRM/Custom/Page/Field.tpl index 14f9a511e3..24e2378a59 100644 --- a/templates/CRM/Custom/Page/Field.tpl +++ b/templates/CRM/Custom/Page/Field.tpl @@ -36,19 +36,17 @@ {strip} {* handle enable/disable actions*} {include file="CRM/common/enableDisableApi.tpl"} - {include file="CRM/common/jsortable.tpl"} - +
- + - @@ -57,12 +55,11 @@ - + - {/foreach} diff --git a/templates/CRM/Custom/Page/Group.tpl b/templates/CRM/Custom/Page/Group.tpl index 117c217ed1..90e9170210 100644 --- a/templates/CRM/Custom/Page/Group.tpl +++ b/templates/CRM/Custom/Page/Group.tpl @@ -42,18 +42,16 @@ {* handle enable/disable actions*} {include file="CRM/common/enableDisableApi.tpl"} {include file="CRM/common/crmeditable.tpl"} - {include file="CRM/common/jsortable.tpl"} -
{ts}Field Label{/ts} {ts}Data Type{/ts} {ts}Field Type{/ts}{ts}Order{/ts}{ts}Order{/ts} {ts}Req?{/ts} {ts}Searchable?{/ts} {ts}Enabled?{/ts}
{$row.label} {$row.data_type} {$row.html_type}{$row.order}{$row.weight} {if $row.is_required eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {if $row.is_searchable eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {$row.action|replace:'xx':$row.id}{$row.weight}
+
- + - @@ -63,10 +61,9 @@ - + - {/foreach} diff --git a/templates/CRM/Member/Page/MembershipType.tpl b/templates/CRM/Member/Page/MembershipType.tpl index 1ba52d061f..1dcdbf63b9 100644 --- a/templates/CRM/Member/Page/MembershipType.tpl +++ b/templates/CRM/Member/Page/MembershipType.tpl @@ -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"} -
{ts}Set{/ts} {ts}Enabled?{/ts} {ts}Used For{/ts} {ts}Type{/ts}{ts}Order{/ts}{ts}Order{/ts} {ts}Style{/ts}
{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {if $row.extends eq 'Contact'}{ts}All Contact Types{/ts}{else}{$row.extends_display}{/if} {$row.extends_entity_column_value}{$row.order}{$row.weight} {$row.style_display} {$row.action|replace:'xx':$row.id}{$row.weight}
+
@@ -49,10 +48,9 @@ - + - {foreach from=$rows item=row} @@ -66,10 +64,9 @@ - + - {/foreach}
{ts}Membership{/ts}{ts}Related{/ts} {ts}Max{/ts} {ts}Visibility{/ts}{ts}Order{/ts}{ts}Order{/ts} {ts}Enabled?{/ts}
{$row.relationshipTypeName} {$row.visibility}{$row.order}{$row.weight} {if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {$row.action|replace:'xx':$row.id}{$row.weight}
diff --git a/templates/CRM/Price/Page/Field.tpl b/templates/CRM/Price/Page/Field.tpl index 84159ad0ce..424be8aa98 100644 --- a/templates/CRM/Price/Page/Field.tpl +++ b/templates/CRM/Price/Page/Field.tpl @@ -57,34 +57,31 @@ {* handle enable/disable actions*} {include file="CRM/common/enableDisableApi.tpl"} {include file="CRM/common/crmeditable.tpl"} - {include file="CRM/common/jsortable.tpl"} - +
- + - + - {foreach from=$priceField key=fid item=row} - + - {/foreach}
{ts}Field Label{/ts} {ts}Field Type{/ts}{ts}Order{/ts}{ts}Order{/ts} {ts}Req?{/ts} {ts}Enabled?{/ts} {ts}Active On{/ts} {ts}Expire On{/ts}{ts}Price{/ts}{ts}Price{/ts}
{$row.label} {$row.html_type}{$row.order}{$row.weight} {if $row.is_required eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {if $row.active_on}{$row.active_on|date_format:"%Y-%m-%d %T"}{/if} {if $row.expire_on}{$row.expire_on|date_format:"%Y-%m-%d %T"}{/if} {if $row.html_type eq "Text / Numeric Quantity"}{$row.price|crmMoney}{else}{if $isReserved}{ts}View Price Options{/ts}{else}{ts}Edit Price Options{/ts}{/if}{/if} {$row.action|replace:'xx':$row.id}{$row.weight}
diff --git a/templates/CRM/Price/Page/Option.tpl b/templates/CRM/Price/Page/Option.tpl index 7419811118..99d3d0270e 100644 --- a/templates/CRM/Price/Page/Option.tpl +++ b/templates/CRM/Price/Page/Option.tpl @@ -52,18 +52,16 @@ {* handle enable/disable actions*} {include file="CRM/common/enableDisableApi.tpl"} {include file="CRM/common/crmeditable.tpl"} - {include file="CRM/common/jsortable.tpl"} - +
- + - {foreach from=$customOption item=row} @@ -75,7 +73,6 @@ - {/foreach} diff --git a/templates/CRM/Report/Page/Options.tpl b/templates/CRM/Report/Page/Options.tpl index db9c22b103..e4898a0ae6 100644 --- a/templates/CRM/Report/Page/Options.tpl +++ b/templates/CRM/Report/Page/Options.tpl @@ -38,14 +38,13 @@ {* handle enable/disable actions*} {include file="CRM/common/enableDisableApi.tpl"} {include file="CRM/common/crmeditable.tpl"} - {include file="CRM/common/jsortable.tpl"} -
{ts}Option Label{/ts} {ts}Option Amount{/ts} {ts}Default{/ts} {ts}Financial Type{/ts}{ts}Order{/ts}{ts}Order{/ts} {ts}Enabled?{/ts}
{$row.weight} {if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {$row.action|replace:'xx':$row.id}{$row.weight}
+
- - + + {if $showIsDefault} {/if} @@ -61,7 +60,7 @@ - + {if $showIsDefault} {/if} @@ -69,7 +68,6 @@ - {/foreach}
{ts}Label{/ts} {ts}URL{/ts}{ts}Description{/ts}{ts}Order{/ts}{ts}Description{/ts}{ts}Order{/ts}{ts}Default{/ts}{$row.label} {$row.value} {$row.description}{$row.order}{$row.weight}{$row.default_value}{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {$row.component_name} {$row.action}{$row.weight}
diff --git a/templates/CRM/UF/Page/Field.tpl b/templates/CRM/UF/Page/Field.tpl index 9ff5e779d1..c14f9d797a 100644 --- a/templates/CRM/UF/Page/Field.tpl +++ b/templates/CRM/UF/Page/Field.tpl @@ -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"} - +
@@ -55,12 +54,11 @@ {/if} - + - {foreach from=$ufField item=row} @@ -71,12 +69,11 @@ {/if} - + - {/foreach}
{ts}Field Name{/ts}{ts}Searchable?{/ts} {ts}In Selector?{/ts}{ts}Order{/ts}{ts}Order{/ts} {ts}Required{/ts} {ts}View Only{/ts} {ts}Reserved{/ts}
{if $row.is_searchable eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {if $row.in_selector eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}{$row.order}{$row.weight} {if $row.is_required eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {if $row.is_view eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {if $row.is_reserved eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {$row.action|replace:'xx':$row.id}{$row.weight}
diff --git a/templates/CRM/common/jsortable.tpl b/templates/CRM/common/jsortable.tpl index 44da77eec7..bfcb5b3995 100644 --- a/templates/CRM/common/jsortable.tpl +++ b/templates/CRM/common/jsortable.tpl @@ -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 "
"+ data +"
" + row[sortId] ; }, "targets": sortColumn,"bUseRendered": false},'; break; case 'nosort': @@ -177,7 +175,7 @@ "asStripClasses" : [ "odd-row", "even-row" ], "bAutoWidth" : false, "aoColumns" : columns, - "bSort" : sortEnabled, + "bSort" : true, "oLanguage":{"sEmptyTable" : noRecordFoundMsg, "sZeroRecords" : noRecordFoundMsg } }); -- 2.25.1