View | Details | Raw Unified | Return to bug 19532
Collapse All | Expand All

(-)a/C4/Circulation.pm (+8 lines)
Lines 56-61 use Koha::RefundLostItemFeeRule; Link Here
56
use Koha::RefundLostItemFeeRules;
56
use Koha::RefundLostItemFeeRules;
57
use Koha::Account::Lines;
57
use Koha::Account::Lines;
58
use Koha::Account::Offsets;
58
use Koha::Account::Offsets;
59
use Koha::Recalls;
59
use Carp;
60
use Carp;
60
use List::MoreUtils qw( uniq );
61
use List::MoreUtils qw( uniq );
61
use Scalar::Util qw( looks_like_number );
62
use Scalar::Util qw( looks_like_number );
Lines 2050-2055 sub AddReturn { Link Here
2050
        $messages->{'ResFound'} = $resrec;
2051
        $messages->{'ResFound'} = $resrec;
2051
    }
2052
    }
2052
2053
2054
    # find recalls.....
2055
    my $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'} });
2056
    if (defined $recall){
2057
        $messages->{'RecallFound'} = 1;
2058
        $messages->{'Recall'} = $recall;
2059
    }
2060
2053
    # Record the fact that this book was returned.
2061
    # Record the fact that this book was returned.
2054
    UpdateStats({
2062
    UpdateStats({
2055
        branch         => $branch,
2063
        branch         => $branch,
(-)a/circ/returns.pl (+31 lines)
Lines 54-59 use Koha::Checkouts; Link Here
54
use Koha::Holds;
54
use Koha::Holds;
55
use Koha::Items;
55
use Koha::Items;
56
use Koha::Patrons;
56
use Koha::Patrons;
57
use Koha::Recalls;
57
58
58
my $query = new CGI;
59
my $query = new CGI;
59
60
Lines 189-194 if ( $query->param('reserve_id') ) { Link Here
189
    }
190
    }
190
}
191
}
191
192
193
if ( $query->param('recall_id') ){
194
    my $recall = Koha::Recalls->find(scalar $query->param('recall_id'));
195
    $recall->update({ status => 'W', waitingdate => dt_from_string() });
196
}
197
192
my $borrower;
198
my $borrower;
193
my $returned = 0;
199
my $returned = 0;
194
my $messages;
200
my $messages;
Lines 364-369 $template->param( inputloop => \@inputloop ); Link Here
364
my $found    = 0;
370
my $found    = 0;
365
my $waiting  = 0;
371
my $waiting  = 0;
366
my $reserved = 0;
372
my $reserved = 0;
373
my $recalled = 0;
367
374
368
# new op dev : we check if the document must be returned to his homebranch directly,
375
# new op dev : we check if the document must be returned to his homebranch directly,
369
#  if the document is transfered, we have warning message .
376
#  if the document is transfered, we have warning message .
Lines 483-488 if ( $messages->{'ResFound'}) { Link Here
483
    } # else { ; }  # error?
490
    } # else { ; }  # error?
484
}
491
}
485
492
493
if ( $messages->{'RecallFound'} ){
494
    my $recall = $messages->{'Recall'};
495
    my $patron = Koha::Patrons->find( $recall->borrowernumber );
496
    $template->param(
497
        patron   => $patron,
498
        found    => 1,
499
        recalled => 1,
500
        recall   => $recall,
501
        address   => $patron->address,
502
        address2  => $patron->address2,
503
        streetnumber => $patron->streetnumber,
504
        city         => $patron->city,
505
        zipcode      => $patron->zipcode,
506
        state        => $patron->state,
507
        country      => $patron->country,
508
    );
509
}
510
486
# Error Messages
511
# Error Messages
487
my @errmsgloop;
512
my @errmsgloop;
488
foreach my $code ( keys %$messages ) {
513
foreach my $code ( keys %$messages ) {
Lines 516-521 foreach my $code ( keys %$messages ) { Link Here
516
    elsif ( $code eq 'WasTransfered' ) {
541
    elsif ( $code eq 'WasTransfered' ) {
517
        ;    # FIXME... anything to do here?
542
        ;    # FIXME... anything to do here?
518
    }
543
    }
544
    elsif ( $code eq 'RecallFound' ) {
545
        ;
546
    }
547
    elsif ( $code eq 'Recall' ) {
548
        ;
549
    }
519
    elsif ( $code eq 'withdrawn' ) {
550
    elsif ( $code eq 'withdrawn' ) {
520
        $err{withdrawn} = 1;
551
        $err{withdrawn} = 1;
521
        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
552
        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +66 lines)
Lines 456-461 Link Here
456
            </div>
456
            </div>
457
        </div>
457
        </div>
458
    [% END %]
458
    [% END %]
459
460
    <!-- item has been recalled  -->
461
    [% IF ( recalled ) %]
462
    <!--  recalled  -->
463
        <div id="recalled" class="modal fade audio-alert-action">
464
            <div class="modal-dialog">
465
            <div class="modal-content">
466
            <form method="post" action="/cgi-bin/koha/circ/returns.pl" class="confirm">
467
                <div class="modal-header">
468
                    <h3>Recall found: <br/>
469
                        <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %] </a>
470
                    </h3>
471
                </div>
472
473
                <div class="modal-body">
474
                    [% IF ( recallnotes ) %]
475
                        <h4>Notes: [% recall.recallnotes %]</h4>
476
                    [% END %]
477
                    <h5>This item has been recalled by:</h5>
478
                    <li>
479
                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">[% patron.surname %], [% patron.firstname %]</a>
480
                        ([% patron.cardnumber %])
481
                        <span class="patron-category"> - [% patron.category.description %]</span>
482
                    </li>
483
484
                    [% INCLUDE display_holdpatron_address %]
485
486
                    [% IF ( patron.phone ) %]
487
                        <li>[% patron.phone %]</li>
488
                    [% END %]
489
490
                    [% IF ( patron.email ) %]
491
                        <li><a id="boremail" href="mailto:[% patron.email %]">[% patron.email %]</a></li>
492
                    [% END %]
493
494
                    [% IF ( patron.debarred ) %]
495
                        <li class="error">Patron is RESTRICTED</li>
496
                    [% END %]
497
498
                    [% IF ( patron.gonenoaddress ) %]
499
                        <li class="error">Patron's address is in doubt</li>
500
                    [% END %]
501
502
                    <h4><strong>Wait for pickup at</strong> [% recall.branch.branchname %]</h4>
503
504
                    <input type="hidden" name="itemnumber" value="[% recall.itemnumber %]" />
505
                    <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
506
                    <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
507
                    <input type="hidden" name="recall_id" value="[% recall.recall_id %]" />
508
                    <input type="hidden" name="diffBranch" value="[% recall.branchcode %]" />
509
                </div>
510
511
                <div class="modal-footer">
512
                    <button type="submit" class="btn btn-default approve">
513
                        <i class="fa fa-check"></i> Confirm recall waiting
514
                    </button>
515
516
                    <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-danger deny" onclick="$('#barcode').focus(); return false;">
517
                        <i class="fa fa-times"></i> Ignore
518
                    </button>
519
                </div>
520
            </form>
521
            </div>
522
            </div>
523
        </div>
524
    [% END %]
459
[% END %]
525
[% END %]
460
526
461
[% IF ( errmsgloop ) %]
527
[% IF ( errmsgloop ) %]
462
- 

Return to bug 19532