Bugzilla – Attachment 119826 Details for
Bug 23243
Allow filtering out of historic subscription expirations in the check expiration of serials page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23243: Restore filtering out historic expired subscriptions
Bug-23243-Restore-filtering-out-historic-expired-s.patch (text/plain), 4.51 KB, created by
Katrin Fischer
on 2021-04-18 10:01:38 UTC
(
hide
)
Description:
Bug 23243: Restore filtering out historic expired subscriptions
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2021-04-18 10:01:38 UTC
Size:
4.51 KB
patch
obsolete
>From 04fc0e1b335a8f6139c5f023db9310ab5ff192a2 Mon Sep 17 00:00:00 2001 >From: Maxime Pelletier <pelletiermaxime@gmail.com> >Date: Mon, 11 Aug 2014 10:53:01 -0400 >Subject: [PATCH] Bug 23243: Restore filtering out historic expired > subscriptions >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >The 'Check Expiration' page in Serials is now hardcoded to display all >expired subscriptions before the entered date. This patch restores the >ability to limit the results to just those expiring between 'today' >and the date entered. > >Original code taken from bug 6968 autored by Maxime Pelletier, rebased >by Charles Farmer and then moved to a new report and rebased again by >Martin Renvoize. > >Test plan: >1) Without the patch any results after a search from this page will > result in matches both before after todays date (but before the date > you entered). >2) With the patch you should see a 'Show historic expirations' checkbox > which will allow you to limit the results to just those that expire > between the date you enter and today. > >Sponsored-by: CCSR >Rescued-by: Charles Farmer <charles.farmer@inlibro.com> >Rescued-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../prog/en/modules/serials/checkexpiration.tt | 9 ++++++++- > serials/checkexpiration.pl | 20 ++++++++++++-------- > 2 files changed, 20 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt >index a8753861fc..196516d02f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt >@@ -38,6 +38,7 @@ > <legend>Filter results:</legend> > > <ol> >+ <ol> > <li><label for="title">Title:</label> > <input id="title" type="text" name="title" size="15" value="[% title | html %]" /></li> > >@@ -57,7 +58,13 @@ > <span class="required">Required</span> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div></li> > </ol> >- >+ >+ <li> >+ <label for="showhistoricexpired">Include historic expirations:</label> >+ <input id="showhistoricexpired" type="checkbox" name="showhistoricexpired" >+ [% IF ( showhistoricexpired ) %] checked="checked" [% END %]/> >+ </li> >+ </ol> > </fieldset> > <fieldset class="action"><input type="submit" value="Search" /></fieldset> > </form> >diff --git a/serials/checkexpiration.pl b/serials/checkexpiration.pl >index 10d5dacc07..2b6f202134 100755 >--- a/serials/checkexpiration.pl >+++ b/serials/checkexpiration.pl >@@ -69,6 +69,7 @@ my $issn = $query->param('issn'); > my $branch = $query->param('branch'); > my $date = $query->param('date'); > $date = eval { dt_from_string( scalar $query->param('date') ) } if $date; >+my $showhistoricexpired = $query->param('showhistoryexpired'); > > if ($date) { > my @subscriptions = SearchSubscriptions({ title => $title, issn => $issn, orderby => 'title' }); >@@ -93,20 +94,23 @@ if ($date) { > next if $subscription->{cannotedit}; > > my $expirationdate_dt = dt_from_string( $expirationdate, 'iso' ); >+ my $today_dt = dt_from_string(); > if ( DateTime->compare( $date, $expirationdate_dt ) == 1 >+ && ( $showhistoricexpired || DateTime->compare( $expiration_dt, $today_dt ) == 1 ) > && ( !$branch || ( $subscription->{'branchcode'} eq $branch ) ) ) { > push @subscriptions_loop, $subscription; > } > } > >- $template->param ( >- title => $title, >- issn => $issn, >- numsubscription => scalar @subscriptions_loop, >- date => $date, >- subscriptions_loop => \@subscriptions_loop, >- "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1, >- searched => 1, >+ $template->param( >+ title => $title, >+ issn => $issn, >+ showhistoricexpired => $showhistoricexpired, >+ numsubscription => scalar @subscriptions_loop, >+ date => $date, >+ subscriptions_loop => \@subscriptions_loop, >+ "BiblioDefaultView" . C4::Context->preference("BiblioDefaultView") => 1, >+ searched => 1, > ); > } > >-- >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 23243
:
91138
|
96215
|
105491
|
105492
|
105493
|
119129
|
119130
|
119131
| 119826 |
119827
|
119828