PMC-1306 Add new attribute mobile_offline_tables_download_interval related to the env.ini configuration

This commit is contained in:
Roly Rudy Gutierrez Pinto
2019-10-22 16:15:42 -04:00
parent 1ad3d6ad62
commit 9312229f83
5 changed files with 238 additions and 15 deletions

View File

@@ -696,9 +696,8 @@ class Light
$sAppDocUid = $oAppDocument->getAppDocUid();
$iDocVersion = $oAppDocument->getDocVersion();
$info = pathinfo($oAppDocument->getAppDocFilename());
$ext = (isset($info['extension']) ? $info['extension'] : '');//BUG fix: must handle files without any extension
$ext = (isset($info['extension']) ? $info['extension'] : ''); //BUG fix: must handle files without any extension
//$app_uid = G::getPathFromUID($oAppDocument->Fields['APP_UID']);
$file = G::getPathFromFileUID($oAppDocument->Fields['APP_UID'], $sAppDocUid);
$realPath = PATH_DOCUMENT . G::getPathFromUID($app_uid) . '/' . $file[0] . $file[1] . '_' . $iDocVersion . '.' . $ext;
@@ -1358,12 +1357,14 @@ class Light
*/
public function getConfiguration($params)
{
$response = [];
$sysConf = Bootstrap::getSystemConfiguration('', '', config("system.workspace"));
$multiTimeZone = false;
//Set Time Zone
/*----------------------------------********---------------------------------*/
if (\PMLicensedFeatures::getSingleton()->verifyfeature('oq3S29xemxEZXJpZEIzN01qenJUaStSekY4cTdJVm5vbWtVM0d4S2lJSS9qUT0=')) {
$multiTimeZone = (int)($sysConf['system_utc_time_zone']) == 1;
$multiTimeZone = (int) ($sysConf['system_utc_time_zone']) == 1;
}
/*----------------------------------********---------------------------------*/
$tz = isset($_SESSION['USR_TIME_ZONE']) ? $_SESSION['USR_TIME_ZONE'] : $sysConf['time_zone'];
@@ -1423,6 +1424,8 @@ class Light
$response['tz'] = isset($_SESSION['USR_TIME_ZONE']) ? $_SESSION['USR_TIME_ZONE'] : $sysConf['time_zone'];
}
$response['mobile_offline_tables_download_interval'] = $sysConf['mobile_offline_tables_download_interval'];
return $response;
}
@@ -1431,13 +1434,13 @@ class Light
switch (substr($size_str, -1)) {
case 'M':
case 'm':
return (int)$size_str * 1048576;
return (int) $size_str * 1048576;
case 'K':
case 'k':
return (int)$size_str * 1024;
return (int) $size_str * 1024;
case 'G':
case 'g':
return (int)$size_str * 1073741824;
return (int) $size_str * 1073741824;
default:
return $size_str;
}

View File

@@ -73,7 +73,8 @@ class System
'files_white_list' => '',
'delay' => '0',
'tries' => '10',
'retry_after' => '90'
'retry_after' => '90',
'mobile_offline_tables_download_interval' => 24
];
/**
@@ -1203,6 +1204,15 @@ class System
$config['proxy_pass'] = G::decrypt($config['proxy_pass'], 'proxy_pass');
}
/**
* Here if you validate if the type of data obtained from the configuration
* files are valid, otherwise the default value is used.
*/
$value = (string) $config['mobile_offline_tables_download_interval'];
if (!is_numeric($value)) {
$config['mobile_offline_tables_download_interval'] = self::$defaultConfig['mobile_offline_tables_download_interval'];
}
return $config;
}