/** * Remove the row * * @param array $aData or string $ProUid * @return string * */ public function remove($ProUid) { if (is_array($ProUid)) { $ProUid = isset($ProUid['DEP_UID']) ? $ProUid['DEP_UID'] : ''; } try { $oCriteria = new Criteria('workflow'); $oCriteria->addSelectColumn(UsersPeer::USR_UID); $oCriteria->add(UsersPeer::DEP_UID, $ProUid, Criteria::EQUAL); $oDataset = UsersPeer::doSelectRS($oCriteria); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next(); $aFields = array(); while ($aRow = $oDataset->getRow()) { $aFields['USR_UID'] = $aRow['USR_UID']; $aFields['DEP_UID'] = ''; $oDepto = UsersPeer::retrieveByPk($aFields['USR_UID']); if (is_object($oDepto) && get_class($oDepto) == 'UsersPeer') { return true; } else { $oDepto = new Users(); $oDepto->update($aFields); } $oDataset->next(); } $oPro = DepartmentPeer::retrieveByPK($ProUid); if (!is_null($oPro)) { $dptoTitle = $this->Load($oPro->getDepUid()); Content::removeContent('DEPO_TITLE', '', $oPro->getDepUid()); Content::removeContent('DEPO_DESCRIPTION', '', $oPro->getDepUid()); G::auditLog("DeleteDepartament", "Departament Name: " . $dptoTitle['DEPO_TITLE'] . " Departament ID: (" . $oPro->getDepUid() . ") "); return $oPro->delete(); } else { throw new Exception("The row '{$ProUid}' in table Group doesn't exist!"); } } catch (Exception $oError) { throw $oError; } }
function removeRole($ROL_UID) { $con = Propel::getConnection(RolesPeer::DATABASE_NAME); try { $con->begin(); $this->setRolUid($ROL_UID); $rol_name = $this->load($ROL_UID); Content::removeContent('ROL_NAME', '', $this->getRolUid()); $result = $this->delete(); $con->commit(); G::auditLog("DeleteRole", "Role Name: " . $rol_name['ROL_NAME'] . " Role UID: (" . $ROL_UID . ") "); return $result; } catch (exception $e) { $con->rollback(); throw $e; } }
public function remove($TriUid) { $con = Propel::getConnection(TriggersPeer::DATABASE_NAME); try { $result = false; $con->begin(); $oTri = TriggersPeer::retrieveByPK($TriUid); if (!is_null($oTri)) { Content::removeContent("TRI_TITLE", "", $TriUid); Content::removeContent("TRI_DESCRIPTION", "", $TriUid); $result = $oTri->delete(); $con->commit(); //Add Audit Log G::auditLog("DeleteTrigger", "Trigger Name: " . $oTri->getTriTitle() . ", Trigger Uid: " . $TriUid . ", Description: " . $oTri->getTriDescription()); } return $result; } catch (Exception $e) { $con->rollback(); throw $e; } }
/** * Delete DataBaseConnection * @var string $pro_uid. Uid for Process * @var string $dbs_uid. Uid for DataBase Connection * * @author Brayan Pereyra (Cochalo) <*****@*****.**> * @copyright Colosa - Bolivia * * @return void */ public function deleteDataBaseConnection($pro_uid, $dbs_uid) { $pro_uid = $this->validateProUid($pro_uid); $dbs_uid = $this->validateDbsUid($dbs_uid, $pro_uid); $oDBSource = new DbSource(); $oContent = new \Content(); $oDBSource->remove($dbs_uid, $pro_uid); $oContent->removeContent('DBS_DESCRIPTION', "", $dbs_uid); }
if (strpos($_POST['server'], "\\")) { $_POST['port'] = 'none'; } $aData = array('PRO_UID' => $_SESSION['PROCESS'], 'DBS_TYPE' => $_POST['type'], 'DBS_SERVER' => $_POST['server'], 'DBS_DATABASE_NAME' => $_POST['db_name'], 'DBS_USERNAME' => $_POST['user'], 'DBS_PASSWORD' => ($_POST['passwd'] == 'none' ? "" : G::encrypt($_POST['passwd'], $_POST['db_name'])) . "_2NnV3ujj3w", 'DBS_PORT' => $_POST['port'] == 'none' ? "" : $_POST['port'], 'DBS_ENCODE' => $_POST['enc']); $newid = $oDBSource->create($aData); $sDelimiter = DBAdapter::getStringDelimiter(); $oContent->addContent('DBS_DESCRIPTION', '', $newid, SYS_LANG, $_POST['desc']); break; case 'deleteDbConnection': try { $oDBSource = new DbSource(); $oContent = new Content(); $DBS_UID = $_POST['dbs_uid']; $PRO_UID = $_SESSION['PROCESS']; $oDBSource->remove($DBS_UID, $PRO_UID); $oContent->removeContent('DBS_DESCRIPTION', "", $DBS_UID); $result->success = true; $result->msg = G::LoadTranslation('ID_DBCONNECTION_REMOVED'); } catch (Exception $e) { $result->success = false; $result->msg = $e->getMessage(); } print G::json_encode($result); break; case 'showTestConnection': $G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent('view', 'dbConnections/dbConnections'); G::RenderPage('publish', 'raw'); break; case 'testConnection': sleep(0);
public function remove($StgUid) { $con = Propel::getConnection(StagePeer::DATABASE_NAME); try { $con->begin(); $oStage = StagePeer::retrieveByPK($StgUid); if (!is_null($oStage)) { Content::removeContent('STG_TITLE', '', $this->getStgUid()); $result = $oStage->delete(); $con->commit(); } return $result; } catch (Exception $e) { $con->rollback(); throw $e; } }
$t = new lime_test(12, new lime_output_color()); $t->diag('class Content'); $t->isa_ok($obj, 'Content', 'class Content created'); $t->todo('review all combinations of is_utf8 '); $t->todo('review is_utf8 should be in another class'); //Initialize the global domain (It is optional) $testDomain = new ymlDomain(); $test = new ContentTest('content.yml', $t, $testDomain); //check if an row exists, $test->load('loadContent'); $test->runSingle(); //check if an row exists, $test->load('deleteContent'); $test->runAll(); $test->load('addContentAcentos'); $test->runSingle(); //add the same row twice, the first time goes good, but the second the class throw an error $test->load('addContent1'); $test->runSingle(); $test->load('addContentTwice'); $test->runSingle(); $test->load('loadContent'); $test->runSingle(); $obj = new Content(); $res = $obj->addContent('1', '2', '3', 'en', 'language1'); $res = $obj->addContent('1', '2', '3', 'es', 'language2'); $res = $obj->addContent('1', '2', '3', 'pt', 'language3'); $res = $obj->addContent('1', '2', '3', 'fr', 'language4'); $res = $obj->addContent('1', '2', '3', 'it', 'language5'); $res = $obj->removeContent('1', '2', '3'); //$t->can_ok( $res, 'getAppTitle', 'removeContent.' );
/** * Create DB Connections rows from an array of data * * @param array $aConnections * @return void */ public function createDBConnectionsRows ($aConnections) { foreach ($aConnections as $sKey => $aRow) { $oConnection = new DbSource(); if ($oConnection->Exists( $aRow['DBS_UID'], $aRow['PRO_UID'] )) { $oConnection->remove( $aRow['DBS_UID'], $aRow['PRO_UID'] ); } $oConnection->create( $aRow ); // Update information in the table of contents $oContent = new Content(); $ConCategory = 'DBS_DESCRIPTION'; $ConParent = ''; $ConId = $aRow['DBS_UID']; $ConLang = SYS_LANG; if ($oContent->Exists( $ConCategory, $ConParent, $ConId, $ConLang )) { $oContent->removeContent( $ConCategory, $ConParent, $ConId ); } $oContent->addContent( $ConCategory, $ConParent, $ConId, $ConLang, $aRow['DBS_DESCRIPTION'] ); } } #@!neyek
/** * Remove the application document registry * * @param array $aData * @return string * */ public function remove($sInpDocUid) { $oConnection = Propel::getConnection(InputDocumentPeer::DATABASE_NAME); try { $oInputDocument = InputDocumentPeer::retrieveByPK($sInpDocUid); if (!is_null($oInputDocument)) { $nameInput = $this->getInpDocTitle(); $descInput = $this->getInpDocDescription(); $oConnection->begin(); Content::removeContent('INP_DOC_TITLE', '', $oInputDocument->getInpDocUid()); Content::removeContent('INP_DOC_DESCRIPTION', '', $oInputDocument->getInpDocUid()); $iResult = $oInputDocument->delete(); $oConnection->commit(); //Add Audit Log $nameInput = $this->getInpDocTitle(); $descInput = $this->getInpDocDescription(); G::auditLog("DeleteInputDocument", "Input Document Name: " . $nameInput . ", Input Document Uid: " . $sInpDocUid . ", Description: " . $descInput); return $iResult; } else { throw new Exception('This row doesn\'t exist!'); } } catch (Exception $oError) { $oConnection->rollback(); throw $oError; } }
/** * Remove the Prolication document registry * * @param array $aData or string $ProUid * @return string * */ public function remove ($ProUid) { if (is_array( $ProUid )) { $ProUid = (isset( $ProUid['DYN_UID'] ) ? $ProUid['DYN_UID'] : ''); } try { $oPro = DynaformPeer::retrieveByPK( $ProUid ); if (! is_null( $oPro )) { $title = $oPro->getDynTitle(); $type = $oPro->getDynType(); $description = $oPro->getDynDescription(); Content::removeContent( 'DYN_TITLE', '', $oPro->getDynUid() ); Content::removeContent( 'DYN_DESCRIPTION', '', $oPro->getDynUid() ); $iResult = $oPro->delete(); //Add Audit Log G::auditLog("DeleteDynaform", "Dynaform Title: ".$title.", Type: ".$type.", Description: ".$description); if (file_exists( PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '.xml' )) { unlink( PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '.xml' ); } if (file_exists( PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '_tmp0.xml' )) { unlink( PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '_tmp0.xml' ); } if (file_exists( PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '.html' )) { unlink( PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '.html' ); } if (file_exists( PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '_tmp0.html' )) { unlink( PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '_tmp0.html' ); } return $iResult; } else { throw (new Exception( "The row '$ProUid' in table Dynaform doesn't exist!" )); } } catch (Exception $oError) { throw ($oError); } }
/** * Remove the Prolication document registry * * @param array $aData or string $ProUid * @return string * */ public function remove($ProUid) { if (is_array($ProUid)) { $ProUid = isset($ProUid['GRP_UID']) ? $ProUid['GRP_UID'] : ''; } try { $oPro = GroupwfPeer::retrieveByPK($ProUid); if (!is_null($oPro)) { Content::removeContent('GRP_TITLE', '', $oPro->getGrpUid()); Content::removeContent('GRP_DESCRIPTION', '', $oPro->getGrpUid()); return $oPro->delete(); } else { throw new Exception("The row '{$ProUid}' in table Group doesn't exist!"); } } catch (Exception $oError) { throw $oError; } }
public function remove($TasUid) { $oConnection = Propel::getConnection(TaskPeer::DATABASE_NAME); try { $oTask = TaskPeer::retrieveByPK($TasUid); if (!is_null($oTask)) { $oConnection->begin(); Content::removeContent('TAS_TITLE', '', $oTask->getTasUid()); Content::removeContent('TAS_DESCRIPTION', '', $oTask->getTasUid()); Content::removeContent('TAS_DEF_TITLE', '', $oTask->getTasUid()); Content::removeContent('TAS_DEF_DESCRIPTION', '', $oTask->getTasUid()); Content::removeContent('TAS_DEF_PROC_CODE', '', $oTask->getTasUid()); Content::removeContent('TAS_DEF_MESSAGE', '', $oTask->getTasUid()); Content::removeContent('TAS_DEF_SUBJECT_MESSAGE', '', $oTask->getTasUid()); $iResult = $oTask->delete(); $oConnection->commit(); return $iResult; } else { throw new Exception("The row '" . $TasUid . "' in table TASK doesn't exist!"); } } catch (Exception $oError) { $oConnection->rollback(); throw $oError; } }
/** * Remove the application document registry * @param array $aData * @return string * */ public function remove($sOutDocUid) { $oConnection = Propel::getConnection(OutputDocumentPeer::DATABASE_NAME); try { $oOutputDocument = OutputDocumentPeer::retrieveByPK($sOutDocUid); if (!is_null($oOutputDocument)) { $oConnection->begin(); Content::removeContent('OUT_DOC_TITLE', '', $oOutputDocument->getOutDocUid()); Content::removeContent('OUT_DOC_DESCRIPTION', '', $oOutputDocument->getOutDocUid()); Content::removeContent('OUT_DOC_FILENAME', '', $oOutputDocument->getOutDocUid()); Content::removeContent('OUT_DOC_TEMPLATE', '', $oOutputDocument->getOutDocUid()); $iResult = $oOutputDocument->delete(); $oConnection->commit(); //Add Audit Log G::auditLog("DeleteOutputDocument", "Output Document Name: " . $oOutputDocument->getOutDocTitle() . ", Output Document Uid: " . $sOutDocUid . ", Description: " . $oOutputDocument->getOutDocDescription() . ", Filename generated: " . $oOutputDocument->getOutDocFilename()); //Return return $iResult; } else { throw (new Exception('This row doesn\'t exist!')); } } catch (Exception $oError) { $oConnection->rollback(); throw ($oError); } }
function remove($sUID) { $oConnection = Propel::getConnection(EventPeer::DATABASE_NAME); try { $oEvent = EventPeer::retrieveByPK($sUID); if (!is_null($oEvent)) { /* with the new feature for events, a event can to relate a existing trigger or more of one events can be reusing the same trigger so, in this point we should't to delete the trigger $oConnection->begin(); $oTrigger = new Triggers(); $oAppEvent = new AppEvent(); $oCriteria = new Criteria('workflow'); $oCriteria->clearSelectColumns(); $oCriteria->addSelectColumn( AppEventPeer::EVN_UID ); $oCriteria->addSelectColumn( EventPeer::TRI_UID ); $oCriteria->addSelectColumn( AppEventPeer::APP_UID ); $oCriteria->addSelectColumn( AppEventPeer::DEL_INDEX ); $oCriteria->add(AppEventPeer::EVN_UID, $sUID ); $oCriteria->addJoin(EventPeer::EVN_UID, AppEventPeer::EVN_UID, Criteria::JOIN); $oDataset = AppEventPeer::doSelectRs($oCriteria); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next(); while ($row = $oDataset->getRow()) { $oTrigger->remove($row['TRI_UID']); $oAppEvent->remove( $row['APP_UID'], $row['DEL_INDEX'], $sUID ); $oDataset->next(); }*/ Content::removeContent('EVN_DESCRIPTION', '', $oEvent->getEvnUid()); $iResult = $oEvent->delete(); $oConnection->commit(); return $iResult; } else { throw new Exception('This row doesn\'t exist!'); } } catch (Exception $oError) { $oConnection->rollback(); throw $oError; } }
/** * Delete Web Entry * * @param string $webEntryUid Unique id of Web Entry * * return void */ public function delete($webEntryUid) { try { //Verify data $this->throwExceptionIfNotExistsWebEntry($webEntryUid, $this->arrayFieldNameForException["webEntryUid"]); //Set variables $arrayWebEntryData = $this->getWebEntry($webEntryUid, true); //Delete content \Content::removeContent("WE_TITLE", "", $webEntryUid); \Content::removeContent("WE_DESCRIPTION", "", $webEntryUid); //Delete web entry $criteria = new \Criteria("workflow"); $criteria->add(\WebEntryPeer::WE_UID, $webEntryUid); $result = \WebEntryPeer::doDelete($criteria); //Delete files if ($arrayWebEntryData["WE_METHOD"] == "WS") { $pathDataPublicProcess = PATH_DATA_PUBLIC . $arrayWebEntryData["PRO_UID"]; $fileName = str_replace(".php", "", trim($arrayWebEntryData["WE_DATA"])); $file = $pathDataPublicProcess . PATH_SEP . $fileName . ".php"; if (is_file($file) && file_exists($file)) { unlink($file); unlink($pathDataPublicProcess . PATH_SEP . $fileName . "Post.php"); } } } catch (\Exception $e) { throw $e; } }
public function remove($RepTabUid) { $con = Propel::getConnection(ReportTablePeer::DATABASE_NAME); try { $con->begin(); $oRepTab = ReportTablePeer::retrieveByPK($RepTabUid); if (!is_null($oRepTab)) { Content::removeContent('REP_TAB_TITLE', '', $this->getRepTabUid()); $result = $oRepTab->delete(); $con->commit(); } return $result; } catch (Exception $e) { $con->rollback(); throw $e; } }
function removeRole($ROL_UID) { $con = Propel::getConnection(RolesPeer::DATABASE_NAME); try { $con->begin(); $this->setRolUid($ROL_UID); Content::removeContent('ROL_NAME', '', $this->getRolUid()); $result = $this->delete(); $con->commit(); return $result; } catch (exception $e) { $con->rollback(); throw $e; } }
/** * Remove the Prolication document registry * * @param array $aData or string $ProUid * @return string * */ public function remove($ProUid) { if (is_array($ProUid)) { $ProUid = isset($ProUid['PRO_UID']) ? $ProUid['PRO_UID'] : ''; } try { $oPro = ProcessPeer::retrieveByPK($ProUid); if (!is_null($oPro)) { Content::removeContent('PRO_TITLE', '', $oPro->getProUid()); Content::removeContent('PRO_DESCRIPTION', '', $oPro->getProUid()); $this->memcachedDelete(); return $oPro->delete(); } else { throw new Exception("The row '{$ProUid}' in table Process doesn't exist!"); } } catch (Exception $oError) { throw $oError; } }
/** * Remove the application document registry * @param array $aData or string $appUid * @return string **/ public function remove($appUid) { if (is_array($appUid)) { $appUid = isset($appUid['APP_UID']) ? $appUid['APP_UID'] : ''; } try { $oApp = ApplicationPeer::retrieveByPK($appUid); if (!is_null($oApp)) { Content::removeContent('APP_TITLE', '', $oApp->getAppUid()); Content::removeContent('APP_DESCRIPTION', '', $oApp->getAppUid()); //Content::removeContent('APP_PROC_CODE', '', $oApp->getAppUid()); return $oApp->delete(); } else { throw new Exception("The row '{$appUid}' in table Application doesn't exist!"); } } catch (Exception $oError) { throw $oError; } }
/** * Remove the application document registry * @param array $aData * @return string * */ public function remove($sOutDocUid) { $oConnection = Propel::getConnection(OutputDocumentPeer::DATABASE_NAME); try { $oOutputDocument = OutputDocumentPeer::retrieveByPK($sOutDocUid); if (!is_null($oOutputDocument)) { $oConnection->begin(); Content::removeContent('OUT_DOC_TITLE', '', $oOutputDocument->getOutDocUid()); Content::removeContent('OUT_DOC_DESCRIPTION', '', $oOutputDocument->getOutDocUid()); Content::removeContent('OUT_DOC_FILENAME', '', $oOutputDocument->getOutDocUid()); Content::removeContent('OUT_DOC_TEMPLATE', '', $oOutputDocument->getOutDocUid()); $iResult = $oOutputDocument->delete(); $oConnection->commit(); return $iResult; } else { throw new Exception('This row doesn\'t exist!'); } } catch (Exception $oError) { $oConnection->rollback(); throw $oError; } }
public function remove($TriUid) { $con = Propel::getConnection(TriggersPeer::DATABASE_NAME); try { $result = false; $con->begin(); $oTri = TriggersPeer::retrieveByPK($TriUid); if (!is_null($oTri)) { Content::removeContent('TRI_TITLE', '', $this->getTriUid()); Content::removeContent('TRI_DESCRIPTION', '', $this->getTriUid()); $result = $oTri->delete(); $con->commit(); } return $result; } catch (Exception $e) { $con->rollback(); throw $e; } }
/** * Remove the Prolication document registry * * @param array $aData or string $ProUid * @return string * */ public function remove($ProUid) { if (is_array($ProUid)) { $ProUid = isset($ProUid['DYN_UID']) ? $ProUid['DYN_UID'] : ''; } try { $oPro = DynaformPeer::retrieveByPK($ProUid); if (!is_null($oPro)) { Content::removeContent('DYN_TITLE', '', $oPro->getDynUid()); Content::removeContent('DYN_DESCRIPTION', '', $oPro->getDynUid()); $iResult = $oPro->delete(); if (file_exists(PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '.xml')) { unlink(PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '.xml'); } if (file_exists(PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '_tmp0.xml')) { unlink(PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '_tmp0.xml'); } if (file_exists(PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '.html')) { unlink(PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '.html'); } if (file_exists(PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '_tmp0.html')) { unlink(PATH_DYNAFORM . $oPro->getProUid() . PATH_SEP . $oPro->getDynUid() . '_tmp0.html'); } return $iResult; } else { throw new Exception("The row '{$ProUid}' in table Dynaform doesn't exist!"); } } catch (Exception $oError) { throw $oError; } }
/** * Remove the application document registry * @param array $aData * @return string **/ public function remove($sSwiEleUid) { $oConnection = Propel::getConnection(SwimlanesElementsPeer::DATABASE_NAME); try { $oSwimlanesElements = SwimlanesElementsPeer::retrieveByPK($sSwiEleUid); if (!is_null($oSwimlanesElements)) { $oConnection->begin(); Content::removeContent('SWI_TEXT', '', $oSwimlanesElements->getSwiUid()); $iResult = $oSwimlanesElements->delete(); $oConnection->commit(); return $iResult; } else { throw new Exception('This row doesn\'t exist!'); } } catch (Exception $oError) { $oConnection->rollback(); throw $oError; } }