PMCORE-2352 User extended attributes PMCORE-2247

This commit is contained in:
Roly Rudy Gutierrez Pinto
2020-12-16 19:47:59 -04:00
parent 9311905f74
commit d57a3ac932
65 changed files with 39216 additions and 153 deletions

View File

@@ -14,6 +14,18 @@ try {
// Executing the action
switch ($action) {
case 'timeZoneParameters':
$arraySystemConfiguration = System::getSystemConfiguration('', '', config("system.workspace"));
$data = array_map(function ($value) {
return ["value" => $value, "text" => $value];
}, DateTimeZone::listIdentifiers());
$result = [
"timeZoneList" => $data,
"systemTimeZone" => $arraySystemConfiguration['time_zone']
];
print(G::json_encode($result));
break;
case 'countryList':
$c = new Criteria();
$c->add(IsoCountryPeer::IC_UID, null, Criteria::ISNOTNULL);
@@ -200,9 +212,6 @@ try {
} catch (Exception $e) {
$result->success = false;
$result->fileError = true;
echo G::json_encode($result);
exit(0);
}
}
@@ -422,7 +431,7 @@ try {
$fields['DESCRIPTION'] = G::LoadTranslation('ID_PASSWORD_COMPLIES_POLICIES') . '</span>';
$fields['STATUS'] = true;
}
$span = '<span style="color: ' . $color . '; font: 9px tahoma,arial,helvetica,sans-serif;">';
$span = '<span style="color: ' . $color . '; ">';
$gif = '<img width="13" height="13" border="0" src="' . $img . '">';
$fields['DESCRIPTION'] = $span . $gif . $fields['DESCRIPTION'];
print(G::json_encode($fields));
@@ -459,7 +468,7 @@ try {
$response['exists'] = false;
}
$span = '<span style="color: ' . $color . '; font: 9px tahoma,arial,helvetica,sans-serif;">';
$span = '<span style="color: ' . $color . '; ">';
$gif = '<img width="13" height="13" border="0" src="' . $img . '">';
$response['descriptionText'] = $span . $gif . $text . '</span>';
echo G::json_encode($response);

View File

@@ -9,6 +9,16 @@ if (isset($_GET['USR_UID']) && RBAC::isGuestUserUid($_GET['USR_UID'])) {
//calculating the max upload file size;
use ProcessMaker\Core\System;
if (isset($_REQUEST['userInterface']) && $_REQUEST['userInterface'] === "v2") {
$lang = defined("SYS_LANG") ? SYS_LANG : "en";
$html = file_get_contents(PATH_HTML . "lib/userPersonalInformation/index.html");
$html = str_replace("var USR_UID='';", "var USR_UID='{$_GET['USR_UID']}';", $html);
$html = str_replace("translation.en.js", "translation.{$lang}.js", $html);
echo $html;
exit();
}
$POST_MAX_SIZE = ini_get('post_max_size');
$mul = substr($POST_MAX_SIZE, - 1);
$mul = ($mul == 'M' ? 1048576 : ($mul == 'K' ? 1024 : ($mul == 'G' ? 1073741824 : 1)));
@@ -30,7 +40,7 @@ $expirationDate = 1;
$envFile = PATH_CONFIG . 'env.ini';
if (file_exists($envFile)) {
$sysConf = System::getSystemConfiguration($envFile);
if (isset($sysConf['expiration_year']) && $sysConf['expiration_year']>0) {
if (isset($sysConf['expiration_year']) && $sysConf['expiration_year'] > 0) {
$expirationDate = abs($sysConf['expiration_year']);
}
}
@@ -52,9 +62,9 @@ $oHeadPublisher->assign('MODE', $_GET['MODE']);
$oHeadPublisher->assign('MAX_FILES_SIZE', ' (' . $maxFileSize . ') ');
$oHeadPublisher->assign('SYSTEM_TIME_ZONE', $arraySystemConfiguration['time_zone']);
$oHeadPublisher->assign('TIME_ZONE_DATA', array_map(function ($value) {
return [$value, $value];
}, DateTimeZone::listIdentifiers()));
$oHeadPublisher->assign('__SYSTEM_UTC_TIME_ZONE__', (isset($_SESSION['__SYSTEM_UTC_TIME_ZONE__']) && $_SESSION['__SYSTEM_UTC_TIME_ZONE__'])? 1 : 0);
return [$value, $value];
}, DateTimeZone::listIdentifiers()));
$oHeadPublisher->assign('__SYSTEM_UTC_TIME_ZONE__', (isset($_SESSION['__SYSTEM_UTC_TIME_ZONE__']) && $_SESSION['__SYSTEM_UTC_TIME_ZONE__']) ? 1 : 0);
$oHeadPublisher->assign('EXPIRATION_DATE', $expirationDate);
$oHeadPublisher->assign('LANGUAGE_MANAGEMENT', $languageManagement);
$oHeadPublisher->assign('__ACTION__', 'saveUser');

View File

@@ -5,6 +5,15 @@ use ProcessMaker\Core\System;
$RBAC->requirePermissions('PM_USERS');
if (isset($_REQUEST['userInterface']) && $_REQUEST['userInterface'] === "v2") {
$lang = defined("SYS_LANG") ? SYS_LANG : "en";
$html = file_get_contents(PATH_HOME . "public_html/lib/userPersonalInformation/index.html");
$html = str_replace("translation.en.js", "translation.{$lang}.js", $html);
echo $html;
exit();
}
//calculating the max upload file size;
$POST_MAX_SIZE = ini_get('post_max_size');
$mul = substr($POST_MAX_SIZE, - 1);