X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fcoord-links.html;h=c885ade87e5b4e8de443d70b8057c3aaf2b3ac38;hb=06fd3d9f3ca53b2d2f7595e55be4b129ca69511c;hp=4c263c638b63ff592bcfbd107db9fb83a1ccb8d4;hpb=bfefb704d76fffc1ab82626c8dec03931457a1cb;p=freeside.git diff --git a/httemplate/elements/coord-links.html b/httemplate/elements/coord-links.html index 4c263c638..c885ade87 100644 --- a/httemplate/elements/coord-links.html +++ b/httemplate/elements/coord-links.html @@ -23,7 +23,17 @@ <%init> -my ($latitude, $longitude, $name, $agentnum) = @_; +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. @@ -35,12 +45,10 @@ $m->interp->apply_escapes($js_name, 'js_string'); $js_name =~ s/^'//; $js_name =~ s/'$//; -my @origin; -my $origin; #for directions link -if ( $agentnum =~ /^\d+$/ ) { - @origin = FS::Conf->new->config('company_address', $agentnum); - $origin = join (/,/,@origin); - $origin = uri_escape($origin); -} +my @origin = $opt{company_address} + ? @{ $opt{company_address} } + : FS::Conf->new->config('company_address', $agentnum); +my $origin = uri_escape(join(',', @origin)); +