From 2d9b5980a16f351f92d0b5ce5d0a9110bd437ad1 Mon Sep 17 00:00:00 2001 From: hdl Date: Wed, 30 Nov 2005 16:18:02 +0000 Subject: [PATCH] Adding a reserve management page in circulation module. Should add a link to it into the menu. It basically displays all the reservations not cancelled. --- circ/reserve.pl | 107 ++++++++++++++++++ .../default/en/circ/reserve.tmpl | 36 ++++++ 2 files changed, 143 insertions(+) create mode 100755 circ/reserve.pl create mode 100644 koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl diff --git a/circ/reserve.pl b/circ/reserve.pl new file mode 100755 index 0000000000..6aa6cbb23e --- /dev/null +++ b/circ/reserve.pl @@ -0,0 +1,107 @@ +#!/usr/bin/perl + +# $Id$ + +# 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; +use C4::Context; +use C4::Output; +use CGI; +use HTML::Template; +use C4::Auth; + +my $input = new CGI; +my $type=$input->param('type'); +my $order=$input->param('order'); + +my $theme = $input->param('theme'); # only used if allowthemeoverride is set + +my ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "circ/reserve.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {borrowers => 1}, + debug => 1, + }); +# borrowernumber int(11) +# reservedate date +# biblionumber int(11) +# constrainttype char(1) +# branchcode varchar(4) +# notificationdate date +# reminderdate date +# cancellationdate date +# reservenotes text +# priority smallint(6) +# found char(1) +# timestamp timestamp ON UPDATE CURRENT_TIMESTAMP Oui CURRENT_TIMESTAMP Modifier Supprimer Primaire Index Unique Texte entier +# itemnumber int(11) +my $duedate; +my $bornum; +my $itemnum; +my $data1; +my $data2; +my $data3; +my $name; +my $phone; +my $email; +my $biblionumber; +my $title; +my $author; +my @datearr = localtime(time()); +my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]); + +my $dbh = C4::Context->dbh; +my $strsth="select reservedate,reserves.borrowernumber as bornum, concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,reserves.biblionumber, itemnumber, notes, notificationdate, reminderdate, priority, biblio.title, biblio.author from reserves, borrowers,biblio where isnull(cancellationdate) && reserves.borrowernumber=borrowers.borrowernumber && reserves.biblionumber=biblio.biblionumber order by reservedate, borrower "; +$strsth="select reservedate,reserves.borrowernumber as bornum,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,reserves.biblionumber, itemnumber, notes, notificationdate, reminderdate, priority, biblio.title, biblio.author from reserves, borrowers,biblio where isnull(cancellationdate) && reserves.borrowernumber=borrowers.borrowernumber && reserves.biblionumber=biblio.biblionumber order by borrower,reservedate " if ($order eq "borrower"); +$strsth="select reservedate,reserves.borrowernumber as bornum,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,reserves.biblionumber, itemnumber, notes, notificationdate, reminderdate, priority, biblio.title, biblio.author from reserves, borrowers,biblio where isnull(cancellationdate) && reserves.borrowernumber=borrowers.borrowernumber && reserves.biblionumber=biblio.biblionumber order by biblio.title, priority,reservedate " if ($order eq "biblio"); +my $sth=$dbh->prepare($strsth); +warn "".$strsth; +$sth->execute(); + +my @reservedata; +while (my $data=$sth->fetchrow_hashref) { + push (@reservedata, + { + reservedate => $data->{reservedate}, + priority => $data->{priority}, + name => $data->{borrower}, + title => $data->{title}, + author => $data->{author}, + bornum => $data->{bornum}, + itemnum => $data->{itemnumber}, + phone => $data->{phone}, + email => $data->{email}, + biblionumber => $data->{biblionumber}, + notes => $data->{notes}, + notificationdate => $data->{notificationdate}, + reminderdate => $data->{reminderdate} + } + + ); + +} + +$sth->finish; + +$template->param( todaysdate => $todaysdate, + reserveloop => \@reservedata ); + +print "Content-Type: text/html\n\n", $template->output; diff --git a/koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl b/koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl new file mode 100644 index 0000000000..00c9e93b7f --- /dev/null +++ b/koha-tmpl/intranet-tmpl/default/en/circ/reserve.tmpl @@ -0,0 +1,36 @@ + +
+

Items Reserved as of

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
reserve Date PatronTitleAuthorPriorityPhoneemailNotesNotification dateReminder date
">">?subject=Reservation: "> + 
+
+ -- 2.39.5