From 7368075d1e3640396ed64a5ed342147a5d31fa22 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 11 Nov 2015 09:36:16 +0000 Subject: [PATCH] Bug 15171: Display subscriptions which will expire in the future MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Since the form on the subscription check expiration page let the user choose an expiration date > today, there is no sense to hide subscriptions which will expire in the future. Test plan: 0/ Make sure you have at least subscription with an expiration date > today 1/ Start a seach on the check expiration page (serials/checkexpiration.pl) with a date < today, = today and > today => The subscription won't never be displayed without this patch. With this patch, it will. Note that you will get a "No results for your query" message only if you have search for something. Followed testplan, works as expected. Signed-off-by: Marc Véron Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 78c1b0198841d832f8aca2c1a8e7d8baffe8a08c) Signed-off-by: Frédéric Demians --- .../intranet-tmpl/prog/en/modules/serials/checkexpiration.tt | 2 +- serials/checkexpiration.pl | 5 +++-- 2 files changed, 4 insertions(+), 3 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 95bfcb89fd..f26f6201f2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt @@ -113,7 +113,7 @@ [% END %] -[% ELSE %] +[% ELSIF searched %]

No results for your query

[% END %] diff --git a/serials/checkexpiration.pl b/serials/checkexpiration.pl index e5abce18b0..3ccd03feee 100755 --- a/serials/checkexpiration.pl +++ b/serials/checkexpiration.pl @@ -50,7 +50,7 @@ use C4::Serials; # GetExpirationDate use C4::Output; use C4::Context; use C4::Dates qw/format_date format_date_in_iso/; -use Date::Calc qw/Today Date_to_Days/; +use Date::Calc qw/Date_to_Days/; my $query = new CGI; @@ -81,7 +81,7 @@ if ($date) { next if $expirationdate !~ /\d{4}-\d{2}-\d{2}/; # next if not in ISO format. next if $subscription->{closed}; if ( Date_to_Days(split "-",$expirationdate) < Date_to_Days(split "-",$date) && - Date_to_Days(split "-",$expirationdate) > Date_to_Days(&Today) ) { + ( !$branch || ($subscription->{'branchcode'} eq $branch) ) ) { $subscription->{expirationdate}=format_date($subscription->{expirationdate}); push @subscriptions_loop,$subscription; } @@ -94,6 +94,7 @@ if ($date) { date => format_date($date), subscriptions_loop => \@subscriptions_loop, "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1, + searched => 1, ); } $template->param ( -- 2.39.5