Browse Source

Bug 24159: Add UI changes

Sponsored-by: Institute of Technology Carlow
Signed-off-by: Simon Perry <simon.perry@itcarlow.ie>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
20.11.x
Jonathan Druart 4 years ago
parent
commit
ad0f89f9e5
  1. 3
      admin/smart-rules.pl
  2. 27
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt

3
admin/smart-rules.pl

@ -94,6 +94,7 @@ if ($op eq 'delete') {
chargeperiod => undef,
chargeperiod_charge_at => undef,
issuelength => undef,
useDaysMode => undef,
lengthunit => undef,
hardduedate => undef,
hardduedatecompare => undef,
@ -278,6 +279,7 @@ elsif ($op eq 'add') {
my $onshelfholds = $input->param('onshelfholds') || 0;
my $issuelength = $input->param('issuelength');
$issuelength = $issuelength eq q{} ? undef : $issuelength;
my $useDaysMode = $input->param('useDaysMode');
my $lengthunit = $input->param('lengthunit');
my $hardduedate = $input->param('hardduedate') || undef;
$hardduedate = eval { dt_from_string( $input->param('hardduedate') ) } if ( $hardduedate );
@ -303,6 +305,7 @@ elsif ($op eq 'add') {
chargeperiod => $chargeperiod,
chargeperiod_charge_at => $chargeperiod_charge_at,
issuelength => $issuelength,
useDaysMode => $useDaysMode,
lengthunit => $lengthunit,
hardduedate => $hardduedate,
hardduedatecompare => $hardduedatecompare,

27
koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt

@ -130,6 +130,7 @@
[% SET maxissueqty = all_rules.$c.$i.maxissueqty %]
[% SET maxonsiteissueqty = all_rules.$c.$i.maxonsiteissueqty %]
[% SET issuelength = all_rules.$c.$i.issuelength %]
[% SET useDaysMode = all_rules.$c.$i.useDaysMode %]
[% SET lengthunit = all_rules.$c.$i.lengthunit %]
[% SET hardduedate = all_rules.$c.$i.hardduedate %]
[% SET hardduedatecompare = all_rules.$c.$i.hardduedatecompare %]
@ -156,7 +157,7 @@
[% SET article_requests = all_rules.$c.$i.article_requests %]
[% SET rentaldiscount = all_rules.$c.$i.rentaldiscount %]
[% SET show_rule = maxissueqty || maxonsiteissueqty || 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 %]
[% SET show_rule = maxissueqty || maxonsiteissueqty || issuelength || useDaysMode || 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 %]
[% IF show_rule %]
[% SET row_count = row_count + 1 %]
<tr row_countd="row_[% row_count | html %]">
@ -198,6 +199,14 @@
[% END %]
</td>
<td>[% issuelength | html %]</td>
<td>
[% SWITCH useDaysMode %]
[% CASE 'Calendar' %]<span title="Use the calendar to skip days the library is closed">Calendar</span>
[% CASE 'Datedue' %]<span title="Use the calendar to push the due date to the next open day">Datedue</span>
[% CASE 'Days' %]<span title="Ignore the calendar">Days</span>
[% CASE 'Dayweek' %]<span title="Use the calendar to push the due date to the next open matching weekday for weekly loan periods, or the next open day otherwise">Dayweek</span>
[% CASE %]<span title="Use the system preference 'useDaysMode' as a default value">Default</span>
[% END %]
<td>
[% IF ( lengthunit == 'days' ) %]
Days
@ -335,6 +344,15 @@
<td><input type="text" name="maxissueqty" id="maxissueqty" size="3" /></td>
<td><input type="text" name="maxonsiteissueqty" id="maxonsiteissueqty" size="3" /></td>
<td><input type="text" name="issuelength" id="issuelength" size="3" /> </td>
<td>
<select name="useDaysMode" id="useDaysMode">
<option value="">Default</option>
<option value="Calendar">Calendar</option>
<option value="Datedue">Datedue</option>
<option value="Days">Days</option>
<option value="Dayweek">Dayweek</option>
</select>
</td>
<td>
<select name="lengthunit" id="lengthunit">
<option value="days" selected="selected">Days</option>
@ -419,6 +437,7 @@
<th>Current checkouts allowed</th>
<th>Current on-site checkouts allowed</th>
<th>Loan period</th>
<th>Days mode</th>
<th>Unit</th>
<th>Hard due date</th>
<th>Fine amount</th>
@ -988,7 +1007,7 @@
// specific processing for the Note column
var note = $(this).find("a[name='viewnote']").data("content");
$(current_column).find("input[type='text']").val(note);
} else if ( i == 8 ) {
} else if ( i == 9 ) {
// specific processing for the Hard due date column
var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val();
var input_value = '';
@ -999,7 +1018,7 @@
}
$(current_column).find("input[type='text']").val(input_value);
$(current_column).find("select").val(select_value);
} else if ( i == 14 ) {
} else if ( i == 15 ) {
// specific processing for cap_fine_to_replacement_price
var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']");
$('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') );
@ -1024,7 +1043,7 @@
// Remove potential previous input added
$(current_column).find("input").remove();
$(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
} else if ( i == 4 || i == 5 || i == 24 || i == 25 || i == 26 ) {
} else if ( i == 5 || i == 6 || i == 25 || i == 26 || i == 27 ) {
// If the value is not an integer for
// - "Current checkouts allowed"
// - "Current on-site checkouts allowed"

Loading…
Cancel
Save