[freeside-commits] freeside/httemplate/browse cust_main_county.cgi, 1.16.2.10, 1.16.2.11
Ivan,,,
ivan at wavetail.420.am
Thu Jul 23 06:36:37 PDT 2009
Update of /home/cvs/cvsroot/freeside/httemplate/browse
In directory wavetail.420.am:/tmp/cvs-serv30965
Modified Files:
Tag: FREESIDE_1_7_BRANCH
cust_main_county.cgi
Log Message:
add back collapse county links to tax config (backport)
Index: cust_main_county.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/browse/cust_main_county.cgi,v
retrieving revision 1.16.2.10
retrieving revision 1.16.2.11
diff -u -d -r1.16.2.10 -r1.16.2.11
--- cust_main_county.cgi 28 Dec 2008 19:10:31 -0000 1.16.2.10
+++ cust_main_county.cgi 23 Jul 2009 13:36:35 -0000 1.16.2.11
@@ -23,10 +23,6 @@
'link_onclicks' => \@link_onclicks,
)
%>
-%
-% # <FONT SIZE=-1><A HREF="<% $p %>edit/process/cust_main_county-collapse.cgi?<% $hashref->{taxnum} %>">collapse state</A></FONT>
-% # % }
-%
<%once>
my $conf = new FS::Conf;
@@ -102,6 +98,17 @@
'</FONT>';
}
+sub collapse_link {
+ my %param = @_;
+
+ my $taxnum = $param{'row'}->taxnum;
+ my $url = "${p}edit/process/cust_main_county-collapse.cgi?$taxnum";
+ $url = "javascript:collapse_areyousure('$url')";
+
+ qq(<FONT SIZE="-1"><A HREF="$url">$param{'label'}</A></FONT>);
+}
+
+
sub separate_taxclasses_link {
my( $row ) = @_;
my $taxnum = $row->taxnum;
@@ -110,6 +117,8 @@
qq!<FONT SIZE="-1"><A HREF="$url">!;
}
+#un-separate taxclasses too
+
</%once>
<%init>
@@ -122,9 +131,18 @@
my @menubar;
-my $html_init =
- "Click on <u>add states</u> to specify a country's tax rates by state or province.
- <BR>Click on <u>add counties</u> to specify a state's tax rates by county.";
+my $html_init = <<END;
+ <SCRIPT>
+ function collapse_areyousure(href) {
+ if (confirm("Are you sure you want to remove all county tax rates for this state?") == true)
+ window.location.href = href;
+ }
+ </SCRIPT>
+
+ Click on <u>add states</u> to specify a country's tax rates by state or province.
+ <BR>Click on <u>add counties</u> to specify a state's tax rates by county, or <u>remove counties</u> to remove per-county tax rates.
+END
+
$html_init .= "<BR>Click on <u>separate taxclasses</u> to specify taxes per taxclass."
if $enable_taxclasses;
$html_init .= '<BR><BR>';
@@ -360,11 +378,16 @@
)
)
},
- sub { $_[0]->county || '(all) '.
- expand_link( desc => 'Add Counties',
- row => $_[0],
- label => 'add counties',
- )
+ sub { $_[0]->county
+ ? $_[0]->county. ' '.
+ collapse_link( label=> 'remove counties',
+ row => $_[0],
+ )
+ : '(all) '.
+ expand_link( desc => 'Add Counties',
+ row => $_[0],
+ label => 'add counties',
+ );
},
);
More information about the freeside-commits
mailing list