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 24-29 Link Here
24
    <legend>Filter results:</legend>
24
    <legend>Filter results:</legend>
25
    
25
    
26
         <ol>
26
         <ol>
27
        <ol>
27
        <li><label for="title">Title:</label>
28
        <li><label for="title">Title:</label>
28
        <input id="title" type="text" name="title" size="15" value="[% title | html %]" /></li>
29
        <input id="title" type="text" name="title" size="15" value="[% title | html %]" /></li>
29
30
Lines 43-49 Link Here
43
        <span class="required">Required</span>
44
        <span class="required">Required</span>
44
			<div class="hint">[% INCLUDE 'date-format.inc' %]</div></li>
45
			<div class="hint">[% INCLUDE 'date-format.inc' %]</div></li>
45
			</ol>
46
			</ol>
46
        
47
48
        <li>
49
            <label for="showhistoricexpired">Include historic expirations:</label>
50
            <input id="showhistoricexpired" type="checkbox" name="showhistoricexpired"
51
            [% IF ( showhistoricexpired ) %] checked="checked" [% END %]/>
52
        </li>
53
        </ol>
47
</fieldset>
54
</fieldset>
48
<fieldset class="action"><input type="submit" value="Search" /></fieldset>
55
<fieldset class="action"><input type="submit" value="Search" /></fieldset>
49
</form>
56
</form>
(-)a/serials/checkexpiration.pl (-9 / +12 lines)
Lines 70-75 my $issn = $query->param('issn'); Link Here
70
my $branch = $query->param('branch');
70
my $branch = $query->param('branch');
71
my $date = $query->param('date');
71
my $date = $query->param('date');
72
$date = eval { dt_from_string( scalar $query->param('date') ) } if $date;
72
$date = eval { dt_from_string( scalar $query->param('date') ) } if $date;
73
my $showhistoricexpired = $query->param('showhistoryexpired');
73
74
74
if ($date) {
75
if ($date) {
75
    my @subscriptions = SearchSubscriptions({ title => $title, issn => $issn, orderby => 'title' });
76
    my @subscriptions = SearchSubscriptions({ title => $title, issn => $issn, orderby => 'title' });
Lines 94-113 if ($date) { Link Here
94
        next if $subscription->{cannotedit};
95
        next if $subscription->{cannotedit};
95
96
96
        my $expirationdate_dt = dt_from_string( $expirationdate, 'iso' );
97
        my $expirationdate_dt = dt_from_string( $expirationdate, 'iso' );
98
        my $today_dt = dt_from_string();
97
        if (   DateTime->compare( $date, $expirationdate_dt ) == 1
99
        if (   DateTime->compare( $date, $expirationdate_dt ) == 1
100
            && ( $showhistoricexpired || DateTime->compare( $expiration_dt, $today_dt ) == 1 )
98
            && ( !$branch || ( $subscription->{'branchcode'} eq $branch ) ) ) {
101
            && ( !$branch || ( $subscription->{'branchcode'} eq $branch ) ) ) {
99
            push @subscriptions_loop, $subscription;
102
            push @subscriptions_loop, $subscription;
100
        }
103
        }
101
    }
104
    }
102
105
103
    $template->param (
106
    $template->param(
104
        title           => $title,
107
        title               => $title,
105
        issn            => $issn,
108
        issn                => $issn,
106
        numsubscription => scalar @subscriptions_loop,
109
        showhistoricexpired => $showhistoricexpired,
107
        date => $date,
110
        numsubscription     => scalar @subscriptions_loop,
108
        subscriptions_loop => \@subscriptions_loop,
111
        date                => $date,
109
        "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
112
        subscriptions_loop  => \@subscriptions_loop,
110
        searched => 1,
113
        "BiblioDefaultView" . C4::Context->preference("BiblioDefaultView") => 1,
114
        searched                                                           => 1,
111
    );
115
    );
112
}
116
}
113
117
114
- 

Return to bug 23243