my $self = shift;
my $r;
- $r = $self->prepare_fines(undef, undef, [$self->cgi->param('xact')]) and return $r;
+ $r = $self->prepare_fines(undef, undef, [$self->cgi->param('xact'), $self->cgi->param('xact_misc')]) and return $r;
$r = $self->prepare_extended_user_info and return $r;
return Apache2::Const::OK;
my $self = shift;
my $r;
- $r = $self->prepare_fines(undef, undef, [$self->cgi->param('xact')]) and
+ $r = $self->prepare_fines(undef, undef, [$self->cgi->param('xact'), $self->cgi->param('xact_misc')]) and
return $r;
# balance_owed is computed specifically from the fines we're trying
if ($self->ctx->{fines}->{balance_owed} <= 0) {
$self->apache->log->info(
sprintf("Can't pay non-positive balance. xacts selected: (%s)",
- join(", ", map(int, $self->cgi->param("xact"))))
+ join(", ", map(int, $self->cgi->param("xact"), $self->cgi->param('xact_misc'))))
);
return Apache2::Const::HTTP_INTERNAL_SERVER_ERROR;
}
try { iframe.print(); } catch (e) { iwin.print(); }
setTimeout(function() { iframe.style.display = "none"; }, 3500);
}
+function select_all_checkboxes(name, checked) {
+ var all = document.getElementsByTagName("input");
+ for (var i = 0; i < all.length; i++) {
+ if (all[i].type == "checkbox" && all[i].name == name) {
+ all[i].checked = checked;
+ }
+ }
+}
<td>[% l("Date Returned") %]</td>
<td>[% l("Balance Owed") %]</td>
<td nowrap="nowrap" style="white-space:nowrap;">
- <!-- XXX TODO select all js --><input id="pay_fines_box1" checked="checked"
- type="checkbox" title="[% l('Click to (un)select all fines') %]" />
+ <input id="pay_fines_box1" checked="checked"
+ type="checkbox" onchange="select_all_checkboxes('xact', this.checked)"
+ title="[% l('Click to (un)select all fines') %]" />
<label for="pay_fines_box1">[% l('Pay Fines') %]</label>
</td>
</tr>
</td>
<td>
<input type="checkbox" checked="checked"
- title="[% l('Pay this fine') %]" name="xact" value="[% f.xact.id %]" />
+ title="[% l('Pay this fine') %]" name="xact"
+ value="[% f.xact.id %]" />
</td>
</tr>
[% END %]
<td width='4%' align="center" nowrap="nowrap"
style="white-space:nowrap;">
<input id="pay_fines_box2" checked="checked"
- type="checkbox"
+ type="checkbox" onchange="select_all_checkboxes('xact_misc', this.checked)"
title="[% l('Click to (un)select all fines') %]" />
<label for="pay_fines_box2">[% l("Pay Fines") %]</label>
</td>
<td>[% f.xact.last_billing_type %]</td>
<td>
<input type="checkbox" title='[% l("Pay this fine") %]'
- name="xact" value="[% f.xact.id %]" />
+ name="xact_misc" value="[% f.xact.id %]"
+ checked="checked" />
</td>
</tr>
[% END %]
[% FOR xact IN CGI.param('xact') %]
<input type="hidden" name="xact" value="[% xact | html %]" />
[% END %]
+ [% FOR xact IN CGI.param('xact_misc') %]
+ <input type="hidden" name="xact_misc" value="[% xact | html %]" />
+ [% END %]
<table>
<tbody>
<tr>
[%
END;
FOR f IN ctx.fines.grocery;
- NEXT IF CGI.param('xact').size &&
- !CGI.param('xact').grep(f.xact.id).size %]
+ NEXT IF CGI.param('xact_misc').size &&
+ !CGI.param('xact_misc').grep(f.xact.id).size %]
<tr>
<td>[% f.xact.last_billing_type %]</td>
<td class="text-right">[% money(f.xact.balance_owed) %]</td>