X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fcoord-links.html;h=02a224a00124f1453e2408f962b538b0bb991f5e;hb=c14b35ce12141287e201bba8489b202a1b34b38f;hp=907e5f04a0e15fdd2114dbb0b7fd430c03555722;hpb=8cbe016ac2c28cd209c48f053f361573368e7988;p=freeside.git diff --git a/httemplate/elements/coord-links.html b/httemplate/elements/coord-links.html index 907e5f04a..02a224a00 100644 --- a/httemplate/elements/coord-links.html +++ b/httemplate/elements/coord-links.html @@ -3,20 +3,42 @@ <& /elements/popup_link.html, 'action' => $p. 'view/map.html?'. $query, 'label' => mt('map'), - 'actionlabel' => $name, + 'actionlabel' => $js_name, 'width' => 763, 'height' => 575, #'color' &> +% if ( $origin ) { + <& /elements/popup_link.html, + 'action' => $p. "view/directions.html?origin=$origin;". $query, + 'label' => mt('directions'), + 'actionlabel' => $js_name, + 'width' => 763, + 'height' => 575, + &> +% } + <% mt('earth') |h %> <%init> -my ($latitude, $longitude, $name) = @_; +my ($latitude, $longitude, $name, $agentnum) = @_; -my $query = 'name='. uri_escape($name). +my $query = 'name='. uri_escape_utf8($name). ';lat='. $latitude. ';lon='. $longitude; +my $js_name = $name; +$js_name =~ s/[<>"]/ /g; +$m->interp->apply_escapes($js_name, 'js_string'); +$js_name =~ s/^'//; +$js_name =~ s/'$//; + +my $origin; +#for directions link +if ( $agentnum =~ /^\d+$/ ) { + $origin = FS::Conf->new->config('company_address', $agentnum); + $origin = uri_escape($origin); +}