From ecd1baba392d971b49a50f133349f85aaec548a0 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sat, 7 Sep 2013 02:05:53 -0700 Subject: select multiple package classes (or report classes) on sales report, RT#24776 --- httemplate/elements/select-table.html | 6 +- httemplate/graph/cust_bill_pkg.cgi | 169 ++++++++++++++++++----------- httemplate/graph/report_cust_bill_pkg.html | 98 +++++++++++------ httemplate/search/cust_bill_pkg.cgi | 23 ++-- 4 files changed, 191 insertions(+), 105 deletions(-) (limited to 'httemplate') diff --git a/httemplate/elements/select-table.html b/httemplate/elements/select-table.html index b6c1573d1..9f26a3591 100644 --- a/httemplate/elements/select-table.html +++ b/httemplate/elements/select-table.html @@ -37,6 +37,7 @@ Example: '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"; }, @@ -75,8 +76,9 @@ Example: % while ( @pre_options ) { % my $pre_opt = shift(@pre_options); % my $pre_label = shift(@pre_options); -% my $selected = ( ref($value) && $value->{$pre_opt} ) -% || ( $value eq $pre_opt ); +% my $selected = $opt{'all_selected'} +% || ( ref($value) && $value->{$pre_opt} ) +% || ( $value eq $pre_opt );