Bug 16934: Add test for ModOrder
[srvgit] / serials / subscription-add.pl
index 31a1e35..31a6b6b 100755 (executable)
@@ -146,7 +146,7 @@ for my $thisbranch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{b
     };
 }
 
-my $locations_loop = GetAuthorisedValues("LOC",$subs->{'location'});
+my $locations_loop = GetAuthorisedValues("LOC");
 
 $template->param(branchloop => $branchloop,
     locations_loop=>$locations_loop,
@@ -294,7 +294,7 @@ sub redirect_add_subscription {
     my $cost           = $query->param('cost');
     my $aqbudgetid     = $query->param('aqbudgetid');
     my $periodicity    = $query->param('frequency');
-    my @irregularity   = $query->param('irregularity');
+    my @irregularity   = $query->multi_param('irregularity');
     my $numberpattern  = $query->param('numbering_pattern');
     my $locale         = $query->param('locale');
     my $graceperiod    = $query->param('graceperiod') || 0;
@@ -323,9 +323,9 @@ sub redirect_add_subscription {
     my $location          = $query->param('location');
     my $skip_serialseq    = $query->param('skip_serialseq');
 
-    my $startdate      = output_pref( { str => $query->param('startdate'),      dateonly => 1, dateformat => 'iso' } );
-    my $enddate        = output_pref( { str => $query->param('enddate'),        dateonly => 1, dateformat => 'iso' } );
-    my $firstacquidate = output_pref( { str => $query->param('firstacquidate'), dateonly => 1, dateformat => 'iso' } );
+    my $startdate      = output_pref( { str => scalar $query->param('startdate'),      dateonly => 1, dateformat => 'iso' } );
+    my $enddate        = output_pref( { str => scalar $query->param('enddate'),        dateonly => 1, dateformat => 'iso' } );
+    my $firstacquidate = output_pref( { str => scalar $query->param('firstacquidate'), dateonly => 1, dateformat => 'iso' } );
 
     if(!defined $enddate || $enddate eq '') {
         if($subtype eq "issues") {
@@ -355,18 +355,18 @@ sub redirect_add_subscription {
 
 sub redirect_mod_subscription {
     my $subscriptionid = $query->param('subscriptionid');
-    my @irregularity = $query->param('irregularity');
+    my @irregularity = $query->multi_param('irregularity');
     my $auser = $query->param('user');
-    my $librarian => $query->param('librarian'),
+    my $librarian => scalar $query->param('librarian'),
     my $branchcode = $query->param('branchcode');
     my $cost = $query->param('cost');
     my $aqbooksellerid = $query->param('aqbooksellerid');
     my $biblionumber = $query->param('biblionumber');
     my $aqbudgetid = $query->param('aqbudgetid');
 
-    my $startdate      = output_pref( { str => $query->param('startdate'),      dateonly => 1, dateformat => 'iso' } );
-    my $enddate        = output_pref( { str => $query->param('enddate'),        dateonly => 1, dateformat => 'iso' } );
-    my $firstacquidate = output_pref( { str => $query->param('firstacquidate'), dateonly => 1, dateformat => 'iso' } );
+    my $startdate      = output_pref( { str => scalar $query->param('startdate'),      dateonly => 1, dateformat => 'iso' } );
+    my $enddate        = output_pref( { str => scalar $query->param('enddate'),        dateonly => 1, dateformat => 'iso' } );
+    my $firstacquidate = output_pref( { str => scalar $query->param('firstacquidate'), dateonly => 1, dateformat => 'iso' } );
 
     my $nextacquidate  = $query->param('nextacquidate');
     $nextacquidate = $nextacquidate
@@ -451,7 +451,7 @@ sub insert_additional_fields {
             }
         } else {
             $af->{values} = {
-                $subscriptionid => $query->param('additional_field_' . $field->{id})
+                $subscriptionid => scalar $query->param('additional_field_' . $field->{id})
             } if defined $query->param('additional_field_' . $field->{id});
         }
         $af->insert_values;