X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fselect-part_pkg.html;h=d54f2831bf7dad314ddc5cd5c08cdc2b6c519de3;hb=5ebeeda12a588c1db792fcc8954aeeedb54a84b2;hp=237d7df0af4e9a56f6cffcc720679b4bb333057f;hpb=8c5702cc86a16f25a9ceb9b822b2aac6a324afaa;p=freeside.git
diff --git a/httemplate/elements/select-part_pkg.html b/httemplate/elements/select-part_pkg.html
index 237d7df0a..d54f2831b 100644
--- a/httemplate/elements/select-part_pkg.html
+++ b/httemplate/elements/select-part_pkg.html
@@ -9,6 +9,8 @@ Example:
#opt
'part_pkg' => \@records,
+ 'showdisabled' => 1, #defaults to 0, shows disabled if true
+ 'toggle_disabled' => 1, #implies showdisabled, adds js to toggle display of disabled
#select-table.html options
)
@@ -23,8 +25,45 @@ Example:
'empty_label' => 'Select package', #should this be the default?
'label_callback' => $opt{'label_callback'} || sub { shift->pkg_comment_only },
'hashref' => \%hash,
+ $opt{'toggle_disabled'} ? (
+ 'extra_option_attributes' => [ 'disabled' ],
+ 'hidden_sub' => sub { my $rec = shift; $rec->disabled; },
+ ) : (),
%opt,
&>
+
+% if ($opt{'toggle_disabled'}) {
+% unless ($toggle_disabled_init) {
+% $toggle_disabled_init = 1;
+
+
+
+% } # unless $toggle_disabled_init
+
+
<% emt("show disabled packages") %>
+
+% } # if $opt{'toggle_disabled'}
+
+<%shared>
+my $toggle_disabled_init = 0;
+%shared>
<%init>
my( %opt ) = @_;
@@ -32,6 +71,8 @@ my( %opt ) = @_;
$opt{'records'} = delete $opt{'part_pkg'}
if $opt{'part_pkg'};
+$opt{'showdisabled'} = 1 if $opt{'toggle_disabled'};
+
my %hash = ();
$hash{'disabled'} = '' unless $opt{'showdisabled'};