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

(-)a/C4/Circulation.pm (-6 / +45 lines)
Lines 461-466 sub TooMany { Link Here
461
        }
461
        }
462
    );
462
    );
463
463
464
    my $default_priority_no_branch_no_cat_patron_maxissueqty = Koha::CirculationRules->get_effective_rule(
465
        {
466
            rule_name    => 'patron_maxissueqty',
467
            has_priority => 1,
468
        }
469
    );
470
    my $default_priority_no_branch_patron_maxissueqty = Koha::CirculationRules->get_effective_rule(
471
        {
472
            categorycode => $cat_borrower,
473
            rule_name    => 'patron_maxissueqty',
474
            has_priority => 1,
475
        }
476
    );
477
478
    my $default_priority_patron_maxissueqty = $default_priority_no_branch_patron_maxissueqty // $default_priority_no_branch_no_cat_patron_maxissueqty;
479
480
    $maxissueqty_rule = $default_priority_patron_maxissueqty ? $default_priority_patron_maxissueqty : $maxissueqty_rule;
481
482
    my $default_priority_no_branch_no_cat_patron_maxonsiteissueqty = Koha::CirculationRules->get_effective_rule(
483
        {
484
            rule_name    => 'patron_maxonsiteissueqty',
485
            has_priority => 1,
486
        }
487
    );
488
    my $default_priority_no_branch_patron_maxonsiteissueqty = Koha::CirculationRules->get_effective_rule(
489
        {
490
            categorycode => $cat_borrower,
491
            rule_name    => 'patron_maxonsiteissueqty',
492
            has_priority => 1,
493
        }
494
    );
495
496
    my $default_priority_patron_maxonsiteissueqty = $default_priority_no_branch_patron_maxonsiteissueqty // $default_priority_no_branch_no_cat_patron_maxonsiteissueqty;
497
464
    # if a rule is found and has a loan limit set, count
498
    # if a rule is found and has a loan limit set, count
465
    # how many loans the patron already has that meet that
499
    # how many loans the patron already has that meet that
466
    # rule
500
    # rule
Lines 534-548 sub TooMany { Link Here
534
        my $checkout_count = $sum_checkouts->{total} || 0;
568
        my $checkout_count = $sum_checkouts->{total} || 0;
535
        my $onsite_checkout_count = $sum_checkouts->{onsite_checkouts} || 0;
569
        my $onsite_checkout_count = $sum_checkouts->{onsite_checkouts} || 0;
536
570
571
        my $max_checkouts_allowed = $default_priority_patron_maxissueqty->rule_value // $maxissueqty_rule->rule_value;
572
        my $max_onsite_checkouts_allowed = $default_priority_patron_maxonsiteissueqty->rule_value // $maxonsiteissueqty_rule->rule_value;
573
        my $circulation_rule = $default_priority_patron_maxissueqty // $maxissueqty_rule;
574
        my $onsite_circulation_rule = $default_priority_patron_maxonsiteissueqty // $maxonsiteissueqty_rule;
575
537
        my $checkout_rules = {
576
        my $checkout_rules = {
538
            checkout_count               => $checkout_count,
577
            checkout_count               => $checkout_count,
539
            onsite_checkout_count        => $onsite_checkout_count,
578
            onsite_checkout_count        => $onsite_checkout_count,
540
            onsite_checkout              => $onsite_checkout,
579
            onsite_checkout              => $onsite_checkout,
541
            max_checkouts_allowed        => $maxissueqty_rule ? $maxissueqty_rule->rule_value : undef,
580
            max_checkouts_allowed        => $max_checkouts_allowed,
542
            max_onsite_checkouts_allowed => $maxonsiteissueqty_rule ? $maxonsiteissueqty_rule->rule_value : undef,
581
            max_onsite_checkouts_allowed => $max_onsite_checkouts_allowed,
543
            switch_onsite_checkout       => $switch_onsite_checkout,
582
            switch_onsite_checkout       => $switch_onsite_checkout,
544
            circulation_rule             => $maxissueqty_rule,
583
            circulation_rule             => $circulation_rule,
545
            onsite_circulation_rule      => $maxonsiteissueqty_rule,
584
            onsite_circulation_rule      => $onsite_circulation_rule,
546
        };
585
        };
547
        # If parent rules exists
586
        # If parent rules exists
548
        if ( defined($parent_maxissueqty_rule) and defined($parent_maxissueqty_rule->rule_value) ){
587
        if ( defined($parent_maxissueqty_rule) and defined($parent_maxissueqty_rule->rule_value) ){
Lines 581-588 sub TooMany { Link Here
581
620
582
        my $checkout_count = $checkouts->count;
621
        my $checkout_count = $checkouts->count;
583
        my $onsite_checkout_count = $checkouts->search({ onsite_checkout => 1 })->count;
622
        my $onsite_checkout_count = $checkouts->search({ onsite_checkout => 1 })->count;
584
        my $max_checkouts_allowed = $branch_borrower_circ_rule->{patron_maxissueqty};
623
        my $max_checkouts_allowed = $default_priority_patron_maxissueqty->rule_value ? $default_priority_patron_maxissueqty->rule_value : $branch_borrower_circ_rule->{patron_maxissueqty};
585
        my $max_onsite_checkouts_allowed = $branch_borrower_circ_rule->{patron_maxonsiteissueqty} || undef;
624
        my $max_onsite_checkouts_allowed = $default_priority_patron_maxonsiteissueqty->rule_value ? $default_priority_patron_maxonsiteissueqty->rule_value : $branch_borrower_circ_rule->{patron_maxonsiteissueqty};
586
625
587
        my $qty_over = _check_max_qty(
626
        my $qty_over = _check_max_qty(
588
            {
627
            {
(-)a/Koha/CirculationRules.pm (-5 / +22 lines)
Lines 216-221 our $RULE_KINDS = { Link Here
216
    holds_pickup_period => {
216
    holds_pickup_period => {
217
        scope => [ 'branchcode', 'categorycode', 'itemtype' ],
217
        scope => [ 'branchcode', 'categorycode', 'itemtype' ],
218
    },
218
    },
219
    has_priority => {
220
        scope => [ 'branchcode', 'categorycode' ],
221
    },
219
    # Not included (deprecated?):
222
    # Not included (deprecated?):
220
    #   * accountsent
223
    #   * accountsent
221
    #   * reservecharge
224
    #   * reservecharge
Lines 248-258 sub get_effective_rule { Link Here
248
    $params->{categorycode} //= undef;
251
    $params->{categorycode} //= undef;
249
    $params->{branchcode}   //= undef;
252
    $params->{branchcode}   //= undef;
250
    $params->{itemtype}     //= undef;
253
    $params->{itemtype}     //= undef;
254
    $params->{has_priority} //= undef;
251
255
252
    my $rule_name    = $params->{rule_name};
256
    my $rule_name    = $params->{rule_name};
253
    my $categorycode = $params->{categorycode};
257
    my $categorycode = $params->{categorycode};
254
    my $itemtype     = $params->{itemtype};
258
    my $itemtype     = $params->{itemtype};
255
    my $branchcode   = $params->{branchcode};
259
    my $branchcode   = $params->{branchcode};
260
    my $has_priority = $params->{has_priority};
256
261
257
    Koha::Exceptions::MissingParameter->throw(
262
    Koha::Exceptions::MissingParameter->throw(
258
        "Required parameter 'rule_name' missing")
263
        "Required parameter 'rule_name' missing")
Lines 271-276 sub get_effective_rule { Link Here
271
    $search_params->{categorycode} = defined $categorycode ? [ $categorycode, undef ] : undef;
276
    $search_params->{categorycode} = defined $categorycode ? [ $categorycode, undef ] : undef;
272
    $search_params->{itemtype}     = defined $itemtype     ? [ $itemtype, undef ] : undef;
277
    $search_params->{itemtype}     = defined $itemtype     ? [ $itemtype, undef ] : undef;
273
    $search_params->{branchcode}   = defined $branchcode   ? [ $branchcode,   undef ] : undef;
278
    $search_params->{branchcode}   = defined $branchcode   ? [ $branchcode,   undef ] : undef;
279
    $search_params->{has_priority} = defined $has_priority ? $has_priority : 0;
274
280
275
    my $rule = $self->search(
281
    my $rule = $self->search(
276
        $search_params,
282
        $search_params,
Lines 308-317 sub get_effective_rule_value { Link Here
308
    my $categorycode = $params->{categorycode};
314
    my $categorycode = $params->{categorycode};
309
    my $itemtype     = $params->{itemtype};
315
    my $itemtype     = $params->{itemtype};
310
    my $branchcode   = $params->{branchcode};
316
    my $branchcode   = $params->{branchcode};
311
317
    my $has_priority = $params->{has_priority};
312
    my $memory_cache = Koha::Cache::Memory::Lite->get_instance;
318
    my $memory_cache = Koha::Cache::Memory::Lite->get_instance;
313
    my $cache_key = sprintf "CircRules:%s:%s:%s:%s", $rule_name // q{},
319
    my $cache_key = sprintf "CircRules:%s:%s:%s:%s", $rule_name // q{},
314
      $categorycode // q{}, $branchcode // q{}, $itemtype // q{};
320
      $categorycode // q{}, $branchcode // q{}, $itemtype // q{} ,$has_priority // q{};
315
321
316
    my $cached       = $memory_cache->get_from_cache($cache_key);
322
    my $cached       = $memory_cache->get_from_cache($cache_key);
317
    return $cached if $cached;
323
    return $cached if $cached;
Lines 334-339 sub get_effective_rules { Link Here
334
    my $categorycode = $params->{categorycode};
340
    my $categorycode = $params->{categorycode};
335
    my $itemtype     = $params->{itemtype};
341
    my $itemtype     = $params->{itemtype};
336
    my $branchcode   = $params->{branchcode};
342
    my $branchcode   = $params->{branchcode};
343
    my $has_priority = $params->{has_priority};
337
344
338
    my $r;
345
    my $r;
339
    foreach my $rule (@$rules) {
346
    foreach my $rule (@$rules) {
Lines 343-348 sub get_effective_rules { Link Here
343
                categorycode => $categorycode,
350
                categorycode => $categorycode,
344
                itemtype     => $itemtype,
351
                itemtype     => $itemtype,
345
                branchcode   => $branchcode,
352
                branchcode   => $branchcode,
353
                has_priority => $has_priority,
346
            }
354
            }
347
        );
355
        );
348
356
Lines 386-391 sub set_rule { Link Here
386
    my $itemtype     = $params->{itemtype};
394
    my $itemtype     = $params->{itemtype};
387
    my $rule_name    = $params->{rule_name};
395
    my $rule_name    = $params->{rule_name};
388
    my $rule_value   = $params->{rule_value};
396
    my $rule_value   = $params->{rule_value};
397
    my $has_priority = $params->{has_priority};
398
389
    my $can_be_blank = defined $kind_info->{can_be_blank} ? $kind_info->{can_be_blank} : 1;
399
    my $can_be_blank = defined $kind_info->{can_be_blank} ? $kind_info->{can_be_blank} : 1;
390
    $rule_value = undef if defined $rule_value && $rule_value eq "" && !$can_be_blank;
400
    $rule_value = undef if defined $rule_value && $rule_value eq "" && !$can_be_blank;
391
    my $is_monetary = defined $kind_info->{is_monetary} ? $kind_info->{is_monetary} : 0;
401
    my $is_monetary = defined $kind_info->{is_monetary} ? $kind_info->{is_monetary} : 0;
Lines 407-412 sub set_rule { Link Here
407
    if ($rule) {
417
    if ($rule) {
408
        if ( defined $rule_value ) {
418
        if ( defined $rule_value ) {
409
            $rule->rule_value($rule_value);
419
            $rule->rule_value($rule_value);
420
            $rule->has_priority($has_priority);
410
            $rule->update();
421
            $rule->update();
411
        }
422
        }
412
        else {
423
        else {
Lines 422-427 sub set_rule { Link Here
422
                    itemtype     => $itemtype,
433
                    itemtype     => $itemtype,
423
                    rule_name    => $rule_name,
434
                    rule_name    => $rule_name,
424
                    rule_value   => $rule_value,
435
                    rule_value   => $rule_value,
436
                    has_priority => $has_priority,
425
                }
437
                }
426
            );
438
            );
427
            $rule->store();
439
            $rule->store();
Lines 444-453 sub set_rules { Link Here
444
    my ( $self, $params ) = @_;
456
    my ( $self, $params ) = @_;
445
457
446
    my %set_params;
458
    my %set_params;
447
    $set_params{branchcode} = $params->{branchcode} if exists $params->{branchcode};
459
    $set_params{branchcode} = $params->{branchcode}
448
    $set_params{categorycode} = $params->{categorycode} if exists $params->{categorycode};
460
      if exists $params->{branchcode};
461
    $set_params{categorycode} = $params->{categorycode}
462
      if exists $params->{categorycode};
449
    $set_params{itemtype} = $params->{itemtype} if exists $params->{itemtype};
463
    $set_params{itemtype} = $params->{itemtype} if exists $params->{itemtype};
450
    my $rules        = $params->{rules};
464
    $set_params{has_priority} = $params->{has_priority}
465
      if exists $params->{has_priority};
466
    my $rules = $params->{rules};
467
451
468
452
    my $rule_objects = [];
469
    my $rule_objects = [];
453
    while ( my ( $rule_name, $rule_value ) = each %$rules ) {
470
    while ( my ( $rule_name, $rule_value ) = each %$rules ) {
(-)a/admin/smart-rules.pl (-2 / +14 lines)
Lines 365-370 elsif ($op eq "cud-set-branch-defaults") { Link Here
365
    my $hold_fulfillment_policy = $input->param('hold_fulfillment_policy');
365
    my $hold_fulfillment_policy = $input->param('hold_fulfillment_policy');
366
    my $returnbranch  = $input->param('returnbranch');
366
    my $returnbranch  = $input->param('returnbranch');
367
    my $max_holds = strip_non_numeric( scalar $input->param('max_holds') );
367
    my $max_holds = strip_non_numeric( scalar $input->param('max_holds') );
368
    my $has_priority = $input->param('has_priority_defaults') ? 1 : 0;
368
369
369
    if ($branch eq "*") {
370
    if ($branch eq "*") {
370
        Koha::CirculationRules->set_rules(
371
        Koha::CirculationRules->set_rules(
Lines 382-387 elsif ($op eq "cud-set-branch-defaults") { Link Here
382
            {
383
            {
383
                categorycode => undef,
384
                categorycode => undef,
384
                branchcode   => undef,
385
                branchcode   => undef,
386
                has_priority => $has_priority,
385
                rules        => {
387
                rules        => {
386
                    patron_maxissueqty             => $patron_maxissueqty,
388
                    patron_maxissueqty             => $patron_maxissueqty,
387
                    patron_maxonsiteissueqty       => $patron_maxonsiteissueqty,
389
                    patron_maxonsiteissueqty       => $patron_maxonsiteissueqty,
Lines 404-409 elsif ($op eq "cud-set-branch-defaults") { Link Here
404
            {
406
            {
405
                categorycode => undef,
407
                categorycode => undef,
406
                branchcode   => $branch,
408
                branchcode   => $branch,
409
                has_priority => $has_priority,
407
                rules        => {
410
                rules        => {
408
                    patron_maxissueqty             => $patron_maxissueqty,
411
                    patron_maxissueqty             => $patron_maxissueqty,
409
                    patron_maxonsiteissueqty       => $patron_maxonsiteissueqty,
412
                    patron_maxonsiteissueqty       => $patron_maxonsiteissueqty,
Lines 427-432 elsif ($op eq "cud-add-branch-cat") { Link Here
427
    $patron_maxonsiteissueqty = strip_non_numeric($patron_maxonsiteissueqty);
430
    $patron_maxonsiteissueqty = strip_non_numeric($patron_maxonsiteissueqty);
428
    my $max_holds = $input->param('max_holds');
431
    my $max_holds = $input->param('max_holds');
429
    $max_holds = strip_non_numeric($max_holds);
432
    $max_holds = strip_non_numeric($max_holds);
433
    my $has_priority = $input->param('has_priority_by_cat') ? 1 : 0;
430
434
431
    if ($branch eq "*") {
435
    if ($branch eq "*") {
432
        if ($categorycode eq "*") {
436
        if ($categorycode eq "*") {
Lines 447-453 elsif ($op eq "cud-add-branch-cat") { Link Here
447
                    categorycode => $categorycode,
451
                    categorycode => $categorycode,
448
                    branchcode   => undef,
452
                    branchcode   => undef,
449
                    rules        => {
453
                    rules        => {
450
                        max_holds         => $max_holds,
454
                        max_holds => $max_holds,
455
                    }
456
                }
457
            );
458
            Koha::CirculationRules->set_rules(
459
                {
460
                    categorycode => $categorycode,
461
                    branchcode   => undef,
462
                    has_priority => $has_priority,
463
                    rules        => {
451
                        patron_maxissueqty       => $patron_maxissueqty,
464
                        patron_maxissueqty       => $patron_maxissueqty,
452
                        patron_maxonsiteissueqty => $patron_maxonsiteissueqty,
465
                        patron_maxonsiteissueqty => $patron_maxonsiteissueqty,
453
                    }
466
                    }
Lines 758-764 while ( my $r = $all_rules->next ) { Link Here
758
}
771
}
759
772
760
$template->param(show_branch_cat_rule_form => 1);
773
$template->param(show_branch_cat_rule_form => 1);
761
762
$template->param(
774
$template->param(
763
    used_categorycodes => \@used_categorycodes,
775
    used_categorycodes => \@used_categorycodes,
764
    used_itemtypes     => \@used_itemtypes,
776
    used_itemtypes     => \@used_itemtypes,
(-)a/installer/data/mysql/atomicupdate/Bug_8137-add-column-has_priority.pl (+13 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "8137",
5
    description => "Add column has_priority",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        $dbh->do('ALTER TABLE circulation_rules ADD IF NOT EXISTS has_priority INT(1) DEFAULT 0');
11
        say $out "Added column 'has_priority'";
12
    },
13
};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-13 / +28 lines)
Lines 622-627 Link Here
622
                        <table>
622
                        <table>
623
                            <tr>
623
                            <tr>
624
                                <th>&nbsp;</th>
624
                                <th>&nbsp;</th>
625
                                <th class="hasPriority">Priority checkouts rule</th>
625
                                <th>Total current checkouts allowed</th>
626
                                <th>Total current checkouts allowed</th>
626
                                <th>Total current on-site checkouts allowed</th>
627
                                <th>Total current on-site checkouts allowed</th>
627
                                <th>Maximum total holds allowed (count)</th>
628
                                <th>Maximum total holds allowed (count)</th>
Lines 637-642 Link Here
637
                            [% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, 'hold_fulfillment_policy', { want_rule => 1 }) %]
638
                            [% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, 'hold_fulfillment_policy', { want_rule => 1 }) %]
638
                            [% SET returnbranch = CirculationRules.Search( current_branch, undef, undef, 'returnbranch', { want_rule => 1 }) %]
639
                            [% SET returnbranch = CirculationRules.Search( current_branch, undef, undef, 'returnbranch', { want_rule => 1 }) %]
639
                            [% SET default_checkout_hold_and_return_policy = ( patron_maxissueqty || patron_maxonsiteissueqty || rule_value || holdallowed || hold_fulfillment_policy || returnbranch ) %]
640
                            [% SET default_checkout_hold_and_return_policy = ( patron_maxissueqty || patron_maxonsiteissueqty || rule_value || holdallowed || hold_fulfillment_policy || returnbranch ) %]
641
                            [% SET has_priority_defaults = patron_maxissueqty.has_priority && patron_maxonsiteissueqty.has_priority %]
640
                            <tr>
642
                            <tr>
641
                                <td>
643
                                <td>
642
                                    [% IF ( default_checkout_hold_and_return_policy ) %]
644
                                    [% IF ( default_checkout_hold_and_return_policy ) %]
Lines 647-652 Link Here
647
                                        Not set
649
                                        Not set
648
                                    [% END %]
650
                                    [% END %]
649
                                </td>
651
                                </td>
652
                                <td class="hasPriority">
653
                                    <input type="checkbox" name="has_priority_defaults" [% IF has_priority_defaults %]checked="checked"[% END %]/>
654
                                </td>
650
                                <td>
655
                                <td>
651
                                    <input type="text" name="patron_maxissueqty" size="9" value="[% patron_maxissueqty.rule_value | html %]" placeholder="Unlimited"/>
656
                                    <input type="text" name="patron_maxissueqty" size="9" value="[% patron_maxissueqty.rule_value | html %]" placeholder="Unlimited"/>
652
                                </td>
657
                                </td>
Lines 817-822 Link Here
817
                        <table>
822
                        <table>
818
                            <tr>
823
                            <tr>
819
                                <th>Patron category</th>
824
                                <th>Patron category</th>
825
                                <th class="hasPriority">Priority checkouts rule</th>
820
                                <th>Total current checkouts allowed</th>
826
                                <th>Total current checkouts allowed</th>
821
                                <th>Total current on-site checkouts allowed</th>
827
                                <th>Total current on-site checkouts allowed</th>
822
                                <th>Total holds allowed</th>
828
                                <th>Total holds allowed</th>
Lines 825-835 Link Here
825
                            [% FOREACH c IN categorycodes %]
831
                            [% FOREACH c IN categorycodes %]
826
                                [% NEXT UNLESS c %]
832
                                [% NEXT UNLESS c %]
827
                                [% SET i = undef %]
833
                                [% SET i = undef %]
828
                                [% SET patron_maxissueqty = all_rules.$c.$i.patron_maxissueqty %]
834
                                [% SET patron_maxissueqty = CirculationRules.Search( current_branch, c, undef, 'patron_maxissueqty', { want_rule => 1 } ) %]
829
                                [% SET patron_maxonsiteissueqty = all_rules.$c.$i.patron_maxonsiteissueqty %]
835
                                [% SET patron_maxonsiteissueqty = CirculationRules.Search( current_branch, c, undef, 'patron_maxonsiteissueqty', { want_rule => 1 } ) %]
830
                                [% SET max_holds = all_rules.$c.$i.max_holds %]
836
                                [% SET max_holds = CirculationRules.Search( current_branch, c, undef, 'max_holds', { want_rule => 1 } ) %]
831
837
                                [% SET has_priority_by_cat = patron_maxissueqty.has_priority && patron_maxonsiteissueqty.has_priority %]
832
                                [% IF  ( patron_maxissueqty.defined && patron_maxissueqty != '' ) || ( patron_maxonsiteissueqty.defined && patron_maxonsiteissueqty != '' ) || ( max_holds.defined && max_holds != '' ) %]
838
                                [% IF  ( patron_maxissueqty.rule_value && patron_maxissueqty.rule_value != '' ) || ( patron_maxonsiteissueqty.rule_value && patron_maxonsiteissueqty.rule_value != '' ) || ( max_holds.rule_value && max_holds.rule_value != '' ) %]
833
                                <tr>
839
                                <tr>
834
                                    <td>
840
                                    <td>
835
                                        [% IF c == undef %]
841
                                        [% IF c == undef %]
Lines 838-865 Link Here
838
                                            [% Categories.GetName(c) | html %]
844
                                            [% Categories.GetName(c) | html %]
839
                                        [% END %]
845
                                        [% END %]
840
                                    </td>
846
                                    </td>
847
                                    <td class="hasPriority">
848
                                        <input type="checkbox" name="has_priority_by_cat" [% IF has_priority_by_cat %]checked="checked"[% END %] disabled/>
849
                                    </td>
841
                                    <td>
850
                                    <td>
842
                                        [% IF patron_maxissueqty.defined && patron_maxissueqty != '' %]
851
                                        [% IF patron_maxissueqty.rule_value && patron_maxissueqty.rule_value != '' %]
843
                                            [% patron_maxissueqty | html %]
852
                                            [% patron_maxissueqty.rule_value | html %]
844
                                        [% ELSE %]
853
                                        [% ELSE %]
845
                                            <span>Unlimited</span>
854
                                            <span>Unlimited</span>
846
                                        [% END %]
855
                                        [% END %]
847
                                    </td>
856
                                    </td>
848
                                    <td>
857
                                    <td>
849
                                        [% IF patron_maxonsiteissueqty.defined && patron_maxonsiteissueqty != '' %]
858
                                        [% IF patron_maxonsiteissueqty.rule_value && patron_maxonsiteissueqty.rule_value != '' %]
850
                                            [% patron_maxonsiteissueqty | html %]
859
                                            [% patron_maxonsiteissueqty.rule_value | html %]
851
                                        [% ELSE %]
860
                                        [% ELSE %]
852
                                            <span>Unlimited</span>
861
                                            <span>Unlimited</span>
853
                                        [% END %]
862
                                        [% END %]
854
                                    </td>
863
                                    </td>
855
                                    <td>
864
                                    <td>
856
                                        [% IF max_holds.defined && max_holds != '' %]
865
                                        [% IF max_holds.rule_value && max_holds.rule_value != '' %]
857
                                            [% max_holds | html %]
866
                                            [% max_holds.rule_value | html %]
858
                                        [% ELSE %]
867
                                        [% ELSE %]
859
                                            <span>Unlimited</span>
868
                                            <span>Unlimited</span>
860
                                        [% END %]
869
                                        [% END %]
861
                                    </td>
870
                                    </td>
862
863
                                    <td class="actions">
871
                                    <td class="actions">
864
                                        <a href="#" class="delete-branch-cat btn btn-default btn-xs" data-categorycode="[% c | html %]" data-branch"[% current_branch | html %]"><i class="fa fa-trash-can"></i> Delete</a>
872
                                        <a href="#" class="delete-branch-cat btn btn-default btn-xs" data-categorycode="[% c | html %]" data-branch"[% current_branch | html %]"><i class="fa fa-trash-can"></i> Delete</a>
865
                                    </td>
873
                                    </td>
Lines 874-879 Link Here
874
                                    [% END %]
882
                                    [% END %]
875
                                    </select>
883
                                    </select>
876
                                </td>
884
                                </td>
885
                                <td class="hasPriority">
886
                                    <input type="checkbox" name="has_priority_by_cat"/>
887
                                </td>
877
                                <td><input name="patron_maxissueqty" size="3" type="text" /></td>
888
                                <td><input name="patron_maxissueqty" size="3" type="text" /></td>
878
                                <td><input name="patron_maxonsiteissueqty" size="3" type="text" /></td>
889
                                <td><input name="patron_maxonsiteissueqty" size="3" type="text" /></td>
879
                                <td><input name="max_holds" size="3" type="text" /></td>
890
                                <td><input name="max_holds" size="3" type="text" /></td>
Lines 1678-1683 Link Here
1678
                return f.submit();
1689
                return f.submit();
1679
            });
1690
            });
1680
1691
1692
            if($("#branch").val() != '*') {
1693
                $(".hasPriority").each(function() {
1694
                    $(this).remove();
1695
                });
1696
            }
1681
        });
1697
        });
1682
    </script>
1698
    </script>
1683
[% END %]
1699
[% END %]
1684
- 

Return to bug 8137