Bugzilla – Attachment 68087 Details for
Bug 9573
Ability to download items lost report
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9573: Lost items report - add KohaTable to itemlost
Bug-9573-Lost-items-report---add-KohaTable-to-item.patch (text/plain), 13.65 KB, created by
Jonathan Druart
on 2017-10-13 18:04:06 UTC
(
hide
)
Description:
Bug 9573: Lost items report - add KohaTable to itemlost
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-10-13 18:04:06 UTC
Size:
13.65 KB
patch
obsolete
>From d9288edd971fbbdf1b46b08c5985825d361b746a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 5 Oct 2017 14:35:24 -0300 >Subject: [PATCH] Bug 9573: Lost items report - add KohaTable to itemlost > >Before this patch set, we used KohaTable to display a table with the >column visibility plugin, and an usual dataTable initialisation for the >filters. >For the lost items report table we will need both. >To do so we need to reorganize the code a bit > >We cannot pass a selector but the id of the node which represents the >table. Indeed it is how works currently the filters (we may want to >improve that later) >--- > .../intranet-tmpl/prog/en/includes/columns_settings.inc | 12 +++++++----- > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 6 +++--- > .../intranet-tmpl/prog/en/modules/cataloguing/additem.tt | 2 +- > .../intranet-tmpl/prog/en/modules/circ/pendingreserves.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt | 2 +- > .../intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt | 2 +- > .../intranet-tmpl/prog/en/modules/members/boraccount.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt | 8 +++++--- > koha-tmpl/intranet-tmpl/prog/js/table_filters.js | 4 ++-- > 13 files changed, 26 insertions(+), 22 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >index 5d674bc0c1..1ee31b0739 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >@@ -2,12 +2,14 @@ > > <script type="text/javascript"> > function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { >- var id = 0; >+ var counter = 0; > var hidden_ids = []; > var included_ids = []; >+ var selector = '#' + id_selector; >+ > $(columns_settings).each( function() { > var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( 'th' ); >- var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : id; >+ var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : counter; > if ( used_id == -1 ) return; > > if ( this['is_hidden'] == "1" ) { >@@ -16,7 +18,7 @@ function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { > if ( this['cannot_be_toggled'] == "0" ) { > included_ids.push( used_id ); > } >- id++; >+ counter++; > }); > dt_parameters[ "buttons" ] = [ > { >@@ -26,7 +28,7 @@ function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { > } > ]; > >- var table = $('#' + id_selector + ' table'); >+ var table = $(selector); > if ( add_filters ) { > // Duplicate the table header row for columnFilter > thead_row = table.find('thead tr'); >@@ -46,7 +48,7 @@ function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { > link = $('<a>') > .attr('href', '#') > .attr('id', id_selector + '_activate_filters'); >- $("." + id_selector + "_table_controls").prepend(link); >+ $("." + id_selector + "_table_controls").prepend(link); > deactivate_filters(id_selector); > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt >index a3ef54aeca..5b92c0a656 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt >@@ -14,7 +14,7 @@ > var MSG_REMOVE_PATRON = _("Remove"); > $(document).ready(function() { > var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'histsearch', 'histsearcht', 'json' ) %]; >- KohaTable("#histsearcht", { >+ KohaTable("histsearcht", { > "aoColumnDefs": [ > { "sType": "anti-the", "aTargets" : [ "anti-the" ] }, > { "sType": "title-string", "aTargets" : [ "title-string" ] } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >index 2363765509..f0a9fa7ac7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >@@ -26,7 +26,7 @@ function check_uncheck() { > $(document).ready(function() { > > var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'lateorders', 'late_orders', 'json' ) %]; >- late_orderst = KohaTable("#late_orders", { >+ late_orderst = KohaTable("late_orders", { > "aoColumnDefs": [ > { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }, > { "sType": "anti-the", "aTargets" : [ "anti-the" ] }, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt >index d7285b8cf1..a8899806c7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt >@@ -26,7 +26,7 @@ > > $(document).ready(function() { > columns_settings = [% ColumnsSettings.GetColumns( 'admin', 'currency', 'currencies-table', 'json' ) %] >- var issuest = KohaTable("#currencies-table", { >+ var issuest = KohaTable("currencies-table", { > dom: 'B<"clearfix">t', > "columnDefs": [ > { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 2ef56d339f..0b9443573c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -310,7 +310,7 @@ > [% items_table_block_iter = 0 %] > [% BLOCK items_table %] > [% items_table_block_iter = items_table_block_iter + 1 %] >- <div class="[% tab %]_table_controls"> >+ <div class="[% tab %]_table_table_controls"> > [% IF (StaffDetailItemSelection) %] > | <a href="#" class="SelectAll" data-tab="[% tab %]"><i class="fa fa-check"></i> Select all</a> | > <a href="#" class="ClearAll" data-tab="[% tab %]"><i class="fa fa-remove"></i> Clear all</a> >@@ -325,7 +325,7 @@ > </span> > [% END %] > </div> >- <table class="items_table"> >+ <table class="items_table" id="[% tab %]_table"> > <thead> > <tr> > [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %] >@@ -1049,7 +1049,7 @@ > browser.show(); > > $(document).ready(function() { >- var ids = ['holdings', 'otherholdings']; >+ var ids = ['holdings_table', 'otherholdings_table']; > > for (var i in ids) { > var id = ids[i]; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >index 65f3101c50..5c8cac619e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -55,7 +55,7 @@ $(document).ready(function(){ > // Skip the first column > columns_settings.unshift( { cannot_be_toggled: "1" } ); > >- var itemst = KohaTable("#itemst", { >+ var itemst = KohaTable("itemst", { > "aoColumnDefs": [ > { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }, > ], >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >index 62cdc26ba9..9e69559572 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >@@ -15,7 +15,7 @@ > //<![CDATA[ > $(document).ready(function() { > var columns_settings = [% ColumnsSettings.GetColumns('circ', 'holds', 'holds-to-pull', 'json') %]; >- var holdst = KohaTable("#holdst", { >+ var holdst = KohaTable("holdst", { > "aoColumnDefs": [ > { "sType": "anti-the", "aTargets" : [ "anti-the" ] }, > { "sType": "title-string", "aTargets" : [ "title-string" ] }, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >index b3b5910342..1f336cab15 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -59,7 +59,7 @@ $(document).ready(function () { > [% END %] > > var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) %] >- var returns_table = KohaTable("#checkedintable", { >+ var returns_table = KohaTable("checkedintable", { > "bFilter":false, > "bPaginate":false, > "bInfo":false, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt >index 75411cc1b1..882a024401 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt >@@ -30,7 +30,7 @@ $(document).ready(function() { > $('#holdst thead input').on('change keyup keydown', filterColumn); > > var columns_settings = [% ColumnsSettings.GetColumns('circ', 'view_holdsqueue', 'holds-table', 'json') %]; >- var holdst = KohaTable("#holdst", { >+ var holdst = KohaTable("holdst", { > "aaSorting": [[ 3, "asc" ]], > "aoColumns": [ > { "sType": "anti-the" },null,null,null,null,null,null,null,null,{ "sType": "title-string" },null >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >index ec792375db..c03f6e9db3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -13,7 +13,7 @@ $(document).ready(function() { > var txtActivefilter = _("Filter paid transactions"); > var txtInactivefilter = _("Show all transactions"); > var columns_settings = [% ColumnsSettings.GetColumns('members', 'fines', 'account-fines', 'json') %]; >- var table_account_fines = KohaTable("#table_account_fines", { >+ var table_account_fines = KohaTable("table_account_fines", { > "sPaginationType": "four_button", > 'aaSorting': [[0, 'desc']], > "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>', >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >index 0c5e044d86..da1f67f887 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >@@ -166,7 +166,7 @@ $(document).ready(function() { > [%# Remove the first column if we do not display the checkbox %] > columns_settings.splice(0, 1); > [% END %] >- dtMemberResults = KohaTable("#memberresultst", { >+ dtMemberResults = KohaTable("memberresultst", { > 'bServerSide': true, > 'sAjaxSource': "/cgi-bin/koha/svc/members/search", > 'fnServerData': function(sSource, aoData, fnCallback) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt >index 327fe8e145..622f5b0846 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt >@@ -7,21 +7,23 @@ > [% INCLUDE 'doc-head-close.inc' %] > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> > [% INCLUDE 'datatables.inc' %] >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script> > [% INCLUDE 'columns_settings.inc' %] >+<script type="text/javascript" src="[% interface %]/[% theme %]/js/table_filters.js"></script> > <script type='text/javascript'> > //<![CDATA[ > $(document).ready(function() { > var columns_settings = [% ColumnsSettings.GetColumns( 'reports', 'lostitems', 'lostitems-table', 'json' ) %]; >- var lostitems_table = KohaTable("#lostitems-table", { >+ var lostitems_table = KohaTable("lostitems-table", { > "dom": 'B<"clearfix">t', > "aaSorting": [], > "aoColumnDefs": [ > { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, > { "sType": "title-string", "aTargets" : [ "title-string" ] } > ], >+ 'bAutoWidth': false, > "bPaginate": false, >- }, columns_settings); >- >+ }, columns_settings, 'with_filters'); > }); > //]]> > </script> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/table_filters.js b/koha-tmpl/intranet-tmpl/prog/js/table_filters.js >index a1a914ad25..6607120d35 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/table_filters.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/table_filters.js >@@ -1,5 +1,5 @@ > function activate_filters(id) { >- var table = $("#" + id + " table"); >+ var table = $("#" + id ); > if (table.length == 1) { > filters_row = table.find('thead tr.filters_row'); > >@@ -32,7 +32,7 @@ function activate_filters(id) { > } > > function deactivate_filters(id) { >- filters_row = $("#" + id + " table").find('thead tr.filters_row'); >+ filters_row = $("#" + id ).find('thead tr.filters_row'); > > filters_row.find('input[type="text"]') > .val('') // Empty filter text boxes >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9573
:
68085
|
68086
|
68087
|
68088
|
68089
|
68090
|
68184
|
68283
|
68351
|
68352
|
68353
|
68354
|
68355
|
68356
|
68357
|
68358
|
68398
|
68399
|
68400
|
68401
|
68402
|
68403
|
68404
|
68405
|
71275
|
71276
|
71277
|
71278
|
71279
|
71280
|
71281
|
71282
|
71872
|
71873
|
71874
|
71875
|
71876
|
71877
|
71878
|
71879
|
71880
|
71887
|
71888
|
71889
|
71890
|
71891
|
71892
|
71893
|
71894
|
71895