if ( $hbr && $branches->{$hbr}->{'PE'} ) {
$messages->{'IsPermanent'} = $hbr;
}
-
+
+ # if independent branches are on and returning to different branch, refuse the return
+ if ($hbr ne C4::Context->userenv->{'branch'} && C4::Context->preference("IndependantBranches")){
+ $messages->{'Wrongbranch'} = 1;
+ $doreturn=0;
+ }
+
# check that the book has been cancelled
if ( $iteminformation->{'wthdrawn'} ) {
$messages->{'wthdrawn'} = 1;
);
}
+if ( $messages->{'Wrongbranch'} ){
+ $template->param(
+ wrongbranch => 1,
+ );
+}
+
# adding a case of wrong transfert, if the document wasn't transfered in the good library (according to branchtransfer (tobranch) BDD)
if ( $messages->{'WrongTransfer'} and not $messages->{'WasTransfered'}) {
}
elsif ( $code eq 'NeedsTransfer' ) {
}
+ elsif ( $code eq 'Wrongbranch' ) {
+ }
else {
die "Unknown error code $code"; # XXX
<div id="yui-main">
<div class="yui-g">
+<!-- TMPL_IF NAME="wrongbranch" -->
+<div class="message"><h3 class="problem">Independent Branches is on, and you
+are trying to return this item to a branch other than its homebranch, NOT RETURNED
+</h3></div>
+<!-- /TMPL_IF -->
<!-- case of a mistake in transfer loop -->
<!-- TMPL_IF Name="WrongTransfer" --><div class="message"><!-- WrongTransfer --><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="TransferWaitingAt" --></h3>
<!-- TMPL_IF Name="wborcnum"--><h5>Hold for:</h5>