Exemplo n.º 1
0
 public static function getTaskHandler($type, $taskID, $workflow = false)
 {
     $difkiadcjj = "sql";
     global $adb;
     ${"GLOBALS"}["vigeayiuagj"] = "result";
     ${"GLOBALS"}["ymbusetiqjad"] = "className";
     ${$difkiadcjj} = "SELECT `handlerClass`, `file`,`module`,`id`  FROM vtiger_wf_types WHERE `type` = '" . ${${"GLOBALS"}["dtigdoiadd"]} . "'";
     ${${"GLOBALS"}["tydgcp"]} = \Workflow\VtUtils::query(${${"GLOBALS"}["nlgdcz"]});
     $efyvkmgcanpn = "className";
     $egguqrhvnyo = "row";
     $haxggxetire = "objTask";
     ${${"GLOBALS"}["mghkudhvefbq"]} = $adb->fetch_array(${${"GLOBALS"}["vigeayiuagj"]});
     if (!empty(${${"GLOBALS"}["mghkudhvefbq"]}["file"])) {
         ${"GLOBALS"}["ndwllnkrw"] = "row";
         require_once "modules/" . ${${"GLOBALS"}["ndwllnkrw"]}["module"] . "/" . ${${"GLOBALS"}["mghkudhvefbq"]}["file"];
     } else {
         ${"GLOBALS"}["iukyxvxgjf"] = "taskDir";
         ${"GLOBALS"}["kbotayscdosb"] = "taskDir";
         ${${"GLOBALS"}["wvrcehb"]} = dirname(__FILE__) . "/../../../" . ${${"GLOBALS"}["mghkudhvefbq"]}["module"] . "/";
         if (!file_exists(${${"GLOBALS"}["kbotayscdosb"]} . "/tasks/" . preg_replace("/[^a-zA-z0-9]/", "", ${${"GLOBALS"}["mghkudhvefbq"]}["handlerclass"]) . ".php")) {
             $lcncgpegplw = "row";
             $dbzwqvvloo = "type";
             throw new \Exception("Taskfile '" . preg_replace("/[^a-zA-z0-9]/", "", ${$lcncgpegplw}["handlerclass"]) . ".php" . "' not found. TypeID: " . ${${"GLOBALS"}["mghkudhvefbq"]}["id"] . " / Type: " . ${$dbzwqvvloo});
             exit;
         }
         require_once ${${"GLOBALS"}["iukyxvxgjf"]} . "tasks/" . preg_replace("/[^a-zA-z0-9]/", "", ${${"GLOBALS"}["mghkudhvefbq"]}["handlerclass"]) . ".php";
     }
     ${$efyvkmgcanpn} = ${$egguqrhvnyo}["handlerclass"];
     ${$haxggxetire} = new ${${"GLOBALS"}["ymbusetiqjad"]}(${${"GLOBALS"}["ncvolctk"]});
     if (${${"GLOBALS"}["bvxigqve"]} !== false) {
         $akonekfkw = "workflow";
         $objTask->setWorkflow(${$akonekfkw});
     }
     return ${${"GLOBALS"}["lyeyccstdk"]};
 }
Exemplo n.º 2
0
 public function beforeGetTaskform($viewer)
 {
     ${"GLOBALS"}["fceqgls"] = "data";
     global $adb;
     ${${"GLOBALS"}["lbujtjnghu"]} = \Workflow\VtUtils::query("SELECT file, module, handlerClass, helpUrl FROM vtiger_wf_types WHERE type = '" . $this->_data["type"] . "'");
     ${${"GLOBALS"}["fceqgls"]} = $adb->fetch_array(${${"GLOBALS"}["lbujtjnghu"]});
     if ($this->_internalConfiguration == true && is_array($this->_configFields)) {
         ${"GLOBALS"}["pdkxqwi"] = "value";
         ${${"GLOBALS"}["npgeqww"]} = array();
         foreach ($this->_configFields as ${${"GLOBALS"}["ugekeupolkiq"]} => ${${"GLOBALS"}["pdkxqwi"]}) {
             $jxydnk = "fields";
             $xnmqjcuqhg = "index";
             ${"GLOBALS"}["xnpbkzjhl"] = "data";
             $ekeaslrj = "index";
             ${"GLOBALS"}["okfdfmrvgj"] = "index";
             ${"GLOBALS"}["tgowlekrr"] = "value";
             ${$ekeaslrj} = getTranslatedString(${$xnmqjcuqhg}, ${${"GLOBALS"}["xnpbkzjhl"]}["module"]);
             foreach (${${"GLOBALS"}["cqtreswpfgh"]} as ${${"GLOBALS"}["hvydudmd"]} => ${${"GLOBALS"}["docyqevipjfu"]}) {
                 $jsbsdlukbixe = "data";
                 ${"GLOBALS"}["tgjzhzjgqm"] = "field";
                 ${${"GLOBALS"}["docyqevipjfu"]}["label"] = getTranslatedString(${${"GLOBALS"}["docyqevipjfu"]}["label"], "Settings:" . ${$jsbsdlukbixe}["module"]);
                 ${${"GLOBALS"}["cqtreswpfgh"]}[${${"GLOBALS"}["hvydudmd"]}] = ${${"GLOBALS"}["tgjzhzjgqm"]};
             }
             ${$jxydnk}[${${"GLOBALS"}["okfdfmrvgj"]}] = ${${"GLOBALS"}["tgowlekrr"]};
         }
         $viewer->assign("CONFIG_FIELDS", ${${"GLOBALS"}["npgeqww"]});
     }
 }
Exemplo n.º 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");
 }
Exemplo n.º 4
0
 public static function runEntry($task)
 {
     ${"GLOBALS"}["ctcvcxix"] = "task";
     ${"GLOBALS"}["twqvrmmodsw"] = "sql";
     $prajunbl = "task";
     $acpzqexyj = "task";
     $mbvelou = "task";
     ${"GLOBALS"}["vxedjoslrc"] = "task";
     global $current_user, $adb;
     ${${"GLOBALS"}["vxedjoslrc"]}["task"]->setContinued(true);
     \Workflow\EntityDelta::unserializeDelta(${${"GLOBALS"}["ctcvcxix"]}["delta"]);
     ${"GLOBALS"}["seyqafmvuu"] = "task";
     ${${"GLOBALS"}["xiewdtxiim"]} = ${$acpzqexyj}["task"]->getWorkflow();
     ${${"GLOBALS"}["pbwcpwycwiz"]} = ${${"GLOBALS"}["mhkvecnv"]}["user"];
     ${"GLOBALS"}["iiakuaugsn"] = "task";
     \Workflow\VTEntity::setUser(${${"GLOBALS"}["mhkvecnv"]}["user"]);
     $_SERVER["runningWorkflow" . ${${"GLOBALS"}["mhkvecnv"]}["id"]] = true;
     $wfMain->handleTasks(${${"GLOBALS"}["iiakuaugsn"]}["task"], ${$mbvelou}["task"]->getBlockId());
     ${"GLOBALS"}["mxmobyxw"] = "task";
     ${${"GLOBALS"}["fjvutiy"]} = "DELETE FROM vtiger_wf_queue WHERE id = " . ${${"GLOBALS"}["seyqafmvuu"]}["queue_id"] . "";
     \Workflow\VtUtils::query(${${"GLOBALS"}["fjvutiy"]});
     ${${"GLOBALS"}["twqvrmmodsw"]} = "DELETE FROM vtiger_wf_userqueue WHERE queue_id = " . ${${"GLOBALS"}["mxmobyxw"]}["queue_id"] . "";
     \Workflow\VtUtils::query(${${"GLOBALS"}["fjvutiy"]});
     $_SERVER["runningWorkflow" . ${$prajunbl}["id"]] = false;
     return array("result" => "ok", "redirect_to" => $wfMain->getSuccessRedirection(), "redirect_to_target" => $wfMain->getSuccessRedirectionTarget());
 }
Exemplo n.º 5
0
 public static function getRelatedModules($module_name)
 {
     $clnasch = "result";
     global $adb, $current_user, $app_strings;
     ${"GLOBALS"}["rnoyrpjcfhr"] = "sql";
     require "user_privileges/user_privileges_" . $current_user->id . ".php";
     ${${"GLOBALS"}["rnoyrpjcfhr"]} = "SELECT vtiger_relatedlists.related_tabid,vtiger_relatedlists.label, vtiger_relatedlists.name, vtiger_tab.name as module_name FROM\n                vtiger_relatedlists\n                    INNER JOIN vtiger_tab ON(vtiger_tab.tabid = vtiger_relatedlists.related_tabid)\n                WHERE vtiger_relatedlists.tabid = '" . getTabId(${${"GLOBALS"}["luxsvwk"]}) . "' AND related_tabid not in (SELECT tabid FROM vtiger_tab WHERE presence = 1) ORDER BY sequence, vtiger_relatedlists.relation_id";
     $pwwrtsww = "sql";
     ${$clnasch} = \Workflow\VtUtils::query(${$pwwrtsww});
     ${"GLOBALS"}["hpteydlzekv"] = "result";
     ${${"GLOBALS"}["sekdixmdyjad"]} = array();
     while (${${"GLOBALS"}["mnxpcyvt"]} = $adb->fetch_array(${${"GLOBALS"}["hpteydlzekv"]})) {
         if (${${"GLOBALS"}["rphtkvjmiom"]}[${${"GLOBALS"}["mnxpcyvt"]}["related_tabid"]] == 0) {
             $jtnacqi = "profileActionPermission";
             ${"GLOBALS"}["geomnpsrb"] = "row";
             if (${$jtnacqi}[${${"GLOBALS"}["geomnpsrb"]}["related_tabid"]][3] == 0) {
                 ${"GLOBALS"}["ehyili"] = "app_strings";
                 $jdcqowf = "row";
                 ${"GLOBALS"}["rywpvnrpf"] = "row";
                 ${"GLOBALS"}["ruzokfcil"] = "row";
                 ${${"GLOBALS"}["sekdixmdyjad"]}[] = array("related_tabid" => ${${"GLOBALS"}["ruzokfcil"]}["related_tabid"], "module_name" => ${${"GLOBALS"}["rywpvnrpf"]}["module_name"], "action" => ${${"GLOBALS"}["mnxpcyvt"]}["name"], "label" => isset(${${"GLOBALS"}["uqqtduge"]}[${${"GLOBALS"}["mnxpcyvt"]}["label"]]) ? ${${"GLOBALS"}["ehyili"]}[${$jdcqowf}["label"]] : ${${"GLOBALS"}["mnxpcyvt"]}["label"]);
             }
         }
     }
     return ${${"GLOBALS"}["sekdixmdyjad"]};
 }