# 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";
}
exit;
}
}
-my ($routing, @routinglist) = getroutinglist($subscriptionid);
+my $hasRouting = check_routing($subscriptionid);
my ($totalissues,@serialslist) = GetSerials($subscriptionid);
$totalissues-- if $totalissues; # the -1 is to have 0 if this is a new subscription (only 1 issue)
# the subscription must be deletable if there is NO issues for a reason or another (should not happend, but...)
# 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{$_});
+ $$subs{$date} = format_date($$subs{$date}) if $date && $$subs{$date};
}
$subs->{abouttoexpire} = abouttoexpire($subs->{subscriptionid});
}
$template->param(
subscriptionid => $subscriptionid,
- routing => $routing,
serialslist => \@serialslist,
+ hasRouting => $hasRouting,
totalissues => $totalissues,
hemisphere => $hemisphere,
cannotedit =>(C4::Context->preference('IndependantBranches') &&