projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
abb5095
)
only show coordinate fields where necessary, #940
author
Mark Wells
<mark@freeside.biz>
Mon, 27 Aug 2012 06:05:04 +0000
(23:05 -0700)
committer
Mark Wells
<mark@freeside.biz>
Tue, 28 Aug 2012 23:55:25 +0000
(16:55 -0700)
httemplate/edit/cust_main.cgi
patch
|
blob
|
history
httemplate/elements/location.html
patch
|
blob
|
history
httemplate/elements/tr-select-cust_location.html
patch
|
blob
|
history
httemplate/misc/payment.cgi
patch
|
blob
|
history
diff --git
a/httemplate/edit/cust_main.cgi
b/httemplate/edit/cust_main.cgi
index
9b30d31
..
e3e812f
100755
(executable)
--- a/
httemplate/edit/cust_main.cgi
+++ b/
httemplate/edit/cust_main.cgi
@@
-53,6
+53,7
@@
<& /elements/location.html,
object => $cust_main->bill_location,
prefix => 'bill_',
<& /elements/location.html,
object => $cust_main->bill_location,
prefix => 'bill_',
+ enable_coords => 1,
&>
<& cust_main/after_bill_location.html, $cust_main &>
</TABLE>
&>
<& cust_main/after_bill_location.html, $cust_main &>
</TABLE>
@@
-77,6
+78,7
@@
prefix => 'ship_',
enable_censustract => 1,
enable_district => 1,
prefix => 'ship_',
enable_censustract => 1,
enable_district => 1,
+ enable_coords => 1,
&>
</TABLE>
<TABLE CLASS="fsinnerbox" ID="table_ship_location_blank"
&>
</TABLE>
<TABLE CLASS="fsinnerbox" ID="table_ship_location_blank"
diff --git
a/httemplate/elements/location.html
b/httemplate/elements/location.html
index
7672318
..
5c7c888
100644
(file)
--- a/
httemplate/elements/location.html
+++ b/
httemplate/elements/location.html
@@
-11,8
+11,10
@@
Example:
'no_asterisks' => 0, #set true to disable the red asterisks next
#to required fields
'address1_label' => 'Address', #label for address
'no_asterisks' => 0, #set true to disable the red asterisks next
#to required fields
'address1_label' => 'Address', #label for address
+ 'enable_coords' => 1, #show latitude/longitude fields
'enable_district' => 1, #show tax district field
'enable_censustract' => 1, #show censustract field
'enable_district' => 1, #show tax district field
'enable_censustract' => 1, #show censustract field
+
)
</%doc>
)
</%doc>
@@
-175,6
+177,7
@@
Example:
<TD COLSPAN=6><% include('/elements/select-country.html', %select_hash ) %></TD>
</TR>
<TD COLSPAN=6><% include('/elements/select-country.html', %select_hash ) %></TD>
</TR>
+% if ( $opt{enable_coords} ) {
<TR>
<TD ALIGN="right"><% mt('Latitude') |h %></TH>
<TD COLSPAN=7>
<TR>
<TD ALIGN="right"><% mt('Latitude') |h %></TH>
<TD COLSPAN=7>
@@
-195,6
+198,11
@@
Example:
>
</TD>
</TR>
>
</TD>
</TR>
+% } else {
+% foreach (qw(latitude longitude)) {
+<INPUT TYPE="hidden" NAME="<% $_ %>" VALUE="<% $object->get($_) |h%>">
+% }
+% }
<INPUT TYPE="hidden" NAME="<%$pre%>coord_auto" VALUE="<% $object->coord_auto %>">
<INPUT TYPE="hidden" NAME="<%$pre%>geocode" VALUE="<% $object->geocode %>">
<INPUT TYPE="hidden" NAME="<%$pre%>coord_auto" VALUE="<% $object->coord_auto %>">
<INPUT TYPE="hidden" NAME="<%$pre%>geocode" VALUE="<% $object->geocode %>">
diff --git
a/httemplate/elements/tr-select-cust_location.html
b/httemplate/elements/tr-select-cust_location.html
index
d9e3e9e
..
b804f45
100644
(file)
--- a/
httemplate/elements/tr-select-cust_location.html
+++ b/
httemplate/elements/tr-select-cust_location.html
@@
-216,6
+216,7
@@
Example:
'no_asterisks' => 1,
'no_bold' => $opt{'no_bold'},
'alt_format' => $opt{'alt_format'},
'no_asterisks' => 1,
'no_bold' => $opt{'no_bold'},
'alt_format' => $opt{'alt_format'},
+ 'enable_coords'=> 1,
)
%>
<SCRIPT TYPE="text/javascript">
)
%>
<SCRIPT TYPE="text/javascript">
diff --git
a/httemplate/misc/payment.cgi
b/httemplate/misc/payment.cgi
index
2d73072
..
b4e3a6f
100644
(file)
--- a/
httemplate/misc/payment.cgi
+++ b/
httemplate/misc/payment.cgi
@@
-78,7
+78,7
@@
</TR>
<& /elements/location.html,
</TR>
<& /elements/location.html,
- 'object' => $cust_main
, #XXX errors???
+ 'object' => $cust_main
->bill_location,
'no_asterisks' => 1,
'address1_label' => emt('Card billing address'),
&>
'no_asterisks' => 1,
'address1_label' => emt('Card billing address'),
&>
@@
-251,6
+251,10
@@
my $custnum = $1;
my $cust_main = qsearchs( 'cust_main', { 'custnum'=>$custnum } );
die "unknown custnum $custnum" unless $cust_main;
my $cust_main = qsearchs( 'cust_main', { 'custnum'=>$custnum } );
die "unknown custnum $custnum" unless $cust_main;
+my $location = $cust_main->bill_location;
+# no proper error handling on this anyway, but when we have it,
+# remember to repopulate fields in $location
+
my $balance = $cust_main->balance;
my $payinfo = '';
my $balance = $cust_main->balance;
my $payinfo = '';