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

(-)a/C4/Circulation.pm (-42 / +73 lines)
Lines 353-368 sub transferbook { Link Here
353
            $dotransfer = 0;
353
            $dotransfer = 0;
354
            $messages->{'RecallPlacedAtHoldingBranch'} = 1;
354
            $messages->{'RecallPlacedAtHoldingBranch'} = 1;
355
        } else {
355
        } else {
356
            $dotransfer = 1;
356
            $dotransfer = 0;
357
        }
357
        }
358
    } else {  #recalls take priority over holds, only check holds if no recalls
358
    } else {  #recalls take priority over holds, only check holds if no recalls
359
        # find reserves.....
359
        # find reserves.....
360
        my ( $resfound, $resrec, undef ) = CheckReserves( $itemnumber );
360
#       my ( $resfound, $resrec, undef ) =
361
        if ( $resfound and not $ignoreRs ) {
361
#       CheckReserves( $itemnumber );
362
            $resrec->{'ResFound'} = $resfound;
362
#        if ( $resfound and not $ignoreRs ) {
363
        #   $messages->{'ResFound'} = $resrec;
363
#            $resrec->{'ResFound'} = $resfound;
364
            $dotransfer = 1;
364
#            $messages->{'ResFound'} = $resrec;
365
        }
365
#            $dotransfer = 1;
366
#        }
366
    }
367
    }
367
368
368
    #actually do the transfer....
369
    #actually do the transfer....
Lines 665-670 sticky due date is invalid or due date in the past Link Here
665
666
666
if the borrower borrows to much things
667
if the borrower borrows to much things
667
668
669
=head3 WAITING_RECALL_FOR_A_DIFFERENT_PATRON
670
671
if the item has been recalled by a different patron and the recall status is waiting 'W'
672
668
=cut
673
=cut
669
674
670
sub CanBookBeIssued {
675
sub CanBookBeIssued {
Lines 989-1024 sub CanBookBeIssued { Link Here
989
        }
994
        }
990
    }
995
    }
991
996
992
    unless ( $ignore_reserves ) {
997
    my $recall;
993
        # See if the item is on reserve.
998
    #CHECK IF ITEM HAS WAITING RECALL FOR ANOTHER PATRON
994
        my ( $restype, $res ) = C4::Reserves::CheckReserves( $item->{'itemnumber'} );
999
    if ( C4::Context->preference('UseRecalls') ) {
995
        if ($restype) {
1000
        $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'}, status => 'W' });
996
            my $resbor = $res->{'borrowernumber'};
1001
        if ((defined $recall) && ($recall->patron->borrowernumber != $patron->borrowernumber) && $recall->status eq 'W') {
997
            if ( $resbor ne $patron->borrowernumber ) {
1002
             #Item has been recalled by a different patron and is waiting for them
998
                my $patron = Koha::Patrons->find( $resbor );
1003
             $issuingimpossible{WAITING_RECALL_FOR_A_DIFFERENT_PATRON} = 1;
999
                if ( $restype eq "Waiting" )
1004
        }
1000
                {
1005
    }
1001
                    # The item is on reserve and waiting, but has been
1006
1002
                    # reserved by some other patron.
1007
    if (!((defined $recall) && $recall->patron->borrowernumber == $patron->borrowernumber && $recall->status eq 'W')) {
1003
                    $needsconfirmation{RESERVE_WAITING} = 1;
1008
        unless ( $ignore_reserves ) {
1004
                    $needsconfirmation{'resfirstname'} = $patron->firstname;
1009
           # See if the item is on reserve.
1005
                    $needsconfirmation{'ressurname'} = $patron->surname;
1010
           my ( $restype, $res ) = C4::Reserves::CheckReserves( $item->{'itemnumber'} );
1006
                    $needsconfirmation{'rescardnumber'} = $patron->cardnumber;
1011
           if ($restype) {
1007
                    $needsconfirmation{'resborrowernumber'} = $patron->borrowernumber;
1012
              my $resbor = $res->{'borrowernumber'};
1008
                    $needsconfirmation{'resbranchcode'} = $res->{branchcode};
1013
              if ( $resbor ne $patron->borrowernumber ) {
1009
                    $needsconfirmation{'reswaitingdate'} = $res->{'waitingdate'};
1014
                  my $patron = Koha::Patrons->find( $resbor );
1010
                }
1015
                  if ( $restype eq "Waiting" )
1011
                elsif ( $restype eq "Reserved" ) {
1016
                  {
1012
                    # The item is on reserve for someone else.
1017
                      # The item is on reserve and waiting, but has been
1013
                    $needsconfirmation{RESERVED} = 1;
1018
                      # reserved by some other patron.
1014
                    $needsconfirmation{'resfirstname'} = $patron->firstname;
1019
                      $needsconfirmation{RESERVE_WAITING} = 1;
1015
                    $needsconfirmation{'ressurname'} = $patron->surname;
1020
                      $needsconfirmation{'resfirstname'} = $patron->firstname;
1016
                    $needsconfirmation{'rescardnumber'} = $patron->cardnumber;
1021
                      $needsconfirmation{'ressurname'} = $patron->surname;
1017
                    $needsconfirmation{'resborrowernumber'} = $patron->borrowernumber;
1022
                      $needsconfirmation{'rescardnumber'} = $patron->cardnumber;
1018
                    $needsconfirmation{'resbranchcode'} = $patron->branchcode;
1023
                      $needsconfirmation{'resborrowernumber'} = $patron->borrowernumber;
1019
                    $needsconfirmation{'resreservedate'} = $res->{reservedate};
1024
                      $needsconfirmation{'resbranchcode'} = $res->{branchcode};
1020
                }
1025
                      $needsconfirmation{'reswaitingdate'} = $res->{'waitingdate'};
1021
            }
1026
                  }
1027
                  elsif ( $restype eq "Reserved" ) {
1028
                      # The item is on reserve for someone else.
1029
                      $needsconfirmation{RESERVED} = 1;
1030
                      $needsconfirmation{'resfirstname'} = $patron->firstname;
1031
                      $needsconfirmation{'ressurname'} = $patron->surname;
1032
                      $needsconfirmation{'rescardnumber'} = $patron->cardnumber;
1033
                      $needsconfirmation{'resborrowernumber'} = $patron->borrowernumber;
1034
                      $needsconfirmation{'resbranchcode'} = $patron->branchcode;
1035
                      $needsconfirmation{'resreservedate'} = $res->{reservedate};
1036
                  }
1037
              }
1038
           }
1022
        }
1039
        }
1023
    }
1040
    }
1024
1041
Lines 1377-1386 sub AddIssue { Link Here
1377
1394
1378
            # Check if a recall
1395
            # Check if a recall
1379
            if ( C4::Context->preference('UseRecalls') ) {
1396
            if ( C4::Context->preference('UseRecalls') ) {
1380
                my $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'}, borrowernumber => $borrower->{'borrowernumber'}, old => undef });
1397
               my $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'}, borrowernumber => $borrower->{'borrowernumber'}, status => 'W' });
1381
                if (defined $recall) {
1398
               if (defined $recall) {
1382
                    $recall->update({ status => "F", old => 1 });
1399
                   $recall->update({ status => 'F', old => 1 });
1383
                }
1400
               }
1384
            }
1401
            }
1385
1402
1386
            if ( C4::Context->preference('ReturnToShelvingCart') ) {
1403
            if ( C4::Context->preference('ReturnToShelvingCart') ) {
Lines 2034-2048 sub AddReturn { Link Here
2034
    my ($resfound, $resrec);
2051
    my ($resfound, $resrec);
2035
2052
2036
    # find recalls.....
2053
    # find recalls.....
2037
    my $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'}, old => undef });
2054
    my $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'}, status => 'R' });
2055
    my $waiting_recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'}, status => 'W' });
2038
    if (defined $recall){
2056
    if (defined $recall){
2039
        $messages->{'RecallFound'} = 1;
2057
        $messages->{'RecallFound'} = 1;
2040
        $messages->{'Recall'} = $recall;
2058
        $messages->{'Recall'} = $recall;
2059
    } elsif (defined $waiting_recall){
2060
        $messages->{'RecallFound'} = 1;
2061
        $messages->{'Recall'} = $waiting_recall;
2041
    } else {
2062
    } else {
2042
        # find reserves.....
2063
        # find reserves.....
2043
        # if we don't have a reserve with the status W, we launch the Checkreserves routine
2064
        # if we don't have a reserve with the status W, we launch the Checkreserves routine
2044
        my $lookahead= C4::Context->preference('ConfirmFutureHolds'); #number of days to look for future holds
2065
        my $lookahead= C4::Context->preference('ConfirmFutureHolds'); #number of days to look for future holds
2045
        ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->{'itemnumber'}, undef, $lookahead ) unless ( $item->{'withdrawn'} );
2066
        ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->{'itemnumber'}, undef, $lookahead ) unless ( $item->{'withdrawn'} );
2067
        warn $issue;
2068
        warn $resrec;
2046
        if ($resfound) {
2069
        if ($resfound) {
2047
            $resrec->{'ResFound'} = $resfound;
2070
            $resrec->{'ResFound'} = $resfound;
2048
            $messages->{'ResFound'} = $resrec;
2071
            $messages->{'ResFound'} = $resrec;
Lines 2692-2697 sub CanBookBeRenewed { Link Here
2692
    }
2715
    }
2693
    return ( 0, "on_reserve" ) if $resfound;    # '' when no hold was found
2716
    return ( 0, "on_reserve" ) if $resfound;    # '' when no hold was found
2694
2717
2718
    # check if item has been recalled. do a transfer if the recall branch is different to the item holding branch, otherwise don't do a transfer
2719
    my $recall = Koha::Recalls->find({ itemnumber => $itemnumber, status => 'R' });
2720
    my $recallfound;
2721
    if (defined $recall){
2722
       $recallfound = 1;
2723
    }
2724
    return ( 0, "recalled" ) if $recallfound;
2725
2695
    return ( 1, undef ) if $override_limit;
2726
    return ( 1, undef ) if $override_limit;
2696
2727
2697
    my $branchcode = _GetCircControlBranch( $item, $patron->unblessed );
2728
    my $branchcode = _GetCircControlBranch( $item, $patron->unblessed );
(-)a/C4/Letters.pm (+1 lines)
Lines 40-45 use Koha::Notice::Messages; Link Here
40
use Koha::DateUtils qw( format_sqldatetime dt_from_string );
40
use Koha::DateUtils qw( format_sqldatetime dt_from_string );
41
use Koha::Patrons;
41
use Koha::Patrons;
42
use Koha::Subscriptions;
42
use Koha::Subscriptions;
43
use Data::Dumper;
43
44
44
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
45
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
45
46
(-)a/C4/Overdues.pm (-1 / +10 lines)
Lines 38-43 use Koha::Account::Lines; Link Here
38
use Koha::Account::Offsets;
38
use Koha::Account::Offsets;
39
use Koha::IssuingRules;
39
use Koha::IssuingRules;
40
use Koha::Libraries;
40
use Koha::Libraries;
41
use Koha::Recalls;
41
42
42
use vars qw(@ISA @EXPORT);
43
use vars qw(@ISA @EXPORT);
43
44
Lines 255-261 sub CalcFine { Link Here
255
        # If chargeperiod_charge_at = 1, we charge a fine at the start of each charge period
256
        # If chargeperiod_charge_at = 1, we charge a fine at the start of each charge period
256
        # if chargeperiod_charge_at = 0, we charge at the end of each charge period
257
        # if chargeperiod_charge_at = 0, we charge at the end of each charge period
257
        $charge_periods = $issuing_rule->chargeperiod_charge_at == 1 ? ceil($charge_periods) : floor($charge_periods);
258
        $charge_periods = $issuing_rule->chargeperiod_charge_at == 1 ? ceil($charge_periods) : floor($charge_periods);
258
        $amount = $charge_periods * $issuing_rule->fine;
259
260
        # check if item has been recalled.
261
        my $currentrecall = Koha::Recalls->find({ itemnumber => $item->{itemnumber}, status => 'R' });
262
        if (defined $currentrecall) {
263
            $amount = $charge_periods * $issuing_rule->recall_overdue_fine;
264
        } else {
265
            $amount = $charge_periods * $issuing_rule->fine;
266
        }
267
259
    } # else { # a zero (or null) chargeperiod or negative units_minus_grace value means no charge. }
268
    } # else { # a zero (or null) chargeperiod or negative units_minus_grace value means no charge. }
260
269
261
    $amount = $issuing_rule->overduefinescap if $issuing_rule->overduefinescap && $amount > $issuing_rule->overduefinescap;
270
    $amount = $issuing_rule->overduefinescap if $issuing_rule->overduefinescap && $amount > $issuing_rule->overduefinescap;
(-)a/C4/Search.pm (-1 / +11 lines)
Lines 2146-2151 sub searchResults { Link Here
2146
                # is item on the reserve shelf?
2146
                # is item on the reserve shelf?
2147
                my $reservestatus = '';
2147
                my $reservestatus = '';
2148
2148
2149
                # is item a waiting recall?
2150
                my $recallstatus = '';
2151
2149
                unless ($item->{withdrawn}
2152
                unless ($item->{withdrawn}
2150
                        || $item->{itemlost}
2153
                        || $item->{itemlost}
2151
                        || $item->{damaged}
2154
                        || $item->{damaged}
Lines 2167-2172 sub searchResults { Link Here
2167
                    #
2170
                    #
2168
                    ($transfertwhen, $transfertfrom, $transfertto) = C4::Circulation::GetTransfers($item->{itemnumber});
2171
                    ($transfertwhen, $transfertfrom, $transfertto) = C4::Circulation::GetTransfers($item->{itemnumber});
2169
                    $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber} );
2172
                    $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber} );
2173
                    $recallstatus = Koha::Recalls->find({ itemnumber => $item->{itemnumber}, status => 'W' });
2170
                }
2174
                }
2171
2175
2172
                # item is withdrawn, lost, damaged, not for loan, reserved or in transit
2176
                # item is withdrawn, lost, damaged, not for loan, reserved or in transit
Lines 2175-2187 sub searchResults { Link Here
2175
                    || $item->{damaged}
2179
                    || $item->{damaged}
2176
                    || $item->{notforloan}
2180
                    || $item->{notforloan}
2177
                    || $reservestatus eq 'Waiting'
2181
                    || $reservestatus eq 'Waiting'
2182
                    || (defined $recallstatus)
2178
                    || ($transfertwhen ne ''))
2183
                    || ($transfertwhen ne ''))
2179
                {
2184
                {
2180
                    $withdrawn_count++        if $item->{withdrawn};
2185
                    $withdrawn_count++        if $item->{withdrawn};
2181
                    $itemlost_count++        if $item->{itemlost};
2186
                    $itemlost_count++        if $item->{itemlost};
2182
                    $itemdamaged_count++     if $item->{damaged};
2187
                    $itemdamaged_count++     if $item->{damaged};
2183
                    $item_in_transit_count++ if $transfertwhen ne '';
2188
                    $item_in_transit_count++ if $transfertwhen ne '';
2184
                    $item_onhold_count++     if $reservestatus eq 'Waiting';
2189
                    $item_onhold_count++     if (($reservestatus eq 'Waiting') || (defined $recallstatus));
2185
                    $item->{status} = $item->{withdrawn} . "-" . $item->{itemlost} . "-" . $item->{damaged} . "-" . $item->{notforloan};
2190
                    $item->{status} = $item->{withdrawn} . "-" . $item->{itemlost} . "-" . $item->{damaged} . "-" . $item->{notforloan};
2186
2191
2187
                    # can place a hold on a item if
2192
                    # can place a hold on a item if
Lines 2204-2209 sub searchResults { Link Here
2204
                    }
2209
                    }
2205
                    $other_items->{$key}->{intransit} = ( $transfertwhen ne '' ) ? 1 : 0;
2210
                    $other_items->{$key}->{intransit} = ( $transfertwhen ne '' ) ? 1 : 0;
2206
                    $other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0;
2211
                    $other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0;
2212
                    if (defined $recallstatus) {
2213
                        $recallstatus = 'W';
2214
                    }
2215
                    $other_items->{$key}->{onhold} = ($recallstatus) ? 1 : 0;
2216
2207
                    $other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan};
2217
                    $other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan};
2208
					$other_items->{$key}->{count}++ if $item->{$hbranch};
2218
					$other_items->{$key}->{count}++ if $item->{$hbranch};
2209
					$other_items->{$key}->{location} = $shelflocations->{ $item->{location} };
2219
					$other_items->{$key}->{location} = $shelflocations->{ $item->{location} };
(-)a/C4/XSLT.pm (-2 / +3 lines)
Lines 291-299 sub buildKohaItemsNamespace { Link Here
291
        my ( $transfertwhen, $transfertfrom, $transfertto ) = C4::Circulation::GetTransfers($item->{itemnumber});
291
        my ( $transfertwhen, $transfertfrom, $transfertto ) = C4::Circulation::GetTransfers($item->{itemnumber});
292
292
293
        my $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber} );
293
        my $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber} );
294
        my $recallstatus = Koha::Recalls->find({ itemnumber => $item->{itemnumber}, status => 'W'});
294
295
295
        if ( ( $item->{itype} && $itemtypes->{ $item->{itype} }->{notforloan} ) || $item->{notforloan} || $item->{onloan} || $item->{withdrawn} || $item->{itemlost} || $item->{damaged} ||
296
        if ( ( $item->{itype} && $itemtypes->{ $item->{itype} }->{notforloan} ) || $item->{notforloan} || $item->{onloan} || $item->{withdrawn} || $item->{itemlost} || $item->{damaged} ||
296
             (defined $transfertwhen && $transfertwhen ne '') || $item->{itemnotforloan} || (defined $reservestatus && $reservestatus eq "Waiting") ){ 
297
             (defined $transfertwhen && $transfertwhen ne '') || $item->{itemnotforloan} || (defined $reservestatus && $reservestatus eq "Waiting") || (defined $recallstatus)){
297
            if ( $item->{notforloan} < 0) {
298
            if ( $item->{notforloan} < 0) {
298
                $status = "On order";
299
                $status = "On order";
299
            } 
300
            } 
Lines 315-321 sub buildKohaItemsNamespace { Link Here
315
            if (defined $transfertwhen && $transfertwhen ne '') {
316
            if (defined $transfertwhen && $transfertwhen ne '') {
316
                $status = 'In transit';
317
                $status = 'In transit';
317
            }
318
            }
318
            if (defined $reservestatus && $reservestatus eq "Waiting") {
319
            if ((defined $reservestatus && $reservestatus eq "Waiting") || (defined $recallstatus)) {
319
                $status = 'Waiting';
320
                $status = 'Waiting';
320
            }
321
            }
321
        } else {
322
        } else {
(-)a/catalogue/detail.pl (-1 / +6 lines)
Lines 46-51 use Koha::ItemTypes; Link Here
46
use Koha::Patrons;
46
use Koha::Patrons;
47
use Koha::Virtualshelves;
47
use Koha::Virtualshelves;
48
use Koha::Recalls;
48
use Koha::Recalls;
49
use Data::Dumper;
49
50
50
my $query = CGI->new();
51
my $query = CGI->new();
51
52
Lines 334-343 foreach my $item (@items) { Link Here
334
        }
335
        }
335
    }
336
    }
336
337
337
    my $recall = Koha::Recalls->find({ itemnumber => $item->{itemnumber}, old => undef });
338
    my $recall = Koha::Recalls->find({ itemnumber => $item->{itemnumber}, status => 'R' });
339
    my $waiting_recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'}, status => 'W' });
338
    if (defined $recall){
340
    if (defined $recall){
339
        $item->{recalled} = 1;
341
        $item->{recalled} = 1;
340
        $item->{recall} = $recall;
342
        $item->{recall} = $recall;
343
    } elsif (defined $waiting_recall) {
344
        $item->{recalled} = 1;
345
        $item->{recall} = $waiting_recall;
341
    }
346
    }
342
347
343
    if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET"
348
    if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET"
(-)a/circ/recall-pickup-slip.pl (+88 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
4
# Copyright 2018 Catalyst IT
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 3 of the License, or
11
# (at your option) any later version.
12
#
13
# Koha is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
21
use Modern::Perl;
22
use C4::Context;
23
use C4::Output;
24
use CGI qw ( -utf8 );
25
use C4::Auth qw/:DEFAULT get_session/;
26
use Koha::Recall;
27
use Koha::Recalls;
28
use C4::Letters;
29
use C4::Message;
30
use Data::Dumper;
31
use Koha::Patrons;
32
use Koha::Items;
33
use Koha::Biblios;
34
use Koha::Libraries;
35
use vars qw($debug);
36
37
BEGIN {
38
    $debug = $ENV{DEBUG} || 0;
39
}
40
41
my $input = new CGI;
42
my $sessionID = $input->cookie("CGISESSID");
43
my $session = get_session($sessionID);
44
45
my $borrowernumber = $input->param('borrowernumber');
46
my $biblionumber = $input->param('biblionumber');
47
my $itemnumber = $input->param('itemnumber');
48
my $recallid = $input->param('recall_id');
49
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
50
    {
51
        template_name   => "circ/recall-pickup-slip.tt",
52
        query           => $input,
53
        type            => "intranet",
54
        authnotrequired => 0,
55
        flagsrequired   => { circulate => "circulate_remaining_permissions" },
56
        debug           => $debug,
57
    }
58
);
59
60
my $recall = Koha::Recalls->find($recallid);
61
my $patron = Koha::Patrons->find($borrowernumber);
62
my $item = Koha::Items->find($recall->itemnumber);
63
my $biblio = Koha::Biblios->find($item->biblionumber);
64
my $library = Koha::Libraries->find($recall->branchcode);
65
66
#Print slip to inform library staff of details of recall requester, so the item can be put aside for requester
67
my ($slip, $is_html);
68
my $letter = C4::Letters::GetPreparedLetter (
69
    module => 'circulation',
70
    letter_code => 'RECALL_REQUESTER_DET',
71
    tables => {
72
         'branches' => $library->branchcode,
73
         'borrowers' => $patron->borrowernumber,
74
         'biblio'   => $biblio->biblionumber,
75
         'items'   => $item->itemnumber,
76
         'recalls'  => $recall->recall_id
77
    }
78
);
79
80
if ($letter) {
81
    $slip = $letter->{content};
82
    $is_html = $letter->{is_html};
83
}
84
85
$template->param( slip => $slip ) if ($slip);
86
$template->param( plain => !$is_html );
87
88
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/circ/returns.pl (-2 / +20 lines)
Lines 89-94 if ( $query->param('print_slip') ) { Link Here
89
    );
89
    );
90
}
90
}
91
91
92
if ( $query->param('print_recall_slip') ) {
93
    $template->param(
94
        print_recall_slip     => 1,
95
        borrowernumber => scalar $query->param('borrowernumber'),
96
        biblionumber   => scalar $query->param('biblionumber'),
97
        itemnumber     => scalar $query->param('itemnumber'),
98
        recall_id      => scalar $query->param('recall_id')
99
    );
100
}
101
92
#####################
102
#####################
93
#Global vars
103
#Global vars
94
my $printers = GetPrinters();
104
my $printers = GetPrinters();
Lines 513-526 if ( $messages->{'ResFound'}) { Link Here
513
523
514
if ( $messages->{'RecallFound'} ){
524
if ( $messages->{'RecallFound'} ){
515
    my $recall = $messages->{'Recall'};
525
    my $recall = $messages->{'Recall'};
526
    warn $userenv_branch;
527
    warn $recall->branchcode;
528
    my $transfer_recall;
529
    if ($userenv_branch  eq $recall->branchcode) {
530
        $transfer_recall = 0;
531
    } else {
532
        $transfer_recall = 1;
533
    }
516
    my $patron = Koha::Patrons->find( $recall->borrowernumber );
534
    my $patron = Koha::Patrons->find( $recall->borrowernumber );
517
    $template->param(
535
    $template->param(
518
        patron   => $patron,
536
        patron   => $patron,
519
        found    => 1,
537
        found    => 1,
520
        recalled => 1,
538
        recalled => 1,
521
        recall   => $recall,
539
        recall   => $recall,
522
        transfer_recall => ($userenv_branch eq $recall->branchcode ? 1 : 0 )
540
        transfer_recall => $transfer_recall,
523
#       address   => $patron->address,
541
        address   => $patron->address,
524
#       address2  => $patron->address2,
542
#       address2  => $patron->address2,
525
#       streetnumber => $patron->streetnumber,
543
#       streetnumber => $patron->streetnumber,
526
#       city         => $patron->city,
544
#       city         => $patron->city,
(-)a/installer/data/mysql/atomicupdate/bug_19532_-_alter_recalls_table_date_datatypes.sql (+2 lines)
Line 0 Link Here
1
ALTER TABLE recalls MODIFY column waitingdate datetime;
2
ALTER TABLE recalls MODIFY column expirationdate datetime;
(-)a/installer/data/mysql/atomicupdate/bug_19532_recall_requester_details_notice.sql (+1 lines)
Line 0 Link Here
1
insert into letter (module, code, name, is_html, title, content, message_transport_type, lang) values ('circulation', 'RECALL_REQUESTER_DET', 'Details of patron who recalled item', 0, 'Details of patorn who recalled item',  '<h5>Date: <<today>></h5><h3> Recall for pickup at <<branches.branchname>></h3><h3><<borrowers.surname>>, <<borrowers.firstname>></h3><ul><li><<borrowers.cardnumber>></li><li><<borrowers.phone>></li><li><<borrowers.address>><br /><<borrowers.address2>><br /><<borrowers.city >><<borrowers.zipcode>></li><li><<borrowers.email>></li></ul><br /><h3>ITEM RECALLED</h3><h4><<biblio.title>></h4><h5><<biblio.author>></h5><ul><li><<items.barcode>></li><li><<items.itemcallnumber>></li><li><<recalls.waitingdate>></li></ul><p>Notes:<pre><<recalls.recallnotes>></pre></p>', 'email', default);
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls-reports.inc (-5 / +5 lines)
Lines 58-75 Link Here
58
                    </td>
58
                    </td>
59
59
60
                    <td class="recall-waiting">
60
                    <td class="recall-waiting">
61
                        [% IF recall.waitingdate %][% recall.waitingdate | $KohaDates %][% ELSE %]Not waiting[% END %]
61
                        [% IF recall.waitingdate %][% recall.waitingdate %][% ELSE %]Not waiting[% END %]
62
                    </td>
62
                    </td>
63
63
64
                    <td class="recall-expiry">
64
                    <td class="recall-expiry">
65
                        [% IF ( recall.is_waiting ) %]
65
                        [% IF ( recall.is_waiting ) %]
66
                            [% IF ( recall.expirationdate ) %]
66
                            [% IF ( recall.expirationdate ) %]
67
                                [% recall.expirationdate | $KohaDates %]
67
                                [% recall.expirationdate  %]
68
                            [% ELSE %]
68
                            [% ELSE %]
69
                                Never expires
69
                                Never expires
70
                            [% END %]
70
                            [% END %]
71
                        [% ELSIF ( recall.has_expired && recall.expirationdate ) %]
71
                        [% ELSIF ( recall.has_expired && recall.expirationdate ) %]
72
                            [% recall.expirationdate | $KohaDates %]
72
                            [% recall.expirationdate %]
73
                        [% ELSE %]
73
                        [% ELSE %]
74
                            -
74
                            -
75
                        [% END %]
75
                        [% END %]
Lines 97-105 Link Here
97
97
98
                    <td class="recall-due_date">
98
                    <td class="recall-due_date">
99
                        [% IF ( recall.is_requested ) %]
99
                        [% IF ( recall.is_requested ) %]
100
                            Due to be returned by [% recall.checkout.date_due | $KohaDates %]
100
                            Due to be returned by [% recall.checkout.date_due %]
101
                        [% ELSIF ( recall.is_waiting && recall.expirationdate ) %]
101
                        [% ELSIF ( recall.is_waiting && recall.expirationdate ) %]
102
                            Pick up by [% recall.expirationdate | $KohaDates %]
102
                            Pick up by [% recall.expirationdate %]
103
                        [% ELSE %]
103
                        [% ELSE %]
104
                            -
104
                            -
105
                        [% END %]
105
                        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-3 / +2 lines)
Lines 95-103 Link Here
95
                <th>Holds per record (count)</th>
95
                <th>Holds per record (count)</th>
96
                <th>On shelf holds allowed</th>
96
                <th>On shelf holds allowed</th>
97
                <th>Item level holds</th>
97
                <th>Item level holds</th>
98
                <th>Recall due date interval (days)</th>
98
                <th>Recall due date interval</th>
99
                <th>Recall overdue fine amount</th>
99
                <th>Recall overdue fine amount</th>
100
                <th>Recall pickup period (days)</th>
100
                <th>Recall pickup period</th>
101
                <th>Article requests</th>
101
                <th>Article requests</th>
102
                <th>Rental discount (%)</th>
102
                <th>Rental discount (%)</th>
103
                <th>Actions</th>
103
                <th>Actions</th>
Lines 214-220 Link Here
214
                                                                <span>Don't allow</span>
214
                                                                <span>Don't allow</span>
215
                                                            [% END %]
215
                                                            [% END %]
216
                                                        </td>
216
                                                        </td>
217
                                                        <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
218
                                                        <td>[% rule.recall_due_date_interval %]</td>
217
                                                        <td>[% rule.recall_due_date_interval %]</td>
219
                                                        <td>[% rule.recall_overdue_fine FILTER format("%.2f") %]</td>
218
                                                        <td>[% rule.recall_overdue_fine FILTER format("%.2f") %]</td>
220
                                                        <td>[% rule.recall_shelf_time %]</td>
219
                                                        <td>[% rule.recall_shelf_time %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt (+8 lines)
Lines 70-75 Link Here
70
                        <a class="circ-button" href="/cgi-bin/koha/circ/reserveratios.pl"><i class="fa fa-line-chart"></i> Hold ratios</a>
70
                        <a class="circ-button" href="/cgi-bin/koha/circ/reserveratios.pl"><i class="fa fa-line-chart"></i> Hold ratios</a>
71
                    </li>
71
                    </li>
72
                </ul>
72
                </ul>
73
                [% IF Koha.Preference('UseRecalls') %]
74
                    <h3>Recalls</h3>
75
                        <ul class="buttons-list">
76
                            <li><a class="circ-button" href="/cgi-bin/koha/circ/recalls_queue.pl"><i class="fa fa-tasks"></i> Recalls queue</a></li>
77
                            <li><a class="circ-button" href="/cgi-bin/koha/circ/recalls_overdue.pl"><i class="fa fa-clock-o"></i> Overdue recalls</a></li>
78
                            <li><a class="circ-button" href="/cgi-bin/koha/circ/recalls_waiting.pl"><i class="fa fa-calendar"></i> Recalls awaiting pickup</a></li>
79
                        </ul>
80
                [% END %]
73
            </div>
81
            </div>
74
82
75
            <!-- Add the extra clearfix for only the required viewport -->
83
            <!-- Add the extra clearfix for only the required viewport -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+8 lines)
Lines 79-84 Link Here
79
    <div class="dialog alert">Staff members are not allowed to discharge borrowers, nor borrowers to request a discharge.</div>
79
    <div class="dialog alert">Staff members are not allowed to discharge borrowers, nor borrowers to request a discharge.</div>
80
[% END %]
80
[% END %]
81
81
82
82
[% IF ( NEEDSCONFIRMATION ) %]
83
[% IF ( NEEDSCONFIRMATION ) %]
83
<div class="yui-g">
84
<div class="yui-g">
84
85
Lines 313-318 Link Here
313
        [% IF ( INVALID_DATE ) %]
314
        [% IF ( INVALID_DATE ) %]
314
            <li>The due date &quot;[% INVALID_DATE | html %]&quot; is invalid</li>
315
            <li>The due date &quot;[% INVALID_DATE | html %]&quot; is invalid</li>
315
        [% END %]
316
        [% END %]
317
        [% IF ( WAITING_RECALL_FOR_A_DIFFERENT_PATRON ) %]
318
               <li>This item is awaiting pickup by another patron who recalled it.</li>
319
        [% END %]
320
321
        [% IF ( WAITING_RECALL_FOR_A_DIFFERENT_PATRON ) %]
322
            <li>This item is awaiting pickup by another patron who recalled it.</li>
323
        [% END %]
316
324
317
        [% IF ( UNKNOWN_BARCODE ) %]
325
        [% IF ( UNKNOWN_BARCODE ) %]
318
            <li>The barcode was not found: <span class="ex">[% barcode | html %]</span>
326
            <li>The barcode was not found: <span class="ex">[% barcode | html %]</span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recall-pickup-slip.tt (+26 lines)
Line 0 Link Here
1
[% USE Asset %]
2
[% USE Koha %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Circulation &rsaquo; Recall print receipt</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
8
[% Asset.css("css/print.css") %]
9
[% IF ( Koha.Preference('SlipCSS') ) %]
10
<link rel="stylesheet" type="text/css" href="[% Koha.Preference('SlipCSS') %]" />
11
[% END %]
12
13
[% INCLUDE 'slip-print.inc' #printThenClose %]
14
</head>
15
<body id="circ_printslip" class="circ">
16
<div id="receipt">
17
18
[% IF plain %]
19
<pre>
20
[% IF ( slip ) %][% slip %][% ELSE %]No slip template found[% END %]
21
</pre>
22
[% ELSE %]
23
[% IF ( slip ) %][% slip %][% ELSE %]No slip template found[% END %]
24
[% END %]
25
26
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_overdue.tt (-1 / +2 lines)
Lines 1-3 Link Here
1
[% USE Asset %]
1
[% USE Koha %]
2
[% USE Koha %]
2
[% USE KohaDates %]
3
[% USE KohaDates %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
Lines 5-11 Link Here
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
6
<style type="text/css"> p { margin-top: 0; }</style>
7
<style type="text/css"> p { margin-top: 0; }</style>
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
8
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
8
<script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls_[% KOHA_VERSION %].js"></script>
9
[% Asset.js("js/recalls.js") %]
9
[% INCLUDE 'datatables.inc' %]
10
[% INCLUDE 'datatables.inc' %]
10
[% INCLUDE 'columns_settings.inc' %]
11
[% INCLUDE 'columns_settings.inc' %]
11
</head>
12
</head>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_queue.tt (-1 / +2 lines)
Lines 1-3 Link Here
1
[% USE Asset %]
1
[% USE Koha %]
2
[% USE Koha %]
2
[% USE KohaDates %]
3
[% USE KohaDates %]
3
[% SET footerjs = 1 %]
4
[% SET footerjs = 1 %]
Lines 58-64 Link Here
58
[% MACRO jsinclude BLOCK %]
59
[% MACRO jsinclude BLOCK %]
59
    [% INCLUDE 'datatables.inc' %]
60
    [% INCLUDE 'datatables.inc' %]
60
    [% INCLUDE 'columns_settings.inc' %]
61
    [% INCLUDE 'columns_settings.inc' %]
61
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls_[% KOHA_VERSION %].js"></script>
62
    [% Asset.js("js/recalls.js") %]
62
    <script type="text/javascript">
63
    <script type="text/javascript">
63
    $(document).ready(function() {
64
    $(document).ready(function() {
64
            $(".old").hide();
65
            $(".old").hide();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_waiting.tt (-1 / +2 lines)
Lines 1-3 Link Here
1
[% USE Asset %]
1
[% USE Koha %]
2
[% USE Koha %]
2
[% USE KohaDates %]
3
[% USE KohaDates %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
Lines 5-11 Link Here
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
6
<style type="text/css"> p { margin-top: 0; }</style>
7
<style type="text/css"> p { margin-top: 0; }</style>
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
8
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
8
<script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls_[% KOHA_VERSION %].js"></script>
9
[% Asset.js("js/recalls.js") %]
9
[% INCLUDE 'datatables.inc' %]
10
[% INCLUDE 'datatables.inc' %]
10
<script type="text/javascript">
11
<script type="text/javascript">
11
    $(document).ready(function() {
12
    $(document).ready(function() {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt (+2 lines)
Lines 113-118 Link Here
113
                                    <button type="submit" class="approve"><i class="fa fa-check"></i> Override and renew</button>
113
                                    <button type="submit" class="approve"><i class="fa fa-check"></i> Override and renew</button>
114
                                </form>
114
                                </form>
115
115
116
                            [% ELSIF error == "recalled" %]
117
                                <p>This item has been recalled.</p>
116
                            [% ELSIF error == "patron_restricted" %]
118
                            [% ELSIF error == "patron_restricted" %]
117
119
118
                                <p>[% borrower.firstname | html %] [% borrower.surname | html %] ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber | uri %]"> [% borrower.cardnumber | html %] </a> ) is currently restricted.</p>
120
                                <p>[% borrower.firstname | html %] [% borrower.surname | html %] ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber | uri %]"> [% borrower.cardnumber | html %] </a> ) is currently restricted.</p>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +10 lines)
Lines 559-565 Link Here
559
                    <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
559
                    <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
560
                    <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
560
                    <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
561
                    <input type="hidden" name="recall_id" value="[% recall.recall_id %]" />
561
                    <input type="hidden" name="recall_id" value="[% recall.recall_id %]" />
562
                    <input type="hidden" name="transfer_recall" value="[% recall.branchcode %]" />
562
                    <input type="hidden" name="diffBranch" value="[% recall.branchcode %]" />
563
                    <input type="hidden" name="print_recall_slip" value="0" />
563
                </div>
564
                </div>
564
565
565
                <div class="modal-footer">
566
                <div class="modal-footer">
Lines 567-572 Link Here
567
                        <i class="fa fa-check"></i> Confirm recall [% IF transfer_recall %]and transfer[% END %]
568
                        <i class="fa fa-check"></i> Confirm recall [% IF transfer_recall %]and transfer[% END %]
568
                    </button>
569
                    </button>
569
570
571
                    <input type="hidden" name="print_slip" value="0" />
572
                    <button type="submit" class="btn btn-default print" onclick="this.form.print_recall_slip.value = 1; this.form.submit();">
573
                        <i class="fa fa-print"></i> Print and confirm
574
                    </button>
575
570
                    <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-danger deny" onclick="$('#barcode').focus(); return false;">
576
                    <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-danger deny" onclick="$('#barcode').focus(); return false;">
571
                        <i class="fa fa-times"></i> Ignore
577
                        <i class="fa fa-times"></i> Ignore
572
                    </button>
578
                    </button>
Lines 839-844 Link Here
839
                e.preventDefault();
845
                e.preventDefault();
840
                Dopop('hold-transfer-slip.pl?borrowernumber=[% patron.borrowernumber | html %]&amp;biblionumber=[% biblionumber | html %]');
846
                Dopop('hold-transfer-slip.pl?borrowernumber=[% patron.borrowernumber | html %]&amp;biblionumber=[% biblionumber | html %]');
841
            });
847
            });
848
            [% IF print_recall_slip %]
849
                Dopop('recall-pickup-slip.pl?borrowernumber=[% borrowernumber %]&amp;biblionumber=[% biblionumber %]&amp;recall_id=[% recall_id %]')    ;
850
            [% END %]
842
851
843
            [% IF print_slip %]
852
            [% IF print_slip %]
844
                Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber | html %]&amp;biblionumber=[% biblionumber | html %]&amp;itemnumber=[% itemnumber | html %]');
853
                Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber | html %]&amp;biblionumber=[% biblionumber | html %]&amp;itemnumber=[% itemnumber | html %]');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-2 / +2 lines)
Lines 662-668 Link Here
662
                                </li>
662
                                </li>
663
                            [% END %]
663
                            [% END %]
664
                            [% IF Koha.Preference('UseRecalls') && recalls.count %]
664
                            [% IF Koha.Preference('UseRecalls') && recalls.count %]
665
                                <li><a href="#recalls" id+"recalls-tab">[% recalls.count %] Recall(s)</a></li>
665
                                <li><a href="#recalls" id="recalls-tab">[% recalls.count %] Recall(s)</a></li>
666
                            [% END %]
666
                            [% END %]
667
                            [% IF Koha.Preference('ArticleRequests') %]
667
                            [% IF Koha.Preference('ArticleRequests') %]
668
                                <li>
668
                                <li>
Lines 780-786 Link Here
780
                                [% END %]
780
                                [% END %]
781
                            </div> [% # /div#reserves %]
781
                            </div> [% # /div#reserves %]
782
                        [% END %]
782
                        [% END %]
783
                        [% IF Koha.Preferernce('UseRecalls') && recalls.count %]
783
                        [% IF Koha.Preference('UseRecalls') && recalls.count %]
784
                            [% INCLUDE 'recalls.inc' %]
784
                            [% INCLUDE 'recalls.inc' %]
785
                        [% END %]
785
                        [% END %]
786
786
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt (-1 / +2 lines)
Lines 1-3 Link Here
1
[% USE Asset %]
1
[% USE KohaDates %]
2
[% USE KohaDates %]
2
[% USE Koha %]
3
[% USE Koha %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
Lines 5-11 Link Here
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
6
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7
[% INCLUDE 'datatables.inc' %]
8
[% INCLUDE 'datatables.inc' %]
8
<script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls_[% KOHA_VERSION %].js"></script>
9
[% Asset.js("js/recalls.js") %]
9
</head>
10
</head>
10
<body id="recalls_history" class="pat">
11
<body id="recalls_history" class="pat">
11
[% INCLUDE 'header.inc' %]
12
[% INCLUDE 'header.inc' %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt (-2 / +2 lines)
Lines 75-84 Link Here
75
                                    <td>[% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode ) | html %]</td>
75
                                    <td>[% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode ) | html %]</td>
76
                                    <td>[% cr.item.itemcallnumber | html %]</td>
76
                                    <td>[% cr.item.itemcallnumber | html %]</td>
77
                                    <td>[% cr.item.copynumber | html %]</td>
77
                                    <td>[% cr.item.copynumber | html %]</td>
78
                                    <td>[% INCLUDE 'item-status.inc' item=cr.item issue=cr.issue %]</td>
78
                                    <td>[% INCLUDE 'item-status.inc' item=cr.course_item issue=cr.issue %]</td>
79
                                    <td><span title="[% cr.issue.date_due | html %]">[% cr.issue.date_due | $KohaDates as_due_date => 1 | html %]</span></td>
79
                                    <td><span title="[% cr.issue.date_due | html %]">[% cr.issue.date_due | $KohaDates as_due_date => 1 | html %]</span></td>
80
                                    <td>[% IF ( cr.public_note ) %]
80
                                    <td>[% IF ( cr.public_note ) %]
81
                                            [% cr.public_note | html %]
81
                                        [% cr.public_note | html %]
82
                                        [% ELSIF ( cr.item.itemnotes ) %]
82
                                        [% ELSIF ( cr.item.itemnotes ) %]
83
                                            [% cr.item.itemnotes | html %]
83
                                            [% cr.item.itemnotes | html %]
84
                                        [% END %]
84
                                        [% END %]
(-)a/opac/opac-course-details.pl (+8 lines)
Lines 46-51 die("No course_id given") unless ($course_id); Link Here
46
my $course = GetCourse($course_id);
46
my $course = GetCourse($course_id);
47
my $course_reserves = GetCourseReserves( course_id => $course_id, include_items => 1, include_count => 1 );
47
my $course_reserves = GetCourseReserves( course_id => $course_id, include_items => 1, include_count => 1 );
48
48
49
foreach my $cr (@$course_reserves) {
50
    if ($cr->{'issue'}->{date_due} && $cr->{'issue'}->{borrowernumber} && $borrowernumber != $cr->{'issue'}->{borrowernumber} && C4::Context->preference('UseRecalls')) {
51
        $cr->{'course_item'}->{avail_for_recall} = 1;
52
    } else {
53
        $cr->{'course_item'}->{avail_for_recall} = 0;
54
    }
55
}
56
49
$template->param(
57
$template->param(
50
    course          => $course,
58
    course          => $course,
51
    course_reserves => $course_reserves,
59
    course_reserves => $course_reserves,
(-)a/opac/opac-detail.pl (-1 / +2 lines)
Lines 694-700 if ( not $viewallitems and @items > $max_items_to_display ) { Link Here
694
    }
694
    }
695
695
696
     my $reserve_status = C4::Reserves::GetReserveStatus($itm->{itemnumber});
696
     my $reserve_status = C4::Reserves::GetReserveStatus($itm->{itemnumber});
697
      if( $reserve_status eq "Waiting"){ $itm->{'waiting'} = 1; }
697
     my $waiting_recall_status = Koha::Recalls->find({ itemnumber => $itm->{itemnumber}, status => 'W' });
698
     if( $reserve_status eq "Waiting" || defined($waiting_recall_status) ){ $itm->{'waiting'} = 1; }
698
      if( $reserve_status eq "Reserved"){ $itm->{'onhold'} = 1; }
699
      if( $reserve_status eq "Reserved"){ $itm->{'onhold'} = 1; }
699
    
700
    
700
     my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber});
701
     my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber});
(-)a/opac/opac-recall.pl (-3 / +8 lines)
Lines 87-95 if ($op eq 'request'){ Link Here
87
            my $recall = Koha::Recalls->find($recall_request->recall_id);
87
            my $recall = Koha::Recalls->find($recall_request->recall_id);
88
            # updating due date on checkout
88
            # updating due date on checkout
89
            my $timestamp = dt_from_string($recall->timestamp);
89
            my $timestamp = dt_from_string($recall->timestamp);
90
            my $due_date = $timestamp->add( $issuing_rule->lengthunit => $issuing_rule->recall_due_date_interval );
90
            my $due_date;
91
            $checkout->update({ date_due => $due_date });
91
            if ( $issuing_rule->recall_due_date_interval eq '' ) {
92
            my $checkout_borrower = $checkout->patron;
92
                $due_date = $timestamp->add( $issuing_rule->lengthunit => 0 );
93
            } else {
94
                $due_date = $timestamp->add( $issuing_rule->lengthunit => $issuing_rule->recall_due_date_interval );
95
            }
96
            my $checkout = Koha::Checkouts->find({ itemnumber => $itemnumber })->update({ date_due => $due_date });
97
            my $checkout_borrower = Koha::Patrons->find($checkout->borrowernumber->borrowernumber);
93
98
94
            # send notice to user with recalled item checked out
99
            # send notice to user with recalled item checked out
95
            my $letter = C4::Letters::GetPreparedLetter (
100
            my $letter = C4::Letters::GetPreparedLetter (
(-)a/t/db_dependent/Koha/Recalls.t (-2 / +2 lines)
Lines 38-43 my $biblio = $builder->build( { source => 'Biblio' } ); Link Here
38
my $itemtype        = $builder->build( { source => 'Itemtype' } );
38
my $itemtype        = $builder->build( { source => 'Itemtype' } );
39
my $item            = $builder->build( { source => 'Item', value => { biblionumber => $biblio->{biblionumber}, itype => $itemtype->{itemtype}, holdingbranch => $library->{branchcode} } } );
39
my $item            = $builder->build( { source => 'Item', value => { biblionumber => $biblio->{biblionumber}, itype => $itemtype->{itemtype}, holdingbranch => $library->{branchcode} } } );
40
my $checkout        = $builder->build( { source => 'Issue', value => { borrowernumber => 5, itemnumber => $item->{itemnumber} } } );
40
my $checkout        = $builder->build( { source => 'Issue', value => { borrowernumber => 5, itemnumber => $item->{itemnumber} } } );
41
my $nb_of_recalls = Koha::Recalls->search->count;
41
42
42
# recall requested by second patron
43
# recall requested by second patron
43
my $recall = Koha::Recall->new({
44
my $recall = Koha::Recall->new({
Lines 50-56 my $recall = Koha::Recall->new({ Link Here
50
    itemtype => $item->{itype},
51
    itemtype => $item->{itype},
51
})->store;
52
})->store;
52
53
53
is( Koha::Recalls->search->count, 1, 'The one recall should be added' );
54
is( Koha::Recalls->search->count, $nb_of_recalls + 1, 'The one recall should have be added' );
54
is( $recall->is_requested, 1, 'Recall status is set to R, requested' );
55
is( $recall->is_requested, 1, 'Recall status is set to R, requested' );
55
56
56
$recall->update({ status => 'O' });
57
$recall->update({ status => 'O' });
57
- 

Return to bug 19532