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 57-62 use Koha::Checkouts; Link Here
57
use Koha::Holds;
57
use Koha::Holds;
58
use Koha::Items;
58
use Koha::Items;
59
use Koha::Patrons;
59
use Koha::Patrons;
60
use Koha::Recalls;
60
61
61
my $query = new CGI;
62
my $query = new CGI;
62
63
Lines 192-197 if ( $query->param('reserve_id') ) { Link Here
192
    }
193
    }
193
}
194
}
194
195
196
if ( $query->param('recall_id') ){
197
    my $recall = Koha::Recalls->find(scalar $query->param('recall_id'));
198
    $recall->update({ status => 'W', waitingdate => dt_from_string() });
199
}
200
195
my $borrower;
201
my $borrower;
196
my $returned = 0;
202
my $returned = 0;
197
my $messages;
203
my $messages;
Lines 367-372 $template->param( inputloop => \@inputloop ); Link Here
367
my $found    = 0;
373
my $found    = 0;
368
my $waiting  = 0;
374
my $waiting  = 0;
369
my $reserved = 0;
375
my $reserved = 0;
376
my $recalled = 0;
370
377
371
# new op dev : we check if the document must be returned to his homebranch directly,
378
# new op dev : we check if the document must be returned to his homebranch directly,
372
#  if the document is transfered, we have warning message .
379
#  if the document is transfered, we have warning message .
Lines 486-491 if ( $messages->{'ResFound'}) { Link Here
486
    } # else { ; }  # error?
493
    } # else { ; }  # error?
487
}
494
}
488
495
496
if ( $messages->{'RecallFound'} ){
497
    my $recall = $messages->{'Recall'};
498
    my $patron = Koha::Patrons->find( $recall->borrowernumber );
499
    $template->param(
500
        patron   => $patron,
501
        found    => 1,
502
        recalled => 1,
503
        recall   => $recall,
504
        address   => $patron->address,
505
        address2  => $patron->address2,
506
        streetnumber => $patron->streetnumber,
507
        city         => $patron->city,
508
        zipcode      => $patron->zipcode,
509
        state        => $patron->state,
510
        country      => $patron->country,
511
    );
512
}
513
489
# Error Messages
514
# Error Messages
490
my @errmsgloop;
515
my @errmsgloop;
491
foreach my $code ( keys %$messages ) {
516
foreach my $code ( keys %$messages ) {
Lines 519-524 foreach my $code ( keys %$messages ) { Link Here
519
    elsif ( $code eq 'WasTransfered' ) {
544
    elsif ( $code eq 'WasTransfered' ) {
520
        ;    # FIXME... anything to do here?
545
        ;    # FIXME... anything to do here?
521
    }
546
    }
547
    elsif ( $code eq 'RecallFound' ) {
548
        ;
549
    }
550
    elsif ( $code eq 'Recall' ) {
551
        ;
552
    }
522
    elsif ( $code eq 'withdrawn' ) {
553
    elsif ( $code eq 'withdrawn' ) {
523
        $err{withdrawn} = 1;
554
        $err{withdrawn} = 1;
524
        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
555
        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +66 lines)
Lines 577-582 $(document).ready(function () { Link Here
577
            </div>
577
            </div>
578
        </div>
578
        </div>
579
    [% END %]
579
    [% END %]
580
581
    <!-- item has been recalled  -->
582
    [% IF ( recalled ) %]
583
    <!--  recalled  -->
584
        <div id="recalled" class="modal fade audio-alert-action">
585
            <div class="modal-dialog">
586
            <div class="modal-content">
587
            <form method="post" action="/cgi-bin/koha/circ/returns.pl" class="confirm">
588
                <div class="modal-header">
589
                    <h3>Recall found: <br/>
590
                        <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %] </a>
591
                    </h3>
592
                </div>
593
594
                <div class="modal-body">
595
                    [% IF ( recallnotes ) %]
596
                        <h4>Notes: [% recall.recallnotes %]</h4>
597
                    [% END %]
598
                    <h5>This item has been recalled by:</h5>
599
                    <li>
600
                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">[% patron.surname %], [% patron.firstname %]</a>
601
                        ([% patron.cardnumber %])
602
                        <span class="patron-category"> - [% patron.category.description %]</span>
603
                    </li>
604
605
                    [% INCLUDE display_holdpatron_address %]
606
607
                    [% IF ( patron.phone ) %]
608
                        <li>[% patron.phone %]</li>
609
                    [% END %]
610
611
                    [% IF ( patron.email ) %]
612
                        <li><a id="boremail" href="mailto:[% patron.email %]">[% patron.email %]</a></li>
613
                    [% END %]
614
615
                    [% IF ( patron.debarred ) %]
616
                        <li class="error">Patron is RESTRICTED</li>
617
                    [% END %]
618
619
                    [% IF ( patron.gonenoaddress ) %]
620
                        <li class="error">Patron's address is in doubt</li>
621
                    [% END %]
622
623
                    <h4><strong>Wait for pickup at</strong> [% recall.branch.branchname %]</h4>
624
625
                    <input type="hidden" name="itemnumber" value="[% recall.itemnumber %]" />
626
                    <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
627
                    <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
628
                    <input type="hidden" name="recall_id" value="[% recall.recall_id %]" />
629
                    <input type="hidden" name="diffBranch" value="[% recall.branchcode %]" />
630
                </div>
631
632
                <div class="modal-footer">
633
                    <button type="submit" class="btn btn-default approve">
634
                        <i class="fa fa-check"></i> Confirm recall waiting
635
                    </button>
636
637
                    <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-danger deny" onclick="$('#barcode').focus(); return false;">
638
                        <i class="fa fa-times"></i> Ignore
639
                    </button>
640
                </div>
641
            </form>
642
            </div>
643
            </div>
644
        </div>
645
    [% END %]
580
[% END %]
646
[% END %]
581
647
582
[% IF ( errmsgloop ) %]
648
[% IF ( errmsgloop ) %]
583
- 

Return to bug 19532