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 2017-2022 sub AddReturn { Link Here
2017
        $messages->{'ResFound'} = $resrec;
2018
        $messages->{'ResFound'} = $resrec;
2018
    }
2019
    }
2019
2020
2021
    # find recalls.....
2022
    my $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'} });
2023
    if (defined $recall){
2024
        $messages->{'RecallFound'} = 1;
2025
        $messages->{'Recall'} = $recall;
2026
    }
2027
2020
    # Record the fact that this book was returned.
2028
    # Record the fact that this book was returned.
2021
    UpdateStats({
2029
    UpdateStats({
2022
        branch         => $branch,
2030
        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 183-188 if ( $query->param('reserve_id') ) { Link Here
183
    }
184
    }
184
}
185
}
185
186
187
if ( $query->param('recall_id') ){
188
    my $recall = Koha::Recalls->find(scalar $query->param('recall_id'));
189
    $recall->update({ status => 'W', waitingdate => dt_from_string() });
190
}
191
186
my $borrower;
192
my $borrower;
187
my $returned = 0;
193
my $returned = 0;
188
my $messages;
194
my $messages;
Lines 357-362 $template->param( inputloop => \@inputloop ); Link Here
357
my $found    = 0;
363
my $found    = 0;
358
my $waiting  = 0;
364
my $waiting  = 0;
359
my $reserved = 0;
365
my $reserved = 0;
366
my $recalled = 0;
360
367
361
# new op dev : we check if the document must be returned to his homebranch directly,
368
# new op dev : we check if the document must be returned to his homebranch directly,
362
#  if the document is transfered, we have warning message .
369
#  if the document is transfered, we have warning message .
Lines 445-450 if ( $messages->{'ResFound'}) { Link Here
445
    } # else { ; }  # error?
452
    } # else { ; }  # error?
446
}
453
}
447
454
455
if ( $messages->{'RecallFound'} ){
456
    my $recall = $messages->{'Recall'};
457
    my $patron = Koha::Patrons->find( $recall->borrowernumber );
458
    $template->param(
459
        patron   => $patron,
460
        found    => 1,
461
        recalled => 1,
462
        recall   => $recall,
463
        address   => $patron->address,
464
        address2  => $patron->address2,
465
        streetnumber => $patron->streetnumber,
466
        city         => $patron->city,
467
        zipcode      => $patron->zipcode,
468
        state        => $patron->state,
469
        country      => $patron->country,
470
    );
471
}
472
448
# Error Messages
473
# Error Messages
449
my @errmsgloop;
474
my @errmsgloop;
450
foreach my $code ( keys %$messages ) {
475
foreach my $code ( keys %$messages ) {
Lines 477-482 foreach my $code ( keys %$messages ) { Link Here
477
    elsif ( $code eq 'WasTransfered' ) {
502
    elsif ( $code eq 'WasTransfered' ) {
478
        ;    # FIXME... anything to do here?
503
        ;    # FIXME... anything to do here?
479
    }
504
    }
505
    elsif ( $code eq 'RecallFound' ) {
506
        ;
507
    }
508
    elsif ( $code eq 'Recall' ) {
509
        ;
510
    }
480
    elsif ( $code eq 'withdrawn' ) {
511
    elsif ( $code eq 'withdrawn' ) {
481
        $err{withdrawn} = 1;
512
        $err{withdrawn} = 1;
482
        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
513
        $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