Exemple #1
0
 public function GetWorkflows($module_name, $start_types = false)
 {
     $xreygshti = "start_types";
     ${"GLOBALS"}["tvkeevw"] = "module_name";
     global $adb, $current_user;
     if (${${"GLOBALS"}["dzgvygmve"]} == "Events") {
         ${${"GLOBALS"}["tvkeevw"]} = "Calendar";
     }
     $wvdjedue = "module_name";
     if (${$xreygshti} === false) {
         ${"GLOBALS"}["jfsbjte"] = "sql";
         ${${"GLOBALS"}["jfsbjte"]} = "SELECT * FROM vtiger_wf_settings WHERE module_name = ? AND active = 1";
     } else {
         if (is_array(${${"GLOBALS"}["qkrtqbzspqei"]})) {
             ${"GLOBALS"}["upjaqlkush"] = "sql";
             ${${"GLOBALS"}["upjaqlkush"]} = "SELECT * FROM vtiger_wf_settings WHERE module_name = ? AND active = 1 AND `trigger` IN ('" . implode("','", ${${"GLOBALS"}["qkrtqbzspqei"]}) . "')";
         } else {
             $vmxdxkownx = "sql";
             ${$vmxdxkownx} = "SELECT * FROM vtiger_wf_settings WHERE module_name = ? AND active = 1 AND `trigger` = '" . ${${"GLOBALS"}["qkrtqbzspqei"]} . "'";
         }
     }
     ${${"GLOBALS"}["tydgcp"]} = \Workflow\VtUtils::pquery(${${"GLOBALS"}["nlgdcz"]}, array(${$wvdjedue}));
     if ($adb->num_rows(${${"GLOBALS"}["tydgcp"]}) > 0) {
         ${${"GLOBALS"}["dyrorjnwams"]} = array();
         ${"GLOBALS"}["iqlpcfgsfg"] = "result";
         while (${${"GLOBALS"}["mghkudhvefbq"]} = $adb->fetch_array(${${"GLOBALS"}["iqlpcfgsfg"]})) {
             $fnliuzmjfu = "user";
             ${"GLOBALS"}["fmsvsgxfoein"] = "user";
             ${"GLOBALS"}["nsuivkxmtsyc"] = "row";
             if (${${"GLOBALS"}["mghkudhvefbq"]}["execution_user"] == "0") {
                 ${${"GLOBALS"}["mghkudhvefbq"]}["execution_user"] = $current_user->id;
             }
             if (empty(${${"GLOBALS"}["nsuivkxmtsyc"]}["execution_user"])) {
                 $teknlho = "row";
                 ${$teknlho}["execution_user"] = \Users::getActiveAdminId();
             }
             ${"GLOBALS"}["qclwupfymm"] = "row";
             ${${"GLOBALS"}["fmsvsgxfoein"]} = new \Users();
             $user->retrieveCurrentUserInfoFromFile(${${"GLOBALS"}["mghkudhvefbq"]}["execution_user"]);
             ${${"GLOBALS"}["ogulunomx"]} = new \Workflow\Main(${${"GLOBALS"}["qclwupfymm"]}["id"], false, ${$fnliuzmjfu});
             if ($wf->checkAuth("exec", ${${"GLOBALS"}["nyuqdt"]})) {
                 $undhwiaz = "wf";
                 ${${"GLOBALS"}["dyrorjnwams"]}[] = ${$undhwiaz};
             }
         }
         return ${${"GLOBALS"}["dyrorjnwams"]};
     }
     return array();
 }
Exemple #2
0
 public function getStatistikForm($execId = null)
 {
     ${"GLOBALS"}["ezrqcuyd"] = "LogInformation";
     ${"GLOBALS"}["vldyrxbu"] = "result";
     ${"GLOBALS"}["gchorkkzjld"] = "sql";
     $sfxotv = "return";
     global $adb;
     ${"GLOBALS"}["jxwklhbjgv"] = "row";
     $dojodhe = "durationTime";
     ${"GLOBALS"}["kzfdlyxxda"] = "return";
     ${${"GLOBALS"}["ifelppoie"]} = $this->getView();
     $tmpwcqf = "result";
     $pdgdmbsiar = "execId";
     ${${"GLOBALS"}["gchorkkzjld"]} = "SELECT `durationms` FROM vtiger_wf_log WHERE blockID = " . $this->_taskID . " ORDER BY timestamp DESC LIMIT 100";
     ${$tmpwcqf} = $adb->query(${${"GLOBALS"}["ulkocil"]});
     ${"GLOBALS"}["miedlxyqu"] = "durationTime";
     if (!empty(${$pdgdmbsiar})) {
         ${${"GLOBALS"}["ulkocil"]} = "SELECT `data` FROM vtiger_wf_log WHERE blockID = " . $this->_taskID . " AND execID = ?";
         ${"GLOBALS"}["pohsrj"] = "statResult";
         ${${"GLOBALS"}["pohsrj"]} = \Workflow\VtUtils::pquery(${${"GLOBALS"}["ulkocil"]}, array(${${"GLOBALS"}["arngjult"]}));
     }
     ${${"GLOBALS"}["aikpgkvgop"]} = array();
     $zvcoibgte = "max";
     ${$zvcoibgte} = 0;
     ${"GLOBALS"}["apqcvqiosl"] = "durationTime";
     while (${${"GLOBALS"}["jxwklhbjgv"]} = $adb->fetch_array(${${"GLOBALS"}["vldyrxbu"]})) {
         $wbbkvzytsu = "row";
         $mbccbnf = "row";
         $wtmfuvoyfwb = "durationTime";
         ${$wtmfuvoyfwb}[] = ${$mbccbnf}["durationms"];
         if (${${"GLOBALS"}["ebugltuav"]} < ${$wbbkvzytsu}["durationms"]) {
             $crggertmg = "max";
             ${$crggertmg} = ${${"GLOBALS"}["lbujtjnghu"]}["durationms"];
         }
     }
     $pcuuifwspq = "viewer";
     ${${"GLOBALS"}["apqcvqiosl"]} = array_reverse(${${"GLOBALS"}["miedlxyqu"]});
     $viewer->assign("execID", empty(${${"GLOBALS"}["arngjult"]}) ? false : ${${"GLOBALS"}["arngjult"]});
     $jnsvbprwwe = "max";
     $viewer->assign("taskId", $this->_taskID);
     $viewer->assign("durations", ${$dojodhe});
     $viewer->assign("maxValue", ${$jnsvbprwwe});
     ob_start();
     ${"GLOBALS"}["cdwsmjegsj"] = "LogInformation";
     if (!empty(${${"GLOBALS"}["arngjult"]})) {
         ${"GLOBALS"}["mxfjsccc"] = "i";
         $tfsuqmf = "countRows";
         $bcwvyulduky = "countRows";
         ${$tfsuqmf} = $adb->num_rows(${${"GLOBALS"}["yvzpvw"]});
         for (${${"GLOBALS"}["mxfjsccc"]} = 0; ${${"GLOBALS"}["oxvepelc"]} < ${$bcwvyulduky}; ${${"GLOBALS"}["oxvepelc"]}++) {
             ${"GLOBALS"}["gqfqmthhctuo"] = "statResult";
             ${"GLOBALS"}["bkfcxqkubauq"] = "data";
             $eixrynduro = "i";
             ${${"GLOBALS"}["iyxcwkakcj"]} = $adb->raw_query_result_rowdata(${${"GLOBALS"}["gqfqmthhctuo"]}, ${$eixrynduro});
             if (!empty(${${"GLOBALS"}["bkfcxqkubauq"]}["data"])) {
                 $ifjcvji = "data";
                 ${"GLOBALS"}["nmjunwl"] = "data";
                 ${${"GLOBALS"}["iyxcwkakcj"]} = unserialize(gzuncompress(${$ifjcvji}["data"]));
                 echo "<pre>";
                 print_r(${${"GLOBALS"}["nmjunwl"]});
                 echo "</pre>";
             }
         }
     }
     if (file_exists("Smarty/templates/modules/Workflow2/taskforms/WfStat" . ucfirst(strtolower($this->_data["type"])) . ".tpl")) {
         $tkrvsyldef = "taskContent";
         ${$tkrvsyldef} = $viewer->fetch(vtlib_getModuleTemplate("Workflow2", "taskforms/WfStat" . ucfirst(strtolower($this->_data["type"])) . ".tpl"));
     }
     ${${"GLOBALS"}["kzfdlyxxda"]} = $this->showStatistikForm(${$pcuuifwspq});
     if (${$sfxotv} !== false) {
         ${"GLOBALS"}["mxthnrkku"] = "return";
         echo ${${"GLOBALS"}["mxthnrkku"]};
     }
     ${${"GLOBALS"}["cdwsmjegsj"]} = ob_get_clean();
     $viewer->assign("LogInformation", ${${"GLOBALS"}["ezrqcuyd"]});
     echo $viewer->view("StatistikPopup.tpl", "Settings:Workflow2", true);
 }
Exemple #3
0
 public static function LockQueueId($queue_id)
 {
     ${${"GLOBALS"}["tjdkacqqpdg"]} = \PearDatabase::getInstance();
     $wuyqwkbnsb = "sql";
     ${${"GLOBALS"}["fjvutiy"]} = "UPDATE vtiger_wf_queue SET locked = 1 WHERE id = ?";
     \Workflow\VtUtils::pquery(${$wuyqwkbnsb}, array(${${"GLOBALS"}["remjfiikk"]}));
 }
Exemple #4
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();
 }
Exemple #5
0
 public static function getFieldsWithBlocksForModule($module_name, $references = false, $refTemplate = "([source]: ([module]) [destination])", $activityType = 'Event')
 {
     ${"GLOBALS"}["gmkxubmgqr"] = "module";
     ${"GLOBALS"}["tckseueixvr"] = "start";
     ${"GLOBALS"}["nyjbntl"] = "activityType";
     global $current_language, $adb, $app_strings;
     \Vtiger_Cache::${${"GLOBALS"}["xmcqwbwjg"]} = false;
     ${${"GLOBALS"}["tckseueixvr"]} = microtime(true);
     if (empty(${${"GLOBALS"}["edetoedh"]}) && ${${"GLOBALS"}["joqrqyq"]} == true) {
         ${${"GLOBALS"}["edetoedh"]} = "([source]: ([module]) [destination])";
     }
     include_once "vtlib/Vtiger/Module.php";
     $ixhjukqo = "blocks";
     ${"GLOBALS"}["uwtsvavwe"] = "module_name";
     if (${${"GLOBALS"}["luxsvwk"]} == "Calendar" && ${${"GLOBALS"}["nyjbntl"]} == "Task") {
         $htxexutwez = "module_name";
         ${$htxexutwez} = "Events";
     }
     ${"GLOBALS"}["kgthgvdjgye"] = "langModule";
     ${"GLOBALS"}["lefzyldkv"] = "rewriteFields";
     ${${"GLOBALS"}["dmoyzhsy"]} = ${${"GLOBALS"}["uwtsvavwe"]};
     ${${"GLOBALS"}["fqnjxp"]} = Vtiger_Module::getInstance(${${"GLOBALS"}["gmkxubmgqr"]});
     ${"GLOBALS"}["cembvymw"] = "moduleFields";
     ${$ixhjukqo} = Vtiger_Block::getAllForModule(${${"GLOBALS"}["fqnjxp"]});
     if (${${"GLOBALS"}["dmoyzhsy"]} != "Events") {
         $yurstcpqdq = "langModule";
         ${"GLOBALS"}["odbegiygfxd"] = "module";
         ${$yurstcpqdq} = ${${"GLOBALS"}["odbegiygfxd"]};
     } else {
         ${${"GLOBALS"}["hfdgvhqkst"]} = "Calendar";
     }
     ${${"GLOBALS"}["odweooain"]} = return_module_language(${${"GLOBALS"}["tlshanufgw"]}, ${${"GLOBALS"}["kgthgvdjgye"]});
     ${${"GLOBALS"}["jthlbvy"]} = array();
     ${${"GLOBALS"}["kpscbcovfo"]} = array();
     ${${"GLOBALS"}["iwqzew"]} = array();
     if (is_array(${${"GLOBALS"}["bnieibcdywdw"]})) {
         ${"GLOBALS"}["xtfdbcuqc"] = "crmid";
         $xolbwjrhxv = "first_key";
         $pgrvdhpa = "moduleFields";
         $zqkmhpowhabu = "blocks";
         foreach (${$zqkmhpowhabu} as ${${"GLOBALS"}["crfolbxyozx"]}) {
             $ujbljy = "fields";
             $dzmyfbqqwco = "fields";
             ${$ujbljy} = Vtiger_Field::getAllForBlock(${${"GLOBALS"}["crfolbxyozx"]}, ${${"GLOBALS"}["fqnjxp"]});
             $dccevwqqnq = "fields";
             if (empty(${${"GLOBALS"}["tobmkodw"]}) || !is_array(${$dzmyfbqqwco})) {
                 continue;
             }
             foreach (${$dccevwqqnq} as ${${"GLOBALS"}["eswxvskrqln"]}) {
                 $qxwayslw = "field";
                 $field->label = getTranslatedString($field->label, ${${"GLOBALS"}["hfdgvhqkst"]});
                 $field->type = new StdClass();
                 $field->type->name = self::getFieldTypeName($field->uitype);
                 if ($field->type->name == "picklist" || $field->type->name == "multipicklist") {
                     ${"GLOBALS"}["iksvvksq"] = "currencies";
                     $oddvouy = "currencies";
                     ${"GLOBALS"}["ljzqlguwfbi"] = "language";
                     $pmkgbyr = "language";
                     switch ($field->name) {
                         case "hdnTaxType":
                             $field->type->picklistValues = array("group" => "Group", "individual" => "Individual");
                             break;
                         case "currency_id":
                             $field->type->picklistValues = array();
                             ${$oddvouy} = getAllCurrencies();
                             foreach (${${"GLOBALS"}["sxrrhtqc"]} as ${${"GLOBALS"}["iksvvksq"]}) {
                                 ${"GLOBALS"}["qbjjpiyh"] = "currencies";
                                 $field->type->picklistValues[${${"GLOBALS"}["qbjjpiyh"]}["currency_id"]] = ${${"GLOBALS"}["sxrrhtqc"]}["currencylabel"];
                             }
                             break;
                         default:
                             ${${"GLOBALS"}["ljzqlguwfbi"]} = \Vtiger_Language_Handler::getModuleStringsFromFile(${${"GLOBALS"}["tlshanufgw"]}, $field->block->module->name);
                             if (empty(${$pmkgbyr})) {
                                 ${"GLOBALS"}["buzjfrxmswvm"] = "language";
                                 ${${"GLOBALS"}["buzjfrxmswvm"]} = \Vtiger_Language_Handler::getModuleStringsFromFile("en_us", $field->block->module->name);
                             }
                             $field->type->picklistValues = getAllPickListValues($field->name, ${${"GLOBALS"}["fztutztrkj"]}["languageStrings"]);
                             break;
                     }
                 }
                 if ($field->uitype == 26) {
                     $field->type->name = "picklist";
                     ${"GLOBALS"}["xrxfzxhc"] = "sql";
                     ${${"GLOBALS"}["xrxfzxhc"]} = "SELECT * FROM vtiger_attachmentsfolder ORDER BY foldername";
                     ${${"GLOBALS"}["yxurcyqzbn"]} = $adb->query(${${"GLOBALS"}["trhmtwd"]});
                     $field->type->picklistValues = array();
                     while (${${"GLOBALS"}["mnxpcyvt"]} = $adb->fetchByAssoc(${${"GLOBALS"}["yxurcyqzbn"]})) {
                         ${"GLOBALS"}["njqgidyefk"] = "row";
                         $field->type->picklistValues[${${"GLOBALS"}["njqgidyefk"]}["folderid"]] = ${${"GLOBALS"}["mnxpcyvt"]}["foldername"];
                     }
                 }
                 if (in_array($field->uitype, self::${${"GLOBALS"}["rjqzcd"]})) {
                     ${${"GLOBALS"}["szphwyugr"]} = self::getModuleForReference($field->block->module->id, $field->name, $field->uitype);
                     $field->type->refersTo = ${${"GLOBALS"}["szphwyugr"]};
                 }
                 if ($field->type->name == "reference") {
                     ${"GLOBALS"}["xejhaonrgfo"] = "field";
                     $zqrofcrhbmr = "referenceFields";
                     ${$zqrofcrhbmr}[] = ${${"GLOBALS"}["xejhaonrgfo"]};
                 }
                 $hmawaqcn = "langModule";
                 $badccgfkws = "references";
                 if (${$badccgfkws} !== false) {
                     $hsfvndvp = "addReferences";
                     ${"GLOBALS"}["xjiagoolbl"] = "addReferences";
                     $zsvcjvgvzpi = "addReferences";
                     $hcfjsh = "addReferences";
                     $qrnywhi = "addReferences";
                     $ikrxlsms = "addReferences";
                     ${"GLOBALS"}["wahhwrswkass"] = "addReferences";
                     ${"GLOBALS"}["jqkkoegemsx"] = "addReferences";
                     ${"GLOBALS"}["lvdytrgaztu"] = "addReferences";
                     $zttgnnv = "field";
                     ${"GLOBALS"}["rchdzecqkwbn"] = "field";
                     $quunxooexcy = "field";
                     $xsyuflgxpgdz = "addReferences";
                     $vfrcqsgkwos = "field";
                     $yckigulnbsk = "addReferences";
                     ${"GLOBALS"}["issxnl"] = "field";
                     ${"GLOBALS"}["fyhpevqw"] = "addReferences";
                     ${"GLOBALS"}["ypyeok"] = "field";
                     ${"GLOBALS"}["vfgwlu"] = "field";
                     ${"GLOBALS"}["tqjctxrneb"] = "field";
                     $hgnhsyoeuxsi = "field";
                     switch ($field->uitype) {
                         case "51":
                             ${${"GLOBALS"}["kpscbcovfo"]}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "Accounts");
                             break;
                         case "52":
                             ${${"GLOBALS"}["xjiagoolbl"]}[] = array(${$vfrcqsgkwos}, "Users");
                             break;
                         case "53":
                             ${$hsfvndvp}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "Users");
                             break;
                         case "57":
                             ${${"GLOBALS"}["kpscbcovfo"]}[] = array(${${"GLOBALS"}["issxnl"]}, "Contacts");
                             break;
                         case "58":
                             ${$xsyuflgxpgdz}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "Campaigns");
                             break;
                         case "59":
                             ${${"GLOBALS"}["kpscbcovfo"]}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "Products");
                             break;
                         case "73":
                             ${${"GLOBALS"}["lvdytrgaztu"]}[] = array(${$hgnhsyoeuxsi}, "Accounts");
                             break;
                         case "75":
                             ${${"GLOBALS"}["jqkkoegemsx"]}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "Vendors");
                             break;
                         case "81":
                             ${$hcfjsh}[] = array(${${"GLOBALS"}["tqjctxrneb"]}, "Vendors");
                             break;
                         case "76":
                             ${$yckigulnbsk}[] = array(${${"GLOBALS"}["vfgwlu"]}, "Potentials");
                             break;
                         case "78":
                             ${$ikrxlsms}[] = array(${${"GLOBALS"}["rchdzecqkwbn"]}, "Quotes");
                             break;
                         case "80":
                             ${$qrnywhi}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "SalesOrder");
                             break;
                         case "66":
                             ${${"GLOBALS"}["kpscbcovfo"]}[] = array(${$zttgnnv}, "Accounts");
                             ${${"GLOBALS"}["kpscbcovfo"]}[] = array(${$quunxooexcy}, "Leads");
                             ${$zsvcjvgvzpi}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "Potentials");
                             ${${"GLOBALS"}["kpscbcovfo"]}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "HelpDesk");
                             ${${"GLOBALS"}["wahhwrswkass"]}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "Campaigns");
                             break;
                         case "68":
                             ${${"GLOBALS"}["kpscbcovfo"]}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "Accounts");
                             ${${"GLOBALS"}["fyhpevqw"]}[] = array(${${"GLOBALS"}["ypyeok"]}, "Contacts");
                             break;
                         case "10":
                             ${${"GLOBALS"}["yxurcyqzbn"]} = \Workflow\VtUtils::pquery("SELECT relmodule FROM `vtiger_fieldmodulerel` WHERE fieldid = ?", array($field->id));
                             while (${${"GLOBALS"}["rpgtsocbjybb"]} = $adb->fetch_array(${${"GLOBALS"}["yxurcyqzbn"]})) {
                                 ${"GLOBALS"}["etvsumie"] = "data";
                                 ${${"GLOBALS"}["kpscbcovfo"]}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, ${${"GLOBALS"}["etvsumie"]}["relmodule"]);
                             }
                             break;
                     }
                 }
                 ${${"GLOBALS"}["jthlbvy"]}[getTranslatedString($block->label, ${$hmawaqcn})][] = ${$qxwayslw};
             }
         }
         ${"GLOBALS"}["bysquph"] = "InventoryModules";
         ${${"GLOBALS"}["xtfdbcuqc"]} = new StdClass();
         $crmid->name = "crmid";
         $crmid->label = "ID";
         $crmid->type = "string";
         reset(${${"GLOBALS"}["jthlbvy"]});
         ${${"GLOBALS"}["hohxkflr"]} = key(${${"GLOBALS"}["jthlbvy"]});
         ${${"GLOBALS"}["jthlbvy"]}[${$xolbwjrhxv}] = array_merge(array(${${"GLOBALS"}["jyctope"]}), ${$pgrvdhpa}[${${"GLOBALS"}["hohxkflr"]}]);
         if (in_array(${${"GLOBALS"}["dmoyzhsy"]}, self::${${"GLOBALS"}["bysquph"]})) {
             ${"GLOBALS"}["henyvjuckpi"] = "module";
             ${"GLOBALS"}["gxxfsgd"] = "first_key";
             ${${"GLOBALS"}["jyctope"]} = new StdClass();
             $kpjfmvzmghs = "first_key";
             ${"GLOBALS"}["cwnxyjn"] = "moduleFields";
             ${"GLOBALS"}["ktmspctvob"] = "crmid";
             $crmid->name = "hdnS_H_Amount";
             $crmid->label = getTranslatedString("Shipping & Handling Charges", ${${"GLOBALS"}["henyvjuckpi"]});
             $crmid->type = "string";
             reset(${${"GLOBALS"}["jthlbvy"]});
             ${${"GLOBALS"}["hohxkflr"]} = key(${${"GLOBALS"}["jthlbvy"]});
             ${${"GLOBALS"}["cwnxyjn"]}[${${"GLOBALS"}["gxxfsgd"]}] = array_merge(${${"GLOBALS"}["jthlbvy"]}[${$kpjfmvzmghs}], array(${${"GLOBALS"}["ktmspctvob"]}));
         }
     }
     ${"GLOBALS"}["upopmkvwurai"] = "addReferences";
     ${${"GLOBALS"}["lefzyldkv"]} = array("assigned_user_id" => "smownerid");
     ${"GLOBALS"}["scqvcmen"] = "cacheEnable";
     if (${${"GLOBALS"}["joqrqyq"]} !== false) {
         ${"GLOBALS"}["dsrwuu"] = "addReferences";
         ${"GLOBALS"}["sslclqqnfbw"] = "field";
         $kmoixogjhxu = "field";
         ${$kmoixogjhxu} = new StdClass();
         $field->name = "current_user";
         $field->label = getTranslatedString("LBL_CURRENT_USER", "Workflow2");
         ${${"GLOBALS"}["dsrwuu"]}[] = array(${${"GLOBALS"}["sslclqqnfbw"]}, "Users");
         if (!empty(${${"GLOBALS"}["iwqzew"]})) {
             foreach (${${"GLOBALS"}["iwqzew"]} as ${${"GLOBALS"}["mmuqgvsylc"]}) {
                 $xvnqxelu = "first_key";
                 $xsxglkjgmm = "crmid";
                 $sbihixyuih = "crmid";
                 ${$xsxglkjgmm} = new StdClass();
                 $crmid->name = str_replace(array("[source]", "[module]", "[destination]"), array($refField->name, "ModuleName", "ModuleName"), ${${"GLOBALS"}["edetoedh"]});
                 $bdnfiyflkc = "moduleFields";
                 ${"GLOBALS"}["etcbqubpb"] = "moduleFields";
                 $crmid->label = $refField->label . " / Modulename";
                 $dmskkogg = "first_key";
                 $crmid->type = "string";
                 reset(${${"GLOBALS"}["etcbqubpb"]});
                 ${$xvnqxelu} = key(${${"GLOBALS"}["jthlbvy"]});
                 ${${"GLOBALS"}["jthlbvy"]}[${${"GLOBALS"}["hohxkflr"]}] = array_merge(${$bdnfiyflkc}[${$dmskkogg}], array(${$sbihixyuih}));
             }
         }
     }
     if (is_array(${${"GLOBALS"}["upopmkvwurai"]})) {
         ${"GLOBALS"}["fokpcifdbil"] = "addReferences";
         foreach (${${"GLOBALS"}["fokpcifdbil"]} as ${${"GLOBALS"}["mmuqgvsylc"]}) {
             ${"GLOBALS"}["cxtkmhcqyn"] = "fields";
             ${"GLOBALS"}["qcadikqoac"] = "fields";
             ${${"GLOBALS"}["cxtkmhcqyn"]} = self::getFieldsForModule(${${"GLOBALS"}["mmuqgvsylc"]}[1]);
             foreach (${${"GLOBALS"}["qcadikqoac"]} as ${${"GLOBALS"}["eswxvskrqln"]}) {
                 ${"GLOBALS"}["ivtfijph"] = "app_strings";
                 $hatpiz = "refTemplate";
                 ${"GLOBALS"}["ithqigutpn"] = "refField";
                 ${"GLOBALS"}["dhtzrkv"] = "app_strings";
                 ${"GLOBALS"}["bmvbvwup"] = "refField";
                 $sxktrqfnbw = "rewriteFields";
                 ${"GLOBALS"}["rsspnimhzpn"] = "refField";
                 $skfigxcabc = "name";
                 $field->label = "(" . (isset(${${"GLOBALS"}["ivtfijph"]}[${${"GLOBALS"}["rsspnimhzpn"]}[1]]) ? ${${"GLOBALS"}["dhtzrkv"]}[${${"GLOBALS"}["mmuqgvsylc"]}[1]] : ${${"GLOBALS"}["ithqigutpn"]}[1]) . ") " . $field->label;
                 if (!empty(${$sxktrqfnbw}[${${"GLOBALS"}["mmuqgvsylc"]}[0]->name])) {
                     $uykopfvgof = "rewriteFields";
                     ${${"GLOBALS"}["mmuqgvsylc"]}[0]->name = ${$uykopfvgof}[${${"GLOBALS"}["mmuqgvsylc"]}[0]->name];
                 }
                 ${"GLOBALS"}["ufmoguryf"] = "moduleFields";
                 ${${"GLOBALS"}["urtuhewdod"]} = str_replace(array("[source]", "[module]", "[destination]"), array(${${"GLOBALS"}["mmuqgvsylc"]}[0]->name, ${${"GLOBALS"}["mmuqgvsylc"]}[1], $field->name), ${$hatpiz});
                 $kgqlxq = "field";
                 $field->name = ${$skfigxcabc};
                 ${${"GLOBALS"}["ufmoguryf"]}["References (" . ${${"GLOBALS"}["bmvbvwup"]}[0]->label . ")"][] = ${$kgqlxq};
             }
         }
     }
     \Vtiger_Cache::${${"GLOBALS"}["scqvcmen"]} = true;
     return ${${"GLOBALS"}["cembvymw"]};
 }