quickfix for displaying collection-code in opac
[koha.git] / serials / subscription-renew.pl
index 31ae2e4..484fbfb 100755 (executable)
@@ -18,7 +18,6 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id$
 
 =head1 NAME
 
@@ -50,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;
@@ -85,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(