<% include('email-customers.html', 'form_action' => 'email-customers-history.html', 'sub_param_process' => $sub_param_process, 'alternate_form' => $alternate_form, 'title' => 'Send payment history', ) %> <%init> my $sub_param_process = sub { my $conf = shift; my %sub_param; foreach my $field ( qw( start_date end_date ) ) { $sub_param{'payment_history'}->{$field} = parse_datetime($cgi->param($field)); $cgi->delete($field); } $cgi->param('msgnum',$conf->config('payment_history_msgnum')); return %sub_param; }; my $alternate_form = sub { my %sub_param = @_; # this could maaaybe be a separate element, for cleanliness # but it's really only for use by this page, and it's not overly complicated my $noinit = 0; return join("\n", '', ( map { my $label = ucfirst($_); $label =~ s/_/ /; include('/elements/tr-input-date-field.html',{ 'name' => $_, 'value' => $sub_param{'payment_history'}->{$_} || '', 'label' => $label, 'noinit' => $noinit++ }); } qw( start_date end_date ) ), '
', '', '', '', ); };