Exemplo n.º 1
0
 public function process(Vtiger_Request $request)
 {
     ${"GLOBALS"}["drfxxcw"] = "workflow";
     ${"GLOBALS"}["qdicwdai"] = "context";
     $yygxkirxkn = "hash";
     $lmnathdjcp = "params";
     $szuzcuefxy = "execId";
     $vleloffw = "environment";
     global $current_user;
     ${${"GLOBALS"}["ppcqurfuseke"]} = PearDatabase::getInstance();
     ${$lmnathdjcp} = $request->getAll();
     ${${"GLOBALS"}["dchjxoxtxl"]} = (int) $request->get("workflow");
     ${$yygxkirxkn} = $request->get("hash");
     ${${"GLOBALS"}["iujcwkxmrghj"]} = \Workflow\Importer::getInstance(${${"GLOBALS"}["giulhdd"]});
     ${"GLOBALS"}["yijvwhkkly"] = "ready";
     ${"GLOBALS"}["civjsw"] = "current_user";
     ${${"GLOBALS"}["kblmucwe"]} = $objImporter->get("execId");
     $gbidioupkub = "hash";
     if (!empty(${$szuzcuefxy})) {
         $uomjohpljtr = "execId";
         $amancvjzyb = "task";
         ${"GLOBALS"}["ihdjnerjw"] = "sql";
         ${${"GLOBALS"}["hkxcia"]} = \Workflow\Queue::getQueueEntryByExecId(${$uomjohpljtr});
         ${"GLOBALS"}["mtarmljwhk"] = "task";
         ${${"GLOBALS"}["ihdjnerjw"]} = "DELETE FROM vtiger_wf_queue WHERE id = " . ${$amancvjzyb}["queue_id"] . "";
         $adb->query(${${"GLOBALS"}["fmhsywrhw"]});
         \Workflow\Queue::runEntry(${${"GLOBALS"}["mtarmljwhk"]});
         exit;
     }
     ${${"GLOBALS"}["hfdtldd"]} = \Workflow\VTEntity::getDummy();
     ${${"GLOBALS"}["xuwgiqqwoqm"]} = new \Workflow\Main(${${"GLOBALS"}["drfxxcw"]}, false, ${${"GLOBALS"}["civjsw"]});
     ${$vleloffw} = array("_import_hash" => ${$gbidioupkub}, "_internal" => $_SESSION["_import_data"][${${"GLOBALS"}["giulhdd"]}]);
     ${${"GLOBALS"}["ibtbwjumn"]}["importParams"] = $objImporter->get("importParams");
     $context->loadEnvironment(${${"GLOBALS"}["ibtbwjumn"]});
     $objWorkflow->setContext(${${"GLOBALS"}["qdicwdai"]});
     $objWorkflow->start();
     ${${"GLOBALS"}["ibtbwjumn"]} = $context->getEnvironment();
     ${${"GLOBALS"}["meglgccnf"]} = $objImporter->get("ready");
     if (${${"GLOBALS"}["yijvwhkkly"]} == true) {
         $objImporter->handleFinish();
     } else {
         $objImporter->handlePause();
     }
 }
Exemplo n.º 2
0
 public function process(Vtiger_Request $request)
 {
     $xhqrbyal = "cu_model";
     $awzoousbijac = "result";
     Workflow2::${${"GLOBALS"}["fiflovy"]} = true;
     if (!empty($_SERVER["HTTP_X_REQUESTED_WITH"]) && strtolower($_SERVER["HTTP_X_REQUESTED_WITH"]) == "xmlhttprequest") {
         Workflow2::${${"GLOBALS"}["sxluqscobil"]} = true;
     }
     $aldkggvnocb = "params";
     ${"GLOBALS"}["qiswqpb"] = "continueExecId";
     ${${"GLOBALS"}["mlokrunke"]} = PearDatabase::getInstance();
     ${"GLOBALS"}["batkhioplbv"] = "allow_parallel";
     $dduumoti = "result";
     ${"GLOBALS"}["aughjdxffu"] = "continueExecId";
     ${$aldkggvnocb} = $request->getAll();
     ${${"GLOBALS"}["fyvmsq"]} = ${$xhqrbyal} = Users_Record_Model::getCurrentUserModel();
     ${"GLOBALS"}["vsxpiyis"] = "requestValues";
     ${${"GLOBALS"}["batkhioplbv"]} = $request->get("allowParallel", "false") === "1";
     ${${"GLOBALS"}["eeennsbvlt"]} = (int) $request->get("workflowID");
     ${${"GLOBALS"}["vsxpiyis"]} = $request->get("requestValues");
     ${${"GLOBALS"}["nztqmvnrgzi"]} = $request->get("requestValuesKey");
     ${${"GLOBALS"}["pajxdehcky"]} = $request->get("continueExecId");
     $hfvpdtq = "sql";
     ${${"GLOBALS"}["qwgmpolil"]} = $request->get("continueBlockId");
     if (strpos(${${"GLOBALS"}["aughjdxffu"]}, "##") !== false) {
         ${"GLOBALS"}["mkuklgbjodtb"] = "continueExecId";
         ${"GLOBALS"}["vpmdfnx"] = "parts";
         $cnibibbpik = "continueExecId";
         ${${"GLOBALS"}["ukdeacyi"]} = explode("##", ${${"GLOBALS"}["mkuklgbjodtb"]});
         ${$cnibibbpik} = ${${"GLOBALS"}["vpmdfnx"]}[0];
         ${${"GLOBALS"}["qwgmpolil"]} = ${${"GLOBALS"}["ukdeacyi"]}[1];
     }
     if (!empty(${${"GLOBALS"}["qiswqpb"]})) {
         $ohjszugmnxs = "requestValuesKey";
         if (${$ohjszugmnxs} == "authPermission") {
             ${"GLOBALS"}["ycnxjrdysji"] = "requestValues";
             ${"GLOBALS"}["zwrvvswpwb"] = "continueExecId";
             $pujwrhxk = "requestValues";
             ${${"GLOBALS"}["qerhyklwh"]} = $this->handleSetPermissions(${${"GLOBALS"}["zwrvvswpwb"]}, ${${"GLOBALS"}["qwgmpolil"]}, ${${"GLOBALS"}["ycnxjrdysji"]});
             if (${${"GLOBALS"}["qerhyklwh"]} === false) {
                 $this->handleReturn();
             }
             ${${"GLOBALS"}["nztqmvnrgzi"]} = "";
             ${$pujwrhxk} = "";
         }
         ${${"GLOBALS"}["sszaqio"]} = \Workflow\Queue::getQueueEntryByExecId(${${"GLOBALS"}["pajxdehcky"]}, ${${"GLOBALS"}["qwgmpolil"]});
         if (${${"GLOBALS"}["sszaqio"]} !== false) {
             $sdfjrtmbv = "workflow";
             \Workflow\Queue::stopEntry(${$sdfjrtmbv});
             ${"GLOBALS"}["vwpxff"] = "requestValuesKey";
             $this->_objWorkflow = ${${"GLOBALS"}["sszaqio"]}["task"]->getWorkflow();
             if (!empty(${${"GLOBALS"}["vwpxff"]})) {
                 $cmiqvsy = "env";
                 ${"GLOBALS"}["qoskdafhutd"] = "workflow";
                 ${"GLOBALS"}["dqxzmxov"] = "env";
                 ${"GLOBALS"}["yfgrwwgyxjh"] = "env";
                 ${${"GLOBALS"}["dqxzmxov"]} = ${${"GLOBALS"}["sszaqio"]}["context"]->getEnvironment("_reqValues");
                 ${"GLOBALS"}["entqbm"] = "requestValues";
                 $cdrbilhs = "workflow";
                 ${$cmiqvsy}[${${"GLOBALS"}["nztqmvnrgzi"]}] = true;
                 ${$cdrbilhs}["context"]->setEnvironment("_reqValues", ${${"GLOBALS"}["rwsybopbofy"]});
                 ${"GLOBALS"}["humlvehh"] = "requestValues";
                 ${${"GLOBALS"}["yfgrwwgyxjh"]} = ${${"GLOBALS"}["sszaqio"]}["context"]->getEnvironment("value");
                 if (!is_array(${${"GLOBALS"}["rwsybopbofy"]})) {
                     ${"GLOBALS"}["kkxlfvg"] = "env";
                     ${${"GLOBALS"}["kkxlfvg"]} = array();
                 }
                 $kvkqyovgu = "env";
                 ${${"GLOBALS"}["wdevzzyv"]} = ${${"GLOBALS"}["ksqrqhcnhk"]}["_fieldtype"];
                 ${"GLOBALS"}["dyfarxu"] = "requestValues";
                 unset(${${"GLOBALS"}["humlvehh"]}["_fieldtype"]);
                 foreach (${${"GLOBALS"}["entqbm"]} as ${${"GLOBALS"}["fxeookd"]} => ${${"GLOBALS"}["bjudgmb"]}) {
                     ${"GLOBALS"}["cwdeawsawnz"] = "fieldTypes";
                     ${"GLOBALS"}["bnsjdgky"] = "requestValues";
                     $kkuxpn = "index";
                     if (!empty(${${"GLOBALS"}["cwdeawsawnz"]}[${${"GLOBALS"}["fxeookd"]}])) {
                         $ulquytqvf = "type";
                         ${"GLOBALS"}["pjngmgj"] = "fieldTypes";
                         $iwcpla = "index";
                         ${"GLOBALS"}["tnxyhf"] = "workflow";
                         ${$ulquytqvf} = \Workflow\Fieldtype::getType(${${"GLOBALS"}["wdevzzyv"]}[${$iwcpla}]);
                         $bygtvss = "index";
                         ${${"GLOBALS"}["bjudgmb"]} = $type->getValue(trim(${${"GLOBALS"}["bjudgmb"]}), ${$bygtvss}, ${${"GLOBALS"}["pjngmgj"]}[${${"GLOBALS"}["fxeookd"]}], ${${"GLOBALS"}["tnxyhf"]}["context"]);
                     }
                     ${${"GLOBALS"}["bnsjdgky"]}[${$kkuxpn}] = trim(${${"GLOBALS"}["bjudgmb"]});
                 }
                 ${$kvkqyovgu} = array_merge(${${"GLOBALS"}["rwsybopbofy"]}, ${${"GLOBALS"}["dyfarxu"]});
                 ${${"GLOBALS"}["qoskdafhutd"]}["context"]->setEnvironment("value", ${${"GLOBALS"}["rwsybopbofy"]});
             }
             try {
                 $fpunbpanmn = "workflow";
                 \Workflow\Queue::runEntry(${$fpunbpanmn});
             } catch (\Exception $exp) {
                 $pqrukkuo = "exp";
                 $this->handleReturn(${$pqrukkuo});
             }
             $this->handleReturn();
             exit;
         }
     }
     ${${"GLOBALS"}["jdijirbbp"]} = "SELECT * FROM vtiger_wf_settings WHERE id = ? AND active = 1";
     ${$dduumoti} = \Workflow\VtUtils::pquery(${$hfvpdtq}, array(${${"GLOBALS"}["eeennsbvlt"]}));
     while (${${"GLOBALS"}["rmniutpwd"]} = $adb->fetch_array(${$awzoousbijac})) {
         ${"GLOBALS"}["ifzwgcvh"] = "user";
         $exbcmtusi = "user";
         if (${${"GLOBALS"}["rmniutpwd"]}["execution_user"] == "0") {
             ${${"GLOBALS"}["rmniutpwd"]}["execution_user"] = $current_user->id;
         }
         ${${"GLOBALS"}["dmcfeolmh"]} = new Users();
         ${"GLOBALS"}["brdhenkjcoeb"] = "context";
         $user->retrieveCurrentUserInfoFromFile(${${"GLOBALS"}["rmniutpwd"]}["execution_user"]);
         ${"GLOBALS"}["eisghylycg"] = "context";
         VTEntity::setUser(${${"GLOBALS"}["ifzwgcvh"]});
         $this->_objWorkflow = new \Workflow\Main(${${"GLOBALS"}["rmniutpwd"]}["id"], false, ${$exbcmtusi});
         $this->_objWorkflow->setExecutionTrigger("WF2_MANUELL");
         if (${${"GLOBALS"}["frhjlwprw"]} == false && $this->_objWorkflow->isRunning($_POST["crmid"])) {
             continue;
         }
         ${${"GLOBALS"}["brdhenkjcoeb"]} = VTEntity::getForId(intval($_POST["crmid"]));
         $this->_objWorkflow->setContext(${${"GLOBALS"}["eisghylycg"]});
         try {
             $this->_objWorkflow->start();
         } catch (\Exception $exp) {
             ${"GLOBALS"}["gikexcyv"] = "exp";
             $this->handleReturn(${${"GLOBALS"}["gikexcyv"]});
         }
         $context->save();
     }
     $this->handleReturn();
 }