Skip to content

Commit 1c31d15

Browse files
authored
Update genJSfromSugar.php
Add support for Google Maps keys
1 parent 5c6899d commit 1c31d15

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

modules/Administration/genJSfromSugar.php

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,26 @@ function createDefaultLocalization() {
218218
$str .= ' aos_installed = false,';
219219
}
220220
$str .= ' securitysuite = '.(in_array ('SecurityGroups',$moduleList)?'true':'false').',';
221-
$str .= ' offline_max_days = 0;';
222-
$str .= 'var quickcrm_upd_time = "'.time().'";';
223-
$str .= "var CustomHTML=".(file_exists("custom/QuickCRM/home.html")?"true":"false").";";
224-
$str .= "var CustomJS=".(file_exists("custom/QuickCRM/custom.js")?"true":"false").";";
221+
$str .= ' offline_max_days = 0;';
222+
$str .= 'var quickcrm_upd_time = "'.time().'";';
223+
224+
$google_key = '';
225+
if (isset($administration->settings['jjwg_google_maps_api_key'])){
226+
$google_key=$administration->settings['jjwg_google_maps_api_key'];
227+
}
228+
else if (isset($sugar_config['google_maps_api_key'])) {
229+
$google_key = $sugar_config['google_maps_api_key'];
230+
}
231+
if ($google_key !='') {
232+
$str .= 'QCRM.google_api_key="'.$google_key.'";';
233+
}
234+
if (isset($sugar_config['google_api_ios_key'])) {
235+
$str .= 'QCRM.google_api_ios_key="'.$sugar_config['google_api_ios_key'].'";';
236+
}
237+
if (isset($sugar_config['google_api_android_key'])) {
238+
$str .= 'QCRM.google_api_android_key="'.$sugar_config['google_api_android_key'].'";';
239+
}
240+
225241

226242
$saveDir = realpath(dirname(__FILE__).'/../../../mobile/');
227243

0 commit comments

Comments
 (0)