diff --git a/C4/Reserves.pm b/C4/Reserves.pm index f9f974704e..3d948a2c10 100755 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -4,6 +4,8 @@ package C4::Reserves; # Copyright 2000-2002 Katipo Communications +# 2006 SAN Ouest Provence +# 2007 BibLibre Paul POULAIN # # This file is part of Koha. # @@ -47,7 +49,33 @@ C4::Reserves - Koha functions for dealing with reservation. =head1 DESCRIPTION this modules provides somes functions to deal with reservations. - + + Reserves are stored in reserves table. + The following columns contains important values : + - priority >0 : then the reserve is at 1st stage, and not yet affected to any item. + =0 : then the reserve is being dealed + - found : NULL : means the patron requested the 1st available, and we haven't choosen the item + W(aiting) : the reserve has an itemnumber affected, and is on the way + F(inished) : the reserve has been completed, and is done + - itemnumber : empty : the reserve is still unaffected to an item + filled: the reserve is attached to an item + The complete workflow is : + ==== 1st use case ==== + patron request a document, 1st available : P >0, F=NULL, I=NULL + a library having it run "transfertodo", and clic on the list + if there is no transfer to do, the reserve waiting + patron can pick it up P =0, F=W, I=filled + if there is a transfer to do, write in branchtransfer P =0, F=NULL, I=filled + The pickup library recieve the book, it check in P =0, F=W, I=filled + The patron borrow the book P =0, F=F, I=filled + + ==== 2nd use case ==== + patron requests a document, a given item, + If pickup is holding branch P =0, F=W, I=filled + If transfer needed, write in branchtransfer P =0, F=NULL, I=filled + The pickup library recieve the book, it checks it in P =0, F=W, I=filled + The patron borrow the book P =0, F=F, I=filled + =head1 FUNCTIONS =over 2 @@ -856,7 +884,7 @@ The itemnumber parameter is used to find the biblionumber. with the biblionumber & the borrowernumber, we can affect the itemnumber to the correct reserve. -if $transferToDo is set, then the status is set to "Waiting" as well. +if $transferToDo is not set, then the status is set to "Waiting" as well. otherwise, a transfer is on the way, and the end of the transfer will take care of the waiting status =cut @@ -900,9 +928,6 @@ sub ModReserveAffect { $sth = $dbh->prepare($query); $sth->execute( $itemnumber, $borrowernumber,$biblionumber); $sth->finish; - - # now fix up the remaining priorities.... -# _FixPriority( $data->{'priority'}, $biblio ); # can't work, 1st parameter should be $biblionumbern NOT priority. FIXME : remove this line if no problem seen once it is commented. return; } diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index b651a17f58..4489b183b9 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -107,6 +107,7 @@ my %tabsysprefs; $tabsysprefs{ReservesMaxPickUpDelay}="Circulation"; $tabsysprefs{TransfersMaxDaysWarning}="Circulation"; $tabsysprefs{useDaysMode}="Circulation"; + $tabsysprefs{ReservesNeedReturns}="Circulation"; # Intranet $tabsysprefs{TemplateEncoding}="Intranet"; diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index 4952afa052..ac223905e5 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -97,11 +97,10 @@ my $strsth = biblio.title, biblio.author FROM reserves - LEFT JOIN items ON items.biblionumber=reserves.biblionumber, - borrowers,biblio + LEFT JOIN items ON items.biblionumber=reserves.biblionumber + LEFT JOIN borrowers ON reserves.borrowernumber=borrowers.borrowernumber + LEFT JOIN biblio ON reserves.biblionumber=biblio.biblionumber WHERE isnull(cancellationdate) - && reserves.borrowernumber=borrowers.borrowernumber - && reserves.biblionumber=biblio.biblionumber && reserves.found is NULL && items.holdingbranch=? "; diff --git a/circ/returns.pl b/circ/returns.pl index 1c8cfa4738..31ff40f3dc 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -1,6 +1,8 @@ #!/usr/bin/perl # Copyright 2000-2002 Katipo Communications +# 2006 SAN-OP +# 2007 BibLibre, Paul POULAIN # # This file is part of Koha. # @@ -21,8 +23,6 @@ script to execute returns of books -written 11/3/2002 by Finlay - =cut use strict; @@ -103,7 +103,6 @@ if ($query->param('WT-itemNumber')){ updateWrongTransfer ($query->param('WT-itemNumber'),$query->param('WT-waitingAt'),$query->param('WT-From')); } - if ( $query->param('resbarcode') ) { my $item = $query->param('itemnumber'); my $borrowernumber = $query->param('borrowernumber'); @@ -115,13 +114,12 @@ if ( $query->param('resbarcode') ) { # addin in ModReserveAffect 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) { - $diffBranchSend = $diffBranchReturned; - } - else { - $diffBranchSend = undef; - } - + if ($diffBranchReturned) { + $diffBranchSend = $diffBranchReturned; + } + else { + $diffBranchSend = undef; + } ModReserveAffect( $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 ) = GetOtherReserves($item); @@ -294,6 +292,7 @@ if ( $messages->{'ResFound'} and not $messages->{'WrongTransfer'}) { gonenoaddress => $borr->{'gonenoaddress'}, currentbranch => $branches->{C4::Context->userenv->{'branch'}}->{'branchname'}, itemnumber => $reserve->{'itemnumber'}, + barcode => $barcode, ); } @@ -319,6 +318,7 @@ if ( $messages->{'ResFound'} and not $messages->{'WrongTransfer'}) { destbranch => $reserve->{'branchcode'}, transfertodo => ( C4::Context->userenv->{'branch'} eq $reserve->{'branchcode'} ? 0 : 1 ), reserved => 1, + resbarcode => $barcode, today => $todaysdate, itemnumber => $reserve->{'itemnumber'}, borsurname => $borr->{'surname'}, diff --git a/installer/data/en/mandatory/sysprefs.sql b/installer/data/en/mandatory/sysprefs.sql index 20cf97407f..48f9b8a51e 100644 --- a/installer/data/en/mandatory/sysprefs.sql +++ b/installer/data/en/mandatory/sysprefs.sql @@ -97,3 +97,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('virtualshelves','1','Set virtual shelves management ON or OFF','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('z3950AuthorAuthFields','701,702,700','contains the MARC biblio tags of person authorities to fill biblio.author with w',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('z3950NormalizeAuthor','0','If set, Personal Name Authorities will replace authors in biblio.author','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReservesNeedReturns','0','If set, a reserve done on an item available in this branch need a check-in, otherwise, a reserve on a specific item, that is on the branch & available is considered as available','','YesNo'); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl index 7aa1f40ef8..43de66ed57 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl @@ -76,7 +76,10 @@ " value="" /> " value="" /> - + " /> + " /> + " /> + " /> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl index 5cb3f5f9ef..181ada7f97 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl @@ -287,7 +287,11 @@ if (alreadyreserved > "0"){