From fcc3ddbd03b97b88bf04f6984d7fd3c443fb14b5 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 29 Oct 2009 18:38:09 +0000 Subject: customer classification, RT#6376 --- httemplate/elements/select-cust_class.html | 18 ++++++++++++++++++ httemplate/elements/tr-select-cust_class.html | 27 +++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 httemplate/elements/select-cust_class.html create mode 100644 httemplate/elements/tr-select-cust_class.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/select-cust_class.html b/httemplate/elements/select-cust_class.html new file mode 100644 index 000000000..94b935acb --- /dev/null +++ b/httemplate/elements/select-cust_class.html @@ -0,0 +1,18 @@ +<% include( '/elements/select-table.html', + 'table' => 'cust_class', + 'name_col' => 'classname', + 'value' => $classnum, + 'empty_label' => '(none)', + 'hashref' => { 'disabled' => '' }, + %opt, + ) +%> +<%init> + +my %opt = @_; +my $classnum = $opt{'curr_value'} || $opt{'value'}; + +$opt{'records'} = delete $opt{'cust_class'} + if $opt{'cust_class'}; + + diff --git a/httemplate/elements/tr-select-cust_class.html b/httemplate/elements/tr-select-cust_class.html new file mode 100644 index 000000000..54a11d79e --- /dev/null +++ b/httemplate/elements/tr-select-cust_class.html @@ -0,0 +1,27 @@ +% if ( scalar(@{ $opt{'cust_class'} }) == 0 ) { + + + +% } else { + + + <% $opt{'label'} || 'Customer class' %> + + <% include( '/elements/select-cust_class.html', + 'curr_value' => $classnum, + %opt + ) + %> + + + +% } + +<%init> + +my %opt = @_; +my $classnum = $opt{'curr_value'} || $opt{'value'}; + +$opt{'cust_class'} ||= [ qsearch( 'cust_class', { disabled=>'' } ) ]; + + -- cgit v1.2.1