summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-part_pkg_freq.html
blob: 98b7da5a512e34f7bc2e9b75d76545a48d18a578 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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>