Merge remote-tracking branch 'origin/release/3.2.1' into bugfix/HOR-3177

This commit is contained in:
dheeyi william
2017-05-09 08:30:04 -04:00
23 changed files with 236 additions and 164 deletions

View File

@@ -283,6 +283,8 @@ class RBAC
"PER_NAME" => "Edit User profile Default Cases Menu Options" "PER_NAME" => "Edit User profile Default Cases Menu Options"
), array("PER_UID" => "00000000000000000000000000000064", "PER_CODE" => "PM_REASSIGNCASE_SUPERVISOR", ), array("PER_UID" => "00000000000000000000000000000064", "PER_CODE" => "PM_REASSIGNCASE_SUPERVISOR",
"PER_NAME" => "Reassign case supervisor" "PER_NAME" => "Reassign case supervisor"
), array("PER_UID" => "00000000000000000000000000000065", "PER_CODE" => "PM_SETUP_CUSTOM_CASES_LIST",
"PER_NAME" => "Setup Custom Cases List"
) )
); );
return $permissionsAdmin; return $permissionsAdmin;

View File

@@ -62,7 +62,8 @@ INSERT INTO `RBAC_PERMISSIONS` VALUES
('00000000000000000000000000000061','PM_EDIT_USER_PROFILE_PHOTO','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'), ('00000000000000000000000000000061','PM_EDIT_USER_PROFILE_PHOTO','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
('00000000000000000000000000000062','PM_EDIT_USER_PROFILE_DEFAULT_MAIN_MENU_OPTIONS','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'), ('00000000000000000000000000000062','PM_EDIT_USER_PROFILE_DEFAULT_MAIN_MENU_OPTIONS','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
('00000000000000000000000000000063','PM_EDIT_USER_PROFILE_DEFAULT_CASES_MENU_OPTIONS','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'), ('00000000000000000000000000000063','PM_EDIT_USER_PROFILE_DEFAULT_CASES_MENU_OPTIONS','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
('00000000000000000000000000000064','PM_REASSIGNCASE_SUPERVISOR','2016-09-01 00:00:00','2016-09-01 00:00:00',1,'00000000000000000000000000000002'); ('00000000000000000000000000000064','PM_REASSIGNCASE_SUPERVISOR','2016-09-01 00:00:00','2016-09-01 00:00:00',1,'00000000000000000000000000000002'),
('00000000000000000000000000000065','PM_SETUP_CUSTOM_CASES_LIST','2017-03-27 00:00:00','2017-03-27 00:00:00',1,'00000000000000000000000000000002');
INSERT INTO `RBAC_ROLES` VALUES INSERT INTO `RBAC_ROLES` VALUES
('00000000000000000000000000000001','','00000000000000000000000000000001','RBAC_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1), ('00000000000000000000000000000001','','00000000000000000000000000000001','RBAC_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1),
@@ -136,6 +137,7 @@ INSERT INTO `RBAC_ROLES_PERMISSIONS` VALUES
('00000000000000000000000000000002','00000000000000000000000000000062'), ('00000000000000000000000000000002','00000000000000000000000000000062'),
('00000000000000000000000000000002','00000000000000000000000000000063'), ('00000000000000000000000000000002','00000000000000000000000000000063'),
('00000000000000000000000000000002','00000000000000000000000000000064'), ('00000000000000000000000000000002','00000000000000000000000000000064'),
('00000000000000000000000000000002','00000000000000000000000000000065'),
('00000000000000000000000000000003','00000000000000000000000000000001'), ('00000000000000000000000000000003','00000000000000000000000000000001'),
('00000000000000000000000000000003','00000000000000000000000000000005'), ('00000000000000000000000000000003','00000000000000000000000000000005'),
('00000000000000000000000000000003','00000000000000000000000000000040'), ('00000000000000000000000000000003','00000000000000000000000000000040'),

View File

@@ -2299,9 +2299,7 @@ class Cases
G::LoadClass('pmScript'); G::LoadClass('pmScript');
$oPMScript = new PMScript(); $oPMScript = new PMScript();
$oApplication = new Application(); $oApplication = new Application();
//$aFields = $oApplication->load($sAppUid); $aFields = $oApplication->Load($sAppUid);
$oApplication = ApplicationPeer::retrieveByPk($sAppUid);
$aFields = $oApplication->toArray(BasePeer::TYPE_FIELDNAME);
if (!is_array($aFields['APP_DATA'])) { if (!is_array($aFields['APP_DATA'])) {
$aFields['APP_DATA'] = G::array_merges(G::getSystemConstants(), unserialize($aFields['APP_DATA'])); $aFields['APP_DATA'] = G::array_merges(G::getSystemConstants(), unserialize($aFields['APP_DATA']));
} }
@@ -2331,7 +2329,9 @@ class Cases
$rs->next(); $rs->next();
$row = $rs->getRow(); $row = $rs->getRow();
$iLastStep = intval($row[0]); $iLastStep = intval($row[0]);
if ($iPosition != 10000 && $iPosition > $iLastStep) {
throw (new Exception(G::LoadTranslation('ID_STEP_DOES_NOT_EXIST', array(G::LoadTranslation('ID_POSITION'), $iPosition))));
}
$iPosition += 1; $iPosition += 1;
$aNextStep = null; $aNextStep = null;
if ($iPosition <= $iLastStep) { if ($iPosition <= $iLastStep) {

View File

@@ -1016,8 +1016,8 @@ class Derivation
$criteria->addSelectColumn(RoutePeer::TAS_UID); $criteria->addSelectColumn(RoutePeer::TAS_UID);
$criteria->addJoin(RoutePeer::TAS_UID, AppDelegationPeer::TAS_UID); $criteria->addJoin(RoutePeer::TAS_UID, AppDelegationPeer::TAS_UID);
$criteria->add(RoutePeer::PRO_UID, $appFields['PRO_UID']); $criteria->add(RoutePeer::PRO_UID, $appFields['PRO_UID']);
$criteria->add(RoutePeer::ROU_NEXT_TASK, $nextDel['ROU_PREVIOUS_TASK']); $criteria->add(RoutePeer::ROU_NEXT_TASK, isset($nextDel['ROU_PREVIOUS_TASK']) ? $nextDel['ROU_PREVIOUS_TASK'] : '');
$criteria->add(RoutePeer::ROU_TYPE, $nextDel['ROU_PREVIOUS_TYPE']); $criteria->add(RoutePeer::ROU_TYPE, isset($nextDel['ROU_PREVIOUS_TYPE']) ? $nextDel['ROU_PREVIOUS_TYPE'] : '');
$criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN'); $criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN');
$rsCriteria = RoutePeer::doSelectRS($criteria); $rsCriteria = RoutePeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC); $rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);

View File

@@ -1722,6 +1722,9 @@ function PMFAddInputDocument(
* @label PMF Generate Output Document * @label PMF Generate Output Document
* *
* @param string(32) | $outputID | Output ID | Output Document ID * @param string(32) | $outputID | Output ID | Output Document ID
* @param string(32) | $sApplication = null | Case ID | The unique ID for a case
* @param string(32) | $index = null | Index | Value for Index
* @param string(32) | $sUserLogged = null | User UID | User Logged UID
* @return none | $none | None | None * @return none | $none | None | None
* *
*/ */
@@ -2558,8 +2561,9 @@ function PMFGetNextAssignedUser ($application, $task, $delIndex = null, $userUid
$g->sessionVarSave(); $g->sessionVarSave();
$_SESSION['INDEX'] = (!is_null($delIndex) ? $delIndex : (isset($_SESSION['INDEX']) ? $_SESSION['INDEX'] : null)); $_SESSION['INDEX'] = (!empty($delIndex) ? $delIndex : (isset($_SESSION['INDEX']) ? $_SESSION['INDEX'] : null));
$_SESSION['USER_LOGGED'] = (!is_null($userUid) ? $userUid : (isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : null)); $_SESSION['USER_LOGGED'] = (!empty($userUid) ? $userUid : (isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED']
: null));
if ($typeTask == 'BALANCED' && !is_null($_SESSION['INDEX']) && !is_null($_SESSION['USER_LOGGED'])) { if ($typeTask == 'BALANCED' && !is_null($_SESSION['INDEX']) && !is_null($_SESSION['USER_LOGGED'])) {
@@ -3279,7 +3283,7 @@ function PMFGetDynaformUID($dynaFormName, $processUid = null)
return false; return false;
} }
$arrayResult = PMFGetUidFromText($dynaFormName, 'DYN_TITLE', (!is_null($processUid))? $processUid : $_SESSION['PROCESS']); $arrayResult = PMFGetUidFromText($dynaFormName, 'DYN_TITLE', (!empty($processUid)) ? $processUid : $_SESSION['PROCESS']);
//Return //Return
return (!empty($arrayResult)) ? array_shift($arrayResult) : false; return (!empty($arrayResult)) ? array_shift($arrayResult) : false;
@@ -3347,7 +3351,8 @@ function PMFGetTaskUID($taskName, $processUid = null)
$criteria->addSelectColumn(TaskPeer::TAS_UID); $criteria->addSelectColumn(TaskPeer::TAS_UID);
$criteria->add(TaskPeer::TAS_TITLE, $taskName, Criteria::EQUAL); $criteria->add(TaskPeer::TAS_TITLE, $taskName, Criteria::EQUAL);
$criteria->add(TaskPeer::PRO_UID, (!is_null($processUid))? $processUid : $_SESSION['PROCESS'], Criteria::EQUAL); $criteria->add(TaskPeer::PRO_UID, (!empty($processUid)) ? $processUid : $_SESSION['PROCESS'],
Criteria::EQUAL);
$rsCriteria = TaskPeer::doSelectRS($criteria); $rsCriteria = TaskPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC); $rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
@@ -3501,10 +3506,9 @@ function PMFCaseLink($caseUid, $workspace = null, $language = null, $skin = null
if ($arrayApplicationData === false) { if ($arrayApplicationData === false) {
return false; return false;
} }
$workspace = (!empty($workspace)) ? $workspace : SYS_SYS;
$workspace = (!is_null($workspace))? $workspace : SYS_SYS; $language = (!empty($language)) ? $language : SYS_LANG;
$language = (!is_null($language))? $language : SYS_LANG; $skin = (!empty($skin)) ? $skin : SYS_SKIN;
$skin = (!is_null($skin))? $skin : SYS_SKIN;
$uri = '/sys' . $workspace . '/' . $language . '/' . $skin . '/cases/opencase/' . $caseUid; $uri = '/sys' . $workspace . '/' . $language . '/' . $skin . '/cases/opencase/' . $caseUid;
@@ -3707,7 +3711,7 @@ function PMFCopyDocumentCase($appDocUid, $versionNumber, $targetCaseUid, $inputD
"APP_UID" => $targetCaseUid, "APP_UID" => $targetCaseUid,
"DEL_INDEX" => $dataFields['DEL_INDEX'], "DEL_INDEX" => $dataFields['DEL_INDEX'],
"USR_UID" => $dataFields['USR_UID'], "USR_UID" => $dataFields['USR_UID'],
"DOC_UID" => ($inputDocumentUid != null) ? $inputDocumentUid : $dataFields['DOC_UID'], "DOC_UID" => (!empty($inputDocumentUid)) ? $inputDocumentUid : $dataFields['DOC_UID'],
"APP_DOC_TYPE" => $dataFields['APP_DOC_TYPE'], "APP_DOC_TYPE" => $dataFields['APP_DOC_TYPE'],
"APP_DOC_CREATE_DATE" => date("Y-m-d H:i:s"), "APP_DOC_CREATE_DATE" => date("Y-m-d H:i:s"),
"APP_DOC_COMMENT" => $dataFields['APP_DOC_COMMENT'], "APP_DOC_COMMENT" => $dataFields['APP_DOC_COMMENT'],

View File

@@ -2916,13 +2916,15 @@ class processMap
if ($archivo != '..') { if ($archivo != '..') {
$one = 0; $one = 0;
$two = 0; $two = 0;
$three = 0;
$alink = $link . $archivo; $alink = $link . $archivo;
$one = count(explode('wsClient.php', $archivo)); $one = count(explode('wsClient.php', $archivo));
$two = count(explode('Post.php', $archivo)); $two = count(explode('Post.php', $archivo));
$three = count(explode('Info.php', $archivo));
if ($one == 1 && $two == 1) { if ($one == 1 && $two == 1 && $three == 1) {
$arlink = "<a href='" . $alink . "' target='blank'><font color='#9999CC'>" . $alink . "</font></a>"; $arlink = "<a href='" . $alink . "' target='blank'><font color='#9999CC'>" . $alink . "</font></a>";
$linkdelete = sprintf("<a href='javascript:webEntry_delete(\"%s\",\"%s\",\"%s\");'><font color='red'>delete</font></a>", $alink, $archivo, $sProcessUID); $linkdelete = sprintf("<a href='javascript:webEntry_delete(\"%s\",\"%s\",\"%s\");'><font color='red'>delete</font></a>", $alink, $archivo, $sProcessUID);
$row[] = array('W_LINK' => $arlink, 'W_FILENAME' => $archivo, 'W_PRO_UID' => $sProcessUID ); $row[] = array('W_LINK' => $arlink, 'W_FILENAME' => $archivo, 'W_PRO_UID' => $sProcessUID );

View File

@@ -86,8 +86,8 @@ class spoolRun
$this->ExceptionCode['WARNING'] = 2; $this->ExceptionCode['WARNING'] = 2;
$this->ExceptionCode['NOTICE'] = 3; $this->ExceptionCode['NOTICE'] = 3;
$this->longMailEreg = "/(.*)(<([\w\-\.']+@[\w\-_\.]+\.\w{2,5})+>)/"; $this->longMailEreg = "/(.*)(<([\w\-\+\.']+@[\w\-_\.]+\.\w{2,5})+>)/";
$this->mailEreg = "/^([\w\-_\.']+@[\w\-_\.]+\.\w{2,5}+)$/"; $this->mailEreg = "/^([\w\-_\+\.']+@[\w\-_\.]+\.\w{2,5}+)$/";
} }
/** /**

View File

@@ -189,9 +189,6 @@ class Application extends BaseApplication
try { try {
$oApplication = ApplicationPeer::retrieveByPK( $AppUid ); $oApplication = ApplicationPeer::retrieveByPK( $AppUid );
if (!$oApplication) {
return false;
}
if (is_object($oApplication) && get_class ($oApplication) == 'Application' ) { if (is_object($oApplication) && get_class ($oApplication) == 'Application' ) {
$aFields = $oApplication->toArray(BasePeer::TYPE_FIELDNAME); $aFields = $oApplication->toArray(BasePeer::TYPE_FIELDNAME);
$this->fromArray($aFields, BasePeer::TYPE_FIELDNAME); $this->fromArray($aFields, BasePeer::TYPE_FIELDNAME);

View File

@@ -2113,6 +2113,24 @@ msgstr "This case does not exist"
msgid "Application ID or Delegation Index is missing!. The System can not open the case." msgid "Application ID or Delegation Index is missing!. The System can not open the case."
msgstr "Application ID or Delegation Index is missing!. The System can not open the case." msgstr "Application ID or Delegation Index is missing!. The System can not open the case."
# TRANSLATION
# LABEL/ID_MEMORY_LIMIT_VALIDATE
#: LABEL/ID_MEMORY_LIMIT_VALIDATE
msgid "Memory Limit value has to be either a positive integer or -1."
msgstr "Memory Limit value has to be either a positive integer or -1."
# TRANSLATION
# LABEL/ID_LIFETIME_VALIDATE
#: LABEL/ID_LIFETIME_VALIDATE
msgid "Max Lifetime value has to be a positive integer."
msgstr "Max Lifetime value has to be a positive integer."
# TRANSLATION
# LABEL/ID_DEFAULT_EXPIRATION_YEAR_VALIDATE
#: LABEL/ID_DEFAULT_EXPIRATION_YEAR_VALIDATE
msgid "Default Expiration Year value has to be a positive integer."
msgstr "Default Expiration Year value has to be a positive integer."
# TRANSLATION # TRANSLATION
# LABEL/ID_PLEASE_SELECT_UPGRADE_FILE # LABEL/ID_PLEASE_SELECT_UPGRADE_FILE
#: LABEL/ID_PLEASE_SELECT_UPGRADE_FILE #: LABEL/ID_PLEASE_SELECT_UPGRADE_FILE

View File

@@ -27,28 +27,18 @@ class adminProxy extends HttpProxyController
{ {
const hashunlink = 'unlink'; const hashunlink = 'unlink';
/**
* Save configurations of systemConf
* @param $httpData
* @throws Exception
*/
public function saveSystemConf($httpData) public function saveSystemConf($httpData)
{ {
G::loadClass('system'); G::loadClass('system');
$envFile = PATH_CONFIG . 'env.ini'; $envFile = PATH_CONFIG . 'env.ini';
$updateRedirector = false; $updateRedirector = false;
$restart = false; $restart = false;
self::validateDataSystemConf($httpData, $envFile);
if (!file_exists($envFile) ) {
if (!is_writable(PATH_CONFIG)) {
throw new Exception('The enviroment config directory is not writable. <br/>Please give write permission to directory: /workflow/engine/config');
}
$content = ";\r\n";
$content .= "; ProcessMaker System Bootstrap Configuration\r\n";
$content .= ";\r\n";
file_put_contents($envFile, $content);
//@chmod($envFile, 0777);
} else {
if (!is_writable($envFile)) {
throw new Exception('The enviroment ini file file is not writable. <br/>Please give write permission to file: /workflow/engine/config/env.ini');
}
}
$sysConf = System::getSystemConfiguration($envFile); $sysConf = System::getSystemConfiguration($envFile);
$updatedConf = array(); $updatedConf = array();
@@ -1536,5 +1526,46 @@ class adminProxy extends HttpProxyController
G::streamFile($support, true); G::streamFile($support, true);
G::rm_dir($support); G::rm_dir($support);
} }
/**
* Validate data before saving
* @param $httpData
* @param $envFile
* @throws Exception
*/
public static function validateDataSystemConf($httpData, $envFile)
{
if (!((is_numeric($httpData->memory_limit)) && ((int)$httpData->memory_limit == $httpData->memory_limit) &&
((int)$httpData->memory_limit >= -1))
) {
throw new Exception(G::LoadTranslation('ID_MEMORY_LIMIT_VALIDATE'));
} }
if (!((is_numeric($httpData->max_life_time)) && ((int)$httpData->max_life_time == $httpData->max_life_time) &&
((int)$httpData->max_life_time > 0))
) {
throw new Exception(G::LoadTranslation('ID_LIFETIME_VALIDATE'));
}
if (!((is_numeric($httpData->expiration_year)) && ((int)$httpData->expiration_year == $httpData->expiration_year) &&
((int)$httpData->expiration_year > 0))
) {
throw new Exception(G::LoadTranslation('ID_DEFAULT_EXPIRATION_YEAR_VALIDATE'));
}
if (!file_exists($envFile)) {
if (!is_writable(PATH_CONFIG)) {
throw new Exception('The enviroment config directory is not writable. <br/>Please give write permission to directory: /workflow/engine/config');
}
$content = ";\r\n";
$content .= "; ProcessMaker System Bootstrap Configuration\r\n";
$content .= ";\r\n";
file_put_contents($envFile, $content);
//@chmod($envFile, 0777);
} else {
if (!is_writable($envFile)) {
throw new Exception('The enviroment ini file is not writable. <br/>Please give write permission to file: /workflow/engine/config/env.ini');
}
}
}
}

View File

@@ -68,7 +68,8 @@ INSERT INTO CONTENT (CON_CATEGORY,CON_PARENT,CON_ID,CON_LANG,CON_VALUE) VALUES
('PER_NAME','','00000000000000000000000000000061','en','Edit User profile Photo'), ('PER_NAME','','00000000000000000000000000000061','en','Edit User profile Photo'),
('PER_NAME','','00000000000000000000000000000062','en','Edit User profile Default Main Menu Options'), ('PER_NAME','','00000000000000000000000000000062','en','Edit User profile Default Main Menu Options'),
('PER_NAME','','00000000000000000000000000000063','en','Edit User profile Default Cases Menu Options'), ('PER_NAME','','00000000000000000000000000000063','en','Edit User profile Default Cases Menu Options'),
('PER_NAME','','00000000000000000000000000000064','en','Reassign case supervisor'); ('PER_NAME','','00000000000000000000000000000064','en','Reassign case supervisor'),
('PER_NAME','','00000000000000000000000000000065','en','Setup Custom Cases List');
INSERT INTO LANGUAGE (LAN_ID,LAN_LOCATION,LAN_NAME,LAN_NATIVE_NAME,LAN_DIRECTION,LAN_WEIGHT,LAN_ENABLED,LAN_CALENDAR) VALUES INSERT INTO LANGUAGE (LAN_ID,LAN_LOCATION,LAN_NAME,LAN_NATIVE_NAME,LAN_DIRECTION,LAN_WEIGHT,LAN_ENABLED,LAN_CALENDAR) VALUES
('aa','','Afar','','L','0','0','GREGORIAN'), ('aa','','Afar','','L','0','0','GREGORIAN'),
@@ -1793,6 +1794,9 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_IN','en','in','2014-01-15') , ( 'LABEL','ID_IN','en','in','2014-01-15') ,
( 'LABEL','ID_CASE_DOES_NOT_EXISTS','en','This case does not exist','2014-01-15') , ( 'LABEL','ID_CASE_DOES_NOT_EXISTS','en','This case does not exist','2014-01-15') ,
( 'LABEL','ID_APPLICATION_OR_INDEX_MISSING','en','Application ID or Delegation Index is missing!. The System can not open the case.','2017-03-30') , ( 'LABEL','ID_APPLICATION_OR_INDEX_MISSING','en','Application ID or Delegation Index is missing!. The System can not open the case.','2017-03-30') ,
( 'LABEL','ID_MEMORY_LIMIT_VALIDATE','en','Memory Limit value has to be either a positive integer or -1','2017-04-05') ,
( 'LABEL','ID_LIFETIME_VALIDATE','en','Max Lifetime value has to be a positive integer','2017-04-05') ,
( 'LABEL','ID_DEFAULT_EXPIRATION_YEAR_VALIDATE','en','Default Expiration Year value has to be a positive integer','2017-04-05') ,
( 'LABEL','ID_PLEASE_SELECT_UPGRADE_FILE','en','Please select the upgrade file','2014-01-15') , ( 'LABEL','ID_PLEASE_SELECT_UPGRADE_FILE','en','Please select the upgrade file','2014-01-15') ,
( 'LABEL','ID_PLEASE_SELECT_MAX_X_FIELDS','en','Please select 80 fields at most','2014-01-15') , ( 'LABEL','ID_PLEASE_SELECT_MAX_X_FIELDS','en','Please select 80 fields at most','2014-01-15') ,
( 'LABEL','ID_UPGRADE_READY','en','System upgraded from revision','2014-01-15') , ( 'LABEL','ID_UPGRADE_READY','en','System upgraded from revision','2014-01-15') ,

View File

@@ -63,16 +63,6 @@ if ($RBAC->userCanAccess('PM_SETUP') === 1) {
} }
} }
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') === 1) {
if ($RBAC->userCanAccess('PM_SETUP_LANGUAGE') === 1) {
$G_TMP_MENU->AddIdRawOption(
'LANGUAGES', 'languages',
G::LoadTranslation('ID_LANGUAGES'),
'icon-language.png','', 'settings'
);
}
}
if ($RBAC->userCanAccess('PM_SETUP') === 1) { if ($RBAC->userCanAccess('PM_SETUP') === 1) {
if ($RBAC->userCanAccess('PM_SETUP_SKIN') === 1) { if ($RBAC->userCanAccess('PM_SETUP_SKIN') === 1) {
$G_TMP_MENU->AddIdRawOption( $G_TMP_MENU->AddIdRawOption(
@@ -103,14 +93,6 @@ if ($RBAC->userCanAccess('PM_SETUP') === 1) {
} }
} }
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') === 1) {
$G_TMP_MENU->AddIdRawOption(
'APPCACHEVIEW_SETUP', '../setup/appCacheViewConf',
G::LoadTranslation('ID_APPCACHE_SETUP'),
"", '', 'settings'
);
}
if ($RBAC->userCanAccess('PM_SETUP') === 1) { if ($RBAC->userCanAccess('PM_SETUP') === 1) {
if ($RBAC->userCanAccess('PM_SETUP_CLEAR_CACHE') === 1) { if ($RBAC->userCanAccess('PM_SETUP_CLEAR_CACHE') === 1) {
$G_TMP_MENU->AddIdRawOption( $G_TMP_MENU->AddIdRawOption(
@@ -159,6 +141,20 @@ if ($RBAC->userCanAccess('PM_SETUP') === 1) {
} }
//tools options //tools options
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') === 1) { if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') === 1) {
if ($RBAC->userCanAccess('PM_SETUP_LANGUAGE') === 1) {
$G_TMP_MENU->AddIdRawOption(
'LANGUAGES', 'languages',
G::LoadTranslation('ID_LANGUAGES'),
'icon-language.png','', 'settings'
);
}
if ($RBAC->userCanAccess('PM_SETUP_CASES_LIST_CACHE_BUILDER') === 1) {
$G_TMP_MENU->AddIdRawOption(
'APPCACHEVIEW_SETUP', '../setup/appCacheViewConf',
G::LoadTranslation('ID_APPCACHE_SETUP'),
"", '', 'settings'
);
}
if (!$partnerFlag) { if (!$partnerFlag) {
if ($RBAC->userCanAccess('PM_SETUP_PLUGINS') === 1) { if ($RBAC->userCanAccess('PM_SETUP_PLUGINS') === 1) {
$G_TMP_MENU->AddIdRawOption( $G_TMP_MENU->AddIdRawOption(
@@ -277,12 +273,12 @@ if ($licenseStatusInfo["message"] != "") {
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
if ($RBAC->userCanAccess('PM_SETUP') == 1) { if ($RBAC->userCanAccess('PM_SETUP') == 1) {
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
if ($RBAC->userCanAccess('PM_SETUP_CASES_LIST_CACHE_BUILDER') == 1) {
$G_TMP_MENU->AddIdRawOption( $G_TMP_MENU->AddIdRawOption(
'PMENTERPRISE', '../enterprise/addonsStore', 'PMENTERPRISE', '../enterprise/addonsStore',
G::LoadTranslation('ID_MENU_NAME') . $licStatusMsg, G::LoadTranslation('ID_MENU_NAME') . $licStatusMsg,
'', '', 'plugins' '', '', 'plugins'
); );
if ($RBAC->userCanAccess('PM_SETUP_CUSTOM_CASES_LIST') == 1) {
$G_TMP_MENU->AddIdRawOption( $G_TMP_MENU->AddIdRawOption(
'CASES_LIST_SETUP', '../cases/casesListSetup', 'CASES_LIST_SETUP', '../cases/casesListSetup',
G::LoadTranslation('ID_CUSTOM_CASES_LISTS'), G::LoadTranslation('ID_CUSTOM_CASES_LISTS'),

View File

@@ -278,6 +278,7 @@ try {
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] ); $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
$aPreviousStep = $oCase->getPreviousStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] ); $aPreviousStep = $oCase->getPreviousStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
} catch (Exception $e) { } catch (Exception $e) {
throw $e;
} }
//Obtain previous and next step - End //Obtain previous and next step - End

View File

@@ -60,6 +60,10 @@ try {
$sContent .= "\$G_PUBLISH->AddContent('dynaform', 'xmlform', '" . $sPRO_UID . '/' . $sDYNAFORM . "', '', array(), '" . $dynTitle . 'Post.php' . "');\n"; $sContent .= "\$G_PUBLISH->AddContent('dynaform', 'xmlform', '" . $sPRO_UID . '/' . $sDYNAFORM . "', '', array(), '" . $dynTitle . 'Post.php' . "');\n";
$sContent .= "G::RenderPage('publish', 'blank');"; $sContent .= "G::RenderPage('publish', 'blank');";
file_put_contents( $pathProcess . $dynTitle . '.php', $sContent ); file_put_contents( $pathProcess . $dynTitle . '.php', $sContent );
//Create file to display information and prevent resubmission data (Post/Redirect/Get).
\ProcessMaker\BusinessModel\WebEntry::createFileInfo($pathProcess . $dynTitle . "Info.php");
//creating the second file, the post file who receive the post form. //creating the second file, the post file who receive the post form.
$pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentryPost.tpl'; $pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentryPost.tpl';
$template = new TemplatePower( $pluginTpl ); $template = new TemplatePower( $pluginTpl );
@@ -72,6 +76,7 @@ try {
$template->assign( 'wsUser', $sWS_USER ); $template->assign( 'wsUser', $sWS_USER );
$template->assign( 'wsPass', Bootstrap::hashPassword($sWS_PASS, '', true) ); $template->assign( 'wsPass', Bootstrap::hashPassword($sWS_PASS, '', true) );
$template->assign( 'wsRoundRobin', $sWS_ROUNDROBIN ); $template->assign( 'wsRoundRobin', $sWS_ROUNDROBIN );
$template->assign( 'weTitle', $dynTitle);
G::auditLog('WebEntry','Generate web entry with web services ('.$dynTitle.'.php) in process "'.$resultProcess['PRO_TITLE'].'"'); G::auditLog('WebEntry','Generate web entry with web services ('.$dynTitle.'.php) in process "'.$resultProcess['PRO_TITLE'].'"');

View File

@@ -165,16 +165,6 @@ switch ($request) {
} else { } else {
$result->info[] = array('name' => 'Error', 'value' => $res['msg']); $result->info[] = array('name' => 'Error', 'value' => $res['msg']);
} }
$res = $appCache->setSuperForUser($currentUser);
if (!isset($res['error'])) {
$result->info[] = array('name' => G::LoadTranslation('ID_SETTING_SUPER'), 'value' => G::LoadTranslation('ID_SUCCESSFULLY'));
} else {
$result->error = true;
$result->errorMsg = $res['msg'];
}
$currentUserIsSuper = true;
} }
//now check if table APPCACHEVIEW exists, and it have correct number of fields, etc. //now check if table APPCACHEVIEW exists, and it have correct number of fields, etc.

View File

@@ -1140,6 +1140,7 @@ class User
* @param bool $flagRecord Flag that set the "getting" of record * @param bool $flagRecord Flag that set the "getting" of record
* @param bool $throwException Flag to throw the exception (This only if the parameters are invalid) * @param bool $throwException Flag to throw the exception (This only if the parameters are invalid)
* (TRUE: throw the exception; FALSE: returns FALSE) * (TRUE: throw the exception; FALSE: returns FALSE)
* @param string $status The user's status, which can be "ACTIVE", "INACTIVE" or "VACATION"
* *
* @return array Return an array with all Users, ThrowTheException/FALSE otherwise * @return array Return an array with all Users, ThrowTheException/FALSE otherwise
*/ */
@@ -1150,7 +1151,8 @@ class User
$start = null, $start = null,
$limit = null, $limit = null,
$flagRecord = true, $flagRecord = true,
$throwException = true $throwException = true,
$status = null
) { ) {
try { try {
$arrayUser = array(); $arrayUser = array();
@@ -1210,7 +1212,9 @@ class User
$criteria->add($value[0], $value[1], $value[2]); $criteria->add($value[0], $value[1], $value[2]);
} }
} else { } else {
$criteria->add(\UsersPeer::USR_STATUS, 'ACTIVE', \Criteria::EQUAL); if (!is_null($status)) {
$criteria->add(\UsersPeer::USR_STATUS, strtoupper($status), \Criteria::EQUAL);
}
} }
if ($flagFilter && trim($arrayWhere['filter']) != '') { if ($flagFilter && trim($arrayWhere['filter']) != '') {

View File

@@ -398,7 +398,7 @@ class WebEntry
$weTitle = $this->sanitizeFilename($arrayWebEntryData["WE_TITLE"]); $weTitle = $this->sanitizeFilename($arrayWebEntryData["WE_TITLE"]);
$fileName = $weTitle; $fileName = $weTitle;
$fileContent = "<?php\n"; $fileContent = "<?php\n\n";
$fileContent .= "global \$_DBArray;\n"; $fileContent .= "global \$_DBArray;\n";
$fileContent .= "if (!isset(\$_DBArray)) {\n"; $fileContent .= "if (!isset(\$_DBArray)) {\n";
$fileContent .= " \$_DBArray = array();\n"; $fileContent .= " \$_DBArray = array();\n";
@@ -409,15 +409,18 @@ class WebEntry
$fileContent .= "G::LoadClass(\"pmDynaform\");\n"; $fileContent .= "G::LoadClass(\"pmDynaform\");\n";
$fileContent .= "\$a = new pmDynaform(array(\"CURRENT_DYNAFORM\" => \"" . $arrayWebEntryData["DYN_UID"] . "\"));\n"; $fileContent .= "\$a = new pmDynaform(array(\"CURRENT_DYNAFORM\" => \"" . $arrayWebEntryData["DYN_UID"] . "\"));\n";
$fileContent .= "if (\$a->isResponsive()) {"; $fileContent .= "if (\$a->isResponsive()) {\n";
$fileContent .= " \$a->printWebEntry(\"" . $fileName . "Post.php\");"; $fileContent .= " \$a->printWebEntry(\"" . $fileName . "Post.php\");\n";
$fileContent .= "} else {"; $fileContent .= "} else {\n";
$fileContent .= " \$G_PUBLISH->AddContent(\"dynaform\", \"xmlform\", \"" . $processUid . PATH_SEP . $dynaFormUid . "\", \"\", array(), \"" . $fileName . "Post.php\");\n"; $fileContent .= " \$G_PUBLISH->AddContent(\"dynaform\", \"xmlform\", \"" . $processUid . PATH_SEP . $dynaFormUid . "\", \"\", array(), \"" . $fileName . "Post.php\");\n";
$fileContent .= " G::RenderPage(\"publish\", \"blank\");"; $fileContent .= " G::RenderPage(\"publish\", \"blank\");\n";
$fileContent .= "}"; $fileContent .= "}\n";
file_put_contents($pathDataPublicProcess . PATH_SEP . $fileName . ".php", $fileContent); file_put_contents($pathDataPublicProcess . PATH_SEP . $fileName . ".php", $fileContent);
//Create file to display information and prevent resubmission data (Post/Redirect/Get).
self::createFileInfo($pathDataPublicProcess . PATH_SEP . $weTitle . "Info.php");
//Creating the second file, the post file who receive the post form. //Creating the second file, the post file who receive the post form.
$pluginTpl = PATH_TPL . "processes" . PATH_SEP . "webentryPost.tpl"; $pluginTpl = PATH_TPL . "processes" . PATH_SEP . "webentryPost.tpl";
@@ -432,6 +435,7 @@ class WebEntry
$template->assign("wsUser", $usrUsername); $template->assign("wsUser", $usrUsername);
$template->assign("wsPass", \Bootstrap::getPasswordHashType() . ':' . $usrPassword); $template->assign("wsPass", \Bootstrap::getPasswordHashType() . ':' . $usrPassword);
$template->assign("wsRoundRobin", $wsRoundRobin); $template->assign("wsRoundRobin", $wsRoundRobin);
$template->assign("weTitle", $weTitle);
if ($webEntryInputDocumentAccess == 0) { if ($webEntryInputDocumentAccess == 0) {
//Restricted to process permissions //Restricted to process permissions
@@ -1033,5 +1037,30 @@ class WebEntry
return $result; return $result;
} }
/**
* Create file to display information and prevent resubmission data (Post/Redirect/Get).
* @param string $pathFileName
*/
public static function createFileInfo($pathFileName)
{
$code = ""
. "<?php\n"
. "\n"
. "\$G_PUBLISH = new Publisher();\n"
. "\$show = \"login/showMessage\";\n"
. "\$message = \"\";\n"
. "if (isset(\$_SESSION[\"__webEntrySuccess__\"])) {\n"
. " \$show = \"login/showInfo\";\n"
. " \$message = \$_SESSION[\"__webEntrySuccess__\"];\n"
. "} else {\n"
. " \$show = \"login/showMessage\";\n"
. " \$message = \$_SESSION[\"__webEntryError__\"];\n"
. "}\n"
. "\$G_PUBLISH->AddContent(\"xmlform\", \"xmlform\", \$show, \"\", \$message);\n"
. "G::RenderPage(\"publish\", \"blank\");\n"
. "\n";
file_put_contents($pathFileName, $code);
}
} }

View File

@@ -318,7 +318,7 @@ class ActivityPropertiesStructure
public $tas_calendar; public $tas_calendar;
/** /**
* @var string {@from body} {@choice NORMAL,ADHOC} * @var string {@from body} {@choice NORMAL,ADHOC,SUBPROCESS}
*/ */
public $tas_type; public $tas_type;

View File

@@ -21,7 +21,7 @@ class User extends Api
* @class AccessControl {@permission PM_USERS,PM_FACTORY} * @class AccessControl {@permission PM_USERS,PM_FACTORY}
* @url GET * @url GET
*/ */
public function index($filter = null, $lfilter = null, $rfilter = null, $start = null, $limit = null) public function index($filter = null, $lfilter = null, $rfilter = null, $start = null, $limit = null, $status = null)
{ {
try { try {
$user = new \ProcessMaker\BusinessModel\User(); $user = new \ProcessMaker\BusinessModel\User();
@@ -32,7 +32,7 @@ class User extends Api
"filterOption" => (!is_null($filter))? "" : ((!is_null($lfilter))? "LEFT" : ((!is_null($rfilter))? "RIGHT" : "")) "filterOption" => (!is_null($filter))? "" : ((!is_null($lfilter))? "LEFT" : ((!is_null($rfilter))? "RIGHT" : ""))
); );
$response = $user->getUsers($arrayFilterData, null, null, $start, $limit, false); $response = $user->getUsers($arrayFilterData, null, null, $start, $limit, false, true, $status);
return \ProcessMaker\Util\DateTime::convertUtcToIso8601($response['data'], $this->arrayFieldIso8601); return \ProcessMaker\Util\DateTime::convertUtcToIso8601($response['data'], $this->arrayFieldIso8601);
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@@ -85,32 +85,6 @@ Ext.onReady(function(){
cmbTimeZone.setValue(sysConf.time_zone); cmbTimeZone.setValue(sysConf.time_zone);
txtExpirationYear = new Ext.form.TextField({
xtype: 'numberfield',
id : 'expiration_year',
name : 'expiration_year',
fieldLabel: _('ID_DEFAULT_EXPIRATION_YEAR'),
allowBlank: false,
allowNegative: false,
value: 1,
maxlength: 15,
minValue: 1,
validator: function(value){
if(value > 0) {
return true;
} else {
PMExt.error( _('ID_ERROR'), _('ID_INVALID_VALUE_EXPECTING_POSITIVE_INTEGER', _('ID_DEFAULT_EXPIRATION_YEAR')));
return false;
}
},
listeners:{
change: function(){
changeSettings();
}
}
});
txtExpirationYear.setValue(sysConf.expiration_year);
saveButton = new Ext.Action({ saveButton = new Ext.Action({
text : _('ID_SAVE_SETTINGS'), text : _('ID_SAVE_SETTINGS'),
disabled : true, disabled : true,
@@ -127,6 +101,8 @@ Ext.onReady(function(){
name: 'memory_limit', name: 'memory_limit',
fieldLabel: _('ID_MEMORY_LIMIT'), fieldLabel: _('ID_MEMORY_LIMIT'),
allowBlank: false, allowBlank: false,
allowDecimals: false,
minValue: -1,
autoCreate: {tag: "input", type: "text", autocomplete: "off", maxlength: 15}, autoCreate: {tag: "input", type: "text", autocomplete: "off", maxlength: 15},
value: sysConf.memory_limit, value: sysConf.memory_limit,
listeners: { listeners: {
@@ -139,7 +115,8 @@ Ext.onReady(function(){
id: 'max_life_time', id: 'max_life_time',
name: 'max_life_time', name: 'max_life_time',
fieldLabel: _('ID_MAX_LIFETIME'), fieldLabel: _('ID_MAX_LIFETIME'),
// allowBlank: false, allowNegative: false,
allowDecimals: false,
autoCreate: {tag: "input", type: "text", autocomplete: "off", maxlength: 15}, autoCreate: {tag: "input", type: "text", autocomplete: "off", maxlength: 15},
value: sysConf.session_gc_maxlifetime, value: sysConf.session_gc_maxlifetime,
listeners: { listeners: {
@@ -147,8 +124,23 @@ Ext.onReady(function(){
changeSettings(); changeSettings();
} }
} }
}, {
xtype: 'numberfield',
id: 'expiration_year',
name: 'expiration_year',
fieldLabel: _('ID_DEFAULT_EXPIRATION_YEAR'),
allowBlank: false,
allowNegative: false,
allowDecimals: false,
value: sysConf.expiration_year,
maxlength: 15,
minValue: 1,
listeners: {
change: function () {
changeSettings();
}
}
} }
,txtExpirationYear
] ]
}); });

View File

@@ -1932,11 +1932,7 @@ Ext.onReady ( function() {
var toolbarUnassigned = [ var toolbarUnassigned = [
optionMenuOpen, optionMenuOpen,
btnRead,
'-', '-',
btnUnread,
'-',
btnAll,
'->', // begin using the right-justified button container '->', // begin using the right-justified button container
_("ID_CATEGORY"), _("ID_CATEGORY"),
comboCategory, comboCategory,

View File

@@ -193,13 +193,11 @@ try {
exit( 0 ); exit( 0 );
} }
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
$G_PUBLISH = new Publisher(); $_SESSION["__webEntrySuccess__"] = $aMessage;
$G_PUBLISH->AddContent("xmlform", "xmlform", "login/showInfo", "", $aMessage); G::header("location:{weTitle}Info.php");
G::RenderPage("publish", "blank");
} catch (Exception $e) { } catch (Exception $e) {
$G_PUBLISH = new Publisher();
$suggest_message = "This web entry should be regenerated, please contact to your system administrator."; $suggest_message = "This web entry should be regenerated, please contact to your system administrator.";
$aMessage["MESSAGE"] = "<font color=\"red\"><pre>" . $e->getMessage() . "</pre>" . $suggest_message . "</font>"; $aMessage["MESSAGE"] = "<font color=\"red\"><pre>" . $e->getMessage() . "</pre>" . $suggest_message . "</font>";
$G_PUBLISH->AddContent("xmlform", "xmlform", "login/showMessage", "", $aMessage); $_SESSION["__webEntryError__"] = $aMessage;
G::RenderPage("publish", "blank"); G::header("location:{weTitle}Info.php");
} }

View File

@@ -962,6 +962,7 @@ if (! defined( 'EXECUTE_BY_CRON' )) {
$noLoginFiles[] = 'licenseUpdate'; $noLoginFiles[] = 'licenseUpdate';
$noLoginFiles[] = 'casesStreamingFile'; $noLoginFiles[] = 'casesStreamingFile';
$noLoginFiles[] = 'opencase'; $noLoginFiles[] = 'opencase';
$noLoginFiles[] = 'defaultAjaxDynaform';
$noLoginFolders[] = 'services'; $noLoginFolders[] = 'services';
$noLoginFolders[] = 'tracker'; $noLoginFolders[] = 'tracker';