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

(-)a/admin/smart-rules.pl (-2 / +5 lines)
Lines 141-147 elsif ($op eq 'add') { Link Here
141
    $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 );
141
    $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 );
142
    $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 );
142
    $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 );
143
    my $reservesallowed  = $input->param('reservesallowed');
143
    my $reservesallowed  = $input->param('reservesallowed');
144
    my $holds_per_record  = $input->param('holds_per_record');
144
    my $holds_per_record = $input->param('holds_per_record');
145
    my $holds_per_day    = $input->param('holds_per_day');
145
    my $onshelfholds     = $input->param('onshelfholds') || 0;
146
    my $onshelfholds     = $input->param('onshelfholds') || 0;
146
    $maxissueqty =~ s/\s//g;
147
    $maxissueqty =~ s/\s//g;
147
    $maxissueqty = undef if $maxissueqty !~ /^\d+/;
148
    $maxissueqty = undef if $maxissueqty !~ /^\d+/;
Lines 181-186 elsif ($op eq 'add') { Link Here
181
        no_auto_renewal_after_hard_limit => $no_auto_renewal_after_hard_limit,
182
        no_auto_renewal_after_hard_limit => $no_auto_renewal_after_hard_limit,
182
        reservesallowed               => $reservesallowed,
183
        reservesallowed               => $reservesallowed,
183
        holds_per_record              => $holds_per_record,
184
        holds_per_record              => $holds_per_record,
185
        holds_per_day                 => $holds_per_day,
184
        issuelength                   => $issuelength,
186
        issuelength                   => $issuelength,
185
        lengthunit                    => $lengthunit,
187
        lengthunit                    => $lengthunit,
186
        hardduedate                   => $hardduedate,
188
        hardduedate                   => $hardduedate,
Lines 543-550 my @sorted_branch_cat_rules = sort { $a->{'humancategorycode'} cmp $b->{'humanca Link Here
543
545
544
# note undef maxissueqty so that template can deal with them
546
# note undef maxissueqty so that template can deal with them
545
foreach my $entry (@sorted_branch_cat_rules, @sorted_row_loop) {
547
foreach my $entry (@sorted_branch_cat_rules, @sorted_row_loop) {
546
    $entry->{unlimited_maxissueqty} = 1 unless defined($entry->{maxissueqty});
548
    $entry->{unlimited_maxissueqty}       = 1 unless defined($entry->{maxissueqty});
547
    $entry->{unlimited_maxonsiteissueqty} = 1 unless defined($entry->{maxonsiteissueqty});
549
    $entry->{unlimited_maxonsiteissueqty} = 1 unless defined($entry->{maxonsiteissueqty});
550
    $entry->{unlimited_holds_per_day}     = 1 unless defined($entry->{rules_per_day});
548
}
551
}
549
552
550
@sorted_row_loop = sort by_category_and_itemtype @row_loop;
553
@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 84-90 Link Here
84
                <th>Automatic renewal</th>
84
                <th>Automatic renewal</th>
85
                <th>No automatic renewal after</th>
85
                <th>No automatic renewal after</th>
86
                <th>No automatic renewal after (hard limit)</th>
86
                <th>No automatic renewal after (hard limit)</th>
87
                <th>Holds allowed (count)</th>
87
                <th>Holds allowed (total)</th>
88
                <th>Holds allowed (daily)</th>
88
                <th>Holds per record (count)</th>
89
                <th>Holds per record (count)</th>
89
                <th>On shelf holds allowed</th>
90
                <th>On shelf holds allowed</th>
90
                <th>Item level holds</th>
91
                <th>Item level holds</th>
Lines 171-177 Link Here
171
                            </td>
172
                            </td>
172
                            <td>[% rule.no_auto_renewal_after %]</td>
173
                            <td>[% rule.no_auto_renewal_after %]</td>
173
                            <td>[% rule.no_auto_renewal_after_hard_limit %]</td>
174
                            <td>[% rule.no_auto_renewal_after_hard_limit %]</td>
174
							<td>[% rule.reservesallowed %]</td>
175
                            <td>[% rule.reservesallowed %]</td>
176
                            <td>[% IF rule.unlimited_holds_per_day %]
177
                                    Unlimited
178
                                [% ELSE %]
179
                                    [% rule.holds_per_day %]
180
                                [% END %]
181
                            </td>
175
                                                        <td>[% rule.holds_per_record %]</td>
182
                                                        <td>[% rule.holds_per_record %]</td>
176
                                                        <td>
183
                                                        <td>
177
                                                            [% IF rule.onshelfholds == 1 %]
184
                                                            [% IF rule.onshelfholds == 1 %]
Lines 268-274 Link Here
268
                        <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 %]" class="datepicker"/>
275
                        <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 %]" class="datepicker"/>
269
                        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
276
                        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
270
                    </td>
277
                    </td>
271
                    <td><input type="text" name="reservesallowed" id="reservesallowed" size="2" /></td>
278
                    <td><input type="text" name="reservesallowed"  id="reservesallowed"  size="2" /></td>
279
                    <td><input type="text" name="holds_per_day"    id="holds_per_day"    size="2" /></td>
272
                    <td><input type="text" name="holds_per_record" id="holds_per_record" size="2" /></td>
280
                    <td><input type="text" name="holds_per_record" id="holds_per_record" size="2" /></td>
273
                    <td>
281
                    <td>
274
                        <select name="onshelfholds" id="onshelfholds">
282
                        <select name="onshelfholds" id="onshelfholds">
Lines 322-329 Link Here
322
                      <th>No renewal before</th>
330
                      <th>No renewal before</th>
323
                      <th>Automatic renewal</th>
331
                      <th>Automatic renewal</th>
324
                      <th>No automatic renewal after</th>
332
                      <th>No automatic renewal after</th>
325
                       <th>No automatic renewal after (hard limit)</th>
333
                      <th>No automatic renewal after (hard limit)</th>
326
                      <th>Holds allowed (count)</th>
334
                      <th>Holds allowed (total)</th>
335
                      <th>Holds allowed (daily)</th>
327
                      <th>Holds per record (count)</th>
336
                      <th>Holds per record (count)</th>
328
                      <th>On shelf holds allowed</th>
337
                      <th>On shelf holds allowed</th>
329
                      <th>Item level holds</th>
338
                      <th>Item level holds</th>
Lines 816-823 Link Here
816
                            // Remove potential previous input added
825
                            // Remove potential previous input added
817
                            $(current_column).find("input").remove();
826
                            $(current_column).find("input").remove();
818
                            $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
827
                            $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
819
                        } else if ( i == 3 || i == 4 ) {
828
                        } else if ( i == 3 || i == 4 || i == 23 ) {
820
                            // If the value is not an integer for "Current checkouts allowed" or "Current on-site checkouts allowed"
829
                            // If the value is not an integer for
830
                            //     - "Current checkouts allowed"
831
                            //     - "Current on-site checkouts allowed"
832
                            //     - "Holds allowed (daily)"
821
                            // The value is "Unlimited" (or an equivalent translated string)
833
                            // The value is "Unlimited" (or an equivalent translated string)
822
                            // an it should be set to an empty string
834
                            // an it should be set to an empty string
823
                            if( !((parseFloat(itm) == parseInt(itm)) && !isNaN(itm)) ) {
835
                            if( !((parseFloat(itm) == parseInt(itm)) && !isNaN(itm)) ) {
824
- 

Return to bug 15486