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

(-)a/C4/Circulation.pm (-5 / +13 lines)
Lines 478-483 sub TooMany { Link Here
478
                    reason => 'TOO_MANY_ONSITE_CHECKOUTS',
478
                    reason => 'TOO_MANY_ONSITE_CHECKOUTS',
479
                    count => $onsite_checkout_count,
479
                    count => $onsite_checkout_count,
480
                    max_allowed => $max_onsite_checkouts_allowed,
480
                    max_allowed => $max_onsite_checkouts_allowed,
481
                    issuing_rule => $issuing_rule,
481
                }
482
                }
482
            }
483
            }
483
        }
484
        }
Lines 488-493 sub TooMany { Link Here
488
                    reason => 'TOO_MANY_CHECKOUTS',
489
                    reason => 'TOO_MANY_CHECKOUTS',
489
                    count => $checkout_count,
490
                    count => $checkout_count,
490
                    max_allowed => $max_checkouts_allowed,
491
                    max_allowed => $max_checkouts_allowed,
492
                    issuing_rule => $issuing_rule,
491
                };
493
                };
492
            }
494
            }
493
        } elsif ( not $onsite_checkout ) {
495
        } elsif ( not $onsite_checkout ) {
Lines 496-501 sub TooMany { Link Here
496
                    reason => 'TOO_MANY_CHECKOUTS',
498
                    reason => 'TOO_MANY_CHECKOUTS',
497
                    count => $checkout_count - $onsite_checkout_count,
499
                    count => $checkout_count - $onsite_checkout_count,
498
                    max_allowed => $max_checkouts_allowed,
500
                    max_allowed => $max_checkouts_allowed,
501
                    issuing_rule => $issuing_rule,
499
                };
502
                };
500
            }
503
            }
501
        }
504
        }
Lines 532-537 sub TooMany { Link Here
532
                    reason => 'TOO_MANY_ONSITE_CHECKOUTS',
535
                    reason => 'TOO_MANY_ONSITE_CHECKOUTS',
533
                    count => $onsite_checkout_count,
536
                    count => $onsite_checkout_count,
534
                    max_allowed => $max_onsite_checkouts_allowed,
537
                    max_allowed => $max_onsite_checkouts_allowed,
538
                    issuing_rule => $issuing_rule,
535
                }
539
                }
536
            }
540
            }
537
        }
541
        }
Lines 542-547 sub TooMany { Link Here
542
                    reason => 'TOO_MANY_CHECKOUTS',
546
                    reason => 'TOO_MANY_CHECKOUTS',
543
                    count => $checkout_count,
547
                    count => $checkout_count,
544
                    max_allowed => $max_checkouts_allowed,
548
                    max_allowed => $max_checkouts_allowed,
549
                    issuing_rule => $issuing_rule,
545
                };
550
                };
546
            }
551
            }
547
        } elsif ( not $onsite_checkout ) {
552
        } elsif ( not $onsite_checkout ) {
Lines 550-562 sub TooMany { Link Here
550
                    reason => 'TOO_MANY_CHECKOUTS',
555
                    reason => 'TOO_MANY_CHECKOUTS',
551
                    count => $checkout_count - $onsite_checkout_count,
556
                    count => $checkout_count - $onsite_checkout_count,
552
                    max_allowed => $max_checkouts_allowed,
557
                    max_allowed => $max_checkouts_allowed,
558
                    issuing_rule => $issuing_rule,
553
                };
559
                };
554
            }
560
            }
555
        }
561
        }
556
    }
562
    }
557
563
558
    if ( not defined( $issuing_rule ) and not defined($branch_borrower_circ_rule->{maxissueqty}) ) {
564
    if ( not defined( $issuing_rule ) and not defined($branch_borrower_circ_rule->{maxissueqty}) ) {
559
        return { reason => 'NO_RULE_DEFINED', max_allowed => 0 };
565
        return { reason => 'NO_RULE_DEFINED', max_allowed => 0, issuing_rule => $issuing_rule };
560
    }
566
    }
561
567
562
    # OK, the patron can issue !!!
568
    # OK, the patron can issue !!!
Lines 843-855 sub CanBookBeIssued { Link Here
843
            $needsconfirmation{PATRON_CANT} = 1;
849
            $needsconfirmation{PATRON_CANT} = 1;
844
        }
850
        }
845
        if ( C4::Context->preference("AllowTooManyOverride") ) {
851
        if ( C4::Context->preference("AllowTooManyOverride") ) {
846
            $needsconfirmation{TOO_MANY} = $toomany->{reason};
852
            $needsconfirmation{TOO_MANY}           = $toomany->{reason};
847
            $needsconfirmation{current_loan_count} = $toomany->{count};
853
            $needsconfirmation{current_loan_count} = $toomany->{count};
848
            $needsconfirmation{max_loans_allowed} = $toomany->{max_allowed};
854
            $needsconfirmation{max_loans_allowed}  = $toomany->{max_allowed};
855
            $needsconfirmation{issuing_rule}       = $toomany->{issuing_rule};
849
        } else {
856
        } else {
850
            $issuingimpossible{TOO_MANY} = $toomany->{reason};
857
            $issuingimpossible{TOO_MANY}           = $toomany->{reason};
851
            $issuingimpossible{current_loan_count} = $toomany->{count};
858
            $issuingimpossible{current_loan_count} = $toomany->{count};
852
            $issuingimpossible{max_loans_allowed} = $toomany->{max_allowed};
859
            $issuingimpossible{max_loans_allowed}  = $toomany->{max_allowed};
860
            $issuingimpossible{issuing_rule}       = $toomany->{issuing_rule};
853
        }
861
        }
854
    }
862
    }
855
863
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-1 / +41 lines)
Lines 230-239 $(document).ready(function() { Link Here
230
230
231
[% IF TOO_MANY and TOO_MANY == 'TOO_MANY_CHECKOUTS' %]
231
[% IF TOO_MANY and TOO_MANY == 'TOO_MANY_CHECKOUTS' %]
232
    <li>Too many checked out. [% current_loan_count %] checked out, only [% max_loans_allowed %] are allowed.</li>
232
    <li>Too many checked out. [% current_loan_count %] checked out, only [% max_loans_allowed %] are allowed.</li>
233
    <li>
234
        Maximum checkouts calculated from the circulation rule for
235
        [% INCLUDE issuing_rule_criteria %]
236
    </li>
233
[% END %]
237
[% END %]
234
238
235
[% IF TOO_MANY and TOO_MANY == 'TOO_MANY_ONSITE_CHECKOUTS' %]
239
[% IF TOO_MANY and TOO_MANY == 'TOO_MANY_ONSITE_CHECKOUTS' %]
236
    <li>Too many on-site checked out. [% current_loan_count %] on-site checked out, only [% max_loans_allowed %] are allowed.</li>
240
    <li>Too many on-site checked out. [% current_loan_count %] on-site checked out, only [% max_loans_allowed %] are allowed.</li>
241
    <li>
242
        Maximum on-site checkouts calculated from the circulation rule for
243
        [% INCLUDE issuing_rule_criteria %]
244
    </li>
237
[% END %]
245
[% END %]
238
246
239
[% IF ( BORRNOTSAMEBRANCH ) %]
247
[% IF ( BORRNOTSAMEBRANCH ) %]
Lines 513-518 $(document).ready(function() { Link Here
513
521
514
        [% IF ( TOO_MANY ) %]
522
        [% IF ( TOO_MANY ) %]
515
            <li>Too many checked out. [% current_loan_count %] checked out, only [% max_loans_allowed %] are allowed.</li>
523
            <li>Too many checked out. [% current_loan_count %] checked out, only [% max_loans_allowed %] are allowed.</li>
524
            <li>
525
                Maximum checkouts calculated from the circulation rule for
526
                [% INCLUDE issuing_rule_criteria %]
527
            </li>
516
        [% END %]
528
        [% END %]
517
529
518
        [% IF ( ITEMNOTSAMEBRANCH ) %]
530
        [% IF ( ITEMNOTSAMEBRANCH ) %]
Lines 1027-1029 No patron matched <span class="ex">[% message | html %]</span> Link Here
1027
    </div>
1039
    </div>
1028
</div>
1040
</div>
1029
[% INCLUDE 'intranet-bottom.inc' %]
1041
[% INCLUDE 'intranet-bottom.inc' %]
1030
- 
1042
1043
[% BLOCK issuing_rule_criteria %]
1044
    <ul>
1045
        <li>
1046
            Item type:
1047
            [% IF issuing_rule.itemtype == '*' %]
1048
                <i>All</i>
1049
            [% ELSE %]
1050
                [% ItemTypes.GetDescription( issuing_rule.itemtype ) %]
1051
            [% END %]
1052
        </li>
1053
        <li>
1054
            Patron category:
1055
            [% IF issuing_rule.categorycode == '*' %]
1056
                <i>All</i>
1057
            [% ELSE %]
1058
                [% Categories.GetName( issuing_rule.categorycode ) %]
1059
            [% END %]
1060
        </li>
1061
        <li>
1062
            Library:
1063
            [% IF issuing_rule.branchcode == '*' %]
1064
                <i>All libraries</i>
1065
            [% ELSE %]
1066
                [% Branches.GetName( issuing_rule.branchcode ) %]
1067
            [% END %]
1068
        </li>
1069
    </ul>
1070
[% END %]

Return to bug 18139