& /elements/init_overlib.html &>
<& /elements/popup_link.html,
'action' => $p. 'view/map.html?'. $query,
'label' => mt('map'),
'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 %opt = ();
my ($latitude, $longitude, $name, $agentnum);
if ( ref($_[0]) ) {
%opt = %{ $_[0] };
$latitude = $opt{latitude};
$longitude = $opt{longitude};
$name = $opt{name};
$agentnum = $opt{agentnum};
} else {
($latitude, $longitude, $name, $agentnum) = @_;
}
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/'$//;
#for directions link
my @origin = $opt{company_address}
? @{ $opt{company_address} }
: FS::Conf->new->config('company_address', $agentnum);
my $origin = uri_escape(join(',', @origin));
%init>