X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_event.html;h=c8072e9f93820b6012faab3072cb815588e86b08;hp=6a532223e2dd645e70969491f3a799526027d9f7;hb=HEAD;hpb=477015901c379f8cd6ba46cfaa4a9ae284ae582d diff --git a/httemplate/edit/part_event.html b/httemplate/edit/part_event.html index 6a532223e..c8072e9f9 100644 --- a/httemplate/edit/part_event.html +++ b/httemplate/edit/part_event.html @@ -1,4 +1,4 @@ -<% include( 'elements/edit.html', +<& elements/edit.html, 'name' => 'Billing event definition', 'table' => 'part_event', 'fields' => [ @@ -22,11 +22,16 @@ type => 'checkbox', value => 'Y', }, + { field => '_initialize', + type => 'checkbox', + onchange => '_initialize_changed', + value => 'Y', + }, { type => 'title', value => 'Event Conditions', }, { field => 'conditionname', - type => 'selectlayers', + type => 'selectlayersx', options => [ keys %all_conditions ], labels => \%condition_labels, onchange => 'condition_changed(what);', @@ -46,7 +51,7 @@ value => 'Event Action', }, { field => 'action', - type => 'selectlayers', + type => 'selectlayersx', options => [ keys %all_actions ], labels => \%action_labels, onchange => 'action_changed(what);', @@ -54,7 +59,6 @@ layer_values_callback => $action_layer_values, html_between => n_a('action'), }, - ], 'labels' => { 'eventpart' => 'Event', @@ -67,6 +71,7 @@ 'conditionname' => 'Add new condition', #'weight', 'action' => 'Action', + '_initialize' => 'Initialize event', }, 'viewall_dir' => 'browse', 'new_callback' => sub { #start empty for new events only @@ -77,8 +82,7 @@ 'agent_virt' => 1, 'agent_null_right' => 'Edit global billing events', - ) -%> +&> <%once> @@ -485,6 +499,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; @@ -524,6 +541,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;