Bugzilla – Attachment 85040 Details for
Bug 20600
Provide the ability for users to filter ILL requests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20600: (follow-up) Add date range filtering
Bug-20600-follow-up-Add-date-range-filtering.patch (text/plain), 6.58 KB, created by
Andrew Isherwood
on 2019-02-13 09:18:03 UTC
(
hide
)
Description:
Bug 20600: (follow-up) Add date range filtering
Filename:
MIME Type:
Creator:
Andrew Isherwood
Created:
2019-02-13 09:18:03 UTC
Size:
6.58 KB
patch
obsolete
>From 77f57d563c5d1544c2ebc1ca0e0a5bfb4153c8e9 Mon Sep 17 00:00:00 2001 >From: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> >Date: Mon, 4 Jun 2018 12:43:37 +0100 >Subject: [PATCH] Bug 20600: (follow-up) Add date range filtering > >It makes more sense to be able to filter placed and updated dates by >range. This patch adds that. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../intranet-tmpl/prog/css/src/staff-global.scss | 6 +- > .../prog/en/modules/ill/ill-requests.tt | 77 ++++++++++++---------- > 2 files changed, 45 insertions(+), 38 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >index c1afe41fd4..eaf0ffcb6c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >+++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >@@ -4093,8 +4093,10 @@ span { > } > } > >-#illfilter_dateplaced, >-#illfilter_datemodified { >+#illfilter_dateplaced_start, >+#illfilter_datemodified_start, >+#illfilter_dateplaced_end, >+#illfilter_datemodified_end { > width: 80%; > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >index 293935f479..cfc5e590d2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >@@ -154,43 +154,13 @@ > } > }, > dateModified: { >- listener: function() { >- var me = 'dateModified'; >- $('#illfilter_datemodified').change(function() { >- var val = $('#illfilter_datemodified').val(); >- if (val && val.length > 0) { >- activeFilters[me] = function() { >- table.column(10).search(val); >- } >- } else { >- if (activeFilters.hasOwnProperty(me)) { >- delete activeFilters[me]; >- } >- } >- }); >- }, > clear: function() { >- $('#illfilter_datemodified').val(''); >+ $('#illfilter_datemodified_start, #illfilter_datemodified_end').val(''); > } > }, > datePlaced: { >- listener: function() { >- var me = 'datePlaced'; >- $('#illfilter_dateplaced').change(function() { >- var val = $('#illfilter_dateplaced').val(); >- if (val && val.length > 0) { >- activeFilters[me] = function() { >- table.column(8).search(val); >- } >- } else { >- if (activeFilters.hasOwnProperty(me)) { >- delete activeFilters[me]; >- } >- } >- }); >- }, > clear: function() { >- $('#illfilter_dateplaced').val(''); >+ $('#illfilter_dateplaced_start, #illfilter_dateplaced_end').val(''); > } > } > }; >@@ -484,6 +454,33 @@ > } > })); > >+ // Custom date range filtering >+ $.fn.dataTable.ext.search.push(function(settings, data, dataIndex) { >+ var placedStart = $('#illfilter_dateplaced_start').datepicker('getDate'); >+ var placedEnd = $('#illfilter_dateplaced_end').datepicker('getDate'); >+ var modifiedStart = $('#illfilter_datemodified_start').datepicker('getDate'); >+ var modifiedEnd = $('#illfilter_datemodified_end').datepicker('getDate'); >+ var rowPlaced = data[8] ? new Date(data[8]) : null; >+ var rowModified = data[10] ? new Date(data[10]) : null; >+ var placedPassed = true; >+ var modifiedPassed = true; >+ if (placedStart && rowPlaced && rowPlaced < placedStart) { >+ placedPassed = false >+ }; >+ if (placedEnd && rowPlaced && rowPlaced > placedEnd) { >+ placedPassed = false; >+ } >+ if (modifiedStart && rowModified && rowModified < modifiedStart) { >+ modifiedPassed = false >+ }; >+ if (modifiedEnd && rowModified && rowModified > modifiedEnd) { >+ modifiedPassed = false; >+ } >+ >+ return placedPassed && modifiedPassed; >+ >+ }); >+ > } > ); > >@@ -553,12 +550,20 @@ > </select> > </li> > <li> >- <label for="illfilter_dateplaced">Date placed:</label> >- <input type="text" name="illfilter_dateplaced" id="illfilter_dateplaced" class="datepicker"> >+ <label for="illfilter_dateplaced_start">Date placed between:</label> >+ <input type="text" name="illfilter_dateplaced_start" id="illfilter_dateplaced_start" class="datepicker"> >+ </li> >+ <li> >+ <label for="illfilter_dateplaced_end">and:</label> >+ <input type="text" name="illfilter_dateplaced_end" id="illfilter_dateplaced_end" class="datepicker"> >+ </li> >+ <li> >+ <label for="illfilter_datemodified_start">Updated between:</label> >+ <input type="text" name="illfilter_datemodified_start" id="illfilter_datemodified_start" class="datepicker"> > </li> > <li> >- <label for="illfilter_datemodified">Updated on:</label> >- <input type="text" name="illfilter_datemodified" id="illfilter_datemodified" class="datepicker"> >+ <label for="illfilter_datemodified_end">and:</label> >+ <input type="text" name="illfilter_datemodified_end" id="illfilter_datemodified_end" class="datepicker"> > </li> > <li> > <label for="illfilter_branchname">Library:</label> >-- >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 20600
:
74640
|
74641
|
75202
|
75276
|
75734
|
75735
|
75753
|
75755
|
75844
|
75845
|
75848
|
75849
|
75850
|
75851
|
75852
|
75853
|
75854
|
75871
|
77691
|
77692
|
77693
|
77694
|
77695
|
77696
|
77697
|
78439
|
78440
|
78441
|
78442
|
78443
|
78444
|
78445
|
78446
|
78463
|
78464
|
78465
|
78466
|
78467
|
78468
|
78469
|
78470
|
79183
|
80468
|
81992
|
81993
|
82032
|
82033
|
82034
|
82035
|
82036
|
82037
|
82038
|
82039
|
82062
|
82170
|
82171
|
82432
|
82433
|
82434
|
82435
|
82436
|
82437
|
82438
|
82439
|
82440
|
82441
|
82442
|
83882
|
83887
|
84736
|
84737
|
84738
|
84739
|
84740
|
84741
|
84742
|
84743
|
84744
|
84745
|
84746
|
84747
|
84748
|
84749
|
85037
|
85038
|
85039
| 85040 |
85041
|
85042
|
85043
|
85044
|
85045
|
85046
|
85047
|
85048
|
85049
|
85050