Browse Source

Add print slip to hold confirmation dialog.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
3.0.x
Ryan Higgins 15 years ago
committed by Joshua Ferraro
parent
commit
86ee8ee384
  1. 37
      C4/Reserves.pm
  2. 67
      circ/hold-transfer-slip.pl
  3. 33
      circ/pendingreserves.pl
  4. 4
      koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close-receipt.inc
  5. 33
      koha-tmpl/intranet-tmpl/prog/en/modules/circ/hold-transfer-slip.tmpl
  6. 13
      koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl

37
C4/Reserves.pm

@ -94,6 +94,7 @@ BEGIN {
&GetReservesToBranch
&GetReserveCount
&GetReserveFee
&GetReserveInfo
&GetOtherReserves
@ -1038,6 +1039,42 @@ sub ModReserveMinusPriority {
$sth_upd->finish;
}
=item GetReserveInfo
&GetReserveInfo($borrowernumber,$biblionumber);
Get item and borrower details for a current hold.
Current implementation this query should have a single result.
=cut
sub GetReserveInfo {
my ( $borrowernumber, $biblionumber ) = @_;
my $dbh = C4::Context->dbh;
my $strsth="SELECT reservedate, reservenotes, reserves.borrowernumber,
reserves.biblionumber, reserves.branchcode,
notificationdate, reminderdate, priority, found,
firstname, surname, phone,
email, address, address2,
cardnumber, city, zipcode,
biblio.title, biblio.author,
items.holdingbranch, items.itemcallnumber, items.itemnumber,
barcode, notes
FROM reserves left join items
ON items.itemnumber=reserves.itemnumber ,
borrowers, biblio
WHERE
reserves.borrowernumber=? &&
reserves.biblionumber=? &&
reserves.borrowernumber=borrowers.borrowernumber &&
reserves.biblionumber=biblio.biblionumber ";
my $sth = $dbh->prepare($strsth);
$sth->execute($borrowernumber,$biblionumber);
my $data = $sth->fetchrow_hashref;
return $data;
}
=item _FixPriority
&_FixPriority($biblio,$borrowernumber,$rank);

67
circ/hold-transfer-slip.pl

@ -0,0 +1,67 @@
#!/usr/bin/perl
# Copyright 2008 LibLime
#
# 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 C4::Auth;
use C4::Reserves;
use C4::Branch;
use C4::Dates qw/format_date format_date_in_iso/;
use vars qw($debug);
BEGIN {
$debug = $ENV{DEBUG} || 0;
}
my $input = new CGI;
my $biblionumber = $input->param('biblionumber');
my $borrowernumber = $input->param('borrowernumber');
my $transfer = $input->param('transfer');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "circ/hold-transfer-slip.tmpl",
query => $input,
type => "intranet",
authnotrequired => 0,
flagsrequired => { circulate => 1 },
debug => $debug,
}
);
my $reserveinfo = GetReserveInfo($borrowernumber,$biblionumber );
my $pulldate = C4::Dates->new();
use Data::Dumper;
warn Dumper($reserveinfo);
$reserveinfo->{'pulldate'} = $pulldate->output();
$reserveinfo->{'branchname'} = GetBranchName($reserveinfo->{'branchcode'});
$reserveinfo->{'transferrequired'} = $transfer;
$template->param( reservedata => [ $reserveinfo ] ,
);
output_html_with_http_headers $input, $cookie, $template->output;

33
circ/pendingreserves.pl

@ -33,14 +33,18 @@ BEGIN {
my $input = new CGI;
my $order = $input->param('order');
my $startdate=$input->param('from');
my $enddate=$input->param('to');
my $startdate = $input->param('from');
my $enddate = $input->param('to');
my $theme = $input->param('theme'); # only used if allowthemeoverride is set
my $op = $input->param('op');
my $biblionumber = $input->param('biblionumber');
my $borrowernumber = $input->param('borrowernumber');
my $tmpl_name = ($op eq 'slip') ? "circ/hold-transfer-slip.tmpl" : "circ/pendingreserves.tmpl" ;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "circ/pendingreserves.tmpl",
template_name => $tmpl_name,
query => $input,
type => "intranet",
authnotrequired => 0,
@ -50,7 +54,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
);
my $duedate;
my $borrowernumber;
my $itemnum;
my $data1;
my $data2;
@ -58,10 +61,11 @@ my $data3;
my $name;
my $phone;
my $email;
my $biblionumber;
my $title;
my $author;
warn $op;
warn $biblionumber;
warn $borrowernumber;
my @datearr = localtime( time() );
my $todaysdate =
( 1900 + $datearr[5] ) . '-'
@ -69,11 +73,15 @@ my $todaysdate =
. sprintf( "%0.2d", $datearr[3] );
my $dbh = C4::Context->dbh;
my ($sqlorderby, $sqldatewhere) = ("","");
my ($sqlorderby, $sqldatewhere, $sqlwhowhere) = ("","","");
$debug and warn format_date_in_iso($startdate) . "\n" . format_date_in_iso($enddate);
$sqldatewhere .= " AND reservedate >= " . $dbh->quote(format_date_in_iso($startdate)) if ($startdate) ;
$sqldatewhere .= " AND reservedate <= " . $dbh->quote(format_date_in_iso($enddate)) if ($enddate) ;
if ($op eq 'slip') {
$sqlwhowhere .= " && reserves.borrowernumber = " . $dbh->quote($borrowernumber) ;
$sqlwhowhere .= " && reserves.biblionumber = " . $dbh->quote($biblionumber) ;
} else {
$sqldatewhere .= " AND reservedate >= " . $dbh->quote(format_date_in_iso($startdate)) if ($startdate) ;
$sqldatewhere .= " AND reservedate <= " . $dbh->quote(format_date_in_iso($enddate)) if ($enddate) ;
}
if ($order eq "borrower") {
$sqlorderby = " order by borrower, reservedate";
} elsif ($order eq "biblio") {
@ -106,6 +114,7 @@ my $strsth =
LEFT JOIN borrowers ON reserves.borrowernumber=borrowers.borrowernumber
LEFT JOIN biblio ON reserves.biblionumber=biblio.biblionumber
WHERE reserves.found is NULL
$sqlwhowhere
$sqldatewhere
AND items.itemnumber NOT IN (SELECT itemnumber FROM issues)
AND reserves.itemnumber is NULL";
@ -114,6 +123,8 @@ if (C4::Context->preference('IndependantBranches')){
$strsth .= " AND items.holdingbranch=? ";
}
$strsth .= $sqlorderby;
warn $strsth;
my $sth = $dbh->prepare($strsth);
if (C4::Context->preference('IndependantBranches')){

4
koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close-receipt.inc

@ -0,0 +1,4 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="<!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" media="print" href="<!-- TMPL_VAR name="themelang" -->/css/print.css" />

33
koha-tmpl/intranet-tmpl/prog/en/modules/circ/hold-transfer-slip.tmpl

@ -0,0 +1,33 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<title>Koha -- Circulation: Transfers</title>
<!-- TMPL_INCLUDE NAME="doc-head-close-receipt.inc" -->
</head>
<body onload="window.print();window.close();">
<div id="main">
<!-- TMPL_LOOP NAME="reservedata" -->
<h5>Date: <!-- TMPL_VAR NAME="pulldate" --></h5>
<h3> <!-- TMPL_IF NAME="transferrequired" -->Transfer to <!-- TMPL_VAR Name="branchname" --> <!-- TMPL_ELSE -->Hold in <!-- TMPL_VAR Name="branchname" --><!-- /TMPL_IF --></h3>
<div id="reserve_display">
<h3><!-- TMPL_VAR Name="surname" -->, <!-- TMPL_VAR Name="firstname" --></h3>
<ul>
<li><!-- TMPL_VAR Name="cardnumber" --></li>
<li><!-- TMPL_VAR Name="phone" --></li>
<li><!-- TMPL_VAR Name="address" --><br />
<!-- TMPL_IF Name="address2" --><!-- TMPL_VAR Name="address2" --><br /><!-- /TMPL_IF -->
<!-- TMPL_VAR Name="city" --> <!-- TMPL_VAR NAME="zip" --></li>
<!-- TMPL_IF NAME="email" --><li><!-- TMPL_VAR NAME="email" --></li> <!-- /TMPL_IF -->
</ul>
<br />
<h3>RESERVED ITEM</h2>
<h4><!-- TMPL_VAR Name="title" --></h4>
<h5><!-- TMPL_VAR NAME="author" --> </h5>
<p><!-- TMPL_VAR Name="barcode" --></p>
<!-- /TMPL_LOOP -->
</div>
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->

13
koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl

@ -1,5 +1,10 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<title>Koha &rsaquo; Circulation &rsaquo; Check In <!-- TMPL_VAR Name="title" --></title>
<script>
function Dopop(link) {
var newin=window.open(link,'popup','width=600,height=400,resizable=yes,toolbar=false,top');
}
</script>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
</head>
<body>
@ -36,6 +41,8 @@
<input type="hidden" name="WT-waitingAt" value="<!-- TMPL_VAR Name="TransferWaitingAt" -->" />
<input type="hidden" name="WT-From" value="<!-- TMPL_VAR Name="wtransfertFrom" -->" />
<input type="submit" class="approve" value="Confirm" />
<br />
<input type="button" value="Print Slip & Confirm" class="approve" onclick='Dopop("hold-transfer-slip.pl?transfer=1&amp;borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="itembiblionumber" -->&amp;op=slip") ; this.form.submit()'; />
</form>
<!-- /TMPL_IF --></div>
<!-- /TMPL_IF -->
@ -59,6 +66,8 @@
</p>
<form method="post" action="returns.pl">
<input type="submit" class="approve" value="Confirm" />
<br />
<input type="button" value="Print Slip & Confirm" class="approve" onclick='Dopop("hold-transfer-slip.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="itembiblionumber" -->&amp;op=slip") ; this.form.submit()'; />
<!-- TMPL_LOOP Name="inputloop" -->
<input type="hidden" name="ri-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="barcode" -->" />
<input type="hidden" name="dd-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="duedate" -->" />
@ -92,6 +101,8 @@
<form method="post" action="returns.pl">
<input type="submit" class="approve" value="Confirm" />
<br />
<input type="button" value="Print Slip & Confirm" class="submit" onclick='Dopop("hold-transfer-slip.pl?transfer=1&amp;borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="itembiblionumber" -->&amp;op=slip") ; this.form.submit()'; />
<!-- TMPL_LOOP Name="inputloop" -->
<input type="hidden" name="ri-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="barcode" -->" />
<input type="hidden" name="dd-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="duedate" -->" />
@ -176,6 +187,8 @@
<form method="post" action="returns.pl">
<!-- TMPL_IF name="transfertodo" -->
<input type="submit" class="approve" value="Confirm hold and transfer" />
<br />
<input type="button" value="Print Slip & Confirm" class="submit" onclick='Dopop("hold-transfer-slip.pl?transfer=1&amp;borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;biblionumber=<!-- TMPL_VAR NAME="itembiblionumber" -->&amp;op=slip") ; this.form.submit()'; />
<!-- TMPL_ELSE -->
<input type="submit" class="approve" value="Confirm hold" />
<!-- /TMPL_IF -->

Loading…
Cancel
Save