summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/edit/part_event.html5
-rw-r--r--httemplate/elements/selectlayers.html25
2 files changed, 25 insertions, 5 deletions
diff --git a/httemplate/edit/part_event.html b/httemplate/edit/part_event.html
index e005cbba0..702471b73 100644
--- a/httemplate/edit/part_event.html
+++ b/httemplate/edit/part_event.html
@@ -500,6 +500,9 @@ tie my %all_conditions, 'Tie::IxHash',
'' => { 'description' => '*** Select new condition ***', },
FS::part_event_condition->conditions();
+# *** Select new condition *** sorts to the beginning anyway
+(tied %all_conditions)->SortByValue;
+
my %condition_labels = map { $_ => $all_conditions{$_}->{'description'} }
keys %all_conditions;
@@ -539,6 +542,8 @@ tie my %all_actions, 'Tie::IxHash',
'' => { 'description' => '*** Select event action ***', },
FS::part_event->actions();
+(tied %all_actions)->SortByValue;
+
my %action_labels = map { $_ => $all_actions{$_}->{'description'} }
keys %all_actions;
diff --git a/httemplate/elements/selectlayers.html b/httemplate/elements/selectlayers.html
index 89fe41b1b..dd279bd16 100644
--- a/httemplate/elements/selectlayers.html
+++ b/httemplate/elements/selectlayers.html
@@ -162,6 +162,7 @@ Example:
my $conf = new FS::Conf;
my $money_char = $conf->config('money_char') || '$';
+my $date_noinit = 0;
</%once>
<%init>
@@ -220,10 +221,24 @@ sub layer_callback {
my $type = $lf->{type} || 'text';
my $include = $type;
- $include = "input-$include" if $include =~ /^(text|money)$/;
- $include = "tr-$include" unless $include eq 'hidden';
- $html .= include( "/elements/$include.html",
+ if ( $include eq 'date' ) {
+ # several important differences from other tr-*
+ $html .= include( '/elements/tr-input-date-field.html',
+ {
+ 'name' => "$layer_prefix$field",
+ 'value' => $value,
+ 'label' => $lf->{label},
+ 'format'=> $lf->{format},
+ 'noinit'=> $date_noinit,
+ }
+ );
+ $date_noinit = 1;
+ }
+ else {
+ $include = "input-$include" if $include =~ /^(text|money)$/;
+ $include = "tr-$include" unless $include eq 'hidden';
+ $html .= include( "/elements/$include.html",
%$lf,
'field' => "$layer_prefix$field",
'id' => "$layer_prefix$field", #separate?
@@ -233,8 +248,8 @@ sub layer_callback {
'value' => ( $lf->{'value'} || $value ), #hmm.
'curr_value' => $value,
);
-
- }
+ }
+ } #foreach $field
$html .= '</TABLE>';
return $html;
}