serials-edit.pl
authorhdl <hdl>
Sat, 30 Jun 2007 06:23:10 +0000 (06:23 +0000)
committerhdl <hdl>
Sat, 30 Jun 2007 06:23:10 +0000 (06:23 +0000)
Changing redirection to serials-home.pl
serials-home.pl
Adding some parameters to serials-home script to display information passed by serials-edit.pl
Preparing information for display.
(template to get committed)

serials/serials-edit.pl
serials/serials-home.pl

index 0ff3a29..cec9244 100755 (executable)
@@ -248,7 +248,14 @@ if ($op eq 'serialchangestatus') {
         }
       }
     }
-    print $query->redirect("serials-collection.pl?biblionumber=".$serialdatalist[0]->{biblionumber});
+    ### FIXME this part of code is not very pretty. Nor is it very efficient... There MUST be a more perlish way to write it. But it works.     
+    my $redirect ="serials-home.pl?";
+    $redirect.=join("&",map{"serialseq=".$_} @serialseqs);
+    $redirect.="&".join("&",map{"planneddate=".$_} @planneddates);
+    $redirect.="&".join("&",map{"publisheddate=".$_} @publisheddates);
+    $redirect.="&".join("&",map{"status=".$_} @status);
+    $redirect.="&".join("&",map{"notes=".$_} @notes);
+    print $query->redirect("$redirect");
 }
 
 $template->param(serialsadditems =>C4::Context->preference("serialsadditems"));
index 7a8c5a2..2a3820e 100755 (executable)
@@ -55,6 +55,12 @@ my $routing       = $query->param('routing');
 my $searched      = $query->param('searched');
 my $biblionumber  = $query->param('biblionumber');
 
+my @serialseqs = $query->param('serialseq');
+my @planneddates = $query->param('planneddate');
+my @publisheddates = $query->param('publisheddate');
+my @status = $query->param('status');
+my @notes = $query->param('notes');
+
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
         template_name   => "serials/serials-home.tmpl",
@@ -66,6 +72,24 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 
+if (@serialseqs){
+  my @information;
+  my $index;
+  foreach my $seq (@serialseqs){
+    if ($seq){
+      ### FIXME  This limitation that a serial must be given a title may not be very efficient for some library who do not update serials titles.
+      push @information,
+        { serialseq=>$seq,
+          publisheddate=>$publisheddates[$index],   
+          planneddate=>$planneddates[$index],   
+          notes=>$notes[$index],   
+          status=>$status[$index]
+        }     
+    }   
+    $index++; 
+  } 
+  $template->param('information'=>\@information);
+}
 my @subscriptions;
 if ($searched){
     @subscriptions = GetSubscriptions( $title, $ISSN, $biblionumber );