diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-11-03 12:25:22 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-11-03 12:25:22 -0700 |
commit | d7f622dc83e9050f83dd12abbaf1cd405a15aa22 (patch) | |
tree | 3706e5babb7dfc0214f27dfe54e7aa45b2264a45 /httemplate/elements | |
parent | 7313b39b6d60bea8c5bd9712527a08093bb337af (diff) |
adding pkg_reason_type and pkg_not_reason_type conditions, RT#20084
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/select-reason_type.html | 21 | ||||
-rw-r--r-- | httemplate/elements/tr-select-reason_type.html | 29 |
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> |