Merged in 3.1 (pull request #4703)

Updating branch HOR-1500 with last 3.1 changes
This commit is contained in:
Julio Cesar Laura Avendaño
2016-08-08 10:31:01 -04:00
68 changed files with 1569 additions and 1201 deletions

View File

@@ -302,6 +302,8 @@ class Light
$response['caseIndex'] = $aData['INDEX'];
$response['caseNumber'] = $aData['CASE_NUMBER'];
//Log
\Bootstrap::registerMonolog('create-case', 200, "Create case", ['application_uid' => $aData['APPLICATION'], 'usr_uid' => $userId], SYS_SYS, 'mobileLogs.log');
} catch (Exception $e) {
$response['status'] = 'failure';
$response['message'] = $e->getMessage();
@@ -535,6 +537,9 @@ class Light
unset($array['message']);
unset($array['timestamp']);
}
//Log
\Bootstrap::registerMonolog('route-case', 200, 'Route case', ['application_uid' => $applicationUid, 'usr_uid' => $userUid], SYS_SYS, 'mobileLogs.log');
} catch (\Exception $e) {
throw $e;
}

View File

@@ -226,6 +226,8 @@ class NotificationDevice
$arrayData['NOT_MSG'] = $message;
$arrayData['NOT_DATA'] = serialize($data);
$arrayData['NOT_STATUS'] = "pending";
$arrayData['APP_UID'] = $appFields['APP_UID'];
$arrayData['DEL_INDEX'] = $iNewDelIndex;
$notQueue = new \NotificationQueue();
$notQueue->create($arrayData);
}
@@ -237,6 +239,8 @@ class NotificationDevice
$arrayData['NOT_MSG'] = $message;
$arrayData['NOT_DATA'] = serialize($data);
$arrayData['NOT_STATUS'] = "pending";
$arrayData['APP_UID'] = $appFields['APP_UID'];
$arrayData['DEL_INDEX'] = $iNewDelIndex;
$notQueue = new \NotificationQueue();
$notQueue->create($arrayData);
}

View File

@@ -2,6 +2,7 @@
namespace ProcessMaker\BusinessModel\Migrator;
use ProcessMaker\BusinessModel;
/**
* The assignment rules migrator class.
* The container class that stores the import and export rules for assignment rules.
@@ -37,13 +38,22 @@ class AssignmentRulesMigrator implements Importable, Exportable
public function import($data, $replace)
{
try {
$workflowTaks = array();
$dummyTaskTypes = BusinessModel\Task::getDummyTypes();
foreach ($data['tasks'] as $key => $value) {
$arrayTaskData = $value;
if (!in_array($arrayTaskData["TAS_TYPE"], $dummyTaskTypes)) {
$workflowTaks[] = $arrayTaskData;
}
}
if ($replace) {
$this->processes->createTaskRows($data['tasks']);
$this->processes->createTaskRows($workflowTaks);
$this->processes->addNewGroupRow($data['groupwfs']);
$this->processes->removeTaskUserRows($data['tasks']);
$this->processes->createTaskUserRows($data['taskusers']);
} else {
$this->processes->addNewTaskRows($data['tasks']);
$this->processes->addNewTaskRows($workflowTaks);
$this->processes->addNewGroupRow($data['groupwfs']);
$this->processes->addNewTaskUserRows($data['taskusers']);
}

View File

@@ -3,6 +3,7 @@
namespace ProcessMaker\BusinessModel\Migrator;
use ProcessMaker\Project\Adapter;
use ProcessMaker\BusinessModel;
use Symfony\Component\Config\Definition\Exception\Exception;
class ProcessDefinitionMigrator implements Importable, Exportable
@@ -53,7 +54,15 @@ class ProcessDefinitionMigrator implements Importable, Exportable
try {
//Workflow elements
$this->processes->updateProcessRow($data['workflow']['process']);
$this->processes->createTaskRows($data['workflow']['tasks']);
$workflowTaks = array();
$dummyTaskTypes = BusinessModel\Task::getDummyTypes();
foreach ($data['workflow']['tasks'] as $key => $value) {
$arrayTaskData = $value;
if (!in_array($arrayTaskData["TAS_TYPE"], $dummyTaskTypes)) {
$workflowTaks[] = $arrayTaskData;
}
}
$this->processes->createTaskRows($workflowTaks);
$this->processes->createLaneRows($data['workflow']['lanes']);
$this->processes->createGatewayRows($data['workflow']['gateways']);
$this->processes->createStepRows($data['workflow']['steps']);

View File

@@ -1913,32 +1913,32 @@ class Task
throw $e;
}
}
public function getValidateSelfService($data)
{
$paused = false;
{
$paused = false;
$data = array_change_key_case($data, CASE_LOWER);
$sTaskUID = $data['act_uid'];
$sTaskUID = $data['act_uid'];
$caseType = isset($data['case_type']) ? ($data['case_type'] == 'assigned' ? $data['case_type'] : 'unassigned') : 'unassigned';
$response = new \stdclass();
$response = new \stdclass();
$oCriteria = new \Criteria();
$arrayCondition = array();
$arrayCondition = array();
$arrayCondition[] = array(\AppDelegationPeer::APP_UID, \AppDelayPeer::APP_UID);
$arrayCondition[] = array(\AppDelegationPeer::DEL_INDEX, \AppDelayPeer::APP_DEL_INDEX);
$oCriteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
$oCriteria->add(\AppDelegationPeer::TAS_UID, $sTaskUID);
$oCriteria->add(\AppDelayPeer::APP_DISABLE_ACTION_USER, "0");
$oResult = \AppDelegationPeer::doSelectOne($oCriteria);
if(!empty($oResult)) {
$paused = true;
$arrayCondition[] = array(\AppDelegationPeer::DEL_INDEX, \AppDelayPeer::APP_DEL_INDEX);
$oCriteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
$oCriteria->add(\AppDelegationPeer::TAS_UID, $sTaskUID);
$oCriteria->add(\AppDelayPeer::APP_DISABLE_ACTION_USER, "0");
$oResult = \AppDelegationPeer::doSelectOne($oCriteria);
if(!empty($oResult)) {
$paused = true;
}
$response->paused = $paused;
$oCriteria = new \Criteria();
$oCriteria->add(\AppDelegationPeer::DEL_THREAD_STATUS, "OPEN");
$oCriteria->add(\AppDelegationPeer::TAS_UID, $sTaskUID);
if($caseType == 'unassigned') {
if($caseType == 'unassigned') {
$oCriteria->add(\AppDelegationPeer::USR_UID, "", \Criteria::EQUAL);
}
$oApplication = \AppDelegationPeer::doSelectOne($oCriteria);
@@ -1949,4 +1949,27 @@ class Task
}
return $response;
}
/**
* Return a list of Dummy Types
*
* return array
*
* @access public
*/
public static function getDummyTypes(){
$aTypes = 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"
);
return $aTypes;
}
}