Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[#27547969] Clear negative notforloan status on checkin

This patch incorporates a new syspref (ClearNotForLoan) that, when enabled,
will set the item.notforloan status to zero when an item is checked in and
previously had a negative value.
  • Loading branch information...
commit 4edf73e4f4d570f762635c342d8eb523239c756a 1 parent 6c1610f
@dlbptfs dlbptfs authored
View
1  cgi/admin/systempreferences.pl
@@ -214,6 +214,7 @@ =head1 systempreferences.pl
$tabsysprefs{KeepPreviousBorrower} = "Circulation";
$tabsysprefs{KeepPreviousBorrowerInterval} = "Circulation";
$tabsysprefs{SplitStatistics} = "Circulation";
+$tabsysprefs{ClearNotForLoan} = "Circulation";
# Staff Client
$tabsysprefs{TemplateEncoding} = "StaffClient";
View
6 installer/data/syspref_defaults.json
@@ -2080,5 +2080,11 @@
"options" : null,
"value" : "0",
"type" : "Integer"
+ },
+ "ClearNotForLoan" : {
+ "explanation" : "If ON, then negative notforloan values will be cleared upon check-in.",
+ "options" : null,
+ "value" : "0",
+ "type" : "YesNo"
}
}
View
1  lib/C4/Auth.pm
@@ -329,6 +329,7 @@ sub get_template_and_user {
StaffSerialIssueDisplayCount => C4::Context->preference("StaffSerialIssueDisplayCount"),
LinkLostItemsToPatron => C4::Context->preference('LinkLostItemsToPatron'),
RefundReturnedLostItem => C4::Context->preference('RefundReturnedLostItem'),
+ ClearNotForLoan => C4::Context->preference('ClearNotForLoan'),
GetItAcquisitions => C4::Context->preference("GetItAcquisitions"),
BibliosCataloging => C4::Context->preference("BibliosCataloging"),
);
View
3  lib/C4/Circulation.pm
@@ -1666,6 +1666,9 @@ sub AddReturn {
C4::Items::ModItem({ otherstatus => undef }, $item->{'biblionumber'}, $item->{'itemnumber'});
C4::Items::ModItem({ onloan => undef }, $item->{'biblionumber'}, $item->{'itemnumber'});
+ # Clear the notforloan status if syspref is turned ON and value is negative
+ C4::Items::ModItem({ notforloan => 0 }, $item->{'biblionumber'}, $item->{'itemnumber'}) if (C4::Context->preference('ClearNotForLoan') && ($item->{'notforloan'} < 0));
+
# case of a return of document (deal with issues and holdingbranch)
if ($doreturn) {
# $borrower or warn "AddReturn without current borrower";
Please sign in to comment.
Something went wrong with that request. Please try again.