caseNumber needed on notificatiosn mobile
Merge remote-tracking branch 'upstream/3.1' into HOR-1417
This commit is contained in:
dheeyi william
2016-07-21 15:41:05 -04:00
47 changed files with 967 additions and 319 deletions

View File

@@ -82,7 +82,14 @@ function run_upgrade($command, $args)
CLI::logging("UPGRADE", PROCESSMAKER_PATH . "upgrade.log");
CLI::logging("Checking files integrity...\n");
//setting flag to true to check into sysGeneric.php
$flag = G::isPMUnderUpdating(1);
$workspaces = get_workspaces_from_args($command);
$oneWorkspace = 'true';
if (count($workspaces) == 1) {
foreach ($workspaces as $index => $workspace) {
$oneWorkspace = $workspace->name;
}
}
$flag = G::isPMUnderUpdating(1, $oneWorkspace);
//start to upgrade
$checksum = System::verifyChecksum();
if ($checksum === false) {

View File

@@ -73,6 +73,7 @@ class Cases
private $appSolr = null;
public $dir = 'ASC';
public $sort = 'APP_MSG_DATE';
public $arrayTriggerExecutionTime = [];
public function __construct()
{
@@ -3555,10 +3556,8 @@ class Cases
$oPMScript = new PMScript();
$oPMScript->setFields($aFields);
$arraySystemConfiguration = System::getSystemConfiguration(PATH_CONFIG . "env.ini");
/*----------------------------------********---------------------------------*/
$cs = new CodeScanner((isset($arraySystemConfiguration["enable_blacklist"]) && (int)($arraySystemConfiguration["enable_blacklist"]) == 1)? "DISABLED_CODE" : "");
$cs = new CodeScanner(SYS_SYS);
$strFoundDisabledCode = "";
/*----------------------------------********---------------------------------*/
@@ -3593,6 +3592,8 @@ class Cases
if ($bExecute) {
$oPMScript->setScript($aTrigger['TRI_WEBBOT']);
$oPMScript->execute();
$this->arrayTriggerExecutionTime[$aTrigger['TRI_UID']] = $oPMScript->scriptExecutionTime;
}
}
/*----------------------------------********---------------------------------*/
@@ -7556,4 +7557,3 @@ class Cases
return $rows;
}
}

View File

@@ -1232,6 +1232,7 @@ class Derivation
{
$iAppThreadIndex = $appFields['DEL_THREAD'];
$delType = 'NORMAL';
$sendNotificationsMobile = false;
if (is_numeric( $nextDel['DEL_PRIORITY'] )) {
$nextDel['DEL_PRIORITY'] = (isset( $nextDel['DEL_PRIORITY'] ) ? ($nextDel['DEL_PRIORITY'] >= 1 && $nextDel['DEL_PRIORITY'] <= 5 ? $nextDel['DEL_PRIORITY'] : '3') : '3');
@@ -1358,6 +1359,8 @@ class Derivation
}
}
$sendNotificationsMobile = $this->sendNotificationsMobile($aOldFields, $aSP, $aNewCase['INDEX']);
//If not is SYNCHRONOUS derivate one more time
if ($aSP['SP_SYNCHRONOUS'] == 0) {
$this->case->setDelInitDate( $currentDelegation['APP_UID'], $iNewDelIndex );
@@ -1388,6 +1391,10 @@ class Derivation
}
}
} //end switch
if($iNewDelIndex !== 0 && !$sendNotificationsMobile){
$sendNotificationsMobile = $this->sendNotificationsMobile($appFields, $nextDel, $iNewDelIndex);
}
return $iNewDelIndex;
}
@@ -1640,5 +1647,24 @@ class Derivation
}
}
}
/**
* @param $appFields
* @param $nextDel
* @param $iNewDelIndex
* @return bool
*/
private function sendNotificationsMobile($appFields, $nextDel, $iNewDelIndex)
{
try {
$notificationMobile = new \ProcessMaker\BusinessModel\Light\NotificationDevice();
if ($notificationMobile->checkMobileNotifications()) {
$notificationMobile->routeCaseNotificationDevice($appFields, $nextDel, $iNewDelIndex);
}
return true;
} catch (Exception $e) {
\G::log(G::loadTranslation('ID_NOTIFICATION_ERROR') . '|' . $e->getMessage(), PATH_DATA, "mobile.log");
}
}
}

View File

@@ -3652,7 +3652,7 @@ function PMFCopyDocumentCase($appDocUid, $versionNumber, $targetCaseUid, $inputD
* @param string | $taskUid | Task Uid | The unique Id of the Task.
* @param string | $userGroupUid | Uid from User or Group | The unique Uid from User or Group.
*
* @return int Returns 1 when is assigned.
* @return int | $result | Result | Returns 1 when is assigned
*/
function PMFAddUserGroupToTask($taskUid, $userGroupUid)
@@ -3693,3 +3693,138 @@ function PMFAddUserGroupToTask($taskUid, $userGroupUid)
return 1;
}
/**
* @method
*
* Remove a user or group from the list of assignees of the Task.
*
* @name PMFRemoveUserGroupFromTask
* @label PMF Remove user or group from a Task
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFRemoveUserGroupFromTask.28.29
*
* @param string | $taskUid | Task Uid | The unique Id of the Task.
* @param string | $userGroupUid | Uid from User or Group | The unique Id from User or Group.
*
* @return int | $result | Result | Returns 1 when is remove
*/
function PMFRemoveUserGroupFromTask($taskUid, $userGroupUid)
{
//Verify data and Set variables
$task = new \ProcessMaker\BusinessModel\Task();
$taskwf = TaskPeer::retrieveByPK($taskUid);
if (is_null($taskwf)) {
throw new Exception(G::LoadTranslation('ID_TASK_NOT_EXIST', ['tas_uid', $taskUid]));
}
$uid = '';
$objUser = UsersPeer::retrieveByPK($userGroupUid);
if (!is_null($objUser)) {
$uid = $userGroupUid;
} else {
$groupUid = GroupwfPeer::retrieveByPK($userGroupUid);
if (!is_null($groupUid)) {
$uid = $userGroupUid;
} else {
throw new Exception(G::LoadTranslation(
'ID_USER_GROUP_NOT_CORRESPOND', [$userGroupUid, G::LoadTranslation('ID_USER') . '/' . G::LoadTranslation('ID_GROUP')]
));
}
}
//Remove User/Group
$task->removeTaskAssignee($taskwf->getProUid(), $taskUid, $uid);
//Return
return 1;
}
/**
* @method
*
* Sends emails to user's group using a template file
*
* @name PMFSendMessageToGroup
* @label PMF Send Message To Group
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFSendMessageToGroup.28.29
*
* @param string(32) | $groupId | Group ID | Unique id of Group.
* @param string(32) | $caseId | Case ID | The UID (unique identification) for a case, which is a string of 32 hexadecimal characters to identify the case.
* @param string | $from | Sender | The email address of the person who sends out the email.
* @param string | $subject | Subject of the email | The subject (title) of the email.
* @param string | $template | Name of the template | The name of the template file in plain text or HTML format which will produce the body of the email.
* @param array | $arrayField = [] | Variables for email template | Optional parameter. An associative array where the keys are the variable names and the values are the variables' values.
* @param array | $arrayAttachment = [] | Attachment | An Optional arrray. An array of files (full paths) to be attached to the email.
* @param boolean | $showMessage = true | Show message | Optional parameter. Set to TRUE to show the message in the case's message history.
* @param int | $delIndex = 0 | Delegation index of the case | Optional parameter. The delegation index of the current task in the case.
* @param mixed | $config = [] | Email server configuration | An optional array: An array of parameters to be used in the Email sent (MESS_ENGINE, MESS_SERVER, MESS_PORT, MESS_FROM_MAIL, MESS_RAUTH, MESS_ACCOUNT, MESS_PASSWORD, and SMTPSecure) Or String: UID of Email server.
* @param int | $limit = 100 | Limit | Limit of mails to send in each bach.
*
* @return int | $result | Result | Returns 1 when is send message to group
*/
function PMFSendMessageToGroup(
$groupId,
$caseId,
$from,
$subject,
$template,
$arrayField = [],
$arrayAttachment = [],
$showMessage = true,
$delIndex = 0,
$config = [],
$limit = 100
) {
//Verify data and Set variables
$group = new \ProcessMaker\BusinessModel\Group();
$case = new \ProcessMaker\BusinessModel\Cases();
$group->throwExceptionIfNotExistsGroup($groupId, '$groupId');
$arrayApplicationData = $case->getApplicationRecordByPk($caseId, ['$applicationUid' => '$caseId'], true);
//Send mails
$criteriaGroupUser = $group->getUserCriteria($groupId, ['condition' => [[UsersPeer::USR_STATUS, 'ACTIVE', Criteria::EQUAL]]]);
$start = 0;
do {
$flagNextRecord = false;
$to = '';
$criteria = clone $criteriaGroupUser;
$criteria->setOffset($start);
$criteria->setLimit($limit);
$rsCriteria = GroupUserPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$record = $rsCriteria->getRow();
$to .= (($to != '')? ', ' : '') . $record['USR_EMAIL'];
$flagNextRecord = true;
}
if ($flagNextRecord) {
$result = PMFSendMessage(
$caseId, $from, $to, null, null, $subject, $template, $arrayField, $arrayAttachment, $showMessage, $delIndex, $config
);
if ($result == 0) {
return 0;
}
}
$start += $limit;
} while ($flagNextRecord);
//Return
return 1;
}

View File

@@ -119,6 +119,8 @@ class PMScript
*/
public $affected_fields;
public $scriptExecutionTime = 0;
/**
* Constructor of the class PMScript
*
@@ -346,7 +348,15 @@ class PMScript
$sScript .= substr( $this->sScript, $iAux );
$sScript = "try {\n" . $sScript . "\n} catch (Exception \$oException) {\n " . " \$this->aFields['__ERROR__'] = utf8_encode(\$oException->getMessage());\n}";
//echo '<pre>-->'; print_r($this->aFields); echo '<---</pre>';
$this->executeAndCatchErrors( $sScript, $this->sScript );
$timeStart = microtime(true);
$this->executeAndCatchErrors($sScript, $this->sScript);
$timeEnd = microtime(true);
$this->scriptExecutionTime = round($timeEnd - $timeStart, 5);
$this->aFields["__VAR_CHANGED__"] = implode(",", $this->affected_fields);
for ($i = 0; $i < count( $this->affected_fields ); $i ++) {
$_SESSION['TRIGGER_DEBUG']['DATA'][] = Array ('key' => $this->affected_fields[$i],'value' => isset( $this->aFields[$this->affected_fields[$i]] ) ? $this->aFields[$this->affected_fields[$i]] : ''
@@ -508,7 +518,7 @@ class PMScript
}
return $bResult;
}
Public function evaluateVariable ()
{
$process = new Process();
@@ -530,7 +540,7 @@ class PMScript
if(strpos($var, '_label') === false) {
if(in_array($var,$processVariables)) {
if(isset($this->aFields[$var]) && is_array($this->aFields[$var][1]) ) {
$varLabel = $var.'_label';
$varLabel = $var.'_label';
$arrayValue = $this->aFields[$var];
if(is_array($arrayValue) && sizeof($arrayValue)) {
foreach($arrayValue as $val) {
@@ -546,7 +556,7 @@ class PMScript
$varType = $varInfo['VAR_FIELD_TYPE'];
switch($varType) {
case 'array':
$arrayLabels = '["'.implode('","',$arrayLabels).'"]';
$arrayLabels = '["'.implode('","',$arrayLabels).'"]';
$newFields[$var] = $arrayValues;
$newFields[$varLabel] = $arrayLabels;
break;
@@ -555,7 +565,7 @@ class PMScript
$newFields[$varLabel] = $arrayLabels[0];
break;
}
$this->affected_fields[] = $varLabel;
$this->affected_fields[] = $varLabel;
$this->aFields = array_merge($this->aFields,$newFields);
unset($newFields);
unset($arrayValues);
@@ -586,13 +596,13 @@ class PMScript
}
}
} catch (Exception $e) {
}
}
}
}
}
}
}
}
}
}

View File

@@ -5913,11 +5913,12 @@ class Processes
/**
* Get disabled code
*
* @param string $processUid Unique id of Process
* @param string $processUid Unique id of Process
* @param string $workspaceName Workspace name
*
* return array Return array with disabled code found, array empty otherwise
* @return array Returns an array with disabled code found, array empty otherwise
*/
public function getDisabledCode($processUid = "")
public function getDisabledCode($processUid = null, $workspaceName = null)
{
try {
/*----------------------------------********---------------------------------*/
@@ -5933,7 +5934,7 @@ class Processes
}
//Set variables
$cs = new CodeScanner("DISABLED_CODE");
$cs = new CodeScanner((!is_null($workspaceName))? $workspaceName : SYS_SYS);
$delimiter = DBAdapter::getStringDelimiter();
@@ -5949,7 +5950,7 @@ class Processes
$arrayCondition[] = array(ContentPeer::CON_LANG, $delimiter . SYS_LANG . $delimiter, Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, Criteria::LEFT_JOIN);
if ($processUid != "") {
if (!is_null($processUid)) {
$criteria->add(ProcessPeer::PRO_UID, $processUid, Criteria::EQUAL);
}

View File

@@ -72,6 +72,7 @@ class System
'safari_cookie_lifetime' => 1,
'error_reporting' => "",
'display_errors' => 'On',
'enable_blacklist' => 0,
'system_utc_time_zone' => 0,
'server_protocol' => '',
'server_hostname_requests_frontend' => ''
@@ -984,7 +985,7 @@ class System
return $aChanges;
}
public function getEmailConfiguration ()
public static function getEmailConfiguration()
{
$emailServer = new \ProcessMaker\BusinessModel\EmailServer();

View File

@@ -2518,20 +2518,6 @@ class wsBase
$oCase->sendNotifications( $appdel['TAS_UID'], $nextDelegations, $appFields['APP_DATA'], $caseId, $delIndex, $sFromName );
// Send notifications Mobile - Start
try {
$notificationMobile = new \ProcessMaker\BusinessModel\Light\NotificationDevice();
if ($notificationMobile->checkMobileNotifications()) {
$oLight = new \ProcessMaker\BusinessModel\Light();
$nextIndex = $oLight->getInformationDerivatedCase($appFields['APP_UID'], $delIndex);
$notificationMobile->routeCaseNotification($userId, $_SESSION["PROCESS"], $appdel['TAS_UID'],
$appFields, $nextDelegations, $nextIndex, $delIndex);
}
} catch (Exception $e) {
\G::log(G::loadTranslation( 'ID_NOTIFICATION_ERROR' ) . '|' . $e->getMessage() , PATH_DATA, "mobile.log");
}
// Send notifications Mobile - End
//Save data - Start
//$appFields = $oCase->loadCase($caseId);
//$oCase->updateCase($caseId, $appFields);

View File

@@ -1946,7 +1946,7 @@ class workspaceTools
/**
* Get disabled code
*
* return array Return array with disabled code found, array empty otherwise
* @return array Returns an array with disabled code found, array empty otherwise
*/
public function getDisabledCode()
{
@@ -1958,7 +1958,7 @@ class workspaceTools
$process = new Processes();
//Return
return $process->getDisabledCode();
return $process->getDisabledCode(null, $this->name);
} catch (Exception $e) {
throw $e;
}

View File

@@ -376,7 +376,7 @@ class AdditionalTables extends BaseAdditionalTables
}
}
public function getAllData($sUID, $start = null, $limit = null, $keyOrderUppercase = true, $filter = '', $appUid = false)
public function getAllData($sUID, $start = null, $limit = null, $keyOrderUppercase = true, $filter = '', $appUid = false, $search = '')
{
$addTab = new AdditionalTables();
$aData = $addTab->load($sUID, true);
@@ -443,7 +443,48 @@ class AdditionalTables extends BaseAdditionalTables
}
$stringOr = $stringOr . '$oCriteria->add($a);';
eval($stringOr);
}
if ($search !== '' && is_string($search)) {
try {
$object = G::json_decode($search);
if (isset($object->where)) {
$stringAnd = "";
$closure = "";
$fields = $object->where;
foreach ($fields as $key => $value) {
if (is_string($value)) {
$stringAnd = $stringAnd . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . G::toUpper($key) . ', "' . $value . '", Criteria::EQUAL)' . $closure . ';';
$closure = '->addAnd($a)';
}
if (is_object($value)) {
$defined = defined("Base" . $sClassPeerName . "::" . G::toUpper($key));
if ($defined === false) {
throw new Exception(G::loadTranslation("ID_FIELD_NOT_FOUND") . ": " . $key . "");
}
if (isset($value->neq) && $defined) {
$stringAnd = $stringAnd . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . G::toUpper($key) . ', "' . $value->neq . '", Criteria::NOT_EQUAL)' . $closure . ';';
$closure = '->addAnd($a)';
}
if (isset($value->like) && $defined) {
$stringAnd = $stringAnd . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . G::toUpper($key) . ', "' . $value->like . '", Criteria::LIKE)' . $closure . ';';
$closure = '->addAnd($a)';
}
if (isset($value->nlike) && $defined) {
$stringAnd = $stringAnd . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . G::toUpper($key) . ', "' . $value->nlike . '", Criteria::NOT_LIKE)' . $closure . ';';
$closure = '->addAnd($a)';
}
}
}
if (!empty($stringAnd)) {
$stringAnd = $stringAnd . '$oCriteria->add($a);';
eval($stringAnd);
}
}
} catch (Exception $oError) {
throw($oError);
}
}
if ($filter != '' && is_string($filter) || $search !== '' && is_string($search)) {
$oCriteriaCount = clone $oCriteria;
eval('$count = ' . $sClassPeerName . '::doCount($oCriteria);');
}

View File

@@ -30,6 +30,31 @@ SELECT 'PER_NAME','','00000000000000000000000000000035','en','Setup Logs' UNION
SELECT 'PER_NAME','','00000000000000000000000000000036','en','Delete process cases' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000037','en','Edit personal info Calendar' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000038','en','Undo cancel case' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000039','en','Create rest API Aplications' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000040','en','Edit User profile First Name' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000041','en','Edit User profile Last Name' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000042','en','Edit User profile Username' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000043','en','Edit User profile Email' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000044','en','Edit User profile Address' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000045','en','Edit User profile Zip Code' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000046','en','Edit User profile Country' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000047','en','Edit User profile State or Region' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000048','en','Edit User profile Location' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000049','en','Edit User profile Phone' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000050','en','Edit User profile Position' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000051','en','Edit User profile Replaced By' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000052','en','Edit User profile Expiration Date' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000053','en','Edit User profile Calendar' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000054','en','Edit User profile Status' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000055','en','Edit User profile Role' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000056','en','Edit User profile Time Zone' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000057','en','Edit User profile Default Language' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000058','en','Edit User profile Costs' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000059','en','Edit User profile Password' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000060','en','Edit User profile Must Change Password at next Logon' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000061','en','Edit User profile Photo' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000062','en','Edit User profile Default Main Menu Options' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000063','en','Edit User profile Default Cases Menu Options' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000013','en','Delete cases' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000012','en','WebDav' UNION ALL
SELECT 'PER_NAME','','00000000000000000000000000000011','en','Dashboard' UNION ALL

View File

@@ -44,7 +44,32 @@ INSERT INTO CONTENT (CON_CATEGORY,CON_PARENT,CON_ID,CON_LANG,CON_VALUE) VALUES
('PER_NAME','','00000000000000000000000000000035','en','Setup Logs'),
('PER_NAME','','00000000000000000000000000000036','en','Delete process cases'),
('PER_NAME','','00000000000000000000000000000037','en','Edit personal info Calendar'),
('PER_NAME','','00000000000000000000000000000038','en','Undo cancel case');
('PER_NAME','','00000000000000000000000000000038','en','Undo cancel case')
('PER_NAME','','00000000000000000000000000000039','en','Create rest API Aplications'),
('PER_NAME','','00000000000000000000000000000040','en','Edit User profile First Name'),
('PER_NAME','','00000000000000000000000000000041','en','Edit User profile Last Name'),
('PER_NAME','','00000000000000000000000000000042','en','Edit User profile Username'),
('PER_NAME','','00000000000000000000000000000043','en','Edit User profile Email'),
('PER_NAME','','00000000000000000000000000000044','en','Edit User profile Address'),
('PER_NAME','','00000000000000000000000000000045','en','Edit User profile Zip Code'),
('PER_NAME','','00000000000000000000000000000046','en','Edit User profile Country'),
('PER_NAME','','00000000000000000000000000000047','en','Edit User profile State or Region'),
('PER_NAME','','00000000000000000000000000000048','en','Edit User profile Location'),
('PER_NAME','','00000000000000000000000000000049','en','Edit User profile Phone'),
('PER_NAME','','00000000000000000000000000000050','en','Edit User profile Position'),
('PER_NAME','','00000000000000000000000000000051','en','Edit User profile Replaced By'),
('PER_NAME','','00000000000000000000000000000052','en','Edit User profile Expiration Date'),
('PER_NAME','','00000000000000000000000000000053','en','Edit User profile Calendar'),
('PER_NAME','','00000000000000000000000000000054','en','Edit User profile Status'),
('PER_NAME','','00000000000000000000000000000055','en','Edit User profile Role'),
('PER_NAME','','00000000000000000000000000000056','en','Edit User profile Time Zone'),
('PER_NAME','','00000000000000000000000000000057','en','Edit User profile Default Language'),
('PER_NAME','','00000000000000000000000000000058','en','Edit User profile Costs'),
('PER_NAME','','00000000000000000000000000000059','en','Edit User profile Password'),
('PER_NAME','','00000000000000000000000000000060','en','Edit User profile Must Change Password at next Logon'),
('PER_NAME','','00000000000000000000000000000061','en','Edit User profile Photo'),
('PER_NAME','','00000000000000000000000000000062','en','Edit User profile Default Main Menu Options'),
('PER_NAME','','00000000000000000000000000000063','en','Edit User profile Default Cases Menu Options');
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'),
@@ -61483,4 +61508,4 @@ INSERT INTO ADDONS_MANAGER (ADDON_DESCRIPTION,ADDON_ID,ADDON_NAME,ADDON_NICK,ADD
('User-based Language Management.','userBasedLanguage','userBasedLanguage','userBasedLanguage','Colosa','localRegistry','ready','00000000000000000000000000010013','features','','','0'),
('User-based Time Zone Management.','userBasedTimeZone','userBasedTimeZone','userBasedTimeZone','Colosa','localRegistry','ready','00000000000000000000000000010014','features','','','0'),
('This Feature will allow to store all input, output and attached documents generated in your processes in Google Drive.','pmGoogleDrive','pmGoogleDrive','pmGoogleDrive','Colosa','localRegistry','ready','00000000000000000000000000010015','features','','','0'),
('Promotion Manager','selectiveImportExport','selectiveImportExport','selectiveImportExport','Colosa','localRegistry','ready','00000000000000000000000000010016','features','','','0');
('Promotion Manager','selectiveImportExport','selectiveImportExport','selectiveImportExport','Colosa','localRegistry','ready','00000000000000000000000000010016','features','','','0');

View File

@@ -54,6 +54,8 @@ $_SESSION['TRIGGER_DEBUG']['ERRORS'] = Array ();
$_SESSION['TRIGGER_DEBUG']['DATA'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_EXECUTION_TIME'] = [];
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'DYNAFORM', $_GET['UID'], 'AFTER' );
$_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] = count( $triggers );
$_SESSION['TRIGGER_DEBUG']['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER'));
@@ -67,6 +69,8 @@ if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) {
//Execute after triggers - Start
$Fields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], 'DYNAFORM', $_GET['UID'], 'AFTER', $Fields['APP_DATA'] );
//Execute after triggers - End
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_EXECUTION_TIME'] = $oCase->arrayTriggerExecutionTime;
}
//go to the next step
@@ -85,4 +89,3 @@ if ($trigger_debug_session) {
}
G::header( 'location: ' . $aNextStep['PAGE'] );

View File

@@ -88,6 +88,7 @@ try {
$_SESSION['TRIGGER_DEBUG']['DATA'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_EXECUTION_TIME'] = [];
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', - 2, 'BEFORE' );
@@ -101,6 +102,7 @@ try {
$_SESSION['TRIGGER_DEBUG']['info'][0]['TIME'] = G::toUpper(G::loadTranslation('ID_BEFORE'));
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers );
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_VALUES'] = $triggers;
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_EXECUTION_TIME'] = $oCase->arrayTriggerExecutionTime;
}
unset($appFields['APP_STATUS']);
@@ -146,6 +148,7 @@ try {
$_SESSION['TRIGGER_DEBUG']['info'][1]['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER'));
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers );
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_VALUES'] = $triggers;
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_EXECUTION_TIME'] = $oCase->arrayTriggerExecutionTime;
}
unset($appFields['APP_STATUS']);
unset($appFields['APP_PROC_STATUS']);
@@ -173,10 +176,10 @@ try {
$pmGoogle = new PMGoogleApi ();
if ($pmGoogle->getServiceGmailStatus ()) {
$flagGmail = true;
$appDel = new AppDelegation ();
$actualThread = $appDel->Load ( $_SESSION ['APPLICATION'], $_SESSION ['INDEX'] );
$appDelPrev = $appDel->LoadParallel ( $_SESSION ['APPLICATION'] );
$Pmgmail = new \ProcessMaker\BusinessModel\Pmgmail ();
foreach ( $appDelPrev as $app ) {
@@ -194,21 +197,6 @@ try {
G::SendTemporalMessage( G::loadTranslation( 'ID_NOTIFICATION_ERROR' ) . ' - ' . $e->getMessage(), 'warning', 'string', null, '100%' );
}
// Send notifications - End
// Send notifications Mobile - Start
try {
$notificationMobile = new \ProcessMaker\BusinessModel\Light\NotificationDevice();
if ($notificationMobile->checkMobileNotifications()) {
$oLight = new \ProcessMaker\BusinessModel\Light();
$nextIndex = $oLight->getInformationDerivatedCase($appFields['APP_UID'], $appFields['DEL_INDEX']);
$notificationMobile->routeCaseNotification($_SESSION['USER_LOGGED'], $_SESSION['PROCESS'], $_SESSION['TASK'],
$appFields, $_POST['form']['TASKS'], $nextIndex, $appFields['DEL_INDEX']);
}
} catch (Exception $e) {
\G::log(G::loadTranslation( 'ID_NOTIFICATION_ERROR' ) . '|' . $e->getMessage() , PATH_DATA, "mobile.log");
}
// Send notifications Mobile - End
// Events - Start
$oEvent = new Event();
@@ -310,4 +298,3 @@ try {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'blank' );
}

View File

@@ -70,21 +70,21 @@ if (!isset($_SESSION['USER_LOGGED'])) {
}
/**
* If you can, you may want to set post_max_size to a low value (say 1M) to make
* testing easier. First test to see how your script behaves. Try uploading a file
* that is larger than post_max_size. If you do you will get a message like this
* If you can, you may want to set post_max_size to a low value (say 1M) to make
* testing easier. First test to see how your script behaves. Try uploading a file
* that is larger than post_max_size. If you do you will get a message like this
* in your error log:
*
* [09-Jun-2010 19:28:01] PHP Warning: POST Content-Length of 30980857 bytes exceeds
*
* [09-Jun-2010 19:28:01] PHP Warning: POST Content-Length of 30980857 bytes exceeds
* the limit of 2097152 bytes in Unknown on line 0
*
*
* This makes the script is not completed.
*
*
* Solving the problem:
* The PHP documentation http://php.net/manual/en/ini.core.php#ini.post-max-size
* provides a hack to solve this problem:
*
* If the size of post data is greater than post_max_size, the $_POST and $_FILES
*
* If the size of post data is greater than post_max_size, the $_POST and $_FILES
* superglobals are empty.
*/
if ($_SERVER['REQUEST_METHOD'] == 'POST' && empty($_POST) && empty($_FILES) && $_SERVER['CONTENT_LENGTH'] > 0) {
@@ -149,6 +149,7 @@ try {
$_SESSION['TRIGGER_DEBUG']['DATA'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_EXECUTION_TIME'] = [];
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'DYNAFORM', $_GET['UID'], 'AFTER' );
@@ -170,6 +171,8 @@ try {
//Execute after triggers - Start
$Fields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], 'DYNAFORM', $_GET['UID'], 'AFTER', $Fields['APP_DATA'] );
//Execute after triggers - End
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_EXECUTION_TIME'] = $oCase->arrayTriggerExecutionTime;
}
//save data in PM Tables if necessary
@@ -493,4 +496,3 @@ try {
G::RenderPage( 'publish', 'blank' );
die();
}

View File

@@ -84,6 +84,7 @@ $_SESSION["TRIGGER_DEBUG"]["ERRORS"] = array();
$_SESSION["TRIGGER_DEBUG"]["DATA"] = array();
$_SESSION["TRIGGER_DEBUG"]["TRIGGERS_NAMES"] = array();
$_SESSION["TRIGGER_DEBUG"]["TRIGGERS_VALUES"] = array();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_EXECUTION_TIME'] = [];
$_SESSION["TRIGGER_DEBUG"]["NUM_TRIGGERS"] = count($arrayTrigger);
$_SESSION["TRIGGER_DEBUG"]["TIME"] = "AFTER";
@@ -229,4 +230,3 @@ $_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish' );
}*/

View File

@@ -196,6 +196,7 @@ if ($flagExecuteBeforeTriggers) {
$_SESSION['TRIGGER_DEBUG']['DATA'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_EXECUTION_TIME'] = [];
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], $_GET['TYPE'], $_GET['UID'], 'BEFORE' );
@@ -210,6 +211,8 @@ if ($flagExecuteBeforeTriggers) {
//Execute before triggers - Start
$Fields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], $_GET['TYPE'], $_GET['UID'], 'BEFORE', $Fields['APP_DATA'] );
//Execute before triggers - End
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_EXECUTION_TIME'] = $oCase->arrayTriggerExecutionTime;
} else {
unset( $_SESSION['_NO_EXECUTE_TRIGGERS_'] );
}
@@ -632,6 +635,8 @@ try {
$Fields['TAS_UID'] = $_SESSION['TASK'];
//Execute after triggers - End
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_EXECUTION_TIME'] = $oCase->arrayTriggerExecutionTime;
//Save data - Start
unset($Fields['APP_STATUS']);
unset($Fields['APP_PROC_STATUS']);
@@ -1187,4 +1192,3 @@ if ($_SESSION['TRIGGER_DEBUG']['ISSET'] && !$isIE) {
showdebug();
}' );
}

View File

@@ -27,6 +27,10 @@ foreach ($aTriggers as $aTrigger) {
$geshi->set_line_style( 'background: #f0f0f0;' );
$triggersList[$i]['code'] = $geshi->parse_code(); //$aTrigger['TRIGGERS_VALUES'][$index]['TRI_WEBBOT'];
$triggerUid = $aTrigger['TRIGGERS_VALUES'][$index]['TRI_UID'];
$triggersList[$i]['script_execution_time'] = $aTrigger['TRIGGERS_EXECUTION_TIME'][$triggerUid];
$i ++;
}
} else {

View File

@@ -71,9 +71,7 @@ if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm
if (!empty($arrayTrigger)) {
G::LoadClass("codeScanner");
$arraySystemConfiguration = System::getSystemConfiguration(PATH_CONFIG . "env.ini");
$cs = new CodeScanner((isset($arraySystemConfiguration["enable_blacklist"]) && (int)($arraySystemConfiguration["enable_blacklist"]) == 1)? "DISABLED_CODE" : "");
$cs = new CodeScanner(SYS_SYS);
$strFoundDisabledCode = "";
@@ -313,7 +311,7 @@ if (isset($_POST["PRO_FILENAME"]) &&
G::LoadClass( 'Process' );
$oProcess = new Process();
$processData = $oProcess->load( $prjUid );
$proType = $processData["PRO_TYPE"];
$proType = $processData["PRO_TYPE"];
$result = array(
"success" => true,

View File

@@ -58,9 +58,7 @@ if ($handle = opendir( PATH_PLUGINS )) {
//Check disabled code
G::LoadClass("codeScanner");
$arraySystemConfiguration = System::getSystemConfiguration(PATH_CONFIG . "env.ini");
$cs = new CodeScanner((isset($arraySystemConfiguration["enable_blacklist"]) && (int)($arraySystemConfiguration["enable_blacklist"]) == 1)? "DISABLED_CODE" : "");
$cs = new CodeScanner(SYS_SYS);
$arrayFoundDisabledCode = array_merge($cs->checkDisabledCode("FILE", PATH_PLUGINS . $pluginName . ".php"), $cs->checkDisabledCode("PATH", PATH_PLUGINS . $pluginName));

View File

@@ -252,9 +252,7 @@ try {
//Check disabled code
G::LoadClass("codeScanner");
$arraySystemConfiguration = System::getSystemConfiguration(PATH_CONFIG . "env.ini");
$cs = new CodeScanner((isset($arraySystemConfiguration["enable_blacklist"]) && (int)($arraySystemConfiguration["enable_blacklist"]) == 1)? "DISABLED_CODE" : "");
$cs = new CodeScanner(SYS_SYS);
$arrayFoundDisabledCode = array_merge($cs->checkDisabledCode("FILE", $path . $pluginFile), $cs->checkDisabledCode("PATH", $path . $sClassName));

View File

@@ -87,9 +87,7 @@ if (isset( $sfunction ) && $sfunction == 'lookforNameTrigger') {
//Check disabled code
G::LoadClass("codeScanner");
$arraySystemConfiguration = System::getSystemConfiguration(PATH_CONFIG . "env.ini");
$cs = new CodeScanner((isset($arraySystemConfiguration["enable_blacklist"]) && (int)($arraySystemConfiguration["enable_blacklist"]) == 1)? "DISABLED_CODE" : "");
$cs = new CodeScanner(SYS_SYS);
$arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $value["TRI_WEBBOT"]);

View File

@@ -132,6 +132,8 @@ switch ($_POST['action']) {
try {
$user = new \ProcessMaker\BusinessModel\User();
$form = $_POST;
$permissionsToSaveData = $user->getPermissionsForEdit();
$form = $user->checkPermissionForEdit($_SESSION['USER_LOGGED'], $permissionsToSaveData, $form);
switch ($_POST['action']) {
case 'saveUser';
@@ -145,13 +147,6 @@ switch ($_POST['action']) {
) {
throw new Exception(G::LoadTranslation('ID_USER_NOT_HAVE_PERMISSION', [$_SESSION['USER_LOGGED']]));
}
unset(
$form['USR_REPLACED_BY'],
$form['USR_DUE_DATE'],
$form['USR_STATUS'],
$form['USR_ROLE']
);
break;
default:
throw new Exception(G::LoadTranslation('ID_INVALID_DATA'));
@@ -159,7 +154,7 @@ switch ($_POST['action']) {
}
if (array_key_exists('USR_LOGGED_NEXT_TIME', $form)) {
$form['USR_LOGGED_NEXT_TIME'] = ($form['USR_LOGGED_NEXT_TIME'])? 1 : 0;
$form['USR_LOGGED_NEXT_TIME'] = ($form['USR_LOGGED_NEXT_TIME']) ? 1 : 0;
}
$userUid = '';
@@ -168,7 +163,7 @@ switch ($_POST['action']) {
$arrayUserData = $user->create($form);
$userUid = $arrayUserData['USR_UID'];
$user->auditLog('INS', array_merge(['USR_UID' => $userUid, 'USR_USERNAME' => $arrayUserData['USR_USERNAME']], $form));
$user->auditLog('INS', array_merge(['USR_UID' => $userUid, 'USR_USERNAME' => $arrayUserData['USR_USERNAME']], $form));
} else {
if (array_key_exists('USR_NEW_PASS', $form) && $form['USR_NEW_PASS'] == '') {
unset($form['USR_NEW_PASS']);
@@ -179,7 +174,7 @@ switch ($_POST['action']) {
$arrayUserData = $user->getUserRecordByPk($userUid, [], false);
$user->auditLog('UPD', array_merge(['USR_UID' => $userUid, 'USR_USERNAME' => $arrayUserData['USR_USERNAME']], $form));
$user->auditLog('UPD', array_merge(['USR_UID' => $userUid, 'USR_USERNAME' => $arrayUserData['USR_USERNAME']], $form));
/* Saving preferences */
$def_lang = $form['PREF_DEFAULT_LANG'];
@@ -298,9 +293,9 @@ switch ($_POST['action']) {
break;
}
} else {
if($aFields['PREF_DEFAULT_MENUSELECTED'] == 'PM_STRATEGIC_DASHBOARD'){
$menuSelected = strtoupper(G::LoadTranslation('ID_STRATEGIC_DASHBOARD'));
}
if ($aFields['PREF_DEFAULT_MENUSELECTED'] == 'PM_STRATEGIC_DASHBOARD') {
$menuSelected = strtoupper(G::LoadTranslation('ID_STRATEGIC_DASHBOARD'));
}
}
}
}
@@ -333,12 +328,16 @@ switch ($_POST['action']) {
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($aFields['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array($aFields['USR_PASSWORD']))));
$aFields['USR_LOGGED_NEXT_TIME'] = $aUserProperty['USR_LOGGED_NEXT_TIME'];
if(array_key_exists('USR_PASSWORD', $aFields)) {
if (array_key_exists('USR_PASSWORD', $aFields)) {
unset($aFields['USR_PASSWORD']);
}
$userPermissions = new \ProcessMaker\BusinessModel\User();
$permissions = $userPermissions->loadDetailedPermissions($aFields);
$result->success = true;
$result->user = $aFields;
$result->permission = $permissions;
print (G::json_encode($result));
break;

View File

@@ -625,9 +625,13 @@ class Group
*
* return object
*/
public function getUserCriteria($groupUid, $arrayFilterData = null, $arrayUserUidExclude = null)
public function getUserCriteria($groupUid, array $arrayWhere = null, $arrayUserUidExclude = null)
{
try {
$flag = !is_null($arrayWhere) && is_array($arrayWhere);
$flagCondition = $flag && array_key_exists('condition', $arrayWhere);
$flagFilter = $flag && array_key_exists('filter', $arrayWhere);
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\UsersPeer::USR_UID);
@@ -642,17 +646,23 @@ class Group
$criteria->add(\GroupUserPeer::GRP_UID, $groupUid, \Criteria::EQUAL);
}
$criteria->add(\UsersPeer::USR_STATUS, "CLOSED", \Criteria::NOT_EQUAL);
if ($flagCondition && !empty($arrayWhere['condition'])) {
foreach ($arrayWhere['condition'] as $value) {
$criteria->add($value[0], $value[1], $value[2]);
}
} else {
$criteria->add(\UsersPeer::USR_STATUS, 'CLOSED', \Criteria::NOT_EQUAL);
}
if (!is_null($arrayUserUidExclude) && is_array($arrayUserUidExclude)) {
$criteria->add(\UsersPeer::USR_UID, $arrayUserUidExclude, \Criteria::NOT_IN);
}
if (!is_null($arrayFilterData) && is_array($arrayFilterData) && isset($arrayFilterData["filter"]) && trim($arrayFilterData["filter"]) != "") {
if ($flagFilter && trim($arrayWhere['filter']) != '') {
$criteria->add(
$criteria->getNewCriterion(\UsersPeer::USR_USERNAME, "%" . $arrayFilterData["filter"] . "%", \Criteria::LIKE)->addOr(
$criteria->getNewCriterion(\UsersPeer::USR_FIRSTNAME, "%" . $arrayFilterData["filter"] . "%", \Criteria::LIKE)->addOr(
$criteria->getNewCriterion(\UsersPeer::USR_LASTNAME, "%" . $arrayFilterData["filter"] . "%", \Criteria::LIKE)))
$criteria->getNewCriterion(\UsersPeer::USR_USERNAME, '%' . $arrayWhere['filter'] . '%', \Criteria::LIKE)->addOr(
$criteria->getNewCriterion(\UsersPeer::USR_FIRSTNAME, '%' . $arrayWhere['filter'] . '%', \Criteria::LIKE)->addOr(
$criteria->getNewCriterion(\UsersPeer::USR_LASTNAME, '%' . $arrayWhere['filter'] . '%', \Criteria::LIKE)))
);
}

View File

@@ -154,113 +154,96 @@ class NotificationDevice
}
/**
* Send Message each user id
*
* @param array $request_data
* @author Ronald Quenta <ronald.quenta@processmaker.com>
*
* @param $appFields
* @param $nextDel
* @param $iNewDelIndex
* @return array
* @throws \Exception
*/
public function routeCaseNotification($currentUserId, $processId, $currentTaskId, $appFields, $aTasks,
$nextIndex, $currentDelIndex)
public function routeCaseNotificationDevice($appFields, $nextDel, $iNewDelIndex)
{
try {
$response = array();
$typeList = 'todo';
foreach ($aTasks as $aTask) {
$arrayTaskUser = array();
$delIndex = null;
foreach ($nextIndex as $nIndex) {
if ($aTask['TAS_UID'] == $nIndex['TAS_UID']) {
$delIndex = $nIndex['DEL_INDEX'];
break;
$arrayTaskUser = array();
switch ($nextDel["TAS_ASSIGN_TYPE"]) {
case "SELF_SERVICE":
$arrayTaskUser = $this->getTaskUserSelfService($nextDel["TAS_UID"], $appFields);
$typeList = 'unassigned';
break;
default:
if (isset($nextDel["USR_UID"]) && !empty($nextDel["USR_UID"])) {
$arrayTaskUser = $nextDel["USR_UID"];
}
}
switch ($aTask["TAS_ASSIGN_TYPE"]) {
case "MULTIPLE_INSTANCE":
case "MULTIPLE_INSTANCE_VALUE_BASED":
$arrayTaskUser = $this->getTaskUserMultipleInstance($aTask["TAS_UID"], $appFields);
$delIndex = 0;
break;
case "SELF_SERVICE":
$arrayTaskUser = $this->getTaskUserSelfService($aTask["TAS_UID"], $appFields);
$typeList = 'unassigned';
break;
default:
if (isset($aTask["USR_UID"]) && !empty($aTask["USR_UID"])) {
$arrayTaskUser = $aTask["USR_UID"];
}
break;
break;
}
$userIds = $arrayTaskUser;
//sub process
$taskAssignType = (isset($nextDel["TAS_ASSIGN_TYPE"])) ? $nextDel["TAS_ASSIGN_TYPE"] : $nextDel["SP_TYPE"];
$message = '#' . $appFields['APP_NUMBER'] . ' : ' . $appFields['APP_TITLE'];
$data = array(
'processId' => $appFields['PRO_UID'],
'taskId' => $nextDel["TAS_UID"],
'taskAssignType' => $taskAssignType,
'caseId' => $appFields['APP_UID'],
'caseTitle' => $appFields['APP_TITLE'],
'delIndex' => $iNewDelIndex,
'typeList' => $typeList,
'caseNumber' => $appFields['APP_NUMBER']
);
if ($userIds) {
$oNoti = new \NotificationDevice();
if (is_array($userIds)) {
$devices = $oNoti->loadUsersArrayId($userIds);
} else {
$devices = $oNoti->loadByUsersId($userIds);
$lists = new \ProcessMaker\BusinessModel\Lists();
$counter = $lists->getCounters($userIds);
$light = new \ProcessMaker\Services\Api\Light();
$result = $light->parserCountersCases($counter);
$data['counters'] = $result;
}
$userIds = $arrayTaskUser;
$message = '#'. $appFields['APP_NUMBER'] . ' : '.$appFields['APP_TITLE'];
$data = array(
'processId' => $processId,
'taskId' => $aTask["TAS_UID"],
'taskAssignType' => $aTask["TAS_ASSIGN_TYPE"],
'caseId' => $appFields['APP_UID'],
'caseTitle' => $appFields['APP_TITLE'],
'delIndex' => $delIndex,
'typeList' => $typeList,
'caseNumber' => $appFields['APP_NUMBER']
);
if ($userIds) {
$oNoti = new \NotificationDevice();
$devices = array();
if (is_array($userIds)) {
$devices = $oNoti->loadUsersArrayId($userIds);
} else {
$devices = $oNoti->loadByUsersId($userIds);
$lists = new \ProcessMaker\BusinessModel\Lists();
$counter = $lists->getCounters($userIds);
$light = new \ProcessMaker\Services\Api\Light();
$result = $light->parserCountersCases($counter);
$data['counters'] = $result;
}
$devicesAndroidIds = array();
$devicesAppleIds = array();
foreach ($devices as $dev) {
switch ($dev['DEV_TYPE']) {
case "apple":
$devicesAppleIds[] = $dev['DEV_REG_ID'];
break;
case "android":
$devicesAndroidIds[] = $dev['DEV_REG_ID'];
break;
}
}
$isExistNextNotifications = $oNoti->isExistNextNotification($appFields['APP_UID'],
$currentDelIndex);
if (count($devicesAppleIds) > 0 && $isExistNextNotifications) {
$arrayData = array();
$arrayData['NOT_FROM'] = $currentUserId;
$arrayData['DEV_TYPE'] = 'apple';
$arrayData['DEV_UID'] = serialize($devicesAppleIds);
$arrayData['NOT_MSG'] = $message;
$arrayData['NOT_DATA'] = serialize($data);
$arrayData['NOT_STATUS'] = "pending";
$notQueue = new \NotificationQueue();
$notQueue->create($arrayData);
}
if (count($devicesAndroidIds) > 0 && $isExistNextNotifications) {
$arrayData = array();
$arrayData['NOT_FROM'] = $currentUserId;
$arrayData['DEV_TYPE'] = 'android';
$arrayData['DEV_UID'] = serialize($devicesAndroidIds);
$arrayData['NOT_MSG'] = $message;
$arrayData['NOT_DATA'] = serialize($data);
$arrayData['NOT_STATUS'] = "pending";
$notQueue = new \NotificationQueue();
$notQueue->create($arrayData);
$devicesAndroidIds = array();
$devicesAppleIds = array();
foreach ($devices as $dev) {
switch ($dev['DEV_TYPE']) {
case "apple":
$devicesAppleIds[] = $dev['DEV_REG_ID'];
break;
case "android":
$devicesAndroidIds[] = $dev['DEV_REG_ID'];
break;
}
}
if (count($devicesAppleIds) > 0) {
$arrayData = array();
$arrayData['NOT_FROM'] = $appFields['APP_CUR_USER'];
$arrayData['DEV_TYPE'] = 'apple';
$arrayData['DEV_UID'] = serialize($devicesAppleIds);
$arrayData['NOT_MSG'] = $message;
$arrayData['NOT_DATA'] = serialize($data);
$arrayData['NOT_STATUS'] = "pending";
$notQueue = new \NotificationQueue();
$notQueue->create($arrayData);
}
if (count($devicesAndroidIds) > 0) {
$arrayData = array();
$arrayData['NOT_FROM'] = $appFields['APP_CUR_USER'];
$arrayData['DEV_TYPE'] = 'android';
$arrayData['DEV_UID'] = serialize($devicesAndroidIds);
$arrayData['NOT_MSG'] = $message;
$arrayData['NOT_DATA'] = serialize($data);
$arrayData['NOT_STATUS'] = "pending";
$notQueue = new \NotificationQueue();
$notQueue->create($arrayData);
}
}
} catch (\Exception $e) {
throw new \Exception($e->getMessage(), Api::STAT_APP_EXCEPTION);
}
return $response;
}
@@ -302,16 +285,4 @@ class NotificationDevice
return $arrayTaskUser;
}
public function getTaskUserMultipleInstance($tas_uid, $appFields)
{
$oDerivation = new \Derivation();
$taskNextDel = \TaskPeer::retrieveByPK($tas_uid);
$oDerivation->case = new \Cases();
$arrayUsersOfTask = $oDerivation->getNextAssignedUser(array("APP_UID" => $appFields['APP_UID'], "NEXT_TASK" => $taskNextDel->toArray(\BasePeer::TYPE_FIELDNAME)));
$arrayTaskUser = array();
foreach ($arrayUsersOfTask as $arrayUser) {
$arrayTaskUser[] = $arrayUser["USR_UID"];
}
return $arrayTaskUser;
}
}

View File

@@ -54,8 +54,6 @@ class ProcessDefinitionMigrator implements Importable, Exportable
//Workflow elements
$this->processes->updateProcessRow($data['workflow']['process']);
$this->processes->createTaskRows($data['workflow']['tasks']);
$this->processes->createRouteRows($data['workflow']['routes']);
$this->processes->replaceRouteRows($data['workflow']['routes']);
$this->processes->createLaneRows($data['workflow']['lanes']);
$this->processes->createGatewayRows($data['workflow']['gateways']);
$this->processes->createStepRows($data['workflow']['steps']);

View File

@@ -150,7 +150,7 @@ class Table
*
* @return array
*/
public function getTableData($tab_uid, $pro_uid = '', $filter = null, $reportFlag = false)
public function getTableData($tab_uid, $pro_uid = '', $filter = null, $reportFlag = false, $search = '')
{
//Validation
$inputFilter = new \InputFilter();
@@ -164,7 +164,7 @@ class Table
$additionalTables = new AdditionalTables();
$table = $additionalTables->load($tab_uid, true);
$result = $additionalTables->getAllData($tab_uid, null, null, null, $filter);
$result = $additionalTables->getAllData($tab_uid, null, null, null, $filter, false, $search);
$primaryKeys = $additionalTables->getPrimaryKeys();
if (is_array($result['rows'])) {
foreach ($result['rows'] as $i => $row) {

View File

@@ -188,9 +188,7 @@ class Trigger
//Check disabled code
\G::LoadClass("codeScanner");
$arraySystemConfiguration = \System::getSystemConfiguration(PATH_CONFIG . "env.ini");
$cs = new \CodeScanner((isset($arraySystemConfiguration["enable_blacklist"]) && (int)($arraySystemConfiguration["enable_blacklist"]) == 1)? "DISABLED_CODE" : "");
$cs = new \CodeScanner(SYS_SYS);
$arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $dataTrigger["TRI_WEBBOT"]);

View File

@@ -42,6 +42,36 @@ class User
"usrPhoto" => "USR_PHOTO"
);
private $arrayPermissionsForEditUser = array (
'USR_FIRSTNAME' => 'PM_EDIT_USER_PROFILE_FIRST_NAME',
'USR_LASTNAME' => 'PM_EDIT_USER_PROFILE_LAST_NAME',
'USR_USERNAME' => 'PM_EDIT_USER_PROFILE_USERNAME',
'USR_EMAIL' => 'PM_EDIT_USER_PROFILE_EMAIL',
'USR_ADDRESS' => 'PM_EDIT_USER_PROFILE_ADDRESS',
'USR_ZIP_CODE' => 'PM_EDIT_USER_PROFILE_ZIP_CODE',
'USR_COUNTRY' => 'PM_EDIT_USER_PROFILE_COUNTRY',
'USR_REGION' => 'PM_EDIT_USER_PROFILE_STATE_OR_REGION',
'USR_LOCATION' => 'PM_EDIT_USER_PROFILE_LOCATION',
'USR_PHONE' => 'PM_EDIT_USER_PROFILE_PHONE',
'USR_POSITION' => 'PM_EDIT_USER_PROFILE_POSITION',
'USR_REPLACED_BY' => 'PM_EDIT_USER_PROFILE_REPLACED_BY',
'USR_DUE_DATE' => 'PM_EDIT_USER_PROFILE_EXPIRATION_DATE',
'USR_CALENDAR' => 'PM_EDIT_USER_PROFILE_CALENDAR',
'USR_STATUS' => 'PM_EDIT_USER_PROFILE_STATUS',
'USR_ROLE' => 'PM_EDIT_USER_PROFILE_ROLE',
'USR_TIME_ZONE' => 'PM_EDIT_USER_PROFILE_TIME_ZONE',
'USR_DEFAULT_LANG' => 'PM_EDIT_USER_PROFILE_DEFAULT_LANGUAGE',
'USR_COST_BY_HOUR' => 'PM_EDIT_USER_PROFILE_COSTS',
'USR_UNIT_COST' => 'PM_EDIT_USER_PROFILE_COSTS',
'USR_CUR_PASS' => 'PM_EDIT_USER_PROFILE_PASSWORD',
'USR_NEW_PASS' => 'PM_EDIT_USER_PROFILE_PASSWORD',
'USR_CNF_PASS' => 'PM_EDIT_USER_PROFILE_PASSWORD',
'USR_LOGGED_NEXT_TIME' => 'PM_EDIT_USER_PROFILE_USER_MUST_CHANGE_PASSWORD_AT_NEXT_LOGON',
'USR_PHOTO' => 'PM_EDIT_USER_PROFILE_PHOTO',
'PREF_DEFAULT_MENUSELECTED' => 'PM_EDIT_USER_PROFILE_DEFAULT_MAIN_MENU_OPTIONS',
'PREF_DEFAULT_CASESELECTED' => 'PM_EDIT_USER_PROFILE_DEFAULT_CASES_MENU_OPTIONS'
);
/**
* Constructor of the class
*
@@ -58,6 +88,13 @@ class User
}
}
/**
* @return array
*/
public function getPermissionsForEdit(){
return $this->arrayPermissionsForEditUser;
}
/**
* Set the format of the fields name (uppercase, lowercase)
*
@@ -1322,6 +1359,53 @@ class User
$this->userObj->update($fields);
}
/**
* @param $userUid
* @param array $arrayPermission
* @return User
* @throws \Exception
*/
public function checkPermissionForEdit($userUid, $arrayPermission = array(), $form)
{
try {
foreach ($arrayPermission as $key => $value) {
$flagPermission = $this->checkPermission($userUid, $value);
if (!$flagPermission){
unset($form[$key]);
}
}
return $form;
} catch (\Exception $e) {
throw $e;
}
}
/**
* @param $aFields
* @return array
* @throws \Exception
*/
public function loadDetailedPermissions($aFields)
{
try {
global $RBAC;
$resultPermissionsForUser = array();
if ($aFields['USR_UID'] != '') {
foreach ($this->arrayPermissionsForEditUser as $index => $item) {
if ($RBAC->userCanAccess($item) !== 1) {
$resultPermissionsForUser[$index] = $item;
}
}
return $resultPermissionsForUser;
} else {
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
throw (new \Exception(G::LoadTranslation("ID_USER_UID_DOESNT_EXIST", $lang, array("USR_UID" => $aFields['USR_UID']))));
}
} catch (\Exception $oError) {
throw ($oError);
}
}
/**
* Check permission
*

View File

@@ -268,10 +268,9 @@ abstract class Importer
if (sizeof($objectList) > 0 && $processGranulate) {
$granularObj->import($objectList);
}
}
if($option === self::IMPORT_OPTION_CREATE_NEW || $option === self::IMPORT_OPTION_KEEP_WITHOUT_CHANGING_AND_CREATE_NEW){
$oProcessDef = new \ProcessMaker\BusinessModel\Migrator\ProcessDefinitionMigrator();
$oProcessDef->afterImport($this->importData['tables']);
$project = new \ProcessMaker\Project\Adapter\BpmnWorkflow();
$diagram = $project->getStruct($projectUid);
$res = $project->updateFromStruct($projectUid, $diagram);
}
return $projectUid;
@@ -537,7 +536,19 @@ abstract class Importer
foreach ($arrayWorkflowTables["tasks"] as $key => $value) {
$arrayTaskData = $value;
if (!in_array($arrayTaskData["TAS_TYPE"], array("GATEWAYTOGATEWAY", "WEBENTRYEVENT", "END-MESSAGE-EVENT", "START-MESSAGE-EVENT", "INTERMEDIATE-THROW-MESSAGE-EVENT", "INTERMEDIATE-CATCH-MESSAGE-EVENT", "START-TIMER-EVENT", "INTERMEDIATE-CATCH-TIMER-EVENT", "END-EMAIL-EVENT", "INTERMEDIATE-THROW-EMAIL-EVENT"))) {
if (!in_array($arrayTaskData["TAS_TYPE"], array(
"GATEWAYTOGATEWAY",
"WEBENTRYEVENT",
"END-MESSAGE-EVENT",
"START-MESSAGE-EVENT",
"INTERMEDIATE-THROW-MESSAGE-EVENT",
"INTERMEDIATE-CATCH-MESSAGE-EVENT",
"START-TIMER-EVENT",
"INTERMEDIATE-CATCH-TIMER-EVENT",
"END-EMAIL-EVENT",
"INTERMEDIATE-THROW-EMAIL-EVENT"
))
) {
$result = $workflow->updateTask($arrayTaskData["TAS_UID"], $arrayTaskData);
}
}

View File

@@ -1480,7 +1480,7 @@ class BpmnWorkflow extends Project\Bpmn
$uidOld = $lanesetData["LNS_UID"];
$lanesetData["LNS_UID"] = Util\Common::generateUID();
$diagram = self::refreshElementUid($diagram, $uidOld, $lanesetData["LNS_UID"]);
$result[] = array(
"object" => "laneset",
"old_uid" => $uidOld,
@@ -1515,13 +1515,6 @@ class BpmnWorkflow extends Project\Bpmn
foreach ($diagram["lanes"] as $i => $laneData) {
$laneData = array_change_key_case($laneData, CASE_UPPER);
//Update UIDs
foreach ($result as $value) {
if ($laneData["LNS_UID"] == $value["old_uid"]) {
$laneData["LNS_UID"] = $value["new_uid"];
}
}
$dataObject = $bwp->getLane($laneData["LAN_UID"]);
if ($forceInsert || is_null($dataObject)) {
@@ -1531,7 +1524,7 @@ class BpmnWorkflow extends Project\Bpmn
$uidOld = $laneData["LAN_UID"];
$laneData["LAN_UID"] = Util\Common::generateUID();
$diagram = self::refreshElementUid($diagram, $uidOld, $laneData["LAN_UID"]);
$result[] = array(
"object" => "lane",
"old_uid" => $uidOld,
@@ -2046,5 +2039,24 @@ class BpmnWorkflow extends Project\Bpmn
throw $e;
}
}
public static function refreshElementUid($diagram, $oldUid, $newUid)
{
array_walk_recursive(
$diagram,
function (&$value, $key, $arrayData)
{
try {
if (strcmp($arrayData['oldUid'], $value) === 0){
$value = $arrayData['newUid'];
}
} catch (\Exception $e) {
throw $e;
}
},
['oldUid' => $oldUid, 'newUid' => $newUid]
);
return $diagram;
}
}

View File

@@ -72,6 +72,8 @@ class Pmtable extends Api
/**
* @param string $pmt_uid {@min 1} {@max 32}
* @param string $filter
* @param string $q
* @return array
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
@@ -79,11 +81,11 @@ class Pmtable extends Api
*
* @url GET /:pmt_uid/data
*/
public function doGetPmTableData($pmt_uid, $filter = null)
public function doGetPmTableData($pmt_uid, $filter = null, $q = "")
{
try {
$oPmTable = new \ProcessMaker\BusinessModel\Table();
$response = $oPmTable->getTableData($pmt_uid, null, $filter);
$response = $oPmTable->getTableData($pmt_uid, null, $filter, false, $q);
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));

View File

@@ -43,6 +43,8 @@ class Role extends Api
}
/**
* @access protected
* @class AccessControl {@permission PM_USERS}
* @url GET
*/
public function index($filter = null, $start = null, $limit = null)
@@ -57,6 +59,8 @@ class Role extends Api
}
/**
* @access protected
* @class AccessControl {@permission PM_USERS}
* @url GET /:rol_uid
*
* @param string $rol_uid {@min 32}{@max 32}
@@ -73,6 +77,8 @@ class Role extends Api
}
/**
* @access protected
* @class AccessControl {@permission PM_USERS}
* @url POST
*
* @param array $request_data
@@ -93,6 +99,8 @@ class Role extends Api
}
/**
* @access protected
* @class AccessControl {@permission PM_USERS}
* @url PUT /:rol_uid
*
* @param string $rol_uid {@min 32}{@max 32}
@@ -108,6 +116,8 @@ class Role extends Api
}
/**
* @access protected
* @class AccessControl {@permission PM_USERS}
* @url DELETE /:rol_uid
*
* @param string $rol_uid {@min 32}{@max 32}

View File

@@ -49,6 +49,9 @@ class Permission extends Api
/**
* @url POST /:rol_uid/permission
*
* @access protected
* @class AccessControl {@permission PM_USERS}
*
* @param string $rol_uid {@min 32}{@max 32}
* @param array $request_data
*
@@ -66,8 +69,12 @@ class Permission extends Api
/**
* @url DELETE /:rol_uid/permission/:per_uid
*
* @access protected
* @class AccessControl {@permission PM_USERS}
*
* @param string $rol_uid {@min 32}{@max 32}
* @param string $per_uid {@min 32}{@max 32}
*
*/
public function doDeletePermission($rol_uid, $per_uid)
{

View File

@@ -30,6 +30,8 @@ class User extends Api
}
/**
* @access protected
* @class AccessControl {@permission PM_USERS}
* @url GET /:rol_uid/users
* @url GET /:rol_uid/available-users
*
@@ -51,6 +53,8 @@ class User extends Api
}
/**
* @access protected
* @class AccessControl {@permission PM_USERS}
* @url POST /:rol_uid/user
*
* @param string $rol_uid {@min 32}{@max 32}
@@ -68,6 +72,8 @@ class User extends Api
}
/**
* @access protected
* @class AccessControl {@permission PM_USERS}
* @url DELETE /:rol_uid/user/:usr_uid
*
* @param string $rol_uid {@min 32}{@max 32}

View File

@@ -37,6 +37,8 @@ class User extends Api
}
/**
* @access protected
* @class AccessControl {@permission PM_USERS}
* @url GET
*/
public function index($filter = null, $lfilter = null, $rfilter = null, $start = null, $limit = null)
@@ -59,6 +61,8 @@ class User extends Api
}
/**
* @access protected
* @class AccessControl {@permission PM_USERS}
* @url GET /:usr_uid
*
* @param string $usr_uid {@min 32}{@max 32}
@@ -78,6 +82,8 @@ class User extends Api
}
/**
* @access protected
* @class AccessControl {@permission PM_USERS}
* @url POST
*
* @param array $request_data
@@ -97,6 +103,8 @@ class User extends Api
}
/**
* @access protected
* @class AccessControl {@permission PM_USERS}
* @url PUT /:usr_uid
*
* @param string $usr_uid {@min 32}{@max 32}
@@ -114,6 +122,8 @@ class User extends Api
}
/**
* @access protected
* @class AccessControl {@permission PM_USERS}
* @url DELETE /:usr_uid
*
* @param string $usr_uid {@min 32}{@max 32}
@@ -131,6 +141,8 @@ class User extends Api
/**
* @param string $usr_uid {@min 32} {@max 32}
*
* @access protected
* @class AccessControl {@permission PM_USERS}
* @url POST /:usr_uid/image-upload
*/
public function doPostUserImageUpload($usr_uid)

View File

@@ -337,7 +337,8 @@ Ext.onReady(function(){
[
{name: 'name'},
{name: 'execution_time'},
{name: 'code'}
{name: 'code'},
{name: "script_execution_time"}
]
);
@@ -362,7 +363,8 @@ Ext.onReady(function(){
columns: [
{id:'name',header: _('ID_NAME'), width: 60, sortable: true, dataIndex: 'name'},
{header: _('ID_EXECUTION'), width: 30, sortable: true, dataIndex: 'execution_time'},
{header: "Code", width: 30, sortable: false, dataIndex: 'code', hidden: true}
{header: "Code", width: 30, sortable: false, dataIndex: 'code', hidden: true},
{header: _("ID_EXECUTION_TIME") + " (" + _("ID_MILLISECONDS") + ")", dataIndex: "script_execution_time", width: 60, sortable: true, hidden: true}
],
view: new Ext.grid.GroupingView({

View File

@@ -29,7 +29,6 @@ var displayPreferences;
var box;
var infoMode;
var global = {};
var readMode;
var usernameText;
var previousUsername = '';
var canEdit = true;
@@ -63,6 +62,8 @@ Ext.onReady(function () {
});
displayPreferences = "display: block;";
if (MODE == "edit" || MODE == "") {
flagPoliciesPassword = true;
}
@@ -78,12 +79,7 @@ Ext.onReady(function () {
//Mode info
box.setVisible(false);
box.disable();
displayPreferences = "display: block;";
readMode = true;
} else {
displayPreferences = "display: none;";
readMode = false;
canEdit = false;
}
} else {
@@ -93,8 +89,6 @@ Ext.onReady(function () {
box.setVisible(false);
box.disable();
displayPreferences = "display: none;";
readMode = false;
canEdit = false;
}
@@ -305,7 +299,6 @@ Ext.onReady(function () {
fieldLabel: _("ID_REPLACED_BY"),
emptyText: "- " + _("ID_NONE") + " -",
readOnly: readMode,
minChars: 1,
hideTrigger: true,
@@ -317,8 +310,7 @@ Ext.onReady(function () {
id : "USR_DUE_DATE",
fieldLabel : _("ID_EXPIRATION_DATE"),
format : "Y-m-d",
editable : false,
readOnly : readMode,
editable : true,
width : 120,
value : (new Date().add(Date.YEAR, EXPIRATION_DATE)).format("Y-m-d")
});
@@ -343,7 +335,6 @@ Ext.onReady(function () {
fieldLabel : _('ID_CALENDAR'),
hiddenName : 'USR_CALENDAR',
id : 'USR_CALENDAR',
readOnly : readMode,
store : storeCalendar,
valueField : 'CALENDAR_UID',
displayField : 'CALENDAR_NAME',
@@ -375,8 +366,7 @@ Ext.onReady(function () {
typeAhead : true,
triggerAction : 'all',
editable : false,
value : 'ACTIVE',
readOnly : readMode
value : 'ACTIVE'
});
storeRole = new Ext.data.Store({
@@ -399,7 +389,6 @@ Ext.onReady(function () {
fieldLabel : _('ID_ROLE'),
hiddenName : 'USR_ROLE',
id : 'USR_ROLE',
readOnly : readMode,
store : storeRole,
valueField : 'ROL_UID',
displayField : 'ROL_CODE',
@@ -548,6 +537,7 @@ Ext.onReady(function () {
allowBlank : false
},
{
id : 'USR_ADDRESS',
xtype : 'textarea',
name : 'USR_ADDRESS',
fieldLabel : _('ID_ADDRESS'),
@@ -804,7 +794,7 @@ Ext.onReady(function () {
emptyText : TRANSLATIONS.ID_SELECT,
width : 260,
selectOnFocus : true,
editable : false,
editable : true,
triggerAction : "all",
mode : "local"
});
@@ -877,7 +867,6 @@ Ext.onReady(function () {
}
//location.href = 'users_List';
}
//hidden:readMode
}
]
});
@@ -1222,7 +1211,6 @@ function userFrmEditSubmit()
frmDetails.getForm().findField("USR_REPLACED_BY").setRawValue(usertmp.REPLACED_NAME);
}
Ext.getCmp("USR_STATUS").setDisabled(readMode);
Ext.getCmp("frmDetails").getForm().submit({
url : "usersAjax",
params : {
@@ -1469,6 +1457,8 @@ function loadUserData()
USR_LOGGED_NEXT_TIME : data.user.USR_LOGGED_NEXT_TIME
});
setReadOnlyItems(data.permission);
if (infoMode) {
Ext.getCmp("USR_FIRSTNAME2").setText(data.user.USR_FIRSTNAME);
Ext.getCmp("USR_LASTNAME2").setText(data.user.USR_LASTNAME);
@@ -1613,3 +1603,22 @@ function userExecuteEvent(element, event)
return !element.dispatchEvent(evt);
}
}
function setReadOnlyItems(permissions) {
for (var key in permissions) {
disableAndReadOnly(key)
}
}
function disableAndReadOnly(idElement) {
if(idElement == 'USR_TIME_ZONE'){
idElement = 'cboTimeZone';
}
if(idElement == 'USR_CUR_PASS'){
idElement = 'currentPassword';
}
var myBoxCmp = Ext.getCmp(idElement);
if (myBoxCmp) {
Ext.getCmp(idElement).setReadOnly(true);
Ext.getCmp(idElement).disable();
}
}

View File

@@ -223,12 +223,14 @@
// the request correspond to valid php page, now parse the URI
G::parseURI(getenv("REQUEST_URI"), $isRestRequest);
if(G::isPMUnderUpdating())
{
header("location: /update/updating.php");
if ( DEBUG_TIME_LOG ) G::logTimeByPage();
die;
}
$arrayUpdating = G::isPMUnderUpdating();
if ($arrayUpdating['action']) {
if ($arrayUpdating['workspace'] == "true" || $arrayUpdating['workspace'] == SYS_TEMP) {
header("location: /update/updating.php");
if (DEBUG_TIME_LOG) G::logTimeByPage();
die;
}
}
// verify if index.html exists
if (!file_exists(PATH_HTML . 'index.html')) { // if not, create it from template

View File

@@ -484,11 +484,14 @@ if (SYS_TARGET === false) {
}
// Bootstrap::mylog("sys_temp: ".SYS_TEMP);
if (Bootstrap::isPMUnderUpdating()) {
header( "location: /update/updating.php" );
if (DEBUG_TIME_LOG)
Bootstrap::logTimeByPage();
die();
$arrayUpdating = Bootstrap::isPMUnderUpdating();
if ($arrayUpdating['action']) {
if ($arrayUpdating['workspace'] == "true" || $arrayUpdating['workspace'] == SYS_TEMP) {
header("location: /update/updating.php");
if (DEBUG_TIME_LOG)
Bootstrap::logTimeByPage();
die();
}
}
// verify if index.html exists