} } //replacing the processOwner user for the current user $oData->process['PRO_CREATE_USER'] = $_SESSION['USER_LOGGED']; //!respect of the groups if ($result->ExistProcessInDatabase == 0 && $result->ExistGroupsInDatabase == 0) { if ($processFileType == "pm") { $oProcess->createProcessFromData($oData, $path . $filename); } } //!data ouput $result->sNewProUid = $sProUid; $result->proFileName = $Fields['PRO_FILENAME']; //Add Audit Log $process = new Process(); if ($process->processExists($sProUid)) { $arrayProcessData = $process->load($oData->process["PRO_UID"]); G::auditLog("ImportProcess", "PM File Imported " . $arrayProcessData["PRO_TITLE"] . " (" . $arrayProcessData["PRO_UID"] . ")"); } } catch (Exception $e) { $result->response = $e->getMessage(); $result->catchMessage = $e->getMessage(); $result->success = true; } } if ($action == "uploadFileNewProcessExist") { try { $option = $_REQUEST["IMPORT_OPTION"]; $filename = $_REQUEST["PRO_FILENAME"]; $processFileType = $_REQUEST["processFileType"]; $result->ExistGroupsInDatabase = "";
/** * Update a Process register in DB, if the process doesn't exist with the same * uid of the $row['PRO_UID'] parameter the function creates a new one based * on the $row parameter data. * * @param $row array parameter with the process data * @return $oProcess Process object */ public function updateProcessRow ($row) { $oProcess = new Process(); if ($oProcess->processExists( $row['PRO_UID'] )) { $oProcess->update( $row ); } else { $oProcess->create( $row ); } }
/** * Validate Process Uid * @var string $pro_uid. Uid for process * * @author Brayan Pereyra (Cochalo) <*****@*****.**> * @copyright Colosa - Bolivia * * @return string */ public function validateProUid($pro_uid) { $pro_uid = trim($pro_uid); if ($pro_uid == '') { throw new \Exception(\G::LoadTranslation("ID_PROJECT_NOT_EXIST", array('prj_uid', ''))); } $oProcess = new \Process(); if (!$oProcess->processExists($pro_uid)) { throw new \Exception(\G::LoadTranslation("ID_PROJECT_NOT_EXIST", array('prj_uid', $pro_uid))); } return $pro_uid; }