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 2024-2029 sub AddReturn { Link Here
2024
        $messages->{'ResFound'} = $resrec;
2025
        $messages->{'ResFound'} = $resrec;
2025
    }
2026
    }
2026
2027
2028
    # find recalls.....
2029
    my $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'} });
2030
    if (defined $recall){
2031
        $messages->{'RecallFound'} = 1;
2032
        $messages->{'Recall'} = $recall;
2033
    }
2034
2027
    # Record the fact that this book was returned.
2035
    # Record the fact that this book was returned.
2028
    UpdateStats({
2036
    UpdateStats({
2029
        branch         => $branch,
2037
        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 473-478 if ( $messages->{'ResFound'}) { Link Here
473
    );
480
    );
474
}
481
}
475
482
483
if ( $messages->{'RecallFound'} ){
484
    my $recall = $messages->{'Recall'};
485
    my $patron = Koha::Patrons->find( $recall->borrowernumber );
486
    $template->param(
487
        patron   => $patron,
488
        found    => 1,
489
        recalled => 1,
490
        recall   => $recall,
491
        address   => $patron->address,
492
        address2  => $patron->address2,
493
        streetnumber => $patron->streetnumber,
494
        city         => $patron->city,
495
        zipcode      => $patron->zipcode,
496
        state        => $patron->state,
497
        country      => $patron->country,
498
    );
499
}
500
476
# Error Messages
501
# Error Messages
477
my @errmsgloop;
502
my @errmsgloop;
478
foreach my $code ( keys %$messages ) {
503
foreach my $code ( keys %$messages ) {
Lines 505-510 foreach my $code ( keys %$messages ) { Link Here
505
    elsif ( $code eq 'WasTransfered' ) {
530
    elsif ( $code eq 'WasTransfered' ) {
506
        ;    # FIXME... anything to do here?
531
        ;    # FIXME... anything to do here?
507
    }
532
    }
533
    elsif ( $code eq 'RecallFound' ) {
534
        ;
535
    }
536
    elsif ( $code eq 'Recall' ) {
537
        ;
538
    }
508
    elsif ( $code eq 'withdrawn' ) {
539
    elsif ( $code eq 'withdrawn' ) {
509
        $err{withdrawn} = 1;
540
        $err{withdrawn} = 1;
510
        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
541
        $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +66 lines)
Lines 506-511 Link Here
506
            </div>
506
            </div>
507
        </div>
507
        </div>
508
    [% END %]
508
    [% END %]
509
510
    <!-- item has been recalled  -->
511
    [% IF ( recalled ) %]
512
    <!--  recalled  -->
513
        <div id="recalled" class="modal fade audio-alert-action">
514
            <div class="modal-dialog">
515
            <div class="modal-content">
516
            <form method="post" action="/cgi-bin/koha/circ/returns.pl" class="confirm">
517
                <div class="modal-header">
518
                    <h3>Recall found: <br/>
519
                        <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %] </a>
520
                    </h3>
521
                </div>
522
523
                <div class="modal-body">
524
                    [% IF ( recallnotes ) %]
525
                        <h4>Notes: [% recall.recallnotes %]</h4>
526
                    [% END %]
527
                    <h5>This item has been recalled by:</h5>
528
                    <li>
529
                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">[% patron.surname %], [% patron.firstname %]</a>
530
                        ([% patron.cardnumber %])
531
                        <span class="patron-category"> - [% patron.category.description %]</span>
532
                    </li>
533
534
                    [% INCLUDE display_holdpatron_address %]
535
536
                    [% IF ( patron.phone ) %]
537
                        <li>[% patron.phone %]</li>
538
                    [% END %]
539
540
                    [% IF ( patron.email ) %]
541
                        <li><a id="boremail" href="mailto:[% patron.email %]">[% patron.email %]</a></li>
542
                    [% END %]
543
544
                    [% IF ( patron.debarred ) %]
545
                        <li class="error">Patron is RESTRICTED</li>
546
                    [% END %]
547
548
                    [% IF ( patron.gonenoaddress ) %]
549
                        <li class="error">Patron's address is in doubt</li>
550
                    [% END %]
551
552
                    <h4><strong>Wait for pickup at</strong> [% recall.branch.branchname %]</h4>
553
554
                    <input type="hidden" name="itemnumber" value="[% recall.itemnumber %]" />
555
                    <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
556
                    <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
557
                    <input type="hidden" name="recall_id" value="[% recall.recall_id %]" />
558
                    <input type="hidden" name="diffBranch" value="[% recall.branchcode %]" />
559
                </div>
560
561
                <div class="modal-footer">
562
                    <button type="submit" class="btn btn-default approve">
563
                        <i class="fa fa-check"></i> Confirm recall waiting
564
                    </button>
565
566
                    <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-danger deny" onclick="$('#barcode').focus(); return false;">
567
                        <i class="fa fa-times"></i> Ignore
568
                    </button>
569
                </div>
570
            </form>
571
            </div>
572
            </div>
573
        </div>
574
    [% END %]
509
[% END %]
575
[% END %]
510
576
511
[% IF ( errmsgloop ) %]
577
[% IF ( errmsgloop ) %]
512
- 

Return to bug 19532