ffzg/recall_notices.pl: added --interval and --dedup
[koha.git] / admin / itemtypes.pl
index cc790df..441bd05 100755 (executable)
@@ -46,7 +46,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
         query           => $input,
         type            => "intranet",
         authnotrequired => 0,
-        flagsrequired   => { parameters => 'parameters_remaining_permissions' },
+        flagsrequired   => { parameters => 'manage_itemtypes' },
         debug           => 1,
     }
 );
@@ -72,6 +72,8 @@ if ( $op eq 'add_form' ) {
     my $itemtype     = Koha::ItemTypes->find($itemtype_code);
     my $description  = $input->param('description');
     my $rentalcharge = $input->param('rentalcharge');
+    my $rentalcharge_daily = $input->param('rentalcharge_daily');
+    my $rentalcharge_hourly = $input->param('rentalcharge_hourly');
     my $defaultreplacecost = $input->param('defaultreplacecost');
     my $processfee = $input->param('processfee');
     my $image = $input->param('image') || q||;
@@ -92,6 +94,8 @@ if ( $op eq 'add_form' ) {
     if ( $itemtype and $is_a_modif ) {    # it's a modification
         $itemtype->description($description);
         $itemtype->rentalcharge($rentalcharge);
+        $itemtype->rentalcharge_daily($rentalcharge_daily);
+        $itemtype->rentalcharge_hourly($rentalcharge_hourly);
         $itemtype->defaultreplacecost($defaultreplacecost);
         $itemtype->processfee($processfee);
         $itemtype->notforloan($notforloan);
@@ -112,19 +116,22 @@ if ( $op eq 'add_form' ) {
         }
     } elsif ( not $itemtype and not $is_a_modif ) {
         my $itemtype = Koha::ItemType->new(
-            {   itemtype           => $itemtype_code,
-                description        => $description,
-                rentalcharge       => $rentalcharge,
-                defaultreplacecost => $defaultreplacecost,
-                processfee         => $processfee,
-                notforloan         => $notforloan,
-                imageurl           => $imageurl,
-                summary            => $summary,
-                checkinmsg         => $checkinmsg,
-                checkinmsgtype     => $checkinmsgtype,
-                sip_media_type     => $sip_media_type,
-                hideinopac         => $hideinopac,
-                searchcategory     => $searchcategory,
+            {
+                itemtype            => $itemtype_code,
+                description         => $description,
+                rentalcharge        => $rentalcharge,
+                rentalcharge_daily  => $rentalcharge_daily,
+                rentalcharge_hourly => $rentalcharge_hourly,
+                defaultreplacecost  => $defaultreplacecost,
+                processfee          => $processfee,
+                notforloan          => $notforloan,
+                imageurl            => $imageurl,
+                summary             => $summary,
+                checkinmsg          => $checkinmsg,
+                checkinmsgtype      => $checkinmsgtype,
+                sip_media_type      => $sip_media_type,
+                hideinopac          => $hideinopac,
+                searchcategory      => $searchcategory,
             }
         );
         eval { $itemtype->store; };