function wf_changedfields($crmid, $internalFields = false)
 {
     if (empty($crmid)) {
         return false;
     }
     $objRecord = \Workflow\VTEntity::getForId($crmid);
     return \Workflow\EntityDelta::changeFields($objRecord->getModuleName(), $crmid, $internalFields);
 }
Ejemplo n.º 2
0
 public function handleEvent($handlerType, $entityData)
 {
     ob_start();
     $buqkvslhibra = "wfManager";
     if (isset($_REQUEST["tableblocks"])) {
         $fcbnalas = "tableBlocks";
         ${$fcbnalas} = $_REQUEST["tableblocks"];
         unset($_REQUEST["tableblocks"]);
     }
     ${$buqkvslhibra} = new \Workflow\Manager();
     ${"GLOBALS"}["miokdjdmdfu"] = "handlerType";
     EntityDelta::refreshDelta($entityData->getModuleName(), $entityData->focus->id);
     if (empty($_SERVER["HTTP_X_REQUESTED_WITH"]) || strtolower($_SERVER["HTTP_X_REQUESTED_WITH"]) != "xmlhttprequest") {
         Workflow2::${${"GLOBALS"}["ulovgcim"]} = false;
     }
     Workflow2::log($entityData->focus->id, 0, 0, "Start EventHandler");
     $snkisgyf = "tableBlocks";
     if ($entityData->getModuleName() == "Emails") {
         ${"GLOBALS"}["wykgomknt"] = "recordid";
         $blnoxjqmlwd = "from_email";
         ${${"GLOBALS"}["jivgrzryssor"]} = explode("|", $entityData->get("parent_id"));
         if (!empty($_REQUEST["pmodule"]) && !empty($_REQUEST["sorce_ids"])) {
             $swvglcac = "parent_ids";
             ${$swvglcac}[] = $_REQUEST["sorce_ids"];
         }
         $lioxtho = "from_email";
         ${$blnoxjqmlwd} = $entityData->get("from_email");
         ${${"GLOBALS"}["bichpdpooc"]} = $entityData->get("saved_toid");
         if (empty(${${"GLOBALS"}["jouqmwctl"]})) {
             if (!empty($_REQUEST["from_email"])) {
                 ${"GLOBALS"}["rbujprnbgdx"] = "email_val";
                 ${"GLOBALS"}["fitxeffb"] = "type";
                 list(${${"GLOBALS"}["fitxeffb"]}, ${${"GLOBALS"}["mhnoosvdd"]}) = explode("::", addslashes($_REQUEST["from_email"]), 2);
                 if (${${"GLOBALS"}["rbujprnbgdx"]} != "") {
                     global $adb;
                     if (${${"GLOBALS"}["bhmfosqagd"]} == "a") {
                         ${"GLOBALS"}["fqvigntr"] = "sql_a";
                         ${"GLOBALS"}["jncqqplmd"] = "from_email";
                         $igxjijlcydv = "sql_a";
                         ${${"GLOBALS"}["fqvigntr"]} = "select * from vtiger_systems where from_email_field != ? AND server_type = ?";
                         ${${"GLOBALS"}["xprvdcgf"]} = $adb->pquery(${$igxjijlcydv}, array("", "email"));
                         ${${"GLOBALS"}["jncqqplmd"]} = $adb->query_result(${${"GLOBALS"}["xprvdcgf"]}, 0, "from_email_field");
                     } else {
                         ${"GLOBALS"}["evgeluzfpjrb"] = "sql_u";
                         ${"GLOBALS"}["jbhzfdfy"] = "sql_u";
                         ${${"GLOBALS"}["evgeluzfpjrb"]} = "SELECT first_name, last_name, " . ${${"GLOBALS"}["bhmfosqagd"]} . " AS email  FROM vtiger_users WHERE id = '" . ${${"GLOBALS"}["mhnoosvdd"]} . "'";
                         ${${"GLOBALS"}["eldowmraukw"]} = $adb->pquery(${${"GLOBALS"}["jbhzfdfy"]}, array());
                         ${${"GLOBALS"}["jouqmwctl"]} = $adb->query_result(${${"GLOBALS"}["eldowmraukw"]}, 0, "email");
                     }
                 }
             } else {
                 $gpvvsxkue = "from_email";
                 global $current_user;
                 ${$gpvvsxkue} = $current_user->column_fields["email1"];
             }
         }
         ${${"GLOBALS"}["ijfuwupmdh"]} = array("subject" => $entityData->get("subject"), "content" => $entityData->get("description"), "from" => ${$lioxtho}, "to" => ${${"GLOBALS"}["bichpdpooc"]});
         foreach (${${"GLOBALS"}["jivgrzryssor"]} as ${${"GLOBALS"}["wykgomknt"]}) {
             $ypgvphf = "recordid";
             if (empty(${${"GLOBALS"}["oubotd"]})) {
                 continue;
             }
             ${${"GLOBALS"}["lcnizm"]} = VTEntity::getForId(${$ypgvphf});
             if (${${"GLOBALS"}["lcnizm"]} !== false) {
                 ${"GLOBALS"}["lxtohylj"] = "workflows";
                 ${${"GLOBALS"}["lxtohylj"]} = $wfManager->GetWorkflows($context->getModuleName(), Workflow\Main::SENDMAIL_START);
                 if (count(${${"GLOBALS"}["qyirwsbmmu"]}) > 0) {
                     ${"GLOBALS"}["ccnmigsavy"] = "maildata";
                     $smkkdars = "wf";
                     $context->setEnvironment("email", ${${"GLOBALS"}["ccnmigsavy"]});
                     foreach (${${"GLOBALS"}["qyirwsbmmu"]} as ${$smkkdars}) {
                         $wf->setExecutionTrigger("WF2_CREATION");
                         if (!$context->isAvailable()) {
                             break;
                         }
                         $wf->setContext(${${"GLOBALS"}["lcnizm"]});
                         if ($wf->checkCondition(${${"GLOBALS"}["zltonpc"]})) {
                             $wf->start();
                         }
                     }
                 }
             }
         }
     }
     if ($entityData->getModuleName() == "ModComments") {
         ${${"GLOBALS"}["iasgnhr"]} = array("commentcontent" => $entityData->get("commentcontent"), "assigned_user_id" => $entityData->get("assigned_user_id"));
         $tvesqluqa = "parent_ids";
         ${$tvesqluqa} = array($entityData->get("related_to"));
         foreach (${${"GLOBALS"}["jivgrzryssor"]} as ${${"GLOBALS"}["oubotd"]}) {
             ${${"GLOBALS"}["lcnizm"]} = VTEntity::getForId(${${"GLOBALS"}["oubotd"]});
             $context->loadEnvironment(array_merge($context->getEnvironment(), ${${"GLOBALS"}["iasgnhr"]}));
             if (${${"GLOBALS"}["lcnizm"]} !== false) {
                 $fpzckemsvm = "wf";
                 ${${"GLOBALS"}["qyirwsbmmu"]} = $wfManager->GetWorkflows($context->getModuleName(), Workflow\Main::COMMENT_START);
                 foreach (${${"GLOBALS"}["qyirwsbmmu"]} as ${$fpzckemsvm}) {
                     $wwheuivbjc = "context";
                     $wf->setExecutionTrigger("WF2_CREATION");
                     if (!$context->isAvailable()) {
                         break;
                     }
                     $gtfpogfmp = "entityData";
                     $wf->setContext(${$wwheuivbjc});
                     if ($wf->checkCondition(${$gtfpogfmp})) {
                         $wf->start();
                     }
                 }
             }
         }
     }
     if (${${"GLOBALS"}["miokdjdmdfu"]} == "vtiger.entity.aftersave") {
         $obmqbokjajz = "context";
         ${$obmqbokjajz} = VTEntity::getForId($entityData->focus->id, $entityData->getModuleName());
         ${"GLOBALS"}["ubninbunb"] = "wf";
         ${"GLOBALS"}["jefljf"] = "context";
         Queue::updateDynamicDate(${${"GLOBALS"}["jefljf"]});
         ${${"GLOBALS"}["qyirwsbmmu"]} = $wfManager->GetWorkflows($entityData->getModuleName(), array(Workflow\Main::ON_FIRST_SAVE, Workflow\Main::ON_EVERY_SAVE));
         ${${"GLOBALS"}["qwvmufvez"]} = $entityData->isNew();
         foreach (${${"GLOBALS"}["qyirwsbmmu"]} as ${${"GLOBALS"}["ubninbunb"]}) {
             $uhytlcpqip = "context";
             if (!$wf->checkExecuteCondition(${$uhytlcpqip})) {
                 continue;
             }
             $wf->setExecutionTrigger(${${"GLOBALS"}["qwvmufvez"]} ? "WF2_CREATION" : "WF2_EVERY_SAVE");
             Workflow2::log($entityData->focus->id, $wf->getId(), 0, "Found WF");
             $fbdjnio = "isNew";
             if (PHP_SAPI === "cli") {
                 echo "Start of Workflow " . $wf->getId() . "\n";
             }
             ${${"GLOBALS"}["lcnizm"]} = VTEntity::getForId($entityData->focus->id, $entityData->getModuleName());
             $context->setIsNew(${$fbdjnio});
             if (!$context->isAvailable()) {
                 break;
             }
             $wf->setContext(${${"GLOBALS"}["lcnizm"]});
             if ($wf->checkCondition(${${"GLOBALS"}["zltonpc"]})) {
                 $wf->start();
                 if ($wf->getSuccessRedirection() !== false) {
                     header("Location:" . $wf->getSuccessRedirection());
                     exit;
                 }
             }
         }
     }
     if (${${"GLOBALS"}["tgrrmbvg"]} == "vtiger.entity.beforedelete") {
         ${${"GLOBALS"}["qyirwsbmmu"]} = $wfManager->GetWorkflows($entityData->getModuleName(), array(Workflow\Main::BEFOREDELETE_START));
         foreach (${${"GLOBALS"}["qyirwsbmmu"]} as ${${"GLOBALS"}["moypxyiw"]}) {
             if (!$wf->checkExecuteCondition(${${"GLOBALS"}["lcnizm"]})) {
                 continue;
             }
             $wf->setExecutionTrigger(Workflow\Main::BEFOREDELETE_START);
             Workflow2::log($entityData->focus->id, $wf->getId(), 0, "Found WF");
             if (PHP_SAPI === "cli") {
                 echo "Start of Workflow " . $wf->getId() . "\n";
             }
             ${${"GLOBALS"}["lcnizm"]} = VTEntity::getForId($entityData->focus->id, $entityData->getModuleName());
             $context->setIsNew(false);
             if (!$context->isAvailable()) {
                 break;
             }
             $wf->setContext(${${"GLOBALS"}["lcnizm"]});
             if ($wf->checkCondition(${${"GLOBALS"}["zltonpc"]})) {
                 $wf->start();
                 if ($wf->getSuccessRedirection() !== false) {
                     Workflow2::error_handler(E_NONBREAK_ERROR, "Redirections do not work on \"before delete\" triggered Workflows.");
                 }
             }
         }
     }
     if (isset(${$snkisgyf})) {
         $_REQUEST["tableblocks"] = ${${"GLOBALS"}["ujnutvf"]};
     }
     Workflow2::${${"GLOBALS"}["ihoxvzlniq"]} = false;
 }
 public function checkValue($context, $key, $fieldvalue, $config, $checkConfig)
 {
     // old check functions
     $checkvalue = $config['value'];
     switch ($key) {
         case "equal":
             // Tested by swa 2016-01-27
             if ($fieldvalue == $checkvalue) {
                 return true;
             }
             return false;
             break;
         case "contains":
             // Tested by swa 2016-01-27
             if (strpos($fieldvalue, $checkvalue) !== false) {
                 return true;
             }
             return false;
             break;
         case "starts_with":
             // Tested by swa 2016-01-27
             if (strlen($fieldvalue) < strlen($checkvalue)) {
                 return false;
             }
             return substr($fieldvalue, 0, strlen($checkvalue)) == $checkvalue;
             break;
         case "ends_with":
             // Tested by swa 2016-01-27
             if (strlen($fieldvalue) < strlen($checkvalue)) {
                 return false;
             }
             return substr($fieldvalue, strlen($fieldvalue) - strlen($checkvalue)) == $checkvalue;
             break;
         case "has_changed":
             // Tested by swa 2016-01-27
             $hasChanged = \Workflow\EntityDelta::hasChanged($context->getModuleName(), $context->getId(), $checkConfig["field"]);
             $checkvalue = trim($checkvalue);
             if (empty($checkvalue)) {
                 return $hasChanged;
             } else {
                 return $hasChanged && $checkvalue == $fieldvalue;
             }
             break;
         case "after":
         case "bigger":
             // Tested by swa 2016-01-27
             if ($fieldvalue > $checkvalue) {
                 return true;
             }
             return false;
             break;
         case "before":
         case "lower":
             // Tested by swa 2016-01-27
             if ($fieldvalue < $checkvalue) {
                 return true;
             }
             return false;
             break;
         case "is_empty":
             // Tested by swa 2016-01-27
             $fieldvalue = trim($fieldvalue, "0.");
             if (empty($fieldvalue)) {
                 return true;
             }
             return false;
             break;
         case "date_empty":
             // Tested by swa 2016-01-27
             $fieldvalue = trim($fieldvalue, ".");
             if (empty($fieldvalue) || $fieldvalue == "0000-00-00") {
                 return true;
             }
             return false;
             break;
         case "is_checked":
             // Tested by swa 2016-01-27
             if ($fieldvalue == "1") {
                 return true;
             }
             return false;
             break;
         case "is_numeric":
             // Tested by swa 2016-01-27
             return is_numeric($fieldvalue);
             break;
         case "today":
             // Tested by swa 2016-01-27
             return date('Y-m-d', time()) == date('Y-m-d', strtotime($fieldvalue));
             break;
         case "yesterday":
             // Tested by swa 2016-01-27
             return date('Y-m-d', time() - 86400) == date('Y-m-d', strtotime($fieldvalue));
             break;
         case "tomorrow":
             // Tested by swa 2016-01-27
             return date('Y-m-d', time() + 86400) == date('Y-m-d', strtotime($fieldvalue));
             break;
     }
     $firstDay = false;
     // date calculations
     switch ($key) {
         case 'between':
             // Tested by swa 2016-01-27
             $firstDay = date("Y-m-d", strtotime($config['from']));
             $lastDay = date("Y-m-d", strtotime($config['to']));
             break;
         case 'current':
             // Tested by swa 2016-01-27
             switch ($config['type']) {
                 case 'day':
                     //$lastweek0 = date("Y-m-d", strtotime("-2 week Sunday"));
                     $lastDay = $firstDay = date('Y-m-d');
                     break;
                 case 'week':
                     $firstDay = date("Y-m-d", strtotime('last Sunday'));
                     $lastDay = date("Y-m-d", strtotime('this Saturday'));
                     break;
                 case 'month':
                     $firstDay = date("Y-m-d", strtotime('first day of this month'));
                     $lastDay = date("Y-m-d", strtotime('last day of this month'));
                     break;
                 case 'quarter':
                     $dates = $this->get_dates_of_quarter('current', null, 'Y-m-d');
                     $firstDay = $dates['start'];
                     $lastDay = $dates['end'];
                     break;
                 case 'year':
                     $firstDay = date("Y") . '-01-01';
                     $lastDay = date("Y") . '-12-31';
                     break;
             }
             break;
         case 'within_past':
             // Tested by swa 2016-01-27
             switch ($config['type']) {
                 case 'day':
                     //$lastweek0 = date("Y-m-d", strtotime("-2 week Sunday"));
                     $firstDay = date('Y-m-d', strtotime('-' . $config['value'] . ' day'));
                     $lastDay = date("Y-m-d", time() - 86400);
                     break;
                 case 'week':
                     $firstDay = date("Y-m-d", strtotime('-' . $config['value'] . ' week Saturday'));
                     $lastDay = date("Y-m-d", strtotime('last Sunday'));
                     break;
                 case 'month':
                     $firstDay = date("Y-m-d", strtotime('first day of -' . $config['value'] . ' month'));
                     $lastDay = date("Y-m-d", strtotime('last day of last month'));
                     break;
                 case 'quarter':
                     $dateObj = new \DateTime();
                     $currentQuarter = ceil($dateObj->format('n') / 3);
                     $years = floor($config['value'] / 4);
                     $year = date('Y') - $years;
                     $quarter = $currentQuarter - $config['value'] % 4;
                     if ($quarter < 1) {
                         $year -= 1;
                         $quarter = 4 - abs($quarter);
                     }
                     $start = $this->get_dates_of_quarter(intval($quarter), intval($year), 'Y-m-d');
                     $end = $this->get_dates_of_quarter('previous', null, 'Y-m-d');
                     $firstDay = $start['start'];
                     $lastDay = $end['end'];
                     break;
                 case 'year':
                     $firstDay = date("Y") - $config['value'] . '-01-01';
                     $lastDay = date("Y") - 1 . '-12-31';
                     break;
             }
             break;
         case 'within_next':
             // Tested by swa 2016-01-27
             switch ($config['type']) {
                 case 'day':
                     //$lastweek0 = date("Y-m-d", strtotime("-2 week Sunday"));
                     $firstDay = date("Y-m-d", time() + 86400);
                     $lastDay = date('Y-m-d', strtotime('+' . $config['value'] . ' day'));
                     break;
                 case 'week':
                     $firstDay = date("Y-m-d", strtotime('this Sunday'));
                     $lastDay = date("Y-m-d", strtotime('+' . $config['value'] . ' week Saturday'));
                     break;
                 case 'month':
                     $firstDay = date("Y-m-d", strtotime('first day of next month'));
                     $lastDay = date("Y-m-d", strtotime('last day of +' . $config['value'] . ' month'));
                     break;
                 case 'quarter':
                     $dateObj = new \DateTime();
                     $currentQuarter = ceil($dateObj->format('n') / 3);
                     $currentQuarter += $config['value'];
                     if ($currentQuarter % 4 > 0) {
                         $year = date('Y') + intval($currentQuarter / 4);
                         $quarter = $currentQuarter % 4;
                     } else {
                         $year = date('Y') + intval($currentQuarter / 4) - 1;
                         $quarter = 4;
                     }
                     $start = $this->get_dates_of_quarter('next', null, 'Y-m-d');
                     $end = $this->get_dates_of_quarter($quarter, $year, 'Y-m-d');
                     $firstDay = $start['start'];
                     $lastDay = $end['end'];
                     break;
                 case 'year':
                     $firstDay = date("Y") + 1 . '-01-01';
                     $lastDay = date("Y") + $config['value'] . '-12-31';
                     break;
             }
             break;
     }
     if ($firstDay !== false) {
         return $fieldvalue >= $firstDay && $fieldvalue <= $lastDay;
     }
     return false;
 }
Ejemplo 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());
 }
Ejemplo n.º 5
0
 do {
     $gnugeea = "tasks";
     ${"GLOBALS"}["wkyilpg"] = "maxRuntimeMinutes";
     foreach (${$gnugeea} as ${${"GLOBALS"}["qultpew"]}) {
         ${"GLOBALS"}["glortx"] = "task";
         ${"GLOBALS"}["bfoyuyip"] = "task";
         $rwlxhqfdu = "current_user";
         ${"GLOBALS"}["qmkfkak"] = "sql";
         $mrnsyuf = "task";
         ${"GLOBALS"}["gzwenlpbces"] = "task";
         ${"GLOBALS"}["qpxefub"] = "task";
         ${"GLOBALS"}["meugpehyrti"] = "sql";
         $eqwykqys = "task";
         ${$eqwykqys}["task"]->setContinued(true);
         $cguolnxdbosn = "task";
         \Workflow\EntityDelta::unserializeDelta(${${"GLOBALS"}["glortx"]}["delta"]);
         ${"GLOBALS"}["tkiyeergxvw"] = "wfMain";
         ${${"GLOBALS"}["tkiyeergxvw"]} = new \Workflow\Main(${${"GLOBALS"}["bfoyuyip"]}["id"], ${${"GLOBALS"}["qultpew"]}["context"], ${${"GLOBALS"}["gzwenlpbces"]}["user"]);
         $wfMain->setExecutionTrigger("WF2_MANUELL");
         ${$rwlxhqfdu} = ${${"GLOBALS"}["qultpew"]}["user"];
         \Workflow\VTEntity::setUser(${${"GLOBALS"}["qpxefub"]}["user"]);
         ${"GLOBALS"}["xekfzyupsc"] = "sql";
         $_SERVER["runningWorkflow" . ${$mrnsyuf}["id"]] = true;
         ${"GLOBALS"}["cnpunorkudj"] = "result";
         try {
             $xphjewohtig = "task";
             $wfMain->handleTasks(${$xphjewohtig}["task"], ${${"GLOBALS"}["qultpew"]}["task"]->getBlockId());
         } catch (\exception $exp) {
             ${"GLOBALS"}["vcteevpx"] = "exp";
             Workflow2::error_handler(${${"GLOBALS"}["vcteevpx"]});
         }
Ejemplo n.º 6
0
 private function _checkField($check)
 {
     ${"GLOBALS"}["jddomxqeud"] = "fieldvalue";
     $itxrdfjhq = "matches";
     $toedvs = "check";
     ${"GLOBALS"}["bjihnoa"] = "fieldvalue";
     ${"GLOBALS"}["urlegth"] = "fieldvalue";
     ${"GLOBALS"}["lcrgpeyzbq"] = "hasChanged";
     ${"GLOBALS"}["erzkbgspclx"] = "checkvalue";
     preg_match("/(\\w+)|\\(((\\w+) ?\\: \\(([_\\w]+)\\)\\)? (\\w+)\\)?)/", ${${"GLOBALS"}["ppgydjvv"]}["field"], ${$itxrdfjhq});
     $gwpxykdvoch = "fieldvalue";
     if (count(${${"GLOBALS"}["cneagqkui"]}) == 2) {
         $vinfcmby = "targetContext";
         ${$vinfcmby} = $this->_context;
     } else {
         if (${${"GLOBALS"}["cneagqkui"]}[3] != "current_user") {
             ${"GLOBALS"}["kzitgtdwg"] = "targetContext";
             ${${"GLOBALS"}["kzitgtdwg"]} = $this->_context->getReference(${${"GLOBALS"}["cneagqkui"]}[4], ${${"GLOBALS"}["cneagqkui"]}[3]);
         } else {
             ${"GLOBALS"}["gxuqhowmz"] = "targetContext";
             $ummepou = "matches";
             global $current_user;
             ${${"GLOBALS"}["gxuqhowmz"]} = \Workflow\VTEntity::getForId($current_user->id, ${$ummepou}[4]);
         }
         ${"GLOBALS"}["jxxhgoaynk"] = "check";
         if (${${"GLOBALS"}["ipfzawk"]} === false) {
             ${"GLOBALS"}["iritosbyxswi"] = "matches";
             throw new \Exception("couldn't load Reference from Record " . $this->_context->getId() . " [" . $this->_context->getModuleName() . "] (" . ${${"GLOBALS"}["iritosbyxswi"]}[3] . "->" . ${${"GLOBALS"}["cneagqkui"]}[4] . ")");
         }
         ${${"GLOBALS"}["jxxhgoaynk"]}["field"] = ${${"GLOBALS"}["cneagqkui"]}[5];
     }
     ${"GLOBALS"}["cjjptrxeibip"] = "check";
     ${"GLOBALS"}["quwlstl"] = "fieldvalue";
     $xeeymju = "checkvalue";
     ${"GLOBALS"}["vbeftl"] = "fieldvalue";
     if (${${"GLOBALS"}["ppgydjvv"]}["field"] == "smownerid") {
         ${${"GLOBALS"}["ppgydjvv"]}["field"] = "assigned_user_id";
     }
     $yduvefukc = "checkvalue";
     $obntgky = "checkvalue";
     ${${"GLOBALS"}["yutgnzzt"]} = $targetContext->get(${${"GLOBALS"}["ppgydjvv"]}["field"]);
     ${"GLOBALS"}["qlgzdb"] = "fieldvalue";
     $gfodhbqtf = "checkvalue";
     $acrvuhsv = "fieldvalue";
     if (${${"GLOBALS"}["ppgydjvv"]}["mode"] == "value" || empty(${${"GLOBALS"}["ppgydjvv"]}["mode"])) {
         ${${"GLOBALS"}["erpksbpytb"]} = ${${"GLOBALS"}["ppgydjvv"]}["rawvalue"];
         ${"GLOBALS"}["cjzgraey"] = "checkvalue";
         if (strpos(${${"GLOBALS"}["erpksbpytb"]}, "\$") !== false || strpos(${${"GLOBALS"}["cjzgraey"]}, "?") !== false) {
             $ibretppzu = "checkvalue";
             ${"GLOBALS"}["tqehnnjsov"] = "objTemplate";
             ${${"GLOBALS"}["tqehnnjsov"]} = new VTTemplate($this->_context);
             ${$ibretppzu} = $objTemplate->render(${${"GLOBALS"}["erpksbpytb"]});
         }
     } elseif (${${"GLOBALS"}["ppgydjvv"]}["mode"] == "function") {
         $hjummqmcqhx = "check";
         ${"GLOBALS"}["mnriwiq"] = "parser";
         ${${"GLOBALS"}["mnriwiq"]} = new ExpressionParser(${$hjummqmcqhx}["rawvalue"], $this->_context, false);
         try {
             $parser->run();
         } catch (ExpressionException $exp) {
             \Workflow2::error_handler(E_EXPRESSION_ERROR, $exp->getMessage(), "", "");
         }
         ${${"GLOBALS"}["erpksbpytb"]} = $parser->getReturn();
     }
     ${"GLOBALS"}["frcdhbenmj"] = "fieldvalue";
     $this->log("Check field: " . ${${"GLOBALS"}["ppgydjvv"]}["field"] . " (" . ${${"GLOBALS"}["urlegth"]} . ")" . (${${"GLOBALS"}["ppgydjvv"]}["not"] == "1" ? " not" : "") . " " . ${${"GLOBALS"}["ppgydjvv"]}["operation"] . " - " . ${${"GLOBALS"}["erpksbpytb"]});
     $furkdcgmptl = "fieldvalue";
     ${"GLOBALS"}["uxmtblslyhk"] = "checkvalue";
     switch (${${"GLOBALS"}["cjjptrxeibip"]}["operation"]) {
         case "equal":
             if (${${"GLOBALS"}["jddomxqeud"]} == ${${"GLOBALS"}["erpksbpytb"]}) {
                 return true;
             }
             break;
         case "contains":
             if (strpos(${${"GLOBALS"}["qlgzdb"]}, ${${"GLOBALS"}["erpksbpytb"]}) !== false) {
                 return true;
             }
             break;
         case "starts_with":
             if (strlen(${${"GLOBALS"}["yutgnzzt"]}) < strlen(${$xeeymju})) {
                 return false;
             }
             return substr(${$furkdcgmptl}, 0, strlen(${${"GLOBALS"}["erpksbpytb"]})) == ${${"GLOBALS"}["erpksbpytb"]};
             break;
         case "ends_with":
             if (strlen(${${"GLOBALS"}["yutgnzzt"]}) < strlen(${${"GLOBALS"}["uxmtblslyhk"]})) {
                 return false;
             }
             return substr(${${"GLOBALS"}["yutgnzzt"]}, strlen(${${"GLOBALS"}["bjihnoa"]}) - strlen(${$gfodhbqtf})) == ${$yduvefukc};
             break;
         case "has_changed":
             ${${"GLOBALS"}["lcrgpeyzbq"]} = \Workflow\EntityDelta::hasChanged($this->_context->getModuleName(), $this->_context->getId(), ${$toedvs}["field"]);
             ${${"GLOBALS"}["erpksbpytb"]} = trim(${$obntgky});
             if (empty(${${"GLOBALS"}["erzkbgspclx"]})) {
                 ${"GLOBALS"}["lxjmge"] = "hasChanged";
                 return ${${"GLOBALS"}["lxjmge"]};
             } else {
                 return ${${"GLOBALS"}["xdfhplmadyw"]} && ${${"GLOBALS"}["erpksbpytb"]} == ${${"GLOBALS"}["yutgnzzt"]};
             }
             break;
         case "bigger":
             if (${${"GLOBALS"}["yutgnzzt"]} > ${${"GLOBALS"}["erpksbpytb"]}) {
                 return true;
             }
             break;
         case "lower":
             if (${${"GLOBALS"}["quwlstl"]} < ${${"GLOBALS"}["erpksbpytb"]}) {
                 return true;
             }
             break;
         case "is_empty":
             ${${"GLOBALS"}["yutgnzzt"]} = trim(${$acrvuhsv}, "0.");
             if (empty(${${"GLOBALS"}["vbeftl"]})) {
                 return true;
             }
             break;
         case "date_empty":
             ${${"GLOBALS"}["yutgnzzt"]} = trim(${${"GLOBALS"}["yutgnzzt"]}, ".");
             if (empty(${$gwpxykdvoch}) || ${${"GLOBALS"}["yutgnzzt"]} == "0000-00-00") {
                 return true;
             }
             break;
         case "is_checked":
             if (${${"GLOBALS"}["yutgnzzt"]} == "1") {
                 return true;
             }
             break;
         case "is_numeric":
             return is_numeric(${${"GLOBALS"}["frcdhbenmj"]});
             break;
     }
     return false;
 }