adding pkg_reason_type and pkg_not_reason_type conditions, RT#20084
[freeside.git] / httemplate / elements / tr-select-reason_type.html
diff --git a/httemplate/elements/tr-select-reason_type.html b/httemplate/elements/tr-select-reason_type.html
new file mode 100644 (file)
index 0000000..9ac473c
--- /dev/null
@@ -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>