serials : lot of bugfixes.
Works fine now. And is documented (clic Help)
This commit is contained in:
parent
cfa9223cd1
commit
716d4a4e18
|
|
@ -221,10 +221,6 @@ Cancel the order with the given order and biblio numbers. It does not
|
|||
delete any entries in the aqorders table, it merely marks them as
|
||||
cancelled.
|
||||
|
||||
If there are no items remaining with the given biblionumber,
|
||||
C<&delorder> also deletes them from the marc_subfield_table and
|
||||
marc_biblio tables of the Koha database.
|
||||
|
||||
=cut
|
||||
#'
|
||||
sub delorder {
|
||||
|
|
@ -234,10 +230,6 @@ sub delorder {
|
|||
where biblionumber=? and ordernumber=?");
|
||||
$sth->execute($bibnum,$ordnum);
|
||||
$sth->finish;
|
||||
my $count=itemcount($bibnum);
|
||||
if ($count == 0){
|
||||
delbiblio($bibnum);
|
||||
}
|
||||
}
|
||||
|
||||
=item modorder
|
||||
|
|
@ -317,17 +309,13 @@ Also updates the book fund ID in the aqorderbreakdown table.
|
|||
=cut
|
||||
#'
|
||||
sub receiveorder {
|
||||
my ($biblio,$ordnum,$quantrec,$user,$cost,$invoiceno,$bibitemno,$freight,$bookfund,$rrp)=@_;
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $sth=$dbh->prepare("update aqorders set quantityreceived=?,datereceived=now(),booksellerinvoicenumber=?,
|
||||
biblioitemnumber=?,unitprice=?,freight=?,rrp=?
|
||||
where biblionumber=? and ordernumber=?");
|
||||
$sth->execute($quantrec,$invoiceno,$bibitemno,$cost,$freight,$rrp,$biblio,$ordnum);
|
||||
$sth->finish;
|
||||
$sth=$dbh->prepare("update aqorderbreakdown set bookfundid=? where
|
||||
ordernumber=?");
|
||||
$sth->execute($bookfund,$ordnum);
|
||||
$sth->finish;
|
||||
my ($biblio,$ordnum,$quantrec,$user,$cost,$invoiceno,$freight,$rrp)=@_;
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $sth=$dbh->prepare("update aqorders set quantityreceived=?,datereceived=now(),booksellerinvoicenumber=?,
|
||||
unitprice=?,freight=?,rrp=?
|
||||
where biblionumber=? and ordernumber=?");
|
||||
$sth->execute($quantrec,$invoiceno,$cost,$freight,$rrp,$biblio,$ordnum);
|
||||
$sth->finish;
|
||||
}
|
||||
|
||||
=item updaterecorder
|
||||
|
|
@ -566,9 +554,10 @@ sub ordersearch {
|
|||
my @searchterms = ($id);
|
||||
map { push(@searchterms,"$_%","% $_%") } @data;
|
||||
push(@searchterms,$search,$search,$biblio);
|
||||
my $sth=$dbh->prepare("Select *,biblio.title from aqorders,biblioitems,biblio
|
||||
where aqorders.biblioitemnumber = biblioitems.biblioitemnumber
|
||||
and aqorders.booksellerid = ?
|
||||
my $sth=$dbh->prepare("Select *,biblio.title from aqorders,biblioitems,biblio,aqbasket
|
||||
where aqorders.biblioitemnumber = biblioitems.biblioitemnumber and
|
||||
aqorders.basketno = aqbasket.basketno
|
||||
and aqbasket.booksellerid = ?
|
||||
and biblio.biblionumber=aqorders.biblionumber
|
||||
and ((datecancellationprinted is NULL)
|
||||
or (datecancellationprinted = '0000-00-00'))
|
||||
|
|
|
|||
169
C4/Bull.pm
169
C4/Bull.pm
|
|
@ -20,6 +20,8 @@ package C4::Bull; #assumes C4/Bull.pm
|
|||
|
||||
use strict;
|
||||
use C4::Date;
|
||||
use Date::Manip;
|
||||
use C4::Suggestions;
|
||||
require Exporter;
|
||||
|
||||
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
|
||||
|
|
@ -42,10 +44,11 @@ Give all XYZ functions
|
|||
=cut
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(&newsubscription &modsubscription &getsubscriptions &getsubscription
|
||||
&modsubscriptionhistory
|
||||
@EXPORT = qw(&newsubscription &modsubscription &getsubscriptions &getsubscription &getsubscriptionfrombiblionumber
|
||||
&modsubscriptionhistory
|
||||
&getserials &serialchangestatus
|
||||
&Find_Next_Date, &Get_Next_Seq);
|
||||
&Find_Next_Date, &Get_Next_Seq
|
||||
&hassubscriptionexpired &subscriptionexpirationdate &subscriptionrenew);
|
||||
|
||||
sub newsubscription {
|
||||
my ($auser,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber,
|
||||
|
|
@ -53,7 +56,7 @@ sub newsubscription {
|
|||
$add1,$every1,$whenmorethan1,$setto1,$lastvalue1,
|
||||
$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,
|
||||
$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,
|
||||
$numberingmethod, $arrivalplanified, $status, $notes) = @_;
|
||||
$numberingmethod, $status, $notes) = @_;
|
||||
my $dbh = C4::Context->dbh;
|
||||
#save subscription
|
||||
my $sth=$dbh->prepare("insert into subscription (librarian,aqbooksellerid,cost,aqbudgetid,biblionumber,
|
||||
|
|
@ -61,8 +64,8 @@ sub newsubscription {
|
|||
add1,every1,whenmorethan1,setto1,lastvalue1,
|
||||
add2,every2,whenmorethan2,setto2,lastvalue2,
|
||||
add3,every3,whenmorethan3,setto3,lastvalue3,
|
||||
numberingmethod, arrivalplanified, status, notes) values
|
||||
(?,?,?,?,?,?,?,?,?,?,
|
||||
numberingmethod, status, notes) values
|
||||
(?,?,?,?,?,?,?,?,?,
|
||||
?,?,?,?,?,?,?,?,?,?,
|
||||
?,?,?,?,?,?,?,?,?,?)");
|
||||
$sth->execute($auser,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber,
|
||||
|
|
@ -70,55 +73,72 @@ sub newsubscription {
|
|||
$add1,$every1,$whenmorethan1,$setto1,$lastvalue1,
|
||||
$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,
|
||||
$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,
|
||||
$numberingmethod, format_date_in_iso($arrivalplanified), $status, $notes);
|
||||
$numberingmethod, $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 subscriptionhistory (biblionumber, subscriptionid, histstartdate, enddate, missinglist, recievedlist, opacnote, librariannote) values (?,?,?,?,?,?,?,?)");
|
||||
$sth->execute($biblionumber, $subscriptionid, format_date_in_iso($startdate), 0, "", "", 0, $notes);
|
||||
# reread subscription to get a hash (for calculation of the 1st issue number)
|
||||
$sth = $dbh->prepare("select * from subscription where subscriptionid = ? ");
|
||||
$sth->execute($subscriptionid);
|
||||
my $val = $sth->fetchrow_hashref;
|
||||
$sth = $dbh->prepare("insert into serial (biblionumber, subscriptionid, serialseq, status, planneddate) values (?,?,?,?,?)");
|
||||
$sth->execute($biblionumber, $subscriptionid,
|
||||
&Get_Next_Seq($val),
|
||||
$status, Find_Next_Date());
|
||||
# next issue number
|
||||
my ($newserialseq,$newlastvalue1,$newlastvalue2,$newlastvalue3,$newinnerloop1,$newinnerloop2,$newinnerloop3) = Get_Next_Seq($val);
|
||||
# next date (calculated from actual date & frequency parameters)
|
||||
my $nextplanneddate = Get_Next_Date($startdate,$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=?
|
||||
where subscriptionid = ?");
|
||||
$sth->execute($newlastvalue1,$newlastvalue2,$newlastvalue3,$newinnerloop1,$newinnerloop2,$newinnerloop3,$subscriptionid);
|
||||
$sth->finish;
|
||||
return $subscriptionid;
|
||||
}
|
||||
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
|
||||
my $sth = $dbh->prepare('select subscription.*,subscriptionhistory.*,aqbudget.bookfundid,aqbooksellers.name as aqbooksellername,biblio.title as bibliotitle
|
||||
from subscription
|
||||
left join subscriptionhistory on subscription.subscriptionid=subscriptionhistory.subscriptionid
|
||||
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 = ?');
|
||||
where subscription.subscriptionid = ?');
|
||||
$sth->execute($subscriptionid);
|
||||
my $subs = $sth->fetchrow_hashref;
|
||||
return $subs;
|
||||
}
|
||||
|
||||
sub getsubscriptionfrombiblionumber {
|
||||
my ($biblionumber) = @_;
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $sth = $dbh->prepare('select subscriptionid from subscription where biblionumber=?');
|
||||
$sth->execute($biblionumber);
|
||||
my $subscriptionid = $sth->fetchrow;
|
||||
return $subscriptionid;
|
||||
}
|
||||
|
||||
sub modsubscription {
|
||||
my ($auser,$aqbooksellerid,$cost,$aqbudgetid,$startdate,
|
||||
$periodicity,$dow,$numberlength,$weeklength,$monthlength,
|
||||
$add1,$every1,$whenmorethan1,$setto1,$lastvalue1,
|
||||
$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,
|
||||
$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,
|
||||
$numberingmethod, $arrivalplanified, $status, $biblionumber, $notes, $subscriptionid)= @_;
|
||||
$numberingmethod, $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=?,
|
||||
add1=?,every1=?,whenmorethan1=?,setto1=?,lastvalue1=?,
|
||||
add2=?,every2=?,whenmorethan2=?,setto2=?,lastvalue2=?,
|
||||
add3=?,every3=?,whenmorethan3=?,setto3=?,lastvalue3=?,
|
||||
numberingmethod=?, arrivalplanified=?, status=?, biblionumber=?, notes=? where subscriptionid = ?");
|
||||
numberingmethod=?, status=?, biblionumber=?, notes=? where subscriptionid = ?");
|
||||
$sth->execute($auser,$aqbooksellerid,$cost,$aqbudgetid,$startdate,
|
||||
$periodicity,$dow,$numberlength,$weeklength,$monthlength,
|
||||
$add1,$every1,$whenmorethan1,$setto1,$lastvalue1,
|
||||
$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,
|
||||
$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,
|
||||
$numberingmethod, $arrivalplanified, $status, $biblionumber, $notes, $subscriptionid);
|
||||
$numberingmethod, $status, $biblionumber, $notes, $subscriptionid);
|
||||
$sth->finish;
|
||||
|
||||
}
|
||||
|
|
@ -137,10 +157,10 @@ sub getsubscriptions {
|
|||
}
|
||||
|
||||
sub modsubscriptionhistory {
|
||||
my ($subscriptionid,$startdate,$enddate,$recievedlist,$missinglist,$opacnote,$librariannote)=@_;
|
||||
my ($subscriptionid,$histstartdate,$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);
|
||||
my $sth = $dbh->prepare("update subscriptionhistory set histstartdate=?,enddate=?,recievedlist=?,missinglist=?,opacnote=?,librariannote=? where subscriptionid=?");
|
||||
$sth->execute($histstartdate,$enddate,$recievedlist,$missinglist,$opacnote,$librariannote,$subscriptionid);
|
||||
}
|
||||
# get every serial not arrived for a given subscription.
|
||||
sub getserials {
|
||||
|
|
@ -152,6 +172,7 @@ sub getserials {
|
|||
my @serials;
|
||||
while(my $line = $sth->fetchrow_hashref) {
|
||||
$line->{"status".$line->{status}} = 1; # fills a "statusX" value, used for template status select list
|
||||
$line->{"planneddate"} = format_date($line->{"planneddate"});
|
||||
push @serials,$line;
|
||||
}
|
||||
return @serials;
|
||||
|
|
@ -184,9 +205,12 @@ sub serialchangestatus {
|
|||
$sth = $dbh->prepare("select * from subscription where subscriptionid = ? ");
|
||||
$sth->execute($subscriptionid);
|
||||
my $val = $sth->fetchrow_hashref;
|
||||
# next issue number
|
||||
my ($newserialseq,$newlastvalue1,$newlastvalue2,$newlastvalue3,$newinnerloop1,$newinnerloop2,$newinnerloop3) = Get_Next_Seq($val);
|
||||
# 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, 0);
|
||||
$sth->execute($newserialseq, $subscriptionid, $val->{'biblionumber'}, 1, $nextplanneddate);
|
||||
$sth = $dbh->prepare("update subscription set lastvalue1=?, lastvalue2=?,lastvalue3=?,
|
||||
innerloop1=?,innerloop2=?,innerloop3=?
|
||||
where subscriptionid = ?");
|
||||
|
|
@ -194,14 +218,47 @@ sub serialchangestatus {
|
|||
}
|
||||
}
|
||||
|
||||
sub Find_Next_Date(@) {
|
||||
return "2004-29-03";
|
||||
sub Get_Next_Date(@) {
|
||||
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,"1 quarter");
|
||||
}
|
||||
if ($subscription->{periodicity} == 9) {
|
||||
$resultdate=DateCalc($planneddate,"2 weeks");
|
||||
}
|
||||
if ($subscription->{periodicity} == 10) {
|
||||
$resultdate=DateCalc($planneddate,"1 year");
|
||||
}
|
||||
if ($subscription->{periodicity} == 11) {
|
||||
$resultdate=DateCalc($planneddate,"2 years");
|
||||
}
|
||||
return format_date_in_iso($resultdate);
|
||||
}
|
||||
|
||||
sub Get_Next_Seq {
|
||||
my ($val) =@_;
|
||||
# return ("$sequence", $seqnum1, $seqnum2, $seqnum3)
|
||||
# if (!defined($seqnum1) && !defined($seqnum2) && !defined($seqnum3));
|
||||
my ($calculated,$newlastvalue1,$newlastvalue2,$newlastvalue3,$newinnerloop1,$newinnerloop2,$newinnerloop3);
|
||||
$calculated = $val->{numberingmethod};
|
||||
# calculate the (expected) value of the next issue recieved.
|
||||
|
|
@ -231,4 +288,64 @@ sub Get_Next_Seq {
|
|||
return ($calculated,$newlastvalue1,$newlastvalue2,$newlastvalue3,$newinnerloop1,$newinnerloop2,$newinnerloop3);
|
||||
}
|
||||
|
||||
# the subscription has expired when the next issue to arrive is out of subscription limit.
|
||||
sub hassubscriptionexpired {
|
||||
my ($subscriptionid) = @_;
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $subscription = getsubscription($subscriptionid);
|
||||
# we don't do the same test if the subscription is based on X numbers or on X weeks/months
|
||||
if ($subscription->{numberlength}) {
|
||||
my $sth = $dbh->prepare("select count(*) from serial where subscriptionid=? and planneddate>=?");
|
||||
$sth->execute($subscriptionid,$subscription->{planneddate});
|
||||
my $res = $sth->fetchrow;
|
||||
if ($subscription->{numberlength}>=$res) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
#a little bit more tricky if based on X weeks/months : search if the latest issue waited is not after subscription startdate + duration
|
||||
my $sth = $dbh->prepare("select max(planneddate) from serial where subscriptionid=?");
|
||||
$sth->execute($subscriptionid);
|
||||
my $res = ParseDate(format_date_in_iso($sth->fetchrow));
|
||||
my $endofsubscriptiondate;
|
||||
$endofsubscriptiondate = DateCalc(format_date_in_iso($subscription->{startdate}),$subscription->{monthlength}." months") if ($subscription->{monthlength});
|
||||
$endofsubscriptiondate = DateCalc(format_date_in_iso($subscription->{startdate}),$subscription->{weeklength}." weeks") if ($subscription->{weeklength});
|
||||
return 1 if ($res >= $endofsubscriptiondate);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
sub subscriptionexpirationdate {
|
||||
my ($subscriptionid) = @_;
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $subscription = getsubscription($subscriptionid);
|
||||
my $enddate=$subscription->{startdate};
|
||||
# we don't do the same test if the subscription is based on X numbers or on X weeks/months
|
||||
if ($subscription->{numberlength}) {
|
||||
#calculate the date of the last issue.
|
||||
for (my $i=1;$i<=$subscription->{numberlength};$i++) {
|
||||
$enddate = Get_Next_Date($enddate,$subscription);
|
||||
}
|
||||
} else {
|
||||
$enddate = DateCalc(format_date_in_iso($subscription->{startdate}),$subscription->{monthlength}." months") if ($subscription->{monthlength});
|
||||
$enddate = DateCalc(format_date_in_iso($subscription->{startdate}),$subscription->{weeklength}." weeks") if ($subscription->{weeklength});
|
||||
}
|
||||
# $enddate=format_date_in_iso($enddate);
|
||||
# warn "END : $enddate";
|
||||
return $enddate;
|
||||
}
|
||||
|
||||
sub subscriptionrenew {
|
||||
my ($subscriptionid,$user,$startdate,$numberlength,$weeklength,$monthlength,$note) = @_;
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $subscription = getsubscription($subscriptionid);
|
||||
my $sth = $dbh->prepare("select * from biblio,biblioitems where biblio.biblionumber=biblioitems.biblionumber and biblio.biblionumber=?");
|
||||
$sth->execute($subscription->{biblionumber});
|
||||
my $biblio = $sth->fetchrow_hashref;
|
||||
newsuggestion($user,$subscription->{bibliotitle},$biblio->{author},$biblio->{publishercode},$biblio->{note},,,,,$subscription->{biblionumber});
|
||||
# renew subscription
|
||||
$sth=$dbh->prepare("update subscription set startdate=?,numberlength=?,weeklength=?,monthlength=?");
|
||||
$sth->execute(format_date_in_iso($startdate),$numberlength,$weeklength,$monthlength);
|
||||
}
|
||||
END { } # module clean-up code here (global destructor)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
# Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
use strict;
|
||||
use C4::Acquisition;
|
||||
use C4::Auth;
|
||||
use C4::Biblio;
|
||||
use C4::Output;
|
||||
|
|
@ -32,6 +31,7 @@ use CGI;
|
|||
use C4::Interface::CGI::Output;
|
||||
use C4::Database;
|
||||
use HTML::Template;
|
||||
use C4::Acquisition;
|
||||
use C4::Date;
|
||||
|
||||
my $query=new CGI;
|
||||
|
|
@ -47,32 +47,37 @@ my ($template, $loggedinuser, $cookie)
|
|||
my $supplier=$query->param('supplier');
|
||||
my ($count,@suppliers)=bookseller($supplier);
|
||||
|
||||
my $colour='#EEEEEE';
|
||||
# check if we have to "close" a basket before building page
|
||||
my $op = $query->param('op');
|
||||
my $basket = $query->param('basket');
|
||||
if ($op eq 'close') {
|
||||
closebasket($basket);
|
||||
}
|
||||
|
||||
#build reult page
|
||||
my $toggle=0;
|
||||
my @loop_suppliers;
|
||||
for (my $i=0; $i<$count; $i++) {
|
||||
my ($ordcount,$orders)=getorders($suppliers[$i]->{'id'});
|
||||
my %line;
|
||||
if ($toggle==0){
|
||||
$line{color}='#EEEEEE';
|
||||
$line{even}=1;
|
||||
$toggle=1;
|
||||
} else {
|
||||
$line{color}='white';
|
||||
$line{even}=0;
|
||||
$toggle=0;
|
||||
}
|
||||
$line{id} =$suppliers[$i]->{'id'};
|
||||
$line{supplierid} =$suppliers[$i]->{'id'};
|
||||
$line{name} = $suppliers[$i]->{'name'};
|
||||
$line{active} = $suppliers[$i]->{'active'};
|
||||
$line{total} = $orders->[0]->{'count(*)'};
|
||||
$line{authorisedby} = $orders->[0]->{'authorisedby'};
|
||||
$line{entrydate} = $orders->[0]->{'entrydate'};
|
||||
my @loop_basket;
|
||||
for (my $i2=0;$i2<$ordcount;$i2++){
|
||||
my %inner_line;
|
||||
$inner_line{basketno} =$orders->[$i2]->{'basketno'};
|
||||
$inner_line{total} =$orders->[$i2]->{'count(*)'};
|
||||
$inner_line{authorisedby} = $orders->[$i2]->{'authorisedby'};
|
||||
$inner_line{entrydate} = format_date($orders->[$i2]->{'entrydate'});
|
||||
$inner_line{creationdate} = format_date($orders->[$i2]->{'creationdate'});
|
||||
$inner_line{closedate} = format_date($orders->[$i2]->{'closedate'});
|
||||
push @loop_basket, \%inner_line;
|
||||
}
|
||||
$line{loop_basket} = \@loop_basket;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use CGI;
|
||||
use C4::Auth;
|
||||
use C4::Koha;
|
||||
use C4::Date;
|
||||
use C4::Bull;
|
||||
use C4::Output;
|
||||
use C4::Interface::CGI::Output;
|
||||
use C4::Context;
|
||||
use HTML::Template;
|
||||
|
||||
my $query = new CGI;
|
||||
my $op = $query->param('op');
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $sth;
|
||||
# my $id;
|
||||
my ($template, $loggedinuser, $cookie);
|
||||
my ($subscriptionid);
|
||||
|
||||
$subscriptionid = $query->param('subscriptionid');
|
||||
my $subscription = &getsubscription($subscriptionid);
|
||||
|
||||
($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "bull/serial-issues.tmpl",
|
||||
query => $query,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {catalogue => 1},
|
||||
debug => 1,
|
||||
});
|
||||
|
||||
# replace CR by <br> in librarian note
|
||||
$subscription->{librariannote} =~ s/\n/\<br\/\>/g;
|
||||
|
||||
$template->param(
|
||||
startdate => format_date($subscription->{startdate}),
|
||||
periodicity => $subscription->{periodicity},
|
||||
dow => $subscription->{dow},
|
||||
numberlength => $subscription->{numberlength},
|
||||
weeklength => $subscription->{weeklength},
|
||||
monthlength => $subscription->{monthlength},
|
||||
librariannote => $subscription->{librariannote},
|
||||
numberingmethod => $subscription->{numberingmethod},
|
||||
arrivalplanified => $subscription->{arrivalplanified},
|
||||
status => $subscription->{status},
|
||||
biblionumber => $subscription->{biblionumber},
|
||||
bibliotitle => $subscription->{bibliotitle},
|
||||
notes => $subscription->{notes},
|
||||
subscriptionid => $subscription->{subscriptionid}
|
||||
);
|
||||
$template->param(
|
||||
"periodicity$subscription->{periodicity}" => 1,
|
||||
"arrival$subscription->{dow}" => 1,
|
||||
);
|
||||
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
use strict;
|
||||
use CGI;
|
||||
use C4::Auth;
|
||||
use C4::Date;
|
||||
use C4::Output;
|
||||
use C4::Interface::CGI::Output;
|
||||
use C4::Context;
|
||||
|
|
@ -13,10 +14,9 @@ my $query = new CGI;
|
|||
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 $histstartdate = format_date_in_iso($query->param('histstartdate'));
|
||||
my $enddate = format_date_in_iso($query->param('enddate'));
|
||||
my $recievedlist = $query->param('recievedlist');
|
||||
my $missinglist = $query->param('missinglist');
|
||||
my $opacnote = $query->param('opacnote');
|
||||
|
|
@ -25,14 +25,20 @@ my @serialids = $query->param('serialid');
|
|||
my @serialseqs = $query->param('serialseq');
|
||||
my @planneddates = $query->param('planneddate');
|
||||
my @status = $query->param('status');
|
||||
my $hassubscriptionexpired = hassubscriptionexpired($subscriptionid);
|
||||
if ($op eq 'modsubscriptionhistory') {
|
||||
modsubscriptionhistory($subscriptionid,$startdate,$enddate,$recievedlist,$missinglist,$opacnote,$librariannote);
|
||||
modsubscriptionhistory($subscriptionid,$histstartdate,$enddate,$recievedlist,$missinglist,$opacnote,$librariannote);
|
||||
}
|
||||
# change status except, if subscription has expired, for the "waited" issue.
|
||||
if ($op eq 'serialchangestatus') {
|
||||
my $sth = $dbh->prepare("select subscriptionid,status from serial where serialid=?");
|
||||
for (my $i=0;$i<=$#serialids;$i++) {
|
||||
serialchangestatus($serialids[$i],$serialseqs[$i],$planneddates[$i],$status[$i]);
|
||||
$sth->execute($serialids[$i]);
|
||||
my ($x,$oldstatus) = $sth->fetchrow;
|
||||
serialchangestatus($serialids[$i],$serialseqs[$i],format_date_in_iso($planneddates[$i]),$status[$i]) unless ($hassubscriptionexpired && $oldstatus == 1);
|
||||
}
|
||||
}
|
||||
my $subs = &getsubscription($subscriptionid);
|
||||
my @serialslist = getserials($subscriptionid);
|
||||
|
||||
my $sth=$dbh->prepare("select * from subscriptionhistory where subscriptionid = ?");
|
||||
|
|
@ -48,16 +54,15 @@ my ($template, $loggedinuser, $cookie)
|
|||
});
|
||||
|
||||
$template->param(
|
||||
# user => $user,
|
||||
serialslist => \@serialslist,
|
||||
# status => $sol->{'status'},
|
||||
# waited => $sol->{'serialseq'},
|
||||
startdate => $solhistory->{'startdate'},
|
||||
enddate => $solhistory->{'enddate'},
|
||||
histstartdate => format_date($solhistory->{'histstartdate'}),
|
||||
enddate => format_date($solhistory->{'enddate'}),
|
||||
recievedlist => $solhistory->{'recievedlist'},
|
||||
missinglist => $solhistory->{'missinglist'},
|
||||
opacnote => $solhistory->{'opacnote'},
|
||||
librariannote => $solhistory->{'librariannote'},
|
||||
subscriptionid => $subscriptionid,
|
||||
bibliotitle => $subs->{bibliotitle},
|
||||
hassubscriptionexpired =>$hassubscriptionexpired,
|
||||
);
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
|
||||
use strict;
|
||||
use CGI;
|
||||
use C4::Koha;
|
||||
|
|
@ -21,7 +22,7 @@ my ($subscriptionid,$auser,$librarian,$cost,$aqbooksellerid, $aqbooksellername,$
|
|||
$add1,$every1,$whenmorethan1,$setto1,$lastvalue1,
|
||||
$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,
|
||||
$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,
|
||||
$numberingmethod, $arrivalplanified, $status, $biblionumber,
|
||||
$numberingmethod, $status, $biblionumber,
|
||||
$bibliotitle, $notes);
|
||||
|
||||
my @budgets;
|
||||
|
|
@ -67,7 +68,6 @@ if ($op eq 'mod') {
|
|||
$setto3 = $subs->{'setto3'};
|
||||
$lastvalue3 = $subs->{'lastvalue3'};
|
||||
$numberingmethod = $subs->{'numberingmethod'};
|
||||
$arrivalplanified = $subs->{'arrivalplanified'};
|
||||
$status = $subs->{status};
|
||||
$biblionumber = $subs->{'biblionumber'};
|
||||
$bibliotitle = $subs->{'bibliotitle'},
|
||||
|
|
@ -103,7 +103,6 @@ if ($op eq 'mod') {
|
|||
setto3 => $setto3,
|
||||
lastvalue3 => $lastvalue3,
|
||||
numberingmethod => $numberingmethod,
|
||||
arrivalplanified => format_date($arrivalplanified),
|
||||
status => $status,
|
||||
biblionumber => $biblionumber,
|
||||
bibliotitle => $bibliotitle,
|
||||
|
|
@ -151,18 +150,17 @@ if ($op eq 'addsubscription') {
|
|||
my $setto3 = $query->param('setto3');
|
||||
my $lastvalue3 = $query->param('lastvalue3');
|
||||
my $numberingmethod = $query->param('numberingmethod');
|
||||
my $arrivalplanified = $query->param('arrivalplanified');
|
||||
my $status = 1;
|
||||
my $biblionumber = $query->param('biblionumber');
|
||||
my $notes = $query->param('notes');
|
||||
newsubscription($auser,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber,
|
||||
my $subscriptionid = newsubscription($auser,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber,
|
||||
$startdate,$periodicity,$dow,$numberlength,$weeklength,$monthlength,
|
||||
$add1,$every1,$whenmorethan1,$setto1,$lastvalue1,
|
||||
$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,
|
||||
$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,
|
||||
$numberingmethod, $arrivalplanified, $status, $notes
|
||||
$numberingmethod, $status, $notes
|
||||
);
|
||||
|
||||
print $query->redirect("/cgi-bin/koha/bull/subscription-detail.pl?subscriptionid=$subscriptionid");
|
||||
} else {
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
}
|
||||
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
|
|
|||
|
|
@ -127,11 +127,6 @@ if ($op eq "do_search") {
|
|||
push @tags, "";
|
||||
}
|
||||
}
|
||||
findseealso($dbh,\@tags);
|
||||
|
||||
# my $sth2 = $dbh->prepare("select b3.serial from biblioitems b2, biblio b3 where b3.biblionumber = ? and b2.biblionumber = b3.biblionumber and (b2.issn = ? or b3.serial like ?)");
|
||||
|
||||
|
||||
my ($results,$total) = catalogsearch($dbh, \@tags,\@and_or,
|
||||
\@excluding, \@operator, \@value,
|
||||
$startfrom*$resultsperpage, $resultsperpage,$orderby);
|
||||
|
|
@ -205,82 +200,7 @@ if ($op eq "do_search") {
|
|||
to=>$to,
|
||||
numbers=>\@numbers,
|
||||
);
|
||||
|
||||
} elsif ($op eq "AddStatement") {
|
||||
|
||||
($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "bull/search.tmpl",
|
||||
query => $query,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {catalogue => 1},
|
||||
debug => 1,
|
||||
});
|
||||
|
||||
# Gets the entered information
|
||||
my @marcfields = $query->param('marclist');
|
||||
my @and_or = $query->param('and_or');
|
||||
my @excluding = $query->param('excluding');
|
||||
my @operator = $query->param('operator');
|
||||
my @value = $query->param('value');
|
||||
|
||||
my @statements = ();
|
||||
|
||||
# List of the marc tags to display
|
||||
my $marcarray = create_marclist();
|
||||
|
||||
my $nbstatements = $query->param('nbstatements');
|
||||
$nbstatements = 1 if(!defined $nbstatements);
|
||||
|
||||
for(my $i = 0 ; $i < $nbstatements ; $i++)
|
||||
{
|
||||
my %fields = ();
|
||||
|
||||
# Recreates the old scrolling lists with the previously selected values
|
||||
my $marclist = create_scrolling_list({name=>"marclist",
|
||||
values=> $marcarray,
|
||||
size=> 1,
|
||||
default=>$marcfields[$i],
|
||||
onChange => "sql_update()"}
|
||||
);
|
||||
|
||||
$fields{'marclist'} = $marclist;
|
||||
$fields{'first'} = 1 if($i == 0);
|
||||
|
||||
# Restores the and/or parameters (no need to test the 'and' for activation because it's the default value)
|
||||
$fields{'or'} = 1 if($and_or[$i] eq "or");
|
||||
|
||||
#Restores the "not" parameters
|
||||
$fields{'not'} = 1 if($excluding[$i]);
|
||||
|
||||
#Restores the operators (most common operators first);
|
||||
if($operator[$i] eq "=") { $fields{'eq'} = 1; }
|
||||
elsif($operator[$i] eq "contains") { $fields{'contains'} = 1; }
|
||||
elsif($operator[$i] eq "start") { $fields{'start'} = 1; }
|
||||
elsif($operator[$i] eq ">") { $fields{'gt'} = 1; } #greater than
|
||||
elsif($operator[$i] eq ">=") { $fields{'ge'} = 1; } #greater or equal
|
||||
elsif($operator[$i] eq "<") { $fields{'lt'} = 1; } #lower than
|
||||
elsif($operator[$i] eq "<=") { $fields{'le'} = 1; } #lower or equal
|
||||
|
||||
#Restores the value
|
||||
$fields{'value'} = $value[$i];
|
||||
|
||||
push @statements, \%fields;
|
||||
}
|
||||
$nbstatements++;
|
||||
|
||||
# The new scrolling list
|
||||
my $marclist = create_scrolling_list({name=>"marclist",
|
||||
values=> $marcarray,
|
||||
size=>1,
|
||||
onChange => "sql_update()"});
|
||||
push @statements, {"marclist" => $marclist };
|
||||
|
||||
$template->param("statements" => \@statements,
|
||||
"nbstatements" => $nbstatements);
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "bull/search.tmpl",
|
||||
query => $query,
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ my ($subscriptionid,$auser,$librarian,$cost,$aqbooksellerid, $aqbooksellername,$
|
|||
$add1,$every1,$whenmorethan1,$setto1,$lastvalue1,
|
||||
$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,
|
||||
$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,
|
||||
$numberingmethod, $arrivalplanified, $status, $biblionumber, $bibliotitle, $notes);
|
||||
$numberingmethod, $status, $biblionumber, $bibliotitle, $notes);
|
||||
|
||||
$subscriptionid = $query->param('subscriptionid');
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ if ($op eq 'modsubscription') {
|
|||
$aqbooksellerid = $query->param('aqbooksellerid');
|
||||
$biblionumber = $query->param('biblionumber');
|
||||
$aqbudgetid = $query->param('aqbudgetid');
|
||||
$startdate = $query->param('startdate');
|
||||
$startdate = format_date_in_iso($query->param('startdate'));
|
||||
$periodicity = $query->param('periodicity');
|
||||
$dow = $query->param('dow');
|
||||
$numberlength = $query->param('numberlength');
|
||||
|
|
@ -55,7 +55,6 @@ if ($op eq 'modsubscription') {
|
|||
$setto3 = $query->param('setto3');
|
||||
$lastvalue3 = $query->param('lastvalue3');
|
||||
$numberingmethod = $query->param('numberingmethod');
|
||||
$arrivalplanified = $query->param('arrivalplanified');
|
||||
$status = 1;
|
||||
$notes = $query->param('notes');
|
||||
|
||||
|
|
@ -64,43 +63,11 @@ if ($op eq 'modsubscription') {
|
|||
$add1,$every1,$whenmorethan1,$setto1,$lastvalue1,
|
||||
$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,
|
||||
$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,
|
||||
$numberingmethod, $arrivalplanified, $status, $biblionumber, $notes, $subscriptionid);
|
||||
$numberingmethod, $status, $biblionumber, $notes, $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'};
|
||||
$add1 = $subs->{'add1'};
|
||||
$every1 = $subs->{'every1'};
|
||||
$whenmorethan1 = $subs->{'whenmorethan1'};
|
||||
$setto1 = $subs->{'setto1'};
|
||||
$lastvalue1 = $subs->{'lastvalue1'};
|
||||
$add2 = $subs->{'add2'};
|
||||
$every2 = $subs->{'every2'};
|
||||
$whenmorethan2 = $subs->{'whenmorethan2'};
|
||||
$setto2 = $subs->{'setto2'};
|
||||
$lastvalue2 = $subs->{'lastvalue2'};
|
||||
$add3 = $subs->{'add3'};
|
||||
$every3 = $subs->{'every3'};
|
||||
$whenmorethan3 = $subs->{'whenmorethan3'};
|
||||
$setto3 = $subs->{'setto3'};
|
||||
$lastvalue3 = $subs->{'lastvalue3'};
|
||||
$numberingmethod = $subs->{'numberingmethod'};
|
||||
$arrivalplanified = $subs->{'arrivalplanified'};
|
||||
$status = $subs->{status};
|
||||
$biblionumber = $subs->{'biblionumber'};
|
||||
$bibliotitle = $subs->{'bibliotitle'},
|
||||
$notes = $subs->{'notes'};
|
||||
|
||||
my $subs = &getsubscription($subscriptionid);
|
||||
my @serialslist = getserials($subscriptionid);
|
||||
|
||||
($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "bull/subscription-detail.tmpl",
|
||||
|
|
@ -115,45 +82,45 @@ 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 => format_date($startdate),
|
||||
periodicity => $periodicity,
|
||||
dow => $dow,
|
||||
numberlength => $numberlength,
|
||||
weeklength => $weeklength,
|
||||
monthlength => $monthlength,
|
||||
add1 => $add1,
|
||||
every1 => $every1,
|
||||
whenmorethan1 => $whenmorethan1,
|
||||
setto1 => $setto1,
|
||||
lastvalue1 => $lastvalue1,
|
||||
add2 => $add2,
|
||||
every2 => $every2,
|
||||
whenmorethan2 => $whenmorethan2,
|
||||
setto2 => $setto2,
|
||||
lastvalue2 => $lastvalue2,
|
||||
add3 => $add3,
|
||||
every3 => $every3,
|
||||
whenmorethan3 => $whenmorethan3,
|
||||
setto3 => $setto3,
|
||||
lastvalue3 => $lastvalue3,
|
||||
numberingmethod => $numberingmethod,
|
||||
arrivalplanified => $arrivalplanified,
|
||||
status => $status,
|
||||
biblionumber => $biblionumber,
|
||||
bibliotitle => $bibliotitle,
|
||||
notes => $notes,
|
||||
subscriptionid => $subscriptionid
|
||||
user => $subs->{auser},
|
||||
librarian => $subs->{librarian},
|
||||
aqbooksellerid => $subs->{aqbooksellerid},
|
||||
aqbooksellername => $subs->{aqbooksellername},
|
||||
cost => $subs->{cost},
|
||||
aqbudgetid => $subs->{aqbudgetid},
|
||||
bookfundid => $subs->{bookfundid},
|
||||
startdate => format_date($subs->{startdate}),
|
||||
periodicity => $subs->{periodicity},
|
||||
dow => $subs->{dow},
|
||||
numberlength => $subs->{numberlength},
|
||||
weeklength => $subs->{weeklength},
|
||||
monthlength => $subs->{monthlength},
|
||||
add1 => $subs->{add1},
|
||||
every1 => $subs->{every1},
|
||||
whenmorethan1 => $subs->{whenmorethan1},
|
||||
setto1 => $subs->{setto1},
|
||||
lastvalue1 => $subs->{lastvalue1},
|
||||
add2 => $subs->{add2},
|
||||
every2 => $subs->{every2},
|
||||
whenmorethan2 => $subs->{whenmorethan2},
|
||||
setto2 => $subs->{setto2},
|
||||
lastvalue2 => $subs->{lastvalue2},
|
||||
add3 => $subs->{add3},
|
||||
every3 => $subs->{every3},
|
||||
whenmorethan3 => $subs->{whenmorethan3},
|
||||
setto3 => $subs->{setto3},
|
||||
lastvalue3 => $subs->{lastvalue3},
|
||||
numberingmethod => $subs->{numberingmethod},
|
||||
status => $subs->{status},
|
||||
biblionumber => $subs->{biblionumber},
|
||||
bibliotitle => $subs->{bibliotitle},
|
||||
notes => $subs->{notes},
|
||||
subscriptionid => $subs->{subscriptionid},
|
||||
serialslist => \@serialslist,
|
||||
);
|
||||
$template->param(
|
||||
"periodicity$periodicity" => 1,
|
||||
"arrival$dow" => 1,
|
||||
"periodicity$subs->{periodicity}" => 1,
|
||||
"arrival$subs->{dow}" => 1,
|
||||
);
|
||||
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,177 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
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 $op = $query->param('op');
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $sth;
|
||||
my $id;
|
||||
my ($template, $loggedinuser, $cookie, $subs);
|
||||
|
||||
if ($op eq 'modsubscription') {
|
||||
&modsubscription($query->param('suscr'),$query->param('user'),$query->param('cost'),
|
||||
$query->param('supplier'),$query->param('budget'),$query->param('begin'),
|
||||
$query->param('frequency'),$query->param('arrival'),$query->param('numberlength'),
|
||||
$query->param('weeklength'),$query->param('monthlength'),
|
||||
$query->param('X'),$query->param('Xstate'),$query->param('Xfreq'),$query->param('Xstep'),
|
||||
$query->param('Y'),$query->param('Ystate'),$query->param('Yfreq'),$query->param('Ystep'),
|
||||
$query->param('Z'),$query->param('Zstate'),$query->param('Zfreq'),$query->param('Zstep'),
|
||||
$query->param('sequence'),$query->param('arrivalplanified'),1,
|
||||
$query->param('biblioid'),$query->param('notes')
|
||||
);
|
||||
|
||||
($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");
|
||||
warn "user =>".$query->param('user'),
|
||||
"librarian =>".$query->param('user'),
|
||||
"aqbooksellerid =>". $query->param('supplier'),
|
||||
"cost =>". $query->param('cost'),
|
||||
"aqbudgetid =>". $query->param('budget'),
|
||||
"startdate =>". $query->param('begin'),
|
||||
"frequency =>". $query->param('frequency'),
|
||||
"arrival =>". $query->param('dow'),
|
||||
"numberlength =>". $query->param('numberlength'),
|
||||
"weeklength =>". $query->param('weeklength'),
|
||||
"monthlength =>". $query->param('monthlength'),
|
||||
"seqnum1 =>". $query->param('X'),
|
||||
"startseqnum1 =>". $query->param('X'),
|
||||
"seqtype1 =>". $query->param('Xstate'),
|
||||
"freq1 =>". $query->param('Xfreq'),
|
||||
"step1 =>". $query->param('Xstep'),
|
||||
"seqnum2 =>". $query->param('Y'),
|
||||
"startseqnum2 =>". $query->param('Y'),
|
||||
"seqtype2 =>". $query->param('Ystate'),
|
||||
"freq2 =>". $query->param('Yfreq'),
|
||||
"step2 =>". $query->param('Ystep'),
|
||||
"seqnum3 =>". $query->param('Z'),
|
||||
"startseqnum3 =>". $query->param('Z'),
|
||||
"seqtype3 =>". $query->param('Zstate'),
|
||||
"freq3 =>". $query->param('Zfreq'),
|
||||
"step3 =>". $query->param('Zstep'),
|
||||
"sequence =>". $query->param('sequence'),
|
||||
"arrivalplanified =>". $query->param('arrivalplanified'),
|
||||
"status =>". $query->param('status'),
|
||||
"biblioid =>". $query->param('perioid'),
|
||||
"notes =>". $query->param('notes'),
|
||||
"suscr =>". $query->param('id');
|
||||
$template->param(
|
||||
user => $query->param('user'),
|
||||
librarian => $query->param('user'),
|
||||
aqbooksellerid => $query->param('supplier'),
|
||||
cost => $query->param('cost'),
|
||||
aqbudgetid => $query->param('budget'),
|
||||
startdate => $query->param('begin'),
|
||||
frequency => $query->param('frequency'),
|
||||
arrival => $query->param('dow'),
|
||||
numberlength => $query->param('numberlength'),
|
||||
weeklength => $query->param('weeklength'),
|
||||
monthlength => $query->param('monthlength'),
|
||||
seqnum1 => $query->param('X'),
|
||||
startseqnum1 => $query->param('X'),
|
||||
seqtype1 => $query->param('Xstate'),
|
||||
freq1 => $query->param('Xfreq'),
|
||||
step1 => $query->param('Xstep'),
|
||||
seqnum2 => $query->param('Y'),
|
||||
startseqnum2 => $query->param('Y'),
|
||||
seqtype2 => $query->param('Ystate'),
|
||||
freq2 => $query->param('Yfreq'),
|
||||
step2 => $query->param('Ystep'),
|
||||
seqnum3 => $query->param('Z'),
|
||||
startseqnum3 => $query->param('Z'),
|
||||
seqtype3 => $query->param('Zstate'),
|
||||
freq3 => $query->param('Zfreq'),
|
||||
step3 => $query->param('Zstep'),
|
||||
sequence => $query->param('sequence'),
|
||||
arrivalplanified => $query->param('arrivalplanified'),
|
||||
status => $query->param('status'),
|
||||
biblioid => $query->param('perioid'),
|
||||
notes => $query->param('notes'),
|
||||
suscr => $query->param('id'));
|
||||
|
||||
|
||||
$template->param(
|
||||
"frequency$query->param('frequency')" => 1,
|
||||
"Xstate".$query->param('Xstate') => 1,
|
||||
"Ystate".$query->param('Ystate') => 1,
|
||||
"Zstate".$query->param('Zstate') => 1,
|
||||
"arrival".query->param('$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)
|
||||
= 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 => $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,
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
#!/usr/bin/perl
|
||||
# WARNING: 4-character tab stops here
|
||||
|
||||
# Copyright 2000-2002 Katipo Communications
|
||||
#
|
||||
# This file is part of Koha.
|
||||
#
|
||||
# Koha is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
|
||||
# Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
use strict;
|
||||
require Exporter;
|
||||
use CGI;
|
||||
use C4::Koha;
|
||||
use C4::Auth;
|
||||
use C4::Date;
|
||||
use HTML::Template;
|
||||
use C4::Context;
|
||||
use C4::Search;
|
||||
use C4::Auth;
|
||||
use C4::Output;
|
||||
use C4::Interface::CGI::Output;
|
||||
use C4::Bull;
|
||||
|
||||
my $query = new CGI;
|
||||
my $dbh = C4::Context->dbh;
|
||||
|
||||
my $op = $query->param('op');
|
||||
my $subscriptionid = $query->param('subscriptionid');
|
||||
|
||||
my ($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "bull/subscription-renew.tmpl",
|
||||
query => $query,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {catalogue => 1},
|
||||
debug => 1,
|
||||
});
|
||||
if ($op eq "renew") {
|
||||
subscriptionrenew($subscriptionid,$loggedinuser,$query->param('startdate'),$query->param('numberlength'),$query->param('weeklength'),$query->param('monthlength'),$query->param('note'));
|
||||
}
|
||||
|
||||
my $subscription= getsubscription($subscriptionid);
|
||||
|
||||
$template->param(startdate => format_date(subscriptionexpirationdate($subscriptionid)),
|
||||
numberlength => $subscription->{numberlength},
|
||||
weeklength => $subscription->{weeklength},
|
||||
monthlength => $subscription->{monthlength},
|
||||
subscriptionid => $subscriptionid,
|
||||
bibliotitle => $subscription->{bibliotitle},
|
||||
$op => 1,
|
||||
);
|
||||
|
||||
# Print the page
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 4
|
||||
# End:
|
||||
|
|
@ -1,39 +1,53 @@
|
|||
<!-- TMPL_INCLUDE name="popup-top.inc" -->
|
||||
<div id="mainbloc">
|
||||
<h1 class="bull">Supplier Search Results</h1>
|
||||
<h1 class="acquisition">Supplier Search Results</h1>
|
||||
<div id="bloc100">
|
||||
<h2 class="bull">You searched on <b>supplier <!-- TMPL_VAR name="supplier" -->,</b> <!-- TMPL_VAR name="count" --> results found</h2>
|
||||
<h2 class="acquisition">You searched on <b>supplier <!-- TMPL_VAR name="supplier" -->,</b> <!-- TMPL_VAR name="count" --> results found</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th class="acquisition">Supplier</th>
|
||||
<th class="acquisition">Select</th>
|
||||
<th class="acquisition">Company</th>
|
||||
<th class="acquisition">
|
||||
<table class="noborder">
|
||||
<tr>
|
||||
<th class="acquisition">Basket</th>
|
||||
<th class="acquisition"> </th>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- TMPL_LOOP name="loop_suppliers" -->
|
||||
<tr bgcolor=<!-- TMPL_VAR name="color" -->>
|
||||
<tr valign=top bgcolor=<!-- TMPL_VAR name="color" -->>
|
||||
<td><!-- TMPL_VAR name="name" --></td>
|
||||
<td>
|
||||
<!-- TMPL_VAR name="name" -->
|
||||
</td>
|
||||
<td>
|
||||
<a href="#" onClick="GetIdInOpener('<!-- TMPL_VAR name=id -->','<!-- TMPL_VAR name="name" -->')">
|
||||
<img src="<!-- TMPL_VAR NAME='interface' -->/<!-- TMPL_VAR name="theme" -->/images/arrow.gif" title="select this supplier" BORDER=0 height=40 width=40>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- /TMPL_LOOP -->
|
||||
</table>
|
||||
</CENTER>
|
||||
<br>
|
||||
<a class="button bull" href="supplier.pl?id=0">Add supplier</a>
|
||||
|
||||
|
||||
<script language="javascript">
|
||||
|
||||
function GetIdInOpener(value,name)
|
||||
{
|
||||
opener.document.f.aqbooksellerid.value = value;
|
||||
opener.document.f.aqbooksellername.value= name;
|
||||
self.close();
|
||||
}
|
||||
|
||||
</script>
|
||||
<table width="100%" cellspacing=0 cellpadding=5 border=0>
|
||||
<tr>
|
||||
<th class="acquisition">Basket</th>
|
||||
<th class="acquisition">Items</th>
|
||||
<th class="acquisition">Created by</th>
|
||||
<th class="acquisition">Date</th>
|
||||
<th class="acquisition"> </th>
|
||||
</tr>
|
||||
<!-- TMPL_LOOP NAME="loop_basket" -->
|
||||
<tr>
|
||||
<td><!-- TMPL_VAR NAME="basketno" --></a></td>
|
||||
<td><TMPL_VAR NAME="total"></td>
|
||||
<td><!-- TMPL_VAR NAME="authorisedby" --></td>
|
||||
<td><!-- TMPL_VAR NAME="creationdate" --></td>
|
||||
<td>
|
||||
<!-- TMPL_IF name="closedate" -->
|
||||
closed on <!-- TMPL_VAR NAME="closedate" -->
|
||||
<!-- TMPL_ELSE -->
|
||||
<a href="/cgi-bin/koha/acqui/basket.pl?basket=<!-- TMPL_VAR NAME="basketno" -->" class="button acquisition">...</a>
|
||||
<!-- /TMPL_IF -->
|
||||
</td>
|
||||
</tr>
|
||||
<!-- /TMPL_LOOP -->
|
||||
</table>
|
||||
</tr>
|
||||
<!-- /TMPL_LOOP -->
|
||||
</table>
|
||||
</div>
|
||||
<a class="button acquisition" href="supplier.pl?supplerid=0">Add supplier</a>
|
||||
</div>
|
||||
<!-- TMPL_INCLUDE name="popup-bottom.inc" -->
|
||||
|
|
|
|||
|
|
@ -0,0 +1,87 @@
|
|||
<!-- TMPL_INCLUDE NAME="cat-top.inc" -->
|
||||
<!--------------------------MAIN BODY OF PAGE-------------------------->
|
||||
<div id="mainbloc">
|
||||
<h1 class="catalogue">Issues for a subscription</h1>
|
||||
<a href="/cgi-bin/koha/MARCdetail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button catalogue">Biblio</a>
|
||||
<form method="post" name="f">
|
||||
<div id="bloc25">
|
||||
<h2 class="catalogue">Subscription information</h2>
|
||||
<p>For <b><!-- TMPL_VAR name="bibliotitle" --></b> that began on <b><!-- TMPL_VAR name="startdate" --></b> and is issued every
|
||||
<b>
|
||||
<!--TMPL_IF name="periodicity1" -->
|
||||
day
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity2" -->
|
||||
week
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity3" -->
|
||||
2 weeks
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity4" -->
|
||||
3 weeks
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity5" -->
|
||||
month
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity6" -->
|
||||
2 monthes
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity7" -->
|
||||
3 Monthes
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity8" -->
|
||||
quarter
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity9" -->
|
||||
2 quarters
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity10" -->
|
||||
year
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity11" -->
|
||||
2 years
|
||||
<!-- /TMPL_IF -->
|
||||
</b>
|
||||
on
|
||||
<b>
|
||||
<!--TMPL_IF name="arrival1" -->
|
||||
Monday
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="arrival2" -->
|
||||
Tuesday
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="arrival3" -->
|
||||
Wednesday
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="arrival4" -->
|
||||
Thursday
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="arrival5" -->
|
||||
Friday
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="arrival6" -->
|
||||
Saturday
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="arrival7" -->
|
||||
Sunday
|
||||
<!-- /TMPL_IF -->
|
||||
</b>
|
||||
</p>
|
||||
<p>(subscription for
|
||||
<!-- TMPL_IF name="numberlength" --><!-- TMPL_VAR name="numberlength" --> issues<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="weeklength" --><!-- TMPL_VAR name="weeklength" --> weeks<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="monthlength" --><!-- TMPL_VAR name="monthlength" --> months<!-- /TMPL_IF -->
|
||||
)
|
||||
</p>
|
||||
<p><!-- TMPL_VAR name="notes" --></p>
|
||||
</div>
|
||||
<div id="bloc25">
|
||||
<h2 class="catalogue">Issues summary</h2>
|
||||
<p>
|
||||
<!-- TMPL_VAR name="librariannote" -->
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- TMPL_INCLUDE NAME="bull-bottom.inc" -->
|
||||
|
|
@ -2,7 +2,8 @@
|
|||
<!-- TMPL_INCLUDE name="bull-top.inc" -->
|
||||
<!--------------------------MAIN BODY OF PAGE-------------------------->
|
||||
<div id="mainbloc">
|
||||
<h1 class="bull">Subscription for XXX <!-- TMPL_VAR name="serial" --></h1>
|
||||
<h1 class="bull">Subscription for <!-- TMPL_VAR name="bibliotitle" --></h1>
|
||||
<a href="subscription-detail.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->" class="button bull">Subscription</a>
|
||||
|
||||
<div id="bloc25">
|
||||
<h2 class="bull">Subscription summary</h2>
|
||||
|
|
@ -12,7 +13,7 @@
|
|||
<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>Beginnning date (*)</label><input type="text" name="startdate" value="<!-- TMPL_VAR name="startdate" -->"></p>
|
||||
<p><label>Beginnning date (*)</label><input type="text" name="histstartdate" value="<!-- TMPL_VAR name="histstartdate" -->"></p>
|
||||
<p><label>End date</label><input type="text" name="enddate" value="<!-- TMPL_VAR name="enddate" -->"></p>
|
||||
<p>Arrived Numbers</p>
|
||||
<p> <textarea name="recievedlist" COLS=60 ROWS=5><!-- TMPL_VAR name="recievedlist" --></textarea></p>
|
||||
|
|
@ -56,11 +57,8 @@
|
|||
<td>
|
||||
<input type="hidden" name="serialid" value="<!-- TMPL_VAR name="serialid" -->">
|
||||
<select name="status" size="1">
|
||||
<option value="">None</option>
|
||||
<!--TMPL_IF name="status1" -->
|
||||
<option value="1" selected>Waited</option>
|
||||
<!-- TMPL_ELSE -->
|
||||
<option value="1" >Waited</option>
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="status2" -->
|
||||
<option value="2" selected>Arrived</option>
|
||||
|
|
@ -83,9 +81,20 @@
|
|||
<!-- /TMPL_LOOP -->
|
||||
</table>
|
||||
<input type="submit" value="Save changes" accesskey="w" class="button bull">
|
||||
<!-- TMPL_IF name="hassubscriptionexpired" -->
|
||||
<p>Subscription has expired. Waited last issue status can't be changed. <a href="#" onClick="popup()" class="button bull">Renew</a> your subscription</p>
|
||||
<!-- /TMPL_IF -->
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</table>
|
||||
<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');
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- TMPL_INCLUDE name="bull-bottom.inc" -->
|
||||
|
|
@ -15,85 +15,74 @@
|
|||
<input type="hidden" name="op" value="addsubscription">
|
||||
<input type="hidden" name="user" value="<!-- TMPL_VAR name="user" -->">
|
||||
<p>Librarian</td><td> <!-- TMPL_VAR name="user" --></p>
|
||||
<p><label>Supplier (*):</label><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()">...</a></p>
|
||||
<p><label>Cost</label><input type="text" name="cost" value="<!-- TMPL_VAR name="cost" -->" size=4></label></p>
|
||||
<p><label>Budget</label>
|
||||
<select name="aqbudgetid">
|
||||
<!-- TMPL_LOOP name="budgets" -->
|
||||
<!-- TMPL_IF name="selected" -->
|
||||
<option value="<!-- TMPL_VAR name="aqbudgetid" -->" selected>
|
||||
<!-- TMPL_ELSE -->
|
||||
<option value="<!-- TMPL_VAR name="aqbudgetid" -->">
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_VAR name="bookfundname" --> (<!-- TMPL_VAR name="startdate" --> - <!-- TMPL_VAR name="enddate" -->)
|
||||
</option>
|
||||
<!-- /TMPL_LOOP -->
|
||||
</select>
|
||||
</p>
|
||||
<p><label>Biblio</label><input type="text" name="biblionumber" value="<!-- TMPL_VAR name="biblionumber" -->" size=4> (<input type="text" name="title" value="<!-- TMPL_VAR name="title" -->" disabled readonly>)<a href="#" onClick="Plugin(f)">...</a></p>
|
||||
<p><label>Notes</label><TEXTAREA NAME="notes" COLS=30 ROWS=2><!-- TMPL_VAR name="notes" --></TEXTAREA></p>
|
||||
<p><label>Biblio</label><input type="text" name="biblionumber" value="<!-- TMPL_VAR name="biblionumber" -->" size=4> (<input type="text" name="title" value="<!-- TMPL_VAR name="title" -->" disabled readonly>)<a href="#" onClick="Plugin(f)">...</a></p>
|
||||
<p><label>Notes</label><TEXTAREA NAME="notes" COLS=30 ROWS=2><!-- TMPL_VAR name="notes" --></TEXTAREA></p>
|
||||
<p class="problem">warning</p>
|
||||
<ul>
|
||||
<li>remember you <b>must</b> have created a biblio <b>before</b> creating a subscription</li>
|
||||
<li>a suggestion is sent to the librarian. The suggestion will be changed to an order</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="bloc25">
|
||||
<h2 class="bull">Planning</h2>
|
||||
<p><label class="label100">Beginnning date:</label> <input type="text" name="startdate" value="<!-- TMPL_VAR name="startdate" -->" size=13 maxlength=10></p>
|
||||
<p><label class="label100">Next issue (expected)</label><input type="text" name="arrivalplanified" value="<!-- TMPL_VAR name="arrivalplanified" -->" size=13 maxlength=10></p>
|
||||
<p><label class="label100">Frequency (*)</label>
|
||||
<select name="periodicity" size="1">
|
||||
<option value="" selected>None</option>
|
||||
<option value="" selected>Unknown</option>
|
||||
<!-- TMPL_IF name="periodicity1" -->
|
||||
<option value="1" selected>1/day</option>
|
||||
<!-- TMPL_ELSE -->
|
||||
<option value="1">1/day</option>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="periodicity2" -->
|
||||
<option value="2" selected>1 week</option>
|
||||
<option value="2" selected>1/week</option>
|
||||
<!-- TMPL_ELSE -->
|
||||
<option value="2">1 week</option>
|
||||
<option value="2">1/week</option>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="periodicity3" -->
|
||||
<option value="3" selected>2 weeks</option>
|
||||
<option value="3" selected>1/2 weeks</option>
|
||||
<!-- TMPL_ELSE -->
|
||||
<option value="3">2 weeks</option>
|
||||
<option value="3">1/2 weeks</option>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="periodicity4" -->
|
||||
<option value="4" selected>3 weeks</option>
|
||||
<option value="4" selected>1/3 weeks</option>
|
||||
<!-- TMPL_ELSE -->
|
||||
<option value="4">3 weeks</option>
|
||||
<option value="4">1/3 weeks</option>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="periodicity5" -->
|
||||
<option value="5" selected>1 month</option>
|
||||
<option value="5" selected>1/month</option>
|
||||
<!-- TMPL_ELSE -->
|
||||
<option value="5">1 month</option>
|
||||
<option value="5">1/month</option>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="periodicity6" -->
|
||||
<option value="6" selected>2 months</option>
|
||||
<option value="6" selected>1/2 months</option>
|
||||
<!-- TMPL_ELSE -->
|
||||
<option value="6">2 months</option>
|
||||
<option value="6">1/2 months</option>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="periodicity7" -->
|
||||
<option value="7" selected>3 months</option>
|
||||
<option value="7" selected>1/3 months</option>
|
||||
<!-- TMPL_ELSE -->
|
||||
<option value="7">3 months</option>
|
||||
<option value="7">1/3 months</option>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="periodicity8" -->
|
||||
<option value="8" selected>1 quarter</option>
|
||||
<option value="8" selected>1/quarter</option>
|
||||
<!-- TMPL_ELSE -->
|
||||
<option value="8">1 quarter</option>
|
||||
<option value="8">1/quarter</option>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="periodicity9" -->
|
||||
<option value="9" selected>2 quarters</option>
|
||||
<option value="9" selected>1/2 quarters</option>
|
||||
<!-- TMPL_ELSE -->
|
||||
<option value="9">2 quarters</option>
|
||||
<option value="9">1/2 quarters</option>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="periodicity10" -->
|
||||
<option value="10" selected>1 year</option>
|
||||
<option value="10" selected>1/year</option>
|
||||
<!-- TMPL_ELSE -->
|
||||
<option value="10">1 year</option>
|
||||
<option value="10">1/year</option>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="periodicity11" -->
|
||||
<option value="11" selected>2 years</option>
|
||||
<option value="11" selected>1/2 years</option>
|
||||
<!-- TMPL_ELSE -->
|
||||
<option value="11">2 years</option>
|
||||
<option value="11">1/2 years</option>
|
||||
<!-- /TMPL_IF -->
|
||||
</select>
|
||||
</p>
|
||||
|
|
@ -225,9 +214,8 @@ function FindAcqui(f)
|
|||
|
||||
function Check(f)
|
||||
{
|
||||
if (f.aqbooksellerid.value.length != 0 && f.dow.value.length != 0
|
||||
&& f.startdate.value.length != 0 && f.dow.value.length != 0
|
||||
&& f.periodicity.value.length != 0)
|
||||
if (f.dow.value.length != 0
|
||||
&& f.startdate.value.length != 0 && f.dow.value.length != 0)
|
||||
{
|
||||
// alert('subscription ok');
|
||||
document.f.submit();
|
||||
|
|
@ -238,149 +226,4 @@ else
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function select(reponse, type)
|
||||
{
|
||||
if (type == 'X')
|
||||
{
|
||||
if (reponse == 0)
|
||||
{
|
||||
document.f.step1.style.backgroundColor="#DCDCDC";
|
||||
document.f.step1.value = "";
|
||||
document.f.step1.disabled = true;
|
||||
document.f.freq1.style.backgroundColor="#DCDCDC";
|
||||
document.f.freq1.value = "";
|
||||
document.f.freq1.disabled = true;
|
||||
document.f.seqnum1.style.backgroundColor="#DCDCDC";
|
||||
document.f.seqnum1.value = "";
|
||||
document.f.seqnum1.disabled = true;
|
||||
|
||||
}
|
||||
if (reponse == 1)
|
||||
{
|
||||
document.f.step1.style.backgroundColor="#FFFFFF";
|
||||
document.f.step1.disabled = false;
|
||||
document.f.freq1.style.backgroundColor="#DCDCDC";
|
||||
document.f.freq1.value = "";
|
||||
document.f.freq1.disabled = true;
|
||||
document.f.seqnum1.style.backgroundColor="#FFFFFF";
|
||||
document.f.seqnum1.disabled = false;
|
||||
}
|
||||
if (reponse == 2)
|
||||
{
|
||||
document.f.step1.style.backgroundColor="#FFFFFF";
|
||||
document.f.step1.disabled = false;
|
||||
document.f.freq1.style.backgroundColor="#FFFFFF";
|
||||
document.f.freq1.disabled = false;
|
||||
document.f.seqnum1.style.backgroundColor="#FFFFFF";
|
||||
document.f.seqnum1.disabled = false;
|
||||
}
|
||||
if (reponse == 3)
|
||||
{
|
||||
document.f.step1.style.backgroundColor="#DCDCDC";
|
||||
document.f.step1.value = "";
|
||||
document.f.step1.disabled = true;
|
||||
document.f.freq1.style.backgroundColor="#DCDCDC";
|
||||
document.f.freq1.value = "";
|
||||
document.f.freq1.disabled = true;
|
||||
document.f.seqnum1.style.backgroundColor="#FFFFFF";
|
||||
document.f.seqnum1.disabled = false;
|
||||
}
|
||||
}
|
||||
if (type == 'Y')
|
||||
{
|
||||
if (reponse == 0)
|
||||
{
|
||||
document.f.step2.style.backgroundColor="#DCDCDC";
|
||||
document.f.step2.value = "";
|
||||
document.f.step2.disabled = true;
|
||||
document.f.freq2.style.backgroundColor="#DCDCDC";
|
||||
document.f.freq2.value = "";
|
||||
document.f.freq2.disabled = true;
|
||||
document.f.seqnum2.style.backgroundColor="#DCDCDC";
|
||||
document.f.seqnum2.value = "";
|
||||
document.f.seqnum2.disabled = true;
|
||||
|
||||
}
|
||||
if (reponse == 1)
|
||||
{
|
||||
document.f.step2.style.backgroundColor="#FFFFFF";
|
||||
document.f.step2.disabled = false;
|
||||
document.f.freq2.style.backgroundColor="#DCDCDC";
|
||||
document.f.freq2.value = "";
|
||||
document.f.freq2.disabled = true;
|
||||
document.f.seqnum2.style.backgroundColor="#FFFFFF";
|
||||
document.f.seqnum2.disabled = false;
|
||||
}
|
||||
if (reponse == 2)
|
||||
{
|
||||
document.f.step2.style.backgroundColor="#FFFFFF";
|
||||
document.f.step2.disabled = false;
|
||||
document.f.freq2.style.backgroundColor="#FFFFFF";
|
||||
document.f.freq2.disabled = false;
|
||||
document.f.seqnum2.style.backgroundColor="#FFFFFF";
|
||||
document.f.seqnum2.disabled = false;
|
||||
}
|
||||
if (reponse == 3)
|
||||
{
|
||||
document.f.step2.style.backgroundColor="#DCDCDC";
|
||||
document.f.step2.value = "";
|
||||
document.f.step2.disabled = true;
|
||||
document.f.freq2.style.backgroundColor="#DCDCDC";
|
||||
document.f.freq2.value = "";
|
||||
document.f.freq2.disabled = true;
|
||||
document.f.Y.style.backgroundColor="#FFFFFF";
|
||||
document.f.Y.disabled = false;
|
||||
}
|
||||
|
||||
}
|
||||
if (type == 'Z')
|
||||
{
|
||||
if (reponse == 0)
|
||||
{
|
||||
document.f.step3.style.backgroundColor="#DCDCDC";
|
||||
document.f.step3.value = "";
|
||||
document.f.step3.disabled = true;
|
||||
document.f.freq3.style.backgroundColor="#DCDCDC";
|
||||
document.f.freq3.value = "";
|
||||
document.f.freq3.disabled = true;
|
||||
document.f.seqnum3.style.backgroundColor="#DCDCDC";
|
||||
document.f.seqnum3.value = "";
|
||||
document.f.seqnum3.disabled = true;
|
||||
|
||||
}
|
||||
if (reponse == 1)
|
||||
{
|
||||
document.f.step3.style.backgroundColor="#FFFFFF";
|
||||
document.f.step3.disabled = false;
|
||||
document.f.freq3.style.backgroundColor="#DCDCDC";
|
||||
document.f.freq3.value = "";
|
||||
document.f.freq3.disabled = true;
|
||||
document.f.seqnum3.style.backgroundColor="#FFFFFF";
|
||||
document.f.seqnum3.disabled = false;
|
||||
}
|
||||
if (reponse == 2)
|
||||
{
|
||||
document.f.step3.style.backgroundColor="#FFFFFF";
|
||||
document.f.step3.disabled = false;
|
||||
document.f.freq3.style.backgroundColor="#FFFFFF";
|
||||
document.f.freq3.disabled = false;
|
||||
document.f.seqnum3.style.backgroundColor="#FFFFFF";
|
||||
document.f.seqnum3.disabled = false;
|
||||
}
|
||||
if (reponse == 3)
|
||||
{
|
||||
document.f.step3.style.backgroundColor="#DCDCDC";
|
||||
document.f.step3.value = "";
|
||||
document.f.step3.disabled = true;
|
||||
document.f.freq3.style.backgroundColor="#DCDCDC";
|
||||
document.f.freq3.value = "";
|
||||
document.f.freq3.disabled = true;
|
||||
document.f.seqnum3.style.backgroundColor="#FFFFFF";
|
||||
document.f.seqnum3.disabled = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
@ -3,7 +3,8 @@
|
|||
<div id="mainbloc">
|
||||
<h1 class="bull">Subscription</h1>
|
||||
<a href="subscription-add.pl?op=mod&subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->" class="button bull">Edit</a>
|
||||
<a href="statecollection.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->" class="button bull">Recieve</a>
|
||||
<a href="statecollection.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->" class="button bull">Issues</a>
|
||||
<a href="/cgi-bin/koha/MARCdetail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button bull">Biblio</a>
|
||||
<form method="post" name="f">
|
||||
<div id="bloc25">
|
||||
<h2 class="bull">Subscription information</h2>
|
||||
|
|
@ -25,10 +26,10 @@
|
|||
1/week
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity3" -->
|
||||
2/weeks
|
||||
1/2 weeks
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity4" -->
|
||||
3/weeks
|
||||
1/3 weeks
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity5" -->
|
||||
1/Month
|
||||
|
|
@ -43,13 +44,13 @@
|
|||
1/quarter
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity9" -->
|
||||
2 quarters
|
||||
1/2 quarters
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity10" -->
|
||||
1 year
|
||||
1/year
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity11" -->
|
||||
2 years
|
||||
1/2 years
|
||||
<!-- /TMPL_IF -->
|
||||
</p>
|
||||
<p><label class="label100">Arrives on:</label>
|
||||
|
|
@ -132,7 +133,41 @@
|
|||
<td><!-- TMPL_VAR name="lastvalue3" --></td>
|
||||
</tr> </table>
|
||||
</div>
|
||||
|
||||
<div id="bloc25">
|
||||
<h2 class="bull">Issues</h2>
|
||||
<table class="small">
|
||||
<tr>
|
||||
<th class="bull"> Issue number </th>
|
||||
<th class="bull"> Planned date </th>
|
||||
<th class="bull"> Status </th>
|
||||
</tr>
|
||||
<!-- TMPL_LOOP name="serialslist" -->
|
||||
<tr>
|
||||
<td>
|
||||
<!-- TMPL_VAR name="serialseq" -->
|
||||
</td>
|
||||
<td>
|
||||
<!-- TMPL_VAR name="planneddate" -->
|
||||
</td>
|
||||
<td>
|
||||
<!--TMPL_IF name="status1" -->
|
||||
Waited
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="status2" -->
|
||||
Arrived
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="status3" -->
|
||||
Late
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="status4" -->
|
||||
Missing
|
||||
<!-- /TMPL_IF -->
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- /TMPL_LOOP -->
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- TMPL_INCLUDE NAME="bull-bottom.inc" -->
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<!-- TMPL_INCLUDE NAME="popup-top.inc" -->
|
||||
<div id="mainbloc">
|
||||
|
||||
<h1 class="bull">subscription renewal for <!-- TMPL_VAR name="bibliotitle" --></h1>
|
||||
|
||||
<form name="f" method="post">
|
||||
<div id="bloc25">
|
||||
<input type="hidden" name="op" value="renew">
|
||||
<input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->">
|
||||
<p><label class="label100">start date</label><input type="text" name="startdate" value="<!-- TMPL_VAR name="startdate" -->"></p>
|
||||
<p>Subscription length :</p>
|
||||
<p><label class="label100">Number of num</label><input type="text" name="numberlength" value="<!-- TMPL_VAR name="numberlength" -->"></p>
|
||||
<p><label class="label100">Number of weeks</label><input type="text" name="weeklength" value="<!-- TMPL_VAR name="weeklength" -->"></p>
|
||||
<p><label class="label100">Number of months</label><input type="text" name="monthlength" value="<!-- TMPL_VAR name="monthlength" -->"></p>
|
||||
<p>Note for the librarian that will manage your renewal request</p>
|
||||
<ul><textarea name="note" rows="10" cols="60"></textarea></ul>
|
||||
<input type="submit" value="Request a renewal" class="button bull">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- TMPL_INCLUDE NAME="popup-bottom.inc" -->
|
||||
|
||||
|
|
@ -45,8 +45,7 @@ a.bull:hover {
|
|||
</div>
|
||||
<div id="submenu">
|
||||
<span class="koha">options >> </span>
|
||||
<a href="/cgi-bin/koha/bull/subscription.pl?report_name=itemtypes" class="submenu">Subscription</a>
|
||||
<a href="/cgi-bin/koha/bull/receipt.pl?report_name=itemtypes" class="submenu">Receipt</a>
|
||||
<a href="/cgi-bin/koha/bull-home.pl" class="submenu">Search subscription</a>
|
||||
</div>
|
||||
|
||||
<!-- TMPL_IF NAME="loggedinusername" -->
|
||||
|
|
|
|||
|
|
@ -0,0 +1,85 @@
|
|||
<!-- TMPL_INCLUDE NAME="opac-top.inc" -->
|
||||
<!--------------------------MAIN BODY OF PAGE-------------------------->
|
||||
<div id="mainbloc">
|
||||
<h1 class="catalogue">Issues for a subscription</h1>
|
||||
<a href="opac-detail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button catalogue">Back to biblio</a>
|
||||
<form method="post" name="f">
|
||||
<div id="bloc25">
|
||||
<h2 class="catalogue">Subscription information for <!-- TMPL_VAR name="bibliotitle" --></h2>
|
||||
<p>It began on <b><!-- TMPL_VAR name="startdate" --></b> and is issued every
|
||||
<b>
|
||||
<!--TMPL_IF name="periodicity1" -->
|
||||
day
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity2" -->
|
||||
week
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity3" -->
|
||||
2 weeks
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity4" -->
|
||||
3 weeks
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity5" -->
|
||||
month
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity6" -->
|
||||
2 monthes
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity7" -->
|
||||
3 Monthes
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity8" -->
|
||||
quarter
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity9" -->
|
||||
2 quarters
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity10" -->
|
||||
year
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="periodicity11" -->
|
||||
2 years
|
||||
<!-- /TMPL_IF -->
|
||||
</b>
|
||||
on
|
||||
<b>
|
||||
<!--TMPL_IF name="arrival1" -->
|
||||
Monday
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="arrival2" -->
|
||||
Tuesday
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="arrival3" -->
|
||||
Wednesday
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="arrival4" -->
|
||||
Thursday
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="arrival5" -->
|
||||
Friday
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="arrival6" -->
|
||||
Saturday
|
||||
<!-- /TMPL_IF -->
|
||||
<!--TMPL_IF name="arrival7" -->
|
||||
Sunday
|
||||
<!-- /TMPL_IF -->
|
||||
</b>
|
||||
for <b>
|
||||
<!-- TMPL_IF name="numberlength" --><!-- TMPL_VAR name="numberlength" --> issues<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="weeklength" --><!-- TMPL_VAR name="weeklength" --> weeks<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="monthlength" --><!-- TMPL_VAR name="monthlength" --> months<!-- /TMPL_IF -->
|
||||
</b>
|
||||
since <b><!-- TMPl_VAR name="startdate" --></b>
|
||||
</p>
|
||||
<p><!-- TMPL_VAR name="notes" --></p>
|
||||
<h2 class="catalogue">Issues summary</h2>
|
||||
<p>
|
||||
<!-- TMPL_VAR name="opacnote" -->
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->
|
||||
Loading…
Reference in New Issue