[Koha-cvs] CVS: koha/bull acqui-search.pl,1.1,1.2 order.pl,1.1,1.2 receipt.pl,1.1,1.2 statecollection.pl,1.1,1.2 subscription-add.pl,1.1,1.2 subscription-bib-search.pl,1.1,1.2 subscription-detail.pl,1.1,1.2

Paul POULAIN tipaul at users.sourceforge.net
Thu Aug 5 18:34:46 CEST 2004


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

Modified Files:
	acqui-search.pl order.pl receipt.pl statecollection.pl 
	subscription-add.pl subscription-bib-search.pl 
	subscription-detail.pl 
Log Message:
reordering code & debugging

Index: acqui-search.pl
===================================================================
RCS file: /cvsroot/koha/koha/bull/acqui-search.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** acqui-search.pl	30 Jul 2004 14:02:50 -0000	1.1
--- acqui-search.pl	5 Aug 2004 16:34:41 -0000	1.2
***************
*** 8,13 ****
  use C4::Database;
  use HTML::Template;
! use C4::Catalogue;
! 
  my $query = new CGI;
  my ($template, $loggedinuser, $cookie)
--- 8,12 ----
  use C4::Database;
  use HTML::Template;
! use C4::Acquisition;
  my $query = new CGI;
  my ($template, $loggedinuser, $cookie)
***************
*** 21,25 ****
  
  # budget
! my ($count, at results)=bookfunds;
  my $classlist='';
  my $total=0;
--- 20,24 ----
  
  # budget
! my ($count, at results)=&bookfunds;
  my $classlist='';
  my $total=0;

Index: order.pl
===================================================================
RCS file: /cvsroot/koha/koha/bull/order.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** order.pl	30 Jul 2004 14:06:30 -0000	1.1
--- order.pl	5 Aug 2004 16:34:42 -0000	1.2
***************
*** 25,29 ****
  
  use strict;
! use C4::Catalogue;
  use C4::Auth;
  use C4::Biblio;
--- 25,29 ----
  
  use strict;
! use C4::Acquisition;
  use C4::Auth;
  use C4::Biblio;
***************
*** 33,37 ****
  use C4::Database;
  use HTML::Template;
- use C4::Catalogue;
  use C4::Date;
  
--- 33,36 ----

Index: receipt.pl
===================================================================
RCS file: /cvsroot/koha/koha/bull/receipt.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** receipt.pl	30 Jul 2004 14:12:07 -0000	1.1
--- receipt.pl	5 Aug 2004 16:34:42 -0000	1.2
***************
*** 31,35 ****
      
  
!     my $sth = $dbh->prepare("select subscriptionid, perioid from subscription");
      $sth->execute();
      my @finalsolution;
--- 31,35 ----
      
  
!     my $sth = $dbh->prepare("select subscriptionid, biblionumber from subscription");
      $sth->execute();
      my @finalsolution;
***************
*** 37,41 ****
      {
  	my $sth2 = $dbh->prepare("select b3.title from biblioitems b2, biblio b3 where b3.biblionumber = ? and b2.biblionumber = b3.biblionumber and (b2.issn = ? or b3.title like ?)");
! 	$sth2->execute($first_step->{'perioid'},$search, "%$search%");
  	my @answear;
  	@answear = $sth2->fetchrow_array;
--- 37,41 ----
      {
  	my $sth2 = $dbh->prepare("select b3.title from biblioitems b2, biblio b3 where b3.biblionumber = ? and b2.biblionumber = b3.biblionumber and (b2.issn = ? or b3.title like ?)");
! 	$sth2->execute($first_step->{'biblionumber'},$search, "%$search%");
  	my @answear;
  	@answear = $sth2->fetchrow_array;

Index: statecollection.pl
===================================================================
RCS file: /cvsroot/koha/koha/bull/statecollection.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** statecollection.pl	30 Jul 2004 14:12:07 -0000	1.1
--- statecollection.pl	5 Aug 2004 16:34:42 -0000	1.2
***************
*** 13,99 ****
  my $op = $query->param('op');
  my $dbh = C4::Context->dbh;
! my $sid = $query->param('subsid');
! my $ser = $query->param('serial');
! warn "$ser la valeur du nom du formulaire";
! if ($op eq 'modsubscriptionhistory')
! {
!    my $auser = $query->param('user');
!    my $status = $query->param('status');
!    my $waited = $query->param('waited');
!    my $begin = $query->param('begin');
!    my $end = $query->param('end');
!    my $arrived = $query->param('arrived');
!    my $gapped = $query->param('gapped');
!    my $opac = $query->param('opac');
!    my $intra = $query->param('intra');
! 
!     my $sth=$dbh->prepare("update subscriptionhistory set startdate=?, enddate=?,missinglist=?, recievedlist=?, opacnote=?, librariannote=? where subscriptionid = ?");
!  $sth->execute($begin, $end, $gapped, $arrived, $opac, $intra, $sid);
! 
!    if ($status != 1)
!    {
!        if ($status == 2)
!        {
! 	   $sth = $dbh->prepare("select recievedlist from subscriptionhistory where subscriptionid = ?");
! 	   $sth->execute($sid);
! 	   my $received = $sth->fetchrow;
! 	   $sth = $dbh->prepare("select * from subscription where subscriptionid = ? ");
! 	   $sth->execute($sid);
! 	   my $val = $sth->fetchrow_hashref;
! 	   $sth = $dbh->prepare("update serial set serialseq = ? where subscriptionid = ? and status = 1");
! 	   my ($temp, $X, $Y, $Z, $Xpos, $Ypos, $Zpos) = Get_Next_Seq($val->{'numberingmethod'},$val->{'seqnum1'},$val->{'freq1'}, $val->{'step1'}, $val->{'seqtype1'}, $val->{'seqnum2'}, $val->{'freq2'}, $val->{'step2'}, $val->{'seqtype2'}, $val->{'seqnum3'}, $val->{'freq3'}, $val->{'step3'}, $val->{'seqtype3'}, $val->{'pos1'}, $val->{'pos2'}, $val->{'pos3'});
! 	   $sth->execute($temp, $sid);
! 	   $sth = $dbh->prepare("update subscription set seqnum1=?, seqnum2=?,seqnum3=?,pos1=?,pos2=?,pos3=? where subscriptionid = ?");
! 	   $sth->execute($X, $Y, $Z, $Xpos, $Ypos, $Zpos, $sid);
! 	   $sth = $dbh->prepare("update subscriptionhistory set recievedlist=? where subscriptionid = ?");
! 	   if (length($received) > 2)
! 	   {
! 	       $sth->execute("$received,$waited", $sid);
! 	   }
! 	   else
! 	   {
! 	       $sth->execute($waited, $sid);
! 	   }
! 	   
!        }
!        elsif ($status == 3)
!        {
! 	   $sth = $dbh->prepare("select missinglist from subscriptionhistory where subscriptionid = ?");
! 	   $sth->execute($sid);
! 	   my $missing = $sth->fetchrow;
! 	   $sth = $dbh->prepare("select * from subscription where subscriptionid = ? ");
! 	   $sth->execute($sid);
! 	   my $val = $sth->fetchrow_hashref;
! 	   $sth = $dbh->prepare("update serial set status = 2 where subscriptionid = ? and status = 1");
! 	   $sth->execute($sid);
! 	   $sth = $dbh->prepare("insert into serial (serialseq,subscriptionid,biblionumber,status, planneddate) values (?,?,?,?,?)");
! 	   my ($temp, $X, $Y, $Z, $Xpos, $Ypos, $Zpos) = Get_Next_Seq($val->{'numberingmethod'},$val->{'seqnum1'},$val->{'freq1'}, $val->{'step1'}, $val->{'seqtype1'}, $val->{'seqnum2'}, $val->{'freq2'}, $val->{'step2'}, $val->{'seqtype2'}, $val->{'seqnum3'}, $val->{'freq3'}, $val->{'step3'}, $val->{'seqtype3'}, $val->{'pos1'}, $val->{'pos2'}, $val->{'pos3'});
! 	   $sth->execute($temp, $sid, $val->{'biblionumber'}, 1, 0);
! 	   $sth = $dbh->prepare("update subscription set seqnum1=?, seqnum2=?,seqnum3=?,pos1=?,pos2=?,pos3=? where subscriptionid = ?");
! 	   $sth->execute($X, $Y, $Z, $Xpos, $Ypos, $Zpos, $sid);
! 	   $sth = $dbh->prepare("update subscriptionhistory set missinglist=? where subscriptionid = ?");
! 	   if (length($missing) > 2)
! 	   {
! 	       $sth->execute("$missing,$waited", $sid);
! 	   }
! 	   else
! 	   {
! 	       $sth->execute($waited, $sid);
! 	   }
! 
!        }
!        else
!        {
! 	   warn ("Error vous avez fait None dans le formulaire receipt\n");
!        }
!    }
!     
!   $sth->finish;
  }
! my $sth=$dbh->prepare("select serialseq, status, planneddate from serial where subscriptionid = ? and status = ?");
! $sth->execute($sid, 1);
! my $sol = $sth->fetchrow_hashref;
  my $sth=$dbh->prepare("select * from subscriptionhistory where subscriptionid = ?");
! $sth->execute($sid);
  my $solhistory = $sth->fetchrow_hashref;
  my ($template, $loggedinuser, $cookie)
--- 13,41 ----
  my $op = $query->param('op');
  my $dbh = C4::Context->dbh;
! my $subscriptionid = $query->param('subscriptionid');
! # warn "$ser la valeur du nom du formulaire";
! my $auser = $query->param('user');
! my $startdate = $query->param('startdate');
! my $enddate = $query->param('enddate');
! my $recievedlist = $query->param('recievedlist');
! my $missinglist = $query->param('missinglist');
! my $opacnote = $query->param('opacnote');
! my $librariannote = $query->param('librariannote');
! my @serialids = $query->param('serialid');
! my @serialseqs = $query->param('serialseq');
! my @planneddates = $query->param('planneddate');
! my @status = $query->param('status');
! if ($op eq 'modsubscriptionhistory') {
! 	modsubscriptionhistory($subscriptionid,$startdate,$enddate,$recievedlist,$missinglist,$opacnote,$librariannote);
  }
! if ($op eq 'serialchangestatus') {
! 	for (my $i=0;$i<=$#serialids;$i++) {
! 		serialchangestatus($serialids[$i],$serialseqs[$i],$planneddates[$i],$status[$i]);
! 	}
! }
! my @serialslist = getserials($subscriptionid);
! 
  my $sth=$dbh->prepare("select * from subscriptionhistory where subscriptionid = ?");
! $sth->execute($subscriptionid);
  my $solhistory = $sth->fetchrow_hashref;
  my ($template, $loggedinuser, $cookie)
***************
*** 106,124 ****
  				});
  
- 	my ($user, $cookie, $sessionID, $flags)
- 		= checkauth($query, 0, {catalogue => 1}, "intranet");
- 
  	$template->param(
! 		user             => $user,
! 		      serial => $ser,
! 			 status  => $sol->{'status'},
! 			 waited  => $sol->{'serialseq'},
! 			 begin => $solhistory->{'startdate'},
! 			 end => $solhistory->{'enddate'},
! 			 arrived => $solhistory->{'recievedlist'},
! 			 gapped => $solhistory->{'missinglist'},
! 			 opac => $solhistory->{'opacnote'},
! 			 intra => $solhistory->{'librariannote'},
! 			 sid => $sid,
  		);
  output_html_with_http_headers $query, $cookie, $template->output;
--- 48,63 ----
  				});
  
  	$template->param(
! # 			user => $user,
! 			serialslist => \@serialslist,
! # 			status  => $sol->{'status'},
! # 			waited  => $sol->{'serialseq'},
! 			startdate => $solhistory->{'startdate'},
! 			enddate => $solhistory->{'enddate'},
! 			recievedlist => $solhistory->{'recievedlist'},
! 			missinglist => $solhistory->{'missinglist'},
! 			opacnote => $solhistory->{'opacnote'},
! 			librariannote => $solhistory->{'librariannote'},
! 			subscriptionid => $subscriptionid,
  		);
  output_html_with_http_headers $query, $cookie, $template->output;

Index: subscription-add.pl
===================================================================
RCS file: /cvsroot/koha/koha/bull/subscription-add.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** subscription-add.pl	30 Jul 2004 14:12:07 -0000	1.1
--- subscription-add.pl	5 Aug 2004 16:34:42 -0000	1.2
***************
*** 3,8 ****
--- 3,10 ----
  use strict;
  use CGI;
+ use C4::Koha;
  use C4::Auth;
  use C4::Output;
+ use C4::Bull;
  use C4::Interface::CGI::Output;
  use C4::Context;
***************
*** 13,69 ****
  my $op = $query->param('op');
  my $dbh = C4::Context->dbh;
! if ($op eq 'addsubscription')
! {
!    my $auser = $query->param('user');
!   my $supplier = $query->param('supplier');
!    my $cost = $query->param('cost');
!    my $budget = $query->param('budget'); 
!    my $begin = $query->param('begin');
!    my $frequency = $query->param('frequency');
!    my $dow = $query->param('arrival');
!     my $numberlength = $query->param('numberlength');
!     my $weeklength = $query->param('weeklength');
!     my $monthlength = $query->param('monthlength');
!     my $X = $query->param('X');
!     my $Xstate = $query->param('Xstate');
!     my $Xfreq = $query->param('Xfreq');
!     my $Xstep = $query->param('Xstep');
!     my $Y = $query->param('Y');
!     my $Ystate = $query->param('Ystate');
!     my $Yfreq = $query->param('Yfreq');
!     my $Ystep = $query->param('Ystep');
!     my $Z = $query->param('Z');
!     my $Zstate = $query->param('Zstate');
!     my $Zfreq = $query->param('Zfreq');
!     my $Zstep = $query->param('Zstep');
!     my $sequence = $query->param('sequence');
!     my $arrivalplanified = $query->param('arrivalplanified');
!     my $status = 1;
!     my $perioid = $query->param('biblioid');
!     my $notes = $query->param('notes');
! 
!     my $sth=$dbh->prepare("insert into subscription (librarian, aqbooksellerid,cost,aqbudgetid,startdate, periodicity,dow,numberlength,weeklength,monthlength,seqnum1,startseqnum1,seqtype1,freq1,step1,seqnum2,startseqnum2,seqtype2,freq2, step2, seqnum3,startseqnum3,seqtype3, freq3, step3,numberingmethod, arrivalplanified, status, perioid, notes, pos1, pos2, pos3) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, 0, 0, 0)");
!  $sth->execute($auser,$supplier,$cost,$budget,$begin,$frequency,$dow,$numberlength,$weeklength,$monthlength,$X,$X,$Xstate,$Xfreq, $Xstep,$Y,$Y,$Ystate,$Yfreq, $Ystep,$Z,$Z,$Zstate,$Zfreq, $Zstep, $sequence, $arrivalplanified, $status, $perioid, $notes);
!    $sth = $dbh->prepare("select subscriptionid from subscription where perioid = ? and numberingmethod = ?");
!    $sth->execute($perioid, $sequence);
!    my $subid = $sth->fetchrow;
!    
!    $sth = $dbh->prepare("insert into subscriptionhistory (biblioid, subscriptionid, startdate, enddate, missinglist, recievedlist, opacnote, librariannote) values (?,?,?,?,?,?,?,?)");
!    $sth->execute($perioid, $subid, $begin, 0, "", "", 0, $notes);
!    $sth = $dbh->prepare("insert into serial (biblionumber, subscriptionid, serialseq, status, planneddate) values (?,?,?,?,?)");
! 
!    $sth->execute($perioid, $subid, Initialize_Sequence($sequence, $X, $Xstate, $Xfreq, $Xstep, $Y, $Ystate, $Yfreq, $Ystep, $Z, $Zstate, $Zfreq, $Zstep), $status, C4::Bull::Find_Next_Date());
! # biblionumber,
! # subscriptionid,
! # startdate, enddate,
! # missinglist,
! # recievedlist,
! # opacnote,
! # librariannote
!   $sth->finish;
  
-     
-     
- }
  my ($template, $loggedinuser, $cookie)
  = get_template_and_user({template_name => "bull/subscription-add.tmpl",
--- 15,26 ----
  my $op = $query->param('op');
  my $dbh = C4::Context->dbh;
! my ($subscriptionid,$auser,$librarian,$cost,$aqbooksellerid, $aqbooksellername,$aqbudgetid, $bookfundid, $startdate, $periodicity,
! 	$dow, $numberlength, $weeklength, $monthlength,
! 	$seqnum1,$startseqnum1,$seqtype1,$freq1,$step1,
! 	$seqnum2,$startseqnum2,$seqtype2,$freq2,$step2,
! 	$seqnum3,$startseqnum3,$seqtype3,$freq3,$step3,
! 	$numberingmethod, $arrivalplanified, $status, $biblionumber, 
! 	$bibliotitle, $notes);
  
  my ($template, $loggedinuser, $cookie)
  = get_template_and_user({template_name => "bull/subscription-add.tmpl",
***************
*** 75,82 ****
  				});
  
! 	my ($user, $cookie, $sessionID, $flags)
! 		= checkauth($query, 0, {catalogue => 1}, "intranet");
  	$template->param(
! 		user             => $user,
  		);
  output_html_with_http_headers $query, $cookie, $template->output;
--- 32,159 ----
  				});
  
! 
! if ($op eq 'mod') {
! 	my $subscriptionid = $query->param('subscriptionid');
! 	my $subs = &getsubscription($subscriptionid);
! 	$auser = $subs->{'user'};
! 	$librarian => $subs->{'librarian'},
! 	$cost = $subs->{'cost'};
! 	$aqbooksellerid = $subs->{'aqbooksellerid'};
! 	$aqbooksellername = $subs->{'aqbooksellername'};
! 	$bookfundid = $subs->{'bookfundid'};
! 	$aqbudgetid = $subs->{'aqbudgetid'};
! 	$startdate = $subs->{'startdate'};
! 	$periodicity = $subs->{'periodicity'};
! 	$dow = $subs->{'dow'};
! 	$numberlength = $subs->{'numberlength'};
! 	$weeklength = $subs->{'weeklength'};
! 	$monthlength = $subs->{'monthlength'};
! 	$seqnum1 = $subs->{'seqnum1'};
! 	$startseqnum1 = $subs->{'startseqnum1'};
! 	$seqtype1 = $subs->{'seqtype1'};
! 	$freq1 = $subs->{'freq1'};
! 	$step1 = $subs->{'step1'};
! 	$seqnum2 = $subs->{'seqnum2'};
! 	$startseqnum2 = $subs->{'startseqnum2'};
! 	$seqtype2 = $subs->{'seqtype2'};
! 	$freq2 = $subs->{'freq2'};
! 	$step2 = $subs->{'step2'};
! 	$seqnum3 = $subs->{'seqnum3'};
! 	$startseqnum3 = $subs->{'startseqnum3'};
! 	$seqtype3 = $subs->{'seqtype3'};
! 	$freq3 = $subs->{'freq3'};
! 	$step3 = $subs->{'step3'};
! 	$numberingmethod = $subs->{'numberingmethod'};
! 	$arrivalplanified = $subs->{'arrivalplanified'};
! 	$status = $subs->{status};
! 	$biblionumber = $subs->{'biblionumber'};
! 	$bibliotitle = $subs->{'bibliotitle'},
! 	$notes = $subs->{'notes'};
! 	$template->param(
! 		$op => 1,
! 		user => $auser,
! 		librarian => $librarian,
! 		aqbooksellerid => $aqbooksellerid,
! 		aqbooksellername => $aqbooksellername,
! 		cost => $cost,
! 		aqbudgetid => $aqbudgetid,
! 		bookfundid => $bookfundid,
! 		startdate => $startdate,
! 		periodicity => $periodicity,
! 		dow => $dow,
! 		numberlength => $numberlength,
! 		weeklength => $weeklength,
! 		monthlength => $monthlength,
! 		seqnum1 =>$seqnum1,
! 		startseqnum =>$startseqnum1,
! 		seqtype1 =>$seqtype1,
! 		freq1 =>$freq1,
! 		step1 =>$step1,
! 		seqnum2 => $seqnum2,
! 		startseqnum2 => $startseqnum2,
! 		seqtype2 => $seqtype2,
! 		freq2 => $freq2,
! 		step2 => $step2,
! 		seqnum3 => $seqnum3,
! 		startseqnum3 => $startseqnum3,
! 		seqtype3 => $seqtype3,
! 		freq3 => $freq3,
! 		step3 => $step3,
! 		numberingmethod => $numberingmethod,
! 		arrivalplanified => $arrivalplanified,
! 		status => $status,
! 		biblionumber => $biblionumber,
! 		bibliotitle => $bibliotitle,
! 		notes => $notes,
! 		subscriptionid => $subscriptionid
! 		);
  	$template->param(
! 				"periodicity$periodicity" => 1,
! 				"seqtype1$seqtype1" => 1,
! 				"seqtype2$seqtype2" => 1,
! 				"seqtype3$seqtype3" => 1,
! 				"dow$dow" => 1,
! 				);
! } else {
! # fill seqtype with 0 to avoid a javascript error
! 	$template->param(
! 				"seqtype1" => 0,
! 				"seqtype2" => 0,
! 				"seqtype3" => 0,
  		);
+ }
+ if ($op eq 'addsubscription') {
+ 	my $auser = $query->param('user');
+ 	my $aqbooksellerid = $query->param('aqbooksellerid');
+ 	my $cost = $query->param('cost');
+ 	my $aqbudgetid = $query->param('aqbudgetid'); 
+ 	my $startdate = $query->param('startdate');
+ 	my $periodicity = $query->param('periodicity');
+ 	my $dow = $query->param('dow');
+ 	my $numberlength = $query->param('numberlength');
+ 	my $weeklength = $query->param('weeklength');
+ 	my $monthlength = $query->param('monthlength');
+ 	my $seqnum1 = $query->param('seqnum1');
+ 	my $seqtype1 = $query->param('seqtype1');
+ 	my $freq1 = $query->param('freq1');
+ 	my $step1 = $query->param('step1');
+ 	my $seqnum2 = $query->param('seqnum2');
+ 	my $seqtype2 = $query->param('seqtype2');
+ 	my $freq2 = $query->param('freq2');
+ 	my $step2 = $query->param('step2');
+ 	my $seqnum3 = $query->param('seqnum3');
+ 	my $seqtype3 = $query->param('seqtype3');
+ 	my $freq3 = $query->param('freq3');
+ 	my $step3 = $query->param('step3');
+ 	my $numberingmethod = $query->param('numberingmethod');
+ 	my $arrivalplanified = $query->param('arrivalplanified');
+ 	my $status = 1;
+ 	my $biblionumber = $query->param('biblionumber');
+ 	my $notes = $query->param('notes');
+ 
+ 	my $sth=$dbh->prepare("insert into subscription (librarian, aqbooksellerid,cost,aqbudgetid,biblionumber,startdate, periodicity,dow,numberlength,weeklength,monthlength,seqnum1,startseqnum1,seqtype1,freq1,step1,seqnum2,startseqnum2,seqtype2,freq2, step2, seqnum3,startseqnum3,seqtype3, freq3, step3,numberingmethod, arrivalplanified, status, notes, pos1, pos2, pos3) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, 0, 0, 0)");
+ 	newsubscription($auser,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber,$startdate,$periodicity,$dow,$numberlength,$weeklength,$monthlength,$seqnum1,$seqnum1,$seqtype1,$freq1, $step1,$seqnum2,$seqnum2,$seqtype2,$freq2, $step2,$seqnum3,$seqnum3,$seqtype3,$freq3, $step3, $numberingmethod, $arrivalplanified, $status, $notes);
+ 	
+ }
+ 
  output_html_with_http_headers $query, $cookie, $template->output;

Index: subscription-bib-search.pl
===================================================================
RCS file: /cvsroot/koha/koha/bull/subscription-bib-search.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** subscription-bib-search.pl	30 Jul 2004 14:12:07 -0000	1.1
--- subscription-bib-search.pl	5 Aug 2004 16:34:42 -0000	1.2
***************
*** 22,25 ****
--- 22,26 ----
  require Exporter;
  use CGI;
+ use C4::Koha;
  use C4::Auth;
  use HTML::Template;
***************
*** 30,35 ****
  use C4::Interface::CGI::Output;
  use C4::Biblio;
  use C4::SearchMarc;
- use C4::Catalogue;
  use C4::Koha; # XXX subfield_is_koha_internal_p
  
--- 31,36 ----
  use C4::Interface::CGI::Output;
  use C4::Biblio;
+ use C4::Acquisition;
  use C4::SearchMarc;
  use C4::Koha; # XXX subfield_is_koha_internal_p
  

Index: subscription-detail.pl
===================================================================
RCS file: /cvsroot/koha/koha/bull/subscription-detail.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** subscription-detail.pl	30 Jul 2004 14:12:07 -0000	1.1
--- subscription-detail.pl	5 Aug 2004 16:34:42 -0000	1.2
***************
*** 4,7 ****
--- 4,9 ----
  use CGI;
  use C4::Auth;
+ use C4::Koha;
+ use C4::Bull;
  use C4::Output;
  use C4::Interface::CGI::Output;
***************
*** 13,120 ****
  my $dbh = C4::Context->dbh;
  my $sth;
! my $id;
  my ($template, $loggedinuser, $cookie, $subs);
! 
! if ($op eq 'modsubscription')
! {
! 
! 
! # if ($op eq 'addsubscription')
! # {
!     my $id = $query->param('suscr');
!     my $auser = $query->param('user');
!     my $cost = $query->param('cost');
!     my $supplier = $query->param('supplier');
!     my $budget = $query->param('budget'); #stocker le id pas le number
!     my $begin = $query->param('begin');
!     my $frequency = $query->param('frequency');
!     my $dow = $query->param('arrival');
!     my $numberlength = $query->param('numberlength');
!     my $weeklength = $query->param('weeklength');
!     my $monthlength = $query->param('monthlength');
!     my $X = $query->param('X');
!     my $Xstate = $query->param('Xstate');
!     my $Xfreq = $query->param('Xfreq');
!     my $Xstep = $query->param('Xstep');
!     my $Y = $query->param('Y');
!     my $Ystate = $query->param('Ystate');
!     my $Yfreq = $query->param('Yfreq');
!     my $Ystep = $query->param('Ystep');
!     my $Z = $query->param('Z');
!     my $Zstate = $query->param('Zstate');
!     my $Zfreq = $query->param('Zfreq');
!     my $Zstep = $query->param('Zstep');
!     my $sequence = $query->param('sequence');
!     my $arrivalplanified = $query->param('arrivalplanified');
!     my $status = 1;
!     my $perioid = $query->param('biblioid');
!     my $notes = $query->param('notes');
      
!   
!     my $sth=$dbh->prepare("update subscription set librarian=?, aqbooksellerid=?,cost=?,aqbudgetid=?,startdate=?, periodicity=?,dow=?,numberlength=?,weeklength=?,monthlength=?,seqnum1=?,startseqnum1=?,seqtype1=?,freq1=?,step1=?,seqnum2=?,startseqnum2=?,seqtype2=?,freq2=?, step2=?, seqnum3=?,startseqnum3=?,seqtype3=?, freq3=?, step3=?,numberingmethod=?, arrivalplanified=?, status=?, perioid=?, notes=? where subscriptionid = ?");
!   $sth->execute($auser,$supplier,$cost,$budget,$begin,$frequency,$dow,$numberlength,$weeklength,$monthlength,$X,$X,$Xstate,$Xfreq, $Xstep,$Y,$Y,$Ystate,$Yfreq, $Ystep,$Z,$Z,$Zstate,$Zfreq, $Zstep, $sequence, $arrivalplanified, $status, $perioid, $notes, $id);
!    $sth->finish;
!   ($template, $loggedinuser, $cookie)
! = get_template_and_user({template_name => "bull/subscription-detail.tmpl",
! 				query => $query,
! 				type => "intranet",
! 				authnotrequired => 0,
! 				flagsrequired => {catalogue => 1},
! 				debug => 1,
! 				});
! 
! # }
! 	my ($user, $cookie, $sessionID, $flags)
! 		= checkauth($query, 0, {catalogue => 1}, "intranet");
!     $template->param(
!     user => $auser, ,librarian => $auser,
!     aqbooksellerid => $supplier,
!     cost => $cost,
!     aqbudgetid => $budget,
!     startdate => $begin,
!     frequency => $frequency,
!     arrival => $dow,
!     numberlength => $numberlength,
!     weeklength => $weeklength,
!     monthlength => $monthlength,
!     seqnum1 => $X,
!     startseqnum1 => $X,
!     seqtype1 => $Xstate,
!     freq1 => $Xfreq,
!     step1 => $Xstep,
!     seqnum2 => $Y,
!     startseqnum2 => $Y,
!     seqtype2 => $Ystate,
!     freq2 => $Yfreq,
!     step2 => $Ystep,
!     seqnum3 => $Z,
!     startseqnum3 => $Z,
!     seqtype3 => $Zstate,
!     freq3 => $Zfreq,
!     step3 => $Zstep,
!     sequence => $sequence,
!     arrivalplanified => $arrivalplanified,
!     status => $status,
!     biblioid => $perioid,
!     notes => $notes,
!     suscr => $id,);
! 
! 
!     $template->param(
! 		     "frequency$frequency" => 1,
! 		     "Xstate$Xstate" => 1,
! 		     "Ystate$Ystate" => 1,
! 		     "Zstate$Zstate" => 1,
! 		     "arrival$dow" => 1,
! 		     );
! 
!  }
!  else
!  {
!     $sth = $dbh->prepare('select * from subscription where subscriptionid = ?');
!     $id = $query->param('suscr');
!     $sth->execute($id);
!     $subs = $sth->fetchrow_hashref;
!     $sth->finish;
  
  ($template, $loggedinuser, $cookie)
--- 15,107 ----
  my $dbh = C4::Context->dbh;
  my $sth;
! # my $id;
  my ($template, $loggedinuser, $cookie, $subs);
! my ($subscriptionid,$auser,$librarian,$cost,$aqbooksellerid, $aqbooksellername,$aqbudgetid, $bookfundid, $startdate, $periodicity,
! 	$dow, $numberlength, $weeklength, $monthlength,
! 	$seqnum1,$startseqnum1,$seqtype1,$freq1,$step1,
! 	$seqnum2,$startseqnum2,$seqtype2,$freq2,$step2,
! 	$seqnum3,$startseqnum3,$seqtype3,$freq3,$step3,
! 	$numberingmethod, $arrivalplanified, $status, $biblionumber, $bibliotitle, $notes);
! 
! $subscriptionid = $query->param('subscriptionid');
! 
! if ($op eq 'modsubscription') {
! 	$auser = $query->param('user');
! 	$librarian => $query->param('librarian'),
! 	$cost = $query->param('cost');
! 	$aqbooksellerid = $query->param('aqbooksellerid');
! 	$biblionumber = $query->param('biblionumber');
! 	$aqbudgetid = $query->param('aqbudgetid');
! 	$startdate = $query->param('startdate');
! 	$periodicity = $query->param('periodicity');
! 	$dow = $query->param('dow');
! 	$numberlength = $query->param('numberlength');
! 	$weeklength = $query->param('weeklength');
! 	$monthlength = $query->param('monthlength');
! 	$seqnum1 = $query->param('seqnum1');
! 	$startseqnum1 = $query->param('startseqnum1');
! 	$seqtype1 = $query->param('seqtype1');
! 	$freq1 = $query->param('freq1');
! 	$step1 = $query->param('step1');
! 	$seqnum2 = $query->param('seqnum2');
! 	$startseqnum2 = $query->param('startseqnum2');
! 	$seqtype2 = $query->param('seqtype2');
! 	$freq2 = $query->param('freq2');
! 	$step2 = $query->param('step2');
! 	$seqnum3 = $query->param('seqnum3');
! 	$startseqnum3 = $query->param('startseqnum3');
! 	$seqtype3 = $query->param('seqtype3');
! 	$freq3 = $query->param('freq3');
! 	$step3 = $query->param('step3');
! 	$numberingmethod = $query->param('numberingmethod');
! 	$arrivalplanified = $query->param('arrivalplanified');
! 	$status = 1;
! 	$notes = $query->param('notes');
      
! 	&modsubscription($auser,$aqbooksellerid,$cost,$aqbudgetid,$startdate,
! 					$periodicity,$dow,$numberlength,$weeklength,$monthlength,
! 					$seqnum1,$startseqnum1,$seqtype1,$freq1,$step1,
! 					$seqnum2,$startseqnum2,$seqtype2,$freq2,$step2,
! 					$seqnum3,$startseqnum3,$seqtype3,$freq3,$step3,
! 					$numberingmethod, $arrivalplanified, $status, $biblionumber, $notes, $subscriptionid);
! 	
!  } else {
!  		my $subs = &getsubscription($subscriptionid);
! 		$auser = $subs->{'user'};
! 		$librarian => $subs->{'librarian'},
! 		$cost = $subs->{'cost'};
! 		$aqbooksellerid = $subs->{'aqbooksellerid'};
! 		$aqbooksellername = $subs->{'aqbooksellername'};
! 		$bookfundid = $subs->{'bookfundid'};
! 		$aqbudgetid = $subs->{'aqbudgetid'};
! 		$startdate = $subs->{'startdate'};
! 		$periodicity = $subs->{'periodicity'};
! 		$dow = $subs->{'dow'};
! 		$numberlength = $subs->{'numberlength'};
! 		$weeklength = $subs->{'weeklength'};
! 		$monthlength = $subs->{'monthlength'};
! 		$seqnum1 = $subs->{'seqnum1'};
! 		$startseqnum1 = $subs->{'startseqnum1'};
! 		$seqtype1 = $subs->{'seqtype1'};
! 		$freq1 = $subs->{'freq1'};
! 		$step1 = $subs->{'step1'};
! 		$seqnum2 = $subs->{'seqnum2'};
! 		$startseqnum2 = $subs->{'startseqnum2'};
! 		$seqtype2 = $subs->{'seqtype2'};
! 		$freq2 = $subs->{'freq2'};
! 		$step2 = $subs->{'step2'};
! 		$seqnum3 = $subs->{'seqnum3'};
! 		$startseqnum3 = $subs->{'startseqnum3'};
! 		$seqtype3 = $subs->{'seqtype3'};
! 		$freq3 = $subs->{'freq3'};
! 		$step3 = $subs->{'step3'};
! 		$numberingmethod = $subs->{'numberingmethod'};
! 		$arrivalplanified = $subs->{'arrivalplanified'};
! 		$status = $subs->{status};
! 		$biblionumber = $subs->{'biblionumber'};
! 		$bibliotitle = $subs->{'bibliotitle'},
! 		$notes = $subs->{'notes'};
! 	
! }
  
  ($template, $loggedinuser, $cookie)
***************
*** 127,181 ****
  				});
  
! # }
! 	my ($user, $cookie, $sessionID, $flags)
! 		= checkauth($query, 0, {catalogue => 1}, "intranet");
! 	$template->param(
! 		user             => $user,
! 			 );
!     $template->param(librarian => $subs->{'librarian'},
!     aqbooksellerid => $subs->{'aqbooksellerid'},
!     cost => $subs->{'cost'},
!     aqbudgetid => $subs->{'aqbudgetid'},
!     startdate => $subs->{'startdate'},
!     frequency => $subs->{'periodicity'},
!     arrival => $subs->{'dow'},
!     numberlength => $subs->{'numberlength'},
!     weeklength => $subs->{'weeklength'},
!     monthlength => $subs->{'monthlength'},
!     seqnum1 => $subs->{'seqnum1'},
!     startseqnum1 => $subs->{'startseqnum1'},
!     seqtype1 => $subs->{'seqtype1'},
!     freq1 => $subs->{'freq1'},
!     step1 => $subs->{'step1'},
!     seqnum2 => $subs->{'seqnum2'},
!     startseqnum2 => $subs->{'startseqnum2'},
!     seqtype2 => $subs->{'seqtype2'},
!     freq2 => $subs->{'freq2'},
!     step2 => $subs->{'step2'},
!     seqnum3 => $subs->{'seqnum3'},
!     startseqnum3 => $subs->{'startseqnum3'},
!     seqtype3 => $subs->{'seqtype3'},
!     freq3 => $subs->{'freq3'},
!     step3 => $subs->{'step3'},
!     sequence => $subs->{'numberingmethod'},
!     arrivalplanified => $subs->{'arrivalplanified'},
!     status => $subs->{'status'},
!     biblioid => $subs->{'perioid'},
!     notes => $subs->{'notes'},
!     suscr => $id,		   
! );
! 
!     $template->param(
! 
! 		     "frequency$subs->{'periodicity'}" => 1,
! 		     "Xstate$subs->{'seqtype1'}" => 1,
! 		     "Ystate$subs->{'seqtype2'}" => 1,
! 		     "Zstate$subs->{'seqtype3'}" => 1,
! 		     "arrival$subs->{'dow'}" => 1,
! 		     );
  
- }
- # }
- #     my $sth=$dbh->prepare("insert into subscription (librarian, aqbooksellerid,cost,aqbudgetid,startdate, periodicity,dow,numberlength,weeklength,monthlength,seqnum1,startseqnum1,seqtype1,freq1,step1,seqnum2,startseqnum2,seqtype2,freq2, step2, seqnum3,startseqnum3,seqtype3, freq3, step3,numberingmethod, arrivalplanified, status, perioid, notes) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
  
  output_html_with_http_headers $query, $cookie, $template->output;
--- 114,165 ----
  				});
  
! my ($user, $cookie, $sessionID, $flags)
! 	= checkauth($query, 0, {catalogue => 1}, "intranet");
! 
! $template->param(
! 	user => $auser,
! 	librarian => $librarian,
! 	aqbooksellerid => $aqbooksellerid,
! 	aqbooksellername => $aqbooksellername,
! 	cost => $cost,
! 	aqbudgetid => $aqbudgetid,
! 	bookfundid => $bookfundid,
! 	startdate => $startdate,
! 	periodicity => $periodicity,
! 	dow => $dow,
! 	numberlength => $numberlength,
! 	weeklength => $weeklength,
! 	monthlength => $monthlength,
! 	seqnum1 =>$seqnum1,
! 	startseqnum1 =>$startseqnum1,
! 	seqtype1 =>$seqtype1,
! 	freq1 =>$freq1,
! 	step1 =>$step1,
! 	seqnum2 => $seqnum2,
! 	startseqnum2 => $startseqnum2,
! 	seqtype2 => $seqtype2,
! 	freq2 => $freq2,
! 	step2 => $step2,
! 	seqnum3 => $seqnum3,
! 	startseqnum3 => $startseqnum3,
! 	seqtype3 => $seqtype3,
! 	freq3 => $freq3,
! 	step3 => $step3,
! 	numberingmethod => $numberingmethod,
! 	arrivalplanified => $arrivalplanified,
! 	status => $status,
! 	biblionumber => $biblionumber,
! 	bibliotitle => $bibliotitle,
! 	notes => $notes,
! 	subscriptionid => $subscriptionid
! 	);
! $template->param(
! 			"periodicity$periodicity" => 1,
! 			"seqtype1$seqtype1" => 1,
! 			"seqtype2$seqtype2" => 1,
! 			"seqtype3$seqtype3" => 1,
! 			"arrival$dow" => 1,
! 			);
  
  
  output_html_with_http_headers $query, $cookie, $template->output;





More information about the Koha-cvs mailing list