Bugzilla – Attachment 45096 Details for
Bug 15235
Add column filters to checkouts table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15235: Add column filters to checkouts table
Bug-15235-Add-column-filters-to-checkouts-table.patch (text/plain), 9.09 KB, created by
Julian Maurice
on 2015-11-23 07:52:07 UTC
(
hide
)
Description:
Bug 15235: Add column filters to checkouts table
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2015-11-23 07:52:07 UTC
Size:
9.09 KB
patch
obsolete
>From 489c81054edf73807a516aec8c4ed471c4fdfa4e Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 20 Nov 2015 15:47:47 +0100 >Subject: [PATCH] Bug 15235: Add column filters to checkouts table > >This adds a switch that allow to enable/disable column filters on >checkouts table (disabled by default) > >Depends on bug 15219 >--- > .../plugins/jquery.dataTables.columnFilter.js | 2 +- > koha-tmpl/intranet-tmpl/prog/en/css/datatables.css | 11 ++++ > .../prog/en/includes/checkouts-table.inc | 19 +++++++ > .../intranet-tmpl/prog/en/includes/strings.inc | 1 + > koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 63 ++++++++++++++++++++++ > .../prog/en/modules/circ/circulation.tt | 1 + > .../prog/en/modules/members/moremember.tt | 1 + > 7 files changed, 97 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.dataTables.columnFilter.js b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.dataTables.columnFilter.js >index 89343f5..342ecd0 100644 >--- a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.dataTables.columnFilter.js >+++ b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.dataTables.columnFilter.js >@@ -250,7 +250,6 @@ > //th.html(_fnRangeLabelPart(0)); > var sFromId = oTable.attr("id") + '_range_from_' + i; > var from = $('<input type="text" class="date_range_filter" id="' + sFromId + '" rel="' + i + '"/>'); >- from.datepicker(); > //th.append(from); > //th.append(_fnRangeLabelPart(1)); > var sToId = oTable.attr("id") + '_range_to_' + i; >@@ -275,6 +274,7 @@ > > > th.wrapInner('<span class="filter_column filter_date_range" />'); >+ from.datepicker(); > to.datepicker(); > var index = i; > aiCustomSearch_Indexes.push(i); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/datatables.css b/koha-tmpl/intranet-tmpl/prog/en/css/datatables.css >index 1f92947..b4a6ae0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/css/datatables.css >+++ b/koha-tmpl/intranet-tmpl/prog/en/css/datatables.css >@@ -243,6 +243,17 @@ span.filter_column > input.text_filter { > font-size: 80%; > width: 100%; > padding: 0; >+ box-sizing: border-box; >+} >+ >+span.filter_column.filter_date_range { >+ white-space: nowrap; >+} >+ >+span.filter_column > input.date_range_filter { >+ font-size: 80%; >+ width: 6em; >+ padding: 0; > } > > /* Row grouping */ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >index ce2f0e9..67f53c5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >@@ -8,6 +8,25 @@ > <form name="issues" action="/cgi-bin/koha/tools/export.pl" method="post" class="checkboxed"> > <table id="issues-table" style="width: 100% !Important;"> > <thead> >+ <tr class="filters_row" style="display: none"> >+ <th> </th> >+ <th> </th> >+ <th> </th> >+ <th>Due date</th> >+ <th>Due date</th> >+ <th>Title</th> >+ <th>Item type</th> >+ <th>Location</th> >+ <th>Checked out on</th> >+ <th>Checked out from</th> >+ <th>Call no</th> >+ <th> </th> >+ <th> </th> >+ <th> </th> >+ <th> </th> >+ <th> </th> >+ <th> </th> >+ </tr> > <tr> > <th scope="col"> </th> > <th scope="col"> </th> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc >index 73a3f60..35e6053 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc >@@ -31,5 +31,6 @@ > var YES = _("Yes"); > var INHOUSE_USE = _("On-site checkout"); > var GROUP_TODAYS_CHECKOUTS = _("Group today's checkouts"); >+ var SHOW_COLUMN_FILTERS = _("Show column filters"); > //]]> > </script> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js >index ed09beb..8cfbf2e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js >@@ -21,6 +21,50 @@ function disableGrouping(datatable) { > } > } > >+function enableFiltering(datatable) { >+ var oSettings = datatable.fnSettings(); >+ var filters_row = $(oSettings.nTable).find('thead tr.filters_row'); >+ if (!filters_row.hasClass('columnFilter')) { >+ datatable.columnFilter({ >+ sPlaceHolder: "head:after", >+ bUseColVis: true, >+ sRangeFormat: "From {from}<br>to {to}", >+ aoColumns: [ >+ null, >+ null, >+ null, >+ null, >+ { type: "date-range" }, >+ { type: "text" }, >+ { type: "text" }, >+ { type: "text" }, >+ { type: "date-range" }, >+ { type: "text" }, >+ { type: "text" }, >+ null, >+ null, >+ null, >+ null, >+ null, >+ null, >+ null >+ ] >+ }); >+ filters_row.addClass('columnFilter'); >+ } >+ filters_row.show(); >+} >+ >+function disableFiltering(datatable) { >+ var oSettings = datatable.fnSettings(); >+ var filters_row = $(oSettings.nTable).find('thead tr.filters_row'); >+ filters_row.find('input[type="text"]') >+ .val('') // Empty filter text boxes >+ .trigger('keyup') // Filter (display all rows) >+ .trigger('blur'); // Reset value to the column name >+ filters_row.hide(); >+} >+ > function loadTableData(datatable, borrowernumbers, offset, count) { > offset = offset ? offset : 0; > count = count ? count : 100; >@@ -522,6 +566,25 @@ $(document).ready(function() { > .append('<label for="issues-table-row-grouping-switch">' + GROUP_TODAYS_CHECKOUTS + '</label>') > .appendTo('#issues-table_wrapper .top.pager'); > >+ var filteringSwitch = $('<input type="checkbox">') >+ .attr('id', 'issues-table-filtering-switch') >+ .css('vertical-align', 'middle') >+ .change(function() { >+ if ($(this).is(':checked')) { >+ enableFiltering(issuesTable); >+ } else { >+ disableFiltering(issuesTable); >+ } >+ }); >+ $('<div></div>') >+ .css('float', 'left') >+ .css('padding', '0.3em 0.5em') >+ .css('line-height', '1.9em') >+ .append(filteringSwitch) >+ .append(' ') >+ .append('<label for="issues-table-filtering-switch">' + SHOW_COLUMN_FILTERS + '</label>') >+ .appendTo('#issues-table_wrapper .top.pager'); >+ > loadTableData(issuesTable, borrowernumber); > > if ( $("#issues-table").length ) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 1c5ceba..1093922 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -25,6 +25,7 @@ > <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script> > [% INCLUDE 'timepicker.inc' %] > <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script> > <script type="text/javascript" src="[% themelang %]/js/pages/circulation.js"></script> > <script type="text/javascript" src="[% themelang %]/js/checkouts.js"></script> > <script type="text/javascript" src="[% themelang %]/js/holds.js"></script> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index b34e666..4e54f52 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -22,6 +22,7 @@ > <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script> > [% INCLUDE 'timepicker.inc' %] > <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script> > <script type="text/javascript" src="[% themelang %]/js/pages/circulation.js"></script> > <script type="text/javascript" src="[% themelang %]/js/checkouts.js"></script> > <script type="text/javascript" src="[% themelang %]/js/holds.js"></script> >-- >1.9.1
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 15235
:
45096
|
60079
|
61160
|
72908
|
79205
|
79206