X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fselect-table.html;h=6fb6b388b267a4e0b9fd12ff7c8bbaf0e0b102d3;hp=96f0177fbde9a127ba22f648bba4ed9dc0d48577;hb=a983ba996fbd3d432443eff8afc4b09bb48ec443;hpb=e65c6a26ca778166aec2b2d1dd3012ab84fa611a diff --git a/httemplate/elements/select-table.html b/httemplate/elements/select-table.html index 96f0177fb..6fb6b388b 100644 --- a/httemplate/elements/select-table.html +++ b/httemplate/elements/select-table.html @@ -1,54 +1,224 @@ -<% - - ##required - # 'table' => 'table_name', - # 'name_col' => 'name_column', - # - ##strongly recommended (you want your forms to be "sticky" on errors, right?) - # 'value' => 'current_value', - # - ##opt - # 'empty_label' => '', #better specify it though, the default might change - # 'hashref' => {}, - # 'records' => \@records, #instead of hashref - # 'pre_options' => [ 'value' => 'option' ], #before normal options - - my( %opt ) = @_; - - #warn "***** select-table: \n". Dumper(%opt); - - my $key = dbdef->table($opt{'table'})->primary_key; #? $opt{'primary_key'} || - - my $name_col = $opt{'name_col'}; - - my @records = (); - if ( $opt{'records'} ) { - @records = @{ $opt{'records'} }; - } else { - @records = qsearch( $opt{'table'}, ( $opt{'hashref'} || {} ) ); - } - - my @pre_options = $opt{'pre_options'} ? @{ $opt{'pre_options'} } : (); - -%> - - + 'pre_options' => [ 'value' => 'option' ], #before normal options + 'post_options' => [ 'value' => 'option' ], #after normal options + 'empty_label' => '', #better specify it though, the default might change + 'multiple' => 0, # bool + 'all_selected' => 0, # useful with multiple + 'disable_empty' => 0, # bool (implied by multiple) + 'label_showkey' => 0, # bool + 'label_callback' => sub { my $record = shift; return "label"; }, + + #more params controlling HTML stuff about the element + 'onchange' => '', #javascript code + + #params (well, a param) controlling the