Bug 7758 - Koha allowing LOST items to check out without alert
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 5 Apr 2012 15:16:47 +0000 (11:16 -0400)
committerPaul Poulain <paul.poulain@biblibre.com>
Fri, 6 Apr 2012 16:08:17 +0000 (18:08 +0200)
Adds a confirmation alert when issuing an item that has
been marked as lost.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
passes tests, works as advertiesd

Tested:
- checking out an item that is marked lost performs all usual lost operations
- checking out an item that is marked lost prompts for confirmation

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
C4/Circulation.pm
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt

index 9c43f36..6ca860d 100644 (file)
@@ -36,7 +36,7 @@ use C4::Message;
 use C4::Debug;
 use C4::Branch; # GetBranches
 use C4::Log; # logaction
-
+use C4::Koha qw(GetAuthorisedValueByCode);
 use Data::Dumper;
 use Koha::DateUtils;
 use Koha::Calendar;
@@ -848,6 +848,9 @@ sub CanBookBeIssued {
     {
         $issuingimpossible{RESTRICTED} = 1;
     }
+    if ( $item->{'itemlost'} ) {
+        $needsconfirmation{ITEM_LOST} = GetAuthorisedValueByCode( 'LOST', $item->{'itemlost'} );
+    }
     if ( C4::Context->preference("IndependantBranches") ) {
         my $userenv = C4::Context->userenv;
         if ( ($userenv) && ( $userenv->{flags} % 2 != 1 ) ) {
index 0cdd2dc..55dca62 100644 (file)
@@ -275,9 +275,14 @@ function refocus(calendar) {
 [% IF ( NOT_FOR_LOAN_FORCING ) %]
     <li>Item is normally not for loan.  Check out anyway?</li>
 [% END %]
+
 [% IF ( USERBLOCKEDOVERDUE ) %]
     <li>Patron has [% USERBLOCKEDOVERDUE %] overdue item(s).  Check out anyway?</li>
 [% END %]
+
+[% IF ( ITEM_LOST ) %]
+    <li>This item has been lost with a status of "[% ITEM_LOST %]". Check out anyway?</li>
+[% END %]
 </ul>
 
 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">