[Koha-cvs] koha C4/Serials.pm koha-tmpl/intranet-tmpl/prog... [rel_3_0]

Henri-Damien LAURENT laurenthdl at alinto.com
Mon Oct 2 11:15:45 CEST 2006


CVSROOT:	/cvsroot/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Henri-Damien LAURENT <hdl>	06/10/02 09:15:45

Modified files:
	C4             : Serials.pm 
	koha-tmpl/intranet-tmpl/prog/en/serials: lateissues.tmpl 
	                                         routing-preview-slip.tmpl 
	                                         serials-recieve.tmpl 
	                                         subscription-add.tmpl 
	                                         subscription-detail.tmpl 
	serials        : routing.pl routing-preview.pl 
	                 serials-recieve.pl statecollection.pl 
	                 subscription-add.pl subscription-detail.pl 
	updater        : updatedatabase 

Log message:
	Serials : 
	* synching with NZ-devs on Serials.
	* adding routing lists support, 
	* adding serialsadditems support
	* adding publisheddate management
	
	TODO : 
	Management for seasonal serials should be fixed in order to be language independant.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Serials.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.5.2.1&r2=1.5.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/serials/lateissues.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.4&r2=1.4.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/serials/routing-preview-slip.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1&r2=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/serials/serials-recieve.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.2&r2=1.2.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-add.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.3.2.1&r2=1.3.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-detail.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.3.2.1&r2=1.3.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/serials/routing.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1&r2=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/serials/routing-preview.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.1&r2=1.1.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/serials/serials-recieve.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.4&r2=1.4.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/serials/statecollection.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.2.2.1&r2=1.2.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/serials/subscription-add.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.6.2.1&r2=1.6.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/serials/subscription-detail.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.3.2.1&r2=1.3.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/updater/updatedatabase?cvsroot=koha&only_with_tag=rel_3_0&r1=1.157.2.4&r2=1.157.2.5

Patches:
Index: C4/Serials.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Serials.pm,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -u -b -r1.5.2.1 -r1.5.2.2
--- C4/Serials.pm	6 Sep 2006 12:57:41 -0000	1.5.2.1
+++ C4/Serials.pm	2 Oct 2006 09:15:44 -0000	1.5.2.2
@@ -17,7 +17,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: Serials.pm,v 1.5.2.1 2006/09/06 12:57:41 hdl Exp $
+# $Id: Serials.pm,v 1.5.2.2 2006/10/02 09:15:44 hdl Exp $
 
 use strict;
 use C4::Date;
@@ -31,7 +31,7 @@
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.5.2.1 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.5.2.2 $' =~ /\d+/g;
         shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
 
 
@@ -75,13 +75,13 @@
     &GetMissingIssues
     &GetDistributedTo
     &SetDistributedTo
-    &serialchangestatus
+    &SerialChangeStatus
     &getroutinglist
     &delroutingmember
     &addroutingmember
     &reorder_members
     &check_routing &getsupplierbyserialid &updateClaim &removeMissingIssue &abouttoexpire
-    &old_newsubscription &old_modsubscription &old_getserials &Get_Next_Date
+    &old_newsubscription &old_modsubscription &old_getserials &GetNextDate
 );
 
 =head2 GetSuppliersWithLateIssues
@@ -196,7 +196,7 @@
     my $dbh = C4::Context->dbh;
     my $query = qq|
         SELECT *
-        FROM   subcriptionhistory
+        FROM   subscriptionhistory
         WHERE  subscriptionid = ?
     |;
     return $dbh->prepare($query);
@@ -498,11 +498,11 @@
     my $dbh = C4::Context->dbh;
     # OK, now add the last 5 issues arrives/missing
     my $query = qq|
-        SELECT   serialid,serialseq, status, planneddate,notes
+        SELECT   serialid,serialseq, status, planneddate, publisheddate,notes
         FROM     serial
         WHERE    subscriptionid = ?
         AND      (status in (2,4,5))
-        ORDER BY serialid DESC
+        ORDER BY publisheddate,serialid DESC
     |;
     my $sth=$dbh->prepare($query);
     $sth->execute($subscriptionid);
@@ -512,6 +512,7 @@
         $counter++;
         $line->{"status".$line->{status}} = 1; # fills a "statusX" value, used for template status select list
         $line->{"planneddate"} = format_date($line->{"planneddate"});
+        $line->{"publisheddate"} = format_date($line->{"publisheddate"});
         push @serials,$line;
     }
     # status = 2 is "arrived"
@@ -519,6 +520,7 @@
         SELECT serialid,serialseq, status, publisheddate, planneddate,notes 
         FROM   serial
         WHERE  subscriptionid = ? AND status NOT IN (2,4,5)
+        ORDER BY publisheddate,serialid DESC
     |;
     my $sth=$dbh->prepare($query);
     $sth->execute($subscriptionid);
@@ -618,39 +620,39 @@
 =back
 
 =cut
-sub GetNextSeq {
-    my ($val) =@_;
-    my ($calculated,$newlastvalue1,$newlastvalue2,$newlastvalue3,$newinnerloop1,$newinnerloop2,$newinnerloop3);
-    $calculated = $val->{numberingmethod};
-# calculate the (expected) value of the next issue recieved.
-    $newlastvalue1 = $val->{lastvalue1};
-# check if we have to increase the new value.
-    $newinnerloop1 = $val->{innerloop1}+1;
-    $newinnerloop1=0 if ($newinnerloop1 >= $val->{every1});
-    $newlastvalue1 += $val->{add1} if ($newinnerloop1<1); # <1 to be true when 0 or empty.
-    $newlastvalue1=$val->{setto1} if ($newlastvalue1>$val->{whenmorethan1}); # reset counter if needed.
-    $calculated =~ s/\{X\}/$newlastvalue1/g;
+# sub GetNextSeq {
+#     my ($val) =@_;
+#     my ($calculated,$newlastvalue1,$newlastvalue2,$newlastvalue3,$newinnerloop1,$newinnerloop2,$newinnerloop3);
+#     $calculated = $val->{numberingmethod};
+# # calculate the (expected) value of the next issue recieved.
+#     $newlastvalue1 = $val->{lastvalue1};
+# # check if we have to increase the new value.
+#     $newinnerloop1 = $val->{innerloop1}+1;
+#     $newinnerloop1=0 if ($newinnerloop1 >= $val->{every1});
+#     $newlastvalue1 += $val->{add1} if ($newinnerloop1<1); # <1 to be true when 0 or empty.
+#     $newlastvalue1=$val->{setto1} if ($newlastvalue1>$val->{whenmorethan1}); # reset counter if needed.
+#     $calculated =~ s/\{X\}/$newlastvalue1/g;
+# 
+#     $newlastvalue2 = $val->{lastvalue2};
+# # check if we have to increase the new value.
+#     $newinnerloop2 = $val->{innerloop2}+1;
+#     $newinnerloop2=0 if ($newinnerloop2 >= $val->{every2});
+#     $newlastvalue2 += $val->{add2} if ($newinnerloop2<1); # <1 to be true when 0 or empty.
+#     $newlastvalue2=$val->{setto2} if ($newlastvalue2>$val->{whenmorethan2}); # reset counter if needed.
+#     $calculated =~ s/\{Y\}/$newlastvalue2/g;
+# 
+#     $newlastvalue3 = $val->{lastvalue3};
+# # check if we have to increase the new value.
+#     $newinnerloop3 = $val->{innerloop3}+1;
+#     $newinnerloop3=0 if ($newinnerloop3 >= $val->{every3});
+#     $newlastvalue3 += $val->{add3} if ($newinnerloop3<1); # <1 to be true when 0 or empty.
+#     $newlastvalue3=$val->{setto3} if ($newlastvalue3>$val->{whenmorethan3}); # reset counter if needed.
+#     $calculated =~ s/\{Z\}/$newlastvalue3/g;
+#     return ($calculated,$newlastvalue1,$newlastvalue2,$newlastvalue3,$newinnerloop1,$newinnerloop2,$newinnerloop3);
+# }
 
-    $newlastvalue2 = $val->{lastvalue2};
-# check if we have to increase the new value.
-    $newinnerloop2 = $val->{innerloop2}+1;
-    $newinnerloop2=0 if ($newinnerloop2 >= $val->{every2});
-    $newlastvalue2 += $val->{add2} if ($newinnerloop2<1); # <1 to be true when 0 or empty.
-    $newlastvalue2=$val->{setto2} if ($newlastvalue2>$val->{whenmorethan2}); # reset counter if needed.
-    $calculated =~ s/\{Y\}/$newlastvalue2/g;
 
-    $newlastvalue3 = $val->{lastvalue3};
-# check if we have to increase the new value.
-    $newinnerloop3 = $val->{innerloop3}+1;
-    $newinnerloop3=0 if ($newinnerloop3 >= $val->{every3});
-    $newlastvalue3 += $val->{add3} if ($newinnerloop3<1); # <1 to be true when 0 or empty.
-    $newlastvalue3=$val->{setto3} if ($newlastvalue3>$val->{whenmorethan3}); # reset counter if needed.
-    $calculated =~ s/\{Z\}/$newlastvalue3/g;
-    return ($calculated,$newlastvalue1,$newlastvalue2,$newlastvalue3,$newinnerloop1,$newinnerloop2,$newinnerloop3);
-}
-
-
-sub New_Get_Next_Seq {
+sub GetNextSeq {
     my ($val) =@_;
     my ($calculated,$newlastvalue1,$newlastvalue2,$newlastvalue3,$newinnerloop1,$newinnerloop2,$newinnerloop3);
     my $pattern = $val->{numberpattern};
@@ -714,57 +716,6 @@
 }
 
 
-=head2 GetNextDate
-
-=over 4
-
-$resultdate = GetNextDate($planneddate,$subscription)
-
-this function get the date after $planneddate.
-return:
-the date on ISO format.
-
-=back
-
-=cut
-sub GetNextDate(@) {
-    my ($planneddate,$subscription) = @_;
-    my $resultdate;
-    if ($subscription->{periodicity} == 1) {
-        $resultdate=DateCalc($planneddate,"1 day");
-    }
-    if ($subscription->{periodicity} == 2) {
-        $resultdate=DateCalc($planneddate,"1 week");
-    }
-    if ($subscription->{periodicity} == 3) {
-        $resultdate=DateCalc($planneddate,"2 weeks");
-    }
-    if ($subscription->{periodicity} == 4) {
-        $resultdate=DateCalc($planneddate,"3 weeks");
-    }
-    if ($subscription->{periodicity} == 5) {
-        $resultdate=DateCalc($planneddate,"1 month");
-    }
-    if ($subscription->{periodicity} == 6) {
-        $resultdate=DateCalc($planneddate,"2 months");
-    }
-    if ($subscription->{periodicity} == 7) {
-        $resultdate=DateCalc($planneddate,"3 months");
-    }
-    if ($subscription->{periodicity} == 8) {
-        $resultdate=DateCalc($planneddate,"3 months");
-    }
-    if ($subscription->{periodicity} == 9) {
-        $resultdate=DateCalc($planneddate,"6 months");
-    }
-    if ($subscription->{periodicity} == 10) {
-        $resultdate=DateCalc($planneddate,"1 year");
-    }
-    if ($subscription->{periodicity} == 11) {
-        $resultdate=DateCalc($planneddate,"2 years");
-    }
-    return format_date_in_iso($resultdate);
-}
 
 =head2 GetSeq
 
@@ -921,10 +872,12 @@
         $sth->execute($subscriptionid);
         my ($missinglist,$recievedlist) = $sth->fetchrow;
         if ($status eq 2) {
-            $recievedlist .= ",$serialseq";
+            warn "receivedlist : $recievedlist serialseq :$serialseq, ".index("$recievedlist","$serialseq");
+            $recievedlist .= ",$serialseq" unless (index("$recievedlist","$serialseq")>=0);
         }
-        $missinglist .= ",$serialseq" if ($status eq 4) ;
-        $missinglist .= ",not issued $serialseq" if ($status eq 5);
+        warn "missinglist : $missinglist serialseq :$serialseq, ".index("$missinglist","$serialseq");
+        $missinglist .= ",$serialseq" if ($status eq 4 and not index("$missinglist","$serialseq")>=0) ;
+        $missinglist .= ",not issued $serialseq" if ($status eq 5 and index("$missinglist","$serialseq")>=0);
         my $query = qq(
             UPDATE subscriptionhistory
             SET    recievedlist=?, missinglist=?
@@ -947,7 +900,7 @@
         my ($newserialseq,$newlastvalue1,$newlastvalue2,$newlastvalue3,$newinnerloop1,$newinnerloop2,$newinnerloop3) = GetNextSeq($val);
         # next date (calculated from actual date & frequency parameters)
         my $nextpublisheddate = GetNextDate($publisheddate,$val);
-        NewIssue($newserialseq, $subscriptionid, $val->{'biblionumber'}, 1, $nextpublisheddate,0);
+        NewIssue($newserialseq, $subscriptionid, $val->{'biblionumber'}, 1, $nextpublisheddate,$nextpublisheddate);
         my $query = qq|
             UPDATE subscription
             SET    lastvalue1=?, lastvalue2=?, lastvalue3=?,
@@ -1022,7 +975,9 @@
         $add1,$every1,$whenmorethan1,$setto1,$lastvalue1,$innerloop1,
         $add2,$every2,$whenmorethan2,$setto2,$lastvalue2,$innerloop2,
         $add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
-        $numberingmethod, $status, $notes, $letter) = @_;
+        $numberingmethod, $status, $notes, $letter,
+        $firstacquidate,$irregularity,$numberpattern, $callnumber, $hemisphere
+        ) = @_;
     my $dbh = C4::Context->dbh;
 #save subscription (insert into database)
     my $query = qq|
@@ -1032,8 +987,9 @@
             add1,every1,whenmorethan1,setto1,lastvalue1,innerloop1,
             add2,every2,whenmorethan2,setto2,lastvalue2,innerloop2,
             add3,every3,whenmorethan3,setto3,lastvalue3,innerloop3,
-            numberingmethod, status, notes, letter)
-        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
+            numberingmethod, status, notes, letter,firstacquidate,irregularity,
+            numberpattern, callnumber, hemisphere)
+        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
         |;
     my $sth=$dbh->prepare($query);
     $sth->execute(
@@ -1042,7 +998,8 @@
         $add1,$every1,$whenmorethan1,$setto1,$lastvalue1,$innerloop1,
         $add2,$every2,$whenmorethan2,$setto2,$lastvalue2,$innerloop2,
         $add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
-        $numberingmethod, $status, $notes, $letter);
+        $numberingmethod, "$status", $notes, $letter,$firstacquidate,$irregularity,
+        $numberpattern, $callnumber, $hemisphere);
 
 #then create the 1st waited number
     my $subscriptionid = $dbh->{'mysql_insertid'};
@@ -1052,7 +1009,7 @@
         VALUES (?,?,?,?,?,?,?,?)
         );
     $sth = $dbh->prepare($query);
-    $sth->execute($biblionumber, $subscriptionid, format_date_in_iso($startdate), 0, "", "", "", $notes);
+    $sth->execute($biblionumber, $subscriptionid, format_date_in_iso($startdate), 0, "", "", "", "$notes");
 
 # reread subscription to get a hash (for calculation of the 1st issue number)
     my $query = qq(
@@ -1068,11 +1025,11 @@
     my $serialseq = GetSeq($val);
     my $query = qq|
         INSERT INTO serial
-            (serialseq,subscriptionid,biblionumber,status, planneddate)
-        VALUES (?,?,?,?,?)
+            (serialseq,subscriptionid,biblionumber,status, planneddate, publisheddate)
+        VALUES (?,?,?,?,?,?)
     |;
     $sth = $dbh->prepare($query);
-    $sth->execute($serialseq, $subscriptionid, $val->{'biblionumber'}, 1, format_date_in_iso($startdate));
+    $sth->execute("$serialseq", $subscriptionid, $biblionumber, 1, format_date_in_iso($startdate),format_date_in_iso($startdate));
     return $subscriptionid;
 }
 
@@ -1170,8 +1127,8 @@
 =back
 
 =cut
-sub serialchangestatus {
-    my ($serialid,$serialseq,$planneddate,$status,$notes)=@_;
+sub SerialChangeStatus {
+    my ($serialid,$serialseq,$planneddate,$publisheddate,$status,$notes)=@_;
     # 1st, get previous status : if we change from "waited" to something else, then we will have to create a new "waited" entry
     my $dbh = C4::Context->dbh;
     my $sth = $dbh->prepare("select subscriptionid,status from serial where serialid=?");
@@ -1179,19 +1136,26 @@
     my ($subscriptionid,$oldstatus) = $sth->fetchrow;
     # change status & update subscriptionhistory
     if ($status eq 6){
-        delissue($serialseq, $subscriptionid)
+        DelIssue($serialseq, $subscriptionid)
     }else{
-        $sth = $dbh->prepare("update serial set serialseq=?,planneddate=?,status=?,notes=? where serialid = ?");
-        $sth->execute($serialseq,$planneddate,$status,$notes,$serialid);
+        $sth = $dbh->prepare(qq|
+     UPDATE serial 
+     SET serialseq=?,
+         planneddate=?,
+         publisheddate=?,
+         status=?,
+         notes=? 
+     WHERE serialid = ?|);
+        $sth->execute($serialseq,$planneddate,$publisheddate,$status,$notes,$serialid);
         $sth = $dbh->prepare("select missinglist,recievedlist from subscriptionhistory where subscriptionid=?");
         $sth->execute($subscriptionid);
         my ($missinglist,$recievedlist) = $sth->fetchrow;
         if ($status eq 2) {
-            $recievedlist .= "| $serialseq";
+            $recievedlist .= "| $serialseq" unless (index($recievedlist,$serialseq)>=0);
             $recievedlist =~ s/^\| //g;
         }
-        $missinglist .= "| $serialseq" if ($status eq 4) ;
-        $missinglist .= "| not issued $serialseq" if ($status eq 5);
+        $missinglist .= "| $serialseq" if ($status eq 4 and not index($missinglist,$serialseq)>=0) ;
+        $missinglist .= "| not issued $serialseq" if ($status eq 5 and not index($missinglist,$serialseq)>=0);
         $missinglist =~ s/^\| //g;
         $sth=$dbh->prepare("update subscriptionhistory set recievedlist=?, missinglist=? where subscriptionid=?");
         $sth->execute($recievedlist,$missinglist,$subscriptionid);
@@ -1202,18 +1166,18 @@
         $sth->execute($subscriptionid);
         my $val = $sth->fetchrow_hashref;
         # next issue number
-        my ($newserialseq,$newlastvalue1,$newlastvalue2,$newlastvalue3) = New_Get_Next_Seq($val);
-        my $nextplanneddate = Get_Next_Date($planneddate,$val);
-        NewIssue($newserialseq, $subscriptionid, $val->{'biblionumber'}, 1, $nextplanneddate);
-        $sth = $dbh->prepare("update subscription set lastvalue1=?, lastvalue2=?,lastvalue3=? where subscriptionid = ?");
-        $sth->execute($newlastvalue1,$newlastvalue2,$newlastvalue3,$subscriptionid);
+        my ($newserialseq,$newlastvalue1,$newlastvalue2,$newlastvalue3,$newinnerloop1,$newinnerloop2,$newinnerloop3) = GetNextSeq($val);
+        my $nextplanneddate = GetNextDate($planneddate,$val);
+        NewIssue($newserialseq, $subscriptionid, $val->{'biblionumber'}, 1, $nextplanneddate,$nextplanneddate);
+        $sth = $dbh->prepare("update subscription set lastvalue1=?, lastvalue2=?,lastvalue3=?,innerloop1=?, innerloop2=?,innerloop3=? where subscriptionid = ?");
+        $sth->execute($newlastvalue1,$newlastvalue2,$newlastvalue3,$newinnerloop1,$newinnerloop2,$newinnerloop3,$subscriptionid);
     }
     # check if an alert must be sent... (= a letter is defined & status became "arrived"
    	$sth = $dbh->prepare("select * from subscription where subscriptionid = ? ");
 	$sth->execute($subscriptionid);
 	my $subscription = $sth->fetchrow_hashref; 
     if ($subscription->{letter} && $status eq 2) {
-        sendalerts('issue',$subscription->{subscriptionid},$subscription->{letter});
+        SendAlerts('issue',$subscription->{subscriptionid},$subscription->{letter});
     }
 }
 
@@ -1689,7 +1653,7 @@
 	    $rank = 1;
 	}
     }
-    $sth = $dbh->prepare("INSERT INTO subscriptionroutinglist VALUES (null,?,?,?,null)");
+    $sth = $dbh->prepare("INSERT INTO subscriptionroutinglist (subscriptionid,borrowernumber,ranking) VALUES (?,?,?)");
     $sth->execute($subscriptionid,$bornum,$rank);
 }
 
@@ -2025,11 +1989,11 @@
         return ($totalissues, at serials);
 }
 
-=head2 Get_Next_Date
+=head2 GetNextDate
 
 =over 4
 
-($resultdate) = &Get_Next_Date($planneddate,$subscription)
+($resultdate) = &GetNextDate($planneddate,$subscription)
 
 this function is an extension of GetNextDate which allows for checking for irregularity
 
@@ -2044,7 +2008,7 @@
 =back
 
 =cut
-sub Get_Next_Date(@) {
+sub GetNextDate(@) {
     my ($planneddate,$subscription) = @_;
     my @irreg = split(/\|/,$subscription->{irregularity});
 

Index: koha-tmpl/intranet-tmpl/prog/en/serials/lateissues.tmpl
===================================================================
RCS file: /cvsroot/koha/koha/koha-tmpl/intranet-tmpl/prog/en/serials/lateissues.tmpl,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -b -r1.4 -r1.4.2.1
--- koha-tmpl/intranet-tmpl/prog/en/serials/lateissues.tmpl	20 Jul 2006 03:42:54 -0000	1.4
+++ koha-tmpl/intranet-tmpl/prog/en/serials/lateissues.tmpl	2 Oct 2006 09:15:44 -0000	1.4.2.1
@@ -39,7 +39,7 @@
 				<td>
 					<a href="subscription-detail.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->">Detail</a>
 					<a
-href="statecollection.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->">Receive</a>
+href="serials-recieve.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->">Receive</a>
 				</td>
 			<!-- /TMPL_IF -->
 		</tr>
@@ -75,7 +75,7 @@
 		</td>
 		<td class="cell">
 		<a
-href="statecollection.pl?op=found&amp;planneddate=<!-- TMPL_VAR
+href="serials-receive.pl?op=found&amp;planneddate=<!-- TMPL_VAR
 name="planneddate" -->&amp;missingissue=<!-- TMPL_VAR name="serialseq" -->&amp;subscriptionid=<!-- TMPL_VAR
 name="subscriptionid" -->">Receive</a>
                 </td>

Index: koha-tmpl/intranet-tmpl/prog/en/serials/routing-preview-slip.tmpl
===================================================================
RCS file: /cvsroot/koha/koha/koha-tmpl/intranet-tmpl/prog/en/serials/routing-preview-slip.tmpl,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -b -r1.1 -r1.1.2.1
--- koha-tmpl/intranet-tmpl/prog/en/serials/routing-preview-slip.tmpl	20 Jul 2006 03:47:29 -0000	1.1
+++ koha-tmpl/intranet-tmpl/prog/en/serials/routing-preview-slip.tmpl	2 Oct 2006 09:15:44 -0000	1.1.2.1
@@ -2,7 +2,7 @@
 
 <div id="slip-block">
 <table cellspacing="0" cellpadding="0" border="0" class="collapse routingslip">
-<tr><td class="cell" colspan="3"><h3>Opus International Consultants - Information Centre</h3></td></tr>
+<tr><td class="cell" colspan="3"><h3><!-- TMPL_VAR NAME="libraryname" --></h3></td></tr>
 <tr><td class="cell" colspan="3"><b>Title:</b> <!-- TMPL_VAR NAME="title" --><br />
 <!-- TMPL_VAR NAME="issue" --></td></tr>
 <tr><td class="cell"><b>Name/Location</b></td>

Index: koha-tmpl/intranet-tmpl/prog/en/serials/serials-recieve.tmpl
===================================================================
RCS file: /cvsroot/koha/koha/koha-tmpl/intranet-tmpl/prog/en/serials/Attic/serials-recieve.tmpl,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -b -r1.2 -r1.2.2.1
--- koha-tmpl/intranet-tmpl/prog/en/serials/serials-recieve.tmpl	12 Jul 2006 15:28:38 -0000	1.2
+++ koha-tmpl/intranet-tmpl/prog/en/serials/serials-recieve.tmpl	2 Oct 2006 09:15:44 -0000	1.2.2.1
@@ -1,47 +1,76 @@
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- Subscription edit<!--
+TMPL_INCLUDE NAME="doc-head-close.inc" -->
 
-<!-- TMPL_INCLUDE name="serials-top.inc" -->
-<!-- TMPL INCLUDE NAME="menu-serials.inc"-->
+<!-- TMPL_INCLUDE NAME="menus.inc" -->
+<!--TMPL_INCLUDE NAME="menu-serials.inc" -->
 
 <!--------------------------MAIN BODY OF PAGE-------------------------->
 <div id="mainbloc">
-<h1 class="serial">Subscription for <!-- TMPL_VAR name="bibliotitle" --></h1>
-<a href="subscription-detail.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->" class="button serial" title="detail of the subscription">Subscription</a>
-<a href="/cgi-bin/koha/serials/serials-home.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->" class="button serial" title="all subscriptions on <!-- TMPL_VAR name="bibliotitle" -->">Subscriptions</a>
-<a href="/cgi-bin/koha/catalogue/MARCdetail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button serial" title="go to <!-- TMPL_VAR name="bibliotitle" -->">Back to biblio</a>
+<h1>Check In</h1>
+<h3>Subscription for: <!-- TMPL_VAR name="bibliotitle" --></h3>
+<a href="alt_subscription-detail.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->" class="button" title="detail of the subscription">Subscription Details</a>
+<!-- <a href="/cgi-bin/koha/serials/serials-home.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->" class="button" title="all subscriptions on <!-- TMPL_VAR name="bibliotitle" -->">Search All Subscriptions</a> -->
+<a href="/cgi-bin/koha/detail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button" title="go to <!-- TMPL_VAR name="bibliotitle" -->">Show Biblio</a>
+<!-- TMPL_IF NAME="routing" -->
+<a href="routing.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->" class="button" title="subscription routing list">Routing list</a>
+<!-- /TMPL_IF -->
 
 <div id="bloc25">
-<h2 class="serial">waited or late numbers</h2>
-    <form method="post" name="f" action="serials-recieve.pl">
-        <input type="hidden" name="op" value="modserialstatus">
+<h2>waited or late numbers</h2>
+	<form method="post" name="f" action="serials-recieve.pl" onsubmit="return barcode_check()">
+		<input type="hidden" name="op" value="serialchangestatus">
         <input type="hidden" name="serial" value="<!-- TMPL_VAR name="serial" -->">
         <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->">
         <input type="hidden" name="user" value="<!-- TMPL_VAR name="user" -->">
-    <table class="small">
+	<table cellspacing="0" cellpadding="0" border="0" class="collapse">
     <tr>
-        <th class="serial">
+		<td class="cell-header">
             Numbered
-        </th>
-        <th class="serial">
+		</td>
+		<td class="cell-header">
+			Published on
+		</td>
+		<td class="cell-header">
             planned for
-        </th>
-        <th class="serial">
+		</td>
+		<td class="cell-header">
             Status
-        </th>
-        <th class="serial">
+		</td>
+		<td class="cell-header">
             Notes
-        </th>
+		</td>
     </tr>
     <!-- TMPL_LOOP name="serialslist" -->
         <tr>
-            <td>
-                <input type="text" name="serialseq" value="<!-- TMPL_VAR name="serialseq" -->" size=50 maxlength=100>
+			<td class="cell">
+				Issue <input type="text" name="serialseq" value="<!-- TMPL_VAR name="serialseq" -->" size="20" maxlength="100">
+			<!--TMPL_IF Name="serialadditems" -->
+				<br /><br />
+				Callnumber <input type="text" name="itemcallnumber" value="<!--TMPL_VAR NAME="callnumber"-->" size=15 maxlength=100>
+				Barcode <input type="text" name="barcode" value="<!-- TMPL_VAR NAME="barcode"-->" id="barcode<!-- TMPL_VAR NAME="num" -->" size=20 maxlength=20>
+			<!--/TMPL_IF -->
+			</td>
+			<td class="cell">
+				<input type="text" name="publisheddate" value="<!-- TMPL_VAR name="publisheddate" -->" size=10 maxlength=15>
+			<!--TMPL_IF Name="serialadditems" -->
+				<br /><br />&nbsp;
+			<!--/TMPL_IF  -->
             </td>
-            <td>
+			<td class="cell">
                 <input type="text" name="planneddate" value="<!-- TMPL_VAR name="planneddate" -->" size=10 maxlength=15>
+			<!--TMPL_IF Name="serialadditems" -->
+				<br /><br />
+				<select name="branch" size="1">
+						<option value="">Branch</option>
+			<!-- TMPL_LOOP name="branchloop" -->
+				<option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="branchname" --></option>
+			<!-- /TMPL_LOOP -->
+				</select>
+			<!--/TMPL_IF -->
             </td>
-            <td>
+			<td class="cell">
                 <input type="hidden" name="serialid" value="<!-- TMPL_VAR name="serialid" -->">
-                <select name="status" size="1">
+				<select name="status" size="1" id="status<!-- TMPL_VAR NAME="num" -->">
                     <!--TMPL_IF name="status1" -->
                         <option value="1" selected>Waited</option>
                     <!-- /TMPL_IF -->
@@ -61,84 +90,220 @@
                         <option value="4">Missing</option>
                     <!-- /TMPL_IF -->
                     <!--TMPL_IF name="status5" -->
-                        <option value="5" selected>Not published</option>
+						<option value="5" selected>Not Available</option>
                     <!-- TMPL_ELSE -->
-                        <option value="5">Not published</option>
+						<option value="5">Not Available</option>
                     <!-- /TMPL_IF -->
+<!--
                     <!--TMPL_IF name="status6" -->
                         <option value="6" selected>Delete</option>
                     <!-- TMPL_ELSE -->
                         <option value="6">Delete</option>
-                    <!-- /TMPL_IF -->
+					<!-- /TMPL_IF --> -->
                 </select>
+			<!--TMPL_IF Name="serialadditems" -->
+				<br /><br />
+				<!--TMPL_IF Name="itemstatus"-->
+				    <!--TMPL_IF Name="choice"-->
+						<!-- TMPL_LOOP name="itemstatusloop" -->
+							<!-- TMPL_VAR name="itemlib" -->: <input type="checkbox" name="itemstatus" value="<!-- TMPL_VAR name="itemval" -->" <!-- TMPL_IF name="selected" -->checked<!-- /TMPL_IF -->>
+						<!-- /TMPL_LOOP -->
+				    <!--TMPL_ELSE-->
+					<select name="itemstatus" size="1">
+						<option value="">Item Status</option>
+						<!-- TMPL_LOOP name="itemstatusloop" -->
+							<option value="<!-- TMPL_VAR name="itemval" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="itemlib" --></option>
+						<!-- /TMPL_LOOP -->
+					</select>
+				    <!--/TMPL_IF-->
+				<!-- TMPL_ELSE -->
+				&nbsp;
+				<!--/TMPL_IF-->
+			<!--/TMPL_IF -->
+
             </td>
-            <td>
+			<td class="cell">
                 <input type="text" name="notes" value="<!-- TMPL_VAR name="notes" -->" size=20 maxlength=255>
-            </td>
-            <td>
-                <a href="javascript:PrintList(<!-- TMPL_VAR name="subscriptionid" -->,'<!-- TMPL_VAR name="serialseq" -->')" class="button serial">print</a>
+			<!--TMPL_IF Name="serialadditems" -->
+				<br /><br />
+				<!--TMPL_IF Name="itemlocation"-->
+					<select name="location" size="1">
+						<option value="">Location</option>
+						<!-- TMPL_LOOP name="itemlocationloop" -->
+							<option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="itemlocationname" --></option>
+						<!-- /TMPL_LOOP -->
+					</select>
+				<!-- TMPL_ELSE -->
+				&nbsp;
+				<!--/TMPL_IF-->
+			<!--/TMPL_IF -->
             </td>
         </tr>
     <!-- /TMPL_LOOP -->
     <!-- TMPL_UNLESS name="hassubscriptionexpired" -->
         <tr>
-            <td>
-                Manual issue <input type="text" name="serialseq" size=30 maxlength=100>
+			<td class="cell">
+				Manual issue <input type="text" name="serialseq" size=30 maxlength=100 value="<!-- TMPL_VAR NAME="missingseq" -->">
+			<!--TMPL_IF Name="serialadditems" -->
+				<br /><br />
+				Callnumber <input type="text" name="itemcallnumber" value="" size=10 maxlength=15>
+				Barcode <input type="text" name="barcode" value="" size=20 maxlength=20>
+			<!--/TMPL_IF-->
+			</td>
+			<td class="cell">
+				<input type="text" name="publisheddate" value="<!-- TMPL_VAR name="publisheddate" -->" size=10 maxlength=15>
+			<!--TMPL_IF Name="serialadditems" -->
+				<br /><br />&nbsp;
+			<!--/TMPL_IF  -->
             </td>
-            <td>
-                <input type="text" name="planneddate" size=10 maxlength=15>
+			<td class="cell">
+				<input type="text" name="planneddate" size=10 maxlength=15 value="<!-- TMPL_VAR NAME="missingdate" -->">
+			<!--TMPL_IF Name="serialadditems" -->
+				<br /><br />
+				<select name="branch" size="1">
+						<option value="">Branch</option>
+			<!-- TMPL_LOOP name="branchloop" -->
+				<option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="branchname" --></option>
+			<!-- /TMPL_LOOP -->
+				</select>
+			<!--/TMPL_IF-->
             </td>
-            <td>
+			<td class="cell">
+				<!-- TMPL_IF NAME="frommissing" -->
+				<input type="hidden" name="serialid" value="<!-- TMPL_VAR name="missingid" -->">
+				<!-- TMPL_ELSE -->
                 <input type="hidden" name="serialid" value="0">
+				<!--/TMPL_IF-->
                 <select name="status" size="1">
+						<!-- TMPL_IF NAME="frommissing" -->
+						<option value="2" selected >Arrived</option>
+						<!-- TMPL_ELSE -->
                         <option value="2">Arrived</option>
+				
+						<!--/TMPL_IF-->
+						<!-- TMPL_IF NAME="frommissing" -->
+						<option value="3">Late</option>
+						<!--TMPL_ELSE-->
                         <option value="3" selected>Late</option>
+						<!--/TMPL_IF-->
                         <option value="4">Missing</option>
+						<option value="5">Not Available</option>
+
+
                 </select>
+			<!--TMPL_IF Name="serialadditems" -->
+				<br /><br />
+				<!-- TMPL_IF Name="itemstatus"-->
+				    <!--TMPL_IF Name="choice"-->
+						<!-- TMPL_LOOP name="itemstatusloop" -->
+							<!-- TMPL_VAR name="itemlib" -->: <input type="checkbox" name="itemstatus" value="<!-- TMPL_VAR name="itemval" -->" <!-- TMPL_IF name="selected" -->checked<!-- /TMPL_IF -->>
+						<!-- /TMPL_LOOP -->
+				    <!--TMPL_ELSE-->
+					<select name="itemstatus" size="1">
+						<option value="">Item Status</option>
+						<!-- TMPL_LOOP name="itemstatusloop" -->
+							<option value="<!-- TMPL_VAR name="itemval" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="itemlib" --></option>
+						<!-- /TMPL_LOOP -->
+					</select>
+				    <!-- /TMPL_IF -->
+				<!-- TMPL_ELSE -->
+				&nbsp;
+				<!--/TMPL_IF -->
+			<!--/TMPL_IF-->
+			</td>
+			<td class="cell">
+				&nbsp;
+			<!--TMPL_IF Name="serialadditems" -->
+				<br /><br />
+				<!-- TMPL_IF Name="itemlocation"-->
+					<select name="location" size="1">
+						<option value="">Location</option>
+						<!-- TMPL_LOOP name="itemlocationloop" -->
+							<option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="itemlocationname" --></option>
+						<!-- /TMPL_LOOP -->
+					</select>
+				<!-- TMPL_ELSE -->
+				&nbsp;
+				<!--/TMPL_IF -->
+			<!--/TMPL_IF-->
             </td>
         </tr>
     <!-- /TMPL_UNLESS -->
     </table>
-    <input type="submit" value="Save changes" accesskey="w" class="button serial">
+	<input type="submit" value="Save changes" accesskey="w" class="button">
     <!-- TMPL_IF name="hassubscriptionexpired" -->
-        <p>Subscription has expired. Waited last issue status can't be changed. <a href="#" onClick="popup()" class="button serial">Renew</a> your subscription</p>
+		<h3>Subscription has expired.</h3>
+		<p><b>Waited last issue status can't be changed. <a href="#" onClick="popup()" class="button">Renew</a> your subscription</b></p>
+	<!-- /TMPL_IF -->
+	<!-- TMPL_IF name="abouttoexpire" -->
+		<h3>Note: Subscription is about to expire next issue.</h3>
+		<script type="text/javascript">
+		<!--
+		alert("Subscription is about to expire next issue");
+		//-->
+		</script>
     <!-- /TMPL_IF -->
     </form>
 </div>
 
-<div id="bloc25">
-    <h2 class="serial">Subscription summary</h2>
-    <form method="post" name="f" action="serials-recieve.pl">
+<div class="bloc25">
+	<h2>Subscription summary</h2>
+	<form method="post" name="f2" action="statecollection.pl">
         <input type="hidden" name="op" value="modsubscriptionhistory">
         <input type="hidden" name="serial" value="<!-- TMPL_VAR name="serial" -->">
         <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->">
         <input type="hidden" name="user" value="<!-- TMPL_VAR name="user" -->">
-        <p><label>Librarian</label><!-- TMPL_VAR name="user" --></p>
+		<p><label class="label100">Librarian</label><!-- TMPL_VAR name="user" --></p>
         <p><label class="label100">Beginnning date (*)</label><input type="text" name="histstartdate" value="<!-- TMPL_VAR name="histstartdate" -->"></p>
         <p><label class="label100">End date</label><input type="text" name="enddate" value="<!-- TMPL_VAR name="enddate" -->"></p>
         <p>Recieved issues</p>
         <p>&nbsp;<textarea name="recievedlist" COLS=60 ROWS=5><!-- TMPL_VAR name="recievedlist" --></textarea></p>
         <p>Missing issues</p>
         <p>&nbsp;<textarea name="missinglist" COLS=60 ROWS=2><!-- TMPL_VAR name="missinglist" --></textarea></p>
-        <!--TMPL_IF Name="notissuedlist"-->
-        <p>Not issued</p>
-        <p>&nbsp;<textarea name="notissuedlist" COLS=60 ROWS=2><!-- TMPL_VAR name="notissuedlist" --></textarea></p>
-        <!--/TMPL_IF-->
         <p>Opac's note</p>
         <p>&nbsp;<textarea name="opacnote" COLS=60 ROWS=5><!-- TMPL_VAR name="opacnote" --></textarea></p>
-        <input type="submit" value="Save changes" class="button serial">
+		<input type="submit" value="Save changes" class="button">
     </form>
 </div>
 
-</table>
+</div>
 <script language="JavaScript" type="text/javascript">
 
 function popup() {
-     window.open("subscription-renew.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid">","subscription renewal",'width=700,height=400,toolbar=false,scrollbars=yes');
+	window.open("subscription-renew.pl?subscriptionid=<!-- TMPL_VAR
+name="subscriptionid">","subscription_renewal",'width=700,height=400,toolbar=false,scrollbars=yes');
 }
 
-function PrintList(subscriptionid,serialseq) {
-    window.open("printlist.pl?subscriptionid="+subscriptionid+"&serialseq="+serialseq);
+function barcode_check(){
+    <!-- TMPL_IF NAME="count" -->
+	var count = '<!-- TMPL_VAR NAME="count" -->';
+	for(var i=1;i<=count;i++){
+
+		var barcodenum = "barcode"+i;
+		var statusnum = "status"+i;
+		var elembarcode = "document.getElementById('"+barcodenum+"')";
+		var elemstatus = "document.getElementById('"+statusnum+"')";
+// alert(elembarcode+"\n"+eval(elembarcode+".value));
+// alert(elemstatus+"\n"+eval(elemstatus+".value"));
+		if(eval(elembarcode+".value") =='' && eval(elemstatus+".value") == 2){
+			var answer = confirm("Leave barcode blank?\n - Note: unable to change this later");
+			if (answer){
+				document.f.submit();
+			} else {
+				return false;
+			}
+		}
+		if(eval(elembarcode+".value".indexOf('TEMP')) > 0 && eval(elemstatus+".value") == 2){
+			var answer = confirm("A barcode was not entered.\nDo you want to put in a barcode\nor do you want to use a system generated barcode?");
+			if (answer){
+				document.f.submit();
+			} else {
+				return false;
+			}
+		}
+	}
+    <!-- /TMPL_IF -->
 }
 </script>
-<!-- TMPL_INCLUDE name="serials-bottom.inc" -->
+
+<!-- TMPL_INCLUDE name="intranet-bottom.inc" -->

Index: koha-tmpl/intranet-tmpl/prog/en/serials/subscription-add.tmpl
===================================================================
RCS file: /cvsroot/koha/koha/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-add.tmpl,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -b -r1.3.2.1 -r1.3.2.2
--- koha-tmpl/intranet-tmpl/prog/en/serials/subscription-add.tmpl	6 Sep 2006 12:57:42 -0000	1.3.2.1
+++ koha-tmpl/intranet-tmpl/prog/en/serials/subscription-add.tmpl	2 Oct 2006 09:15:44 -0000	1.3.2.2
@@ -630,7 +630,7 @@
 
 function check_input(e){
 	var unicode=e.charCode? e.charCode : e.keyCode
-	if (unicode!=8 && unicode !=46){ // if key isn't backspace or delete
+	if (unicode!=8 && unicode !=46 && unicode!=9 && unicode !=13){ // if key isn't backspace or delete
 		if (unicode<48||unicode>57) { // if not a number
 			alert("Needs to be entered in digit form -eg 10");
 			return false // disable key press
@@ -662,9 +662,9 @@
 	<tr><td>Librarian:</td>
 	    <td><!-- TMPL_VAR name="loggedinusername" --></td></tr>
 	<tr><td><label>Supplier:</label></td>
-	    <td><input type="text" name="aqbooksellerid" value="<!-- TMPL_VAR name="aqbooksellerid" -->" size="4"> (<input type="text" name="aqbooksellername" value="<!-- TMPL_VAR name="aqbooksellername" -->" disabled readonly>) <a href="#" onClick="FindAcqui(f)">Search for a Supplier</a></td>
+	    <td><input type="text" name="aqbooksellerid" value="<!-- TMPL_VAR name="aqbooksellerid" -->" size="8"> (<input type="text" name="aqbooksellername" value="<!-- TMPL_VAR name="aqbooksellername" -->" disabled readonly>) <a href="#" onClick="FindAcqui(f)">Search for a Supplier</a></td>
 	<tr><td><label>Biblio</label></td>
-	    <td><input type="text" name="biblionumber" value="<!-- TMPL_VAR name="biblionumber" -->" size="4"> (<input type="text" name="title" value="<!-- TMPL_VAR name="bibliotitle" -->" disabled readonly>) <a href="#" onClick="Plugin(f)">Search for Biblio</a> | <a href="/cgi-bin/koha/acqui/acqui-home.pl">Create Biblio</a></td>
+	    <td><input type="text" name="biblionumber" value="<!-- TMPL_VAR name="biblionumber" -->" size="8"> (<input type="text" name="title" value="<!-- TMPL_VAR name="bibliotitle" -->" disabled readonly>) <a href="#" onClick="Plugin(f)">Search for Biblio</a> | <a href="/cgi-bin/koha/acqui/acqui-home.pl">Create Biblio</a></td>
 	<tr><td><label>Call Number</label></td>
 	    <td><input type="text" name="callnumber" value="<!-- TMPL_VAR name="callnumber" -->" size="20"></td></tr>
 	<tr><td><label>Notes</label></td>

Index: koha-tmpl/intranet-tmpl/prog/en/serials/subscription-detail.tmpl
===================================================================
RCS file: /cvsroot/koha/koha/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-detail.tmpl,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -b -r1.3.2.1 -r1.3.2.2
--- koha-tmpl/intranet-tmpl/prog/en/serials/subscription-detail.tmpl	6 Sep 2006 12:57:42 -0000	1.3.2.1
+++ koha-tmpl/intranet-tmpl/prog/en/serials/subscription-detail.tmpl	2 Oct 2006 09:15:44 -0000	1.3.2.2
@@ -137,9 +137,9 @@
 <div id="mainbloc">
 <h1>Subscription</h1>
 <a href="subscription-add.pl?op=mod&amp;subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->" class="button">Edit</a>
-<a href="statecollection.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->" class="button">Receive</a>
-<!--<a href="/cgi-bin/koha/MARCdetail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button">Biblio</a>-->
-<a href="/cgi-bin/koha/detail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button">Biblio</a>
+<a href="serials-recieve.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->" class="button">Receive</a>
+
+<a href="/cgi-bin/koha/catalogue/MARCdetail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button">Biblio</a>
 <!-- TMPL_IF NAME="routing" -->
 <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=<!-- TMPL_VAR NAME="subscriptionid" -->" class="button">Edit Routing List</a>
 <!-- TMPL_ELSE -->

Index: serials/routing.pl
===================================================================
RCS file: /cvsroot/koha/koha/serials/routing.pl,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -b -r1.1 -r1.1.2.1
--- serials/routing.pl	20 Jul 2006 03:20:55 -0000	1.1
+++ serials/routing.pl	2 Oct 2006 09:15:44 -0000	1.1.2.1
@@ -42,7 +42,7 @@
     
 my ($routing, @routinglist) = getroutinglist($subscriptionid);
 my $subs = GetSubscription($subscriptionid);
-my ($count, at serials) = old_getserials($subscriptionid);
+my ($count, at serials) = GetSerials($subscriptionid);
 my ($serialdates) = GetLatestSerials($subscriptionid,$count);
 
 my @dates;

Index: serials/routing-preview.pl
===================================================================
RCS file: /cvsroot/koha/koha/serials/routing-preview.pl,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -b -r1.1.2.1 -r1.1.2.2
--- serials/routing-preview.pl	31 Aug 2006 16:26:42 -0000	1.1.2.1
+++ serials/routing-preview.pl	2 Oct 2006 09:15:44 -0000	1.1.2.2
@@ -14,8 +14,8 @@
 use C4::Circulation::Circ2;
 use C4::Interface::CGI::Output;
 use C4::Context;
-use HTML::Template;
-use C4::Search;
+use C4::Members;
+use C4::Biblio;
 use C4::Serials;
 
 my $query = new CGI;
@@ -56,7 +56,7 @@
 	    $count--;
         }
     }
-    my ($count2, at bibitems) = bibitems($biblio);
+    my ($count2, at bibitems) = GetBiblioItemByBiblioNumber($biblio);
     my @itemresults = GetItemsInfo($subs->{'biblionumber'}, 'intra');
     my $branch = $itemresults[0]->{'holdingbranch'};
     my $const = 'o';
@@ -85,6 +85,7 @@
 				flagsrequired => {catalogue => 1},
 				debug => 1,
 				});    
+    $template->param("libraryname"=>C4::Context->preference("LibraryName"));
 } else {
     ($template, $loggedinuser, $cookie)
 = get_template_and_user({template_name => "serials/routing-preview.tmpl",

Index: serials/serials-recieve.pl
===================================================================
RCS file: /cvsroot/koha/koha/serials/Attic/serials-recieve.pl,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -b -r1.4 -r1.4.2.1
--- serials/serials-recieve.pl	21 Jul 2006 09:19:38 -0000	1.4
+++ serials/serials-recieve.pl	2 Oct 2006 09:15:44 -0000	1.4.2.1
@@ -17,7 +17,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: serials-recieve.pl,v 1.4 2006/07/21 09:19:38 toins Exp $
+# $Id: serials-recieve.pl,v 1.4.2.1 2006/10/02 09:15:44 hdl Exp $
 
 =head1 NAME
 
@@ -89,6 +89,7 @@
 my @serialids = $query->param('serialid');
 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 @barcodes = $query->param('barcode');
@@ -128,7 +129,7 @@
 		
 		my ($oldstatus) = $sth->fetchrow;
 		if ($serialids[$i]) {
-			ModSerialStatus($serialids[$i],$serialseqs[$i],format_date_in_iso($planneddates[$i]),$status[$i],$notes[$i]) unless ($hassubscriptionexpired && $oldstatus == 1);
+			SerialChangeStatus($serialids[$i],$serialseqs[$i],format_date_in_iso($planneddates[$i]),format_date_in_iso($publisheddates[$i]),$status[$i],$notes[$i]) unless ($hassubscriptionexpired && $oldstatus == 1);
 			if (($status[$i]==2) && C4::Context->preference("serialsadditems")){
 				my %info;
 				$info{branch}=$homebranches[$i];
@@ -149,7 +150,7 @@
 		} else {
 			# add a special issue
 			if ($serialseqs[$i]) {
-				NewIssue($serialseqs[$i],$subscriptionid,$subscription->{biblionumber},$status[$i], format_date_in_iso($planneddates[$i]));
+				NewIssue($serialseqs[$i],$subscriptionid,$subscription->{biblionumber},$status[$i] ,format_date_in_iso($publisheddates[$i]),format_date_in_iso($planneddates[$i]));
 			}
 			if (($status[$i]==2) && C4::Context->preference("serialsadditems") && !hassubscriptionexpired($subscriptionid)){
 				my %info;
@@ -173,7 +174,7 @@
 	}
 }
 my ($template, $loggedinuser, $cookie)
-= get_template_and_user({template_name => "serials/statecollection.tmpl",
+= get_template_and_user({template_name => "serials/serials-recieve.tmpl",
 				query => $query,
 				type => "intranet",
 				authnotrequired => 0,
@@ -218,7 +219,7 @@
 		push @branchloop, \%row;
 	}
 	
-	my $itemstatushash = getitemstatus($fwk);
+	my $itemstatushash = GetItemStatus($fwk);
 	my @itemstatusloop;
         my $itemstatusloopcount=0;    
 	foreach my $thisitemstatus (keys %$itemstatushash) {
@@ -230,7 +231,7 @@
 		push @itemstatusloop, \%row;
 	}
 	
-	my $itemlocationhash = getitemlocation($fwk);
+	my $itemlocationhash = GetItemLocation($fwk);
 	my @itemlocationloop;
 	foreach my $thisitemlocation (keys %$itemlocationhash) {
 		my %row =(value => $thisitemlocation,

Index: serials/statecollection.pl
===================================================================
RCS file: /cvsroot/koha/koha/serials/Attic/statecollection.pl,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -b -r1.2.2.1 -r1.2.2.2
--- serials/statecollection.pl	26 Sep 2006 13:27:41 -0000	1.2.2.1
+++ serials/statecollection.pl	2 Oct 2006 09:15:44 -0000	1.2.2.2
@@ -7,8 +7,7 @@
 use C4::Output;
 use C4::Interface::CGI::Output;
 use C4::Context;
-use C4::Bull;
-use HTML::Template;
+use C4::Serials;
 
 my $query = new CGI;
 my $op = $query->param('op');
@@ -36,8 +35,8 @@
 				debug => 1,
 				});
 
-my $hassubscriptionexpired = hassubscriptionexpired($subscriptionid);
-my $subscription=getsubscription($subscriptionid);
+my $HasSubscriptionExpired = HasSubscriptionExpired($subscriptionid);
+my $subscription=GetSubscription($subscriptionid);
 if ($op eq 'modsubscriptionhistory') {
 	modsubscriptionhistory($subscriptionid,$histstartdate,$enddate,$recievedlist,$missinglist,$opacnote,$librariannote);
 }
@@ -48,7 +47,7 @@
 		$sth->execute($serialids[$i]);
 		my ($oldstatus) = $sth->fetchrow;
 		if ($serialids[$i]) {
-			serialchangestatus($serialids[$i],$serialseqs[$i],format_date_in_iso($planneddates[$i]),$status[$i],$notes[$i]) unless ($hassubscriptionexpired && $oldstatus == 1);
+			serialchangestatus($serialids[$i],$serialseqs[$i],format_date_in_iso($planneddates[$i]),$status[$i],$notes[$i]) unless ($HasSubscriptionExpired && $oldstatus == 1);
 		} else {
 			# add a special issue
 			if ($serialseqs[$i]) {
@@ -58,8 +57,8 @@
 		}
 	}
 }
-my $subs = &getsubscription($subscriptionid);
-my ($totalissues, at serialslist) = getserials($subscriptionid,10);
+my $subs = &GetSubscription($subscriptionid);
+my ($totalissues, at serialslist) = GetSerials($subscriptionid,10);
 
 my $sth=$dbh->prepare("select * from subscriptionhistory where subscriptionid = ?");
 $sth->execute($subscriptionid);
@@ -77,6 +76,6 @@
 			subscriptionid => $subscriptionid,
 			bibliotitle => $subs->{bibliotitle},
 			biblionumber => $subs->{biblionumber},
-			hassubscriptionexpired =>$hassubscriptionexpired,
+			hassubscriptionexpired =>$HasSubscriptionExpired,
 		);
 output_html_with_http_headers $query, $cookie, $template->output;

Index: serials/subscription-add.pl
===================================================================
RCS file: /cvsroot/koha/koha/serials/subscription-add.pl,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -b -r1.6.2.1 -r1.6.2.2
--- serials/subscription-add.pl	6 Sep 2006 12:57:42 -0000	1.6.2.1
+++ serials/subscription-add.pl	2 Oct 2006 09:15:44 -0000	1.6.2.2
@@ -61,6 +61,7 @@
 my @sub_type_data;
 if ($op eq 'mod') {
 	my $subscriptionid = $query->param('subscriptionid');
+    warn "irregularity :$irregularity numberpattern : $numberpattern, callnumber :$callnumber, firstacquidate :$firstacquidate";
 	my $subs = &GetSubscription($subscriptionid);
 	$auser = $subs->{'user'};
 	$librarian => $subs->{'librarian'},
@@ -195,7 +196,7 @@
 	my $firstacquidate = $query->param('firstacquidate');    
 	my $periodicity = $query->param('periodicity');
 	my $dow = $query->param('dow');
-        # my $irregularity = $query->param('irregularity');
+    my $irregularity = $query->param('irregularity');
 	my $numberlength = 0;
 	my $weeklength = 0;
 	my $monthlength = 0;
@@ -231,13 +232,15 @@
         my $callnumber = $query->param('callnumber');
 	my $notes = $query->param('notes');
         my $hemisphere = $query->param('hemisphere') || 1;
-
-	my $subscriptionid = old_newsubscription($auser,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber,
-					$startdate,$periodicity,$firstacquidate,$dow,$irregularity,$numberpattern,$numberlength,$weeklength,$monthlength,
-					$add1,$every1,$whenmorethan1,$setto1,$lastvalue1,
-					$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,
-					$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,
-					$numberingmethod, $status, $callnumber, $notes, $hemisphere
+    ### BugFIX : hdl doesnot know what innerloops or letter stand for but it seems necessary. So he adds them.
+    my ($innerloop1,$innerloop2,$innerloop3,$letter);
+	my $subscriptionid = NewSubscription($auser,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber,
+					$startdate,$periodicity,$dow,$numberlength,$weeklength,$monthlength,
+					$add1,$every1,$whenmorethan1,$setto1,$lastvalue1,$innerloop1,
+					$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,$innerloop2,
+					$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
+					$numberingmethod, $status, $notes,$letter,$firstacquidate,$irregularity,
+                    $numberpattern, $callnumber, $hemisphere
 				);
 	print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
 } else {

Index: serials/subscription-detail.pl
===================================================================
RCS file: /cvsroot/koha/koha/serials/subscription-detail.pl,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -b -r1.3.2.1 -r1.3.2.2
--- serials/subscription-detail.pl	6 Sep 2006 12:57:42 -0000	1.3.2.1
+++ serials/subscription-detail.pl	2 Oct 2006 09:15:44 -0000	1.3.2.2
@@ -97,7 +97,7 @@
 }
 my $subs = &GetSubscription($subscriptionid);
 my ($routing, @routinglist) = getroutinglist($subscriptionid);
-my ($totalissues, at serialslist) = old_getserials($subscriptionid);
+my ($totalissues, at serialslist) = GetSerials($subscriptionid);
 $totalissues-- if $totalissues; # the -1 is to have 0 if this is a new subscription (only 1 issue)
 # the subscription must be deletable if there is NO issues for a reason or another (should not happend, but...)
 

Index: updater/updatedatabase
===================================================================
RCS file: /cvsroot/koha/koha/updater/updatedatabase,v
retrieving revision 1.157.2.4
retrieving revision 1.157.2.5
diff -u -b -r1.157.2.4 -r1.157.2.5
--- updater/updatedatabase	19 Sep 2006 07:44:13 -0000	1.157.2.4
+++ updater/updatedatabase	2 Oct 2006 09:15:44 -0000	1.157.2.5
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: updatedatabase,v 1.157.2.4 2006/09/19 07:44:13 btoumi Exp $
+# $Id: updatedatabase,v 1.157.2.5 2006/10/02 09:15:44 hdl Exp $
 
 # Database Updater
 # This script checks for required updates to the database.
@@ -179,16 +179,26 @@
 	                        borrower1 integer,
 	                        borrower2 integer
 	                        )",
+    subscriptionroutinglist=>"(
+                             routingid integer NOT NULL auto_increment,
+                             borrowernumber integer,
+                             ranking integer,
+                             subscriptionid integer,
+	                        PRIMARY KEY (routingid)
+                             )",
+
+
 
 );
 
 my %requirefields = (
-	subscription => { 'letter' => 'char(20) NULL', 'distributedto' => 'text NULL'},
+	subscription => { 'letter' => 'char(20) NULL', 'distributedto' => 'text NULL', 'firstacquidate'=>'date NOT NULL','irregularity'=>'TINYINT(3) NULL default 0','numberpattern'=>'TINYINT(3) NULL default 0', 'callnumber'=>'text NULL', 'hemisphere' =>'TINYINT(3) NULL default 0', 'issuesatonce'=>'TINYINT(3) NOT NULL default 1'},
 	itemtypes => { 'imageurl' => 'char(200) NULL'},
 	aqbookfund => { 'branchcode' => 'varchar(4) NULL'},
 	aqbudget => { 'branchcode' => 'varchar(4) NULL'},
 	auth_header => { 'marc' => 'BLOB NOT NULL', 'linkid' => 'BIGINT(20) NULL'},
 	auth_subfield_structure =>{ 'hidden' => 'TINYINT(3) NOT NULL UNSIGNED ZEROFILL', 'kohafield' => 'VARCHAR(45) NOT NULL', 'linkid' =>  'TINYINT(1) NOT NULL UNSIGNED', 'isurl' => 'TINYINT(1) UNSIGNED'},
+	serial =>{ 'publisheddate' => 'date', 'itemnumber'=>'text NULL','routingnotes'=>'text NULL',},
         statistics => { 'associatedborrower' => 'integer'},
 #    tablename        => { 'field' => 'fieldtype' },
 );
@@ -1678,6 +1688,16 @@
 exit;
 
 # $Log: updatedatabase,v $
+# Revision 1.157.2.5  2006/10/02 09:15:44  hdl
+# Serials :
+# * synching with NZ-devs on Serials.
+# * adding routing lists support,
+# * adding serialsadditems support
+# * adding publisheddate management
+#
+# TODO :
+# Management for seasonal serials should be fixed in order to be language independant.
+#
 # Revision 1.157.2.4  2006/09/19 07:44:13  btoumi
 # bug fix : modify wrong field name BorrowerMandatoryField
 #





More information about the Koha-cvs mailing list