View | Details | Raw Unified | Return to bug 6968
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt (-1 / +8 lines)
Lines 46-51 Link Here
46
    <legend>Filter results :</legend>
46
    <legend>Filter results :</legend>
47
    
47
    
48
         <ol>
48
         <ol>
49
        <ol>
49
        <li><label for="title">Title:</label>
50
        <li><label for="title">Title:</label>
50
        <input id="title" type="text" name="title" size="15" value="[% title %]" /></li>
51
        <input id="title" type="text" name="title" size="15" value="[% title %]" /></li>
51
52
Lines 57-63 Link Here
57
        <span class="required">Required</span>
58
        <span class="required">Required</span>
58
			<div class="hint">[% INCLUDE 'date-format.inc' %]</div></li>
59
			<div class="hint">[% INCLUDE 'date-format.inc' %]</div></li>
59
			</ol>
60
			</ol>
60
        
61
62
        <li>
63
            <label for="showexpiredtoday">Show expired before today:</label>
64
            <input id="showexpiredtoday" type="checkbox" name="showexpiredtoday"
65
            [% IF ( showexpiredtoday ) %] checked="checked" [% END %]/>
66
        </li>
67
        </ol>
61
</fieldset>
68
</fieldset>
62
<fieldset class="action"><input type="submit" value="Search" /></fieldset>
69
<fieldset class="action"><input type="submit" value="Search" /></fieldset>
63
</form>
70
</form>
(-)a/serials/checkexpiration.pl (-3 / +4 lines)
Lines 68-73 my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( Link Here
68
my $title = $query->param('title');
68
my $title = $query->param('title');
69
my $issn  = $query->param('issn');
69
my $issn  = $query->param('issn');
70
my $date  = format_date_in_iso($query->param('date'));
70
my $date  = format_date_in_iso($query->param('date'));
71
my $showexpiredtoday = $query->param('showexpiredtoday');
71
72
72
if ($date) {
73
if ($date) {
73
    my @subscriptions = GetSubscriptions( $title, $issn );
74
    my @subscriptions = GetSubscriptions( $title, $issn );
Lines 78-87 if ($date) { Link Here
78
        my $expirationdate = GetExpirationDate($subscriptionid);
79
        my $expirationdate = GetExpirationDate($subscriptionid);
79
80
80
        $subscription->{expirationdate} = $expirationdate;
81
        $subscription->{expirationdate} = $expirationdate;
81
        next if $expirationdate !~ /\d{4}-\d{2}-\d{2}/; # next if not in ISO format.
82
        next if !$expirationdate || $expirationdate !~ /\d{4}-\d{2}-\d{2}/; # next if not in ISO format.
82
        next if $subscription->{closed};
83
        next if $subscription->{closed};
83
        if ( Date_to_Days(split "-",$expirationdate) < Date_to_Days(split "-",$date) &&
84
        if ( Date_to_Days(split "-",$expirationdate) < Date_to_Days(split "-",$date) &&
84
			 Date_to_Days(split "-",$expirationdate) > Date_to_Days(&Today) ) {
85
           ( $showexpiredtoday || (Date_to_Days(split "-",$expirationdate) > Date_to_Days(&Today)))) {
85
            $subscription->{expirationdate}=format_date($subscription->{expirationdate});
86
            $subscription->{expirationdate}=format_date($subscription->{expirationdate});
86
            push @subscriptions_loop,$subscription;
87
            push @subscriptions_loop,$subscription;
87
        }
88
        }
Lines 90-95 if ($date) { Link Here
90
    $template->param (
91
    $template->param (
91
        title           => $title,
92
        title           => $title,
92
        issn            => $issn,
93
        issn            => $issn,
94
        showexpiredtoday => $showexpiredtoday,
93
        numsubscription => scalar @subscriptions_loop,
95
        numsubscription => scalar @subscriptions_loop,
94
        date => format_date($date),
96
        date => format_date($date),
95
        subscriptions_loop => \@subscriptions_loop,
97
        subscriptions_loop => \@subscriptions_loop,
96
- 

Return to bug 6968