<legend>Filter results:</legend>
<ol>
+ <ol>
<li><label for="title">Title:</label>
<input id="title" type="text" name="title" size="15" value="[% title | html %]" /></li>
<span class="required">Required</span>
<div class="hint">[% INCLUDE 'date-format.inc' %]</div></li>
</ol>
-
+
+ <li>
+ <label for="showhistoricexpired">Include historic expirations:</label>
+ <input id="showhistoricexpired" type="checkbox" name="showhistoricexpired"
+ [% IF ( showhistoricexpired ) %] checked="checked" [% END %]/>
+ </li>
+ </ol>
</fieldset>
<fieldset class="action"><input type="submit" value="Search" /></fieldset>
</form>
my $branch = $query->param('branch');
my $date = $query->param('date');
$date = eval { dt_from_string( scalar $query->param('date') ) } if $date;
+my $showhistoricexpired = $query->param('showhistoryexpired');
if ($date) {
my @subscriptions = SearchSubscriptions({ title => $title, issn => $issn, orderby => 'title' });
next if $subscription->{cannotedit};
my $expirationdate_dt = dt_from_string( $expirationdate, 'iso' );
+ my $today_dt = dt_from_string();
if ( DateTime->compare( $date, $expirationdate_dt ) == 1
+ && ( $showhistoricexpired || DateTime->compare( $expiration_dt, $today_dt ) == 1 )
&& ( !$branch || ( $subscription->{'branchcode'} eq $branch ) ) ) {
push @subscriptions_loop, $subscription;
}
}
- $template->param (
- title => $title,
- issn => $issn,
- numsubscription => scalar @subscriptions_loop,
- date => $date,
- subscriptions_loop => \@subscriptions_loop,
- "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
- searched => 1,
+ $template->param(
+ title => $title,
+ issn => $issn,
+ showhistoricexpired => $showhistoricexpired,
+ numsubscription => scalar @subscriptions_loop,
+ date => $date,
+ subscriptions_loop => \@subscriptions_loop,
+ "BiblioDefaultView" . C4::Context->preference("BiblioDefaultView") => 1,
+ searched => 1,
);
}