Exemple #1
0
 public static function updateDynamicDate($context)
 {
     ${"GLOBALS"}["cxjptdslky"] = "adb";
     ${"GLOBALS"}["ffwkvdnarsns"] = "sql";
     ${${"GLOBALS"}["cxjptdslky"]} = \PearDatabase::getInstance();
     ${${"GLOBALS"}["ffwkvdnarsns"]} = "SELECT nextStepField, block_id, id FROM vtiger_wf_queue WHERE crmid = ? AND checkMode = 'dynamic'";
     $aijrbqs = "row";
     ${${"GLOBALS"}["dnpzgnxsrrdc"]} = \Workflow\VtUtils::pquery(${${"GLOBALS"}["fjvutiy"]}, array($context->getId()));
     ${"GLOBALS"}["hkrgfrun"] = "result";
     if ($adb->num_rows(${${"GLOBALS"}["dnpzgnxsrrdc"]}) == 0) {
         return false;
     }
     while (${$aijrbqs} = $adb->fetchByAssoc(${${"GLOBALS"}["hkrgfrun"]})) {
         if (\Workflow\EntityDelta::hasChanged($context->getModuleName(), $context->getId(), ${${"GLOBALS"}["isqdglbip"]}["nextstepfield"])) {
             $pgoetzgxky = "objTask";
             $bpggpjbm = "newDate";
             $ujxsupnbec = "row";
             ${$bpggpjbm} = \Workflow\EntityDelta::getCurrentValue($context->getModuleName(), $context->getId(), ${$ujxsupnbec}["nextstepfield"]);
             ${$pgoetzgxky} = \Workflow\Manager::getTaskHandler("delay", ${${"GLOBALS"}["isqdglbip"]}["block_id"]);
             ${${"GLOBALS"}["wtgbcaer"]} = $objTask->calculateContinueTS(strtotime(${${"GLOBALS"}["kjqnmsg"]}));
             ${${"GLOBALS"}["fjvutiy"]} = "UPDATE vtiger_wf_queue SET nextStepTime = ? WHERE id = ?";
             \Workflow\VtUtils::pquery(${${"GLOBALS"}["fjvutiy"]}, array(date("Y-m-d H:i:s", ${${"GLOBALS"}["wtgbcaer"]}), ${${"GLOBALS"}["isqdglbip"]}["id"]));
         }
     }
     return true;
 }
Exemple #2
0
 public function getNextTasks($output = null)
 {
     $fwyuhxoyb = "output";
     $rfdjdrbp = "output";
     global $adb;
     ${${"GLOBALS"}["ulkocil"]} = "SELECT vtiger_wfp_blocks.type, vtiger_wfp_blocks.id FROM\n                vtiger_wfp_connections\n                 LEFT JOIN vtiger_wfp_blocks ON(vtiger_wfp_blocks.id = vtiger_wfp_connections.destination_id)\n            WHERE vtiger_wfp_connections.deleted = 0 AND active = 1 AND source_id = " . $this->_taskID . " AND source_mode = 'block'" . (${$fwyuhxoyb} !== null ? " AND source_key IN ('" . implode("','", ${$rfdjdrbp}) . "')" : "") . " ORDER BY y";
     ${"GLOBALS"}["twdscusz"] = "sql";
     $xlbyckbe = "tasks";
     $zriemn = "result";
     ${"GLOBALS"}["jjtdacjhhr"] = "tasks";
     $jkmmtxe = "result";
     ${$jkmmtxe} = \Workflow\VtUtils::query(${${"GLOBALS"}["twdscusz"]});
     ${$xlbyckbe} = array();
     while (${${"GLOBALS"}["lbujtjnghu"]} = $adb->fetch_array(${$zriemn})) {
         ${"GLOBALS"}["nshmpwnc"] = "objTask";
         ${${"GLOBALS"}["nshmpwnc"]} = \Workflow\Manager::getTaskHandler(${${"GLOBALS"}["lbujtjnghu"]}["type"], ${${"GLOBALS"}["lbujtjnghu"]}["id"], $this->getWorkflow());
         $objTask->setExecId($this->_execID);
         $objTask->setPrevTask($this, ${${"GLOBALS"}["sqykfod"]} === null ? false : ${${"GLOBALS"}["sqykfod"]});
         ${${"GLOBALS"}["wwxwfhef"]}[] = ${${"GLOBALS"}["dpkdjeeeix"]};
     }
     return ${${"GLOBALS"}["jjtdacjhhr"]};
 }
Exemple #3
0
 public function start()
 {
     global $adb, $current_user;
     Workflow2::log($this->_context->getWsId(), $this->_workflowID, 0, "Exec WF");
     ${"GLOBALS"}["bkqjdft"] = "sql";
     ${${"GLOBALS"}["lpkalvdeh"]} = $this->getSettings();
     if (${${"GLOBALS"}["lpkalvdeh"]}["once_per_record"] == "1" && !$this->_context->isDummy()) {
         $inxxzeyok = "dataKey";
         ${"GLOBALS"}["bivgbqxtk"] = "result";
         $qmpoys = "sql";
         ${$inxxzeyok} = "__internal_oncePerRecord_" . $this->getId();
         ${$qmpoys} = "SELECT dataid FROM vtiger_wf_entityddata WHERE crmid = ? AND `key` = ?";
         ${${"GLOBALS"}["bivgbqxtk"]} = $adb->pquery(${${"GLOBALS"}["dutcyticanf"]}, array($this->_context->getId(), ${${"GLOBALS"}["dosuzoyzgm"]}));
         if ($adb->num_rows(${${"GLOBALS"}["jegtsurybn"]}) > 0) {
             return false;
         } else {
             ${"GLOBALS"}["qlpvaphhfspn"] = "sql";
             $icdpopmw = "sql";
             ${$icdpopmw} = "INSERT INTO vtiger_wf_entityddata SET `crmid` = ?, `key` = ?, `value` = ?";
             $adb->pquery(${${"GLOBALS"}["qlpvaphhfspn"]}, array($this->_context->getId(), ${${"GLOBALS"}["dosuzoyzgm"]}, array(serialize(1))), true);
         }
     }
     ${"GLOBALS"}["wbsbbykpc"] = "current_user";
     ${${"GLOBALS"}["wbsbbykpc"]} = $this->getUser();
     $jbjrvuk = "current_user";
     VTEntity::setUser(${$jbjrvuk});
     $skdddiceo = "row";
     $sugjsbwz = "row";
     ${${"GLOBALS"}["dutcyticanf"]} = "SELECT id FROM vtiger_wfp_blocks WHERE workflow_id = " . $this->_workflowID . " AND type='start' LIMIT 1";
     ${${"GLOBALS"}["jegtsurybn"]} = \Workflow\VtUtils::query(${${"GLOBALS"}["bkqjdft"]});
     $xrzjxx = "start";
     ${$sugjsbwz} = $adb->fetch_array(${${"GLOBALS"}["jegtsurybn"]});
     $vrjfwkerv = "start";
     ${$xrzjxx} = \Workflow\Manager::getTaskHandler("start", ${$skdddiceo}["id"], $this);
     $start->setExecId($this->_execID);
     $_SERVER["runningWorkflow" . $this->_workflowID] = true;
     $this->pushExecutionStack(${$vrjfwkerv});
     $this->handleExecutionStack();
     unset($_SERVER["runningWorkflow" . $this->_workflowID]);
     Workflow2::log($this->_context->getWsId(), $this->_workflowID, 0, "Finish WF");
 }