X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fselect-hardware_type.html;h=126576d0d7aebdda9e480e0e936aa04e7d264369;hp=ae07798fc4f3e683c80728046d2635667e7fb01e;hb=b71b1576c68bc40ad26592b354feace37a029f0e;hpb=b5c4237a34aef94976bc343c8d9e138664fc3984 diff --git a/httemplate/elements/select-hardware_type.html b/httemplate/elements/select-hardware_type.html index ae07798fc..126576d0d 100644 --- a/httemplate/elements/select-hardware_type.html +++ b/httemplate/elements/select-hardware_type.html @@ -1,14 +1,36 @@ -<% include( '/elements/select-table.html', - 'table' => 'hardware_type', - 'name_col' => 'model', - 'hashref' => $hashref, - %opt, - ) -%> +<& /elements/select-tiered.html, tiers => [ + { + field => 'classnum', + table => 'hardware_class', + hashref => ($classnum ? { classnum => $classnum } : {}), + name_col => 'classname', + empty_label => '(all)', + }, + { + field => 'model', + table => 'hardware_type', + select => 'classnum, model', + name_col => 'model', + value_col => 'model', + link_col => 'classnum', + hashref => $hashref, + extra_sql => 'GROUP BY classnum, model', + empty_label => '(all)', + }, + { + table => 'hardware_type', + name_col => 'revision', + value_col => 'typenum', + link_col => 'model', + empty_label => $opt{'empty_label'}, + }, +], + field => 'typenum', + %opt, +&> <%init> my %opt = @_; -my $classnum = delete $opt{'classnum'}; my $hashref = $opt{'hashref'} || {}; -$hashref->{'classnum'} = $classnum if $classnum; +my $classnum = $hashref->{classnum};