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

(-)a/admin/smart-rules.pl (-3 / +148 lines)
Lines 75-80 $cache->clear_from_cache( Koha::CirculationRules::GUESSED_ITEMTYPES_KEY ); Link Here
75
if ($op eq 'delete') {
75
if ($op eq 'delete') {
76
    my $itemtype     = $input->param('itemtype');
76
    my $itemtype     = $input->param('itemtype');
77
    my $categorycode = $input->param('categorycode');
77
    my $categorycode = $input->param('categorycode');
78
    my $checkout_type = $input->param('checkout_type');
79
78
    $debug and warn "deleting $1 $2 $branch";
80
    $debug and warn "deleting $1 $2 $branch";
79
81
80
    Koha::CirculationRules->set_rules(
82
    Koha::CirculationRules->set_rules(
Lines 82-87 if ($op eq 'delete') { Link Here
82
            categorycode => $categorycode eq '*' ? undef : $categorycode,
84
            categorycode => $categorycode eq '*' ? undef : $categorycode,
83
            branchcode   => $branch eq '*' ? undef : $branch,
85
            branchcode   => $branch eq '*' ? undef : $branch,
84
            itemtype     => $itemtype eq '*' ? undef : $itemtype,
86
            itemtype     => $itemtype eq '*' ? undef : $itemtype,
87
            checkout_type => $checkout_type eq '*' ? undef : $checkout_type,
85
            rules        => {
88
            rules        => {
86
                maxissueqty                      => undef,
89
                maxissueqty                      => undef,
87
                rentaldiscount                   => undef,
90
                rentaldiscount                   => undef,
Lines 125-131 elsif ($op eq 'delete-branch-cat') { Link Here
125
                    categorycode => undef,
128
                    categorycode => undef,
126
                    rules        => {
129
                    rules        => {
127
                        max_holds                      => undef,
130
                        max_holds                      => undef,
128
                        patron_maxissueqty             => undef,
131
                    }
132
                }
133
            );
134
            Koha::CirculationRules->set_rules(
135
                {
136
                    branchcode   => undef,
137
                    categorycode => undef,
138
                    checkout_type => $Koha::Checkouts::type->{checkout},
139
                    rules        => {
140
                        patron_maxissueqty                      => undef,
141
                    }
142
                }
143
            );
144
            Koha::CirculationRules->set_rules(
145
                {
146
                    branchcode   => undef,
147
                    categorycode => undef,
148
                    checkout_type => $Koha::Checkouts::type->{onsite_checkout},
149
                    rules        => {
150
                        patron_maxissueqty       => undef,
129
                    }
151
                    }
130
                }
152
                }
131
            );
153
            );
Lines 147-152 elsif ($op eq 'delete-branch-cat') { Link Here
147
                    branchcode   => undef,
169
                    branchcode   => undef,
148
                    rules        => {
170
                    rules        => {
149
                        max_holds                => undef,
171
                        max_holds                => undef,
172
                    }
173
                }
174
            );
175
            Koha::CirculationRules->set_rules(
176
                {
177
                    categorycode => $categorycode,
178
                    branchcode   => undef,
179
                    checkout_type => $Koha::Checkouts::type->{checkout},
180
                    rules        => {
181
                        patron_maxissueqty       => undef,
182
                    }
183
                }
184
            );
185
            Koha::CirculationRules->set_rules(
186
                {
187
                    categorycode => $categorycode,
188
                    branchcode   => undef,
189
                    checkout_type => $Koha::Checkouts::type->{onsite_checkout},
190
                    rules        => {
150
                        patron_maxissueqty       => undef,
191
                        patron_maxissueqty       => undef,
151
                    }
192
                    }
152
                }
193
                }
Lines 157-162 elsif ($op eq 'delete-branch-cat') { Link Here
157
            {
198
            {
158
                branchcode   => $branch,
199
                branchcode   => $branch,
159
                categorycode => undef,
200
                categorycode => undef,
201
                checkout_type => $Koha::Checkouts::type->{checkout},
202
                rules        => {
203
                    patron_maxissueqty       => undef,
204
                }
205
            }
206
        );
207
        Koha::CirculationRules->set_rules(
208
            {
209
                branchcode   => $branch,
210
                categorycode => undef,
211
                checkout_type => $Koha::Checkouts::type->{onsite_checkout},
160
                rules        => {
212
                rules        => {
161
                    patron_maxissueqty       => undef,
213
                    patron_maxissueqty       => undef,
162
                }
214
                }
Lines 180-186 elsif ($op eq 'delete-branch-cat') { Link Here
180
                branchcode   => $branch,
232
                branchcode   => $branch,
181
                rules        => {
233
                rules        => {
182
                    max_holds         => undef,
234
                    max_holds         => undef,
183
                    patron_maxissueqty       => undef,
235
                }
236
            }
237
        );
238
        Koha::CirculationRules->set_rules(
239
            {
240
                categorycode => $categorycode,
241
                branchcode   => $branch,
242
                checkout_type => $Koha::Checkouts::type->{checkout},
243
                rules        => {
244
                    patron_maxissueqty => undef,
245
                }
246
            }
247
        );
248
        Koha::CirculationRules->set_rules(
249
            {
250
                categorycode => $categorycode,
251
                branchcode   => $branch,
252
                checkout_type => $Koha::Checkouts::type->{onsite_checkout},
253
                rules        => {
254
                    patron_maxissueqty => undef,
184
                }
255
                }
185
            }
256
            }
186
        );
257
        );
Lines 245-250 elsif ($op eq 'add') { Link Here
245
    my $br = $branch; # branch
316
    my $br = $branch; # branch
246
    my $bor  = $input->param('categorycode'); # borrower category
317
    my $bor  = $input->param('categorycode'); # borrower category
247
    my $itemtype  = $input->param('itemtype');     # item type
318
    my $itemtype  = $input->param('itemtype');     # item type
319
    my $checkout_type = $input->param('checkout_type');
248
    my $fine = $input->param('fine');
320
    my $fine = $input->param('fine');
249
    my $finedays     = $input->param('finedays');
321
    my $finedays     = $input->param('finedays');
250
    my $maxsuspensiondays = $input->param('maxsuspensiondays');
322
    my $maxsuspensiondays = $input->param('maxsuspensiondays');
Lines 320-325 elsif ($op eq 'add') { Link Here
320
            categorycode => $bor eq '*' ? undef : $bor,
392
            categorycode => $bor eq '*' ? undef : $bor,
321
            itemtype     => $itemtype eq '*' ? undef : $itemtype,
393
            itemtype     => $itemtype eq '*' ? undef : $itemtype,
322
            branchcode   => $br eq '*' ? undef : $br,
394
            branchcode   => $br eq '*' ? undef : $br,
395
            checkout_type => $checkout_type eq '*' ? undef : $checkout_type,
323
            rules        => $rules,
396
            rules        => $rules,
324
        }
397
        }
325
    );
398
    );
Lines 328-333 elsif ($op eq 'add') { Link Here
328
elsif ($op eq "set-branch-defaults") {
401
elsif ($op eq "set-branch-defaults") {
329
    my $categorycode  = $input->param('categorycode');
402
    my $categorycode  = $input->param('categorycode');
330
    my $patron_maxissueqty   = strip_non_numeric($input->param('patron_maxissueqty'));
403
    my $patron_maxissueqty   = strip_non_numeric($input->param('patron_maxissueqty'));
404
    my $patron_maxonsiteissueqty   = strip_non_numeric($input->param('patron_maxonsiteissueqty'));
331
    my $holdallowed   = $input->param('holdallowed');
405
    my $holdallowed   = $input->param('holdallowed');
332
    my $hold_fulfillment_policy = $input->param('hold_fulfillment_policy');
406
    my $hold_fulfillment_policy = $input->param('hold_fulfillment_policy');
333
    my $returnbranch  = $input->param('returnbranch');
407
    my $returnbranch  = $input->param('returnbranch');
Lines 351-361 elsif ($op eq "set-branch-defaults") { Link Here
351
            {
425
            {
352
                categorycode => undef,
426
                categorycode => undef,
353
                branchcode   => undef,
427
                branchcode   => undef,
428
                checkout_type => $Koha::Checkouts::type->{checkout},
354
                rules        => {
429
                rules        => {
355
                    patron_maxissueqty             => $patron_maxissueqty,
430
                    patron_maxissueqty             => $patron_maxissueqty,
356
                }
431
                }
357
            }
432
            }
358
        );
433
        );
434
        Koha::CirculationRules->set_rules(
435
            {
436
                categorycode => undef,
437
                branchcode   => undef,
438
                checkout_type => $Koha::Checkouts::type->{onsite_checkout},
439
                rules        => {
440
                    patron_maxissueqty             => $patron_maxonsiteissueqty,
441
                }
442
            }
443
        );
359
    } else {
444
    } else {
360
        Koha::CirculationRules->set_rules(
445
        Koha::CirculationRules->set_rules(
361
            {
446
            {
Lines 372-382 elsif ($op eq "set-branch-defaults") { Link Here
372
            {
457
            {
373
                categorycode => undef,
458
                categorycode => undef,
374
                branchcode   => $branch,
459
                branchcode   => $branch,
460
                checkout_type => $Koha::Checkouts::type->{checkout},
375
                rules        => {
461
                rules        => {
376
                    patron_maxissueqty             => $patron_maxissueqty,
462
                    patron_maxissueqty             => $patron_maxissueqty,
377
                }
463
                }
378
            }
464
            }
379
        );
465
        );
466
        Koha::CirculationRules->set_rules(
467
            {
468
                categorycode => undef,
469
                branchcode   => $branch,
470
                checkout_type => $Koha::Checkouts::type->{onsite_checkout},
471
                rules        => {
472
                    patron_maxissueqty             => $patron_maxonsiteissueqty,
473
                }
474
            }
475
        );
380
    }
476
    }
381
    Koha::CirculationRules->set_rule(
477
    Koha::CirculationRules->set_rule(
382
        {
478
        {
Lines 390-395 elsif ($op eq "set-branch-defaults") { Link Here
390
elsif ($op eq "add-branch-cat") {
486
elsif ($op eq "add-branch-cat") {
391
    my $categorycode  = $input->param('categorycode');
487
    my $categorycode  = $input->param('categorycode');
392
    my $patron_maxissueqty = strip_non_numeric($input->param('patron_maxissueqty'));
488
    my $patron_maxissueqty = strip_non_numeric($input->param('patron_maxissueqty'));
489
    my $patron_maxonsiteissueqty = strip_non_numeric($input->param('patron_maxonsiteissueqty'));
393
    my $max_holds = $input->param('max_holds');
490
    my $max_holds = $input->param('max_holds');
394
    $max_holds =~ s/\s//g;
491
    $max_holds =~ s/\s//g;
395
    $max_holds = undef if $max_holds !~ /^\d+/;
492
    $max_holds = undef if $max_holds !~ /^\d+/;
Lines 400-445 elsif ($op eq "add-branch-cat") { Link Here
400
                {
497
                {
401
                    categorycode => undef,
498
                    categorycode => undef,
402
                    branchcode   => undef,
499
                    branchcode   => undef,
500
                    checkout_type => $Koha::Checkouts::type->{checkout},
403
                    rules        => {
501
                    rules        => {
404
                        max_holds         => $max_holds,
502
                        max_holds         => $max_holds,
405
                        patron_maxissueqty       => $patron_maxissueqty,
503
                        patron_maxissueqty       => $patron_maxissueqty,
406
                    }
504
                    }
407
                }
505
                }
408
            );
506
            );
507
            Koha::CirculationRules->set_rules(
508
                {
509
                    categorycode => undef,
510
                    branchcode   => undef,
511
                    checkout_type => $Koha::Checkouts::type->{onsite_checkout},
512
                    rules        => {
513
                        max_holds         => $max_holds,
514
                        patron_maxissueqty       => $patron_maxonsiteissueqty,
515
                    }
516
                }
517
            );
409
        } else {
518
        } else {
410
            Koha::CirculationRules->set_rules(
519
            Koha::CirculationRules->set_rules(
411
                {
520
                {
412
                    categorycode => $categorycode,
521
                    categorycode => $categorycode,
413
                    branchcode   => undef,
522
                    branchcode   => undef,
523
                    checkout_type => $Koha::Checkouts::type->{checkout},
414
                    rules        => {
524
                    rules        => {
415
                        max_holds         => $max_holds,
525
                        max_holds         => $max_holds,
416
                        patron_maxissueqty       => $patron_maxissueqty,
526
                        patron_maxissueqty       => $patron_maxissueqty,
417
                    }
527
                    }
418
                }
528
                }
419
            );
529
            );
530
            Koha::CirculationRules->set_rules(
531
                {
532
                    categorycode => $categorycode,
533
                    branchcode   => undef,
534
                    checkout_type => $Koha::Checkouts::type->{onsite_checkout},
535
                    rules        => {
536
                        max_holds         => $max_holds,
537
                        patron_maxissueqty       => $patron_maxonsiteissueqty,
538
                    }
539
                }
540
            );
420
        }
541
        }
421
    } elsif ($categorycode eq "*") {
542
    } elsif ($categorycode eq "*") {
422
        Koha::CirculationRules->set_rules(
543
        Koha::CirculationRules->set_rules(
423
            {
544
            {
424
                categorycode => undef,
545
                categorycode => undef,
425
                branchcode   => $branch,
546
                branchcode   => $branch,
547
                checkout_type => $Koha::Checkouts::type->{checkout},
426
                rules        => {
548
                rules        => {
427
                    max_holds         => $max_holds,
549
                    max_holds         => $max_holds,
428
                    patron_maxissueqty       => $patron_maxissueqty,
550
                    patron_maxissueqty       => $patron_maxissueqty,
429
                }
551
                }
430
            }
552
            }
431
        );
553
        );
554
        Koha::CirculationRules->set_rules(
555
            {
556
                categorycode => undef,
557
                branchcode   => $branch,
558
                checkout_type => $Koha::Checkouts::type->{onsite_checkout},
559
                rules        => {
560
                    max_holds         => $max_holds,
561
                    patron_maxissueqty       => $patron_maxonsiteissueqty,
562
                }
563
            }
564
        );
432
    } else {
565
    } else {
433
        Koha::CirculationRules->set_rules(
566
        Koha::CirculationRules->set_rules(
434
            {
567
            {
435
                categorycode => $categorycode,
568
                categorycode => $categorycode,
436
                branchcode   => $branch,
569
                branchcode   => $branch,
570
                checkout_type => $Koha::Checkouts::type->{checkout},
437
                rules        => {
571
                rules        => {
438
                    max_holds         => $max_holds,
572
                    max_holds         => $max_holds,
439
                    patron_maxissueqty       => $patron_maxissueqty,
573
                    patron_maxissueqty       => $patron_maxissueqty,
440
                }
574
                }
441
            }
575
            }
442
        );
576
        );
577
        Koha::CirculationRules->set_rules(
578
            {
579
                categorycode => $categorycode,
580
                branchcode   => $branch,
581
                checkout_type => $Koha::Checkouts::type->{onsite_checkout},
582
                rules        => {
583
                    max_holds         => $max_holds,
584
                    patron_maxissueqty       => $patron_maxonsiteissueqty,
585
                }
586
            }
587
        );
443
    }
588
    }
444
}
589
}
445
elsif ($op eq "add-branch-item") {
590
elsif ($op eq "add-branch-item") {
Lines 549-555 my $definedbranch = $all_rules->count ? 1 : 0; Link Here
549
my $rules = {};
694
my $rules = {};
550
while ( my $r = $all_rules->next ) {
695
while ( my $r = $all_rules->next ) {
551
    $r = $r->unblessed;
696
    $r = $r->unblessed;
552
    $rules->{ $r->{categorycode} }->{ $r->{itemtype} }->{ $r->{rule_name} } = $r->{rule_value};
697
    $rules->{ $r->{categorycode} }->{ $r->{itemtype} }->{ $r->{checkout_type} }->{ $r->{rule_name} } = $r->{rule_value};
553
}
698
}
554
699
555
$template->param(show_branch_cat_rule_form => 1);
700
$template->param(show_branch_cat_rule_form => 1);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-188 / +235 lines)
Lines 5-10 Link Here
5
[% USE Branches %]
5
[% USE Branches %]
6
[% USE Categories %]
6
[% USE Categories %]
7
[% USE ItemTypes %]
7
[% USE ItemTypes %]
8
[% USE Checkouts %]
8
[% USE CirculationRules %]
9
[% USE CirculationRules %]
9
[% SET footerjs = 1 %]
10
[% SET footerjs = 1 %]
10
11
Lines 22-27 Link Here
22
[% END %]
23
[% END %]
23
[% itemtypes.push(undef) %]
24
[% itemtypes.push(undef) %]
24
25
26
[% SET checkout_types = [] %]
27
[% FOREACH ct IN Checkouts.type %]
28
    [% checkout_types.push( ct.value ) %]
29
[% END %]
30
[% checkout_types.push(undef) %]
31
25
[% INCLUDE 'doc-head-open.inc' %]
32
[% INCLUDE 'doc-head-open.inc' %]
26
<title>Koha &rsaquo; Administration &rsaquo; Circulation and fine rules</title>
33
<title>Koha &rsaquo; Administration &rsaquo; Circulation and fine rules</title>
27
[% INCLUDE 'doc-head-close.inc' %]
34
[% INCLUDE 'doc-head-close.inc' %]
Lines 88-93 Link Here
88
            <tr>
95
            <tr>
89
                <th>Patron category</th>
96
                <th>Patron category</th>
90
                <th>Item type</th>
97
                <th>Item type</th>
98
                <th>Checkout type</th>
91
                <th>Actions</th>
99
                <th>Actions</th>
92
                <th>Note</th>
100
                <th>Note</th>
93
                <th>Current checkouts allowed</th>
101
                <th>Current checkouts allowed</th>
Lines 125-302 Link Here
125
                    [% SET c = '' UNLESS c.defined %]
133
                    [% SET c = '' UNLESS c.defined %]
126
                    [% FOREACH i IN itemtypes %]
134
                    [% FOREACH i IN itemtypes %]
127
                        [% SET i = '' UNLESS i.defined %]
135
                        [% SET i = '' UNLESS i.defined %]
128
                        [% SET note = all_rules.$c.$i.note %]
136
                        [% FOREACH ct IN checkout_types %]
129
                        [% SET maxissueqty = all_rules.$c.$i.maxissueqty %]
137
                            [% SET ct = '' UNLESS ct.defined %]
130
                        [% SET issuelength = all_rules.$c.$i.issuelength %]
138
                            [% SET note = all_rules.$c.$i.$ct.note %]
131
                        [% SET lengthunit = all_rules.$c.$i.lengthunit %]
139
                            [% SET maxissueqty = all_rules.$c.$i.$ct.maxissueqty %]
132
                        [% SET hardduedate = all_rules.$c.$i.hardduedate %]
140
                            [% SET issuelength = all_rules.$c.$i.$ct.issuelength %]
133
                        [% SET hardduedatecompare = all_rules.$c.$i.hardduedatecompare %]
141
                            [% SET lengthunit = all_rules.$c.$i.$ct.lengthunit %]
134
                        [% SET fine = all_rules.$c.$i.fine %]
142
                            [% SET hardduedate = all_rules.$c.$i.$ct.hardduedate %]
135
                        [% SET chargeperiod = all_rules.$c.$i.chargeperiod %]
143
                            [% SET hardduedatecompare = all_rules.$c.$i.$ct.hardduedatecompare %]
136
                        [% SET chargeperiod_charge_at = all_rules.$c.$i.chargeperiod_charge_at %]
144
                            [% SET fine = all_rules.$c.$i.$ct.fine %]
137
                        [% SET firstremind = all_rules.$c.$i.firstremind %]
145
                            [% SET chargeperiod = all_rules.$c.$i.$ct.chargeperiod %]
138
                        [% SET overduefinescap = all_rules.$c.$i.overduefinescap %]
146
                            [% SET chargeperiod_charge_at = all_rules.$c.$i.$ct.chargeperiod_charge_at %]
139
                        [% SET cap_fine_to_replacement_price = all_rules.$c.$i.cap_fine_to_replacement_price %]
147
                            [% SET firstremind = all_rules.$c.$i.$ct.firstremind %]
140
                        [% SET finedays = all_rules.$c.$i.finedays %]
148
                            [% SET overduefinescap = all_rules.$c.$i.$ct.overduefinescap %]
141
                        [% SET maxsuspensiondays = all_rules.$c.$i.maxsuspensiondays %]
149
                            [% SET cap_fine_to_replacement_price = all_rules.$c.$i.$ct.cap_fine_to_replacement_price %]
142
                        [% SET suspension_chargeperiod = all_rules.$c.$i.suspension_chargeperiod %]
150
                            [% SET finedays = all_rules.$c.$i.$ct.finedays %]
143
                        [% SET renewalsallowed = all_rules.$c.$i.renewalsallowed %]
151
                            [% SET maxsuspensiondays = all_rules.$c.$i.$ct.maxsuspensiondays %]
144
                        [% SET renewalperiod = all_rules.$c.$i.renewalperiod %]
152
                            [% SET suspension_chargeperiod = all_rules.$c.$i.$ct.suspension_chargeperiod %]
145
                        [% SET norenewalbefore = all_rules.$c.$i.norenewalbefore %]
153
                            [% SET renewalsallowed = all_rules.$c.$i.$ct.renewalsallowed %]
146
                        [% SET auto_renew = all_rules.$c.$i.auto_renew %]
154
                            [% SET renewalperiod = all_rules.$c.$i.$ct.renewalperiod %]
147
                        [% SET no_auto_renewal_after = all_rules.$c.$i.no_auto_renewal_after %]
155
                            [% SET norenewalbefore = all_rules.$c.$i.$ct.norenewalbefore %]
148
                        [% SET no_auto_renewal_after_hard_limit = all_rules.$c.$i.no_auto_renewal_after_hard_limit %]
156
                            [% SET auto_renew = all_rules.$c.$i.$ct.auto_renew %]
149
                        [% SET reservesallowed = all_rules.$c.$i.reservesallowed %]
157
                            [% SET no_auto_renewal_after = all_rules.$c.$i.$ct.no_auto_renewal_after %]
150
                        [% SET holds_per_day = all_rules.$c.$i.holds_per_day %]
158
                            [% SET no_auto_renewal_after_hard_limit = all_rules.$c.$i.$ct.no_auto_renewal_after_hard_limit %]
151
                        [% SET holds_per_record = all_rules.$c.$i.holds_per_record %]
159
                            [% SET reservesallowed = all_rules.$c.$i.$ct.reservesallowed %]
152
                        [% SET onshelfholds = all_rules.$c.$i.onshelfholds %]
160
                            [% SET holds_per_day = all_rules.$c.$i.$ct.holds_per_day %]
153
                        [% SET opacitemholds = all_rules.$c.$i.opacitemholds %]
161
                            [% SET holds_per_record = all_rules.$c.$i.$ct.holds_per_record %]
154
                        [% SET article_requests = all_rules.$c.$i.article_requests %]
162
                            [% SET onshelfholds = all_rules.$c.$i.$ct.onshelfholds %]
155
                        [% SET rentaldiscount = all_rules.$c.$i.rentaldiscount %]
163
                            [% SET opacitemholds = all_rules.$c.$i.$ct.opacitemholds %]
156
164
                            [% SET article_requests = all_rules.$c.$i.$ct.article_requests %]
157
                        [% SET show_rule = maxissueqty || issuelength || lengthunit || hardduedate || hardduedatebefore || hardduedateexact || fine || chargeperiod || chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || suspension_chargeperiod || renewalsallowed || renewalsallowed || norenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || article_requests %]
165
                            [% SET rentaldiscount = all_rules.$c.$i.$ct.rentaldiscount %]
158
                        [% IF show_rule %]
166
                            [% SET show_rule = maxissueqty || issuelength || lengthunit || hardduedate || hardduedatebefore || hardduedateexact || fine || chargeperiod || chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || suspension_chargeperiod || renewalsallowed || renewalsallowed || norenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || article_requests %]
159
                            [% SET row_count = row_count + 1 %]
167
                            [% IF show_rule %]
160
                            <tr row_countd="row_[% row_count | html %]">
168
                                [% SET row_count = row_count + 1 %]
161
                                    <td>
169
                                <tr row_countd="row_[% row_count | html %]">
162
                                        [% IF c == undef %]
170
                                        <td>
163
                                            <em>All</em>
171
                                            [% IF c == undef %]
164
                                        [% ELSE %]
172
                                                <em>All</em>
165
                                            [% Categories.GetName(c) | html %]
173
                                            [% ELSE %]
166
                                        [% END %]
174
                                                [% Categories.GetName(c) | html %]
167
                                    </td>
175
                                            [% END %]
168
                                    <td>
176
                                        </td>
169
                                        [% IF i == undef %]
177
                                        <td>
170
                                            <em>All</em>
178
                                            [% IF i == undef %]
171
                                        [% ELSE %]
179
                                                <em>All</em>
172
                                            [% ItemTypes.GetDescription(i) | html %]
180
                                            [% ELSE %]
173
                                        [% END %]
181
                                                [% ItemTypes.GetDescription(i) | html %]
174
                                    </td>
182
                                            [% END %]
175
                                    <td class="actions">
183
                                        </td>
176
                                      <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
184
                                        <td>
177
                                      <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=[% i || '*' | html %]&amp;categorycode=[% c || '*' | html %]&amp;branch=[% current_branch | html %]"><i class="fa fa-trash"></i> Delete</a>
185
                                            [% IF ct == undef %]
178
                                    </td>
186
                                                <em>All</em>
179
                                    <td>
187
                                            [% ELSE %]
180
                                        [% IF note.defined && note != '' %]
188
                                                [% IF ct == 'CHECKOUT' %]
181
                                            <a name="viewnote" data-toggle="popover" title="Note" data-content="[% note | html %]" data-placement="top" data-trigger="hover">View note</a>
189
                                                    <em>Normal checkout</em>
182
                                        [% ELSE %]<span>&nbsp;</span>[% END %]
190
                                                [% ELSIF ct == 'ONSITE' %]
183
                                    </td>
191
                                                    <em>On-site checkout</em>
184
                                    <td>
192
                                                [% END %]
185
                                        [% IF maxissueqty.defined && maxissueqty != '' %]
193
                                            [% END %]
186
                                            [% maxissueqty | html %]
194
                                        </td>
187
                                        [% ELSE %]
195
                                        <td class="actions">
188
                                            <span>Unlimited</span>
196
                                          <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
189
                                        [% END %]
197
                                          <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=[% i || '*' | html %]&amp;categorycode=[% c || '*' | html %]&amp;branch=[% current_branch | html %]"><i class="fa fa-trash"></i> Delete</a>
190
                                    </td>
198
                                        </td>
191
                                    <td>[% issuelength | html %]</td>
199
                                        <td>
192
                                    <td>
200
                                            [% IF note.defined && note != '' %]
193
                                        [% IF ( lengthunit == 'days' ) %]
201
                                                <a name="viewnote" data-toggle="popover" title="Note" data-content="[% note | html %]" data-placement="top" data-trigger="hover">View note</a>
194
                                            Days
202
                                            [% ELSE %]<span>&nbsp;</span>[% END %]
195
                                        [% ELSIF ( lengthunit == 'hours') %]
203
                                        </td>
196
                                            Hours
204
                                        <td>
197
                                        [% ELSE %]
205
                                            [% IF maxissueqty.defined && maxissueqty != '' %]
198
                                            Undefined
206
                                                [% maxissueqty | html %]
199
                                        [% END %]
207
                                            [% ELSE %]
200
                                    </td>
208
                                                <span>Unlimited</span>
201
                                    <td>
209
                                            [% END %]
202
                                      [% IF ( hardduedate ) %]
210
                                        </td>
203
                                        [% IF ( hardduedatecompare == '-1' ) %]
211
                                        <td>[% issuelength | html %]</td>
204
                                          before [% hardduedate | $KohaDates %]
212
                                        <td>
205
                                          <input type="hidden" name="hardduedatecomparebackup" value="-1" />
213
                                            [% IF ( lengthunit == 'days' ) %]
206
                                        [% ELSIF ( hardduedatecompare == '0' ) %]
214
                                                Days
207
                                          on [% hardduedate | $KohaDates %]
215
                                            [% ELSIF ( lengthunit == 'hours') %]
208
                                          <input type="hidden" name="hardduedatecomparebackup" value="0" />
216
                                                Hours
209
                                        [% ELSIF ( hardduedatecompare == '1' ) %]
217
                                            [% ELSE %]
210
                                          after [% hardduedate | $KohaDates %]
218
                                                Undefined
211
                                          <input type="hidden" name="hardduedatecomparebackup" value="1" />
219
                                            [% END %]
212
                                        [% END %]
220
                                        </td>
213
                                      [% ELSE %]
221
                                        <td>
214
                                        <span>None defined</span>
222
                                          [% IF ( hardduedate ) %]
215
                                      [% END %]
223
                                            [% IF ( hardduedatecompare == '-1' ) %]
216
                                    </td>
224
                                              before [% hardduedate | $KohaDates %]
217
                                    <td>[% fine | html %]</td>
225
                                              <input type="hidden" name="hardduedatecomparebackup" value="-1" />
218
                                    <td>[% chargeperiod | html %]</td>
226
                                            [% ELSIF ( hardduedatecompare == '0' ) %]
219
                                    <td>[% IF chargeperiod_charge_at %]Start of interval[% ELSE %]End of interval[% END %]</td>
227
                                              on [% hardduedate | $KohaDates %]
220
                                    <td>[% firstremind | html %]</td>
228
                                              <input type="hidden" name="hardduedatecomparebackup" value="0" />
221
                                    <td>[% overduefinescap FILTER format("%.2f") %]</td>
229
                                            [% ELSIF ( hardduedatecompare == '1' ) %]
222
                                    <td>
230
                                              after [% hardduedate | $KohaDates %]
223
                                        [% IF cap_fine_to_replacement_price %]
231
                                              <input type="hidden" name="hardduedatecomparebackup" value="1" />
224
                                            <input type="checkbox" checked="checked" disabled="disabled" />
232
                                            [% END %]
225
                                        [% ELSE %]
233
                                          [% ELSE %]
226
                                            <input type="checkbox" disabled="disabled" />
234
                                            <span>None defined</span>
227
                                        [% END %]
235
                                          [% END %]
228
                                    </td>
236
                                        </td>
229
                                    <td>[% finedays | html %]</td>
237
                                        <td>[% fine | html %]</td>
230
                                    <td>[% maxsuspensiondays | html %]</td>
238
                                        <td>[% chargeperiod | html %]</td>
231
                                    <td>[% suspension_chargeperiod | html %]</td>
239
                                        <td>[% IF chargeperiod_charge_at %]Start of interval[% ELSE %]End of interval[% END %]</td>
232
                                    <td>[% renewalsallowed | html %]</td>
240
                                        <td>[% firstremind | html %]</td>
233
                                    <td>[% renewalperiod | html %]</td>
241
                                        <td>[% overduefinescap FILTER format("%.2f") %]</td>
234
                                    <td>[% norenewalbefore | html %]</td>
242
                                        <td>
235
                                    <td>
243
                                            [% IF cap_fine_to_replacement_price %]
236
                                        [% IF auto_renew %]
244
                                                <input type="checkbox" checked="checked" disabled="disabled" />
237
                                            <span>Yes</span>
245
                                            [% ELSE %]
238
                                        [% ELSE %]
246
                                                <input type="checkbox" disabled="disabled" />
239
                                            <span>No</span>
247
                                            [% END %]
240
                                        [% END %]
248
                                        </td>
241
                                    </td>
249
                                        <td>[% finedays | html %]</td>
242
                                    <td>[% no_auto_renewal_after | html %]</td>
250
                                        <td>[% maxsuspensiondays | html %]</td>
243
                                    <td>[% no_auto_renewal_after_hard_limit | $KohaDates %]</td>
251
                                        <td>[% suspension_chargeperiod | html %]</td>
244
                                    <td>
252
                                        <td>[% renewalsallowed | html %]</td>
245
                                        [% IF reservesallowed.defined && reservesallowed != '' %]
253
                                        <td>[% renewalperiod | html %]</td>
246
                                            [% reservesallowed | html %]
254
                                        <td>[% norenewalbefore | html %]</td>
247
                                        [% ELSE %]
255
                                        <td>
248
                                            <span>Unlimited</span>
256
                                            [% IF auto_renew %]
249
                                        [% END %]
257
                                                <span>Yes</span>
250
                                    </td>
258
                                            [% ELSE %]
251
                                    <td>
259
                                                <span>No</span>
252
                                        [% IF holds_per_day.defined && holds_per_day != '' %]
260
                                            [% END %]
253
                                            [% holds_per_day | html %]
261
                                        </td>
254
                                        [% ELSE %]
262
                                        <td>[% no_auto_renewal_after | html %]</td>
255
                                            <span>Unlimited</span>
263
                                        <td>[% no_auto_renewal_after_hard_limit | $KohaDates %]</td>
256
                                        [% END %]
264
                                        <td>
257
                                    </td>
265
                                            [% IF reservesallowed.defined && reservesallowed != '' %]
258
                                    <td>
266
                                                [% reservesallowed | html %]
259
                                        [% IF holds_per_record.defined && holds_per_record != '' %]
267
                                            [% ELSE %]
260
                                            [% holds_per_record | html %]
268
                                                <span>Unlimited</span>
261
                                        [% ELSE %]
269
                                            [% END %]
262
                                            <span>Unlimited</span>
270
                                        </td>
263
                                        [% END %]
271
                                        <td>
264
                                    </td>
272
                                            [% IF holds_per_day.defined && holds_per_day != '' %]
265
                                    <td>
273
                                                [% holds_per_day | html %]
266
                                        [% IF onshelfholds == 1 %]
274
                                            [% ELSE %]
267
                                            <span>Yes</span>
275
                                                <span>Unlimited</span>
268
                                        [% ELSIF onshelfholds == 2 %]
276
                                            [% END %]
269
                                            <span>If all unavailable</span>
277
                                        </td>
270
                                        [% ELSE %]
278
                                        <td>
271
                                            <span>If any unavailable</span>
279
                                            [% IF holds_per_record.defined && holds_per_record != '' %]
272
                                        [% END %]
280
                                                [% holds_per_record | html %]
273
                                    </td>
281
                                            [% ELSE %]
274
                                    <td>
282
                                                <span>Unlimited</span>
275
                                        [% IF opacitemholds == 'F'%]
283
                                            [% END %]
276
                                            <span>Force</span>
284
                                        </td>
277
                                        [% ELSIF opacitemholds == 'Y'%]
285
                                        <td>
278
                                            <span>Allow</span>
286
                                            [% IF onshelfholds == 1 %]
279
                                        [% ELSE %]
287
                                                <span>Yes</span>
280
                                            <span>Don't allow</span>
288
                                            [% ELSIF onshelfholds == 2 %]
281
                                        [% END %]
289
                                                <span>If all unavailable</span>
282
                                    </td>
290
                                            [% ELSE %]
283
                                    <td>
291
                                                <span>If any unavailable</span>
284
                                        [% IF article_requests == 'no' %]
292
                                            [% END %]
285
                                            <span>No</span>
293
                                        </td>
286
                                        [% ELSIF article_requests == 'yes' %]
294
                                        <td>
287
                                            <span>Yes</span>
295
                                            [% IF opacitemholds == 'F'%]
288
                                        [% ELSIF article_requests == 'bib_only' %]
296
                                                <span>Force</span>
289
                                            <span>Record only</span>
297
                                            [% ELSIF opacitemholds == 'Y'%]
290
                                        [% ELSIF article_requests == 'item_only' %]
298
                                                <span>Allow</span>
291
                                            <span>Item only</span>
299
                                            [% ELSE %]
292
                                        [% END %]
300
                                                <span>Don't allow</span>
293
                                    </td>
301
                                            [% END %]
294
                                    <td>[% rentaldiscount | html %]</td>
302
                                        </td>
295
                                    <td class="actions">
303
                                        <td>
296
                                      <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
304
                                            [% IF article_requests == 'no' %]
297
                                      <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=[% i || '*' | uri %]&amp;categorycode=[% c || '*' | uri %]&amp;branch=[% current_branch | uri %]"><i class="fa fa-trash"></i> Delete</a>
305
                                                <span>No</span>
298
                                    </td>
306
                                            [% ELSIF article_requests == 'yes' %]
299
                            </tr>
307
                                                <span>Yes</span>
308
                                            [% ELSIF article_requests == 'bib_only' %]
309
                                                <span>Record only</span>
310
                                            [% ELSIF article_requests == 'item_only' %]
311
                                                <span>Item only</span>
312
                                            [% END %]
313
                                        </td>
314
                                        <td>[% rentaldiscount | html %]</td>
315
                                        <td class="actions">
316
                                          <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
317
                                          <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=[% i || '*' | uri %]&amp;categorycode=[% c || '*' | uri %]&amp;branch=[% current_branch | uri %]"><i class="fa fa-trash"></i> Delete</a>
318
                                        </td>
319
                                </tr>
320
                            [% END %]
300
                        [% END %]
321
                        [% END %]
301
                    [% END %]
322
                    [% END %]
302
                [% END %]
323
                [% END %]
Lines 317-322 Link Here
317
                        [% END %]
338
                        [% END %]
318
                        </select>
339
                        </select>
319
                    </td>
340
                    </td>
341
                    <td>
342
                        <select name="checkout_type" id="matrixcheckout_type" style="width:13em;">
343
                            <option value="*">All</option>
344
                            <option value="CHECKOUT">Normal checkout</option>
345
                            <option value="ONSITE">On-site checkout</option>
346
                        </select>
347
                    </td>
320
                    <td class="actions">
348
                    <td class="actions">
321
                        <input type="hidden" name="branch" value="[% current_branch | html %]"/>
349
                        <input type="hidden" name="branch" value="[% current_branch | html %]"/>
322
                        <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
350
                        <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
Lines 404-409 Link Here
404
                    <tr>
432
                    <tr>
405
                      <th>Patron category</th>
433
                      <th>Patron category</th>
406
                      <th>Item type</th>
434
                      <th>Item type</th>
435
                      <th>Checkout type</th>
407
                      <th>&nbsp;</th>
436
                      <th>&nbsp;</th>
408
                      <th>Note</th>
437
                      <th>Note</th>
409
                      <th>Current checkouts allowed</th>
438
                      <th>Current checkouts allowed</th>
Lines 449-454 Link Here
449
                <tr>
478
                <tr>
450
                    <th>&nbsp;</th>
479
                    <th>&nbsp;</th>
451
                    <th>Total current checkouts allowed</th>
480
                    <th>Total current checkouts allowed</th>
481
                    <th>Total current on-site checkouts allowed</th>
452
                    <th>Maximum total holds allowed (count)</th>
482
                    <th>Maximum total holds allowed (count)</th>
453
                    <th>Hold policy</th>
483
                    <th>Hold policy</th>
454
                    <th>Hold pickup library match</th>
484
                    <th>Hold pickup library match</th>
Lines 458-473 Link Here
458
                <tr>
488
                <tr>
459
                    <td><em>Defaults</em></td>
489
                    <td><em>Defaults</em></td>
460
                    <td>
490
                    <td>
461
                        [% SET patron_maxissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxissueqty' ) %]
491
                        [% SET patron_maxissueqty = CirculationRules.Search( current_branch, undef, undef, Checkouts.type.checkout, 'patron_maxissueqty' ) %]
462
                        <input type="text" name="patron_maxissueqty" size="3" value="[% patron_maxissueqty | html %]"/>
492
                        <input type="text" name="patron_maxissueqty" size="3" value="[% patron_maxissueqty | html %]"/>
463
                    </td>
493
                    </td>
464
                    <td>
494
                    <td>
465
                        [% SET rule_value = CirculationRules.Search( current_branch, undef , undef, 'max_holds' ) %]
495
                        [% SET patron_maxissueqty = CirculationRules.Search( current_branch, undef, undef, Checkouts.type.onsite_checkout, 'patron_maxissueqty' ) %]
496
                        <input type="text" name="patron_maxonsiteissueqty" size="3" value="[% patron_maxissueqty | html %]"/>
497
                    </td>
498
                    <td>
499
                        [% SET rule_value = CirculationRules.Search( current_branch, undef , undef, undef, 'max_holds' ) %]
466
                        <input name="max_holds" size="3" value="[% rule_value | html %]" />
500
                        <input name="max_holds" size="3" value="[% rule_value | html %]" />
467
                    </td>
501
                    </td>
468
                    <td>
502
                    <td>
469
                        <select name="holdallowed">
503
                        <select name="holdallowed">
470
                            [% SET holdallowed = CirculationRules.Search( current_branch, undef, undef, 'holdallowed' ) %]
504
                            [% SET holdallowed = CirculationRules.Search( current_branch, undef, undef, undef, 'holdallowed' ) %]
471
                            <option value="">
505
                            <option value="">
472
                                Not set
506
                                Not set
473
                            </option>
507
                            </option>
Lines 507-513 Link Here
507
                    </td>
541
                    </td>
508
                    <td>
542
                    <td>
509
                        <select name="hold_fulfillment_policy">
543
                        <select name="hold_fulfillment_policy">
510
                            [% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, 'hold_fulfillment_policy' ) %]
544
                            [% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, undef, 'hold_fulfillment_policy' ) %]
511
545
512
                            <option value="">
546
                            <option value="">
513
                                Not set
547
                                Not set
Lines 566-572 Link Here
566
                    </td>
600
                    </td>
567
                    <td>
601
                    <td>
568
                        <select name="returnbranch">
602
                        <select name="returnbranch">
569
                            [% SET returnbranch = CirculationRules.Search( current_branch, undef, undef, 'returnbranch' ) %]
603
                            [% SET returnbranch = CirculationRules.Search( current_branch, undef, undef, undef, 'returnbranch' ) %]
570
604
571
                            <option value="">
605
                            <option value="">
572
                                Not set
606
                                Not set
Lines 619-631 Link Here
619
                <tr>
653
                <tr>
620
                    <th>Patron category</th>
654
                    <th>Patron category</th>
621
                    <th>Total current checkouts allowed</th>
655
                    <th>Total current checkouts allowed</th>
656
                    <th>Total current on-site checkouts allowed</th>
622
                    <th>Total holds allowed</th>
657
                    <th>Total holds allowed</th>
623
                    <th>&nbsp;</th>
658
                    <th>&nbsp;</th>
624
                </tr>
659
                </tr>
625
                [% FOREACH c IN categorycodes %]
660
                [% FOREACH c IN categorycodes %]
626
                    [% NEXT UNLESS c %]
661
                    [% NEXT UNLESS c %]
627
                    [% SET patron_maxissueqty = CirculationRules.Search( branchcode, c, undef, 'patron_maxissueqty' ) %]
662
                    [% SET patron_maxissueqty = CirculationRules.Search( branchcode, c, undef, Checkouts.type.checkout, 'patron_maxissueqty' ) %]
628
                    [% SET max_holds = CirculationRules.Search( branchcode, c, undef, 'max_holds' ) %]
663
                    [% SET patron_maxonsiteissueqty = CirculationRules.Search( branchcode, c, undef, Checkouts.type.onsite_checkout, 'patron_maxissueqty' ) %]
664
                    [% SET max_holds = CirculationRules.Search( branchcode, c, undef, undef, 'max_holds' ) %]
629
665
630
                    [% IF  ( patron_maxissueqty.defined && patron_maxissueqty != '' ) || ( max_holds.defined && max_holds != '' ) %]
666
                    [% IF  ( patron_maxissueqty.defined && patron_maxissueqty != '' ) || ( max_holds.defined && max_holds != '' ) %]
631
                    <tr>
667
                    <tr>
Lines 643-648 Link Here
643
                                <span>Unlimited</span>
679
                                <span>Unlimited</span>
644
                            [% END %]
680
                            [% END %]
645
                        </td>
681
                        </td>
682
                        <td>
683
                            [% IF patron_maxonsiteissueqty.defined && patron_maxonsiteissueqty != '' %]
684
                                [% patron_maxonsiteissueqty | html %]
685
                            [% ELSE %]
686
                                <span>Unlimited</span>
687
                            [% END %]
688
                        </td>
646
                        <td>
689
                        <td>
647
                            [% IF max_holds.defined && max_holds != '' %]
690
                            [% IF max_holds.defined && max_holds != '' %]
648
                                [% max_holds | html %]
691
                                [% max_holds | html %]
Lines 666-671 Link Here
666
                        </select>
709
                        </select>
667
                    </td>
710
                    </td>
668
                    <td><input name="patron_maxissueqty" size="3" type="text" /></td>
711
                    <td><input name="patron_maxissueqty" size="3" type="text" /></td>
712
                    <td><input name="patron_maxonsiteissueqty" size="3" type="text" /></td>
669
                    <td><input name="max_holds" size="3" type="text" /></td>
713
                    <td><input name="max_holds" size="3" type="text" /></td>
670
                    <td class="actions"><button type="submit" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</td>
714
                    <td class="actions"><button type="submit" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</td>
671
                </tr>
715
                </tr>
Lines 785-793 Link Here
785
                    <th>&nbsp;</th>
829
                    <th>&nbsp;</th>
786
                </tr>
830
                </tr>
787
                [% FOREACH i IN itemtypeloop %]
831
                [% FOREACH i IN itemtypeloop %]
788
                    [% SET holdallowed = CirculationRules.Search( branchcode, undef, i.itemtype, 'holdallowed' ) %]
832
                    [% SET holdallowed = CirculationRules.Search( branchcode, undef, i.itemtype, undef, 'holdallowed' ) %]
789
                    [% SET hold_fulfillment_policy = CirculationRules.Search( branchcode, undef, i.itemtype, 'hold_fulfillment_policy' ) %]
833
                    [% SET hold_fulfillment_policy = CirculationRules.Search( branchcode, undef, i.itemtype, undef, 'hold_fulfillment_policy' ) %]
790
                    [% SET returnbranch = CirculationRules.Search( branchcode, undef, i.itemtype, 'returnbranch' ) %]
834
                    [% SET returnbranch = CirculationRules.Search( branchcode, undef, i.itemtype, undef, 'returnbranch' ) %]
791
835
792
                    [% IF holdallowed || hold_fulfillment_policy || returnbranch %]
836
                    [% IF holdallowed || hold_fulfillment_policy || returnbranch %]
793
                        <tr>
837
                        <tr>
Lines 958-968 Link Here
958
                    itm = $(this).text();
1002
                    itm = $(this).text();
959
                    itm = itm.replace(/^\s*|\s*$/g,'');
1003
                    itm = itm.replace(/^\s*|\s*$/g,'');
960
                    var current_column = $("#edit_row td:eq("+i+")");
1004
                    var current_column = $("#edit_row td:eq("+i+")");
961
                    if ( i == 3 ) {
1005
                    if ( i == 4 ) {
962
                        // specific processing for the Note column
1006
                        // specific processing for the Note column
963
                        var note = $(this).find("a[name='viewnote']").data("content");
1007
                        var note = $(this).find("a[name='viewnote']").data("content");
964
                        $(current_column).find("input[type='text']").val(note);
1008
                        $(current_column).find("input[type='text']").val(note);
965
                    } else if ( i == 7 ) {
1009
                    } else if ( i == 8 ) {
966
                        // specific processing for the Hard due date column
1010
                        // specific processing for the Hard due date column
967
                        var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val();
1011
                        var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val();
968
                        var input_value = '';
1012
                        var input_value = '';
Lines 973-979 Link Here
973
                        }
1017
                        }
974
                        $(current_column).find("input[type='text']").val(input_value);
1018
                        $(current_column).find("input[type='text']").val(input_value);
975
                        $(current_column).find("select").val(select_value);
1019
                        $(current_column).find("select").val(select_value);
976
                    } else if ( i == 13 ) {
1020
                    } else if ( i == 14 ) {
977
                        // specific processing for cap_fine_to_replacement_price
1021
                        // specific processing for cap_fine_to_replacement_price
978
                        var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']");
1022
                        var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']");
979
                        $('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') );
1023
                        $('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') );
Lines 988-1004 Link Here
988
                                $(this).attr('selected', 'selected');
1032
                                $(this).attr('selected', 'selected');
989
                            }
1033
                            }
990
                        });
1034
                        });
991
                        if ( i == 0 || i == 1 ) {
1035
                        if ( i == 0 || i == 1 || i == 2 ) {
992
                            // Disable the 2 first columns, we cannot update them.
1036
                            // Disable the 2 first columns, we cannot update them.
993
                            var val = $(current_column).find("select option:selected").val();
1037
                            var val = $(current_column).find("select option:selected").val();
994
                            var name = "categorycode";
1038
                            var name = "categorycode";
995
                            if ( i == 1 ) {
1039
                            if ( i == 1 ) {
996
                                name="itemtype";
1040
                                name="itemtype";
997
                            }
1041
                            }
1042
                            if ( i == 2 ) {
1043
                                name="checkout_type";
1044
                            }
998
                            // Remove potential previous input added
1045
                            // Remove potential previous input added
999
                            $(current_column).find("input").remove();
1046
                            $(current_column).find("input").remove();
1000
                            $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
1047
                            $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
1001
                        } else if ( i == 4 || i == 23 || i == 24 || i == 25 ) {
1048
                        } else if ( i == 5 || i == 24 || i == 25 || i == 26 ) {
1002
                            // If the value is not an integer for
1049
                            // If the value is not an integer for
1003
                            //     - "Current checkouts allowed"
1050
                            //     - "Current checkouts allowed"
1004
                            //     - "Holds allowed (total)"
1051
                            //     - "Holds allowed (total)"
Lines 1014-1019 Link Here
1014
                });
1061
                });
1015
                $("#default-circulation-rules tr:last td:eq(0) select").prop('disabled', true);
1062
                $("#default-circulation-rules tr:last td:eq(0) select").prop('disabled', true);
1016
                $("#default-circulation-rules tr:last td:eq(1) select").prop('disabled', true);
1063
                $("#default-circulation-rules tr:last td:eq(1) select").prop('disabled', true);
1064
                $("#default-circulation-rules tr:last td:eq(2) select").prop('disabled', true);
1017
                return false;
1065
                return false;
1018
            });
1066
            });
1019
            $(".clear_edit").on("click",function(e){
1067
            $(".clear_edit").on("click",function(e){
1020
- 

Return to bug 25089