Bugzilla – Attachment 71888 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), 14.42 KB, created by
Katrin Fischer
on 2018-02-17 17:33:22 UTC
(
hide
)
Description:
Bug 9573: Lost items report - add KohaTable to itemlost
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2018-02-17 17:33:22 UTC
Size:
14.42 KB
patch
obsolete
>From b18bb04512c1fdd9f73f189b038764b1d1521dcf 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 >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >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) > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../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 | 3 +-- > 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(+), 23 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 5d674bc..1ee31b0 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 3b9e221..94ccbf3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt >@@ -216,7 +216,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 9c4b622..97797ad 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 4308b40..6441f95 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt >@@ -235,7 +235,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 a990c80..1cf0f81 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 %] >@@ -1039,7 +1039,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 5b90d9a..8df082e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -58,7 +58,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 200f95c..b706e8f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt >@@ -155,7 +155,7 @@ > <script type="text/javascript"> > $(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 2d4f805..f18ea69 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -715,7 +715,7 @@ > [% 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 ca497e7..80ff386 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 >@@ -215,7 +215,7 @@ > $('#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 c13bbbb..158470f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -131,7 +131,7 @@ > 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 efa97c1..ad73084 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >@@ -5,7 +5,6 @@ > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Patrons [% IF ( searching ) %]› Search results[% END %]</title> >-[% INCLUDE 'doc-head-close.inc' %] > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" /> > </head> > >@@ -382,7 +381,7 @@ > [%# 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 b88ead7..e5e3866 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt >@@ -141,20 +141,22 @@ > > [% MACRO jsinclude BLOCK %] > [% 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'> > $(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> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/table_filters.js b/koha-tmpl/intranet-tmpl/prog/js/table_filters.js >index a1a914a..6607120 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.1.4
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