public function deleteInputDoc($params) { require_once 'classes/model/StepSupervisor.php'; require_once 'classes/model/ObjectPermission.php'; require_once 'classes/model/InputDocument.php'; G::LoadClass('processMap'); $oStepSupervisor = new StepSupervisor(); $fields2 = $oStepSupervisor->loadInfo($params->IDOC_UID); $oStepSupervisor->remove($fields2['STEP_UID']); $oPermission = new ObjectPermission(); $fields3 = $oPermission->loadInfo($params->IDOC_UID); if (is_array($fields3)) { $oPermission->remove($fields3['OP_UID']); } $oInputDocument = new InputDocument(); $fields = $oInputDocument->load($params->IDOC_UID); $oInputDocument->remove($params->IDOC_UID); $oStep = new Step(); $oStep->removeStep('INPUT_DOCUMENT', $params->IDOC_UID); $oOP = new ObjectPermission(); $oOP->removeByObject('INPUT', $params->IDOC_UID); //refresh dbarray with the last change in inputDocument $oMap = new processMap(); $oCriteria = $oMap->getInputDocumentsCriteria($params->PRO_UID); $this->success = true; $this->msg = G::LoadTranslation('ID_INPUT_DOC_SUCCESS_DELETE'); }
case 'deleteInputDocument': try { $oStepSupervisor = new StepSupervisor(); $fields2 = $oStepSupervisor->loadInfo($_POST['INP_DOC_UID']); $oStepSupervisor->remove($fields2['STEP_UID']); $oPermission = new ObjectPermission(); $fields3 = $oPermission->loadInfo($_POST['INP_DOC_UID']); if (is_array($fields3)) { $oPermission->remove($fields3['OP_UID']); } $oInputDocument = new InputDocument(); $fields = $oInputDocument->load($_POST['INP_DOC_UID']); $oInputDocument->remove($_POST['INP_DOC_UID']); $oStep = new Step(); $oStep->removeStep('INPUT_DOCUMENT', $_POST['INP_DOC_UID']); $oOP = new ObjectPermission(); $oOP->removeByObject('INPUT', $_POST['INP_DOC_UID']); //refresh dbarray with the last change in inputDocument $oMap = new processMap(); $oCriteria = $oMap->getInputDocumentsCriteria($fields['PRO_UID']); $result->success = true; $result->msg = G::LoadTranslation('ID_INPUTDOCUMENT_REMOVED'); } catch (Exception $e) { $result->success = false; $result->msg = $e->getMessage(); } print G::json_encode($result); break; } } catch (Exception $oException) { die($oException->getMessage());
/** * Delete InputDocument * * @param string $inputDocumentUid Unique id of InputDocument * * return void */ public function delete($inputDocumentUid) { try { //Verify data $this->throwExceptionIfNotExistsInputDocument($inputDocumentUid, "", $this->arrayFieldNameForException["inputDocumentUid"]); $this->throwExceptionIfItsAssignedInOtherObjects($inputDocumentUid, $this->arrayFieldNameForException["inputDocumentUid"]); //Delete //StepSupervisor $stepSupervisor = new \StepSupervisor(); $arrayData = $stepSupervisor->loadInfo($inputDocumentUid); $result = $stepSupervisor->remove($arrayData["STEP_UID"]); //ObjectPermission $objectPermission = new \ObjectPermission(); $arrayData = $objectPermission->loadInfo($inputDocumentUid); if (is_array($arrayData)) { $result = $objectPermission->remove($arrayData["OP_UID"]); } //InputDocument $inputDocument = new \InputDocument(); $result = $inputDocument->remove($inputDocumentUid); //Step $step = new \Step(); $step->removeStep("INPUT_DOCUMENT", $inputDocumentUid); //ObjectPermission $objectPermission = new \ObjectPermission(); $objectPermission->removeByObject("INPUT", $inputDocumentUid); } catch (\Exception $e) { throw $e; } }
/** * this function remove all Process except the PROCESS ROW * * @param string $sProUid * @return boolean */ public function removeProcessRows ($sProUid) { try { //Instance all classes necesaries $oProcess = new Process(); $oDynaform = new Dynaform(); $oInputDocument = new InputDocument(); $oOutputDocument = new OutputDocument(); $oTrigger = new Triggers(); $oStepTrigger = new StepTrigger(); $oRoute = new Route(); $oStep = new Step(); $oSubProcess = new SubProcess(); $oCaseTracker = new CaseTracker(); $oCaseTrackerObject = new CaseTrackerObject(); $oObjectPermission = new ObjectPermission(); $oSwimlaneElement = new SwimlanesElements(); $oConnection = new DbSource(); $oStage = new Stage(); $oEvent = new Event(); $oCaseScheduler = new CaseScheduler(); $oConfig = new Configuration(); //Delete the tasks of process $oCriteria = new Criteria( 'workflow' ); $oCriteria->add( TaskPeer::PRO_UID, $sProUid ); $oDataset = TaskPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); $oTask = new Task(); while ($aRow = $oDataset->getRow()) { $oCriteria = new Criteria( 'workflow' ); $oCriteria->add( StepTriggerPeer::TAS_UID, $aRow['TAS_UID'] ); StepTriggerPeer::doDelete( $oCriteria ); if ($oTask->taskExists( $aRow['TAS_UID'] )) { $oTask->remove( $aRow['TAS_UID'] ); } $oDataset->next(); } //Delete the dynaforms of process $oCriteria = new Criteria( 'workflow' ); $oCriteria->add( DynaformPeer::PRO_UID, $sProUid ); $oDataset = DynaformPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { $sWildcard = PATH_DYNAFORM . $aRow['PRO_UID'] . PATH_SEP . $aRow['DYN_UID'] . '_tmp*'; foreach (glob( $sWildcard ) as $fn) { @unlink( $fn ); } $sWildcard = PATH_DYNAFORM . $aRow['PRO_UID'] . PATH_SEP . $aRow['DYN_UID'] . '.*'; foreach (glob( $sWildcard ) as $fn) { @unlink( $fn ); } if ($oDynaform->dynaformExists( $aRow['DYN_UID'] )) { $oDynaform->remove( $aRow['DYN_UID'] ); } $oDataset->next(); } //Delete the input documents of process $oCriteria = new Criteria( 'workflow' ); $oCriteria->add( InputDocumentPeer::PRO_UID, $sProUid ); $oDataset = InputDocumentPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { if ($oInputDocument->InputExists( $aRow['INP_DOC_UID'] )) { $oInputDocument->remove( $aRow['INP_DOC_UID'] ); } $oDataset->next(); } //Delete the output documents of process $oCriteria = new Criteria( 'workflow' ); $oCriteria->add( OutputDocumentPeer::PRO_UID, $sProUid ); $oDataset = OutputDocumentPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { if ($oOutputDocument->OutputExists( $aRow['OUT_DOC_UID'] )) { $oOutputDocument->remove( $aRow['OUT_DOC_UID'] ); } $oDataset->next(); } //Delete the steps $oCriteria = new Criteria( 'workflow' ); $oCriteria->add( StepPeer::PRO_UID, $sProUid ); $oDataset = StepPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { //Delete the steptrigger of process /*$oCriteria = new Criteria('workflow'); $oCriteria->add(StepTriggerPeer::STEP_UID, $aRow['STEP_UID']); $oDataseti = StepTriggerPeer::doSelectRS($oCriteria); $oDataseti->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataseti->next(); while ($aRowi = $oDataseti->getRow()) { if ($oStepTrigger->stepTriggerExists($aRowi['STEP_UID'], $aRowi['TAS_UID'], $aRowi['TRI_UID'], $aRowi['ST_TYPE'])) $oStepTrigger->remove($aRowi['STEP_UID'], $aRowi['TAS_UID'], $aRowi['TRI_UID'], $aRowi['ST_TYPE']); $oDataseti->next(); }*/ $oStep->remove( $aRow['STEP_UID'] ); $oDataset->next(); } //Delete the StepSupervisor $oCriteria = new Criteria( 'workflow' ); $oCriteria->add( StepSupervisorPeer::PRO_UID, $sProUid ); $oDataset = StepSupervisorPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { if ($oStep->StepExists( $aRow['STEP_UID'] )) { $oStep->remove( $aRow['STEP_UID'] ); } $oDataset->next(); } //Delete the triggers of process $oCriteria = new Criteria( 'workflow' ); $oCriteria->add( TriggersPeer::PRO_UID, $sProUid ); $oDataset = TriggersPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { if ($oTrigger->TriggerExists( $aRow['TRI_UID'] )) { $oTrigger->remove( $aRow['TRI_UID'] ); } $oDataset->next(); } //Delete the routes of process $oCriteria = new Criteria( 'workflow' ); $oCriteria->add( RoutePeer::PRO_UID, $sProUid ); $oDataset = RoutePeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { if ($oRoute->routeExists( $aRow['ROU_UID'] )) { $oRoute->remove( $aRow['ROU_UID'] ); } $oDataset->next(); } //Delete the swimlanes elements of process $oCriteria = new Criteria( 'workflow' ); $oCriteria->add( SwimlanesElementsPeer::PRO_UID, $sProUid ); $oDataset = SwimlanesElementsPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { if ($oSwimlaneElement->swimlanesElementsExists( $aRow['SWI_UID'] )) { $oSwimlaneElement->remove( $aRow['SWI_UID'] ); } $oDataset->next(); } //Delete the DB connections of process $oCriteria = new Criteria( 'workflow' ); $oCriteria->add( DbSourcePeer::PRO_UID, $sProUid ); $oDataset = DbSourcePeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { if ($oConnection->Exists( $aRow['DBS_UID'], $aRow['PRO_UID'] )) { $oConnection->remove( $aRow['DBS_UID'], $aRow['PRO_UID'] ); } $oDataset->next(); } //Delete the sub process of process $oCriteria = new Criteria( 'workflow' ); $oCriteria->add( SubProcessPeer::PRO_PARENT, $sProUid ); $oDataset = SubProcessPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { if ($oSubProcess->subProcessExists( $aRow['SP_UID'] )) { $oSubProcess->remove( $aRow['SP_UID'] ); } $oDataset->next(); } //Delete the caseTracker of process $oCriteria = new Criteria( 'workflow' ); $oCriteria->add( CaseTrackerPeer::PRO_UID, $sProUid ); $oDataset = CaseTrackerPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { if ($oCaseTracker->caseTrackerExists( $aRow['PRO_UID'] )) { $oCaseTracker->remove( $aRow['PRO_UID'] ); } $oDataset->next(); } //Delete the caseTrackerObject of process $oCriteria = new Criteria( 'workflow' ); $oCriteria->add( CaseTrackerObjectPeer::PRO_UID, $sProUid ); $oDataset = CaseTrackerObjectPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { if ($oCaseTrackerObject->caseTrackerObjectExists( $aRow['CTO_UID'] )) { $oCaseTrackerObject->remove( $aRow['CTO_UID'] ); } $oDataset->next(); } //Delete the ObjectPermission of process $oCriteria = new Criteria( 'workflow' ); $oCriteria->add( ObjectPermissionPeer::PRO_UID, $sProUid ); $oDataset = ObjectPermissionPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { if ($oObjectPermission->Exists( $aRow['OP_UID'] )) { $oObjectPermission->remove( $aRow['OP_UID'] ); } $oDataset->next(); } //Delete the Stage of process $oCriteria = new Criteria( 'workflow' ); $oCriteria->add( StagePeer::PRO_UID, $sProUid ); $oDataset = StagePeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { if ($oStage->Exists( $aRow['STG_UID'] )) { $oStage->remove( $aRow['STG_UID'] ); } $oDataset->next(); } //Delete the Event of process $oCriteria = new Criteria( 'workflow' ); $oCriteria->add( EventPeer::PRO_UID, $sProUid ); $oDataset = EventPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { if ($oEvent->Exists( $aRow['EVN_UID'] )) { $oEvent->remove( $aRow['EVN_UID'] ); } $oDataset->next(); if ($oEvent->existsByTaskUidFrom( $aRow['TAS_UID'] )) { $aRowEvent = $oEvent->getRowByTaskUidFrom( $aRow['TAS_UID'] ); $oEvent->remove( $aRowEvent['EVN_UID'] ); } $oDataset->next(); } //Delete the CaseScheduler of process $oCriteria = new Criteria( 'workflow' ); $oCriteria->add( CaseSchedulerPeer::PRO_UID, $sProUid ); $oDataset = CaseSchedulerPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { if ($oCaseScheduler->Exists( $aRow['SCH_UID'] )) { $oCaseScheduler->remove( $aRow['SCH_UID'] ); } $oDataset->next(); } //Delete the TaskExtraProperties of the process $oCriteria = new Criteria( 'workflow' ); $oCriteria->addSelectColumn( ConfigurationPeer::CFG_UID ); $oCriteria->addSelectColumn( ConfigurationPeer::OBJ_UID ); $oCriteria->addSelectColumn( ConfigurationPeer::CFG_VALUE ); $oCriteria->addSelectColumn( TaskPeer::PRO_UID ); $oCriteria->addSelectColumn( ConfigurationPeer::USR_UID ); $oCriteria->addSelectColumn( ConfigurationPeer::APP_UID ); $oCriteria->add( TaskPeer::PRO_UID, $sProUid ); $oCriteria->add( ConfigurationPeer::CFG_UID, 'TAS_EXTRA_PROPERTIES' ); $oCriteria->addJoin( ConfigurationPeer::OBJ_UID, TaskPeer::TAS_UID ); $oDataset = ConfigurationPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { if ($oConfig->exists($aRow['CFG_UID'], $aRow['OBJ_UID'], $aRow['PRO_UID'], $aRow['USR_UID'], $aRow['APP_UID'])) { $oConfig->remove( $aRow['CFG_UID'], $aRow['OBJ_UID'], $aRow['PRO_UID'], $aRow['USR_UID'], $aRow['APP_UID'] ); } $oDataset->next(); } return true; } catch (Exception $oError) { throw ($oError); } }
list($iRelation, $sUserGroup) = explode('|', $sValue['GROUP_USER']); $sObjectUID = ''; switch ($sValue['OP_OBJ_TYPE']) { case 'ANY': /*case 'ANY_DYNAFORM': case 'ANY_INPUT': case 'ANY_OUTPUT':*/ $sObjectUID = ''; break; case 'DYNAFORM': $sObjectUID = $sValue['DYNAFORMS']; break; case 'INPUT': $sObjectUID = $sValue['INPUTS']; break; case 'OUTPUT': $sObjectUID = $sValue['OUTPUTS']; break; } require_once 'classes/model/ObjectPermission.php'; $oOP = new ObjectPermission(); $aData = array('OP_UID' => G::generateUniqueID(), 'PRO_UID' => $sValue['PRO_UID'], 'TAS_UID' => $sValue['TAS_UID'], 'USR_UID' => (string) $sUserGroup, 'OP_USER_RELATION' => $iRelation, 'OP_TASK_SOURCE' => $sValue['OP_TASK_SOURCE'], 'OP_PARTICIPATE' => $sValue['OP_PARTICIPATE'], 'OP_OBJ_TYPE' => $sValue['OP_OBJ_TYPE'], 'OP_OBJ_UID' => $sObjectUID, 'OP_ACTION' => $sValue['OP_ACTION'], 'OP_CASE_STATUS' => $sValue['OP_CASE_STATUS']); $oOP->fromArray($aData, BasePeer::TYPE_FIELDNAME); $oOP->save(); G::LoadClass('processMap'); $oProcessMap = new ProcessMap(); $oProcessMap->getObjectsPermissionsCriteria($sValue['PRO_UID']); $infoProcess = new Processes(); $resultProcess = $infoProcess->getProcessRow($sValue['PRO_UID']); $participation = $sValue['OP_PARTICIPATE'] == 1 ? "YES" : "NO"; G::auditLog('ProcessPermissions', 'Add Permission (group or user: '******'|', $sValue['GROUP_USER'])) . ', permission: ' . $sValue['OP_ACTION'] . ', status case: ' . $sValue['OP_CASE_STATUS'] . ', type: ' . $sValue['OP_OBJ_TYPE'] . ', participation required: ' . $participation . ') in Process "' . $resultProcess['PRO_TITLE'] . '"');
G::header('location: ../login/login'); die; break; case -1: G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::header('location: ../login/login'); die; break; } require_once 'classes/model/OutputDocument.php'; require_once 'classes/model/ObjectPermission.php'; require_once 'classes/model/Step.php'; G::LoadClass('processMap'); $oOutputDocument = new OutputDocument(); $fields = $oOutputDocument->load($_POST['OUT_DOC_UID']); $oOutputDocument->remove($_POST['OUT_DOC_UID']); $oStep = new Step(); $oStep->removeStep('OUTPUT_DOCUMENT', $_POST['OUT_DOC_UID']); $oOP = new ObjectPermission(); $oOP->removeByObject('OUTPUT', $_POST['OUT_DOC_UID']); //refresh dbarray with the last change in outputDocument $oMap = new processMap(); $oCriteria = $oMap->getOutputDocumentsCriteria($fields['PRO_UID']); $result->success = true; $result->msg = G::LoadTranslation('ID_OUTPUTDOCUMENT_REMOVED'); } catch (Exception $e) { $result->success = false; $result->msg = $e->getMessage(); //die($oException->getMessage()); } print G::json_encode($result);
break; case 'removeDynaform': try { if (!isset($_POST['DYN_UID'])) { throw new Exception('DYN_UID was not set!'); } $DYN_UIDS = explode(',', $_POST['DYN_UID']); foreach ($DYN_UIDS as $i => $DYN_UID) { $dynaform = new dynaform(); //in table dynaform $dynaform->remove($DYN_UID); //in table Step $oStep = new Step(); $oStep->removeStep('DYNAFORM', $DYN_UID); //in table ObjectPermission $oOP = new ObjectPermission(); $oOP->removeByObject('DYNAFORM', $DYN_UID); //in table Step_supervisor $oSS = new StepSupervisor(); $oSS->removeByObject('DYNAFORM', $DYN_UID); //in table case_tracker_object $oCTO = new CaseTrackerObject(); $oCTO->removeByObject('DYNAFORM', $DYN_UID); } $result->success = true; $result->msg = G::LoadTranslation('ID_DYNAFORM_REMOVED'); } catch (Exception $e) { $result->success = false; $result->msg = $e->getMessage(); } print G::json_encode($result);
/** * Delete DynaForm * * @param string $dynaFormUid Unique id of DynaForm * * return void */ public function delete($dynaFormUid) { try { //Verify data $this->throwExceptionIfNotExistsDynaForm($dynaFormUid, "", $this->arrayFieldNameForException["dynaFormUid"]); //Load DynaForm $dynaForm = new \Dynaform(); $arrayDynaFormData = $dynaForm->Load($dynaFormUid); $processUid = $arrayDynaFormData["PRO_UID"]; //Verify dependences dynaforms $resultDepends = $this->dynaFormDepends($dynaFormUid, $processUid); if ($resultDepends != "") { throw new \Exception($resultDepends); } //Delete //In table DYNAFORM $result = $dynaForm->remove($dynaFormUid); //In table STEP $step = new \Step(); $step->removeStep("DYNAFORM", $dynaFormUid); //In table OBJECT_PERMISSION $objPermission = new \ObjectPermission(); $objPermission->removeByObject("DYNAFORM", $dynaFormUid); //In table STEP_SUPERVISOR $stepSupervisor = new \StepSupervisor(); $stepSupervisor->removeByObject("DYNAFORM", $dynaFormUid); //In table CASE_TRACKER_OBJECT $caseTrackerObject = new \CaseTrackerObject(); $caseTrackerObject->removeByObject("DYNAFORM", $dynaFormUid); } catch (\Exception $e) { throw $e; } }
/** * Validates all modified columns of given ObjectPermission object. * If parameter $columns is either a single column name or an array of column names * than only those columns are validated. * * NOTICE: This does not apply to primary or foreign keys for now. * * @param ObjectPermission $obj The object to validate. * @param mixed $cols Column name or array of column names. * * @return mixed TRUE if all columns are valid or the error message of the first invalid column. */ public static function doValidate(ObjectPermission $obj, $cols = null) { $columns = array(); if ($cols) { $dbMap = Propel::getDatabaseMap(ObjectPermissionPeer::DATABASE_NAME); $tableMap = $dbMap->getTable(ObjectPermissionPeer::TABLE_NAME); if (!is_array($cols)) { $cols = array($cols); } foreach ($cols as $colName) { if ($tableMap->containsColumn($colName)) { $get = 'get' . $tableMap->getColumn($colName)->getPhpName(); $columns[$colName] = $obj->{$get}(); } } } else { if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_UID)) { $columns[ObjectPermissionPeer::OP_UID] = $obj->getOpUid(); } if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::PRO_UID)) { $columns[ObjectPermissionPeer::PRO_UID] = $obj->getProUid(); } if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::TAS_UID)) { $columns[ObjectPermissionPeer::TAS_UID] = $obj->getTasUid(); } if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::USR_UID)) { $columns[ObjectPermissionPeer::USR_UID] = $obj->getUsrUid(); } if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_USER_RELATION)) { $columns[ObjectPermissionPeer::OP_USER_RELATION] = $obj->getOpUserRelation(); } if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_TASK_SOURCE)) { $columns[ObjectPermissionPeer::OP_TASK_SOURCE] = $obj->getOpTaskSource(); } if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_PARTICIPATE)) { $columns[ObjectPermissionPeer::OP_PARTICIPATE] = $obj->getOpParticipate(); } if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_OBJ_TYPE)) { $columns[ObjectPermissionPeer::OP_OBJ_TYPE] = $obj->getOpObjType(); } if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_OBJ_UID)) { $columns[ObjectPermissionPeer::OP_OBJ_UID] = $obj->getOpObjUid(); } if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_ACTION)) { $columns[ObjectPermissionPeer::OP_ACTION] = $obj->getOpAction(); } } return BasePeer::doValidate(ObjectPermissionPeer::DATABASE_NAME, ObjectPermissionPeer::TABLE_NAME, $columns); }
/** * Validate Process Permission Uid * @var string $op_uid. Uid for process permission * * @author Brayan Pereyra (Cochalo) <*****@*****.**> * @copyright Colosa - Bolivia * * @return string */ public function validateOpUid($op_uid) { $op_uid = trim($op_uid); if ($op_uid == '') { throw new \Exception(\G::LoadTranslation("ID_PROCESS_PERMISSION_NOT_EXIST", array('op_uid', ''))); } $oObjectPermission = new \ObjectPermission(); if (!$oObjectPermission->Exists($op_uid)) { throw new \Exception(\G::LoadTranslation("ID_PROCESS_PERMISSION_NOT_EXIST", array('op_uid', $op_uid))); } return $op_uid; }
} if (isset($_POST['form'])) { $sValue = $_POST['form']; } else { $sValue = $_POST; } //For new processmap EXtjs list($iRelation, $sUserGroup) = explode('|', $sValue['GROUP_USER']); $sObjectUID = ''; switch ($sValue['OP_OBJ_TYPE']) { case 'ANY': $sObjectUID = ''; break; case 'DYNAFORM': $sObjectUID = $sValue['DYNAFORMS']; break; case 'INPUT': $sObjectUID = $sValue['INPUTS']; break; case 'OUTPUT': $sObjectUID = $sValue['OUTPUTS']; break; } require_once 'classes/model/ObjectPermission.php'; $oOP = new ObjectPermission(); $aData = array('OP_UID' => $sValue['OP_UID'], 'PRO_UID' => $sValue['PRO_UID'], 'TAS_UID' => $sValue['TAS_UID'] != '' ? $sValue['TAS_UID'] : '0', 'USR_UID' => (string) $sUserGroup, 'OP_USER_RELATION' => $iRelation, 'OP_TASK_SOURCE' => $sValue['OP_TASK_SOURCE'] != '' ? $sValue['OP_TASK_SOURCE'] : '0', 'OP_PARTICIPATE' => $sValue['OP_PARTICIPATE'] != '' ? $sValue['OP_PARTICIPATE'] : 0, 'OP_OBJ_TYPE' => $sValue['OP_OBJ_TYPE'] != '' ? $sValue['OP_OBJ_TYPE'] : '0', 'OP_OBJ_UID' => $sObjectUID != '' ? $sObjectUID : '0', 'OP_ACTION' => $sValue['OP_ACTION'] != '' ? $sValue['OP_ACTION'] : '0', 'OP_CASE_STATUS' => $sValue['OP_CASE_STATUS'] != '' ? $sValue['OP_CASE_STATUS'] : '0'); $oObj = new ObjectPermission(); $oObj->update($aData); G::LoadClass('processMap'); $oProcessMap = new ProcessMap(); $oProcessMap->getObjectsPermissionsCriteria($sValue['PRO_UID']);
/** * Delete a output document of a project * * @param string $sProcessUID * @param string $sOutputDocumentUID * * @access public */ public function deleteOutputDocument($sProcessUID, $sOutputDocumentUID) { try { require_once PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "OutputDocument.php"; require_once PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "ObjectPermission.php"; require_once PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Step.php"; $this->throwExceptionIfItsAssignedInOtherObjects($sOutputDocumentUID, "outputDocumentUid"); \G::LoadClass('processMap'); $oOutputDocument = new \OutputDocument(); $fields = $oOutputDocument->load($sOutputDocumentUID); $oOutputDocument->remove($sOutputDocumentUID); $oStep = new \Step(); $oStep->removeStep('OUTPUT_DOCUMENT', $sOutputDocumentUID); $oOP = new \ObjectPermission(); $oOP->removeByObject('OUTPUT', $sOutputDocumentUID); //refresh dbarray with the last change in outputDocument $oMap = new \processMap(); $oCriteria = $oMap->getOutputDocumentsCriteria($fields['PRO_UID']); } catch (\Exception $e) { throw $e; } }