From 55f5ccd9987859c56a78ff93d681cfaae70f9e35 Mon Sep 17 00:00:00 2001 From: charles Date: Mon, 11 Aug 2014 10:53:01 -0400 Subject: [PATCH] Patch sponsored by our client http://www.ccsr.qc.ca/ The page Check Expiration the in Serials section doesn't show items that expired before today. There is now a checkbox to add it as an option. Took back Maxime Pelletier's patch and applied it to current master. The variable 'showexpiredtoday' is not tested against the string 'on' anymore. modified: koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt modified: serials/checkexpiration.pl --- .../prog/en/modules/serials/checkexpiration.tt | 9 ++++++++- serials/checkexpiration.pl | 6 ++++-- 2 files changed, 12 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 95bfcb8..5fb909d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt @@ -46,6 +46,7 @@ Filter results :
    +
    1. @@ -57,7 +58,13 @@ Required
      [% INCLUDE 'date-format.inc' %]
    - + +
  1. + + +
  2. +
diff --git a/serials/checkexpiration.pl b/serials/checkexpiration.pl index e24210f..695b3c0 100755 --- a/serials/checkexpiration.pl +++ b/serials/checkexpiration.pl @@ -68,6 +68,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( my $title = $query->param('title'); my $issn = $query->param('issn'); my $date = format_date_in_iso($query->param('date')); +my $showexpiredtoday = $query->param('showexpiredtoday'); if ($date) { my @subscriptions = GetSubscriptions( $title, $issn ); @@ -78,10 +79,10 @@ if ($date) { my $expirationdate = GetExpirationDate($subscriptionid); $subscription->{expirationdate} = $expirationdate; - next if $expirationdate !~ /\d{4}-\d{2}-\d{2}/; # next if not in ISO format. + next if !$expirationdate || $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) ) { + ( $showexpiredtoday || (Date_to_Days(split "-",$expirationdate) > Date_to_Days(&Today)))) { $subscription->{expirationdate}=format_date($subscription->{expirationdate}); push @subscriptions_loop,$subscription; } @@ -90,6 +91,7 @@ if ($date) { $template->param ( title => $title, issn => $issn, + showexpiredtoday => $showexpiredtoday, numsubscription => scalar @subscriptions_loop, date => format_date($date), subscriptions_loop => \@subscriptions_loop, -- 1.7.9.5