diff options
author | ivan <ivan> | 2008-04-13 02:55:44 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-04-13 02:55:44 +0000 |
commit | 311c04a5c63df131c6c5d74568c9e426f73955eb (patch) | |
tree | 80480b3be8a6e9285505ff459129a03617f5f7af /httemplate/elements/tr-part_pkg_freq.html | |
parent | fcfe0b35f3c8570b99f7286c5d93a23fab02257e (diff) |
add an element for selecting part_pkg frequencies
Diffstat (limited to 'httemplate/elements/tr-part_pkg_freq.html')
-rw-r--r-- | httemplate/elements/tr-part_pkg_freq.html | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/httemplate/elements/tr-part_pkg_freq.html b/httemplate/elements/tr-part_pkg_freq.html new file mode 100644 index 000000000..98b7da5a5 --- /dev/null +++ b/httemplate/elements/tr-part_pkg_freq.html @@ -0,0 +1,29 @@ +<% include('tr-td-label.html', @_ ) %> + + <TD> + <SELECT NAME="freq"> +% foreach my $freq ( @freq ) { + <OPTION VALUE="<% $freq %>" <% $freq eq $curr_value ? 'SELECTED' : '' %>><% $freq{$freq} %> +% } + </SELECT> + </TD> + +</TR> + +<%init> + +my %opt = @_; + +my $curr_value = $opt{'curr_value'} || $opt{'freq'}; + +tie my %freq, 'Tie::IxHash', %{FS::part_pkg->freqs_href()}; +if ( dbdef->table('part_pkg')->column('freq')->type =~ /(int)/i ) { + delete $freq{$_} foreach grep { ! /^\d+$/ } keys %freq; +} + +my @freq = keys %freq; +@freq = grep { /^\d+$/ } @freq + if $opt{'month_increments_only'}; +# if exists($plans{$layer}->{'freq'}) && $plans{$layer}->{'freq'} eq 'm'; + +</%init> |