summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/elements/select-reason_type.html21
-rw-r--r--httemplate/elements/tr-select-reason_type.html29
2 files changed, 50 insertions, 0 deletions
diff --git a/httemplate/elements/select-reason_type.html b/httemplate/elements/select-reason_type.html
new file mode 100644
index 000000000..9031e583a
--- /dev/null
+++ b/httemplate/elements/select-reason_type.html
@@ -0,0 +1,21 @@
+<% include( '/elements/select-table.html',
+ 'table' => 'reason_type',
+ 'name_col' => 'type',
+ 'value' => $typenum,
+ #XXX? 'empty_label' => '(none)',
+ #XXX? 'hashref' => { 'disabled' => '' },
+ %opt,
+ )
+%>
+<%init>
+
+my %opt = @_;
+my $typenum = $opt{'curr_value'} || $opt{'value'};
+
+#my %hash = ();
+#$hash{'disabled'} = '' unless $opt{'showdisabled'};
+
+#$opt{'records'} = delete $opt{'reason_type'}
+# if $opt{'reason_type'};
+
+</%init>
diff --git a/httemplate/elements/tr-select-reason_type.html b/httemplate/elements/tr-select-reason_type.html
new file mode 100644
index 000000000..9ac473ce7
--- /dev/null
+++ b/httemplate/elements/tr-select-reason_type.html
@@ -0,0 +1,29 @@
+% if ( scalar(@{ $opt{'reason_type'} }) == 0 ) {
+
+ <INPUT TYPE="hidden" NAME="<% $opt{'element_name'} || $opt{'field'} || 'typenum' %>" VALUE="">
+
+% } else {
+
+ <& /elements/tr-td-label.html, label => $opt{'label'} || 'Reason type', %opt &>
+
+ <TD COLSPAN="<% $colspan %>">
+ <% include( '/elements/select-reason_type.html',
+ 'curr_value' => $typenum,
+ %opt
+ )
+ %>
+ </TD>
+ </TR>
+
+% }
+
+<%init>
+
+my %opt = @_;
+my $typenum = $opt{'curr_value'} || $opt{'value'};
+
+$opt{'reason_type'} ||= [ qsearch( 'reason_type', { disabled=>'' } ) ];
+
+my $colspan = delete($opt{'colspan'}) || 1;
+
+</%init>