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

(-)a/C4/Circulation.pm (-12 / +30 lines)
Lines 31-36 use C4::Dates; Link Here
31
use C4::Calendar;
31
use C4::Calendar;
32
use C4::Accounts;
32
use C4::Accounts;
33
use C4::ItemCirculationAlertPreference;
33
use C4::ItemCirculationAlertPreference;
34
use C4::Dates qw(format_date);
34
use C4::Message;
35
use C4::Message;
35
use C4::Debug;
36
use C4::Debug;
36
use Date::Calc qw(
37
use Date::Calc qw(
Lines 412-418 sub TooMany { Link Here
412
413
413
        my $max_loans_allowed = $issuing_rule->{'maxissueqty'};
414
        my $max_loans_allowed = $issuing_rule->{'maxissueqty'};
414
        if ($current_loan_count >= $max_loans_allowed) {
415
        if ($current_loan_count >= $max_loans_allowed) {
415
            return "$current_loan_count / $max_loans_allowed";
416
            return ($current_loan_count, $max_loans_allowed);
416
        }
417
        }
417
    }
418
    }
418
419
Lines 440-446 sub TooMany { Link Here
440
441
441
        my $max_loans_allowed = $branch_borrower_circ_rule->{maxissueqty};
442
        my $max_loans_allowed = $branch_borrower_circ_rule->{maxissueqty};
442
        if ($current_loan_count >= $max_loans_allowed) {
443
        if ($current_loan_count >= $max_loans_allowed) {
443
            return "$current_loan_count / $max_loans_allowed";
444
            return ($current_loan_count, $max_loans_allowed);
444
        }
445
        }
445
    }
446
    }
446
447
Lines 747-758 sub CanBookBeIssued { Link Here
747
#
748
#
748
    # JB34 CHECKS IF BORROWERS DONT HAVE ISSUE TOO MANY BOOKS
749
    # JB34 CHECKS IF BORROWERS DONT HAVE ISSUE TOO MANY BOOKS
749
    #
750
    #
750
	my $toomany = TooMany( $borrower, $item->{biblionumber}, $item );
751
	my ($current_loan_count, $max_loans_allowed) = TooMany( $borrower, $item->{biblionumber}, $item );
751
    # if TooMany return / 0, then the user has no permission to check out this book
752
    # if TooMany max_loans_allowed returns 0 the user doesn't have permission to check out this book
752
    if ($toomany =~ /\/ 0/) {
753
    if ($max_loans_allowed eq 0) {
753
        $needsconfirmation{PATRON_CANT} = 1;
754
        $needsconfirmation{PATRON_CANT} = 1;
754
    } else {
755
    } else {
755
        $needsconfirmation{TOO_MANY} = $toomany if $toomany;
756
        if($max_loans_allowed){
757
            $needsconfirmation{TOO_MANY} = 1;
758
            $needsconfirmation{current_loan_count} = $current_loan_count;
759
            $needsconfirmation{max_loans_allowed} = $max_loans_allowed;
760
        }
756
    }
761
    }
757
762
758
    #
763
    #
Lines 835-842 sub CanBookBeIssued { Link Here
835
        my $currborinfo =    C4::Members::GetMemberDetails( $issue->{borrowernumber} );
840
        my $currborinfo =    C4::Members::GetMemberDetails( $issue->{borrowernumber} );
836
841
837
#        warn "=>.$currborinfo->{'firstname'} $currborinfo->{'surname'} ($currborinfo->{'cardnumber'})";
842
#        warn "=>.$currborinfo->{'firstname'} $currborinfo->{'surname'} ($currborinfo->{'cardnumber'})";
838
        $needsconfirmation{ISSUED_TO_ANOTHER} =
843
        $needsconfirmation{ISSUED_TO_ANOTHER} = 1;
839
"$currborinfo->{'reservedate'} : $currborinfo->{'firstname'} $currborinfo->{'surname'} ($currborinfo->{'cardnumber'})";
844
        $needsconfirmation{issued_firstname} = $currborinfo->{'firstname'};
845
        $needsconfirmation{issued_surname} = $currborinfo->{'surname'};
846
        $needsconfirmation{issued_cardnumber} = $currborinfo->{'cardnumber'};
847
        $needsconfirmation{issued_borrowernumber} = $currborinfo->{'borrowernumber'};
840
    }
848
    }
841
849
842
    # See if the item is on reserve.
850
    # See if the item is on reserve.
Lines 850-862 sub CanBookBeIssued { Link Here
850
        {
858
        {
851
            # The item is on reserve and waiting, but has been
859
            # The item is on reserve and waiting, but has been
852
            # reserved by some other patron.
860
            # reserved by some other patron.
853
            $needsconfirmation{RESERVE_WAITING} =
861
            $needsconfirmation{RESERVE_WAITING} = 1;
854
"$resborrower->{'firstname'} $resborrower->{'surname'} ($resborrower->{'cardnumber'}, $branchname)";
862
            $needsconfirmation{'resfirstname'} = $resborrower->{'firstname'};
863
            $needsconfirmation{'ressurname'} = $resborrower->{'surname'};
864
            $needsconfirmation{'rescardnumber'} = $resborrower->{'cardnumber'};
865
            $needsconfirmation{'resborrowernumber'} = $resborrower->{'borrowernumber'};
866
            $needsconfirmation{'resbranchname'} = $branchname;
867
            $needsconfirmation{'reswaitingdate'} = format_date($res->{'waitingdate'});
855
        }
868
        }
856
        elsif ( $restype eq "Reserved" ) {
869
        elsif ( $restype eq "Reserved" ) {
857
            # The item is on reserve for someone else.
870
            # The item is on reserve for someone else.
858
            $needsconfirmation{RESERVED} =
871
            $needsconfirmation{RESERVED} = 1;
859
"$res->{'reservedate'} : $resborrower->{'firstname'} $resborrower->{'surname'} ($resborrower->{'cardnumber'})";
872
            $needsconfirmation{'resfirstname'} = $resborrower->{'firstname'};
873
            $needsconfirmation{'ressurname'} = $resborrower->{'surname'};
874
            $needsconfirmation{'rescardnumber'} = $resborrower->{'cardnumber'};
875
            $needsconfirmation{'resborrowernumber'} = $resborrower->{'borrowernumber'};
876
            $needsconfirmation{'resbranchname'} = $branchname;
877
            $needsconfirmation{'resreservedate'} = format_date($res->{'reservedate'});
860
        }
878
        }
861
    }
879
    }
862
	return ( \%issuingimpossible, \%needsconfirmation );
880
	return ( \%issuingimpossible, \%needsconfirmation );
(-)a/C4/Reserves.pm (+1 lines)
Lines 1677-1682 sub _Findgroupreserve { Link Here
1677
        SELECT reserves.biblionumber               AS biblionumber,
1677
        SELECT reserves.biblionumber               AS biblionumber,
1678
               reserves.borrowernumber             AS borrowernumber,
1678
               reserves.borrowernumber             AS borrowernumber,
1679
               reserves.reservedate                AS reservedate,
1679
               reserves.reservedate                AS reservedate,
1680
               reserves.waitingdate                AS waitingdate,
1680
               reserves.branchcode                 AS branchcode,
1681
               reserves.branchcode                 AS branchcode,
1681
               reserves.cancellationdate           AS cancellationdate,
1682
               reserves.cancellationdate           AS cancellationdate,
1682
               reserves.found                      AS found,
1683
               reserves.found                      AS found,
(-)a/circ/circulation.pl (+1 lines)
Lines 298-303 if ($barcode) { Link Here
298
                $template->param(
298
                $template->param(
299
                    $needsconfirmation => $$question{$needsconfirmation},
299
                    $needsconfirmation => $$question{$needsconfirmation},
300
                    getTitleMessageIteminfo => $getmessageiteminfo->{'title'},
300
                    getTitleMessageIteminfo => $getmessageiteminfo->{'title'},
301
                    getBarcodeMessageIteminfo => $getmessageiteminfo->{'barcode'},
301
                    NEEDSCONFIRMATION  => 1
302
                    NEEDSCONFIRMATION  => 1
302
                );
303
                );
303
                $confirm_required = 1;
304
                $confirm_required = 1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl (-6 / +5 lines)
Lines 212-234 function refocus(calendar) { Link Here
212
<!-- /TMPL_IF -->
212
<!-- /TMPL_IF -->
213
213
214
<!-- TMPL_IF NAME="RENEW_ISSUE" -->
214
<!-- TMPL_IF NAME="RENEW_ISSUE" -->
215
    <li>Item is currently checked out to this patron.  Renew?</li>
215
    <li>Item <i><!-- TMPL_VAR NAME="getTitleMessageIteminfo" --></i> (<!-- TMPL_VAR NAME="getBarcodeMessageIteminfo" -->) is currently checked out to this patron.  Renew?</li>
216
<!-- /TMPL_IF -->
216
<!-- /TMPL_IF -->
217
217
218
<!-- TMPL_IF NAME="RESERVE_WAITING" -->
218
<!-- TMPL_IF NAME="RESERVE_WAITING" -->
219
    <li>Item is consigned for <!-- TMPL_VAR NAME="RESERVE_WAITING" --></li>
219
    <li>Item <i><!-- TMPL_VAR NAME="getTitleMessageIteminfo" --></i> (<!-- TMPL_VAR NAME="getBarcodeMessageIteminfo" -->) has been waiting for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="resborrowernumber" -->"><!-- TMPL_VAR NAME="resfirstname" --> <!-- TMPL_VAR NAME="ressurname" --></a> (<!-- TMPL_VAR NAME="rescardnumber" -->) at <!-- TMPL_VAR NAME="resbranchname" --> since <!-- TMPL_VAR NAME="reswaitingdate" --></li>
220
<!-- /TMPL_IF -->
220
<!-- /TMPL_IF -->
221
221
222
<!-- TMPL_IF NAME="RESERVED" -->
222
<!-- TMPL_IF NAME="RESERVED" -->
223
    <li>Item is on hold for <!-- TMPL_VAR NAME="RESERVED" --></li>
223
    <li>Item <i><!-- TMPL_VAR NAME="getTitleMessageIteminfo" --></i> (<!-- TMPL_VAR NAME="getBarcodeMessageIteminfo" -->) has been on hold for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="resborrowernumber" -->"><!-- TMPL_VAR NAME="resfirstname" --> <!-- TMPL_VAR NAME="ressurname" --></a> (<!-- TMPL_VAR NAME="rescardnumber" -->) at <!-- TMPL_VAR NAME="resbranchname" --> since <!-- TMPL_VAR NAME="resreservedate" --></li>
224
<!-- /TMPL_IF -->
224
<!-- /TMPL_IF -->
225
225
226
<!-- TMPL_IF NAME="ISSUED_TO_ANOTHER" -->
226
<!-- TMPL_IF NAME="ISSUED_TO_ANOTHER" -->
227
    <li>Item ( <!-- TMPL_VAR NAME="getTitleMessageIteminfo" --> ) checked out to <!-- TMPL_VAR NAME="ISSUED_TO_ANOTHER" -->. Check in and check out?</li>
227
    <li>Item <i><!-- TMPL_VAR NAME="getTitleMessageIteminfo" --></i> (<!-- TMPL_VAR NAME="getBarcodeMessageIteminfo" -->) is checked out to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="issued_borrowernumber" -->"><!-- TMPL_VAR NAME="issued_firstname" --> <!-- TMPL_VAR NAME="issued_surname" --></a> (<!-- TMPL_VAR NAME="issued_cardnumber" -->). Check in and check out?</li>
228
<!-- /TMPL_IF -->
228
<!-- /TMPL_IF -->
229
229
230
<!-- TMPL_IF NAME="TOO_MANY" -->
230
<!-- TMPL_IF NAME="TOO_MANY" -->
231
    <li>Too many checked out (already checked out / max : <!-- TMPL_VAR name="TOO_MANY" -->)</li>
231
    <li>Too many checked out. <!-- TMPL_VAR NAME="current_loan_count" --> checked out, only <!-- TMPL_VAR NAME="max_loans_allowed" --> are allowed.</li>
232
<!-- /TMPL_IF -->
232
<!-- /TMPL_IF -->
233
233
234
<!-- TMPL_IF NAME="BORRNOTSAMEBRANCH" -->
234
<!-- TMPL_IF NAME="BORRNOTSAMEBRANCH" -->
235
- 

Return to bug 4946