[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha C4/Circulation/Circ2.pm C4/Reserves2.pm ci... [rel_3_0]
From: |
LAURIN arnaud |
Subject: |
[Koha-cvs] koha C4/Circulation/Circ2.pm C4/Reserves2.pm ci... [rel_3_0] |
Date: |
Thu, 25 Jan 2007 18:06:52 +0000 |
CVSROOT: /sources/koha
Module name: koha
Branch: rel_3_0
Changes by: LAURIN arnaud <alaurin> 07/01/25 18:06:52
Modified files:
C4/Circulation : Circ2.pm
C4 : Reserves2.pm
circ : returns.pl branchoverdues.pl
koha-tmpl/intranet-tmpl/prog/en/circ: returns.tmpl
Log message:
improvement for returns .pl :
- removing global vars for branch value .
- adding security for transfers
- bug fixing ...
still work on it
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Circulation/Circ2.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.114.2.34&r2=1.114.2.35
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Reserves2.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.46.2.14&r2=1.46.2.15
http://cvs.savannah.gnu.org/viewcvs/koha/circ/returns.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.43.2.12&r2=1.43.2.13
http://cvs.savannah.gnu.org/viewcvs/koha/circ/branchoverdues.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.6&r2=1.1.2.7
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.4.2.10&r2=1.4.2.11
Patches:
Index: C4/Circulation/Circ2.pm
===================================================================
RCS file: /sources/koha/koha/C4/Circulation/Circ2.pm,v
retrieving revision 1.114.2.34
retrieving revision 1.114.2.35
diff -u -b -r1.114.2.34 -r1.114.2.35
--- C4/Circulation/Circ2.pm 22 Jan 2007 18:00:38 -0000 1.114.2.34
+++ C4/Circulation/Circ2.pm 25 Jan 2007 18:06:52 -0000 1.114.2.35
@@ -17,7 +17,7 @@
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
-# $Id: Circ2.pm,v 1.114.2.34 2007/01/22 18:00:38 alaurin Exp $
+# $Id: Circ2.pm,v 1.114.2.35 2007/01/25 18:06:52 alaurin Exp $
use strict;
require Exporter;
@@ -41,7 +41,7 @@
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
# set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.114.2.34 $' =~ /\d+/g;
shift(@v).".".join( "_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = do { my @v = '$Revision: 1.114.2.35 $' =~ /\d+/g;
shift(@v).".".join( "_", map { sprintf "%03d", $_ } @v ); };
=head1 NAME
@@ -584,11 +584,17 @@
# separate function?
sub dotransfer {
my ( $itm, $fbr, $tbr ) = @_;
+
my $dbh = C4::Context->dbh;
$itm = $dbh->quote($itm);
$fbr = $dbh->quote($fbr);
$tbr = $dbh->quote($tbr);
+ warn "entree dans dotransfer";
+ warn "item dt->".$itm;
+ warn "from fbr->".$fbr;
+ warn "item tbr->".$tbr;
+
#new entry in branchtransfers....
$dbh->do(
"INSERT INTO branchtransfers (itemnumber, frombranch, datesent, tobranch)
@@ -1538,7 +1544,7 @@
# check that the book has been cancelled
if ( $iteminformation->{'wthdrawn'} ) {
- $messages->{'wthdrawn'} = 1;
+ $messages->{'wthdrawn'} = 1;itemnumber
$doreturn = 0;
}
@@ -1546,6 +1552,9 @@
# update issues, thereby returning book (should push this out into another
subroutine
my ($borrower) = getpatroninformation( \%env, $currentborrower, 0 );
+
+# case of a return of document (deal with issues and holdingbranch)
+
if ($doreturn) {
my $sth =
$dbh->prepare(
@@ -1553,36 +1562,22 @@
);
$sth->execute( $borrower->{'borrowernumber'},
$iteminformation->{'itemnumber'} );
+ $messages->{'WasReturned'} = 1; # FIXME is the "= 1" right?
+ }
-# FIXME the holdingbranch is updated if the document is returned in an
other location .
- if ( $iteminformation->{'holdingbranch'} ne
+# continue to deal with returns cases, but not only if we have an issue
+
+# the holdingbranch is updated if the document is returned in an other
location .
+if ( $iteminformation->{'holdingbranch'} ne
C4::Context->userenv->{'branch'} )
{
- my $sth_upd_location =
- $dbh->prepare(
- "UPDATE items SET holdingbranch=? WHERE itemnumber=?");
- $sth_upd_location->execute(
- C4::Context->userenv->{'branch'},
- $iteminformation->{'itemnumber'}
- );
- $sth_upd_location->finish;
- $iteminformation->{'holdingbranch'} =
- C4::Context->userenv->{'branch'};
+
UpdateHoldingbranch(C4::Context->userenv->{'branch'},$iteminformation->{'itemnumber'});
+ warn "changement holdingbranch
->".C4::Context->userenv->{'branch'};
}
- $messages->{'WasReturned'} = 1; # FIXME is the "= 1" right?
- }
itemseen( $iteminformation->{'itemnumber'} );
($borrower) = getpatroninformation( \%env, $currentborrower, 0 );
- # transfer book to the current branch
-
- # FIXME function transfered still always used ????
- # my ($transfered, $mess, $item) = transferbook($branch, $barcode, 1);
- # if ($transfered) {
- # $messages->{'WasTransfered'} = 1; # FIXME is the "= 1" right?
- # }
-
# fix up the accounts.....
if ( $iteminformation->{'itemlost'} ) {
fixaccountforlostandreturned( $iteminformation, $borrower );
@@ -1607,6 +1602,7 @@
}
else {
$messages->{'WrongTransfer'} = $tobranch;
+ $messages->{'WrongTransferItem'} = $iteminformation->{'itemnumber'};
}
}
@@ -3131,7 +3127,7 @@
=cut
sub updateWrongTransfer {
- my ( $itemNumber,$borrowernumber,$waitingAtLibrary,$FromLibrary ) = @_;
+ my ( $itemNumber,$waitingAtLibrary,$FromLibrary ) = @_;
my $dbh = C4::Context->dbh;
# first step validate the actual line of transfert .
my $sth =
@@ -3140,9 +3136,32 @@
);
$sth->execute($FromLibrary,$itemNumber);
$sth->finish;
+
# second step create a new line of branchtransfer to the right location .
dotransfer($itemNumber, $FromLibrary, $waitingAtLibrary);
+#third step changing holdingbranch of item
+ UpdateHoldingbranch($FromLibrary,$itemNumber);
+}
+
+=head2 UpdateHoldingbranch
+
+$items = UpdateHoldingbranch($branch,$itmenumber);
+Simple methode for updating hodlingbranch in items BDD line
+=cut
+
+sub UpdateHoldingbranch {
+ my ( $branch,$itmenumber ) = @_;
+ my $dbh = C4::Context->dbh;
+# first step validate the actual line of transfert .
+ my $sth =
+ $dbh->prepare(
+ "update items set holdingbranch = ? where itemnumber= ?"
+ );
+ $sth->execute($branch,$itmenumber);
+ $sth->finish;
+
+
}
1;
Index: C4/Reserves2.pm
===================================================================
RCS file: /sources/koha/koha/C4/Reserves2.pm,v
retrieving revision 1.46.2.14
retrieving revision 1.46.2.15
diff -u -b -r1.46.2.14 -r1.46.2.15
--- C4/Reserves2.pm 24 Jan 2007 11:16:42 -0000 1.46.2.14
+++ C4/Reserves2.pm 25 Jan 2007 18:06:52 -0000 1.46.2.15
@@ -20,7 +20,7 @@
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
-# $Id: Reserves2.pm,v 1.46.2.14 2007/01/24 11:16:42 alaurin Exp $
+# $Id: Reserves2.pm,v 1.46.2.15 2007/01/25 18:06:52 alaurin Exp $
use strict;
require Exporter;
@@ -33,7 +33,7 @@
my $library_name = C4::Context->preference("LibraryName");
# set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.46.2.14 $' =~ /\d+/g; shift(@v) . "." .
join( "_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = do { my @v = '$Revision: 1.46.2.15 $' =~ /\d+/g; shift(@v) . "." .
join( "_", map { sprintf "%03d", $_ } @v ); };
=head1 NAME
@@ -95,7 +95,7 @@
my ( $itemnumber, $borrowernumber ) = @_;
#step 1 : cancel the reservation
- my $CancelReserve = CancelReserve( 0, $itemnumber, $borrowernumber );
+ my $CancelReserve = CancelReserve( undef, $itemnumber, $borrowernumber );
#step 2 launch the subroutine of the others reserves
( $messages, $nextreservinfo ) = OtherReserves($itemnumber);
@@ -179,7 +179,7 @@
my $sth_upd = $dbh->prepare($query);
$sth_upd->execute( $itemnumber, $borrowernumber, $biblionumber );
$sth_upd->finish;
-
+warn "entree en mode minuspriority";
# second step update all others reservs
$query = qq/
SELECT priority,borrowernumber,biblionumber,reservedate
@@ -611,8 +611,6 @@
sub CancelReserve {
my ( $biblio, $item, $borr ) = @_;
my $dbh = C4::Context->dbh;
-
-
if ( ( $item and $borr ) and ( not $biblio ) ) {
# removing a waiting reserve record....
# update the database...
@@ -637,6 +635,7 @@
WHERE biblionumber = ?
AND borrowernumber = ?
AND cancellationdate IS NULL
+ AND itemnumber IS NULL
AND (found <> 'F' OR found IS NULL)
/;
my $sth = $dbh->prepare($query);
@@ -682,7 +681,7 @@
sub FillReserve {
my ($res) = @_;
my $dbh = C4::Context->dbh;
-
+warn "entree en mode fill reserve";
# fill in a reserve record....
my $qbiblio = $res->{'biblionumber'};
my $borr = $res->{'borrowernumber'};
@@ -737,8 +736,9 @@
sub FixPriority {
my ( $biblio, $borrowernumber, $rank ) = @_;
my $dbh = C4::Context->dbh;
-
+warn "mode fixpriority : rang retour : ".$rank;
if ( $rank eq "del" ) {
+ warn "mode suppresion ok";
CancelReserve( $biblio, undef, $borrowernumber );
}
if ( $rank eq "W" || $rank eq "0" ) {
@@ -759,11 +759,14 @@
my @reservedates;
# get whats left
+# FIXME adding a new security in returned elements for changing priority,
+# now, we don't care anymore any reservations with itemnumber linked (suppose
a waiting reserve)
my $query = qq/
SELECT borrowernumber, reservedate, constrainttype
FROM reserves
WHERE biblionumber = ?
AND cancellationdate IS NULL
+ AND itemnumber IS NULL
AND ((found <> 'F' and found <> 'W') or found is NULL)
ORDER BY priority ASC
/;
@@ -822,7 +825,8 @@
=cut
sub ReserveWaiting {
- my ( $item, $borr ) = @_;
+warn "entree dans reserves waiting";
+ my ( $item, $borr,$diffBranchSend ) = @_;
my $dbh = C4::Context->dbh;
# get priority and biblionumber....
@@ -846,6 +850,19 @@
my $timestamp = $data->{'timestamp'};
# update reserves record....
+ if ($diffBranchSend) {
+ warn "diffbranchsend";
+ $query = qq/
+ UPDATE reserves
+ SET priority = 0,
+ itemnumber = ?
+ WHERE borrowernumber = ?
+ AND biblionumber = ?
+ AND timestamp = ?
+ /;
+ }
+ else {
+ warn"statut waiting pour la reservation";
$query = qq/
UPDATE reserves
SET priority = 0,
@@ -856,6 +873,7 @@
AND biblionumber = ?
AND timestamp = ?
/;
+ }
$sth = $dbh->prepare($query);
$sth->execute( $item, $borr, $biblio, $timestamp );
$sth->finish;
@@ -1244,6 +1262,7 @@
my $sth = $dbh->prepare($query);
$sth->execute( $biblio, $borrower );
$sth->finish;
+
}
else {
my $query = qq/
Index: circ/returns.pl
===================================================================
RCS file: /sources/koha/koha/circ/returns.pl,v
retrieving revision 1.43.2.12
retrieving revision 1.43.2.13
diff -u -b -r1.43.2.12 -r1.43.2.13
--- circ/returns.pl 22 Jan 2007 18:00:39 -0000 1.43.2.12
+++ circ/returns.pl 25 Jan 2007 18:06:52 -0000 1.43.2.13
@@ -58,14 +58,14 @@
my $branches = GetBranches();
my $printers = GetPrinters( \%env );
-my $branch = C4::Context->userenv?C4::Context->userenv->{'branch'}:"";
+#my $branch = C4::Context->userenv?C4::Context->userenv->{'branch'}:"";
my $printer = C4::Context->userenv?C4::Context->userenv->{'branchprinter'}:"";
#
# Some code to handle the error if there is no branch or printer setting.....
#
-$env{'branchcode'} = $branch;
+#$env{'branchcode'} = $branch;
$env{'printer'} = $printer;
$env{'queue'} = $printer;
@@ -105,10 +105,8 @@
############
# Deal with the requests....
-# dela with the request of case : "Wrong Transfert" (WT-...)
if ($query->param('WT-itemNumber')){
-updateWrongTransfer
($query->param('WT-itemNumber'),$query->param('WT-borrnum'),$query->param('WT-waitingAt'),$query->param('WT-From'));
-
+updateWrongTransfer
($query->param('WT-itemNumber'),$query->param('WT-waitingAt'),$query->param('WT-From'));
}
@@ -117,19 +115,27 @@
my $item = $query->param('itemnumber');
my $borrowernumber = $query->param('borrowernumber');
my $resbarcode = $query->param('resbarcode');
-
+ my $diffBranchReturned = $query->param('diffBranch');
# set to waiting....
my $iteminfo = getiteminformation($item);
- my $tobranchcd = ReserveWaiting( $item, $borrowernumber );
+ my $diffBranchSend;
+ warn "diffbranch retour ->".$diffBranchReturned;
+
+# addin in ReserveWaiting the possibility to check if the document is
expected in this library or not,
+# if not we send a value in reserve waiting for not implementting waiting
status
+ if ($diffBranchReturned) {
+ warn "entrer en mod retour diffbranch";
+ $diffBranchSend = $diffBranchReturned;
+ }
+ else {
+ warn "pas de diffbranch";
+ $diffBranchSend = undef;
+ }
-# if($iteminfo->{'holdingbranch'} ne $branch){
-# UpdateHoldingbranch($branch,$item);
-# }
+ my $tobranchcd = ReserveWaiting( $item, $borrowernumber,$diffBranchSend);
# check if we have other reservs for this document, if we have a return send
the message of transfer
my ( $messages, $nextreservinfo ) = OtherReserves($item);
-# my $branchname = $branches->{$tobranchcd}->{'branchname'}; - not sure if
this line + $tobranchcd line do the same thing
-# as the $messages{'transfert'} code
my $branchname = GetBranchName( $messages->{'transfert'} );
my ($borr) = getpatroninformation( \%env, $nextreservinfo, 0 );
@@ -138,11 +144,8 @@
$borr->{'surname'} . ", " . $borr->{'title'} . " " .
$borr->{'firstname'};
my $slip = $query->param('resslip');
- #printreserve( $branchname, $borr, $iteminfo );
- # if ( $tobranchcd ne $branch ) { - not sure if line below is doing the
same
+
if ( $messages->{'transfert'} ) {
-# add the transfer routine
-#
C4::Circulation::Circ2::dotransfer($item,$iteminfo->{'holdingbranch'},$tobranchcd);
$template->param(
itemtitle => $iteminfo->{'title'},
iteminfo => $iteminfo->{'author'},
@@ -169,7 +172,7 @@
# decode cuecat
$barcode = cuecatbarcodedecode($barcode);
( $returned, $messages, $iteminformation, $borrower ) =
- returnbook( $barcode, $branch );
+ returnbook( $barcode, C4::Context->userenv->{'branch'} );
if ($returned) {
$returneditems{0} = $barcode;
$riborrowernumber{0} = $borrower->{'borrowernumber'};
@@ -184,7 +187,7 @@
# check if the branch is the same as homebranch
# if not, we want to put a message
- if ( $iteminformation->{'homebranch'} ne $branch ) {
+ if ( $iteminformation->{'homebranch'} ne
C4::Context->userenv->{'branch'} ) {
$template->param( homebranch => $iteminformation->{'homebranch'} );
}
}
@@ -228,20 +231,8 @@
if ( $messages->{'WasTransfered'} ) {
-# my $res = $messages->{'ResFound'};
-# my $branchname = $branches->{ $res->{'branchcode'} }->{'branchname'};
-# my ($borr) = getpatroninformation( \%env, $res->{'borrowernumber'}, 0 );
-# my $name =
-# $borr->{'surname'} . " " . $borr->{'title'} . " " .
$borr->{'firstname'};
my ($iteminfo) = getiteminformation( 0, $barcode );
- # if ( $res->{'ResFound'} eq "Waiting" ) {
- # if($branch eq $res->{'branchcode'}){
- # $template->param(intransit => 0);
- # } else {
- # $template->param(intransit => 1);
- # }
-
$template->param(
found => 1,
transfer => 1,
@@ -254,10 +245,10 @@
# adding a case of wrong transfert, if the document wasn't transfered in the
good library (according to branchtransfer (tobranch) BDD)
if ( $messages->{'WrongTransfer'} ) {
- warn "faux transferts retourné ";
$template->param(
WrongTransfer => 1,
TransferWaitingAt => $messages->{'WrongTransfer'},
+ WrongTransferItem => $messages->{'WrongTransferItem'},
);
my $res = $messages->{'ResFound'};
@@ -268,28 +259,28 @@
my ($iteminfo) = getiteminformation( 0, $barcode );
$template->param(
- name => $name,
- borfirstname => $borr->{'firstname'},
- borsurname => $borr->{'surname'},
- bortitle => $borr->{'title'},
- borphone => $borr->{'phone'},
- boremail => $borr->{'emailaddress'},
- borstraddress => $borr->{'streetaddress'},
- borcity => $borr->{'city'},
- borzip => $borr->{'zipcode'},
- borrowernumber => $res->{'borrowernumber'},
- borcnum => $borr->{'cardnumber'},
- itemnumber => $res->{'itemnumber'},
- itemtitle => $iteminfo->{'title'},
- itemauthor => $iteminfo->{'author'},
- itembarcode => $iteminfo->{'barcode'},
- itemtype => $iteminfo->{'itemtype'},
- ccode => $iteminfo->{'ccode'},
- itembiblionumber => $iteminfo->{'biblionumber'},
- transfertFrom => $branch,
+ wname => $name,
+ wborfirstname => $borr->{'firstname'},
+ wborsurname => $borr->{'surname'},
+ wbortitle => $borr->{'title'},
+ wborphone => $borr->{'phone'},
+ wboremail => $borr->{'emailaddress'},
+ wborstraddress => $borr->{'streetaddress'},
+ wborcity => $borr->{'city'},
+ wborzip => $borr->{'zipcode'},
+ wborrowernumber => $res->{'borrowernumber'},
+ wborcnum => $borr->{'cardnumber'},
+ witemtitle => $iteminfo->{'title'},
+ witemauthor => $iteminfo->{'author'},
+ witembarcode => $iteminfo->{'barcode'},
+ witemtype => $iteminfo->{'itemtype'},
+ wccode => $iteminfo->{'ccode'},
+ witembiblionumber => $iteminfo->{'biblionumber'},
+ wtransfertFrom => C4::Context->userenv->{'branch'},
);
}
+
if ( $messages->{'ResFound'} and not $messages->{'WrongTransfer'}) {
my $res = $messages->{'ResFound'};
my $branchname = $branches->{ $res->{'branchcode'} }->{'branchname'};
@@ -299,11 +290,11 @@
my ($iteminfo) = getiteminformation( 0, $barcode );
if ( $res->{'ResFound'} eq "Waiting" ) {
- if ( $branch eq $res->{'branchcode'} ) {
- $template->param( intransit => 0 );
+ if ( C4::Context->userenv->{'branch'} eq $res->{'branchcode'} ) {
+ $template->param( waiting => 1 );
}
else {
- $template->param( intransit => 1 );
+ $template->param( waiting => 0 );
}
$template->param(
@@ -321,7 +312,7 @@
borcnum => $borr->{'cardnumber'},
debarred => $borr->{'debarred'},
gonenoaddress => $borr->{'gonenoaddress'},
- currentbranch => $branches->{$branch}->{'branchname'},
+ currentbranch =>
$branches->{C4::Context->userenv->{'branch'}}->{'branchname'},
itemnumber => $res->{'itemnumber'},
itemtitle => $iteminfo->{'title'},
itemauthor => $iteminfo->{'author'},
@@ -339,7 +330,7 @@
. sprintf( "%0.2d", ( $da[4] + 1 ) ) . "/"
. ( $da[5] + 1900 );
- if ( $branch eq $res->{'branchcode'} ) {
+ if ( C4::Context->userenv->{'branch'} eq $res->{'branchcode'} ) {
$template->param( intransit => 0 );
}
else {
@@ -349,11 +340,12 @@
warn "RES FOR : " . $res->{'branchcode'};
$template->param(
found => 1,
- currentbranch => $branches->{$branch}->{'branchname'},
+ currentbranch =>
$branches->{C4::Context->userenv->{'branch'}}->{'branchname'},
name => $name,
destbranchname =>
$branches->{ $res->{'branchcode'} }->{'branchname'},
- transfertodo => ( $branch eq $res->{'branchcode'} ? 0 : 1 ),
+ destbranch => $res->{'branchcode'},
+ transfertodo => ( C4::Context->userenv->{'branch'} eq
$res->{'branchcode'} ? 0 : 1 ),
reserved => 1,
today => $todaysdate,
itemnumber => $res->{'itemnumber'},
@@ -413,7 +405,7 @@
$exit_required_p = 1;
}
elsif ( ( $code eq 'IsPermanent' ) && ( not $messages->{'ResFound'} ) ) {
- if ( $messages->{'IsPermanent'} ne $branch ) {
+ if ( $messages->{'IsPermanent'} ne C4::Context->userenv->{'branch'} ) {
$err{ispermanent} = 1;
$err{msg} =
$branches->{ $messages->{'IsPermanent'} }->{'branchname'};
@@ -422,6 +414,9 @@
elsif ( $code eq 'WrongTransfer' ) {
; # FIXME... anything to do here?
}
+ elsif ( $code eq 'WrongTransferItem' ) {
+ ; # FIXME... anything to do here?
+ }
else {
die "Unknown error code $code"; # XXX
}
@@ -556,9 +551,9 @@
$template->param( riloop => address@hidden );
$template->param(
- genbrname => $branches->{$branch}->{'branchname'},
+ genbrname =>
$branches->{C4::Context->userenv->{'branch'}}->{'branchname'},
genprname => $printers->{$printer}->{'printername'},
- branchname => $branches->{$branch}->{'branchname'},
+ branchname =>
$branches->{C4::Context->userenv->{'branch'}}->{'branchname'},
printer => $printer,
errmsgloop => address@hidden,
intranetcolorstylesheet =>
Index: circ/branchoverdues.pl
===================================================================
RCS file: /sources/koha/koha/circ/Attic/branchoverdues.pl,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -b -r1.1.2.6 -r1.1.2.7
--- circ/branchoverdues.pl 18 Dec 2006 10:59:54 -0000 1.1.2.6
+++ circ/branchoverdues.pl 25 Jan 2007 18:06:52 -0000 1.1.2.7
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Id: branchoverdues.pl,v 1.1.2.6 2006/12/18 10:59:54 toins Exp $
+# $Id: branchoverdues.pl,v 1.1.2.7 2007/01/25 18:06:52 alaurin Exp $
#
# This file is part of Koha.
#
@@ -55,8 +55,6 @@
=cut
my $input = new CGI;
-my $departement = $input->param('departement');
-
my $theme = $input->param('theme'); # only used if allowthemeoverride is set
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
@@ -82,6 +80,7 @@
my $method = $input->param('method');
my $overduelevel = $input->param('overduelevel');
my $notifyId = $input->param('notifyId');
+my $departement = $input->param('departement');
# now create the line in bdd (notifys)
if ( $input->param('action') eq 'add' ) {
Index: koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl,v
retrieving revision 1.4.2.10
retrieving revision 1.4.2.11
diff -u -b -r1.4.2.10 -r1.4.2.11
--- koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl 22 Jan 2007 18:00:39
-0000 1.4.2.10
+++ koha-tmpl/intranet-tmpl/prog/en/circ/returns.tmpl 25 Jan 2007 18:06:52
-0000 1.4.2.11
@@ -4,24 +4,31 @@
<!-- TMPL_INCLUDE NAME="menus.inc" -->
<!-- TMPL_INCLUDE NAME="menu-circ.inc" -->
-<!-- TMPL_IF Name="WrongTransfer" -->
+<!-- case of a mistake in transfert loop -->
+
+ <!-- TMPL_IF Name="WrongTransfer" -->
<h3 class="problem">This item was not transfered initialy to
this library !</h3>
<table>
<tr>
<th>Title : </th>
<td>
- <a
href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=<!-- TMPL_VAR
NAME="itembiblionumber" -->"><!-- TMPL_VAR Name="itemtitle" --></a>
+ <a
href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=<!-- TMPL_VAR
NAME="itembiblionumber" -->"><!-- TMPL_VAR Name="witemtitle" --></a>
</td>
+ </tr>
<tr><th>Reserved for: </th>
<td>
+ <!-- TMPL_IF Name="wborcnum"-->
<ul>
- <li><a
href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR
NAME="borrowernumber" -->"><!-- TMPL_VAR Name="borcnum" --></a></li>
- <li><!-- TMPL_VAR Name="borsurname" -->, <!-- TMPL_VAR
Name="borfirstname" --> </li>
- <li><!-- TMPL_VAR Name="borstraddress" --><br />
- <!-- TMPL_VAR Name="borcity" --> <!-- TMPL_VAR NAME="borzip"
--></li>
- <li><!-- TMPL_VAR Name="borphone" --></li>
+ <li><a
href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR
NAME="borrowernumber" -->"><!-- TMPL_VAR Name="wborcnum" --></a></li>
+ <li><!-- TMPL_VAR Name="wborsurname" -->, <!-- TMPL_VAR
Name="wborfirstname" --> </li>
+ <li><!-- TMPL_VAR Name="wborstraddress" --><br />
+ <!-- TMPL_VAR Name="wborcity" --> <!-- TMPL_VAR NAME="wborzip"
--></li>
+ <li><!-- TMPL_VAR Name="wborphone" --></li>
</ul>
+ <!-- TMPL_ELSE-->
+ No reservation linked
+ <!-- /TMPL_IF -->
</td>
</tr>
<tr><th>Action : </th>
@@ -31,18 +38,19 @@
</tr>
</table>
<form method="post" action="returns.pl" name="mainform" id="mainform">
- <input type="hidden" name="WT-itemNumber" value="<!-- TMPL_VAR
Name="itemnumber" -->" />
- <input type="hidden" name="WT-borrnum" value="<!-- TMPL_VAR
Name="borrowernumber" -->" />
+ <input type="hidden" name="WT-itemNumber" value="<!-- TMPL_VAR
Name="WrongTransferItem" -->" />
<input type="hidden" name="WT-waitingAt" value="<!-- TMPL_VAR
Name="TransferWaitingAt" -->" />
- <input type="hidden" name="WT-From" value="<!-- TMPL_VAR
Name="transfertFrom" -->" />
+ <input type="hidden" name="WT-From" value="<!-- TMPL_VAR
Name="wtransfertFrom" -->" />
<input type="submit" value="Send this document" />
</form>
<!-- /TMPL_IF -->
<!-- TMPL_IF Name="found" -->
- <h3>Reserve Found<!-- TMPL_IF Name="waiting" --> (item is already
consigned) <!-- /TMPL_IF --></h3>
+<!-- case of a reservation found, and display info -->
+
<!-- TMPL_IF Name="waiting" -->
+ <h3>Waiting Reserve Found in your library</h3>
<table>
<caption><a
href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=<!-- TMPL_VAR
NAME="itembiblionumber" -->"><!-- TMPL_VAR Name="itemtitle" --></a></caption>
<tr><th>Patron: </th><td>
@@ -61,10 +69,10 @@
<!-- /TMPL_LOOP -->
<input type="hidden" name="barcode" value="0" />
</form>
- <!-- /TMPL_IF -->
+<!-- /TMPL_IF -->
<!-- TMPL_IF Name="diffbranch" -->
-
+ <h3>Reserve With necesary transfert Found</h3>
<table>
<caption><a
href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=<!-- TMPL_VAR
NAME="itembiblionumber" -->"><!-- TMPL_VAR Name="itemtitle" --></a></caption>
<tr><th>Patron: </th><td>
@@ -84,10 +92,12 @@
<input type="hidden" name="dd-<!-- TMPL_VAR Name="counter"
-->" value="<!-- TMPL_VAR Name="duedate" -->" />
<input type="hidden" name="bn-<!-- TMPL_VAR Name="counter"
-->" value="<!-- TMPL_VAR Name="borrowernumber" -->" />
<!-- /TMPL_LOOP -->
+ <input type="hidden" name="diffBranch" value="<!-- TMPL_VAR
Name="destbranch" -->" />
<input type="hidden" name="barcode" value="0" />
</form>
<!-- /TMPL_IF -->
+<!-- case of a return of item, but with no reservation after, if the document
must return to his homebranch -->
<!-- TMPL_IF Name="transfer" -->
<h2>This item must return to his homebranch :</h2>
<p><span class="problem">The document <!-- TMPL_VAR
NAME="itemtitle" --> (<!-- TMPL_VAR NAME="itemauthor" -->) Must be returned to
his homebranch(<b><!-- TMPL_VAR NAME="itemhomebranch" --></b>)</span></p>
@@ -102,6 +112,7 @@
</form>
<!-- /TMPL_IF -->
+
<!-- TMPL_IF Name="diffbranch" -->
<h3>Item Consigned:</h3>
@@ -119,11 +130,16 @@
<input type="hidden" name="barcode" value="0" />
</form>
-
-
<!-- /TMPL_IF -->
+<!-- case of simple return no issue or transfer but with a reservation -->
+
<!-- TMPL_IF Name="reserved" -->
+ <!-- TMPL_IF Name="transfertodo"-->
+ <h3>Reserve With necesary transfert Found</h3>
+ <!-- TMPL_ELSE -->
+ <h3>Waiting Reserve Found in your library</h3>
+ <!-- /TMPL_IF -->
<table>
<caption><a
href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=<!-- TMPL_VAR
NAME="itembiblionumber" -->"><!-- TMPL_VAR Name="itemtitle" --></a></caption>
@@ -149,7 +165,9 @@
<!-- /TMPL_LOOP -->
<input type="hidden" name="itemnumber" value="<!-- TMPL_VAR
Name="itemnumber" -->" />
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR
Name="borrowernumber" -->" />
- <input type="hidden" name="resbarcode" value="<!-- TMPL_VAR
Name="barcode" -->" /></form>
+ <input type="hidden" name="resbarcode" value="<!-- TMPL_VAR
Name="barcode" -->" />
+ <input type="hidden" name="diffBranch" value="<!-- TMPL_VAR
Name="destbranch" -->" />
+ </form>
<!-- /TMPL_IF -->
<!-- TMPL_ELSE -->