Se modifican url de los end points, se adiciona get por busqueda especifica y filtro en caso de usuarios y grupos disponibles
This commit is contained in:
@@ -8,19 +8,17 @@ class ProcessSupervisor
|
||||
/**
|
||||
* Return supervisors
|
||||
* @param string $sProcessUID
|
||||
* @param string $filter
|
||||
* @param int $start
|
||||
* @param int $limit
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function getSupervisors($sProcessUID = '', $filter, $start, $limit)
|
||||
public function getProcessSupervisors($sProcessUID = '')
|
||||
{
|
||||
try {
|
||||
// Groups
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(\ProcessUserPeer::PU_UID);
|
||||
$oCriteria->addSelectColumn(\ProcessUserPeer::USR_UID);
|
||||
$oCriteria->addAsColumn('GRP_TITLE', \ContentPeer::CON_VALUE);
|
||||
$aConditions [] = array(\ProcessUserPeer::USR_UID, \ContentPeer::CON_ID);
|
||||
@@ -33,53 +31,103 @@ class ProcessSupervisor
|
||||
$oDataset = \ProcessUserPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn('COUNT(*) AS MEMBERS_NUMBER');
|
||||
$oCriteria->add(\GroupUserPeer::GRP_UID, $results['GRP_UID']);
|
||||
$oDataset2 = \GroupUserPeer::doSelectRS($oCriteria);
|
||||
$oDataset2->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset2->next();
|
||||
$aRow2 = $oDataset2->getRow();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aResp[] = array('sup_uid' => $aRow['USR_UID'],
|
||||
'sup_name' => (!isset($aRow2['GROUP_INACTIVE']) ? $aRow['GRP_TITLE'] .
|
||||
' (' . $aRow2['MEMBERS_NUMBER'] . ' ' .
|
||||
((int) $aRow2['MEMBERS_NUMBER'] == 1 ? \G::LoadTranslation('ID_USER') : \G::LoadTranslation('ID_USERS')).
|
||||
')' . '' : $aRow['GRP_TITLE'] . ' ' . $aRow2['GROUP_INACTIVE']),
|
||||
'sup_lastname' => "",
|
||||
'sup_username' => "",
|
||||
'sup_type' => "group" );
|
||||
$aResp[] = array('pu_uid' => $aRow['PU_UID'],
|
||||
'pu_type' => "GROUP_SUPERVISOR",
|
||||
'grp_uid' => $aRow['USR_UID'],
|
||||
'grp_name' => $aRow['GRP_TITLE']);
|
||||
$oDataset->next();
|
||||
}
|
||||
// Users
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(\ProcessUserPeer::USR_UID);
|
||||
$oCriteria->addSelectColumn(\ProcessUserPeer::PU_UID);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_FIRSTNAME);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_LASTNAME);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_USERNAME);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_EMAIL);
|
||||
if ($filter) {
|
||||
$oCriteria->add( $oCriteria->getNewCriterion( \UsersPeer::USR_USERNAME, "%$filter%", \Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( \UsersPeer::USR_FIRSTNAME, "%$filter%", \Criteria::LIKE ) )->addOr( $oCriteria->getNewCriterion( \UsersPeer::USR_LASTNAME, "%$filter%", \Criteria::LIKE ) ) );
|
||||
}
|
||||
$oCriteria->addJoin(\ProcessUserPeer::USR_UID, \UsersPeer::USR_UID, \Criteria::LEFT_JOIN);
|
||||
$oCriteria->add(\ProcessUserPeer::PU_TYPE, 'SUPERVISOR');
|
||||
$oCriteria->add(\ProcessUserPeer::PRO_UID, $sProcessUID);
|
||||
if ($start) {
|
||||
$oCriteria->setOffset( $start );
|
||||
}
|
||||
if ($limit) {
|
||||
$oCriteria->setLimit( $limit );
|
||||
}
|
||||
$oCriteria->addAscendingOrderByColumn(\UsersPeer::USR_FIRSTNAME);
|
||||
$oDataset = \ProcessUserPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aResp[] = array('sup_uid' => $aRow['USR_UID'],
|
||||
'sup_name' => $aRow['USR_FIRSTNAME'],
|
||||
'sup_lastname' => $aRow['USR_LASTNAME'],
|
||||
'sup_username' => $aRow['USR_USERNAME'],
|
||||
'sup_type' => "user" );
|
||||
$aResp[] = array('pu_uid' => $aRow['PU_UID'],
|
||||
'pu_type' => "SUPERVISOR",
|
||||
'usr_uid' => $aRow['USR_UID'],
|
||||
'usr_firstname' => $aRow['USR_FIRSTNAME'],
|
||||
'usr_lastname' => $aRow['USR_LASTNAME'],
|
||||
'usr_username' => $aRow['USR_USERNAME'],
|
||||
'usr_email' => $aRow['USR_EMAIL'] );
|
||||
$oDataset->next();
|
||||
}
|
||||
return $aResp;
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a spefic supervisor
|
||||
* @param string $sProcessUID
|
||||
* @param string $sPuUID
|
||||
*
|
||||
* @return object
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function getProcessSupervisor($sProcessUID = '', $sPuUID = '')
|
||||
{
|
||||
try {
|
||||
// Groups
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(\ProcessUserPeer::PU_UID);
|
||||
$oCriteria->addSelectColumn(\ProcessUserPeer::USR_UID);
|
||||
$oCriteria->addAsColumn('GRP_TITLE', \ContentPeer::CON_VALUE);
|
||||
$aConditions [] = array(\ProcessUserPeer::USR_UID, \ContentPeer::CON_ID);
|
||||
$aConditions [] = array(\ContentPeer::CON_CATEGORY, \DBAdapter::getStringDelimiter().'GRP_TITLE'.\DBAdapter::getStringDelimiter());
|
||||
$aConditions [] = array(\ContentPeer::CON_LANG, \DBAdapter::getStringDelimiter().SYS_LANG.\DBAdapter::getStringDelimiter());
|
||||
$oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
|
||||
$oCriteria->add(\ProcessUserPeer::PU_TYPE, 'GROUP_SUPERVISOR');
|
||||
$oCriteria->add(\ProcessUserPeer::PRO_UID, $sProcessUID);
|
||||
$oCriteria->add(\ProcessUserPeer::PU_UID, $sPuUID);
|
||||
$oCriteria->addAscendingOrderByColumn(\ContentPeer::CON_VALUE);
|
||||
$oDataset = \ProcessUserPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aResp = array('pu_uid' => $aRow['PU_UID'],
|
||||
'pu_type' => "GROUP_SUPERVISOR",
|
||||
'grp_uid' => $aRow['USR_UID'],
|
||||
'grp_name' => $aRow['GRP_TITLE']);
|
||||
$oDataset->next();
|
||||
}
|
||||
// Users
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(\ProcessUserPeer::USR_UID);
|
||||
$oCriteria->addSelectColumn(\ProcessUserPeer::PU_UID);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_FIRSTNAME);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_LASTNAME);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_USERNAME);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_EMAIL);
|
||||
$oCriteria->addJoin(\ProcessUserPeer::USR_UID, \UsersPeer::USR_UID, \Criteria::LEFT_JOIN);
|
||||
$oCriteria->add(\ProcessUserPeer::PU_TYPE, 'SUPERVISOR');
|
||||
$oCriteria->add(\ProcessUserPeer::PRO_UID, $sProcessUID);
|
||||
$oCriteria->add(\ProcessUserPeer::PU_UID, $sPuUID);
|
||||
$oCriteria->addAscendingOrderByColumn(\UsersPeer::USR_FIRSTNAME);
|
||||
$oDataset = \ProcessUserPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aResp = array('pu_uid' => $aRow['PU_UID'],
|
||||
'pu_type' => "SUPERVISOR",
|
||||
'usr_uid' => $aRow['USR_UID'],
|
||||
'usr_firstname' => $aRow['USR_FIRSTNAME'],
|
||||
'usr_lastname' => $aRow['USR_LASTNAME'],
|
||||
'usr_username' => $aRow['USR_USERNAME'],
|
||||
'usr_email' => $aRow['USR_EMAIL'] );
|
||||
$oDataset->next();
|
||||
}
|
||||
return $aResp;
|
||||
@@ -91,15 +139,13 @@ class ProcessSupervisor
|
||||
/**
|
||||
* Return available supervisors
|
||||
* @param string $sProcessUID
|
||||
* @param string $filter
|
||||
* @param int $start
|
||||
* @param int $limit
|
||||
* @param string $obj_type
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function getAvailableSupervisors($sProcessUID = '', $filter, $start, $limit)
|
||||
public function getAvailableProcessSupervisors($sProcessUID = '', $obj_type)
|
||||
{
|
||||
try {
|
||||
// Groups
|
||||
@@ -140,15 +186,15 @@ class ProcessSupervisor
|
||||
$oDataset2->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset2->next();
|
||||
$aRow2 = $oDataset2->getRow();
|
||||
if ($obj_type == 'group' || $obj_type == '') {
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aRespLi[] = array('sup_uid' => $aRow['GRP_UID'],
|
||||
'sup_name' => (!isset($aRow2['GROUP_INACTIVE']) ? $aRow['GRP_TITLE'] .
|
||||
'' : $aRow['GRP_TITLE'] . ' ' . $aRow2['GROUP_INACTIVE']),
|
||||
'sup_lastname' => "",
|
||||
'sup_username' => "",
|
||||
'sup_type' => "group" );
|
||||
$aRespLi[] = array('grp_uid' => $aRow['GRP_UID'],
|
||||
'grp_name' => $aRow['GRP_TITLE'],
|
||||
'obj_type' => "group");
|
||||
$oDataset->next();
|
||||
}
|
||||
}
|
||||
|
||||
$sDelimiter = \DBAdapter::getStringDelimiter();
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_UID);
|
||||
@@ -166,19 +212,23 @@ class ProcessSupervisor
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_FIRSTNAME);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_LASTNAME);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_USERNAME);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_EMAIL);
|
||||
$oCriteria->add(\UsersPeer::USR_UID, $aUIDS, \Criteria::IN);
|
||||
$oCriteria->addAscendingOrderByColumn(\UsersPeer::USR_FIRSTNAME);
|
||||
$oDataset = \UsersPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
if ($obj_type == 'user' || $obj_type == '') {
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aRespLi[] = array('sup_uid' => $aRow['USR_UID'],
|
||||
'sup_name' => $aRow['USR_FIRSTNAME'],
|
||||
'sup_lastname' => $aRow['USR_LASTNAME'],
|
||||
'sup_username' => $aRow['USR_USERNAME'],
|
||||
'sup_type' => "user" );
|
||||
$aRespLi[] = array('usr_uid' => $aRow['USR_UID'],
|
||||
'usr_firstname' => $aRow['USR_FIRSTNAME'],
|
||||
'usr_lastname' => $aRow['USR_LASTNAME'],
|
||||
'usr_username' => $aRow['USR_USERNAME'],
|
||||
'usr_email' => $aRow['USR_EMAIL'],
|
||||
"obj_type" => "user" );
|
||||
$oDataset->next();
|
||||
}
|
||||
}
|
||||
return $aRespLi;
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
@@ -186,14 +236,14 @@ class ProcessSupervisor
|
||||
}
|
||||
|
||||
/**
|
||||
* Return dynaform supervisor
|
||||
* Return dynaforms supervisor
|
||||
* @param string $sProcessUID
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function getDynaformSupervisor($sProcessUID = '')
|
||||
public function getProcessSupervisorDynaforms($sProcessUID = '')
|
||||
{
|
||||
try {
|
||||
$sDelimiter = \DBAdapter::getStringDelimiter();
|
||||
@@ -221,12 +271,60 @@ class ProcessSupervisor
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aResp[] = array('step_uid' => $aRow['STEP_UID'],
|
||||
'pro_uid' => $aRow['PRO_UID'],
|
||||
'step_type_obj' => $aRow['STEP_TYPE_OBJ'],
|
||||
'step_uid_obj' => $aRow['STEP_UID_OBJ'],
|
||||
'step_position' => $aRow['STEP_POSITION'],
|
||||
'title' => $aRow['DYN_TITLE']);
|
||||
$aResp[] = array('pud_uid' => $aRow['STEP_UID'],
|
||||
'pud_position' => $aRow['STEP_POSITION'],
|
||||
'dyn_uid' => $aRow['STEP_UID_OBJ'],
|
||||
'dyn_title' => $aRow['DYN_TITLE']);
|
||||
$oDataset->next();
|
||||
}
|
||||
return $aResp;
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a specific dynaform supervisor
|
||||
* @param string $sProcessUID
|
||||
* @param string $sPudUID
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function getProcessSupervisorDynaform($sProcessUID = '', $sPudUID = '')
|
||||
{
|
||||
try {
|
||||
$sDelimiter = \DBAdapter::getStringDelimiter();
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_UID);
|
||||
$oCriteria->addSelectColumn(\StepSupervisorPeer::PRO_UID);
|
||||
$oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_TYPE_OBJ);
|
||||
$oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_UID_OBJ);
|
||||
$oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_POSITION);
|
||||
$oCriteria->addAsColumn('DYN_TITLE', 'C.CON_VALUE');
|
||||
$oCriteria->addAlias('C', 'CONTENT');
|
||||
$aConditions = array();
|
||||
$aConditions[] = array(\StepSupervisorPeer::STEP_UID_OBJ, \DynaformPeer::DYN_UID );
|
||||
$aConditions[] = array(\StepSupervisorPeer::STEP_TYPE_OBJ, $sDelimiter . 'DYNAFORM' . $sDelimiter );
|
||||
$oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
|
||||
$aConditions = array();
|
||||
$aConditions[] = array(\DynaformPeer::DYN_UID, 'C.CON_ID' );
|
||||
$aConditions[] = array('C.CON_CATEGORY', $sDelimiter . 'DYN_TITLE' . $sDelimiter );
|
||||
$aConditions[] = array('C.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter );
|
||||
$oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
|
||||
$oCriteria->add(\StepSupervisorPeer::PRO_UID, $sProcessUID);
|
||||
$oCriteria->add(\StepSupervisorPeer::STEP_UID, $sPudUID);
|
||||
$oCriteria->add(\StepSupervisorPeer::STEP_TYPE_OBJ, 'DYNAFORM');
|
||||
$oCriteria->addAscendingOrderByColumn(\StepSupervisorPeer::STEP_POSITION);
|
||||
$oDataset = \StepSupervisorPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aResp = array('pud_uid' => $aRow['STEP_UID'],
|
||||
'pud_position' => $aRow['STEP_POSITION'],
|
||||
'dyn_uid' => $aRow['STEP_UID_OBJ'],
|
||||
'dyn_title' => $aRow['DYN_TITLE']);
|
||||
$oDataset->next();
|
||||
}
|
||||
return $aResp;
|
||||
@@ -243,13 +341,13 @@ class ProcessSupervisor
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function getAvailableDynaformSupervisors($sProcessUID = '')
|
||||
public function getAvailableProcessSupervisorDynaform($sProcessUID = '')
|
||||
{
|
||||
try {
|
||||
$oCriteria = $this->getDynaformSupervisor($sProcessUID);
|
||||
$oCriteria = $this->getProcessSupervisorDynaforms($sProcessUID);
|
||||
$aUIDS = array();
|
||||
foreach ($oCriteria as $oCriteria => $value) {
|
||||
$aUIDS[] = $value["step_uid_obj"];
|
||||
$aUIDS[] = $value["dyn_uid"];
|
||||
}
|
||||
$sDelimiter = \DBAdapter::getStringDelimiter();
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
@@ -272,9 +370,8 @@ class ProcessSupervisor
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aResp[] = array('pro_uid' => $aRow['PRO_UID'],
|
||||
'dyn_uid' => $aRow['DYN_UID'],
|
||||
'title' => $aRow['DYN_TITLE']);
|
||||
$aResp[] = array('dyn_uid' => $aRow['DYN_UID'],
|
||||
'dyn_title' => $aRow['DYN_TITLE']);
|
||||
$oDataset->next();
|
||||
}
|
||||
return $aResp;
|
||||
@@ -291,7 +388,7 @@ class ProcessSupervisor
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function getInputDocumentSupervisor($sProcessUID = '')
|
||||
public function getProcessSupervisorInputDocuments($sProcessUID = '')
|
||||
{
|
||||
try {
|
||||
$sDelimiter = \DBAdapter::getStringDelimiter();
|
||||
@@ -319,12 +416,60 @@ class ProcessSupervisor
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aResp[] = array('step_uid' => $aRow['STEP_UID'],
|
||||
'pro_uid' => $aRow['PRO_UID'],
|
||||
'step_type_obj' => $aRow['STEP_TYPE_OBJ'],
|
||||
'step_uid_obj' => $aRow['STEP_UID_OBJ'],
|
||||
'step_position' => $aRow['STEP_POSITION'],
|
||||
'title' => $aRow['INP_DOC_TITLE']);
|
||||
$aResp[] = array('pui_uid' => $aRow['STEP_UID'],
|
||||
'pui_position' => $aRow['STEP_POSITION'],
|
||||
'input_doc_uid' => $aRow['STEP_UID_OBJ'],
|
||||
'input_doc_title' => $aRow['INP_DOC_TITLE']);
|
||||
$oDataset->next();
|
||||
}
|
||||
return $aResp;
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a specific input document supervisor
|
||||
* @param string $sProcessUID
|
||||
* @param string $sPuiUID
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function getProcessSupervisorInputDocument($sProcessUID = '', $sPuiUID = '')
|
||||
{
|
||||
try {
|
||||
$sDelimiter = \DBAdapter::getStringDelimiter();
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_UID);
|
||||
$oCriteria->addSelectColumn(\StepSupervisorPeer::PRO_UID);
|
||||
$oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_TYPE_OBJ);
|
||||
$oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_UID_OBJ);
|
||||
$oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_POSITION);
|
||||
$oCriteria->addAsColumn('INP_DOC_TITLE', 'C.CON_VALUE');
|
||||
$oCriteria->addAlias('C', 'CONTENT');
|
||||
$aConditions = array();
|
||||
$aConditions[] = array(\StepSupervisorPeer::STEP_UID_OBJ, \InputDocumentPeer::INP_DOC_UID);
|
||||
$aConditions[] = array(\StepSupervisorPeer::STEP_TYPE_OBJ, $sDelimiter . 'INPUT_DOCUMENT' . $sDelimiter);
|
||||
$oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
|
||||
$aConditions = array();
|
||||
$aConditions[] = array(\InputDocumentPeer::INP_DOC_UID, 'C.CON_ID');
|
||||
$aConditions[] = array('C.CON_CATEGORY', $sDelimiter . 'INP_DOC_TITLE' . $sDelimiter);
|
||||
$aConditions[] = array('C.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter);
|
||||
$oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
|
||||
$oCriteria->add(\StepSupervisorPeer::PRO_UID, $sProcessUID);
|
||||
$oCriteria->add(\StepSupervisorPeer::STEP_UID, $sPuiUID);
|
||||
$oCriteria->add(\StepSupervisorPeer::STEP_TYPE_OBJ, 'INPUT_DOCUMENT');
|
||||
$oCriteria->addAscendingOrderByColumn(\StepSupervisorPeer::STEP_POSITION);
|
||||
$oDataset = \StepSupervisorPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aResp[] = array('pui_uid' => $aRow['STEP_UID'],
|
||||
'pui_position' => $aRow['STEP_POSITION'],
|
||||
'input_doc_uid' => $aRow['STEP_UID_OBJ'],
|
||||
'input_doc_title' => $aRow['INP_DOC_TITLE']);
|
||||
$oDataset->next();
|
||||
}
|
||||
return $aResp;
|
||||
@@ -341,13 +486,13 @@ class ProcessSupervisor
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function getAvailableInputDocumentSupervisor($sProcessUID = '')
|
||||
public function getAvailableProcessSupervisorInputDocument($sProcessUID = '')
|
||||
{
|
||||
try {
|
||||
$oCriteria = $this->getInputDocumentSupervisor($sProcessUID);
|
||||
$oCriteria = $this->getProcessSupervisorInputDocuments($sProcessUID);
|
||||
$aUIDS = array();
|
||||
foreach ($oCriteria as $oCriteria => $value) {
|
||||
$aUIDS[] = $value["step_uid_obj"];
|
||||
$aUIDS[] = $value["input_doc_uid"];
|
||||
}
|
||||
$sDelimiter = \DBAdapter::getStringDelimiter();
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
@@ -369,9 +514,8 @@ class ProcessSupervisor
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aResp[] = array('pro_uid' => $aRow['PRO_UID'],
|
||||
'inp_doc_uid' => $aRow['INP_DOC_UID'],
|
||||
'title' => $aRow['INP_DOC_TITLE']);
|
||||
$aResp[] = array('inp_doc_uid' => $aRow['INP_DOC_UID'],
|
||||
'inp_doc_title' => $aRow['INP_DOC_TITLE']);
|
||||
$oDataset->next();
|
||||
}
|
||||
return $aResp;
|
||||
@@ -380,29 +524,86 @@ class ProcessSupervisor
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a supervisor of a process
|
||||
*
|
||||
* @param string $sProcessUID
|
||||
* @param string $sUsrUID
|
||||
* @param string $sTypeUID
|
||||
* @access public
|
||||
*/
|
||||
public function addProcessSupervisor($sProcessUID, $sUsrUID, $sTypeUID)
|
||||
{
|
||||
$oProcessUser = new \ProcessUser ( );
|
||||
$oTypeAssigneeG = \GroupwfPeer::retrieveByPK( $sUsrUID );
|
||||
$oTypeAssigneeU = \UsersPeer::retrieveByPK( $sUsrUID );
|
||||
if (is_null( $oTypeAssigneeG ) && is_null( $oTypeAssigneeU ) ) {
|
||||
throw (new \Exception( 'This id: '. $sUsrUID .' do not correspond to a registered ' .$sTypeUID ));
|
||||
}
|
||||
if (is_null( $oTypeAssigneeG ) && ! is_null( $oTypeAssigneeU) ) {
|
||||
if ( "SUPERVISOR"!= $sTypeUID ) {
|
||||
throw (new \Exception( 'This id: '. $sUsrUID .' do not correspond to a registered ' .$sTypeUID ));
|
||||
}
|
||||
}
|
||||
if (! is_null( $oTypeAssigneeG ) && is_null( $oTypeAssigneeU ) ) {
|
||||
if ( "GROUP_SUPERVISOR" != $sTypeUID ) {
|
||||
throw (new \Exception( 'This id: '. $sUsrUID .' do not correspond to a registered ' .$sTypeUID ));
|
||||
}
|
||||
}
|
||||
$sPuUID = \G::generateUniqueID();
|
||||
$oProcessUser->create(array('PU_UID' => $sPuUID,
|
||||
'PRO_UID' => $sProcessUID,
|
||||
'USR_UID' => $sUsrUID,
|
||||
'PU_TYPE' => $sTypeUID));
|
||||
$oCriteria = $this->getProcessSupervisor($sProcessUID, $sPuUID);
|
||||
return $oCriteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a dynaform supervisor of a process
|
||||
*
|
||||
* @param string $sProcessUID
|
||||
* @param string $sDynUID
|
||||
* @access public
|
||||
*/
|
||||
public function addProcessSupervisorDynaform($sProcessUID, $sDynUID)
|
||||
{
|
||||
$oStepSupervisor = new \StepSupervisor();
|
||||
$oStepSupervisor->create(array('PRO_UID' => $sProcessUID,
|
||||
'STEP_TYPE_OBJ' => "DYNAFORM",
|
||||
'STEP_UID_OBJ' => $sDynUID,
|
||||
'STEP_POSITION' => $oStepSupervisor->getNextPosition($sProcessUID, "DYNAFORM")));
|
||||
return $oStepSupervisor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a inputdocument supervisor of a process
|
||||
*
|
||||
* @param string $sProcessUID
|
||||
* @param string $sInputDocumentUID
|
||||
* @access public
|
||||
*/
|
||||
public function addProcessSupervisorInputDocument($sProcessUID, $sInputDocumentUID)
|
||||
{
|
||||
$oStepSupervisor = new \StepSupervisor();
|
||||
$oStepSupervisor->create(array('PRO_UID' => $sProcessUID,
|
||||
'STEP_TYPE_OBJ' => "INPUT_DOCUMENT",
|
||||
'STEP_UID_OBJ' => $sInputDocumentUID,
|
||||
'STEP_POSITION' => $oStepSupervisor->getNextPosition($sProcessUID, "DYNAFORM")));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a supervisor
|
||||
*
|
||||
* @param string $sProcessUID
|
||||
* @param string $sUserUID
|
||||
* @param string $sPuUID
|
||||
* @access public
|
||||
*/
|
||||
public function removeProcessSupervisor($sProcessUID, $sUserUID)
|
||||
public function removeProcessSupervisor($sProcessUID, $sPuUID)
|
||||
{
|
||||
$oConnection = \Propel::getConnection(\ProcessUserPeer::DATABASE_NAME);
|
||||
try {
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn( \ProcessUserPeer::PU_UID );
|
||||
$oCriteria->add(\ProcessUserPeer::PRO_UID, $sProcessUID);
|
||||
$oCriteria->add(\ProcessUserPeer::USR_UID, $sUserUID);
|
||||
$oPuUid = \ProcessUserPeer::doSelectRS($oCriteria);
|
||||
$oPuUid->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
while ($oPuUid->next()) {
|
||||
$aRow = $oPuUid->getRow();
|
||||
$iPuUid = $aRow['PU_UID'];
|
||||
}
|
||||
$oProcessUser = \ProcessUserPeer::retrieveByPK($iPuUid);
|
||||
$oProcessUser = \ProcessUserPeer::retrieveByPK($sPuUID);
|
||||
if (!is_null($oProcessUser)) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oProcessUser->delete();
|
||||
@@ -421,24 +622,14 @@ class ProcessSupervisor
|
||||
* Remove a dynaform supervisor
|
||||
*
|
||||
* @param string $sProcessUID
|
||||
* @param string $sDynaformUID
|
||||
* @param string $sPudUID
|
||||
* @access public
|
||||
*/
|
||||
public function removeDynaformSupervisor($sProcessUID, $sDynaform)
|
||||
public function removeDynaformSupervisor($sProcessUID, $sPudUID)
|
||||
{
|
||||
$oConnection = \Propel::getConnection(\StepSupervisorPeer::DATABASE_NAME);
|
||||
try {
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn( \StepSupervisorPeer::STEP_UID );
|
||||
$oCriteria->add(\StepSupervisorPeer::PRO_UID, $sProcessUID);
|
||||
$oCriteria->add(\StepSupervisorPeer::STEP_UID_OBJ, $sDynaform);
|
||||
$oPuUid = \StepSupervisorPeer::doSelectRS($oCriteria);
|
||||
$oPuUid->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
while ($oPuUid->next()) {
|
||||
$aRow = $oPuUid->getRow();
|
||||
$iStepUid = $aRow['STEP_UID'];
|
||||
}
|
||||
$oDynaformSupervidor = \StepSupervisorPeer::retrieveByPK($iStepUid);
|
||||
$oDynaformSupervidor = \StepSupervisorPeer::retrieveByPK($sPudUID);
|
||||
if (!is_null($oDynaformSupervidor)) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oDynaformSupervidor->delete();
|
||||
@@ -457,24 +648,14 @@ class ProcessSupervisor
|
||||
* Remove a input document supervisor
|
||||
*
|
||||
* @param string $sProcessUID
|
||||
* @param string $sInputDocumentUID
|
||||
* @param string $sPuiUID
|
||||
* @access public
|
||||
*/
|
||||
public function removeInputDocumentSupervisor($sProcessUID, $sInputDocumentUID)
|
||||
public function removeInputDocumentSupervisor($sProcessUID, $sPuiUID)
|
||||
{
|
||||
$oConnection = \Propel::getConnection(\StepSupervisorPeer::DATABASE_NAME);
|
||||
try {
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn( \StepSupervisorPeer::STEP_UID );
|
||||
$oCriteria->add(\StepSupervisorPeer::PRO_UID, $sProcessUID);
|
||||
$oCriteria->add(\StepSupervisorPeer::STEP_UID_OBJ, $sInputDocumentUID);
|
||||
$oPuUid = \StepSupervisorPeer::doSelectRS($oCriteria);
|
||||
$oPuUid->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
while ($oPuUid->next()) {
|
||||
$aRow = $oPuUid->getRow();
|
||||
$iStepUid = $aRow['STEP_UID'];
|
||||
}
|
||||
$oInputDocumentSupervidor = \StepSupervisorPeer::retrieveByPK($iStepUid);
|
||||
$oInputDocumentSupervidor = \StepSupervisorPeer::retrieveByPK($sPuiUID);
|
||||
if (!is_null($oInputDocumentSupervidor)) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oInputDocumentSupervidor->delete();
|
||||
@@ -488,72 +669,5 @@ class ProcessSupervisor
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a supervisor of a process
|
||||
*
|
||||
* @param string $sProcessUID
|
||||
* @param string $sUsrUID
|
||||
* @param string $sTypeUID
|
||||
* @access public
|
||||
*/
|
||||
public function addSupervisor($sProcessUID, $sUsrUID, $sTypeUID)
|
||||
{
|
||||
$oProcessUser = new \ProcessUser ( );
|
||||
$puType = 'SUPERVISOR';
|
||||
if ($sTypeUID == 'Group') {
|
||||
$puType = 'GROUP_SUPERVISOR';
|
||||
}
|
||||
$oTypeAssigneeG = \GroupwfPeer::retrieveByPK( $sUsrUID );
|
||||
$oTypeAssigneeU = \UsersPeer::retrieveByPK( $sUsrUID );
|
||||
if (is_null( $oTypeAssigneeG ) && is_null( $oTypeAssigneeU ) ) {
|
||||
throw (new \Exception( 'This id: '. $sUsrUID .' do not correspond to a registered ' .$sTypeUID ));
|
||||
}
|
||||
if (is_null( $oTypeAssigneeG ) && ! is_null( $oTypeAssigneeU) ) {
|
||||
$type = "User";
|
||||
if ( $type != $sTypeUID ) {
|
||||
throw (new \Exception( 'This id: '. $sUsrUID .' do not correspond to a registered ' .$sTypeUID ));
|
||||
}
|
||||
}
|
||||
if (! is_null( $oTypeAssigneeG ) && is_null( $oTypeAssigneeU ) ) {
|
||||
$type = "Group";
|
||||
if ( $type != $sTypeUID ) {
|
||||
throw (new \Exception( 'This id: '. $sUsrUID .' do not correspond to a registered ' .$sTypeUID ));
|
||||
}
|
||||
}
|
||||
$oProcessUser->create(array('PU_UID' => \G::generateUniqueID(), 'PRO_UID' => $sProcessUID, 'USR_UID' => $sUsrUID, 'PU_TYPE' => $puType));
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a dynaform supervisor of a process
|
||||
*
|
||||
* @param string $sProcessUID
|
||||
* @param string $sDynUID
|
||||
* @access public
|
||||
*/
|
||||
public function addDynaformSupervisor($sProcessUID, $sDynUID)
|
||||
{
|
||||
$oStepSupervisor = new \StepSupervisor();
|
||||
$oStepSupervisor->create(array('PRO_UID' => $sProcessUID,
|
||||
'STEP_TYPE_OBJ' => "DYNAFORM",
|
||||
'STEP_UID_OBJ' => $sDynUID,
|
||||
'STEP_POSITION' => $oStepSupervisor->getNextPosition($sProcessUID, "DYNAFORM")));
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a inputdocument supervisor of a process
|
||||
*
|
||||
* @param string $sProcessUID
|
||||
* @param string $sInputDocumentUID
|
||||
* @access public
|
||||
*/
|
||||
public function addInputDocumentSupervisor($sProcessUID, $sInputDocumentUID)
|
||||
{
|
||||
$oStepSupervisor = new \StepSupervisor();
|
||||
$oStepSupervisor->create(array('PRO_UID' => $sProcessUID,
|
||||
'STEP_TYPE_OBJ' => "INPUT_DOCUMENT",
|
||||
'STEP_UID_OBJ' => $sInputDocumentUID,
|
||||
'STEP_POSITION' => $oStepSupervisor->getNextPosition($sProcessUID, "DYNAFORM")));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,17 +13,113 @@ class ProcessSupervisors extends Api
|
||||
{
|
||||
/**
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $filter
|
||||
* @param int $start
|
||||
* @param int $limit
|
||||
*
|
||||
* @url GET /:prjUid/supervisors
|
||||
* @url GET /:prjUid/process-supervisors
|
||||
*/
|
||||
public function doGetSupervisors($prjUid, $filter = '', $start = null, $limit = null)
|
||||
public function doGetProcessSupervisors($prjUid)
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$arrayData = $supervisor->getSupervisors($prjUid, $filter, $start, $limit);
|
||||
$arrayData = $supervisor->getProcessSupervisors($prjUid);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $puUid {@min 32} {@max 32}
|
||||
*
|
||||
* @url GET /:prjUid/process-supervisor/:puUid
|
||||
*/
|
||||
public function doGetProcessSupervisor($prjUid, $puUid)
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$objectData = $supervisor->getProcessSupervisor($prjUid, $puUid);
|
||||
//Response
|
||||
$response = $objectData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $obj_type {@choice user,group}
|
||||
*
|
||||
* @url GET /:prjUid/available-process-supervisors
|
||||
*/
|
||||
public function doGetAvailableSupervisors($prjUid, $obj_type = '')
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$arrayData = $supervisor->getAvailableProcessSupervisors($prjUid, $obj_type);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
*
|
||||
* @url GET /:prjUid/process-supervisor/dynaforms
|
||||
*/
|
||||
public function doGetProcessSupervisorDynaforms($prjUid)
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$arrayData = $supervisor->getProcessSupervisorDynaforms($prjUid);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $pudUid {@min 32} {@max 32}
|
||||
*
|
||||
* @url GET /:prjUid/process-supervisor/dynaform/:pudUid
|
||||
*/
|
||||
public function doGetProcessSupervisorDynaform($prjUid, $pudUid)
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$objectData = $supervisor->getProcessSupervisorDynaform($prjUid, $pudUid);
|
||||
//Response
|
||||
$response = $objectData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
*
|
||||
* @url GET /:prjUid/process-supervisor/available-dynaforms
|
||||
*/
|
||||
public function doGetAvailableProcessSupervisorDynaform($prjUid)
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$arrayData = $supervisor->getAvailableProcessSupervisorDynaform($prjUid);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
@@ -36,13 +132,13 @@ class ProcessSupervisors extends Api
|
||||
/**
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
*
|
||||
* @url GET /:prjUid/inputdocument-supervisor
|
||||
* @url GET /:prjUid/process-supervisor/input-documents
|
||||
*/
|
||||
public function doGetInputDocumentSupervisor($prjUid)
|
||||
public function doGetProcessSupervisorInputDocuments($prjUid)
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$arrayData = $supervisor->getInputDocumentSupervisor($prjUid);
|
||||
$arrayData = $supervisor->getProcessSupervisorInputDocuments($prjUid);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
@@ -54,38 +150,17 @@ class ProcessSupervisors extends Api
|
||||
|
||||
/**
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $puiUid {@min 32} {@max 32}
|
||||
*
|
||||
* @url GET /:prjUid/dynaform-supervisor
|
||||
* @url GET /:prjUid/process-supervisor/input-document/:puiUid
|
||||
*/
|
||||
public function doGetDynaformSupervisor($prjUid)
|
||||
public function doGetProcessSupervisorInputDocument($prjUid, $puiUid)
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$arrayData = $supervisor->getDynaformSupervisor($prjUid);
|
||||
$objectData = $supervisor->getProcessSupervisorInputDocument($prjUid, $puiUid);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
* @param string $filter
|
||||
* @param int $start
|
||||
* @param int $limit
|
||||
*
|
||||
* @url GET /:prjUid/available-supervisors
|
||||
*/
|
||||
public function doGetAvailableSupervisors($prjUid, $filter = '', $start = null, $limit = null)
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$arrayData = $supervisor->getAvailableSupervisors($prjUid, $filter, $start, $limit);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
$response = $objectData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
@@ -96,13 +171,14 @@ class ProcessSupervisors extends Api
|
||||
/**
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
*
|
||||
* @url GET /:prjUid/available-dynaform-supervisor
|
||||
* @url GET /:prjUid/process-supervisor/available-input-documents
|
||||
*/
|
||||
public function doGetAvailableDynaformSupervisor($prjUid)
|
||||
public function doGetAvailableProcessSupervisorInputDocument($prjUid)
|
||||
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$arrayData = $supervisor->getAvailableDynaformSupervisors($prjUid);
|
||||
$arrayData = $supervisor->getAvailableProcessSupervisorInputDocument($prjUid);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
@@ -113,98 +189,21 @@ class ProcessSupervisors extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $prjUid {@min 32} {@max 32}
|
||||
*
|
||||
* @url GET /:prjUid/available-inputdocument-supervisor
|
||||
*/
|
||||
public function doGetAvailableInputDocumentSupervisor($prjUid)
|
||||
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$arrayData = $supervisor->getAvailableInputDocumentSupervisor($prjUid);
|
||||
//Response
|
||||
$response = $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @url DELETE /:prjUid/supervisor/:supUid
|
||||
* @url POST /:prjUid/process-supervisor
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $supUid
|
||||
*
|
||||
*/
|
||||
public function doDeleteSupervisor($prjUid, $supUid)
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$arrayData = $supervisor->removeProcessSupervisor($prjUid, $supUid);
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:prjUid/dynaform-supervisor/:dynUid
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $dynUid
|
||||
*
|
||||
*/
|
||||
public function doDeleteDynaformSupervisor($prjUid, $dynUid)
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$arrayData = $supervisor->removeDynaformSupervisor($prjUid, $dynUid);
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:prjUid/inputdocument-supervisor/:inputDocUid
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $inputDocUid
|
||||
*
|
||||
*/
|
||||
public function doDeleteInputDocumentSupervisor($prjUid, $inputDocUid)
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$arrayData = $supervisor->removeInputDocumentSupervisor($prjUid, $inputDocUid);
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @url POST /:prjUid/supervisor
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $sup_uid
|
||||
* @param string $sup_type {@choice user,group}
|
||||
* @param string $usr_uid
|
||||
* @param string $pu_type {@choice SUPERVISOR,GROUP_SUPERVISOR}
|
||||
*
|
||||
* @status 201
|
||||
*/
|
||||
public function doPostSupervisors($prjUid, $sup_uid, $sup_type)
|
||||
public function doPostProcessSupervisor($prjUid, $usr_uid, $pu_type)
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$sup_type=ucwords($sup_type);
|
||||
$arrayData = $supervisor->addSupervisor($prjUid, $sup_uid, $sup_type);
|
||||
$objectData = $supervisor->addProcessSupervisor($prjUid, $usr_uid, $pu_type);
|
||||
//Response
|
||||
$response = $objectData;
|
||||
} catch (\Exception $e) {
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
@@ -213,18 +212,20 @@ class ProcessSupervisors extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @url POST /:prjUid/dynaform-supervisor
|
||||
* @url POST /:prjUid/process-supervisor/dynaform
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $dyn_uid
|
||||
*
|
||||
* @status 201
|
||||
*/
|
||||
public function doPostDynaformSupervisors($prjUid, $dyn_uid)
|
||||
public function doPostProcessSupervisorDynaform($prjUid, $dyn_uid)
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$arrayData = $supervisor->addDynaformSupervisor($prjUid, $dyn_uid);
|
||||
$objectData = $supervisor->addProcessSupervisorDynaform($prjUid, $dyn_uid);
|
||||
//Response
|
||||
$response = $objectData;
|
||||
} catch (\Exception $e) {
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
@@ -233,18 +234,18 @@ class ProcessSupervisors extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @url POST /:prjUid/inputdocument-supervisor
|
||||
* @url POST /:prjUid/process-supervisor/input-document
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $inp_doc_uid
|
||||
*
|
||||
* @status 201
|
||||
*/
|
||||
public function doPostInputDocumentSupervisors($prjUid, $inp_doc_uid)
|
||||
public function doPostProcessSupervisorInputDocument($prjUid, $inp_doc_uid)
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$arrayData = $supervisor->addInputDocumentSupervisor($prjUid, $inp_doc_uid);
|
||||
$arrayData = $supervisor->addProcessSupervisorInputDocument($prjUid, $inp_doc_uid);
|
||||
} catch (\Exception $e) {
|
||||
//Response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
@@ -252,4 +253,64 @@ class ProcessSupervisors extends Api
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:prjUid/process-supervisor/:puUid
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $puUid
|
||||
*
|
||||
*/
|
||||
public function doDeleteSupervisor($prjUid, $puUid)
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$arrayData = $supervisor->removeProcessSupervisor($prjUid, $puUid);
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:prjUid/process-supervisor/dynaform/:pudUid
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $pudUid
|
||||
*
|
||||
*/
|
||||
public function doDeleteDynaformSupervisor($prjUid, $pudUid)
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$arrayData = $supervisor->removeDynaformSupervisor($prjUid, $pudUid);
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:prjUid/process-supervisor/input-document/:puiUid
|
||||
*
|
||||
* @param string $prjUid
|
||||
* @param string $puiUid
|
||||
*
|
||||
*/
|
||||
public function doDeleteInputDocumentSupervisor($prjUid, $puiUid)
|
||||
{
|
||||
try {
|
||||
$supervisor = new \BusinessModel\ProcessSupervisor();
|
||||
$arrayData = $supervisor->removeInputDocumentSupervisor($prjUid, $puiUid);
|
||||
} catch (\Exception $e) {
|
||||
//response
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user