Solving conflicts with branch 3.1-CONTENT
This commit is contained in:
@@ -611,9 +611,12 @@ class Bootstrap
|
||||
* 0 to delete the temporary file flag
|
||||
* 1 to set the temporary file flag.
|
||||
* 2 or bigger to check if the temporary file exists.
|
||||
* @content Contains the content of the temporary file
|
||||
* true to all workspace
|
||||
* nameWorkspace to specific workspace
|
||||
* return true if the file exists, otherwise false.
|
||||
*/
|
||||
public function isPMUnderUpdating($setFlag = 2)
|
||||
public function isPMUnderUpdating($setFlag = 2, $content="true")
|
||||
{
|
||||
if (!defined('PATH_DATA')) {
|
||||
return false;
|
||||
@@ -626,12 +629,16 @@ class Bootstrap
|
||||
}
|
||||
} elseif ($setFlag == 1) {
|
||||
$fp = fopen($fileCheck, 'w');
|
||||
$line = fputs($fp, "true");
|
||||
$line = fputs($fp, $content);
|
||||
}
|
||||
// checking temporary file
|
||||
if ($setFlag >= 1) {
|
||||
if (file_exists($fileCheck)) {
|
||||
return true;
|
||||
$res['action'] = true;
|
||||
$fp = fopen($fileCheck, "r");
|
||||
$res['workspace'] = fread($fp, filesize($fileCheck));
|
||||
fclose($fp);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -333,7 +333,7 @@ class G
|
||||
* @param string $key
|
||||
* @return string
|
||||
*/
|
||||
public function decrypt ($string, $key)
|
||||
public static function decrypt($string, $key)
|
||||
{
|
||||
// if ( defined ( 'ENABLE_ENCRYPT' ) && ENABLE_ENCRYPT == 'yes' ) {
|
||||
//if (strpos($string, '|', 0) !== false) return $string;
|
||||
@@ -1820,7 +1820,7 @@ class G
|
||||
* @param type Array $aFields
|
||||
* @return type String
|
||||
*/
|
||||
public function replaceDataGridField($sContent, $aFields, $nl2brRecursive = true)
|
||||
public static function replaceDataGridField($sContent, $aFields, $nl2brRecursive = true)
|
||||
{
|
||||
$nrt = array("\n", "\r", "\t");
|
||||
$nrthtml = array("(n /)", "(r /)", "(t /)");
|
||||
@@ -2816,7 +2816,7 @@ class G
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function array_merges ()
|
||||
public static function array_merges()
|
||||
{
|
||||
$array = array ();
|
||||
$arrays = & func_get_args();
|
||||
@@ -2963,7 +2963,7 @@ class G
|
||||
* Constants: SYS_*
|
||||
* Sessions : USER_* , URS_*
|
||||
*/
|
||||
public function getSystemConstants($params = null)
|
||||
public static function getSystemConstants($params = null)
|
||||
{
|
||||
$t1 = G::microtime_float();
|
||||
$sysCon = array();
|
||||
@@ -5122,9 +5122,12 @@ class G
|
||||
* 0 to delete the temporary file flag
|
||||
* 1 to set the temporary file flag.
|
||||
* 2 or bigger to check if the temporary file exists.
|
||||
* @content Contains the content of the temporary file
|
||||
* true to all workspace
|
||||
* nameWorkspace to specific workspace
|
||||
* return true if the file exists, otherwise false.
|
||||
*/
|
||||
public function isPMUnderUpdating($setFlag = 2)
|
||||
public function isPMUnderUpdating($setFlag = 2, $content="true")
|
||||
{
|
||||
if (!defined('PATH_DATA')) {
|
||||
return false;
|
||||
@@ -5136,12 +5139,16 @@ class G
|
||||
}
|
||||
} elseif ($setFlag == 1) {
|
||||
$fp = fopen($fileCheck,'w');
|
||||
$line = fputs($fp,"true");
|
||||
$line = fputs($fp,$content);
|
||||
}
|
||||
//checking temporary file
|
||||
if ($setFlag >= 1) {
|
||||
if (file_exists($fileCheck)) {
|
||||
return true;
|
||||
$res['action'] = true;
|
||||
$fp = fopen($fileCheck, "r");
|
||||
$res['workspace'] = fread($fp, filesize($fileCheck));
|
||||
fclose($fp);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -5704,7 +5711,7 @@ class G
|
||||
*
|
||||
* @return md5($string)
|
||||
*/
|
||||
public function encryptOld ($string)
|
||||
public static function encryptOld($string)
|
||||
{
|
||||
return md5($string);
|
||||
}
|
||||
|
||||
@@ -233,6 +233,54 @@ class RBAC
|
||||
"PER_NAME" => "Undo cancel case"
|
||||
), array("PER_UID" => "00000000000000000000000000000039", "PER_CODE" => "PM_REST_API_APPLICATIONS",
|
||||
"PER_NAME" => "Create rest API Aplications"
|
||||
), array("PER_UID" => "00000000000000000000000000000040", "PER_CODE" => "PM_EDIT_USER_PROFILE_FIRST_NAME",
|
||||
"PER_NAME" => "Edit User profile First Name"
|
||||
), array("PER_UID" => "00000000000000000000000000000041", "PER_CODE" => "PM_EDIT_USER_PROFILE_LAST_NAME",
|
||||
"PER_NAME" => "Edit User profile Last Name"
|
||||
), array("PER_UID" => "00000000000000000000000000000042", "PER_CODE" => "PM_EDIT_USER_PROFILE_USERNAME",
|
||||
"PER_NAME" => "Edit User profile Username"
|
||||
), array("PER_UID" => "00000000000000000000000000000043", "PER_CODE" => "PM_EDIT_USER_PROFILE_EMAIL",
|
||||
"PER_NAME" => "Edit User profile Email"
|
||||
), array("PER_UID" => "00000000000000000000000000000044", "PER_CODE" => "PM_EDIT_USER_PROFILE_ADDRESS",
|
||||
"PER_NAME" => "Edit User profile Address"
|
||||
), array("PER_UID" => "00000000000000000000000000000045", "PER_CODE" => "PM_EDIT_USER_PROFILE_ZIP_CODE",
|
||||
"PER_NAME" => "Edit User profile Zip Code"
|
||||
), array("PER_UID" => "00000000000000000000000000000046", "PER_CODE" => "PM_EDIT_USER_PROFILE_COUNTRY",
|
||||
"PER_NAME" => "Edit User profile Country"
|
||||
), array("PER_UID" => "00000000000000000000000000000047", "PER_CODE" => "PM_EDIT_USER_PROFILE_STATE_OR_REGION",
|
||||
"PER_NAME" => "Edit User profile State or Region"
|
||||
), array("PER_UID" => "00000000000000000000000000000048", "PER_CODE" => "PM_EDIT_USER_PROFILE_LOCATION",
|
||||
"PER_NAME" => "Edit User profile Location"
|
||||
), array("PER_UID" => "00000000000000000000000000000049", "PER_CODE" => "PM_EDIT_USER_PROFILE_PHONE",
|
||||
"PER_NAME" => "Edit User profile Phone"
|
||||
), array("PER_UID" => "00000000000000000000000000000050", "PER_CODE" => "PM_EDIT_USER_PROFILE_POSITION",
|
||||
"PER_NAME" => "Edit User profile Position"
|
||||
), array("PER_UID" => "00000000000000000000000000000051", "PER_CODE" => "PM_EDIT_USER_PROFILE_REPLACED_BY",
|
||||
"PER_NAME" => "Edit User profile Replaced By"
|
||||
), array("PER_UID" => "00000000000000000000000000000052", "PER_CODE" => "PM_EDIT_USER_PROFILE_EXPIRATION_DATE",
|
||||
"PER_NAME" => "Edit User profile Expiration Date"
|
||||
), array("PER_UID" => "00000000000000000000000000000053", "PER_CODE" => "PM_EDIT_USER_PROFILE_CALENDAR",
|
||||
"PER_NAME" => "Edit User profile Calendar"
|
||||
), array("PER_UID" => "00000000000000000000000000000054", "PER_CODE" => "PM_EDIT_USER_PROFILE_STATUS",
|
||||
"PER_NAME" => "Edit User profile Status"
|
||||
), array("PER_UID" => "00000000000000000000000000000055", "PER_CODE" => "PM_EDIT_USER_PROFILE_ROLE",
|
||||
"PER_NAME" => "Edit User profile Role"
|
||||
), array("PER_UID" => "00000000000000000000000000000056", "PER_CODE" => "PM_EDIT_USER_PROFILE_TIME_ZONE",
|
||||
"PER_NAME" => "Edit User profile Time Zone"
|
||||
), array("PER_UID" => "00000000000000000000000000000057", "PER_CODE" => "PM_EDIT_USER_PROFILE_DEFAULT_LANGUAGE",
|
||||
"PER_NAME" => "Edit User profile Default Language"
|
||||
), array("PER_UID" => "00000000000000000000000000000058", "PER_CODE" => "PM_EDIT_USER_PROFILE_COSTS",
|
||||
"PER_NAME" => "Edit User profile Costs"
|
||||
), array("PER_UID" => "00000000000000000000000000000059", "PER_CODE" => "PM_EDIT_USER_PROFILE_PASSWORD",
|
||||
"PER_NAME" => "Edit User profile Password"
|
||||
), array("PER_UID" => "00000000000000000000000000000060", "PER_CODE" => "PM_EDIT_USER_PROFILE_USER_MUST_CHANGE_PASSWORD_AT_NEXT_LOGON",
|
||||
"PER_NAME" => "Edit User profile Must Change Password at next Logon"
|
||||
), array("PER_UID" => "00000000000000000000000000000061", "PER_CODE" => "PM_EDIT_USER_PROFILE_PHOTO",
|
||||
"PER_NAME" => "Edit User profile Photo"
|
||||
), array("PER_UID" => "00000000000000000000000000000062", "PER_CODE" => "PM_EDIT_USER_PROFILE_DEFAULT_MAIN_MENU_OPTIONS",
|
||||
"PER_NAME" => "Edit User profile Default Main Menu Options"
|
||||
), array("PER_UID" => "00000000000000000000000000000063", "PER_CODE" => "PM_EDIT_USER_PROFILE_DEFAULT_CASES_MENU_OPTIONS",
|
||||
"PER_NAME" => "Edit User profile Default Cases Menu Options"
|
||||
)
|
||||
);
|
||||
return $permissionsAdmin;
|
||||
@@ -889,9 +937,23 @@ class RBAC
|
||||
* @param string $ROL_UID
|
||||
* @return $this->rolesObj->getRolePermissionsByPerUid
|
||||
*/
|
||||
public function getRolePermissionsByPerUid ($ROL_UID)
|
||||
public function getRolePermissionsByPerUid($ROL_UID)
|
||||
{
|
||||
return $this->rolesObj->getRolePermissionsByPerUid( $ROL_UID );
|
||||
return $this->rolesObj->getRolePermissionsByPerUid($ROL_UID);
|
||||
}
|
||||
|
||||
/**
|
||||
* this function is Assigne role permission
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $ROL_UID
|
||||
* @return $this->rolesObj->isAssigneRolePermission
|
||||
*/
|
||||
public function getPermissionAssignedRole($ROL_UID, $PER_UID)
|
||||
{
|
||||
return $this->rolesObj->getPermissionAssignedRole($ROL_UID, $PER_UID);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1271,18 +1333,18 @@ class RBAC
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function verifyPermissions ()
|
||||
public function verifyPermissions()
|
||||
{
|
||||
$message = array();
|
||||
$listPermissions = $this->loadPermissionAdmin();
|
||||
$criteria = new Criteria( 'rbac' );
|
||||
$dataset = PermissionsPeer::doSelectRS( $criteria );
|
||||
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$criteria = new Criteria('rbac');
|
||||
$dataset = PermissionsPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
while (is_array( $aRow )) {
|
||||
foreach($listPermissions as $key => $item) {
|
||||
if ($aRow['PER_UID'] == $item['PER_UID'] ) {
|
||||
while (is_array($aRow)) {
|
||||
foreach ($listPermissions as $key => $item) {
|
||||
if ($aRow['PER_UID'] == $item['PER_UID']) {
|
||||
unset($listPermissions[$key]);
|
||||
break;
|
||||
}
|
||||
@@ -1290,39 +1352,42 @@ class RBAC
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
}
|
||||
foreach($listPermissions as $key => $item) {
|
||||
foreach ($listPermissions as $key => $item) {
|
||||
//Adding new permissions
|
||||
$data = array();
|
||||
$data['PER_UID'] = $item['PER_UID'];
|
||||
$data['PER_CODE'] = $item['PER_CODE'];
|
||||
$data['PER_UID'] = $item['PER_UID'];
|
||||
$data['PER_CODE'] = $item['PER_CODE'];
|
||||
$data['PER_CREATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$data['PER_UPDATE_DATE'] = $data['PER_CREATE_DATE'];
|
||||
$data['PER_STATUS'] = 1;
|
||||
$permission = new Permissions();
|
||||
$data['PER_STATUS'] = 1;
|
||||
$permission = new Permissions();
|
||||
$permission->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
$permission->save();
|
||||
$message[] = 'Add permission missing ' . $item['PER_CODE'];
|
||||
|
||||
//Adding new labels for new permissions
|
||||
$o = new RolesPermissions();
|
||||
$o->setPerUid($item['PER_UID']);
|
||||
$o->setPermissionName($item['PER_NAME']);
|
||||
//assigning new permissions
|
||||
$this->assigningNewPermissionsPmSetup($item);
|
||||
$this->assigningNewPermissionsPmEditProfile($item);
|
||||
}
|
||||
return $message;
|
||||
}
|
||||
|
||||
//Assigning new permissions
|
||||
/**
|
||||
* Permissions for tab ADMIN
|
||||
* @param array $item
|
||||
*/
|
||||
public function assigningNewPermissionsPmSetup($item = array())
|
||||
{
|
||||
if (strpos($item['PER_CODE'], 'PM_SETUP_') !== false) {
|
||||
$rolesWithPermissionSetup = $this->getRolePermissionsByPerUid(self::SETUPERMISSIONUID);
|
||||
$rolesWithPermissionSetup->next();
|
||||
while ($aRow = $rolesWithPermissionSetup->getRow()) {
|
||||
$userRolePermission = $this->getRolePermissions($aRow['ROL_UID']);
|
||||
$userRolePermission->next();
|
||||
$valueNewPermissions = false;
|
||||
while ($aRowPermission = $userRolePermission->getRow()) {
|
||||
if ($item['PER_CODE'] === $aRowPermission['PER_CODE']) {
|
||||
$valueNewPermissions = true;
|
||||
}
|
||||
$userRolePermission->next();
|
||||
}
|
||||
$dataPermissions = array();
|
||||
if (!$valueNewPermissions) {
|
||||
$isAssignedNewpermissions = $this->getPermissionAssignedRole($aRow['ROL_UID'], $item['PER_UID']);
|
||||
if (!$isAssignedNewpermissions) {
|
||||
$dataPermissions = array();
|
||||
$dataPermissions['ROL_UID'] = $aRow['ROL_UID'];
|
||||
$dataPermissions['PER_UID'] = $item['PER_UID'];
|
||||
$this->assignPermissionRole($dataPermissions);
|
||||
@@ -1330,7 +1395,51 @@ class RBAC
|
||||
$rolesWithPermissionSetup->next();
|
||||
}
|
||||
}
|
||||
return $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Permissions for Edit Profile User
|
||||
* @param array $item
|
||||
*/
|
||||
public function assigningNewPermissionsPmEditProfile($item = array())
|
||||
{
|
||||
if (strpos($item['PER_CODE'], 'PM_EDIT_USER_PROFILE_') !== false) {
|
||||
$allRolesRolUid = $this->getAllRoles('PROCESSMAKER');
|
||||
$perCodePM = array('PROCESSMAKER_ADMIN', 'PROCESSMAKER_OPERATOR', 'PROCESSMAKER_MANAGER');
|
||||
$permissionsForOperator = array(
|
||||
'PM_EDIT_USER_PROFILE_POSITION',
|
||||
'PM_EDIT_USER_PROFILE_REPLACED_BY',
|
||||
'PM_EDIT_USER_PROFILE_EXPIRATION_DATE',
|
||||
'PM_EDIT_USER_PROFILE_STATUS',
|
||||
'PM_EDIT_USER_PROFILE_ROLE',
|
||||
'PM_EDIT_USER_PROFILE_COSTS',
|
||||
'PM_EDIT_USER_PROFILE_USER_MUST_CHANGE_PASSWORD_AT_NEXT_LOGON',
|
||||
'PM_EDIT_USER_PROFILE_DEFAULT_MAIN_MENU_OPTIONS',
|
||||
'PM_EDIT_USER_PROFILE_DEFAULT_CASES_MENU_OPTIONS'
|
||||
);
|
||||
foreach ($allRolesRolUid as $index => $aRow) {
|
||||
$isAssignedNewpermissions = $this->getPermissionAssignedRole($aRow['ROL_UID'], $item['PER_UID']);
|
||||
$assignPermissions = true;
|
||||
if (!$isAssignedNewpermissions) {
|
||||
if ($aRow['ROL_CODE'] == 'PROCESSMAKER_OPERATOR' && in_array($item['PER_CODE'], $permissionsForOperator)) {
|
||||
$assignPermissions = false;
|
||||
}
|
||||
if (!in_array($aRow['ROL_CODE'], $perCodePM)) {
|
||||
$assignPermissions = false;
|
||||
$checkPermisionEdit = $this->getPermissionAssignedRole($aRow['ROL_UID'], '00000000000000000000000000000014');
|
||||
if ($checkPermisionEdit && !in_array($item['PER_CODE'], $permissionsForOperator)) {
|
||||
$assignPermissions = true;
|
||||
}
|
||||
}
|
||||
if ($assignPermissions) {
|
||||
$dataPermissions = array();
|
||||
$dataPermissions['ROL_UID'] = $aRow['ROL_UID'];
|
||||
$dataPermissions['PER_UID'] = $item['PER_UID'];
|
||||
$this->assignPermissionRole($dataPermissions);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -471,6 +471,11 @@ class Roles extends BaseRoles {
|
||||
G::auditLog("DeleteUserToRole", "Delete user ".$user['USR_USERNAME']." (".$USR_UID.") to Role ".$rol['ROL_NAME']." (".$ROL_UID.") ");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $roleUid
|
||||
* @return ResultSet
|
||||
* @throws Exception
|
||||
*/
|
||||
function getRolePermissionsByPerUid($roleUid){
|
||||
try {
|
||||
$criteria = new Criteria();
|
||||
@@ -487,6 +492,36 @@ class Roles extends BaseRoles {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks a permission is assigned to a Role
|
||||
* @param $ROL_UID
|
||||
* @param $PER_UID
|
||||
* @return bool
|
||||
* @throws Exception
|
||||
*/
|
||||
function getPermissionAssignedRole($ROL_UID, $PER_UID)
|
||||
{
|
||||
try {
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(RolesPermissionsPeer::ROL_UID);
|
||||
$criteria->addSelectColumn(RolesPermissionsPeer::PER_UID);
|
||||
$criteria->add(RolesPermissionsPeer::ROL_UID, $ROL_UID, Criteria::EQUAL);
|
||||
$criteria->add(RolesPermissionsPeer::PER_UID, $PER_UID, Criteria::EQUAL);
|
||||
|
||||
$oDataset = RolesPermissionsPeer::doSelectRS($criteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
if($aRowRP = $oDataset->getRow()){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
} catch (exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
function getRolePermissions($ROL_UID, $filter='', $status=null) {
|
||||
try {
|
||||
$criteria = new Criteria();
|
||||
|
||||
@@ -37,7 +37,31 @@ INSERT INTO `RBAC_PERMISSIONS` VALUES
|
||||
('00000000000000000000000000000036','PM_DELETE_PROCESS_CASES','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000037','PM_EDITPERSONALINFO_CALENDAR','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000038','PM_UNCANCELCASE','2016-06-14 00:00:00','2016-06-14 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000039','PM_REST_API_APPLICATIONS','2016-06-14 00:00:00','2016-06-14 00:00:00',1,'00000000000000000000000000000002');
|
||||
('00000000000000000000000000000039','PM_REST_API_APPLICATIONS','2016-06-14 00:00:00','2016-06-14 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000040','PM_EDIT_USER_PROFILE_FIRST_NAME','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000041','PM_EDIT_USER_PROFILE_LAST_NAME','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000042','PM_EDIT_USER_PROFILE_USERNAME','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000043','PM_EDIT_USER_PROFILE_EMAIL','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000044','PM_EDIT_USER_PROFILE_ADDRESS','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000045','PM_EDIT_USER_PROFILE_ZIP_CODE','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000046','PM_EDIT_USER_PROFILE_COUNTRY','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000047','PM_EDIT_USER_PROFILE_STATE_OR_REGION','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000048','PM_EDIT_USER_PROFILE_LOCATION','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000049','PM_EDIT_USER_PROFILE_PHONE','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000050','PM_EDIT_USER_PROFILE_POSITION','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000051','PM_EDIT_USER_PROFILE_REPLACED_BY','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000052','PM_EDIT_USER_PROFILE_EXPIRATION_DATE','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000053','PM_EDIT_USER_PROFILE_CALENDAR','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000054','PM_EDIT_USER_PROFILE_STATUS','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000055','PM_EDIT_USER_PROFILE_ROLE','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000056','PM_EDIT_USER_PROFILE_TIME_ZONE','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000057','PM_EDIT_USER_PROFILE_DEFAULT_LANGUAGE','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000058','PM_EDIT_USER_PROFILE_COSTS','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000059','PM_EDIT_USER_PROFILE_PASSWORD','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'),
|
||||
('00000000000000000000000000000060','PM_EDIT_USER_PROFILE_USER_MUST_CHANGE_PASSWORD_AT_NEXT_LOGON','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'),
|
||||
('00000000000000000000000000000063','PM_EDIT_USER_PROFILE_DEFAULT_CASES_MENU_OPTIONS','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002');
|
||||
|
||||
INSERT INTO `RBAC_ROLES` VALUES
|
||||
('00000000000000000000000000000001','','00000000000000000000000000000001','RBAC_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1),
|
||||
@@ -86,8 +110,47 @@ INSERT INTO `RBAC_ROLES_PERMISSIONS` VALUES
|
||||
('00000000000000000000000000000002','00000000000000000000000000000037'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000038'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000039'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000040'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000041'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000042'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000043'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000044'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000045'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000046'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000047'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000048'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000049'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000050'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000051'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000052'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000053'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000054'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000055'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000056'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000057'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000058'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000059'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000060'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000061'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000062'),
|
||||
('00000000000000000000000000000002','00000000000000000000000000000063'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000001'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000005'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000040'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000041'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000042'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000043'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000044'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000045'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000046'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000047'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000048'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000049'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000053'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000056'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000057'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000059'),
|
||||
('00000000000000000000000000000003','00000000000000000000000000000061'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000001'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000003'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000005'),
|
||||
@@ -122,7 +185,31 @@ INSERT INTO `RBAC_ROLES_PERMISSIONS` VALUES
|
||||
('00000000000000000000000000000004','00000000000000000000000000000036'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000037'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000038'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000039');
|
||||
('00000000000000000000000000000004','00000000000000000000000000000039'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000040'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000041'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000042'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000043'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000044'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000045'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000046'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000047'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000048'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000049'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000050'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000051'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000052'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000053'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000054'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000055'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000056'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000057'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000058'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000059'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000060'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000061'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000062'),
|
||||
('00000000000000000000000000000004','00000000000000000000000000000063');
|
||||
|
||||
INSERT INTO `RBAC_SYSTEMS` VALUES ('00000000000000000000000000000001','RBAC','2007-07-31 19:10:22','2007-08-03 12:24:36',1),('00000000000000000000000000000002','PROCESSMAKER','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
||||
INSERT INTO `RBAC_USERS` VALUES ('00000000000000000000000000000001','admin','21232f297a57a5a743894a0e4a801fc3','Administrator','','admin@processmaker.com','2020-01-01','2007-08-03 12:24:36','2008-02-13 07:24:07',1,'MYSQL','00000000000000000000000000000000','','');
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3661,7 +3661,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)
|
||||
@@ -3751,3 +3751,89 @@ function PMFRemoveUserGroupFromTask($taskUid, $userGroupUid)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -985,7 +985,7 @@ class System
|
||||
return $aChanges;
|
||||
}
|
||||
|
||||
public function getEmailConfiguration ()
|
||||
public static function getEmailConfiguration()
|
||||
{
|
||||
$emailServer = new \ProcessMaker\BusinessModel\EmailServer();
|
||||
|
||||
|
||||
@@ -2516,20 +2516,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);
|
||||
|
||||
@@ -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);');
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -197,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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -614,9 +614,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);
|
||||
@@ -631,17 +635,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)))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -154,112 +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
|
||||
);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -301,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -268,6 +268,9 @@ abstract class Importer
|
||||
if (sizeof($objectList) > 0 && $processGranulate) {
|
||||
$granularObj->import($objectList);
|
||||
}
|
||||
$project = new \ProcessMaker\Project\Adapter\BpmnWorkflow();
|
||||
$diagram = $project->getStruct($projectUid);
|
||||
$res = $project->updateFromStruct($projectUid, $diagram);
|
||||
}
|
||||
|
||||
return $projectUid;
|
||||
@@ -533,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()));
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user