Ukranian and Russian sql updates courtesy of Сергій Дубик
[koha.git] / serials / subscription-renew.pl
index 10c1205..219fca7 100755 (executable)
@@ -1,5 +1,4 @@
 #!/usr/bin/perl
-# WARNING: 4-character tab stops here
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -45,6 +44,7 @@ Id of the subscription this script has to renew
 =cut
 
 use strict;
+use warnings;
 
 use CGI;
 use C4::Koha;
@@ -68,7 +68,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         query           => $query,
         type            => "intranet",
         authnotrequired => 0,
-        flagsrequired   => { serials => 1 },
+        flagsrequired   => { serials => 'renew_subscription' },
         debug           => 1,
     }
 );
@@ -79,14 +79,14 @@ if ( $op eq "renew" ) {
         $query->param('startdate'),  $query->param('numberlength'),
         $query->param('weeklength'), $query->param('monthlength'),
         $query->param('note')
-    );  
+    );
 }
 
 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(
@@ -99,12 +99,8 @@ $template->param(
     subscriptionid => $subscriptionid,
     bibliotitle    => $subscription->{bibliotitle},
     $op            => 1,
-    popup          => ($query->param('mode')eq "popup"),  
+    popup          => ($query->param('mode')eq "popup"),
 );
 
 # Print the page
 output_html_with_http_headers $query, $cookie, $template->output;
-
-# Local Variables:
-# tab-width: 4
-# End: