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 2023-2028 sub AddReturn { Link Here
2023
        $messages->{'ResFound'} = $resrec;
2024
        $messages->{'ResFound'} = $resrec;
2024
    }
2025
    }
2025
2026
2027
    # find recalls.....
2028
    my $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'} });
2029
    if (defined $recall){
2030
        $messages->{'RecallFound'} = 1;
2031
        $messages->{'Recall'} = $recall;
2032
    }
2033
2026
    # Record the fact that this book was returned.
2034
    # Record the fact that this book was returned.
2027
    UpdateStats({
2035
    UpdateStats({
2028
        branch         => $branch,
2036
        branch         => $branch,
(-)a/circ/returns.pl (+31 lines)
Lines 52-57 use Koha::BiblioFrameworks; Link Here
52
use Koha::Holds;
52
use Koha::Holds;
53
use Koha::Items;
53
use Koha::Items;
54
use Koha::Patrons;
54
use Koha::Patrons;
55
use Koha::Recalls;
55
56
56
my $query = new CGI;
57
my $query = new CGI;
57
58
Lines 187-192 if ( $query->param('reserve_id') ) { Link Here
187
    }
188
    }
188
}
189
}
189
190
191
if ( $query->param('recall_id') ){
192
    my $recall = Koha::Recalls->find(scalar $query->param('recall_id'));
193
    $recall->update({ status => 'W', waitingdate => dt_from_string() });
194
}
195
190
my $borrower;
196
my $borrower;
191
my $returned = 0;
197
my $returned = 0;
192
my $messages;
198
my $messages;
Lines 362-367 $template->param( inputloop => \@inputloop ); Link Here
362
my $found    = 0;
368
my $found    = 0;
363
my $waiting  = 0;
369
my $waiting  = 0;
364
my $reserved = 0;
370
my $reserved = 0;
371
my $recalled = 0;
365
372
366
# new op dev : we check if the document must be returned to his homebranch directly,
373
# new op dev : we check if the document must be returned to his homebranch directly,
367
#  if the document is transfered, we have warning message .
374
#  if the document is transfered, we have warning message .
Lines 481-486 if ( $messages->{'ResFound'}) { Link Here
481
    } # else { ; }  # error?
488
    } # else { ; }  # error?
482
}
489
}
483
490
491
if ( $messages->{'RecallFound'} ){
492
    my $recall = $messages->{'Recall'};
493
    my $patron = Koha::Patrons->find( $recall->borrowernumber );
494
    $template->param(
495
        patron   => $patron,
496
        found    => 1,
497
        recalled => 1,
498
        recall   => $recall,
499
        address   => $patron->address,
500
        address2  => $patron->address2,
501
        streetnumber => $patron->streetnumber,
502
        city         => $patron->city,
503
        zipcode      => $patron->zipcode,
504
        state        => $patron->state,
505
        country      => $patron->country,
506
    );
507
}
508
484
# Error Messages
509
# Error Messages
485
my @errmsgloop;
510
my @errmsgloop;
486
foreach my $code ( keys %$messages ) {
511
foreach my $code ( keys %$messages ) {
Lines 513-518 foreach my $code ( keys %$messages ) { Link Here
513
    elsif ( $code eq 'WasTransfered' ) {
538
    elsif ( $code eq 'WasTransfered' ) {
514
        ;    # FIXME... anything to do here?
539
        ;    # FIXME... anything to do here?
515
    }
540
    }
541
    elsif ( $code eq 'RecallFound' ) {
542
        ;
543
    }
544
    elsif ( $code eq 'Recall' ) {
545
        ;
546
    }
516
    elsif ( $code eq 'withdrawn' ) {
547
    elsif ( $code eq 'withdrawn' ) {
517
        $err{withdrawn} = 1;
548
        $err{withdrawn} = 1;
518
        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
549
        $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