Bug 23243: Adjust previous patch
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 12 Dec 2019 10:07:31 +0000 (11:07 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 21 Apr 2021 13:25:07 +0000 (15:25 +0200)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt
serials/checkexpiration.pl

index 0ec36ce..ef656fc 100644 (file)
 
         <li>
             <label for="showhistoricexpired">Include historic expirations:</label>
-            <input id="showhistoricexpired" type="checkbox" name="showhistoricexpired"
-            [% IF ( showhistoricexpired ) %] checked="checked" [% END %]/>
+            [% IF showhistoricexpired %]
+                <input id="showhistoricexpired" type="checkbox" name="showhistoricexpired" checked="checked" />
+            [% ELSE %]
+                <input id="showhistoricexpired" type="checkbox" name="showhistoricexpired" />
+            [% END %]
         </li>
         </ol>
 </fieldset>
index 2b6f202..aeebd2f 100755 (executable)
@@ -69,7 +69,7 @@ my $issn  = $query->param('issn');
 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');
+my $showhistoricexpired = $query->param('showhistoricexpired');
 
 if ($date) {
     my @subscriptions = SearchSubscriptions({ title => $title, issn => $issn, orderby => 'title' });
@@ -96,7 +96,7 @@ if ($date) {
         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 )
+            && ( $showhistoricexpired || DateTime->compare( $expirationdate_dt, $today_dt ) == 1 )
             && ( !$branch || ( $subscription->{'branchcode'} eq $branch ) ) ) {
             push @subscriptions_loop, $subscription;
         }