[Koha-cvs] koha/C4 Serials.pm

Henri-Damien LAURENT laurenthdl at alinto.com
Thu May 24 18:11:39 CEST 2007


CVSROOT:	/cvsroot/koha
Module name:	koha
Changes by:	Henri-Damien LAURENT <hdl>	07/05/24 16:11:39

Modified files:
	C4             : Serials.pm 

Log message:
	Changing signature for NewIssue
	(To be more unify to other subs signature)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Serials.pm?cvsroot=koha&r1=1.18&r2=1.19

Patches:
Index: Serials.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Serials.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- Serials.pm	23 May 2007 19:57:47 -0000	1.18
+++ Serials.pm	24 May 2007 16:11:39 -0000	1.19
@@ -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.18 2007/05/23 19:57:47 hdl Exp $
+# $Id: Serials.pm,v 1.19 2007/05/24 16:11:39 hdl Exp $
 
 use strict;
 use C4::Date;
@@ -35,7 +35,7 @@
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.18 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.19 $' =~ /\d+/g;
     shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v );
 };
 
@@ -1055,13 +1055,14 @@
 #      use Data::Dumper; warn Dumper($subscription);
 
 #          warn "dateCHECKRESERV :".$subscription->{startdate};
+    if ($subscription->{periodicity}){
     if ( $subscription->{numberlength} ) {
         #calculate the date of the last issue.
         my $length = $subscription->{numberlength};
-#         warn "ENDDATE ".$enddate;
+  #         warn "ENDDATE ".$enddate;
         for ( my $i = 1 ; $i <= $length ; $i++ ) {
             $enddate = GetNextDate( $enddate, $subscription );
-#             warn "AFTER ENDDATE ".$enddate;
+  #             warn "AFTER ENDDATE ".$enddate;
         }
     }
     elsif ( $subscription->{monthlength} ){
@@ -1070,21 +1071,24 @@
         $enddate=sprintf("%04d-%02d-%02d",$enddate[0],$enddate[1],$enddate[2]);
     } elsif ( $subscription->{weeklength} ){
         my @date=split (/-/,$subscription->{startdate});
-#         warn "dateCHECKRESERV :".$subscription->{startdate};
-#### An other way to do it
-#         if ( $subscription->{weeklength} ){
-#           my ($weeknb,$year)=Week_of_Year(@startdate);
-#           $weeknb += $subscription->{weeklength};
-#           my $weeknbcalc= $weeknb % 52;
-#           $year += int($weeknb/52);
-# #           warn "year : $year weeknb :$weeknb weeknbcalc $weeknbcalc";
-#           @endofsubscriptiondate=Monday_of_Week($weeknbcalc,$year);
-#         }
+  #         warn "dateCHECKRESERV :".$subscription->{startdate};
+  #### An other way to do it
+  #         if ( $subscription->{weeklength} ){
+  #           my ($weeknb,$year)=Week_of_Year(@startdate);
+  #           $weeknb += $subscription->{weeklength};
+  #           my $weeknbcalc= $weeknb % 52;
+  #           $year += int($weeknb/52);
+  # #           warn "year : $year weeknb :$weeknb weeknbcalc $weeknbcalc";
+  #           @endofsubscriptiondate=Monday_of_Week($weeknbcalc,$year);
+  #         }
         my @enddate = Add_Delta_Days($date[0],$date[1],$date[2],$subscription->{weeklength}*7);
         $enddate=sprintf("%04d-%02d-%02d",$enddate[0],$enddate[1],$enddate[2]);
     }
-#     warn "date de fin :$enddate";
+  #     warn "date de fin :$enddate";
     return $enddate;
+    } else {
+      return 0;  
+    }  
 }
 
 =head2 CountSubscriptionFromBiblionumber
@@ -1482,8 +1486,8 @@
 =cut
 
 sub NewIssue {
-    my ( $serialseq, $subscriptionid, $biblionumber, $status, $publisheddate,
-        $planneddate, $notes )
+    my ( $serialseq, $subscriptionid, $biblionumber, $status, 
+        $planneddate, $publisheddate, $notes )
       = @_;
     ### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ?
     





More information about the Koha-cvs mailing list