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;
}
}

View File

@@ -531,23 +531,11 @@ abstract class Importer
//Update
$workflow = \ProcessMaker\Project\Workflow::load($projectUid);
$dummyTaskTypes = \ProcessMaker\BusinessModel\Task::getDummyTypes();
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"], $dummyTaskTypes) ) {
$result = $workflow->updateTask($arrayTaskData["TAS_UID"], $arrayTaskData);
}
}

View File

@@ -32,8 +32,8 @@ class Cases extends Api
/**
* Get list Cases To Do
*
* @param string $start {@from path}
* @param string $limit {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
@@ -79,8 +79,8 @@ class Cases extends Api
/**
* Get list Cases To Do with paged
*
* @param string $start {@from path}
* @param string $limit {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
@@ -125,8 +125,8 @@ class Cases extends Api
/**
* Get list Cases Draft
*
* @param string $start {@from path}
* @param string $limit {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
@@ -171,8 +171,8 @@ class Cases extends Api
/**
* Get list Cases Draft with paged
*
* @param string $start {@from path}
* @param string $limit {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
@@ -217,8 +217,8 @@ class Cases extends Api
/**
* Get list Cases Participated
*
* @param string $start {@from path}
* @param string $limit {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
@@ -263,8 +263,8 @@ class Cases extends Api
/**
* Get list Cases Participated with paged
*
* @param string $start {@from path}
* @param string $limit {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
@@ -309,8 +309,8 @@ class Cases extends Api
/**
* Get list Cases Unassigned
*
* @param string $start {@from path}
* @param string $limit {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
@@ -355,8 +355,8 @@ class Cases extends Api
/**
* Get list Cases Unassigned with paged
*
* @param string $start {@from path}
* @param string $limit {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
@@ -401,8 +401,8 @@ class Cases extends Api
/**
* Get list Cases Paused
*
* @param string $start {@from path}
* @param string $limit {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
@@ -447,8 +447,8 @@ class Cases extends Api
/**
* Get list Cases Paused with paged
*
* @param string $start {@from path}
* @param string $limit {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
@@ -493,8 +493,8 @@ class Cases extends Api
/**
* Get list Cases Advanced Search
*
* @param string $start {@from path}
* @param string $limit {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
@@ -551,8 +551,8 @@ class Cases extends Api
/**
* Get list Cases Advanced Search with Paged
*
* @param string $start {@from path}
* @param string $limit {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
@@ -862,7 +862,7 @@ class Cases extends Api
* @param string $app_uid {@min 1}{@max 32}
* @param array $request_data
* @param string $dyn_uid {@from path}
* @param string $del_index {@from path}
* @param int $del_index {@from path}
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
@@ -884,8 +884,8 @@ class Cases extends Api
/**
* Get Case Notes
*
* @param string $start {@from path}
* @param string $limit {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $usr_uid {@from path}
@@ -934,8 +934,8 @@ class Cases extends Api
/**
* Get Case Notes with Paged
*
* @param string $start {@from path}
* @param string $limit {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $usr_uid {@from path}

View File

@@ -84,8 +84,8 @@ class Consolidated extends Api
* @param string $tas_uid {@min 1} {@max 32}
* @param string $dyn_uid {@min 1} {@max 32}
* @param string $pro_uid {@min 1} {@max 32}
* @param string $start {@from path}
* @param string $limit {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $search {@from path}
* @return array
*
@@ -94,7 +94,7 @@ class Consolidated extends Api
*
* @url GET /cases/:tas_uid/:dyn_uid/:pro_uid
*/
public function doGetCasesConsolidated($tas_uid, $dyn_uid, $pro_uid, $start = '', $limit = '', $search = '')
public function doGetCasesConsolidated($tas_uid, $dyn_uid, $pro_uid, $start = 0, $limit = 0, $search = '')
{
try {
$usr_uid = $this->getUserId();
@@ -135,7 +135,7 @@ class Consolidated extends Api
*
* @param string $app_uid {@min 1} {@max 32}
* @param string $app_number
* @param string $del_index
* @param int $del_index
* @param string $field_grid
* @param string $field_grid_val
* @return array

View File

@@ -1264,8 +1264,8 @@ class Light extends Api
* Get Case Notes
*
* @param string $app_uid {@min 1}{@max 32}
* @param string $start {@from path}
* @param string $limit {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $usr_uid {@from path}
@@ -1535,7 +1535,7 @@ class Light extends Api
* @param string $app_uid {@min 1}{@max 32}
* @param array $request_data
* @param string $dyn_uid {@from path}
* @param string $del_index {@from path}
* @param int $del_index {@from path}
*
* @url PUT /:app_uid/variable
*/

View File

@@ -28,10 +28,10 @@ class Lists extends Api
/**
* Get list Inbox
*
* @param string $count {@from path}
* @param string $paged {@from path}
* @param string $start {@from path}
* @param string $limit {@from path}
* @param boolean $count {@from path}
* @param boolean $paged {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $category {@from path}
@@ -137,10 +137,10 @@ class Lists extends Api
/**
* Get list Participated Last
*
* @param string $count {@from path}
* @param string $paged {@from path}
* @param string $start {@from path}
* @param string $limit {@from path}
* @param boolean $count {@from path}
* @param boolean $paged {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $category {@from path}
@@ -243,10 +243,10 @@ class Lists extends Api
/**
* Get list Participated History
*
* @param string $count {@from path}
* @param string $paged {@from path}
* @param string $start {@from path}
* @param string $limit {@from path}
* @param boolean $count {@from path}
* @param boolean $paged {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $category {@from path}
@@ -350,10 +350,10 @@ class Lists extends Api
/**
* Get list Paused
*
* @param string $count {@from path}
* @param string $paged {@from path}
* @param string $start {@from path}
* @param string $limit {@from path}
* @param boolean $count {@from path}
* @param boolean $paged {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $category {@from path}
@@ -456,10 +456,10 @@ class Lists extends Api
/**
* Get list Canceled
*
* @param string $count {@from path}
* @param string $paged {@from path}
* @param string $start {@from path}
* @param string $limit {@from path}
* @param boolean $count {@from path}
* @param boolean $paged {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $category {@from path}
@@ -561,10 +561,10 @@ class Lists extends Api
/**
* Get List Completed
*
* @param string $count {@from path}
* @param string $paged {@from path}
* @param string $start {@from path}
* @param string $limit {@from path}
* @param boolean $count {@from path}
* @param boolean $paged {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $category {@from path}
@@ -666,10 +666,10 @@ class Lists extends Api
/**
* Get List Completed
*
* @param string $count {@from path}
* @param string $paged {@from path}
* @param string $start {@from path}
* @param string $limit {@from path}
* @param boolean $count {@from path}
* @param boolean $paged {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $category {@from path}
@@ -770,10 +770,10 @@ class Lists extends Api
/**
* Get list Unassigned
*
* @param string $count {@from path}
* @param string $paged {@from path}
* @param string $start {@from path}
* @param string $limit {@from path}
* @param boolean $count {@from path}
* @param boolean $paged {@from path}
* @param int $start {@from path}
* @param int $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $category {@from path}