quickfix for displaying collection-code in opac
[koha.git] / serials / subscription-renew.pl
index 210e947..484fbfb 100755 (executable)
@@ -49,8 +49,7 @@ require Exporter;
 use CGI;
 use C4::Koha;
 use C4::Auth;
-use C4::Date;
-
+use C4::Dates qw/format_date/;
 use C4::Context;
 use C4::Auth;
 use C4::Output;
@@ -84,6 +83,10 @@ if ( $op eq "renew" ) {
 }
 
 my $subscription = GetSubscription($subscriptionid);
+if ($subscription->{'cannotedit'}){
+  warn "Attempt to renew subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed";
+  print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
+}  
 
 $template->param(
     startdate => format_date(