$dbh->prepare(
"select issuelength from issuingrules where categorycode=? and itemtype=? and branchcode=? and issuelength is not null"
);
-
+warn "in get loan lenght $borrowertype $itemtype $branchcode ";
# try to find issuelength & return the 1st available.
# check with borrowertype, itemtype and branchcode, then without one of those parameters
$sth->execute( $borrowertype, $itemtype, $branchcode );
#we check, if we don't have reserv or transfert for this document, if not, return it to homebranch .
if ( ($iteminformation->{'holdingbranch'} ne $iteminformation->{'homebranch'}) and not $messages->{'WrongTransfer'} and ($validTransfert ne 1) and ($reserveDone ne 1) ){
- if (C4::Context->preference("AutomaticItemReturn") == 1) {
- ModItemTransfer($iteminformation->{'itemnumber'}, C4::Context->userenv->{'branch'}, $iteminformation->{'homebranch'});
- $messages->{'WasTransfered'} = 1;
- warn "was transfered";
- }
+ if (C4::Context->preference("AutomaticItemReturn") == 1) {
+ ModItemTransfer($iteminformation->{'itemnumber'}, C4::Context->userenv->{'branch'}, $iteminformation->{'homebranch'});
+ $messages->{'WasTransfered'} = 1;
+ }
+ else {
+ $messages->{'NeedsTransfer'} = 1;
+ }
}
}
return ( $doreturn, $messages, $iteminformation, $borrower );
# Deal with the requests....
if ($query->param('WT-itemNumber')){
-updateWrongTransfer ($query->param('WT-itemNumber'),$query->param('WT-waitingAt'),$query->param('WT-From'));
+ updateWrongTransfer ($query->param('WT-itemNumber'),$query->param('WT-waitingAt'),$query->param('WT-From'));
}
if ( $query->param('resbarcode') ) {
my $issueinformation;
my $barcode = $query->param('barcode');
+my $dotransfer = $query->param('dotransfer');
+if ($dotransfer){
+ # An item has been returned to a branch other than the homebranch, and the librarian has choosen to initiate a transfer
+ my $transferitem=$query->param('transferitem');
+ my $tobranch=$query->param('tobranch');
+ ModItemTransfer($transferitem, C4::Context->userenv->{'branch'}, $tobranch);
+}
+
# actually return book and prepare item table.....
if ($barcode) {
# decode cuecat
found => 1,
transfer => 1,
);
+}
+if ( $messages->{'NeedsTransfer'} ){
+ $template->param(
+ found => 1,
+ needstransfer => 1,
+ itemnumber => $issueinformation->{'itemnumber'}
+ );
}
# adding a case of wrong transfert, if the document wasn't transfered in the good library (according to branchtransfer (tobranch) BDD)
elsif ( $code eq 'WrongTransferItem' ) {
; # FIXME... anything to do here?
}
+ elsif ( $code eq 'NeedsTransfer' ) {
+ }
+
else {
die "Unknown error code $code"; # XXX
}
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('authoritysep','--','Used to separate a list of authorities in a display. Usually --','10','free');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('autoBarcode','OFF','Used to autogenerate a barcode: incremental will be of the form 1, 2, 3; annual of the form 2007-0001, 2007-0002','incremental|annual|OFF','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutoLocation','0','If ON, IP authentication is enabled, blocking access to the staff client from unauthorized IP addresses',NULL,'YesNo');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutomaticItemReturn','1','If ON, items attempt to return to their home branch when checked in',NULL,'YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutomaticItemReturn','1','If ON, Koha will automatically set up a transfer of this item to its homebranch',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('autoMemberNum','1','If ON, patron number is auto-calculated','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BiblioDefaultView','normal','Choose the default detail view in the catalog; choose between normal, marc or isbd','normal|marc|isbd','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerMandatoryField','zipcode|surname','Choose the mandatory fields for a patron\'s account',NULL,'free');
<!-- case of a return of item, but with no reservation after, if the item must be returned to its homebranch -->
<!-- TMPL_IF Name="transfer" -->
<!-- transfer -->
- <h3 class="problem">Please return <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=<!-- TMPL_VAR NAME="itembiblionumber" -->"><!-- TMPL_VAR Name="title" --></a> to <!-- TMPL_VAR Name="homebranch" --></h3><!-- /TMPL_IF -->
+ <h3 class="problem">Please return <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=<!-- TMPL_VAR NAME="itembiblionumber" -->"><!-- TMPL_VAR Name="title" --></a> to <!-- TMPL_VAR Name="homebranch" --></h3>
+ <!-- /TMPL_IF -->
+ <!-- TMPL_IF Name="needstransfer" -->
+ <!-- transfer -->
+ <h3 class="problem"> This item needs to be transfered to <!-- TMPL_VAR Name="homebranch" --></h3>
+ <form method="post" action="returns.pl" name="mainform" id="mainform">
+ <input type="submit" value="Confirm and transfer" class="submit" />
+ <input type="hidden" name="dotransfer" value="yes">
+ <input type="hidden" name="tobranch" value="<!-- TMPL_VAR NAME="homebranch" -->">
+ <input type="hidden" name="transferitem" value="<!-- TMPL_VAR NAME="itemnumber" -->">
+ <!--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" -->" />
+ <input type="hidden" name="bn-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="bornum" -->" />
+ <!-- /TMPL_LOOP -->
+ <input type="hidden" name="barcode" value="0" />
+ </form>
+ <!-- /TMPL_IF -->
+
<!-- TMPL_IF Name="diffbranch" -->
<!-- diffbranch -->
<h3>Item Consigned:</h3>