From 8e5b1d4792e8024dbb410bb929ed0fae92c5ccfc Mon Sep 17 00:00:00 2001 From: tipaul Date: Thu, 5 Aug 2004 16:34:41 +0000 Subject: [PATCH] reordering code & debugging --- C4/Bull.pm | 335 ++++++---- C4/Output.pm | 9 +- bull-home.pl | 10 + bull/acqui-search.pl | 5 +- bull/order.pl | 3 +- bull/receipt.pl | 4 +- bull/statecollection.pl | 129 ++-- bull/subscription-add.pl | 187 ++++-- bull/subscription-bib-search.pl | 3 +- bull/subscription-detail.pl | 282 ++++----- .../default/en/bull/bull-home.tmpl | 50 +- .../intranet-tmpl/default/en/bull/order.tmpl | 55 +- .../en/bull/receipt-search-result.tmpl | 9 +- .../intranet-tmpl/default/en/bull/result.tmpl | 2 +- .../default/en/bull/search-supply.tmpl | 17 +- .../intranet-tmpl/default/en/bull/search.tmpl | 2 +- .../default/en/bull/statecollection.tmpl | 316 +++------- .../default/en/bull/subscription-add.tmpl | 575 ++++++++++-------- .../default/en/bull/subscription-detail.tmpl | 552 ++++------------- 19 files changed, 1131 insertions(+), 1414 deletions(-) diff --git a/C4/Bull.pm b/C4/Bull.pm index be1fe78edd..05759a5d17 100755 --- a/C4/Bull.pm +++ b/C4/Bull.pm @@ -41,10 +41,129 @@ Give all XYZ functions =cut @ISA = qw(Exporter); -@EXPORT = qw(&Initialize_Sequence &Find_Next_Date, &Get_Next_Seq); +@EXPORT = qw(&newsubscription &modsubscription &getsubscriptions &getsubscription + &modsubscriptionhistory + &getserials &serialchangestatus + &Initialize_Sequence &Find_Next_Date, &Get_Next_Seq); -# FIXME - Retirer ce FIXME il ne sert pas. +sub newsubscription { + my ($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) = @_; + my $dbh = C4::Context->dbh; + #save subscription + 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)"); + $sth->execute($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); + #then create the 1st waited number + my $subscriptionid = $dbh->{'mysql_insertid'}; + $sth = $dbh->prepare("insert into subscriptionhistory (biblionumber, subscriptionid, startdate, enddate, missinglist, recievedlist, opacnote, librariannote) values (?,?,?,?,?,?,?,?)"); + $sth->execute($biblionumber, $subscriptionid, $startdate, 0, "", "", 0, $notes); + $sth = $dbh->prepare("insert into serial (biblionumber, subscriptionid, serialseq, status, planneddate) values (?,?,?,?,?)"); + $sth->execute($biblionumber, $subscriptionid, Initialize_Sequence($numberingmethod, $seqnum1, $seqtype1, $freq1, $step1, $seqnum2, $seqtype2, $freq2, $step2, $seqnum3, $seqtype3, $freq3, $step3), $status, C4::Bull::Find_Next_Date()); + $sth->finish; +} +sub getsubscription { + my ($subscriptionid) = @_; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare('select subscription.*,aqbudget.bookfundid,aqbooksellers.name as aqbooksellername,biblio.title as bibliotitle + from subscription + left join aqbudget on subscription.aqbudgetid=aqbudget.aqbudgetid + left join aqbooksellers on subscription.aqbooksellerid=aqbooksellers.id + left join biblio on biblio.biblionumber=subscription.biblionumber + where subscriptionid = ?'); + $sth->execute($subscriptionid); + my $subs = $sth->fetchrow_hashref; + return $subs; +} + +sub modsubscription { + my ($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)= @_; + my $dbh = C4::Context->dbh; + 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=?, biblionumber=?, notes=? where subscriptionid = ?"); + $sth->execute($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); + $sth->finish; + +} + +sub getsubscriptions { + my ($title,$ISSN) = @_; + my $dbh = C4::Context->dbh; + my $sth; + $sth = $dbh->prepare("select subscription.subscriptionid,biblio.title,biblioitems.issn from subscription,biblio,biblioitems where biblio.biblionumber = biblioitems.biblionumber and biblio.biblionumber=subscription.biblionumber and (biblio.title like ? or biblioitems.issn = ? )"); + $sth->execute($title,$ISSN); + my @results; + while (my $line = $sth->fetchrow_hashref) { + push @results, $line; + } + return @results; +} + +sub modsubscriptionhistory { + my ($subscriptionid,$startdate,$enddate,$recievedlist,$missinglist,$opacnote,$librariannote)=@_; + my $dbh=C4::Context->dbh; + my $sth = $dbh->prepare("update subscriptionhistory set startdate=?,enddate=?,recievedlist=?,missinglist=?,opacnote=?,librariannote=? where subscriptionid=?"); + $sth->execute($startdate,$enddate,$recievedlist,$missinglist,$opacnote,$librariannote,$subscriptionid); +} +# get every serial not arrived for a given subscription. +sub getserials { + my ($subscriptionid) = @_; + my $dbh = C4::Context->dbh; + # status = 2 is "arrived" + my $sth=$dbh->prepare("select serialid,serialseq, status, planneddate from serial where subscriptionid = ? and status <>2 and status <>4"); + $sth->execute($subscriptionid); + my @serials; + while(my $line = $sth->fetchrow_hashref) { + $line->{"status".$line->{status}} = 1; # fills a "statusX" value, used for template status select list + push @serials,$line; + } + return @serials; +} + +sub serialchangestatus { + my ($serialid,$serialseq,$planneddate,$status)=@_; + warn "($serialid,$serialseq,$planneddate,$status)"; +# return 1; + # 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=?"); + $sth->execute($serialid); + my ($subscriptionid,$oldstatus) = $sth->fetchrow; + # change status & update subscriptionhistory + $sth = $dbh->prepare("update serial set serialseq=?,planneddate=?,status=? where serialid = ?"); + $sth->execute($serialseq,$planneddate,$status,$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"; + } + if ($status eq 4) { + $missinglist .= ",$serialseq"; + } + $sth=$dbh->prepare("update subscriptionhistory set recievedlist=?, missinglist=? where subscriptionid=?"); + $sth->execute($recievedlist,$missinglist,$subscriptionid); + # create new waited entry if needed (ie : was a "waited" and has changed) + if ($oldstatus eq 1 && $status ne 1) { + $sth = $dbh->prepare("select * from subscription where subscriptionid = ? "); + $sth->execute($subscriptionid); + my $val = $sth->fetchrow_hashref; + $sth = $dbh->prepare("insert into serial (serialseq,subscriptionid,biblionumber,status, planneddate) values (?,?,?,?,?)"); + my ($temp, $X, $Y, $Z, $pos1, $pos2, $pos3) = 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, $subscriptionid, $val->{'biblionumber'}, 1, 0); + $sth = $dbh->prepare("update subscription set seqnum1=?, seqnum2=?,seqnum3=?,pos1=?,pos2=?,pos3=? where subscriptionid = ?"); + $sth->execute($X, $Y, $Z, $pos1, $pos2, $pos3, $subscriptionid); + + } +} sub GetValue(@) { my $seq = shift; my $X = shift; @@ -59,58 +178,38 @@ sub GetValue(@) { sub Initialize_Sequence(@) { - my $sequence = shift; - my $X = shift; - my $Xstate = shift; - my $Xfreq = shift; - my $Xstep = shift; - my $Y = shift; - my $Ystate = shift; - my $Yfreq = shift; - my $Ystep = shift; - my $Z = shift; - my $Zstate = shift; - my $Zfreq = shift; - my $Zstep = shift; - my $finalstring = ""; - my @string = split //, $sequence; - my $etat = 0; - - for (my $i = 0; $i < (scalar @string); $i++) - { - if ($string[$i] ne '{') - { - if (!$etat) - { + my $sequence = shift; + my $X = shift; + my $seqtype1 = shift; + my $freq1 = shift; + my $step1 = shift; + my $Y = shift; + my $seqtype2 = shift; + my $freq2 = shift; + my $step2 = shift; + my $Z = shift; + my $seqtype3 = shift; + my $freq3 = shift; + my $step3 = shift; + my $finalstring = ""; + my @string = split //, $sequence; + my $etat = 0; + + for (my $i = 0; $i < (scalar @string); $i++) { + if ($string[$i] ne '{') { + if (!$etat) { $finalstring .= $string[$i]; - } - else - { - return "1 Syntax Error in Sequence"; - } - } - else - { -# if ($string[$i + 1] eq '\'') -# { -# return "2 Syntax Error in Sequence" -# if ($string[$i + 2] ne 'X' && $string[$i + 2] ne 'Y' && $string[$i + 2] ne 'Z'); - -# $finalstring .= GetValueAsc($string[$i + 2], $X, $Y, $Z); -# $i += 3; -# } -# else -# { - return "3 Syntax Error in Sequence" - if ($string[$i + 1] ne 'X' && $string[$i + 1] ne 'Y' && $string[$i + 1] ne 'Z'); - - - $finalstring .= GetValue($string[$i + 1], $X, $Y, $Z); - $i += 2; -# } + } else { + return "1 Syntax Error in Sequence"; + } + } else { + return "3 Syntax Error in Sequence" + if ($string[$i + 1] ne 'X' && $string[$i + 1] ne 'Y' && $string[$i + 1] ne 'Z'); + $finalstring .= GetValue($string[$i + 1], $X, $Y, $Z); + $i += 2; } - } - return "$finalstring"; + } + return "$finalstring"; } sub Find_Next_Date(@) { @@ -118,74 +217,90 @@ sub Find_Next_Date(@) { } sub Step(@) { - my $X = shift; - my $Xstate = shift; - my $Xfreq = shift; - my $Xstep = shift; - my $Y = shift; - my $Ystate = shift; - my $Yfreq = shift; - my $Ystep = shift; - my $Z = shift; - my $Zstate = shift; - my $Zfreq = shift; - my $Zstep = shift; - my $Xpos = shift; - my $Ypos = shift; - my $Zpos = shift; - - - $X += $Xstep if ($Xstate == 1); - if ($Xstate == 2) { $Xpos += 1; if ($Xpos >= $Xfreq) { - $Xpos = 0; $X += $Xstep; } } + my $seqnum1 = shift; + my $seqtype1 = shift; + my $freq1 = shift; + my $step1 = shift; + my $seqnum2 = shift; + my $seqtype2 = shift; + my $freq2 = shift; + my $step2 = shift; + my $seqnum3 = shift; + my $seqtype3 = shift; + my $freq3 = shift; + my $step3 = shift; + my $pos1 = shift; + my $pos2 = shift; + my $pos3 = shift; - $Y += $Ystep if ($Ystate == 1); - if ($Ystate == 2) { $Ypos += 1; if ($Ypos >= $Yfreq) { - $Ypos = 0; $Y += $Ystep; } } + $seqnum1 += $step1 if ($seqtype1 == 1); + if ($seqtype1 == 2) { + $pos1 += 1; + if ($pos1 >= $freq1) { + $pos1 = 0; + $seqnum1 += $step1; + } + } - $Z += $Zstep if ($Zstate == 1); - if ($Zstate == 2) { $Zpos += 1; if ($Zpos >= $Zfreq) { - $Zpos = 0; $Z += $Zstep; } } + $seqnum2 += $step2 if ($seqtype2 == 1); + if ($seqtype2 == 2) { + $pos2 += 1; + if ($pos2 >= $freq2) { + $pos2 = 0; + $seqnum2 += $step2; + } + } + + $seqnum3 += $step3 if ($seqtype3 == 1); + if ($seqtype3 == 2) { + $pos3 += 1; + if ($pos3 >= $freq3) { + $pos3 = 0; + $seqnum3 += $step3; + } + } -# $Y += $Ystep; if ($Ystate == 1); - # if ($Ystate == 2) { $Ypos += 1; if ($Ypos >= $Yfreq) { - #$Ypos = 0; $Y += $Ystep; } } +# $Y += $step2; if ($seqtype2 == 1); + # if ($seqtype2 == 2) { $pos2 += 1; if ($pos2 >= $freq2) { + #$pos2 = 0; $Y += $step2; } } - # $Z += $Zstep; if ($Zstate == 1); - # if ($Zstate == 2) { $Zpos += 1; if ($Zpos >= $Zfreq) { -# $Zpos = 0; $Z += $Zstep; } } + # $Z += $step3; if ($seqtype3 == 1); + # if ($seqtype3 == 2) { $pos3 += 1; if ($pos3 >= $freq3) { +# $pos3 = 0; $Z += $step3; } } - return ($X, $Y, $Z, $Xpos, $Ypos, $Zpos); + return ($seqnum1, $seqnum2, $seqnum3, $pos1, $pos2, $pos3); } sub Get_Next_Seq(@) { my $sequence = shift; - my $X = shift; - my $Xfreq = shift; - my $Xstep = shift; - my $Xstate = shift; - my $Y = shift; - my $Yfreq = shift; - my $Ystep = shift; - my $Ystate = shift; - my $Z = shift; - my $Zfreq = shift; - my $Zstep = shift; - my $Zstate = shift; - my $Xpos = shift; - my $Ypos = shift; - my $Zpos = shift; - - return ("$sequence", $X, $Y, $Z) - if (!defined($X) && !defined($Y) && !defined($Z)); - ($X, $Y, $Z, $Xpos, $Ypos, $Zpos) = - Step($X, $Xstate, $Xfreq, $Xstep, $Y, $Ystate, $Yfreq, - $Ystep, $Z, $Zstate, $Zfreq, $Zstep, $Xpos, $Ypos, $Zpos); - return (Initialize_Sequence($sequence, $X, $Xstate, - $Xfreq, $Xstep, $Y, $Ystate, $Yfreq, - $Ystep, $Z, $Zstate, $Zfreq, $Zstep), - $X, $Y, $Z, $Xpos, $Ypos, $Zpos); + my $seqnum1 = shift; + my $freq1 = shift; + my $step1 = shift; + my $seqtype1 = shift; + my $seqnum2 = shift; + my $freq2 = shift; + my $step2 = shift; + my $seqtype2 = shift; + my $seqnum3 = shift; + my $freq3 = shift; + my $step3 = shift; + my $seqtype3 = shift; + my $pos1 = shift; + my $pos2 = shift; + my $pos3 = shift; + + return ("$sequence", $seqnum1, $seqnum2, $seqnum3) + if (!defined($seqnum1) && !defined($seqnum2) && !defined($seqnum3)); + + ($seqnum1, $seqnum2, $seqnum3, $pos1, $pos2, $pos3) = + Step($seqnum1, $seqtype1, $freq1, $step1, $seqnum2, $seqtype2, $freq2, + $step2, $seqnum3, $seqtype3, $freq3, $step3, $pos1, $pos2, $pos3); + + return (Initialize_Sequence($sequence, $seqnum1, $seqtype1, + $freq1, $step1, $seqnum2, $seqtype2, $freq2, + $step2, $seqnum3, $seqtype3, $freq3, $step3), + $seqnum1, $seqnum2, $seqnum3, $pos1, $pos2, $pos3); } END { } # module clean-up code here (global destructor) diff --git a/C4/Output.pm b/C4/Output.pm index aa97ec7687..8b6ab14780 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -79,8 +79,6 @@ if (!$query){ global_vars => 1, path => ["$htdocs/$theme/$lang/includes"]); - # XXX temporary patch for Bug 182 for themelang - warn "theme is $theme lang is $lang"; $template->param(themelang => ($opac ne 'intranet'? '/opac-tmpl': '/intranet-tmpl') . "/$theme/$lang", interface => ($opac ne 'intranet'? '/opac-tmpl': '/intranet-tmpl'), theme => $theme, @@ -94,10 +92,9 @@ if (!$query){ # FIXME - POD sub themelanguage { my ($htdocs, $tmpl, $section, $query) = @_; - if (!$query) { - warn "no query"; - - } +# if (!$query) { +# warn "no query"; +# } my $dbh = C4::Context->dbh; my @languages; my @themes; diff --git a/bull-home.pl b/bull-home.pl index ec59df54c3..8ee0255cb9 100755 --- a/bull-home.pl +++ b/bull-home.pl @@ -3,12 +3,16 @@ use strict; use CGI; use C4::Auth; +use C4::Bull; use C4::Output; use C4::Interface::CGI::Output; use C4::Context; use HTML::Template; my $query = new CGI; +my $title = $query->param('title'); +my $ISSN = $query->param('ISSN'); +my @subscriptions = getsubscriptions($title,$ISSN); my ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "bull/bull-home.tmpl", query => $query, @@ -17,4 +21,10 @@ my ($template, $loggedinuser, $cookie) flagsrequired => {catalogue => 1}, debug => 1, }); + +$template->param( + subscriptions => \@subscriptions, + title => $title, + ISSN => $ISSN, + ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/bull/acqui-search.pl b/bull/acqui-search.pl index f8f776c2eb..3961405bb0 100755 --- a/bull/acqui-search.pl +++ b/bull/acqui-search.pl @@ -7,8 +7,7 @@ use C4::Output; use C4::Interface::CGI::Output; use C4::Database; use HTML::Template; -use C4::Catalogue; - +use C4::Acquisition; my $query = new CGI; my ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "bull/search-supply.tmpl", @@ -20,7 +19,7 @@ my ($template, $loggedinuser, $cookie) }); # budget -my ($count,@results)=bookfunds; +my ($count,@results)=&bookfunds; my $classlist=''; my $total=0; my $totspent=0; diff --git a/bull/order.pl b/bull/order.pl index 0c6b784614..85b3332697 100755 --- a/bull/order.pl +++ b/bull/order.pl @@ -24,7 +24,7 @@ # Suite 330, Boston, MA 02111-1307 USA use strict; -use C4::Catalogue; +use C4::Acquisition; use C4::Auth; use C4::Biblio; use C4::Output; @@ -32,7 +32,6 @@ use CGI; use C4::Interface::CGI::Output; use C4::Database; use HTML::Template; -use C4::Catalogue; use C4::Date; my $query=new CGI; diff --git a/bull/receipt.pl b/bull/receipt.pl index b7a0fd7cee..4e06609e25 100755 --- a/bull/receipt.pl +++ b/bull/receipt.pl @@ -30,13 +30,13 @@ if ($op eq 'search') - my $sth = $dbh->prepare("select subscriptionid, perioid from subscription"); + my $sth = $dbh->prepare("select subscriptionid, biblionumber from subscription"); $sth->execute(); my @finalsolution; while (my $first_step = $sth->fetchrow_hashref) { 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%"); + $sth2->execute($first_step->{'biblionumber'},$search, "%$search%"); my @answear; @answear = $sth2->fetchrow_array; $total = scalar @answear; diff --git a/bull/statecollection.pl b/bull/statecollection.pl index c10858e696..6eee904b01 100755 --- a/bull/statecollection.pl +++ b/bull/statecollection.pl @@ -12,89 +12,31 @@ use HTML::Template; my $query = new CGI; 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 $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); } -my $sth=$dbh->prepare("select serialseq, status, planneddate from serial where subscriptionid = ? and status = ?"); -$sth->execute($sid, 1); -my $sol = $sth->fetchrow_hashref; +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($sid); +$sth->execute($subscriptionid); my $solhistory = $sth->fetchrow_hashref; my ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "bull/statecollection.tmpl", @@ -105,20 +47,17 @@ my ($template, $loggedinuser, $cookie) debug => 1, }); - 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, +# 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; diff --git a/bull/subscription-add.pl b/bull/subscription-add.pl index b6d53765b3..eb81cccd76 100755 --- a/bull/subscription-add.pl +++ b/bull/subscription-add.pl @@ -2,8 +2,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; use HTML::Template; @@ -12,59 +14,14 @@ use C4::Bull; my $query = new CGI; 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 ($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", query => $query, @@ -74,9 +31,129 @@ my ($template, $loggedinuser, $cookie) debug => 1, }); - my ($user, $cookie, $sessionID, $flags) - = checkauth($query, 0, {catalogue => 1}, "intranet"); + +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( - user => $user, + "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; diff --git a/bull/subscription-bib-search.pl b/bull/subscription-bib-search.pl index 6a9cdc80ff..db8279a275 100755 --- a/bull/subscription-bib-search.pl +++ b/bull/subscription-bib-search.pl @@ -21,6 +21,7 @@ use strict; require Exporter; use CGI; +use C4::Koha; use C4::Auth; use HTML::Template; use C4::Context; @@ -29,8 +30,8 @@ use C4::Auth; use C4::Output; use C4::Interface::CGI::Output; use C4::Biblio; +use C4::Acquisition; use C4::SearchMarc; -use C4::Catalogue; use C4::Koha; # XXX subfield_is_koha_internal_p # Creates the list of active tags using the active MARC configuration diff --git a/bull/subscription-detail.pl b/bull/subscription-detail.pl index 23442221d4..f446e7e59e 100755 --- a/bull/subscription-detail.pl +++ b/bull/subscription-detail.pl @@ -3,6 +3,8 @@ use strict; use CGI; use C4::Auth; +use C4::Koha; +use C4::Bull; use C4::Output; use C4::Interface::CGI::Output; use C4::Context; @@ -12,110 +14,95 @@ my $query = new CGI; my $op = $query->param('op'); my $dbh = C4::Context->dbh; my $sth; -my $id; +# 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); -if ($op eq 'modsubscription') -{ +$subscriptionid = $query->param('subscriptionid'); - -# 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'); +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'); - - 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; + &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) = get_template_and_user({template_name => "bull/subscription-detail.tmpl", @@ -126,56 +113,53 @@ if ($op eq 'modsubscription') debug => 1, }); -# } - 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( +my ($user, $cookie, $sessionID, $flags) + = checkauth($query, 0, {catalogue => 1}, "intranet"); - "frequency$subs->{'periodicity'}" => 1, - "Xstate$subs->{'seqtype1'}" => 1, - "Ystate$subs->{'seqtype2'}" => 1, - "Zstate$subs->{'seqtype3'}" => 1, - "arrival$subs->{'dow'}" => 1, - ); +$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, + ); -} -# } -# 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; diff --git a/koha-tmpl/intranet-tmpl/default/en/bull/bull-home.tmpl b/koha-tmpl/intranet-tmpl/default/en/bull/bull-home.tmpl index f188221b7c..a804fe3f07 100644 --- a/koha-tmpl/intranet-tmpl/default/en/bull/bull-home.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/bull/bull-home.tmpl @@ -1,21 +1,41 @@
-

Serial

- +

Serials subscriptions

+ + + + + + + + + + + + + + + + + + + +
TitleISSN 
+ "> + + "> + + +
+ + + + + " class="button bull">Detail + " class="button bull">Recieve +
+ Add subscription
diff --git a/koha-tmpl/intranet-tmpl/default/en/bull/order.tmpl b/koha-tmpl/intranet-tmpl/default/en/bull/order.tmpl index 118f929bbc..b2074df8f5 100644 --- a/koha-tmpl/intranet-tmpl/default/en/bull/order.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/bull/order.tmpl @@ -1,65 +1,38 @@ - +
-

Supplier Search Results

+

Supplier Search Results

-

You searched on supplier , results found

+

You searched on supplier , results found

- - - - - + - - > + > - - -
OrderReceiveGet it!!Company - - - - - - - -
BasketItemsStaffDate
- +
SupplierSelect
- - /images/mail_send.png" title="Add order" ALT="Add" BORDER=0 > - - Inactive - + - /images/mail_get.png" title="receive" ALT="Add" BORDER=0 > + + /images/arrow.gif" title="select this supplier" BORDER=0 height=40 width=40> + /images/arrow.gif" title="receive" BORDER=0 height=40 width=40> - - - - - - - - - -
">

-Add supplier +Add supplier \ No newline at end of file + + diff --git a/koha-tmpl/intranet-tmpl/default/en/bull/receipt-search-result.tmpl b/koha-tmpl/intranet-tmpl/default/en/bull/receipt-search-result.tmpl index dfda2405d7..714a52ddd2 100644 --- a/koha-tmpl/intranet-tmpl/default/en/bull/receipt-search-result.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/bull/receipt-search-result.tmpl @@ -38,19 +38,12 @@ //images/fileopen.png" width="32" hspace="0" vspace="0" border="0" alt="Authority number " title="Serial number">
-
&serial="> +
&serial="> //images/Fleche.jpg" width="32" hspace="0" vspace="0" border="0" alt="Subscribtion serial" title="Serial number">
-
- - ')"> - //images/edittrash.png" width="32" hspace="0" vspace="0" border="0"> - - -
diff --git a/koha-tmpl/intranet-tmpl/default/en/bull/result.tmpl b/koha-tmpl/intranet-tmpl/default/en/bull/result.tmpl index 46d96724ae..e364245626 100644 --- a/koha-tmpl/intranet-tmpl/default/en/bull/result.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/bull/result.tmpl @@ -91,7 +91,7 @@ function GetIt(bibno) { - opener.document.f.biblioid.value = bibno; + opener.document.f.perioid.value = bibno; self.close(); } \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/default/en/bull/search-supply.tmpl b/koha-tmpl/intranet-tmpl/default/en/bull/search-supply.tmpl index 084f3328b6..2f8ace0b77 100644 --- a/koha-tmpl/intranet-tmpl/default/en/bull/search-supply.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/bull/search-supply.tmpl @@ -1,12 +1,11 @@ - -
+ -

Acquisitions

+
+

Search supplier for serial subscription

-

Start, receive, modify order

- - Supplier name : - - +
+ Supplier name : + +
- + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/default/en/bull/search.tmpl b/koha-tmpl/intranet-tmpl/default/en/bull/search.tmpl index decbbce264..f37d5e6c20 100644 --- a/koha-tmpl/intranet-tmpl/default/en/bull/search.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/bull/search.tmpl @@ -1,4 +1,4 @@ - +

Catalogue search

diff --git a/koha-tmpl/intranet-tmpl/default/en/bull/statecollection.tmpl b/koha-tmpl/intranet-tmpl/default/en/bull/statecollection.tmpl index d4a59f27f5..3c29b580ec 100644 --- a/koha-tmpl/intranet-tmpl/default/en/bull/statecollection.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/bull/statecollection.tmpl @@ -1,243 +1,91 @@ - +
-

Collections

-
    - - - -
    Collection's states
    - - - - +

    Subscription for XXX

    + +
    +

    Subscription summary

    + + + "> + "> + "> +

    +

    ">

    +

    ">

    +

    Arrived Numbers

    +

     

    +

    Gapped Numbers

    +

     

    +

    Opac's note

    +

     

    +

    Intra's note

    +

     

    + + +
    - - - - - - - - - - - - - -
    -
    - - "> - "> - "> - Librarian identity :
    -Beginnning date (*) : "> -Enddate date (*) : ">
    Arrived Numbers : Gapped Numbers :
    Opac's note : Intra's note :

    - - - - - - -
    -Waited number : - - "> -
    -Status : - - + "> + "> + "> + + + + + + + + + + + - - - + + + +
    + Numbered + + planned for + + Status +
    + " size=50 maxlength=100> + + " size=10 maxlength=15> + + "> + -
    -
    - - -
    + +
    - - - \ No newline at end of file + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/default/en/bull/subscription-add.tmpl b/koha-tmpl/intranet-tmpl/default/en/bull/subscription-add.tmpl index 8943bc65e6..4a64ecabc3 100644 --- a/koha-tmpl/intranet-tmpl/default/en/bull/subscription-add.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/bull/subscription-add.tmpl @@ -1,170 +1,246 @@
    -

    Subscription

    -
      - - - -
      Add a new subscription
      - - - - -

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
      +

      Numbering calculation

      +

      +

      Numbering formula: ">

      +
      -
      - - "> - Librarian identity :
      Supplier (*) : ...
      -Cost : -Suscribtion's budget :
      -Beginnning date (*) : -Frequency (*) :
      -Arrival week's day (*) : - - -Number of num
      Number of weeks Number of months
      X: - -Evolution : - - - -
      Xfrequency: Xstep:
      Y: - -Evolution : - - - -
      Yfrequency: Ystep:
      Z: - -Evolution : - - + "> + +

      Add a subscription

      + + +
      +

      Subscription information

      + + "> +

      Librarian

      +

      ">...

      +

      ">

      +

      ">

      +

      "> ...

      +

      + +
      +

      Planning

      +

      ">

      +

      + - -

      Zfrequency: Zstep:
      -Sequencial phrase (*): - - - - - -
      Notes : Arrival date : -
      Bib number : ... -
      -
      - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      +

      + + +

      +

      Subscription length

      +

      ">

      +

      ">

      +

      ">

      -
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
       XYZ
      Evolution + + + + + +
      Value">">">
      Frequency">">">
      Step">">">
      +Arrival date : "> +
    + + + + +
- \ No newline at end of file + \ No newline at end of file -- 2.20.1