Skip to content

Commit

Permalink
Update genJSfromSugar.php
Browse files Browse the repository at this point in the history
Add support for Google Maps keys
  • Loading branch information
QuickCRM authored Jun 27, 2018
1 parent 5c6899d commit 1c31d15
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions modules/Administration/genJSfromSugar.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,26 @@ function createDefaultLocalization() {
$str .= ' aos_installed = false,';
}
$str .= ' securitysuite = '.(in_array ('SecurityGroups',$moduleList)?'true':'false').',';
$str .= ' offline_max_days = 0;';
$str .= 'var quickcrm_upd_time = "'.time().'";';
$str .= "var CustomHTML=".(file_exists("custom/QuickCRM/home.html")?"true":"false").";";
$str .= "var CustomJS=".(file_exists("custom/QuickCRM/custom.js")?"true":"false").";";
$str .= ' offline_max_days = 0;';
$str .= 'var quickcrm_upd_time = "'.time().'";';

$google_key = '';
if (isset($administration->settings['jjwg_google_maps_api_key'])){
$google_key=$administration->settings['jjwg_google_maps_api_key'];
}
else if (isset($sugar_config['google_maps_api_key'])) {
$google_key = $sugar_config['google_maps_api_key'];
}
if ($google_key !='') {
$str .= 'QCRM.google_api_key="'.$google_key.'";';
}
if (isset($sugar_config['google_api_ios_key'])) {
$str .= 'QCRM.google_api_ios_key="'.$sugar_config['google_api_ios_key'].'";';
}
if (isset($sugar_config['google_api_android_key'])) {
$str .= 'QCRM.google_api_android_key="'.$sugar_config['google_api_android_key'].'";';
}


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

Expand Down

0 comments on commit 1c31d15

Please sign in to comment.