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

(-)a/C4/Circulation.pm (+8 lines)
Lines 57-62 use Koha::RefundLostItemFeeRule; Link Here
57
use Koha::RefundLostItemFeeRules;
57
use Koha::RefundLostItemFeeRules;
58
use Koha::Account::Lines;
58
use Koha::Account::Lines;
59
use Koha::Account::Offsets;
59
use Koha::Account::Offsets;
60
use Koha::Recalls;
60
use Carp;
61
use Carp;
61
use List::MoreUtils qw( uniq );
62
use List::MoreUtils qw( uniq );
62
use Scalar::Util qw( looks_like_number );
63
use Scalar::Util qw( looks_like_number );
Lines 2020-2025 sub AddReturn { Link Here
2020
        $messages->{'ResFound'} = $resrec;
2021
        $messages->{'ResFound'} = $resrec;
2021
    }
2022
    }
2022
2023
2024
    # find recalls.....
2025
    my $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'} });
2026
    if (defined $recall){
2027
        $messages->{'RecallFound'} = 1;
2028
        $messages->{'Recall'} = $recall;
2029
    }
2030
2023
    # Record the fact that this book was returned.
2031
    # Record the fact that this book was returned.
2024
    UpdateStats({
2032
    UpdateStats({
2025
        branch         => $branch,
2033
        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 184-189 if ( $query->param('reserve_id') ) { Link Here
184
    }
185
    }
185
}
186
}
186
187
188
if ( $query->param('recall_id') ){
189
    my $recall = Koha::Recalls->find(scalar $query->param('recall_id'));
190
    $recall->update({ status => 'W', waitingdate => dt_from_string() });
191
}
192
187
my $borrower;
193
my $borrower;
188
my $returned = 0;
194
my $returned = 0;
189
my $messages;
195
my $messages;
Lines 358-363 $template->param( inputloop => \@inputloop ); Link Here
358
my $found    = 0;
364
my $found    = 0;
359
my $waiting  = 0;
365
my $waiting  = 0;
360
my $reserved = 0;
366
my $reserved = 0;
367
my $recalled = 0;
361
368
362
# new op dev : we check if the document must be returned to his homebranch directly,
369
# new op dev : we check if the document must be returned to his homebranch directly,
363
#  if the document is transfered, we have warning message .
370
#  if the document is transfered, we have warning message .
Lines 444-449 if ( $messages->{'ResFound'}) { Link Here
444
    } # else { ; }  # error?
451
    } # else { ; }  # error?
445
}
452
}
446
453
454
if ( $messages->{'RecallFound'} ){
455
    my $recall = $messages->{'Recall'};
456
    my $patron = Koha::Patrons->find( $recall->borrowernumber );
457
    $template->param(
458
        patron   => $patron,
459
        found    => 1,
460
        recalled => 1,
461
        recall   => $recall,
462
        address   => $patron->address,
463
        address2  => $patron->address2,
464
        streetnumber => $patron->streetnumber,
465
        city         => $patron->city,
466
        zipcode      => $patron->zipcode,
467
        state        => $patron->state,
468
        country      => $patron->country,
469
    );
470
}
471
447
# Error Messages
472
# Error Messages
448
my @errmsgloop;
473
my @errmsgloop;
449
foreach my $code ( keys %$messages ) {
474
foreach my $code ( keys %$messages ) {
Lines 476-481 foreach my $code ( keys %$messages ) { Link Here
476
    elsif ( $code eq 'WasTransfered' ) {
501
    elsif ( $code eq 'WasTransfered' ) {
477
        ;    # FIXME... anything to do here?
502
        ;    # FIXME... anything to do here?
478
    }
503
    }
504
    elsif ( $code eq 'RecallFound' ) {
505
        ;
506
    }
507
    elsif ( $code eq 'Recall' ) {
508
        ;
509
    }
479
    elsif ( $code eq 'withdrawn' ) {
510
    elsif ( $code eq 'withdrawn' ) {
480
        $err{withdrawn} = 1;
511
        $err{withdrawn} = 1;
481
        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
512
        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +66 lines)
Lines 454-459 Link Here
454
            </div>
454
            </div>
455
        </div>
455
        </div>
456
    [% END %]
456
    [% END %]
457
458
    <!-- item has been recalled  -->
459
    [% IF ( recalled ) %]
460
    <!--  recalled  -->
461
        <div id="recalled" class="modal fade audio-alert-action">
462
            <div class="modal-dialog">
463
            <div class="modal-content">
464
            <form method="post" action="/cgi-bin/koha/circ/returns.pl" class="confirm">
465
                <div class="modal-header">
466
                    <h3>Recall found: <br/>
467
                        <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %] </a>
468
                    </h3>
469
                </div>
470
471
                <div class="modal-body">
472
                    [% IF ( recallnotes ) %]
473
                        <h4>Notes: [% recall.recallnotes %]</h4>
474
                    [% END %]
475
                    <h5>This item has been recalled by:</h5>
476
                    <li>
477
                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">[% patron.surname %], [% patron.firstname %]</a>
478
                        ([% patron.cardnumber %])
479
                        <span class="patron-category"> - [% patron.category.description %]</span>
480
                    </li>
481
482
                    [% INCLUDE display_holdpatron_address %]
483
484
                    [% IF ( patron.phone ) %]
485
                        <li>[% patron.phone %]</li>
486
                    [% END %]
487
488
                    [% IF ( patron.email ) %]
489
                        <li><a id="boremail" href="mailto:[% patron.email %]">[% patron.email %]</a></li>
490
                    [% END %]
491
492
                    [% IF ( patron.debarred ) %]
493
                        <li class="error">Patron is RESTRICTED</li>
494
                    [% END %]
495
496
                    [% IF ( patron.gonenoaddress ) %]
497
                        <li class="error">Patron's address is in doubt</li>
498
                    [% END %]
499
500
                    <h4><strong>Wait for pickup at</strong> [% recall.branch.branchname %]</h4>
501
502
                    <input type="hidden" name="itemnumber" value="[% recall.itemnumber %]" />
503
                    <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
504
                    <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
505
                    <input type="hidden" name="recall_id" value="[% recall.recall_id %]" />
506
                    <input type="hidden" name="diffBranch" value="[% recall.branchcode %]" />
507
                </div>
508
509
                <div class="modal-footer">
510
                    <button type="submit" class="btn btn-default approve">
511
                        <i class="fa fa-check"></i> Confirm recall waiting
512
                    </button>
513
514
                    <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-danger deny" onclick="$('#barcode').focus(); return false;">
515
                        <i class="fa fa-times"></i> Ignore
516
                    </button>
517
                </div>
518
            </form>
519
            </div>
520
            </div>
521
        </div>
522
    [% END %]
457
[% END %]
523
[% END %]
458
524
459
[% IF ( errmsgloop ) %]
525
[% IF ( errmsgloop ) %]
460
- 

Return to bug 19532