[freeside-commits] freeside/httemplate/view kml.cgi,1.1,1.2

Ivan,,, ivan at wavetail.420.am
Wed Dec 21 17:52:05 PST 2011


Update of /home/cvs/cvsroot/freeside/httemplate/view
In directory wavetail.420.am:/tmp/cvs-serv9889

Modified Files:
	kml.cgi 
Log Message:
google earth links should now show a filename of customer_name.kmz, RT#15539

Index: kml.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/kml.cgi,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- kml.cgi	13 Dec 2011 05:09:32 -0000	1.1
+++ kml.cgi	22 Dec 2011 01:52:03 -0000	1.2
@@ -1,13 +1,11 @@
 <% $kml->archive %>\
 <%init>
 
-my ($latitude, $longitude, $name) = @_;
-#would be nice to pass in customer or prospect name too...
-
 my $kml = Geo::GoogleEarth::Pluggable->new;
 $kml->Point( map { $_=>scalar($cgi->param($_)) } qw( name lat lon ) );
 
 #http_header('Content-Type' => 'application/vnd.google-earth.kml+xml' ); #kml
 http_header('Content-Type' => 'application/vnd.google-earth.kmz' ); #kmz
-
+( my $name = $cgi->param('name') ) =~ s/[^a-z0-9]/_/g; #perhaps too restrictive
+http_header('Content-Disposition' => "filename=$name.kmz" );
 </%init>



More information about the freeside-commits mailing list