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

(-)a/admin/smart-rules.pl (-3 / +8 lines)
Lines 146-152 elsif ($op eq 'add') { Link Here
146
    $no_auto_renewal_after_hard_limit = eval { dt_from_string( $input->param('no_auto_renewal_after_hard_limit') ) } if ( $no_auto_renewal_after_hard_limit );
146
    $no_auto_renewal_after_hard_limit = eval { dt_from_string( $input->param('no_auto_renewal_after_hard_limit') ) } if ( $no_auto_renewal_after_hard_limit );
147
    $no_auto_renewal_after_hard_limit = output_pref( { dt => $no_auto_renewal_after_hard_limit, dateonly => 1, dateformat => 'iso' } ) if ( $no_auto_renewal_after_hard_limit );
147
    $no_auto_renewal_after_hard_limit = output_pref( { dt => $no_auto_renewal_after_hard_limit, dateonly => 1, dateformat => 'iso' } ) if ( $no_auto_renewal_after_hard_limit );
148
    my $reservesallowed  = $input->param('reservesallowed');
148
    my $reservesallowed  = $input->param('reservesallowed');
149
    my $holds_per_record  = $input->param('holds_per_record');
149
    my $holds_per_record = $input->param('holds_per_record');
150
    my $holds_per_day    = $input->param('holds_per_day');
151
    $holds_per_day =~ s/\s//g;
152
    $holds_per_day = undef if $holds_per_day !~ /^\d+/;
150
    my $onshelfholds     = $input->param('onshelfholds') || 0;
153
    my $onshelfholds     = $input->param('onshelfholds') || 0;
151
    $maxissueqty =~ s/\s//g;
154
    $maxissueqty =~ s/\s//g;
152
    $maxissueqty = undef if $maxissueqty !~ /^\d+/;
155
    $maxissueqty = undef if $maxissueqty !~ /^\d+/;
Lines 187-192 elsif ($op eq 'add') { Link Here
187
        no_auto_renewal_after_hard_limit => $no_auto_renewal_after_hard_limit,
190
        no_auto_renewal_after_hard_limit => $no_auto_renewal_after_hard_limit,
188
        reservesallowed               => $reservesallowed,
191
        reservesallowed               => $reservesallowed,
189
        holds_per_record              => $holds_per_record,
192
        holds_per_record              => $holds_per_record,
193
        holds_per_day                 => $holds_per_day,
190
        issuelength                   => $issuelength,
194
        issuelength                   => $issuelength,
191
        lengthunit                    => $lengthunit,
195
        lengthunit                    => $lengthunit,
192
        hardduedate                   => $hardduedate,
196
        hardduedate                   => $hardduedate,
Lines 555-563 my @sorted_branch_cat_rules = sort { $a->{'humancategorycode'} cmp $b->{'humanca Link Here
555
559
556
# note undef maxissueqty so that template can deal with them
560
# note undef maxissueqty so that template can deal with them
557
foreach my $entry (@sorted_branch_cat_rules, @sorted_row_loop) {
561
foreach my $entry (@sorted_branch_cat_rules, @sorted_row_loop) {
558
    $entry->{unlimited_maxissueqty} = 1 unless defined($entry->{maxissueqty});
562
    $entry->{unlimited_maxissueqty}       = 1 unless defined($entry->{maxissueqty});
559
    $entry->{unlimited_maxonsiteissueqty} = 1 unless defined($entry->{maxonsiteissueqty});
563
    $entry->{unlimited_maxonsiteissueqty} = 1 unless defined($entry->{maxonsiteissueqty});
560
    $entry->{unlimited_max_holds} = 1 unless defined($entry->{max_holds});
564
    $entry->{unlimited_max_holds}         = 1 unless defined($entry->{max_holds});
565
    $entry->{unlimited_holds_per_day}     = 1 unless defined($entry->{holds_per_day});
561
}
566
}
562
567
563
@sorted_row_loop = sort by_category_and_itemtype @row_loop;
568
@sorted_row_loop = sort by_category_and_itemtype @row_loop;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-8 / +19 lines)
Lines 87-93 Link Here
87
                <th>Automatic renewal</th>
87
                <th>Automatic renewal</th>
88
                <th>No automatic renewal after</th>
88
                <th>No automatic renewal after</th>
89
                <th>No automatic renewal after (hard limit)</th>
89
                <th>No automatic renewal after (hard limit)</th>
90
                <th>Holds allowed (count)</th>
90
                <th>Holds allowed (total)</th>
91
                <th>Holds allowed (daily)</th>
91
                <th>Holds per record (count)</th>
92
                <th>Holds per record (count)</th>
92
                <th>On shelf holds allowed</th>
93
                <th>On shelf holds allowed</th>
93
                <th>Item level holds</th>
94
                <th>Item level holds</th>
Lines 182-188 Link Here
182
                            <td>[% rule.no_auto_renewal_after | html %]</td>
183
                            <td>[% rule.no_auto_renewal_after | html %]</td>
183
                            <td>[% rule.no_auto_renewal_after_hard_limit | html %]</td>
184
                            <td>[% rule.no_auto_renewal_after_hard_limit | html %]</td>
184
							<td>[% rule.reservesallowed | html %]</td>
185
							<td>[% rule.reservesallowed | html %]</td>
185
                                                        <td>[% rule.holds_per_record | html %]</td>
186
                            <td>[% IF rule.unlimited_holds_per_day %]
187
                                    <span>Unlimited</span>
188
                                [% ELSE %]
189
                                    [% rule.holds_per_day | html %]
190
                                [% END %]
191
                            </td>
192
                            <td>[% rule.holds_per_record | html %]</td>
186
                                                        <td>
193
                                                        <td>
187
                                                            [% IF rule.onshelfholds == 1 %]
194
                                                            [% IF rule.onshelfholds == 1 %]
188
                                                                <span>Yes</span>
195
                                                                <span>Yes</span>
Lines 288-294 Link Here
288
                        <input type="text" size="10" name="no_auto_renewal_after_hard_limit" id="no_auto_renewal_after_hard_limit" value="[% no_auto_renewal_after_hard_limit | html %]" class="datepicker"/>
295
                        <input type="text" size="10" name="no_auto_renewal_after_hard_limit" id="no_auto_renewal_after_hard_limit" value="[% no_auto_renewal_after_hard_limit | html %]" class="datepicker"/>
289
                        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
296
                        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
290
                    </td>
297
                    </td>
291
                    <td><input type="text" name="reservesallowed" id="reservesallowed" size="2" /></td>
298
                    <td><input type="text" name="reservesallowed"  id="reservesallowed"  size="2" /></td>
299
                    <td><input type="text" name="holds_per_day"    id="holds_per_day"    size="2" /></td>
292
                    <td><input type="text" name="holds_per_record" id="holds_per_record" size="2" /></td>
300
                    <td><input type="text" name="holds_per_record" id="holds_per_record" size="2" /></td>
293
                    <td>
301
                    <td>
294
                        <select name="onshelfholds" id="onshelfholds">
302
                        <select name="onshelfholds" id="onshelfholds">
Lines 343-350 Link Here
343
                      <th>No renewal before</th>
351
                      <th>No renewal before</th>
344
                      <th>Automatic renewal</th>
352
                      <th>Automatic renewal</th>
345
                      <th>No automatic renewal after</th>
353
                      <th>No automatic renewal after</th>
346
                       <th>No automatic renewal after (hard limit)</th>
354
                      <th>No automatic renewal after (hard limit)</th>
347
                      <th>Holds allowed (count)</th>
355
                      <th>Holds allowed (total)</th>
356
                      <th>Holds allowed (daily)</th>
348
                      <th>Holds per record (count)</th>
357
                      <th>Holds per record (count)</th>
349
                      <th>On shelf holds allowed</th>
358
                      <th>On shelf holds allowed</th>
350
                      <th>Item level holds</th>
359
                      <th>Item level holds</th>
Lines 847-854 Link Here
847
                            // Remove potential previous input added
856
                            // Remove potential previous input added
848
                            $(current_column).find("input").remove();
857
                            $(current_column).find("input").remove();
849
                            $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
858
                            $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
850
                        } else if ( i == 3 || i == 4 ) {
859
                        } else if ( i == 3 || i == 4 || i == 24 ) {
851
                            // If the value is not an integer for "Current checkouts allowed" or "Current on-site checkouts allowed"
860
                            // If the value is not an integer for
861
                            //     - "Current checkouts allowed"
862
                            //     - "Current on-site checkouts allowed"
863
                            //     - "Holds allowed (daily)"
852
                            // The value is "Unlimited" (or an equivalent translated string)
864
                            // The value is "Unlimited" (or an equivalent translated string)
853
                            // an it should be set to an empty string
865
                            // an it should be set to an empty string
854
                            if( !((parseFloat(itm) == parseInt(itm)) && !isNaN(itm)) ) {
866
                            if( !((parseFloat(itm) == parseInt(itm)) && !isNaN(itm)) ) {
855
- 

Return to bug 15486