koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha/C4 Bull.pm,1.6.2.3,1.6.2.4


From: Paul POULAIN
Subject: [Koha-cvs] CVS: koha/C4 Bull.pm,1.6.2.3,1.6.2.4
Date: Fri, 25 Mar 2005 08:26:40 -0800

Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9878/C4

Modified Files:
      Tag: rel_2_2
        Bull.pm 
Log Message:
* adding a sub to manually create an issue
* bugfix for date calc on periodicity=2/year
* minor improvement in subscriptionhistory (remove , at start if any, and 
replace \n by <br/>)

Index: Bull.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Bull.pm,v
retrieving revision 1.6.2.3
retrieving revision 1.6.2.4
diff -C2 -r1.6.2.3 -r1.6.2.4
*** Bull.pm     7 Mar 2005 09:56:42 -0000       1.6.2.3
--- Bull.pm     25 Mar 2005 16:26:38 -0000      1.6.2.4
***************
*** 47,51 ****
  @EXPORT = qw(&newsubscription &modsubscription &delsubscription 
&getsubscriptions &getsubscription 
                        &getsubscriptionfrombiblionumber 
&get_subscription_list_from_biblionumber
!                       &modsubscriptionhistory
                        &getserials &serialchangestatus
                        &Find_Next_Date, &Get_Next_Seq
--- 47,51 ----
  @EXPORT = qw(&newsubscription &modsubscription &delsubscription 
&getsubscriptions &getsubscription 
                        &getsubscriptionfrombiblionumber 
&get_subscription_list_from_biblionumber
!                       &modsubscriptionhistory &newissue
                        &getserials &serialchangestatus
                        &Find_Next_Date, &Get_Next_Seq
***************
*** 179,182 ****
--- 179,184 ----
                $subs->{startdate} = format_date($subs->{startdate});
                $subs->{opacnote} =~ s/\n/\<br\/\>/g;
+               $subs->{missinglist} =~ s/\n/\<br\/\>/g;
+               $subs->{recievedlist} =~ s/\n/\<br\/\>/g;
                push @res,$subs;
        }
***************
*** 244,247 ****
--- 246,252 ----
        my $dbh=C4::Context->dbh;
        my $sth = $dbh->prepare("update subscriptionhistory set 
histstartdate=?,enddate=?,recievedlist=?,missinglist=?,opacnote=?,librariannote=?
 where subscriptionid=?");
+       $recievedlist =~ s/^,//g;
+       $missinglist =~ s/^,//g;
+       $opacnote =~ s/^,//g;
        
$sth->execute($histstartdate,$enddate,$recievedlist,$missinglist,$opacnote,$librariannote,$subscriptionid);
  }
***************
*** 298,303 ****
                # next date (calculated from actual date & frequency parameters)
                my $nextplanneddate = Get_Next_Date($planneddate,$val);
!               $sth = $dbh->prepare("insert into serial 
(serialseq,subscriptionid,biblionumber,status, planneddate) values 
(?,?,?,?,?)");
!               $sth->execute($newserialseq, $subscriptionid, 
$val->{'biblionumber'}, 1, $nextplanneddate);
                $sth = $dbh->prepare("update subscription set lastvalue1=?, 
lastvalue2=?,lastvalue3=?,
                                                                                
                                innerloop1=?,innerloop2=?,innerloop3=?
--- 303,307 ----
                # next date (calculated from actual date & frequency parameters)
                my $nextplanneddate = Get_Next_Date($planneddate,$val);
!               newissue($newserialseq, $subscriptionid, 
$val->{'biblionumber'}, 1, $nextplanneddate);
                $sth = $dbh->prepare("update subscription set lastvalue1=?, 
lastvalue2=?,lastvalue3=?,
                                                                                
                                innerloop1=?,innerloop2=?,innerloop3=?
***************
*** 307,310 ****
--- 311,321 ----
  }
  
+ sub newissue {
+       my ($serialseq,$subscriptionid,$biblionumber,$status, $planneddate) = 
@_;
+       my $dbh = C4::Context->dbh;
+       my $sth = $dbh->prepare("insert into serial 
(serialseq,subscriptionid,biblionumber,status, planneddate) values 
(?,?,?,?,?)");
+       $sth->execute($serialseq,$subscriptionid,$biblionumber,$status, 
$planneddate);
+ }
+ 
  sub Get_Next_Date(@) {
        my ($planneddate,$subscription) = @_;
***************
*** 335,339 ****
        }
        if ($subscription->{periodicity} == 9) {
!               $resultdate=DateCalc($planneddate,"2 weeks");
        }
        if ($subscription->{periodicity} == 10) {
--- 346,350 ----
        }
        if ($subscription->{periodicity} == 9) {
!               $resultdate=DateCalc($planneddate,"6 months");
        }
        if ($subscription->{periodicity} == 10) {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]