Merged in darojas/processmaker (pull request #170)
Fix notice ASSIGNEE and ADHOC-ASSIGNEE. Fix notice OUTPUTDOCUMENTS.
This commit is contained in:
@@ -984,9 +984,6 @@ class Task
|
|||||||
public function getTaskAssignee($sProcessUID, $sTaskUID, $sAssigneeUID)
|
public function getTaskAssignee($sProcessUID, $sTaskUID, $sAssigneeUID)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$filter = '';
|
|
||||||
$start = null;
|
|
||||||
$limit = null;
|
|
||||||
$oProcess = \ProcessPeer::retrieveByPK( $sProcessUID );
|
$oProcess = \ProcessPeer::retrieveByPK( $sProcessUID );
|
||||||
if (is_null($oProcess)) {
|
if (is_null($oProcess)) {
|
||||||
throw (new \Exception( 'This id for `prj_uid`: '. $sProcessUID .' do not correspond to a registered process'));
|
throw (new \Exception( 'This id for `prj_uid`: '. $sProcessUID .' do not correspond to a registered process'));
|
||||||
@@ -1025,7 +1022,34 @@ class Task
|
|||||||
$aUIDS1[] = $aGroup['GRP_UID'];
|
$aUIDS1[] = $aGroup['GRP_UID'];
|
||||||
}
|
}
|
||||||
$groups = new \Groupwf();
|
$groups = new \Groupwf();
|
||||||
$result = $groups->getAllGroup($start, $limit, $filter);
|
$totalCount = 0;
|
||||||
|
$criteria = new \Criteria( 'workflow' );
|
||||||
|
$criteria->addSelectColumn( \GroupwfPeer::GRP_UID );
|
||||||
|
$criteria->addJoin( \GroupwfPeer::GRP_UID, \ContentPeer::CON_ID, \Criteria::LEFT_JOIN );
|
||||||
|
$criteria->add( \ContentPeer::CON_CATEGORY, 'GRP_TITLE' );
|
||||||
|
$criteria->add( \ContentPeer::CON_LANG, SYS_LANG );
|
||||||
|
$criteria->addAscendingOrderByColumn( \ContentPeer::CON_VALUE );
|
||||||
|
$totalRows = \GroupwfPeer::doCount( $criteria );
|
||||||
|
$criteria = new \Criteria( 'workflow' );
|
||||||
|
$criteria->addSelectColumn( \GroupwfPeer::GRP_UID );
|
||||||
|
$criteria->addSelectColumn( \GroupwfPeer::GRP_STATUS );
|
||||||
|
$criteria->addSelectColumn( \GroupwfPeer::GRP_UX );
|
||||||
|
$criteria->addAsColumn( 'GRP_TITLE', \ContentPeer::CON_VALUE );
|
||||||
|
$criteria->addJoin( \GroupwfPeer::GRP_UID, \ContentPeer::CON_ID, \Criteria::LEFT_JOIN );
|
||||||
|
$criteria->add( \ContentPeer::CON_CATEGORY, 'GRP_TITLE' );
|
||||||
|
$criteria->add( \ContentPeer::CON_LANG, SYS_LANG );
|
||||||
|
$criteria->add( \GroupwfPeer::GRP_UID, $sAssigneeUID);
|
||||||
|
$criteria->addAscendingOrderByColumn( \ContentPeer::CON_VALUE );
|
||||||
|
$oDataset = \GroupwfPeer::doSelectRS( $criteria );
|
||||||
|
$oDataset->setFetchmode( \ResultSet::FETCHMODE_ASSOC );
|
||||||
|
$processes = Array ();
|
||||||
|
$uids = array ();
|
||||||
|
$groups = array ();
|
||||||
|
$aGroups = array ();
|
||||||
|
while ($oDataset->next()) {
|
||||||
|
$groups[] = $oDataset->getRow();
|
||||||
|
}
|
||||||
|
$result = array ('rows' => $groups,'totalCount' => $totalRows);
|
||||||
foreach ($result['rows'] as $results) {
|
foreach ($result['rows'] as $results) {
|
||||||
if (in_array($results['GRP_UID'], $aUIDS1)) {
|
if (in_array($results['GRP_UID'], $aUIDS1)) {
|
||||||
$c++;
|
$c++;
|
||||||
@@ -1105,6 +1129,7 @@ class Task
|
|||||||
throw (new \Exception( 'This id for `act_uid`: '. $sTaskUID .' do not correspond to a registered activity'));
|
throw (new \Exception( 'This id for `act_uid`: '. $sTaskUID .' do not correspond to a registered activity'));
|
||||||
}
|
}
|
||||||
$iType = 1;
|
$iType = 1;
|
||||||
|
$iRelation = '';
|
||||||
$oCriteria = new \Criteria('workflow');
|
$oCriteria = new \Criteria('workflow');
|
||||||
$oCriteria->addSelectColumn( \TaskUserPeer::TU_RELATION );
|
$oCriteria->addSelectColumn( \TaskUserPeer::TU_RELATION );
|
||||||
$oCriteria->add(\TaskUserPeer::USR_UID, $sAssigneeUID );
|
$oCriteria->add(\TaskUserPeer::USR_UID, $sAssigneeUID );
|
||||||
@@ -1176,6 +1201,7 @@ class Task
|
|||||||
throw (new \Exception( 'This id for `act_uid`: '. $sTaskUID .' do not correspond to a registered activity'));
|
throw (new \Exception( 'This id for `act_uid`: '. $sTaskUID .' do not correspond to a registered activity'));
|
||||||
}
|
}
|
||||||
$iType = 1;
|
$iType = 1;
|
||||||
|
$iRelation = '';
|
||||||
$oCriteria = new \Criteria('workflow');
|
$oCriteria = new \Criteria('workflow');
|
||||||
$oCriteria->addSelectColumn( \TaskUserPeer::TU_RELATION );
|
$oCriteria->addSelectColumn( \TaskUserPeer::TU_RELATION );
|
||||||
$oCriteria->add(\TaskUserPeer::USR_UID, $sAssigneeUID);
|
$oCriteria->add(\TaskUserPeer::USR_UID, $sAssigneeUID);
|
||||||
@@ -1533,9 +1559,6 @@ class Task
|
|||||||
public function getTaskAdhocAssignee($sProcessUID, $sTaskUID, $sAssigneeUID)
|
public function getTaskAdhocAssignee($sProcessUID, $sTaskUID, $sAssigneeUID)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$filter = '';
|
|
||||||
$start = null;
|
|
||||||
$limit = null;
|
|
||||||
$oProcess = \ProcessPeer::retrieveByPK( $sProcessUID );
|
$oProcess = \ProcessPeer::retrieveByPK( $sProcessUID );
|
||||||
if (is_null($oProcess)) {
|
if (is_null($oProcess)) {
|
||||||
throw (new \Exception( 'This id for `prj_uid`: '. $sProcessUID .' do not correspond to a registered process'));
|
throw (new \Exception( 'This id for `prj_uid`: '. $sProcessUID .' do not correspond to a registered process'));
|
||||||
@@ -1574,7 +1597,34 @@ class Task
|
|||||||
$aUIDS1[] = $aGroup['GRP_UID'];
|
$aUIDS1[] = $aGroup['GRP_UID'];
|
||||||
}
|
}
|
||||||
$groups = new \Groupwf();
|
$groups = new \Groupwf();
|
||||||
$result = $groups->getAllGroup($start, $limit, $filter);
|
$totalCount = 0;
|
||||||
|
$criteria = new \Criteria( 'workflow' );
|
||||||
|
$criteria->addSelectColumn( \GroupwfPeer::GRP_UID );
|
||||||
|
$criteria->addJoin( \GroupwfPeer::GRP_UID, \ContentPeer::CON_ID, \Criteria::LEFT_JOIN );
|
||||||
|
$criteria->add( \ContentPeer::CON_CATEGORY, 'GRP_TITLE' );
|
||||||
|
$criteria->add( \ContentPeer::CON_LANG, SYS_LANG );
|
||||||
|
$criteria->addAscendingOrderByColumn( \ContentPeer::CON_VALUE );
|
||||||
|
$totalRows = \GroupwfPeer::doCount( $criteria );
|
||||||
|
$criteria = new \Criteria( 'workflow' );
|
||||||
|
$criteria->addSelectColumn( \GroupwfPeer::GRP_UID );
|
||||||
|
$criteria->addSelectColumn( \GroupwfPeer::GRP_STATUS );
|
||||||
|
$criteria->addSelectColumn( \GroupwfPeer::GRP_UX );
|
||||||
|
$criteria->addAsColumn( 'GRP_TITLE', \ContentPeer::CON_VALUE );
|
||||||
|
$criteria->addJoin( \GroupwfPeer::GRP_UID, \ContentPeer::CON_ID, \Criteria::LEFT_JOIN );
|
||||||
|
$criteria->add( \ContentPeer::CON_CATEGORY, 'GRP_TITLE' );
|
||||||
|
$criteria->add( \ContentPeer::CON_LANG, SYS_LANG );
|
||||||
|
$criteria->add( \GroupwfPeer::GRP_UID, $sAssigneeUID);
|
||||||
|
$criteria->addAscendingOrderByColumn( \ContentPeer::CON_VALUE );
|
||||||
|
$oDataset = \GroupwfPeer::doSelectRS( $criteria );
|
||||||
|
$oDataset->setFetchmode( \ResultSet::FETCHMODE_ASSOC );
|
||||||
|
$processes = Array ();
|
||||||
|
$uids = array ();
|
||||||
|
$groups = array ();
|
||||||
|
$aGroups = array ();
|
||||||
|
while ($oDataset->next()) {
|
||||||
|
$groups[] = $oDataset->getRow();
|
||||||
|
}
|
||||||
|
$result = array ('rows' => $groups,'totalCount' => $totalRows);
|
||||||
foreach ($result['rows'] as $results) {
|
foreach ($result['rows'] as $results) {
|
||||||
if (in_array($results['GRP_UID'], $aUIDS1)) {
|
if (in_array($results['GRP_UID'], $aUIDS1)) {
|
||||||
$c++;
|
$c++;
|
||||||
@@ -1654,6 +1704,7 @@ class Task
|
|||||||
throw (new \Exception( 'This id for `act_uid`: '. $sTaskUID .' do not correspond to a registered activity'));
|
throw (new \Exception( 'This id for `act_uid`: '. $sTaskUID .' do not correspond to a registered activity'));
|
||||||
}
|
}
|
||||||
$iType = 2;
|
$iType = 2;
|
||||||
|
$iRelation = '';
|
||||||
$oCriteria = new \Criteria('workflow');
|
$oCriteria = new \Criteria('workflow');
|
||||||
$oCriteria->addSelectColumn( \TaskUserPeer::TU_RELATION );
|
$oCriteria->addSelectColumn( \TaskUserPeer::TU_RELATION );
|
||||||
$oCriteria->add(\TaskUserPeer::USR_UID, $sAssigneeUID );
|
$oCriteria->add(\TaskUserPeer::USR_UID, $sAssigneeUID );
|
||||||
@@ -1725,6 +1776,7 @@ class Task
|
|||||||
throw (new \Exception( 'This id for `act_uid`: '. $sTaskUID .' do not correspond to a registered activity'));
|
throw (new \Exception( 'This id for `act_uid`: '. $sTaskUID .' do not correspond to a registered activity'));
|
||||||
}
|
}
|
||||||
$iType = 2;
|
$iType = 2;
|
||||||
|
$iRelation = '';
|
||||||
$oCriteria = new \Criteria('workflow');
|
$oCriteria = new \Criteria('workflow');
|
||||||
$oCriteria->addSelectColumn( \TaskUserPeer::TU_RELATION );
|
$oCriteria->addSelectColumn( \TaskUserPeer::TU_RELATION );
|
||||||
$oCriteria->add(\TaskUserPeer::USR_UID, $sAssigneeUID);
|
$oCriteria->add(\TaskUserPeer::USR_UID, $sAssigneeUID);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class Assignee extends Api
|
|||||||
//Response
|
//Response
|
||||||
$response = $arrayData;
|
$response = $arrayData;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//response
|
//Response
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
return $response;
|
return $response;
|
||||||
@@ -55,7 +55,7 @@ class Assignee extends Api
|
|||||||
//Response
|
//Response
|
||||||
$response = $arrayData;
|
$response = $arrayData;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//response
|
//Response
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
return $response;
|
return $response;
|
||||||
@@ -74,11 +74,11 @@ class Assignee extends Api
|
|||||||
$response = array();
|
$response = array();
|
||||||
try {
|
try {
|
||||||
$task = new \BusinessModel\Task();
|
$task = new \BusinessModel\Task();
|
||||||
$arrayData = $task->getTaskAssignee($prjUid, $actUid, $aasUid);
|
$objectData = $task->getTaskAssignee($prjUid, $actUid, $aasUid);
|
||||||
//Response
|
//Response
|
||||||
$response = $arrayData;
|
$response = $objectData;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//response
|
//Response
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
return $response;
|
return $response;
|
||||||
@@ -98,12 +98,11 @@ class Assignee extends Api
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$task = new \BusinessModel\Task();
|
$task = new \BusinessModel\Task();
|
||||||
$arrayData = $task->addTaskAssignee($prjUid, $actUid, $aas_uid, $aas_type);
|
$task->addTaskAssignee($prjUid, $actUid, $aas_uid, $aas_type);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//Response
|
//Response
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
return $response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -118,12 +117,11 @@ class Assignee extends Api
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$task = new \BusinessModel\Task();
|
$task = new \BusinessModel\Task();
|
||||||
$arrayData = $task->removeTaskAssignee($prjUid, $actUid, $aasUid);
|
$task->removeTaskAssignee($prjUid, $actUid, $aasUid);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//response
|
//Response
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
return $response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -145,7 +143,7 @@ class Assignee extends Api
|
|||||||
//Response
|
//Response
|
||||||
$response = $arrayData;
|
$response = $arrayData;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//response
|
//Response
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
return $response;
|
return $response;
|
||||||
@@ -170,7 +168,7 @@ class Assignee extends Api
|
|||||||
//Response
|
//Response
|
||||||
$response = $arrayData;
|
$response = $arrayData;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//response
|
//Response
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
return $response;
|
return $response;
|
||||||
@@ -189,11 +187,11 @@ class Assignee extends Api
|
|||||||
$response = array();
|
$response = array();
|
||||||
try {
|
try {
|
||||||
$task = new \BusinessModel\Task();
|
$task = new \BusinessModel\Task();
|
||||||
$arrayData = $task->getTaskAdhocAssignee($prjUid, $actUid, $aasUid);
|
$objectData = $task->getTaskAdhocAssignee($prjUid, $actUid, $aasUid);
|
||||||
//Response
|
//Response
|
||||||
$response = $arrayData;
|
$response = $objectData;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//response
|
//Response
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
return $response;
|
return $response;
|
||||||
@@ -213,12 +211,11 @@ class Assignee extends Api
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$task = new \BusinessModel\Task();
|
$task = new \BusinessModel\Task();
|
||||||
$arrayData = $task->addTaskAdhocAssignee($prjUid, $actUid, $ada_uid, $ada_type);
|
$task->addTaskAdhocAssignee($prjUid, $actUid, $ada_uid, $ada_type);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//response
|
//Response
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
return $response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -233,12 +230,11 @@ class Assignee extends Api
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$task = new \BusinessModel\Task();
|
$task = new \BusinessModel\Task();
|
||||||
$arrayData = $task->removeTaskAdhocAssignee($prjUid, $actUid, $adaUid);
|
$task->removeTaskAdhocAssignee($prjUid, $actUid, $adaUid);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//response
|
//Response
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
return $response;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class OutputDocuments extends Api
|
|||||||
//Response
|
//Response
|
||||||
$response = $arrayData;
|
$response = $arrayData;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//response
|
//Response
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
return $response;
|
return $response;
|
||||||
@@ -40,11 +40,11 @@ class OutputDocuments extends Api
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$outputDocument = new \BusinessModel\OutputDocument();
|
$outputDocument = new \BusinessModel\OutputDocument();
|
||||||
$arrayData = $outputDocument->getOutputDocument($prjUid, $outputDocumentUid);
|
$objectData = $outputDocument->getOutputDocument($prjUid, $outputDocumentUid);
|
||||||
//Response
|
//Response
|
||||||
$response = $arrayData;
|
$response = $objectData;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//response
|
//Response
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
return $response;
|
return $response;
|
||||||
@@ -67,7 +67,7 @@ class OutputDocuments extends Api
|
|||||||
//Response
|
//Response
|
||||||
$response = $arrayData;
|
$response = $arrayData;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//response
|
//Response
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
return $response;
|
return $response;
|
||||||
@@ -88,7 +88,7 @@ class OutputDocuments extends Api
|
|||||||
$outputDocument = new \BusinessModel\OutputDocument();
|
$outputDocument = new \BusinessModel\OutputDocument();
|
||||||
$arrayData = $outputDocument->updateOutputDocument($prjUid, $request_data, $outputDocumentUid);
|
$arrayData = $outputDocument->updateOutputDocument($prjUid, $request_data, $outputDocumentUid);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//response
|
//Response
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -103,12 +103,11 @@ class OutputDocuments extends Api
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$outputDocument = new \BusinessModel\OutputDocument();
|
$outputDocument = new \BusinessModel\OutputDocument();
|
||||||
$arrayData = $outputDocument->deleteOutputDocument($prjUid, $outputDocumentUid);
|
$outputDocument->deleteOutputDocument($prjUid, $outputDocumentUid);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
//response
|
//Response
|
||||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||||
}
|
}
|
||||||
return $response;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user