(bug #3783) fix marcurls
[koha_gimpoz] / serials / subscription-detail.pl
index c425296..0b8e579 100755 (executable)
@@ -56,10 +56,12 @@ if ($op eq 'del') {
     # Asking for confirmation if the subscription has not strictly expired yet or if it has linked issues
     my $strictlyexpired = HasSubscriptionStrictlyExpired($subscriptionid);
     my $linkedissues = CountIssues($subscriptionid);
-    if ($strictlyexpired == 0 || $linkedissues > 0) {
+    my $countitems   = HasItems($subscriptionid);
+    if ($strictlyexpired == 0 || $linkedissues > 0 || $countitems>0) {
                $template->param(NEEDSCONFIRMATION => 1);
                if ($strictlyexpired == 0) { $template->param("NOTEXPIRED" => 1); }
                if ($linkedissues     > 0) { $template->param("LINKEDISSUES" => 1); }
+               if ($countitems       > 0) { $template->param("LINKEDITEMS"  => 1); }
     } else {
                $issueconfirmed = "1";
     }
@@ -82,7 +84,7 @@ my ($user, $sessionID, $flags);
 # COMMENT hdl : IMHO, we should think about passing more and more data hash to template->param rather than duplicating code a new coding Guideline ?
 
 for my $date qw(startdate enddate firstacquidate histstartdate histenddate){
-    $$subs{$_}      = format_date($$subs{$_}) if $_ && $$subs{$_};
+    $$subs{$date}      = format_date($$subs{$date}) if $date && $$subs{$date};
 }
 $subs->{abouttoexpire}  = abouttoexpire($subs->{subscriptionid});