/** * Add raw step * @param string $name * @param callable $executer * @param integer $units * @return StepCollection */ public function add($name, callable $executer, $units = 1) { $step = new Step($name); $step->setExecuter($executer)->setUnits($units); $this->addStep($step); return $this; }
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'); }
/** * Test getters */ public function testGets() { $node = $this->getMock('Choccybiccy\\Pathfinder\\NodeInterface'); $parent = new Step($node, null); $step = new Step($node, $parent); $this->assertEquals($node, $parent->getNode()); $this->assertEquals($parent, $step->getParent()); }
/** * @param Step $step * @param bool $replaceExistingStep */ public function registerStep(Step $step, $replaceExistingStep = false) { $identifier = $step->getIdentifier(); if (preg_match(static::STEP_IDENTIFIER_PATTERN, $identifier) !== 1) { throw new \InvalidArgumentException(sprintf('The given step "%s" does not match the step identifier pattern %s.', $identifier, static::STEP_IDENTIFIER_PATTERN), 1437921283); } if ($replaceExistingStep === false && isset($this->steps[$identifier])) { throw new \InvalidArgumentException(sprintf('The given step "%s" was already registered and you did not set the "replaceExistingStep" flag.', $identifier), 1437921270); } $this->steps[$step->getIdentifier()]['step'] = $step; }
function test_save() { //Arrange $description = "Buy book on learning French"; $project_id = 1; $position = 1; $test_step = new Step($description, $project_id, $position); //Act $test_step->save(); //Assert $result = Step::getAll(); $this->assertEquals([$test_step], $result); }
/** * Class constructor * * @param Log $log */ public function __construct(Log $log) { parent::__construct($log); $this->args = ['name' => 'contact', 'title' => __('Contact', 'wp-easy-mode'), 'page_title' => __('Contact', 'wp-easy-mode'), 'can_skip' => true]; add_action('wpem_print_header_scripts_' . $this->args['name'], [$this, 'print_header_scripts']); add_action('wpem_print_footer_scripts_' . $this->args['name'], [$this, 'print_footer_scripts']); }
public function actionReorder($id) { $traveler = $this->loadModel($id); if (isset($_POST['position'])) { Step::model()->sortSteps($_POST['position']); exit("ok"); } $this->render('reorder', array('steps' => $traveler->getStepParent(), 'id' => $id)); }
/** * Implementation for 'POST' method for Rest API * * @param mixed $stepUid Primary key * * @return array $result Returns array within multiple records or a single record depending if * a single selection was requested passing id(s) as param */ protected function post($stepUid, $proUid, $tasUid, $stepTypeObj, $stepUidObj, $stepCondition, $stepPosition, $stepMode) { try { $result = array(); $obj = new Step(); $obj->setStepUid($stepUid); $obj->setProUid($proUid); $obj->setTasUid($tasUid); $obj->setStepTypeObj($stepTypeObj); $obj->setStepUidObj($stepUidObj); $obj->setStepCondition($stepCondition); $obj->setStepPosition($stepPosition); $obj->setStepMode($stepMode); $obj->save(); } catch (Exception $e) { throw new RestException(412, $e->getMessage()); } }
/** * Compares this object with the specified object for order. * Returns a negative integer, zero, or a positive integer * as this object is less than, equal to, or greater than the specified object. * * WARNING: this comparison assumes the rounds are in the same sequence. * This means that you CANNOT compare an ExitStep with a regular Step. * (I mean, you can, but you won't get meaningful results.) * * @param Round $round the round to compare to this one * @return int negative if this round comes before the given one; positive if it comes after; zero if they come at the same time (are the same) */ public function compareTo(Round $round) { $my_order = $this->step->order(); $their_order = $round->step->order(); if ($my_order == $their_order) { return $this->repetition - $round->repetition; } else { return $my_order - $their_order; } }
protected function loadStep($stepId) { //if the project property is null, create it based on input id if ($this->step === null) { $this->step = Step::model()->findbyPk($stepId); if ($this->step === null) { throw new CHttpException(404, 'The requested step does not exist.'); } } return $this->step; }
/** * Class constructor * * @param Log $log * @param Image_API $image_api */ public function __construct(Log $log, Image_API $image_api) { $this->image_api = $image_api; parent::__construct($log); $this->args = ['name' => 'theme', 'title' => __('Theme', 'wp-easy-mode'), 'page_title' => __('Choose a Theme', 'wp-easy-mode'), 'can_skip' => false]; add_action('wpem_print_footer_scripts_' . $this->args['name'], [$this, 'print_footer_scripts']); $pointer = new Pointer(); $pos = 1; $count = 2; if ('store' !== wpem_get_site_type()) { $count = 3; $pointer->register(['id' => 'wpem_theme_preview_1', 'target' => '#wpem-header-images-wrapper', 'cap' => 'manage_options', 'options' => ['content' => wp_kses_post(sprintf('<h3>%s</h3><p>%s</p>', sprintf(__('Step %1$s of %2$s', 'wp-easy-mode'), $pos++, $count), __('Choose a stylish header image for your website.', 'wp-easy-mode'))), 'position' => ['edge' => 'left', 'align' => 'right']], 'btn_primary' => __('Next', 'wp-easy-mode'), 'close_on_load' => true, 'next_pointer' => 'wpem_theme_preview_2']); } $pointer->register(['id' => 'wpem_theme_preview_2', 'target' => '.wp-full-overlay-header .next-theme', 'cap' => 'manage_options', 'options' => ['content' => wp_kses_post(sprintf('<h3>%s</h3><p>%s</p>', sprintf(__('Step %1$s of %2$s', 'wp-easy-mode'), $pos++, $count), __('Preview different website designs using the the left and right arrows.', 'wp-easy-mode'))), 'position' => ['at' => 'left bottom', 'my' => 'left-63 top']], 'btn_primary' => __('Next', 'wp-easy-mode'), 'close_on_load' => true, 'next_pointer' => 'wpem_theme_preview_3']); $pointer->register(['id' => 'wpem_theme_preview_3', 'target' => '.button-primary.theme-install', 'cap' => 'manage_options', 'options' => ['content' => wp_kses_post(sprintf('<h3>%s</h3><p>%s</p>', sprintf(__('Step %1$s of %2$s', 'wp-easy-mode'), $pos, $count), __("When you've found a design you like, click Select to install it.", 'wp-easy-mode'))), 'position' => ['at' => 'left bottom', 'my' => 'left-34 top+5']], 'btn_primary' => __('Close', 'wp-easy-mode'), 'btn_primary_close' => true, 'close_on_load' => true]); $pointer->register_scripts(); }
public function getFullById($id) { $db = \Qh\Db_lo::instance(); $getSteps = Step::findByExID($id); $arr = [':id' => $id]; $sql = 'SELECT * FROM ' . static::TABLE . ' WHERE id = :id'; try { $send2base = $db->queryObj($sql, static::class, $arr); if ([] !== $send2base) { $send2base[0]->ex_steps = $getSteps; return $send2base[0]; } else { return false; } } catch (\PDOException $exception) { throw new \App\Exceptions\Db($exception->getMessage()); } }
/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { throw new CHttpException(404, 'The requested page does not exist.'); $model = new File(); $issue = null; if (isset($_GET['discrepancyId'])) { $discrepancyId = $_GET['discrepancyId']; $discrepancy = Nonconformity::model()->findByPk($discrepancyId); $step = $discrepancy->step; $model->discrepancyId = $discrepancyId; $issue = Issue::model()->find("id = {$discrepancy->issueId}"); $dir = "discrepancy/"; } elseif (isset($_GET['stepId'])) { $stepId = $_GET['stepId']; $step = Step::model()->findByPk($stepId); $model->stepId = $stepId; $dir = "step/"; } else { throw new CHttpException(404, 'The requested page does not exist.'); } // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['File'])) { $model->attributes = $_POST['File']; $upload = CUploadedFile::getInstance($model, 'fileSelected'); $rnd = rand(0, 99999); if (@getimagesize($upload->tempName)) { $model->image = 1; } else { $model->image = 0; } $fileName = "{$rnd}-{$upload}"; $model->userId = Yii::app()->user->id; $model->fileSelected = $upload; $link = $dir . preg_replace("/[^a-zA-Z0-9\\/_|.-]/", "_", $fileName); if ($upload->saveAs(Yii::app()->params['dfs'] . "/{$link}")) { $model->link = $link; $model->save(); $this->redirect(array('index', 'discrepancyId' => $model->discrepancyId)); } } $this->render('create', array('model' => $model, 'step' => $step, 'issue' => $issue, 'discrepancyId' => $discrepancyId)); }
public function postCreate(Request $request) { $rules = ['title' => 'required', 'steps' => 'required|array', 'sourcecitations' => 'array']; // Steps rules // if ($request->has('steps')) { foreach ($request->get('steps') as $key => $val) { $rules['steps.' . $key . '.title'] = 'required'; $rules['steps.' . $key . '.image'] = 'required_without:steps.' . $key . '.video'; $rules['steps.' . $key . '.video'] = 'required_without:steps.' . $key . '.image'; $rules['steps.' . $key . '.content'] = 'required'; } } // Sources & Citation's rules // if ($request->has('sourcecitations')) { foreach ($request->get('sourcecitations') as $key => $val) { $rules['sourcecitations.' . $key . '.link'] = 'required'; $rules['sourcecitations.' . $key . '.text'] = 'required'; } } $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { flash($request)->error("Virheitä!"); return redirect()->to('guides/create')->withErrors($validator)->withInput(); } $guide = Guide::create($request->all()); if ($request->has('steps')) { foreach ($request->get('steps') as $index => $step) { Step::create(['guide_id' => $guide->id, 'step' => $index, 'title' => $step['title'], 'content' => $step['content'], 'image' => $step['image'], 'video' => $step['video']]); } } if ($request->has('sourcecitations')) { foreach ($request->get('sourcecitations') as $sourcecitation) { SourceCitation::create(['guide_id' => $guide->id, 'text' => $sourcecitation['text'], 'link' => $sourcecitation['link']]); } } // TODO Rest of the creation }
public function get() { $step = parent::get(); $step->plan = $this->plan; return $step; }
throw new Exception('dbconnections Fatal error, No action defined!...'); } if (isset($_POST['PROCESS'])) { $_SESSION['PROCESS'] = $_POST['PROCESS']; } #Global Definitions require_once 'classes/model/DbSource.php'; require_once 'classes/model/Content.php'; $G_PUBLISH = new Publisher(); G::LoadClass('processMap'); G::LoadClass('ArrayPeer'); G::LoadClass('dbConnections'); global $_DBArray; switch ($action) { case 'loadInfoAssigConnecctionDB': $oStep = new Step(); return print $oStep->loadInfoAssigConnecctionDB($_POST['PRO_UID'], $_POST['DBS_UID']); break; case 'showDbConnectionsList': $oProcess = new processMap(); $oCriteria = $oProcess->getConditionProcessList(); if (ProcessPeer::doCount($oCriteria) > 0) { $aProcesses = array(); $aProcesses[] = array('PRO_UID' => 'char', 'PRO_TITLE' => 'char'); $oDataset = ArrayBasePeer::doSelectRS($oCriteria); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next(); $sProcessUID = ''; while ($aRow = $oDataset->getRow()) { if ($sProcessUID == '') { $sProcessUID = $aRow['PRO_UID'];
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sPRO_UID . '/' . $dynTitle . '.php'; print $link; //print "\n<a href='$link' target='_new' > $link </a>"; } else { $G_FORM = new Form($sPRO_UID . '/' . $sDYNAFORM, PATH_DYNAFORM, SYS_LANG, false); $G_FORM->action = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/cases_StartExternal.php'; $scriptCode = ''; $scriptCode = $G_FORM->render(PATH_CORE . 'templates/' . 'xmlform' . '.html', $scriptCode); $scriptCode = str_replace('/controls/', $http . $_SERVER['HTTP_HOST'] . '/controls/', $scriptCode); $scriptCode = str_replace('/js/maborak/core/images/', $http . $_SERVER['HTTP_HOST'] . '/js/maborak/core/images/', $scriptCode); //render the template $pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentry.tpl'; $template = new TemplatePower($pluginTpl); $template->prepare(); require_once 'classes/model/Step.php'; $oStep = new Step(); $sUidGrids = $oStep->lookingforUidGrids($sPRO_UID, $sDYNAFORM); $template->assign("URL_MABORAK_JS", G::browserCacheFilesUrl("/js/maborak/core/maborak.js")); $template->assign("URL_TRANSLATION_ENV_JS", G::browserCacheFilesUrl("/jscore/labels/" . SYS_LANG . ".js")); $template->assign("siteUrl", $http . $_SERVER["HTTP_HOST"]); $template->assign("sysSys", SYS_SYS); $template->assign("sysLang", SYS_LANG); $template->assign("sysSkin", SYS_SKIN); $template->assign("processUid", $sPRO_UID); $template->assign("dynaformUid", $sDYNAFORM); $template->assign("taskUid", $sTASKS); $template->assign("dynFileName", $sPRO_UID . "/" . $sDYNAFORM); $template->assign("formId", $G_FORM->id); $template->assign("scriptCode", $scriptCode); if (sizeof($sUidGrids) > 0) { foreach ($sUidGrids as $k => $v) {
/** * Validates all modified columns of given Step 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 Step $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(Step $obj, $cols = null) { $columns = array(); if ($cols) { $dbMap = Propel::getDatabaseMap(StepPeer::DATABASE_NAME); $tableMap = $dbMap->getTable(StepPeer::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(StepPeer::STEP_TYPE_OBJ)) { $columns[StepPeer::STEP_TYPE_OBJ] = $obj->getStepTypeObj(); } } return BasePeer::doValidate(StepPeer::DATABASE_NAME, StepPeer::TABLE_NAME, $columns); }
function parse() { $fp = fopen($this->filePath, "r") or die("Couldnot open file"); $varListStr = ""; $checkListStr = ""; $stepListStr = ""; $collectListStr = ""; while (!feof($fp)) { $line = trim(fgets($fp, 1024)); $flag = substr($line, 0, 1); $elementArray = explode('.', $line, 2); $element = $elementArray[0]; switch ($flag) { case "\$": $varListStr .= $line . '\\n'; break; case "{": $stepListStr .= $line . '\\nflag'; $checkListStr .= $line . '\\nflag'; $collectListStr .= $line . '\\nflag'; break; case "}": $stepListStr .= $line . '\\n'; $checkListStr .= $line . '\\n'; $collectListStr .= $line . '\\n'; break; case "#": break; default: switch ($element) { case "step": $stepListStr .= $line . '\\n'; break; case "check": $checkListStr .= $line . '\\n'; break; case "collect": $collectListStr .= $line . '\\n'; break; default: break; } break; } } fclose($fp); //echo "</br></br>".$varListStr."</br></br>"; //echo $checkListStr."</br></br>"; //echo $stepListStr."</br></br>"; //echo $collectListStr."</br></br>"; $this->varibles = Varible::parseList($varListStr); $this->checks = Check::parseList($checkListStr, "check"); $this->steps = Step::parseList($stepListStr, "step"); $this->collects = Collect::parseList($collectListStr, "collect"); }
* * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * For more information, contact Colosa Inc, 2566 Le Jeune Rd., * Coral Gables, FL, 33134, USA, or email info@colosa.com. */ try { global $RBAC; switch ($RBAC->userCanAccess('PM_FACTORY')) { case -2: G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); 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/Step.php'; $oStep = new Step(); $oStep->down($_POST['STEP_UID'], $_POST['TASK'], $_POST['STEP_POSITION']); G::auditlog("StepDown", "Down the Step One Level -> " . $_POST['STEP_UID'] . ' In Task -> ' . $_POST['TASK'] . ' Step Position -> ' . $_POST['STEP_POSITION']); G::LoadClass('processMap'); $oProcessMap = new ProcessMap(); $oProcessMap->getStepsCriteria($_POST['TASK']); } catch (Exception $oException) { die($oException->getMessage()); }
/** * 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); } }
$auth = new auth("EXPORT"); $page = new page("Export"); $wizard = new Wizard($lang->get("export_data", "Export Content and Templates Wizard")); $wizard->setTitleText($lang->get("wz_export_title", "This wizard is used to exchange clusters, cluster-templates and page-templates between your N/X installation and others. The wizard generates a XML File, which you can store on your local hard drive and exchange with other N/X-Users.")); ////// STEP 1 ////// $step = new Step(); $step->setTitle($lang->get("wzt_export_type", "Select type to export")); $step->setExplanation($lang->get("wze_export_type", "On the right you need to select the type of data you want to export. Clusters are storing content. When you export clusters, the templates are automatically exported too. Cluster-Templates are schemes for creating clusters. Page-Templates are used for creating pages in the website. Cluster-Templates, Meta-Templates and layout are automatically exported when you export a Page-Template.")); $resources[0][0] = $lang->get("cluster", "Cluster"); $resources[0][1] = "CLUSTER"; $resources[1][0] = $lang->get("cluster_template", "Cluster Template"); $resources[1][1] = "CLUSTERTEMPLATE"; $resources[2][0] = $lang->get("page_template", "Page Template"); $resources[2][1] = "PAGETEMPLATE"; $step->add(new WZRadio("resource_type", $resources)); ////// STEP 2 ////// $step2 = new STSelectResource(); $step2->setTitle($lang->get("wzt_sel_exp_res", "Select Resource for export")); ////// STEP 3 ////// $step3 = new Step(); $step3->setTitle($lang->get("wzt_descr", "Add description")); $step3->setExplanation($lang->get("wzt_descr_expl", "You should add a short description to the exported data.<br/><br/> Anyone who will import the data will easier understand, what he exports.")); $step3->add(new WZText("exp_description", $lang->get("description", "Description"), "TEXTAREA")); ////// Step 4 ////// $step4 = new STExportResource(); $wizard->add($step); $wizard->add($step2); $wizard->add($step3); $wizard->add($step4); $page->add($wizard); $page->draw();
/** * Class constructor * * @param Log $log */ public function __construct(Log $log) { parent::__construct($log); $this->args = ['name' => 'start', 'title' => __('Start', 'wp-easy-mode'), 'page_title' => __('Create a WordPress Website', 'wp-easy-mode'), 'can_skip' => false]; }
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * */ try { global $RBAC; switch ($RBAC->userCanAccess('PM_FACTORY')) { case -2: G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); 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/Step.php'; $oStep = new Step(); if (isset($_POST['form'])) { $value = $_POST['form']; } else { $value = $_POST; } $oStep->update(array('STEP_UID' => $value['STEP_UID'], 'STEP_CONDITION' => $value['STEP_CONDITION'])); G::LoadClass('processMap'); $oProcessMap = new ProcessMap(); $oProcessMap->getStepsCriteria($value['TAS_UID']); } catch (Exception $oException) { die($oException->getMessage()); }
<?php require_once 'includes/config.php'; require_once 'class/Steps.class.php'; $steps = new Step($pdo); $id_step = $_GET['id_step']; if (isset($_POST['validate']) && $_POST['validate'] == 'validate') { $steps->updateStep($id_step); }
/** * 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; } }
print G::json_encode($result); break; 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; }
<?php require_once '../admin/includes/config.php'; require_once '../class/Step.class.php'; $step = new Step($pdo); if (isset($_GET['action'])) { $action = $_GET['action']; if ($action == 'getStepState') { $step_id = $_GET['step_id']; echo json_encode($step->getStepState($step_id)); } if ($action == 'getStepInfos') { $step_id = $_GET['step_id']; $step_field = $_GET['step_field']; echo json_encode($step->getStepInfos($step_id, $step_field)); } if ($action == 'getIdUrl') { echo json_encode($step->getIdUrl()); } } if (isset($_POST['action'])) { $action = $_POST['action']; if ($action == 'updateLikes') { $id_step = $_POST['id_step']; $nb_likes = $_POST['nb_likes']; echo json_encode($step->updateLikes($id_step, $nb_likes)); } }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Step the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Step::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public function __construct($plan, $address, $zip, $responsible, $telephone = null, $complement = null, $comment = null, $track_id = null) { $this->plan = $plan; parent::__construct($address, $zip, $responsible, $telephone, $complement, $comment, $track_id); }