72456: Directions - override company_address
authorJonathan Prykop <jonathan@freeside.biz>
Mon, 26 Sep 2016 18:46:03 +0000 (13:46 -0500)
committerJonathan Prykop <jonathan@freeside.biz>
Mon, 26 Sep 2016 18:46:03 +0000 (13:46 -0500)
FS/FS/Conf.pm
httemplate/elements/coord-links.html

index 6bfbf98..a7e5d94 100644 (file)
@@ -2076,6 +2076,14 @@ and customer address. Include units.',
   },
 
   {
+    'key'         => 'company_physical_address',
+    'section'     => 'addresses',
+    'description' => 'Your physical company address, for use in supplying google map directions, defaults to company_address',
+    'type'        => 'textarea',
+    'per_agent'   => 1,
+  },
+
+  {
     'key'         => 'show_ship_company',
     'section'     => 'addresses',
     'description' => 'Turns on display/collection of a "service company name" field for customers.',
index f27ffd3..586a710 100644 (file)
@@ -51,7 +51,8 @@ my $apikey = $conf->config('google_maps_api_key');
 #for directions link
 my @origin = $opt{company_address}
                ? @{ $opt{company_address} }
-               : $conf->config('company_address', $agentnum);
+               : ( $conf->config('company_physical_address', $agentnum) ||
+                   $conf->config('company_address', $agentnum) );
 my $origin = uri_escape(join(',', @origin));
 
 </%init>