HOR-886 Se precisa informacion del nombre de time zone
fix in time zone by user
This commit is contained in:
@@ -1268,7 +1268,8 @@ class Light
|
||||
$multiTimeZone = (int)($sysConf['system_utc_time_zone']) == 1;
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$offset = timezone_offset_get( new \DateTimeZone( $sysConf['time_zone'] ), new \DateTime() );
|
||||
$tz = isset($_SESSION['USR_TIME_ZONE'])?$_SESSION['USR_TIME_ZONE']:$sysConf['time_zone'];
|
||||
$offset = timezone_offset_get( new \DateTimeZone( $tz ), new \DateTime() );
|
||||
$response['timeZone'] = sprintf( "GMT%s%02d:%02d", ( $offset >= 0 ) ? '+' : '-', abs( $offset / 3600 ), abs( ($offset % 3600) / 60 ) );
|
||||
$response['multiTimeZone'] = $multiTimeZone;
|
||||
$fields = \System::getSysInfo();
|
||||
@@ -1306,9 +1307,12 @@ class Light
|
||||
$languagesList[] = $languages;
|
||||
}
|
||||
$response['listLanguage'] = $languagesList;
|
||||
if ($params['fileLimit']) {
|
||||
if (isset($params['fileLimit']) && $params['fileLimit']) {
|
||||
$response['fileLimit'] = $this->return_bytes(ini_get('post_max_size'));
|
||||
}
|
||||
if (isset($params['tz']) && $params['tz']) {
|
||||
$response['tz'] = isset($_SESSION['USR_TIME_ZONE'])?$_SESSION['USR_TIME_ZONE']:$sysConf['time_zone'];
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
@@ -1533,4 +1533,26 @@ class Light extends Api
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get configuration ProcessMaker
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @url GET /config-user
|
||||
*
|
||||
* @param string $fileLimit {@from path}
|
||||
* @param string $tz {@from path}
|
||||
*/
|
||||
public function getConfigurationUser($fileLimit = false, $tz = false)
|
||||
{
|
||||
try {
|
||||
$params = array('fileLimit' => $fileLimit, 'tz' => $tz);
|
||||
$oMobile = new \ProcessMaker\BusinessModel\Light();
|
||||
$response = $oMobile->getConfiguration($params);
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user