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)
|
||||
{
|
||||
try {
|
||||
$filter = '';
|
||||
$start = null;
|
||||
$limit = null;
|
||||
$oProcess = \ProcessPeer::retrieveByPK( $sProcessUID );
|
||||
if (is_null($oProcess)) {
|
||||
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'];
|
||||
}
|
||||
$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) {
|
||||
if (in_array($results['GRP_UID'], $aUIDS1)) {
|
||||
$c++;
|
||||
@@ -1105,6 +1129,7 @@ class Task
|
||||
throw (new \Exception( 'This id for `act_uid`: '. $sTaskUID .' do not correspond to a registered activity'));
|
||||
}
|
||||
$iType = 1;
|
||||
$iRelation = '';
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn( \TaskUserPeer::TU_RELATION );
|
||||
$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'));
|
||||
}
|
||||
$iType = 1;
|
||||
$iRelation = '';
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn( \TaskUserPeer::TU_RELATION );
|
||||
$oCriteria->add(\TaskUserPeer::USR_UID, $sAssigneeUID);
|
||||
@@ -1533,9 +1559,6 @@ class Task
|
||||
public function getTaskAdhocAssignee($sProcessUID, $sTaskUID, $sAssigneeUID)
|
||||
{
|
||||
try {
|
||||
$filter = '';
|
||||
$start = null;
|
||||
$limit = null;
|
||||
$oProcess = \ProcessPeer::retrieveByPK( $sProcessUID );
|
||||
if (is_null($oProcess)) {
|
||||
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'];
|
||||
}
|
||||
$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) {
|
||||
if (in_array($results['GRP_UID'], $aUIDS1)) {
|
||||
$c++;
|
||||
@@ -1654,6 +1704,7 @@ class Task
|
||||
throw (new \Exception( 'This id for `act_uid`: '. $sTaskUID .' do not correspond to a registered activity'));
|
||||
}
|
||||
$iType = 2;
|
||||
$iRelation = '';
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn( \TaskUserPeer::TU_RELATION );
|
||||
$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'));
|
||||
}
|
||||
$iType = 2;
|
||||
$iRelation = '';
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn( \TaskUserPeer::TU_RELATION );
|
||||
$oCriteria->add(\TaskUserPeer::USR_UID, $sAssigneeUID);
|
||||
|
||||
@@ -30,7 +30,7 @@ class Assignee extends Api
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
@@ -55,7 +55,7 @@ class Assignee extends Api
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
@@ -74,11 +74,11 @@ class Assignee extends Api
|
||||
$response = array();
|
||||
try {
|
||||
$task = new \BusinessModel\Task();
|
||||
$arrayData = $task->getTaskAssignee($prjUid, $actUid, $aasUid);
|
||||
$objectData = $task->getTaskAssignee($prjUid, $actUid, $aasUid);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
$response = $objectData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
@@ -98,12 +98,11 @@ class Assignee extends Api
|
||||
{
|
||||
try {
|
||||
$task = new \BusinessModel\Task();
|
||||
$arrayData = $task->addTaskAssignee($prjUid, $actUid, $aas_uid, $aas_type);
|
||||
$task->addTaskAssignee($prjUid, $actUid, $aas_uid, $aas_type);
|
||||
} catch (\Exception $e) {
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -118,12 +117,11 @@ class Assignee extends Api
|
||||
{
|
||||
try {
|
||||
$task = new \BusinessModel\Task();
|
||||
$arrayData = $task->removeTaskAssignee($prjUid, $actUid, $aasUid);
|
||||
$task->removeTaskAssignee($prjUid, $actUid, $aasUid);
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -145,7 +143,7 @@ class Assignee extends Api
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
@@ -170,7 +168,7 @@ class Assignee extends Api
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
@@ -189,11 +187,11 @@ class Assignee extends Api
|
||||
$response = array();
|
||||
try {
|
||||
$task = new \BusinessModel\Task();
|
||||
$arrayData = $task->getTaskAdhocAssignee($prjUid, $actUid, $aasUid);
|
||||
$objectData = $task->getTaskAdhocAssignee($prjUid, $actUid, $aasUid);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
$response = $objectData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
@@ -213,12 +211,11 @@ class Assignee extends Api
|
||||
{
|
||||
try {
|
||||
$task = new \BusinessModel\Task();
|
||||
$arrayData = $task->addTaskAdhocAssignee($prjUid, $actUid, $ada_uid, $ada_type);
|
||||
$task->addTaskAdhocAssignee($prjUid, $actUid, $ada_uid, $ada_type);
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -233,12 +230,11 @@ class Assignee extends Api
|
||||
{
|
||||
try {
|
||||
$task = new \BusinessModel\Task();
|
||||
$arrayData = $task->removeTaskAdhocAssignee($prjUid, $actUid, $adaUid);
|
||||
$task->removeTaskAdhocAssignee($prjUid, $actUid, $adaUid);
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class OutputDocuments extends Api
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
@@ -40,11 +40,11 @@ class OutputDocuments extends Api
|
||||
{
|
||||
try {
|
||||
$outputDocument = new \BusinessModel\OutputDocument();
|
||||
$arrayData = $outputDocument->getOutputDocument($prjUid, $outputDocumentUid);
|
||||
$objectData = $outputDocument->getOutputDocument($prjUid, $outputDocumentUid);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
$response = $objectData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
@@ -67,7 +67,7 @@ class OutputDocuments extends Api
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
@@ -88,7 +88,7 @@ class OutputDocuments extends Api
|
||||
$outputDocument = new \BusinessModel\OutputDocument();
|
||||
$arrayData = $outputDocument->updateOutputDocument($prjUid, $request_data, $outputDocumentUid);
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
@@ -103,12 +103,11 @@ class OutputDocuments extends Api
|
||||
{
|
||||
try {
|
||||
$outputDocument = new \BusinessModel\OutputDocument();
|
||||
$arrayData = $outputDocument->deleteOutputDocument($prjUid, $outputDocumentUid);
|
||||
$outputDocument->deleteOutputDocument($prjUid, $outputDocumentUid);
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user