summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-08-11 16:18:24 -0700
committerIvan Kohler <ivan@freeside.biz>2013-08-11 16:18:24 -0700
commit35e5b12fb55f229edd16bed66e21c5806b8d3b7e (patch)
tree4c36e5b3821e92cfe773a4d57a82d9172ecf62aa /httemplate/elements
parent9005d0ad058eee59bacafe26217ed4fda2da1800 (diff)
parent98ea745e4b55a38ad8b5ba3749c56327d641d65d (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/location.html36
-rw-r--r--httemplate/elements/tr-input-pkg-quantity.html15
2 files changed, 51 insertions, 0 deletions
diff --git a/httemplate/elements/location.html b/httemplate/elements/location.html
index 41a67a0cb..df5106cb0 100644
--- a/httemplate/elements/location.html
+++ b/httemplate/elements/location.html
@@ -244,6 +244,42 @@ Example:
%# Placeholders
<INPUT TYPE="hidden" NAME="<%$pre%>cachenum" VALUE="">
<INPUT TYPE="hidden" NAME="<%$pre%>addr_clean" VALUE="">
+
+<SCRIPT TYPE="text/javascript">
+// the strictly correct way to append something to window.onload
+window.addEventListener('load', function() {
+ var clear_coords_ids = [
+ '<%$pre%>latitude',
+ '<%$pre%>longitude',
+ 'enter_censustract',
+ '<%$pre%>district'
+ ];
+ function clear_coords() {
+ for (var i=0; i < clear_coords_ids.length; i++) {
+ var el = document.getElementById(clear_coords_ids[i]);
+ if ( el ) {
+ el.value = '';
+ }
+ }
+ }
+ var clear_coords_on_change = [
+ '<%$pre%>address1',
+ '<%$pre%>address2',
+ '<%$pre%>city',
+ '<%$pre%>state',
+ '<%$pre%>zip',
+ '<%$pre%>country',
+ ];
+ for (var i=0; i < clear_coords_on_change.length; i++) {
+ var el = document.getElementById(clear_coords_on_change[i]);
+ if ( el ) {
+ // because some of these already have onchange triggers
+ el.addEventListener('change', clear_coords);
+ }
+ }
+});
+</SCRIPT>
+
<%init>
my %opt = @_;
diff --git a/httemplate/elements/tr-input-pkg-quantity.html b/httemplate/elements/tr-input-pkg-quantity.html
new file mode 100644
index 000000000..7ade57399
--- /dev/null
+++ b/httemplate/elements/tr-input-pkg-quantity.html
@@ -0,0 +1,15 @@
+% if ( FS::Conf->new->exists('invoice-unitprice') or $curr_value > 1 ) {
+ <TR>
+ <TH ALIGN="right"><% mt('Quantity') |h %>
+ </TH>
+ <TD>
+ <INPUT TYPE="text" NAME="quantity" SIZE=4 VALUE="<% $curr_value |h %>">
+ </TD>
+ </TR>
+% } else {
+ <INPUT TYPE="hidden" NAME="quantity" VALUE="1">
+% }
+<%init>
+my %opt = @_;
+my $curr_value = $cgi->param('quantity') || $opt{'curr_value'} || 1;
+</%init>