summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-part_pkg_freq.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/elements/tr-part_pkg_freq.html')
-rw-r--r--httemplate/elements/tr-part_pkg_freq.html24
1 files changed, 24 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 0000000..649f8a2
--- /dev/null
+++ b/httemplate/elements/tr-part_pkg_freq.html
@@ -0,0 +1,24 @@
+<% include('tr-select.html', @_,
+ 'field' => 'freq',
+ 'options' => \@freq,
+ 'labels' => \%freq,
+ 'curr_value' => $curr_value,
+ )
+%>
+<%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>