From 5f6b143801578ebcc30b97fba1b047f80fa232fe Mon Sep 17 00:00:00 2001 From: Mitch Jackson Date: Sun, 9 Dec 2018 17:53:20 -0500 Subject: RT# 81706 Fix for transparent customer menu tabs --- httemplate/elements/dropdown-menu.html | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'httemplate/elements') diff --git a/httemplate/elements/dropdown-menu.html b/httemplate/elements/dropdown-menu.html index 54447a23f..3c0f40f75 100644 --- a/httemplate/elements/dropdown-menu.html +++ b/httemplate/elements/dropdown-menu.html @@ -5,12 +5,17 @@ border: none; } +% if ( $opt{id} !~ /customer_/ ) { +% # Fix for changes to how jQuery UI applies state classes + #<% $opt{id} %> .ui-state-active { color: inherit; background-color: transparent; border-color: transparent; } +% } + #<% $opt{id} %> li { float: left; padding: .25em; -- cgit v1.2.1 From 88678677483b169d035d623cc1a07606dff6b046 Mon Sep 17 00:00:00 2001 From: Christopher Burger Date: Tue, 11 Dec 2018 18:45:36 -0500 Subject: RT# 74693 - Added city select when using tax classes --- httemplate/elements/select-city.html | 176 +++++++++++++++++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 httemplate/elements/select-city.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/select-city.html b/httemplate/elements/select-city.html new file mode 100644 index 000000000..09e28dd48 --- /dev/null +++ b/httemplate/elements/select-city.html @@ -0,0 +1,176 @@ +<%doc> + +Example: + + <& /elements/select-city.html, + #recommended + country => $current_country, + state => $current_state, + county => $current_county, + city => $current_city, + + #optional + prefix => $optional_unique_prefix, + onchange => $javascript, + disabled => 0, #bool + disable_empty => 1, #defaults to 1, set to 0 to disable the empty option + empty_label => 'all', #label for empty option + style => [ 'attribute:value', 'another:value' ], + &> + + +% if ( $cityflag ) { + + <% include('/elements/xmlhttp.html', + 'url' => $p.'misc/cities.cgi', + 'subs' => [ $pre. 'get_cities' ], + ) + %> + + + + + +% } else { + + + + + +% } + +<%init> + +my %opt = @_; +foreach my $opt (qw( city county state country prefix onchange disabled + empty_value )) { + $opt{$opt} = '' unless exists($opt{$opt}) && defined($opt{$opt}); +} + +$opt{'disable_empty'} = 1 unless exists($opt{'disable_empty'}); + +my $pre = $opt{'prefix'}; + +my $onchange = $opt{'onchange'}; + +my $city_style = $opt{'style'} ? [ @{ $opt{'style'} } ] : []; + +my @cities = (); +if ( $cityflag ) { + + @cities = map { length($_) ? $_ : $opt{'empty_data_value'} } + cities( $opt{'county'}, $opt{'state'}, $opt{'country'} ); + + push @$city_style, 'display:none' + unless scalar(@cities) > 1; + +} + +my $style = + scalar(@$city_style) + ? 'STYLE="'. join(';', @$city_style). '"' + : ''; + + +<%once> + +my $sql = "SELECT COUNT(*) FROM cust_main_county". + " WHERE city IS NOT NULL AND city != ''"; +my $sth = dbh->prepare($sql) or die dbh->errstr; +$sth->execute or die $sth->errstr; +my $cityflag = $sth->fetchrow_arrayref->[0]; + + \ No newline at end of file -- cgit v1.2.1 From 4d9e2d0980eb542aec39997b7bd92130b3a60676 Mon Sep 17 00:00:00 2001 From: Mitch Jackson Date: Tue, 18 Dec 2018 17:47:57 -0500 Subject: RT# 80488 Allow city select for tax_district_method=wa_sales --- httemplate/elements/city.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/city.html b/httemplate/elements/city.html index 05250fef5..3c5e91782 100644 --- a/httemplate/elements/city.html +++ b/httemplate/elements/city.html @@ -153,9 +153,7 @@ my %opt = @_; my $pre = $opt{'prefix'}; my $conf = new FS::Conf; -# Using tax_district_method implies that there's not a preloaded city/county -# tax district table. -my $disable_select = 1 if $conf->config('tax_district_method'); +my $disable_select = 0; $opt{'disable_empty'} = 1 unless exists($opt{'disable_empty'}); -- cgit v1.2.1