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

(-)a/C4/Circulation.pm (-5 / +13 lines)
Lines 477-482 sub TooMany { Link Here
477
                    reason => 'TOO_MANY_ONSITE_CHECKOUTS',
477
                    reason => 'TOO_MANY_ONSITE_CHECKOUTS',
478
                    count => $onsite_checkout_count,
478
                    count => $onsite_checkout_count,
479
                    max_allowed => $max_onsite_checkouts_allowed,
479
                    max_allowed => $max_onsite_checkouts_allowed,
480
                    issuing_rule => $issuing_rule,
480
                }
481
                }
481
            }
482
            }
482
        }
483
        }
Lines 487-492 sub TooMany { Link Here
487
                    reason => 'TOO_MANY_CHECKOUTS',
488
                    reason => 'TOO_MANY_CHECKOUTS',
488
                    count => $checkout_count,
489
                    count => $checkout_count,
489
                    max_allowed => $max_checkouts_allowed,
490
                    max_allowed => $max_checkouts_allowed,
491
                    issuing_rule => $issuing_rule,
490
                };
492
                };
491
            }
493
            }
492
        } elsif ( not $onsite_checkout ) {
494
        } elsif ( not $onsite_checkout ) {
Lines 495-500 sub TooMany { Link Here
495
                    reason => 'TOO_MANY_CHECKOUTS',
497
                    reason => 'TOO_MANY_CHECKOUTS',
496
                    count => $checkout_count - $onsite_checkout_count,
498
                    count => $checkout_count - $onsite_checkout_count,
497
                    max_allowed => $max_checkouts_allowed,
499
                    max_allowed => $max_checkouts_allowed,
500
                    issuing_rule => $issuing_rule,
498
                };
501
                };
499
            }
502
            }
500
        }
503
        }
Lines 531-536 sub TooMany { Link Here
531
                    reason => 'TOO_MANY_ONSITE_CHECKOUTS',
534
                    reason => 'TOO_MANY_ONSITE_CHECKOUTS',
532
                    count => $onsite_checkout_count,
535
                    count => $onsite_checkout_count,
533
                    max_allowed => $max_onsite_checkouts_allowed,
536
                    max_allowed => $max_onsite_checkouts_allowed,
537
                    issuing_rule => $issuing_rule,
534
                }
538
                }
535
            }
539
            }
536
        }
540
        }
Lines 541-546 sub TooMany { Link Here
541
                    reason => 'TOO_MANY_CHECKOUTS',
545
                    reason => 'TOO_MANY_CHECKOUTS',
542
                    count => $checkout_count,
546
                    count => $checkout_count,
543
                    max_allowed => $max_checkouts_allowed,
547
                    max_allowed => $max_checkouts_allowed,
548
                    issuing_rule => $issuing_rule,
544
                };
549
                };
545
            }
550
            }
546
        } elsif ( not $onsite_checkout ) {
551
        } elsif ( not $onsite_checkout ) {
Lines 549-561 sub TooMany { Link Here
549
                    reason => 'TOO_MANY_CHECKOUTS',
554
                    reason => 'TOO_MANY_CHECKOUTS',
550
                    count => $checkout_count - $onsite_checkout_count,
555
                    count => $checkout_count - $onsite_checkout_count,
551
                    max_allowed => $max_checkouts_allowed,
556
                    max_allowed => $max_checkouts_allowed,
557
                    issuing_rule => $issuing_rule,
552
                };
558
                };
553
            }
559
            }
554
        }
560
        }
555
    }
561
    }
556
562
557
    if ( not defined( $issuing_rule ) and not defined($branch_borrower_circ_rule->{maxissueqty}) ) {
563
    if ( not defined( $issuing_rule ) and not defined($branch_borrower_circ_rule->{maxissueqty}) ) {
558
        return { reason => 'NO_RULE_DEFINED', max_allowed => 0 };
564
        return { reason => 'NO_RULE_DEFINED', max_allowed => 0, issuing_rule => $issuing_rule };
559
    }
565
    }
560
566
561
    # OK, the patron can issue !!!
567
    # OK, the patron can issue !!!
Lines 842-854 sub CanBookBeIssued { Link Here
842
            $needsconfirmation{PATRON_CANT} = 1;
848
            $needsconfirmation{PATRON_CANT} = 1;
843
        }
849
        }
844
        if ( C4::Context->preference("AllowTooManyOverride") ) {
850
        if ( C4::Context->preference("AllowTooManyOverride") ) {
845
            $needsconfirmation{TOO_MANY} = $toomany->{reason};
851
            $needsconfirmation{TOO_MANY}           = $toomany->{reason};
846
            $needsconfirmation{current_loan_count} = $toomany->{count};
852
            $needsconfirmation{current_loan_count} = $toomany->{count};
847
            $needsconfirmation{max_loans_allowed} = $toomany->{max_allowed};
853
            $needsconfirmation{max_loans_allowed}  = $toomany->{max_allowed};
854
            $needsconfirmation{issuing_rule}       = $toomany->{issuing_rule};
848
        } else {
855
        } else {
849
            $issuingimpossible{TOO_MANY} = $toomany->{reason};
856
            $issuingimpossible{TOO_MANY}           = $toomany->{reason};
850
            $issuingimpossible{current_loan_count} = $toomany->{count};
857
            $issuingimpossible{current_loan_count} = $toomany->{count};
851
            $issuingimpossible{max_loans_allowed} = $toomany->{max_allowed};
858
            $issuingimpossible{max_loans_allowed}  = $toomany->{max_allowed};
859
            $issuingimpossible{issuing_rule}       = $toomany->{issuing_rule};
852
        }
860
        }
853
    }
861
    }
854
862
(-)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 1039-1041 No patron matched <span class="ex">[% message | html %]</span> Link Here
1039
    </div>
1051
    </div>
1040
</div>
1052
</div>
1041
[% INCLUDE 'intranet-bottom.inc' %]
1053
[% INCLUDE 'intranet-bottom.inc' %]
1042
- 
1054
1055
[% BLOCK issuing_rule_criteria %]
1056
    <ul>
1057
        <li>
1058
            Item type:
1059
            [% IF issuing_rule.itemtype == '*' %]
1060
                <i>All</i>
1061
            [% ELSE %]
1062
                [% ItemTypes.GetDescription( issuing_rule.itemtype ) %]
1063
            [% END %]
1064
        </li>
1065
        <li>
1066
            Patron category:
1067
            [% IF issuing_rule.categorycode == '*' %]
1068
                <i>All</i>
1069
            [% ELSE %]
1070
                [% Categories.GetName( issuing_rule.categorycode ) %]
1071
            [% END %]
1072
        </li>
1073
        <li>
1074
            Library:
1075
            [% IF issuing_rule.branchcode == '*' %]
1076
                <i>All libraries</i>
1077
            [% ELSE %]
1078
                [% Branches.GetName( issuing_rule.branchcode ) %]
1079
            [% END %]
1080
        </li>
1081
    </ul>
1082
[% END %]

Return to bug 18139