diff options
author | ivan <ivan> | 2011-12-13 05:10:23 +0000 |
---|---|---|
committer | ivan <ivan> | 2011-12-13 05:10:23 +0000 |
commit | b429a422185206c645c84ec1c3540494d336b943 (patch) | |
tree | b08fba0581e3569b2cf1e9bce5a8172c6921497c /httemplate/elements | |
parent | b0329dafd35e0296ec61fef4c35a687ff8866764 (diff) |
add latitude/longitude to prospects, customers and package locations, RT#15539
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/city.html | 3 | ||||
-rw-r--r-- | httemplate/elements/coord-links.html | 22 | ||||
-rw-r--r-- | httemplate/elements/location.html | 24 | ||||
-rw-r--r-- | httemplate/elements/popup_link.html | 1 | ||||
-rw-r--r-- | httemplate/elements/tr-coords.html | 14 | ||||
-rw-r--r-- | httemplate/elements/tr-select-cust_location.html | 4 |
6 files changed, 66 insertions, 2 deletions
diff --git a/httemplate/elements/city.html b/httemplate/elements/city.html index 956d353bd..29495df43 100644 --- a/httemplate/elements/city.html +++ b/httemplate/elements/city.html @@ -123,6 +123,9 @@ my $pre = $opt{'prefix'}; my $text_style = $opt{'style'} ? [ @{ $opt{'style'} } ] : []; my $select_style = $opt{'style'} ? [ @{ $opt{'style'} } ] : []; +push @$text_style, @{ $opt{'text_style'} } if $opt{'text_style'}; +push @$select_style, @{ $opt{'select_style'} } if $opt{'select_style'}; + my @cities = cities( $opt{'county'}, $opt{'state'}, $opt{'country'} ); my $saved_city = ''; if ( scalar(@cities) > 1 || $cities[0] ) { diff --git a/httemplate/elements/coord-links.html b/httemplate/elements/coord-links.html new file mode 100644 index 000000000..907e5f04a --- /dev/null +++ b/httemplate/elements/coord-links.html @@ -0,0 +1,22 @@ +<& /elements/init_overlib.html &> + +<& /elements/popup_link.html, + 'action' => $p. 'view/map.html?'. $query, + 'label' => mt('map'), + 'actionlabel' => $name, + 'width' => 763, + 'height' => 575, + #'color' +&> + +<A HREF="<%$p%>view/kml.cgi?<% $query %>"><% mt('earth') |h %></A> + +<%init> + +my ($latitude, $longitude, $name) = @_; + +my $query = 'name='. uri_escape($name). + ';lat='. $latitude. + ';lon='. $longitude; + +</%init> diff --git a/httemplate/elements/location.html b/httemplate/elements/location.html index 48c6159bb..c5509c1a9 100644 --- a/httemplate/elements/location.html +++ b/httemplate/elements/location.html @@ -149,7 +149,7 @@ Example: <TR> <<%$th%> ALIGN="right"><%$r%><% mt('City') |h %></<%$th%>> - <TD WIDTH="1"><% include('/elements/city.html', %select_hash) %></TD> + <TD WIDTH="1"><% include('/elements/city.html', %select_hash, 'text_style' => \@style ) %></TD> <<%$th%> ALIGN="right" WIDTH="1" ID="<%$pre%>countylabel" <%$county_style%>><%$r%>County</<%$th%>> <TD WIDTH="1"><% include('/elements/select-county.html', %select_hash ) %></TD> <<%$th%> ALIGN="right" WIDTH="1"><%$r%><% mt('State') |h %></<%$th%>> @@ -175,6 +175,28 @@ Example: <TD COLSPAN=6><% include('/elements/select-country.html', %select_hash ) %></TD> </TR> +<TR> + <TD ALIGN="right"><% mt('Latitude') |h %></TH> + <TD COLSPAN=7> + <INPUT TYPE = "text" + NAME = "<%$pre%>latitude" + ID = "<%$pre%>latitude" + VALUE = "<% $object->get($pre.'latitude') |h %>" + <% $disabled %> + <% $style %> + > + <% mt('Longitude') |h %> + <INPUT TYPE = "text" + NAME = "<%$pre%>longitude" + ID = "<%$pre%>longitude" + VALUE = "<% $object->get($pre.'longitude') |h %>" + <% $disabled %> + <% $style %> + > + </TD> +</TR> +<INPUT TYPE="hidden" NAME="<%$pre%>coord_auto" VALUE="<% $object->get($pre.'coord_auto') %>"> + % if ( !$pre ) { <INPUT TYPE="hidden" NAME="geocode" VALUE="<% $opt{geocode} %>"> % } else { diff --git a/httemplate/elements/popup_link.html b/httemplate/elements/popup_link.html index fbb6ce3b8..e5f8c61ca 100644 --- a/httemplate/elements/popup_link.html +++ b/httemplate/elements/popup_link.html @@ -46,6 +46,7 @@ if (ref($_[0]) eq 'HASH') { } my $label = $params->{'label'}; +$label =~ s/ / /g; my $onclick = include('/elements/popup_link_onclick.html', $params); </%init> diff --git a/httemplate/elements/tr-coords.html b/httemplate/elements/tr-coords.html new file mode 100644 index 000000000..5539f565e --- /dev/null +++ b/httemplate/elements/tr-coords.html @@ -0,0 +1,14 @@ +<TR> + <TD ALIGN="right"><% mt('Latitude') |h %></TD> + <TD COLSPAN=5> + <FONT STYLE="background-color: #ffffff; border: 1px solid #ffffff"><% $latitude %></FONT> + <% mt('Longitude') |h %> + <FONT STYLE="background-color: #ffffff; border: 1px solid #ffffff"><% $longitude %></FONT> + <& /elements/coord-links.html, $latitude, $longitude, $name &> + </TD> +</TR> +<%init> + +my ($latitude, $longitude, $name) = @_; + +</%init> diff --git a/httemplate/elements/tr-select-cust_location.html b/httemplate/elements/tr-select-cust_location.html index a876f6225..0ca255b3e 100644 --- a/httemplate/elements/tr-select-cust_location.html +++ b/httemplate/elements/tr-select-cust_location.html @@ -270,7 +270,9 @@ if ( $cgi->param('error') ) { my $editable = $cust_main ? 0 : 1; #could use explicit control my $addnew = $cust_main ? 1 : ( $locationnum>0 ? 0 : 1 ); -my @location_fields = qw( address1 address2 city county state zip country ); +my @location_fields = qw( address1 address2 city county state zip country + latitude longitude + ); if ( $opt{'alt_format'} ) { push @location_fields, qw( location_type location_number location_kind ); } |