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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt (-1 / +8 lines)
Lines 38-43 Link Here
38
    <legend>Filter results:</legend>
38
    <legend>Filter results:</legend>
39
    
39
    
40
         <ol>
40
         <ol>
41
        <ol>
41
        <li><label for="title">Title:</label>
42
        <li><label for="title">Title:</label>
42
        <input id="title" type="text" name="title" size="15" value="[% title | html %]" /></li>
43
        <input id="title" type="text" name="title" size="15" value="[% title | html %]" /></li>
43
44
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="showhistoricexpired">Include historic expirations:</label>
64
            <input id="showhistoricexpired" type="checkbox" name="showhistoricexpired"
65
            [% IF ( showhistoricexpired ) %] 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 (-9 / +12 lines)
Lines 69-74 my $issn = $query->param('issn'); Link Here
69
my $branch = $query->param('branch');
69
my $branch = $query->param('branch');
70
my $date = $query->param('date');
70
my $date = $query->param('date');
71
$date = eval { dt_from_string( scalar $query->param('date') ) } if $date;
71
$date = eval { dt_from_string( scalar $query->param('date') ) } if $date;
72
my $showhistoricexpired = $query->param('showhistoryexpired');
72
73
73
if ($date) {
74
if ($date) {
74
    my @subscriptions = SearchSubscriptions({ title => $title, issn => $issn, orderby => 'title' });
75
    my @subscriptions = SearchSubscriptions({ title => $title, issn => $issn, orderby => 'title' });
Lines 93-112 if ($date) { Link Here
93
        next if $subscription->{cannotedit};
94
        next if $subscription->{cannotedit};
94
95
95
        my $expirationdate_dt = dt_from_string( $expirationdate, 'iso' );
96
        my $expirationdate_dt = dt_from_string( $expirationdate, 'iso' );
97
        my $today_dt = dt_from_string();
96
        if (   DateTime->compare( $date, $expirationdate_dt ) == 1
98
        if (   DateTime->compare( $date, $expirationdate_dt ) == 1
99
            && ( $showhistoricexpired || DateTime->compare( $expiration_dt, $today_dt ) == 1 )
97
            && ( !$branch || ( $subscription->{'branchcode'} eq $branch ) ) ) {
100
            && ( !$branch || ( $subscription->{'branchcode'} eq $branch ) ) ) {
98
            push @subscriptions_loop, $subscription;
101
            push @subscriptions_loop, $subscription;
99
        }
102
        }
100
    }
103
    }
101
104
102
    $template->param (
105
    $template->param(
103
        title           => $title,
106
        title               => $title,
104
        issn            => $issn,
107
        issn                => $issn,
105
        numsubscription => scalar @subscriptions_loop,
108
        showhistoricexpired => $showhistoricexpired,
106
        date => $date,
109
        numsubscription     => scalar @subscriptions_loop,
107
        subscriptions_loop => \@subscriptions_loop,
110
        date                => $date,
108
        "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
111
        subscriptions_loop  => \@subscriptions_loop,
109
        searched => 1,
112
        "BiblioDefaultView" . C4::Context->preference("BiblioDefaultView") => 1,
113
        searched                                                           => 1,
110
    );
114
    );
111
}
115
}
112
116
113
- 

Return to bug 23243