5 # Copyright 2000-2002 Katipo Communications
7 # This file is part of Koha.
9 # Koha is free software; you can redistribute it and/or modify it under the
10 # terms of the GNU General Public License as published by the Free Software
11 # Foundation; either version 2 of the License, or (at your option) any later
14 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License along with
19 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
20 # Suite 330, Boston, MA 02111-1307 USA
31 my $type=$input->param('type');
32 my $order=$input->param('order');
34 my $theme = $input->param('theme'); # only used if allowthemeoverride is set
36 my ($template, $loggedinuser, $cookie)
37 = get_template_and_user({template_name => "circ/reserve.tmpl",
41 flagsrequired => {borrowers => 1},
44 # borrowernumber int(11)
46 # biblionumber int(11)
47 # constrainttype char(1)
48 # branchcode varchar(4)
49 # notificationdate date
51 # cancellationdate date
53 # priority smallint(6)
55 # timestamp timestamp ON UPDATE CURRENT_TIMESTAMP Oui CURRENT_TIMESTAMP Modifier Supprimer Primaire Index Unique Texte entier
69 my @datearr = localtime(time());
70 my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]);
72 my $dbh = C4::Context->dbh;
73 my $strsth="select reservedate,reserves.borrowernumber as bornum, concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,reserves.biblionumber, reserves.branchcode as branch, items.holdingbranch, items.itemcallnumber, items.itemnumber, notes, notificationdate, reminderdate, priority, reserves.found, biblio.title, biblio.author from reserves left join items on items.itemnumber=reserves.itemnumber, borrowers,biblio where isnull(cancellationdate) && reserves.borrowernumber=borrowers.borrowernumber && reserves.biblionumber=biblio.biblionumber order by reservedate, borrower ";
74 $strsth="select reservedate,reserves.borrowernumber as bornum,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,reserves.biblionumber, reserves.branchcode as branch, items.holdingbranch, items.itemcallnumber, items.itemnumber, notes, notificationdate, reminderdate, priority, reserves.found, biblio.title, biblio.author from reserves left join items on items.itemnumber=reserves.itemnumber , borrowers,biblio where isnull(cancellationdate) && reserves.borrowernumber=borrowers.borrowernumber && reserves.biblionumber=biblio.biblionumber order by borrower,reservedate " if ($order eq "borrower");
75 $strsth="select reservedate,reserves.borrowernumber as bornum,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,reserves.biblionumber, reserves.branchcode as branch, items.holdingbranch, items.itemcallnumber, items.itemnumber, notes, notificationdate, reminderdate, priority, reserves.found, biblio.title, biblio.author from reserves left join items on items.itemnumber=reserves.itemnumber, borrowers,biblio where isnull(cancellationdate) && reserves.borrowernumber=borrowers.borrowernumber && reserves.biblionumber=biblio.biblionumber order by biblio.title, priority,reservedate " if ($order eq "biblio");
76 my $sth=$dbh->prepare($strsth);
81 while (my $data=$sth->fetchrow_hashref) {
84 reservedate => format_date($data->{reservedate}),
85 priority => $data->{priority},
86 name => $data->{borrower},
87 title => $data->{title},
88 author => $data->{author},
89 bornum => $data->{bornum},
90 itemnum => $data->{itemnumber},
91 phone => $data->{phone},
92 email => $data->{email},
93 biblionumber => $data->{biblionumber},
94 statusw => ($data->{found} eq "w"),
95 statusf => ($data->{found} eq "f"),
96 holdingbranch => $data->{holdingbranch},
97 branch => $data->{branch},
98 itemcallnumber => $data->{itemcallnumber},
99 notes => $data->{notes},
100 notificationdate => $data->{notificationdate},
101 reminderdate => $data->{reminderdate}
110 $template->param(todaysdate => format_date($todaysdate),
111 reserveloop => \@reservedata,
112 intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
113 intranetstylesheet => C4::Context->preference("intranetstylesheet"),
114 IntranetNav => C4::Context->preference("IntranetNav"),
117 print "Content-Type: text/html\n\n", $template->output;