if ( $item->{'wthdrawn'} ) { # book has been cancelled
$messages->{'wthdrawn'} = 1;
- $doreturn = 0;
+ $doreturn = 0 if C4::Context->preference("BlockReturnOfWithdrawnItems");
}
# case of a return of document (deal with issues and holdingbranch)
# find reserves.....
# if we don't have a reserve with the status W, we launch the Checkreserves routine
- my ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->{'itemnumber'} );
+ my ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->{'itemnumber'} ) unless ( $item->{'wthdrawn'} );
if ($resfound) {
$resrec->{'ResFound'} = $resfound;
$messages->{'ResFound'} = $resrec;
$input{duedate} = 0;
$returneditems{0} = $barcode;
$riduedate{0} = 0;
- if ( $messages->{'wthdrawn'} ) {
- $input{withdrawn} = 1;
- $input{borrowernumber} = 'Item Cancelled'; # FIXME: should be in display layer ?
- $riborrowernumber{0} = 'Item Cancelled';
- }
- else {
- $input{borrowernumber} = ' '; # This seems clearly bogus.
- $riborrowernumber{0} = ' ';
- }
push( @inputloop, \%input );
}
}
}
elsif ( $code eq 'wthdrawn' ) {
$err{withdrawn} = 1;
- $exit_required_p = 1;
+ $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
}
elsif ( ( $code eq 'IsPermanent' ) && ( not $messages->{'ResFound'} ) ) {
if ( $messages->{'IsPermanent'} ne $userenv_branch ) {
dropboxdate => output_pref($dropboxdate),
overduecharges => $overduecharges,
soundon => C4::Context->preference("SoundOn"),
+ BlockReturnOfWithdrawnItems => C4::Context->preference("BlockReturnOfWithdrawnItems"),
);
### Comment out rotating collections for now to allow it a little more time to bake
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('AuthDisplayHierarchy','0','Display authority hierarchies','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,type) VALUES('OPACdidyoumean',NULL,'Did you mean? configuration for the OPAC. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free');
INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdidyoumean',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free');
+INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');
SetVersion($DBversion);
}
+$DBversion ="3.09.00.059";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');");
+ print "Upgrade to $DBversion done (Add system preference BlockReturnOfWithdrawnItems)\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)
alert: "display a message"
nothing : "do nothing"
- .
+ Checkin Policy:
+ -
+ - pref: BlockReturnOfWithdrawnItems
+ choices:
+ yes: Block
+ no: "Don't block"
+ - returning of items that have been withdrawn.
Holds Policy:
-
- pref: AllowHoldPolicyOverride
<p class="problem">Item was lost, now found.</p>
[% END %]
[% IF ( errmsgloo.withdrawn ) %]
- <p class="problem">Item is withdrawn.</p>
+ [% IF BlockReturnOfWithdrawnItems %]
+ <h3>Cannot Check In</h3>
+ <p class="problem">Item is withdrawn. <strong>NOT CHECKED IN</strong></p>
+ [% ELSE %]
+ <p class="problem">Item is withdrawn.</p>
+ [% END %]
[% END %]
[% IF ( errmsgloo.debarred ) %]
<p class="problem"><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% errmsgloo.debarborrowernumber %]">[% errmsgloo.debarname %]([% errmsgloo.debarcardnumber %])</a> is now debarred until [% errmsgloo.debarred | $KohaDates %] </p>