From 81e426fe755eaea508041bc2d7b25ac44c777434 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 25 Sep 2009 10:14:30 +0000 Subject: nomadix, RT#5876 --- httemplate/elements/select-part_svc.html | 18 ++++++++++++++++++ httemplate/elements/select-table.html | 11 +++++++++-- httemplate/elements/tr-select-part_svc.html | 7 ++----- 3 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 httemplate/elements/select-part_svc.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/select-part_svc.html b/httemplate/elements/select-part_svc.html new file mode 100644 index 000000000..72ab7f6b0 --- /dev/null +++ b/httemplate/elements/select-part_svc.html @@ -0,0 +1,18 @@ +<% include( '/elements/select-table.html', + 'table' => 'part_svc', + 'name_col' => 'svc', + 'label_showkey' => 1, + #N/A 'empty_label' => '(none)', + %opt, + ) +%> +<%init> + +my( %opt ) = @_; + +$opt{'records'} = delete $opt{'part_svc'} + if $opt{'part_svc'}; + +$opt{'records'} ||= [ qsearch( 'part_svc', {} ) ]; # { disabled=>'' } ) + + diff --git a/httemplate/elements/select-table.html b/httemplate/elements/select-table.html index 1a440f07e..10a8b2741 100644 --- a/httemplate/elements/select-table.html +++ b/httemplate/elements/select-table.html @@ -34,6 +34,7 @@ Example: 'empty_label' => '', #better specify it though, the default might change 'multiple' => 0, # bool '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