summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/coord-links.html18
-rw-r--r--httemplate/elements/tr-coords.html4
2 files changed, 19 insertions, 3 deletions
diff --git a/httemplate/elements/coord-links.html b/httemplate/elements/coord-links.html
index 907e5f04a..6b91a26e8 100644
--- a/httemplate/elements/coord-links.html
+++ b/httemplate/elements/coord-links.html
@@ -9,14 +9,30 @@
#'color'
&>
+% if ( $origin ) {
+ <& /elements/popup_link.html,
+ 'action' => $p. "view/directions.html?origin=$origin;". $query,
+ 'label' => mt('dir'),
+ 'actionlabel' => $name,
+ 'width' => 763,
+ 'height' => 575,
+ &>
+% }
+
<A HREF="<%$p%>view/kml.cgi?<% $query %>"><% mt('earth') |h %></A>
<%init>
-my ($latitude, $longitude, $name) = @_;
+my ($latitude, $longitude, $name, $agentnum) = @_;
my $query = 'name='. uri_escape($name).
';lat='. $latitude.
';lon='. $longitude;
+my $origin;
+#for directions link
+if ( $agentnum =~ /^\d+$/ ) {
+ $origin = FS::Conf->new->config('company_address', $agentnum);
+ $origin = uri_escape($origin);
+}
</%init>
diff --git a/httemplate/elements/tr-coords.html b/httemplate/elements/tr-coords.html
index 5539f565e..3248dc2de 100644
--- a/httemplate/elements/tr-coords.html
+++ b/httemplate/elements/tr-coords.html
@@ -4,11 +4,11 @@
<FONT STYLE="background-color: #ffffff; border: 1px solid #ffffff"><% $latitude %></FONT>
&nbsp;<% mt('Longitude') |h %>
<FONT STYLE="background-color: #ffffff; border: 1px solid #ffffff"><% $longitude %></FONT>
- <& /elements/coord-links.html, $latitude, $longitude, $name &>
+ <& /elements/coord-links.html, @_ &>
</TD>
</TR>
<%init>
-my ($latitude, $longitude, $name) = @_;
+my ($latitude, $longitude, $name, $agentnum) = @_;
</%init>