From d5cdad7fae9c5e45701a7e83abeb903d31b7983f Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Tue, 28 Feb 2012 16:17:59 -0800 Subject: directions to customer address, #16585 --- httemplate/elements/coord-links.html | 18 +++++++++++++++++- httemplate/elements/tr-coords.html | 4 ++-- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'httemplate/elements') 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, + &> +% } + <% mt('earth') |h %> <%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); +} 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 @@ <% $latitude %>  <% mt('Longitude') |h %> <% $longitude %> - <& /elements/coord-links.html, $latitude, $longitude, $name &> + <& /elements/coord-links.html, @_ &> <%init> -my ($latitude, $longitude, $name) = @_; +my ($latitude, $longitude, $name, $agentnum) = @_; -- cgit v1.2.1