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

(-)a/admin/smart-rules.pl (-3 / +8 lines)
Lines 164-170 elsif ($op eq 'add') { Link Here
164
    $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 );
164
    $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 );
165
    $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 );
165
    $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 );
166
    my $reservesallowed  = $input->param('reservesallowed');
166
    my $reservesallowed  = $input->param('reservesallowed');
167
    my $holds_per_record  = $input->param('holds_per_record');
167
    my $holds_per_record = $input->param('holds_per_record');
168
    my $holds_per_day    = $input->param('holds_per_day');
169
    $holds_per_day =~ s/\s//g;
170
    $holds_per_day = undef if $holds_per_day !~ /^\d+/;
168
    my $onshelfholds     = $input->param('onshelfholds') || 0;
171
    my $onshelfholds     = $input->param('onshelfholds') || 0;
169
    $maxissueqty =~ s/\s//g;
172
    $maxissueqty =~ s/\s//g;
170
    $maxissueqty = undef if $maxissueqty !~ /^\d+/;
173
    $maxissueqty = undef if $maxissueqty !~ /^\d+/;
Lines 205-210 elsif ($op eq 'add') { Link Here
205
        no_auto_renewal_after_hard_limit => $no_auto_renewal_after_hard_limit,
208
        no_auto_renewal_after_hard_limit => $no_auto_renewal_after_hard_limit,
206
        reservesallowed               => $reservesallowed,
209
        reservesallowed               => $reservesallowed,
207
        holds_per_record              => $holds_per_record,
210
        holds_per_record              => $holds_per_record,
211
        holds_per_day                 => $holds_per_day,
208
        issuelength                   => $issuelength,
212
        issuelength                   => $issuelength,
209
        lengthunit                    => $lengthunit,
213
        lengthunit                    => $lengthunit,
210
        hardduedate                   => $hardduedate,
214
        hardduedate                   => $hardduedate,
Lines 613-621 my @sorted_branch_cat_rules = sort { $a->{'humancategorycode'} cmp $b->{'humanca Link Here
613
617
614
# note undef maxissueqty so that template can deal with them
618
# note undef maxissueqty so that template can deal with them
615
foreach my $entry (@sorted_branch_cat_rules, @sorted_row_loop) {
619
foreach my $entry (@sorted_branch_cat_rules, @sorted_row_loop) {
616
    $entry->{unlimited_maxissueqty} = 1 unless defined($entry->{maxissueqty});
620
    $entry->{unlimited_maxissueqty}       = 1 unless defined($entry->{maxissueqty});
617
    $entry->{unlimited_maxonsiteissueqty} = 1 unless defined($entry->{maxonsiteissueqty});
621
    $entry->{unlimited_maxonsiteissueqty} = 1 unless defined($entry->{maxonsiteissueqty});
618
    $entry->{unlimited_max_holds} = 1 unless defined($entry->{max_holds});
622
    $entry->{unlimited_max_holds}         = 1 unless defined($entry->{max_holds});
623
    $entry->{unlimited_holds_per_day}     = 1 unless defined($entry->{holds_per_day});
619
}
624
}
620
625
621
@sorted_row_loop = sort by_category_and_itemtype @row_loop;
626
@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 90-96 Link Here
90
                <th>Automatic renewal</th>
90
                <th>Automatic renewal</th>
91
                <th>No automatic renewal after</th>
91
                <th>No automatic renewal after</th>
92
                <th>No automatic renewal after (hard limit)</th>
92
                <th>No automatic renewal after (hard limit)</th>
93
                <th>Holds allowed (count)</th>
93
                <th>Holds allowed (total)</th>
94
                <th>Holds allowed (daily)</th>
94
                <th>Holds per record (count)</th>
95
                <th>Holds per record (count)</th>
95
                <th>On shelf holds allowed</th>
96
                <th>On shelf holds allowed</th>
96
                <th>Item level holds</th>
97
                <th>Item level holds</th>
Lines 185-191 Link Here
185
                            <td>[% rule.no_auto_renewal_after | html %]</td>
186
                            <td>[% rule.no_auto_renewal_after | html %]</td>
186
                            <td>[% rule.no_auto_renewal_after_hard_limit | html %]</td>
187
                            <td>[% rule.no_auto_renewal_after_hard_limit | html %]</td>
187
							<td>[% rule.reservesallowed | html %]</td>
188
							<td>[% rule.reservesallowed | html %]</td>
188
                                                        <td>[% rule.holds_per_record | html %]</td>
189
                            <td>[% IF rule.unlimited_holds_per_day %]
190
                                    <span>Unlimited</span>
191
                                [% ELSE %]
192
                                    [% rule.holds_per_day | html %]
193
                                [% END %]
194
                            </td>
195
                            <td>[% rule.holds_per_record | html %]</td>
189
                                                        <td>
196
                                                        <td>
190
                                                            [% IF rule.onshelfholds == 1 %]
197
                                                            [% IF rule.onshelfholds == 1 %]
191
                                                                <span>Yes</span>
198
                                                                <span>Yes</span>
Lines 291-297 Link Here
291
                        <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"/>
298
                        <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"/>
292
                        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
299
                        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
293
                    </td>
300
                    </td>
294
                    <td><input type="text" name="reservesallowed" id="reservesallowed" size="2" /></td>
301
                    <td><input type="text" name="reservesallowed"  id="reservesallowed"  size="2" /></td>
302
                    <td><input type="text" name="holds_per_day"    id="holds_per_day"    size="2" /></td>
295
                    <td><input type="text" name="holds_per_record" id="holds_per_record" size="2" /></td>
303
                    <td><input type="text" name="holds_per_record" id="holds_per_record" size="2" /></td>
296
                    <td>
304
                    <td>
297
                        <select name="onshelfholds" id="onshelfholds">
305
                        <select name="onshelfholds" id="onshelfholds">
Lines 346-353 Link Here
346
                      <th>No renewal before</th>
354
                      <th>No renewal before</th>
347
                      <th>Automatic renewal</th>
355
                      <th>Automatic renewal</th>
348
                      <th>No automatic renewal after</th>
356
                      <th>No automatic renewal after</th>
349
                       <th>No automatic renewal after (hard limit)</th>
357
                      <th>No automatic renewal after (hard limit)</th>
350
                      <th>Holds allowed (count)</th>
358
                      <th>Holds allowed (total)</th>
359
                      <th>Holds allowed (daily)</th>
351
                      <th>Holds per record (count)</th>
360
                      <th>Holds per record (count)</th>
352
                      <th>On shelf holds allowed</th>
361
                      <th>On shelf holds allowed</th>
353
                      <th>Item level holds</th>
362
                      <th>Item level holds</th>
Lines 857-864 Link Here
857
                            // Remove potential previous input added
866
                            // Remove potential previous input added
858
                            $(current_column).find("input").remove();
867
                            $(current_column).find("input").remove();
859
                            $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
868
                            $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
860
                        } else if ( i == 3 || i == 4 ) {
869
                        } else if ( i == 3 || i == 4 || i == 24 ) {
861
                            // If the value is not an integer for "Current checkouts allowed" or "Current on-site checkouts allowed"
870
                            // If the value is not an integer for
871
                            //     - "Current checkouts allowed"
872
                            //     - "Current on-site checkouts allowed"
873
                            //     - "Holds allowed (daily)"
862
                            // The value is "Unlimited" (or an equivalent translated string)
874
                            // The value is "Unlimited" (or an equivalent translated string)
863
                            // an it should be set to an empty string
875
                            // an it should be set to an empty string
864
                            if( !((parseFloat(itm) == parseInt(itm)) && !isNaN(itm)) ) {
876
                            if( !((parseFloat(itm) == parseInt(itm)) && !isNaN(itm)) ) {
865
- 

Return to bug 15486