my ( $borrower, $barcode, $duedate, $inprocess, $ignore_reserves ) = @_;
my %needsconfirmation; # filled with problems that needs confirmations
my %issuingimpossible; # filled with problems that causes the issue to be IMPOSSIBLE
+ my %alerts; # filled with messages that shouldn't stop issuing, but the librarian should be aware of.
+
my $item = GetItem(GetItemnumberFromBarcode( $barcode ));
my $issue = GetItemIssue($item->{itemnumber});
my $biblioitem = GetBiblioItemData($item->{biblioitemnumber});
{
$issuingimpossible{RESTRICTED} = 1;
}
- if ( $item->{'itemlost'} ) {
- $needsconfirmation{ITEM_LOST} = GetAuthorisedValueByCode( 'LOST', $item->{'itemlost'} );
+ if ( $item->{'itemlost'} && C4::Context->preference("IssueLostItem") ne 'nothing' ) {
+ my $code = GetAuthorisedValueByCode( 'LOST', $item->{'itemlost'} );
+ $needsconfirmation{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'confirm' );
+ $alerts{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'alert' );
}
if ( C4::Context->preference("IndependantBranches") ) {
my $userenv = C4::Context->userenv;
}
}
}
- return ( \%issuingimpossible, \%needsconfirmation );
+ return ( \%issuingimpossible, \%needsconfirmation, \%alerts );
}
=head2 AddIssue
#
if ($barcode) {
# always check for blockers on issuing
- my ( $error, $question ) =
+ my ( $error, $question, $alerts ) =
CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess );
my $blocker = $invalidduedate ? 1 : 0;
+ $template->param( alert => $alerts );
+
delete $question->{'DEBT'} if ($debt_confirmed);
foreach my $impossible ( keys %$error ) {
$template->param(
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacBrowseResults','1','Disable/enable browsing and paging search results from the OPAC detail page.',NULL,'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SvcMaxReportRows','10','Maximum number of rows to return via the report web service.',NULL,'Integer');
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IssueLostItem', 'alert', 'alert|confirm|nothing', 'Defines what should be done when an attempt is made to issue an item that has been marked as lost.', 'Choice');
SetVersion ($DBversion);
}
+$DBversion = "3.09.00.XXX";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IssueLostItem', 'alert', 'alert|confirm|nothing', 'Defines what should be done when an attempt is made to issue an item that has been marked as lost.', 'Choice')");
+ print "Upgrade to $DBversion done (Add system preference issuelostitem ))\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)
choices:
homebranch: the library the item is from.
holdingbranch: the library the item was checked out from.
+ -
+ - "When issuing an item that has been marked as lost, "
+ - pref: IssueLostItem
+ choices:
+ confirm: "require confirmation"
+ alert: "display a message"
+ nothing : "do nothing"
+ - .
Holds Policy:
-
- pref: AllowHoldPolicyOverride
</div>
[% END %]
+[% IF ( alert.ITEM_LOST ) %]
+ <div class="dialog message">This item has been lost with a status of "[% alert.ITEM_LOST %]".</div>
+[% END %]
+
[% IF ( NEEDSCONFIRMATION ) %]
<div class="yui-g">