コード例 #1
0
ファイル: DownloadFile.php プロジェクト: cin-system/cinrepo
 public function process(Vtiger_Request $request)
 {
     ${"GLOBALS"}["jhslxixksw"] = "id";
     $hbtbpmlh = "path";
     ${"GLOBALS"}["lxinqwn"] = "params";
     ${${"GLOBALS"}["yetinhmxt"]} = PearDatabase::getInstance();
     $ougpgodj = "filename";
     ${${"GLOBALS"}["lxinqwn"]} = $request->getAll();
     ${${"GLOBALS"}["jhslxixksw"]} = $request->get("id");
     $wdittud = "id";
     $hsnxkpbpjgl = "path";
     ${"GLOBALS"}["ospxotjg"] = "filename";
     ${$ougpgodj} = $request->get("filename");
     ${$hbtbpmlh} = vglobal("root_directory") . "/modules/Workflow2/tmp/download/" . ${$wdittud};
     if (!file_exists(${$hsnxkpbpjgl})) {
         \Workflow2::error_handler(E_ERROR, "File to download not found! You could download a file only one time!");
     }
     header("Pragma: public");
     ${"GLOBALS"}["bjnhsjrlsql"] = "path";
     header("Expires: 0");
     header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
     header("Cache-Control: public");
     header("Content-Description: File Transfer");
     header("Content-type: application/octet-stream");
     header("Content-Disposition: attachment; filename=\"" . ${${"GLOBALS"}["ospxotjg"]} . "\"");
     header("Content-Transfer-Encoding: binary");
     header("Content-Length: " . filesize(${${"GLOBALS"}["bjnhsjrlsql"]}));
     @readfile(${${"GLOBALS"}["rxsnhyopph"]});
     @unlink(${${"GLOBALS"}["rxsnhyopph"]});
     exit;
 }
コード例 #2
0
 /**
  * @param $context \Workflow\VTEntity
  * @return string
  */
 public function handleTask(&$context)
 {
     $regex = $this->get("regex", $context);
     $source = $this->get("source", $context);
     $index = $this->get("targetindex");
     $envVar = $this->get("env_var");
     $this->addStat("Source:" . $source);
     if (!empty($regex)) {
         try {
             @preg_match($regex, $source, $matches);
         } catch (Exception $exp) {
             Workflow2::error_handler(E_NONBREAK_ERROR, $exp->getMessage());
             return "no";
         }
         if (count($matches) >= $index) {
             $testresult = $matches[$index];
         } else {
             $testresult = "";
         }
     } else {
         $testresult = getTranslatedString("LBL_BEFORE_TEST_SET_REGEX", "Workflow2");
     }
     $context->setEnvironment($envVar, $testresult);
     return "yes";
 }
コード例 #3
0
 public function beforeGetTaskform($viewer)
 {
     global $adb;
     $new_module = $this->get("new_module");
     if (!empty($_POST["task"]["new_module_setter"])) {
         $recordID = trim($this->get("recordid"));
         $new_module = $_POST["task"]["new_module_setter"];
         if (-1 == $recordID || empty($recordID)) {
             $this->set('recordid', '$id');
         }
     }
     if (!empty($new_module) && $new_module != -1) {
         $viewer->assign("new_module", $new_module);
     }
     $workflows = Workflow2::getWorkflowsForModule($new_module, 1);
     $viewer->assign("extern_workflows", $workflows);
     $sql = "SELECT * FROM vtiger_tab WHERE presence = 0 AND isentitytype = 1 ORDER BY name";
     $result = $adb->query($sql);
     $module = array();
     while ($row = $adb->fetch_array($result)) {
         if ($row["name"] == "Calendar") {
             continue;
         }
         $module[$row["name"]] = getTranslatedString($row["tablabel"], $row["name"]);
     }
     asort($module);
     $viewer->assign("avail_module", $module);
 }
コード例 #4
0
 public function handleTask(&$context)
 {
     /* Insert here source code to execute the task */
     global $adb;
     $documentId = $context->get("id");
     if (strpos($documentId, 'x') !== false) {
         $TMP = explode("x", $documentId);
         $documentId = $TMP[1];
     }
     $context->save();
     $sql = "SELECT attachmentsid FROM vtiger_seattachmentsrel WHERE crmid = " . $documentId;
     $result = $adb->query($sql, true);
     $fileid = $adb->query_result($result, 0, "attachmentsid");
     $pathQuery = $adb->pquery("select path, name from vtiger_attachments where attachmentsid = ?", array($fileid), true);
     $filepath = "../../../" . $adb->query_result($pathQuery, 0, 'path');
     $filename = $adb->query_result($pathQuery, 0, 'name');
     $saved_filename = $fileid . "_" . utf8_encode(html_entity_decode(html_entity_decode($filename)));
     $path = realpath(dirname(__FILE__) . "/" . $filepath . $saved_filename);
     $create_dir = $this->get("create_dir");
     #var_dump($path);exit();
     //        $sql = "SELECT * FROM
     //                vtiger_attachments
     //            INNER JOIN vtiger_seattachmentsrel ON(vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid)
     //            INNER JOIN vtiger_notes ON(vtiger_notes.notesid = vtiger_seattachmentsrel.crmid)
     //        WHERE vtiger_attachments.attachmentsid = ".intval($attachmentid);
     //        $result = $adb->query($sql);
     try {
         $this->initDropbox();
         #$tmp = tempnam('/tmp', 'dropbox');
         #$data = 'This file was uploaded using the Dropbox API!';
         #file_put_contents($tmp, $data);
         $directory = $this->get("filepath");
         self::$dropbox->setRoot("dropbox");
         if (!empty($create_dir)) {
             $parser = new VTWfExpressionParser($create_dir, $context, false);
             # Last Parameter = DEBUG
             try {
                 $parser->run();
             } catch (\Workflow\ExpressionException $exp) {
                 Workflow2::error_handler(E_EXPRESSION_ERROR, $exp->getMessage(), "", "");
             }
             $newDir = $parser->getReturn();
             $found = self::$dropbox->search($newDir, $directory);
             if (empty($found["body"]) || count($found["body"]) == 0) {
                 self::$dropbox->create($directory);
             }
             $directory = $directory . "/" . $newDir;
         }
         $put = self::$dropbox->putFile($path, $newDir . "/" . $filename, $directory);
     } catch (Exception $exp) {
         Workflow2::error_handler(E_NONBREAK_ERROR, $exp->getMessage(), $exp->getFile(), $exp->getLine());
     }
     return "yes";
 }
コード例 #5
0
ファイル: WfTaskExpcond.php プロジェクト: cin-system/cinrepo
 public function handleTask(&$context)
 {
     $conditions = $this->get("condition");
     $parser = new \Workflow\ExpressionParser($conditions, $context, false);
     # Last Parameter = DEBUG
     try {
         $parser->run();
     } catch (\Workflow\ExpressionException $exp) {
         \Workflow2::error_handler(E_EXPRESSION_ERROR, $exp->getMessage(), "", "");
     }
     $return = $parser->getReturn();
     if ($return != "yes" && $return != "no") {
         $return = "no";
     }
     return $return;
 }
コード例 #6
0
ファイル: Documents.inc.php プロジェクト: cin-system/cinrepo
 public function getActions($moduleName)
 {
     $adb = \PearDatabase::getInstance();
     $sql = 'SELECT * FROM vtiger_attachmentsfolder ORDER BY foldername';
     $result = $adb->query($sql);
     $folders = array();
     while ($row = $adb->fetchByAssoc($result)) {
         $folders[$row['folderid']] = $row['foldername'];
     }
     $tmpWorkflows = \Workflow2::getWorkflowsForModule("Documents", 1);
     $workflows = array('' => '--- choose Workflow ---');
     foreach ($tmpWorkflows as $id => $workflow) {
         $workflows[$id] = $workflow['title'];
     }
     $return = array('id' => 'documents', 'title' => 'Store in Documents Module', 'options' => array('title' => array('type' => 'templatefield', 'label' => 'LBL_DOCUMENT_TITLE', 'placeholder' => 'The title of the Documents Record'), 'description' => array('type' => 'templatearea', 'label' => 'LBL_DOCUMENT_DESCR', 'placeholder' => 'Optionally a description, stored in the record'), 'folderid' => array('type' => 'picklist', 'label' => 'LBL_FOLDER', 'options' => $folders), 'workflowid' => array('type' => 'picklist', 'label' => 'execute this workflow<br>with the new Document', 'options' => $workflows), 'relation' => array('type' => 'checkbox', 'label' => 'create relationship to the used record/s', 'value' => '1')));
     return $return;
 }
コード例 #7
0
 public function beforeGetTaskform($viewer)
 {
     global $adb;
     $new_module = "Invoice";
     $viewer->assign("new_module", $new_module);
     $workflows = Workflow2::getWorkflowsForModule($new_module, 1);
     $viewer->assign("extern_workflows", $workflows);
     $sql = "SELECT * FROM vtiger_tab WHERE presence = 0 AND isentitytype = 1 ORDER BY name";
     $result = $adb->query($sql);
     $module = array();
     while ($row = $adb->fetch_array($result)) {
         if ($row["name"] == "Calendar") {
             continue;
         }
         $module[$row["name"]] = getTranslatedString($row["tablabel"], $row["name"]);
     }
     asort($module);
     $viewer->assign("avail_module", $module);
 }
コード例 #8
0
 public function handleTask(&$context)
 {
     /* Insert here source code to execute the task */
     $products = $context->exportInventory();
     $products = $products['listitems'];
     $checked = new \Workflow\ConditionCheck();
     $logger = new \Workflow\ConditionLogger();
     $conditions = $this->get('condition');
     $expression = $this->get('expression');
     $environment = $context->getEnvironment();
     foreach ($products as $product) {
         $productContext = \Workflow\VTEntity::getForId($product['productid'], 'Products');
         $productContext->loadEnvironment($environment);
         $checked->setLogger($logger);
         $return = $checked->check($conditions, $productContext);
         $logs = $logger->getLogs();
         $logs[] = "Complete Result: " . intval($return);
         $this->setStat($logs);
         $logger->clearLogs();
         if ($return == true) {
             $parser = new \Workflow\ExpressionParser($expression, $productContext, false);
             # Last Parameter = DEBUG
             $parser->setVariable('quantity', $product['quantity']);
             $parser->setVariable('unitprice', $product['unitprice']);
             $parser->setVariable('discount_amount', $product['discount_amount']);
             $parser->setVariable('discount_percent', $product['discount_percent']);
             try {
                 $parser->run();
             } catch (\Workflow\ExpressionException $exp) {
                 Workflow2::error_handler(E_EXPRESSION_ERROR, $exp->getMessage(), "", "");
             }
             $environment = $productContext->getEnvironment();
             if ($parser->getReturn() === 'stop') {
                 break;
             }
         }
     }
     $context->loadEnvironment($environment);
     return "yes";
 }
コード例 #9
0
 public function handleTask(&$context)
 {
     global $adb;
     if (defined("WF_DEMO_MODE") && constant("WF_DEMO_MODE") == true) {
         return "yes";
     }
     $query = $this->get("query", $context);
     $envVar = $this->get("envvar", $context);
     if (empty($envVar)) {
         Workflow2::error_handler(E_NONBREAK_ERROR, "You must configure an environment variable in this block to get the correct result.");
     }
     $oldDieOnError = $adb->dieOnError;
     $adb->dieOnError = false;
     $this->addStat($query);
     try {
         $result = $adb->query($query, false);
         $errorNo = $adb->database->ErrorNo();
         if (!empty($errorNo)) {
             Workflow2::error_handler(E_NONBREAK_ERROR, $adb->database->ErrorMsg());
         } else {
             if (!empty($envVar)) {
                 if ($adb->num_rows($result) > 0) {
                     $row = $adb->fetchByAssoc($result);
                     $context->setEnvironment($envVar, $row);
                 }
             }
         }
         # need vtiger Database to reset Selected DB in the case the query changed this
         global $dbconfig;
         $adb->database->SelectDB($dbconfig['db_name']);
     } catch (Exception $exp) {
         Workflow2::error_handler(E_NONBREAK_ERROR, $exp->getMessage());
     }
     $adb->dieOnError = $oldDieOnError;
     return "yes";
 }
コード例 #10
0
 /**
  * @param $context \Workflow\VTEntity
  * @return string
  */
 public function handleTask(&$context)
 {
     global $adb;
     $currentTime = microtime(true);
     $benchmark = array();
     if ($this->get("search_module") == -1) {
         return "no";
     }
     $found_rows = $this->get("found_rows");
     if (empty($found_rows) || $found_rows == -1) {
         $found_rows = 1;
     }
     $parts = explode("#~#", $this->get("search_module"));
     $functionName = $parts[0];
     $related_module = VtUtils::getModuleName($parts[1]);
     $logger = new \Workflow\ConditionLogger();
     $objMySQL = new \Workflow\ConditionMysql($related_module, $context);
     $objMySQL->setLogger($logger);
     $main_module = \CRMEntity::getInstance($related_module);
     #$sqlTables = $main_module->generateReportsQuery($related_module);
     if ($related_module == "Calendar") {
         #$sqlTables .= " LEFT JOIN vtiger_seactivityrel ON(vtiger_seactivityrel.activityid = vtiger_crmentity.crmid)";
     }
     $sqlCondition = $objMySQL->parse($this->get("condition"));
     $newTime = microtime(true);
     $benchmark[] = round($newTime - $currentTime, 3);
     $currentTime = $newTime;
     $sqlTables = $objMySQL->generateTables();
     if (strlen($sqlCondition) > 3) {
         $sqlCondition .= " AND vtiger_crmentity.deleted = 0";
     } else {
         $sqlCondition .= " vtiger_crmentity.deleted = 0";
     }
     $logs = $logger->getLogs();
     $this->setStat($logs);
     $sqlCondition .= " GROUP BY vtiger_crmentity.crmid ";
     $idColumn = $main_module->table_name . "." . $main_module->table_index;
     $sqlQuery = "SELECT {$idColumn} as `idCol` " . $sqlTables . " WHERE " . (strlen($sqlCondition) > 3 ? $sqlCondition : "");
     $sortField = $this->get("sort_field");
     if (!empty($sortField) && $sortField != -1) {
         $sortField = VtUtils::getColumnName($sortField);
         $sortDirection = $this->get("sortDirection");
         $sqlQuery .= " ORDER BY " . $sortField . " " . $sortDirection;
     }
     $numRows = $this->get("found_rows");
     if (!empty($numRows) && $numRows != -1) {
         $sqlQuery .= " LIMIT " . $found_rows;
     }
     #var_dump(nl2br($sqlQuery));exit();
     $this->addStat("MySQL Query: " . $sqlQuery);
     $result = $adb->query($sqlQuery);
     $newTime = microtime(true);
     $benchmark[] = round($newTime - $currentTime, 3);
     $currentTime = $newTime;
     $this->addStat("num Rows: " . $adb->num_rows($result));
     # If no records are found, fo other way
     if ($adb->num_rows($result) == 0) {
         return "no";
     }
     $environment = $context->getEnvironment();
     while ($row = $adb->fetchByAssoc($result)) {
         $expression = $this->get("expression");
         if (!empty($expression)) {
             $tmpContext = \Workflow\VTEntity::getForId($row["idcol"], $related_module);
             $tmpContext->loadEnvironment($environment);
             $parser = new \Workflow\ExpressionParser($expression, $tmpContext, false);
             # Last Parameter = DEBUG
             try {
                 $parser->run();
             } catch (ExpressionException $exp) {
                 Workflow2::error_handler(E_EXPRESSION_ERROR, $exp->getMessage(), "", "");
             }
             $environment = $tmpContext->getEnvironment();
         }
     }
     # while
     $newTime = microtime(true);
     $benchmark[] = round($newTime - $currentTime, 3);
     $currentTime = $newTime;
     $context->loadEnvironment($environment);
     $this->addStat("Benchmark: " . implode("/", $benchmark));
     return "yes";
 }
コード例 #11
0
 /**
  * @param $context \Workflow\VTEntity
  */
 public function handleTask(&$context)
 {
     global $current_user, $adb;
     if ($this->isContinued()) {
         $sql = "SELECT id, result, result_user_id FROM vtiger_wf_confirmation WHERE execID = '" . $this->getExecId() . "' AND result != '' AND visible = 1";
         $result = $adb->query($sql);
         if ($adb->num_rows($result) == 0) {
             $timeout = $context->getEnvironment('_permissionTimeout');
             $timeoutValue = $context->getEnvironment('_permissionTimeoutValue');
             if ($timeout == true) {
                 if (time() > $timeoutValue) {
                     $this->addStat('Timeout action: ' . $this->get('timeout_output'));
                     return $this->get('timeout_output');
                 }
             }
             return array("delay" => time() + 60 * 10, "checkmode" => "static");
         }
         $data = $adb->fetchByAssoc($result);
         $sql = "SELECT user_name FROM vtiger_users WHERE id = " . $data["result_user_id"];
         $resultUser = $adb->query($sql);
         $resultUser = $adb->fetchByAssoc($resultUser);
         $this->addStat("Permission: " . $data["result"] . " by " . $resultUser["user_name"]);
         $sql = "UPDATE vtiger_wf_confirmation SET visible = 0 WHERE id = " . $data["id"];
         $adb->query($sql);
         return $data["result"];
     }
     $this->_compatible();
     $connected = $this->getConnectedObjects("assigned_to");
     $targets = array();
     if (!empty($connected)) {
         foreach ($connected as $user) {
             if (empty($user)) {
                 continue;
             }
             $targets['user'][] = intval($user->getId());
         }
     }
     $TMPtargets = $this->get('targets');
     if (is_array($TMPtargets)) {
         foreach ($TMPtargets as $value) {
             $parts = explode('##', $value);
             if ($parts[0] == 'USER' && !in_array(intval($parts[1]), $targets['user'])) {
                 $targets['user'][] = intval($parts[1]);
             }
             if ($parts[0] == 'GROUP') {
                 $focusGrpUsers = new GetGroupUsers();
                 $focusGrpUsers->getAllUsersInGroup($parts[1]);
                 $groupUser = $focusGrpUsers->group_users;
                 if (is_array($groupUser)) {
                     foreach ($groupUser as $userId) {
                         if (!in_array($userId, $targets['user'])) {
                             $targets['user'][] = $userId;
                         }
                     }
                 }
             }
             if ($parts[0] == 'ROLE') {
                 $focusGrpUsers = new GetGroupUsers();
                 $focusGrpUsers->getAllUsersInGroup($parts[0]);
                 $groupUser = array_keys(getRoleUsers($parts[1]));
                 if (is_array($groupUser)) {
                     foreach ($groupUser as $userId) {
                         if (!in_array($userId, $targets['user'])) {
                             $targets['user'][] = $userId;
                         }
                     }
                 }
             }
         }
     }
     $backgroundcolor = $this->get("backgroundcolor");
     $bgmode = $this->get("bgmode");
     if (!empty($bgmode) && $bgmode != -1) {
         if ($bgmode == "function") {
             $parser = new VTWfExpressionParser($backgroundcolorFKT, $context, false);
             # Last Parameter = DEBUG
             try {
                 $parser->run();
             } catch (ExpressionException $exp) {
                 Workflow2::error_handler(E_EXPRESSION_ERROR, $exp->getMessage(), "", "");
             }
             $backgroundcolor = $parser->getReturn();
         } else {
             if (strpos($backgroundcolor, '$') !== false || strpos($backgroundcolor, '?') !== false) {
                 $objTemplate = new VTTemplate($context);
                 $backgroundcolor = $objTemplate->render($backgroundcolor);
             }
         }
     } else {
         $backgroundcolor = "#ffffff";
     }
     if (empty($backgroundcolor)) {
         $backgroundcolor = "#ffffff";
     }
     $infomessage = $this->get("infomessage");
     $infomessageFKT = $this->get("infomessageFKT");
     $infomode = $this->get("infomode");
     if (!empty($infomode) && $infomode != -1) {
         if ($infomode == "function") {
             $parser = new VTWfExpressionParser($infomessageFKT, $context, false);
             # Last Parameter = DEBUG
             try {
                 $parser->run();
             } catch (ExpressionException $exp) {
                 Workflow2::error_handler(E_EXPRESSION_ERROR, $exp->getMessage(), "", "");
             }
             $infomessage = $parser->getReturn();
         } else {
             if (strpos($infomessage, '$') !== false || strpos($infomessage, '?') !== false) {
                 $objTemplate = new VTTemplate($context);
                 $infomessage = $objTemplate->render($infomessage);
             }
         }
     } else {
         $infomessage = "";
     }
     if (empty($infomessage)) {
         $infomessage = "";
     }
     $rundirect = $this->get("rundirect");
     $sql = "INSERT INTO vtiger_wf_confirmation SET crmid = " . $context->getId() . ", infomessage = ?, backgroundcolor = ?, blockID = '" . $this->getBlockId() . "', execID = '" . $this->getExecId() . "', visible = 1, result = '', module = '" . $context->getModuleName() . "', workflow_id = " . $this->getWorkflowId() . ", rundirect = " . ($rundirect == "1" ? 1 : 0) . ", from_user_id = " . $current_user->id;
     $adb->pquery($sql, array($infomessage, $backgroundcolor));
     $confID = $adb->getLastInsertID();
     foreach ($targets['user'] as $user) {
         $sql = "INSERT INTO vtiger_wf_confirmation_user SET confirmation_id = '" . $confID . "', user_id = " . $user;
         $adb->query($sql);
         $this->addStat("create Permission entry (Block " . $this->getBlockId() . ") for User " . $user);
     }
     // if we need an timeout than wait until
     $use_timeout = $this->get("use_timeout");
     if ($use_timeout == '1') {
         $timeout_value = $this->get("timeout_value");
         $timeout_value_mode = $this->get("timeout_value_mode");
         $timestamp = time();
         switch ($timeout_value_mode) {
             case "minutes":
                 $timestamp += 60 * $timeout_value;
                 break;
             case "hours":
                 $timestamp += 60 * 60 * $timeout_value;
                 break;
             case "days":
                 $timestamp += 24 * 60 * 60 * $timeout_value;
                 break;
             case "weeks":
                 $timestamp += 7 * 24 * 60 * 60 * $timeout_value;
                 break;
         }
         $context->setEnvironment('_permissionTimeout', true);
         $context->setEnvironment('_permissionTimeoutValue', $timestamp);
     } else {
         $context->setEnvironment('_permissionTimeout', false);
     }
     // check every 15 minutes
     return array("delay" => time() + 60 * 15, "checkmode" => "static");
 }
コード例 #12
0
 function wf_dbSelectAll($query)
 {
     $adb = PearDatabase::getInstance();
     $result = $adb->query($query, false);
     $errorNo = $adb->database->ErrorNo();
     if (!empty($errorNo)) {
         Workflow2::error_handler(E_NONBREAK_ERROR, $adb->database->ErrorMsg());
     } else {
         if ($adb->num_rows($result) > 0) {
             $return = array();
             while ($row = $adb->fetchByAssoc($result)) {
                 $return[] = $row;
             }
             return $return;
         } else {
             return array();
         }
     }
     # need vtiger Database to reset Selected DB in the case the query changed this
     global $dbconfig;
     $adb->database->SelectDB($dbconfig['db_name']);
 }
コード例 #13
0
 public function beforeGetTaskform($viewer)
 {
     global $adb;
     $new_module = $this->getWorkflow()->getSettings();
     $new_module = $new_module["module_name"];
     if (!empty($new_module) && $new_module != -1) {
         $viewer->assign("new_module", $new_module);
     }
     $sql = "SELECT\r\n                    vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.description,\r\n                    vtiger_products.*,\r\n                    vtiger_productcf.*\r\n                FROM vtiger_products\r\n                    INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_products.productid\r\n                    INNER JOIN vtiger_productcf ON vtiger_products.productid = vtiger_productcf.productid\r\n                    LEFT JOIN vtiger_vendor ON vtiger_vendor.vendorid = vtiger_products.vendor_id\r\n                    LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\r\n                    LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\r\n                WHERE\r\n                    vtiger_products.productid > 0 AND\r\n                    vtiger_crmentity.deleted = 0 and\r\n                    vtiger_products.discontinued <> 0 AND\r\n                    (vtiger_products.productid NOT IN (\r\n                        SELECT crmid FROM vtiger_seproductsrel WHERE vtiger_products.productid > 0 AND setype='Products'\r\n                        )\r\n                    )";
     $result = $adb->query($sql);
     $products = array();
     $taxes = array();
     while ($row = $adb->fetchByAssoc($result)) {
         $products[$row["productid"]] = $row;
         $taxes[$row["productid"]] = getTaxDetailsForProduct($row["productid"], 'all');
         if (empty($taxes[$row["productid"]])) {
             $taxes[$row["productid"]] = array("a" => "b");
         }
     }
     $viewer->assign("taxlist", $taxes);
     $viewer->assign("productlist", $products);
     $workflows = Workflow2::getWorkflowsForModule($new_module, 1);
     $viewer->assign("extern_workflows", $workflows);
     $module = array();
     $module["Invoice"] = getTranslatedString("Invoice", "Invoice");
     $module["Quotes"] = getTranslatedString("Quotes", "Quotes");
     $module["PurchaseOrder"] = getTranslatedString("PurchaseOrder", "PurchaseOrder");
     $module["SalesOrder"] = getTranslatedString("SalesOrder", "SalesOrder");
     asort($module);
     $viewer->assign("avail_module", $module);
     $viewer->assign("orig_module_name", $this->getModuleName());
     $viewer->assign("availCurrency", getAllCurrencies());
     $viewer->assign("availTaxes", getAllTaxes("available"));
 }
コード例 #14
0
 public function beforeGetTaskform($viewer)
 {
     global $adb, $current_language, $mod_strings;
     $viewer->assign("related_modules", VtUtils::getEntityModules(true));
     $search_module = $this->get("search_module");
     if (!empty($_POST["task"]["search_module"])) {
         $parts = explode("#~#", $_POST["task"]["search_module"]);
     } elseif (!empty($search_module)) {
         if ($search_module != -1) {
             $parts = explode("#~#", $search_module);
         }
     } else {
         return;
     }
     if (!empty($parts)) {
         $viewer->assign("related_tabid", $parts[1]);
         $search_module_name = VtUtils::getModuleName($parts[1]);
         #$workflowSettings = $this->getWorkflow()->getSettings();
         $workflows = $workflows = Workflow2::getWorkflowsForModule($search_module_name, 1);
         $viewer->assign("workflows", $workflows);
         $fields = VtUtils::getFieldsWithBlocksForModule($search_module_name);
         $viewer->assign("sort_fields", $fields);
         $moduleObj = \Vtiger_Module_Model::getInstance($search_module_name);
         $viewer->assign('productCache', array());
         if ($moduleObj instanceof \Inventory_Module_Model) {
             $viewer->assign('searchByProduct', true);
             $product = $this->get('products');
             if (!empty($product)) {
                 //$dataObj = \Vtiger_Record_Model::getInstanceById($product);
                 $productCache[$product] = array('label' => \Vtiger_Functions::getCRMRecordLabel($product));
                 $viewer->assign('productCache', $productCache);
             }
         }
         $views = array();
         $allviews = \CustomView_Record_Model::getAll($search_module_name);
         foreach ($allviews as $view) {
             $views[$view->get('cvid')] = $view->get('viewname');
         }
         $viewer->assign('customviews', $views);
     }
 }
コード例 #15
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;
 }
コード例 #16
0
ファイル: cronjobHandler.php プロジェクト: cin-system/cinrepo
            ${"GLOBALS"}["dwueotishfr"] = "result";
            ${${"GLOBALS"}["cnpunorkudj"]} = $adb->query(${${"GLOBALS"}["qmkfkak"]}, true);
            if ($adb->num_rows(${${"GLOBALS"}["dwueotishfr"]}) == 0) {
                ${${"GLOBALS"}["qultpew"]}["context"]->unlinkTempFiles();
            }
        }
        if (time() < ${${"GLOBALS"}["bmukduyjbf"]} + ${${"GLOBALS"}["wkyilpg"]} * 60) {
            ${${"GLOBALS"}["keuetfu"]} = \Workflow\Queue::getQueueEntry();
        } else {
            ${${"GLOBALS"}["keuetfu"]} = false;
        }
    } while (${${"GLOBALS"}["keuetfu"]} !== false);
}
echo "Workflow2 Scheduler Started\n";
\Workflow\Scheduler::execute();
echo "Workflow2 Scheduler Finished\n";
echo "Workflow2 Cronjob Start Cleaning\n";
${${"GLOBALS"}["gvudxdr"]} = decideFilePath();
@chmod(dirname(dirname(${${"GLOBALS"}["gvudxdr"]})), 0777);
@chmod(dirname(${$cfcoklxwq}), 0777);
@chmod(${${"GLOBALS"}["gvudxdr"]}, 0777);
if (mt_rand(1, 100) > 90) {
    \Workflow2::purgeLogs();
    \Workflow2::purgeQueue();
}
\Workflow2::cleanQueue();
${${"GLOBALS"}["jvrworyisrg"]} = new \Workflow2();
$obj->repoUpdateCheck();
\Workflow2::${${"GLOBALS"}["nimkcgvrvs"]} = false;
unlink(sys_get_temp_dir() . "/workflow2_lock");
echo "Workflow2 Cronjob Finished\n";
コード例 #17
0
 private function _checkField($check)
 {
     $hokekyg = "check";
     $irkmjqniy = "check";
     $vuomcowj = "check";
     $qxtftfelfc = "checkvalue";
     global $adb;
     if (${$vuomcowj}["mode"] == "value" || empty(${$hokekyg}["mode"])) {
         $ljuuqqmpe = "checkvalue";
         $qlncurmce = "check";
         ${"GLOBALS"}["sjpunfxie"] = "checkvalue";
         ${$ljuuqqmpe} = ${$qlncurmce}["rawvalue"];
         if (strpos(${${"GLOBALS"}["mhtrtpoxqog"]}, "\$") !== false || strpos(${${"GLOBALS"}["sjpunfxie"]}, "?") !== false) {
             $kasuqypyri = "objTemplate";
             ${$kasuqypyri} = new VTTemplate($this->_context);
             ${${"GLOBALS"}["mhtrtpoxqog"]} = $objTemplate->render(${${"GLOBALS"}["mhtrtpoxqog"]});
         }
     } elseif (${$irkmjqniy}["mode"] == "function") {
         $mslifxq = "parser";
         ${$mslifxq} = new ExpressionParser(${${"GLOBALS"}["eikcioit"]}["rawvalue"], $this->_context, false);
         try {
             $parser->run();
         } catch (ExpressionException $exp) {
             \Workflow2::error_handler(E_EXPRESSION_ERROR, $exp->getMessage(), "", "");
         }
         ${${"GLOBALS"}["mhtrtpoxqog"]} = $parser->getReturn();
     }
     if (preg_match("/^([0-9]+)x([0-9]+)\$/", ${${"GLOBALS"}["mhtrtpoxqog"]}, ${${"GLOBALS"}["rltbvvdxzi"]})) {
         ${${"GLOBALS"}["mhtrtpoxqog"]} = ${${"GLOBALS"}["rltbvvdxzi"]}[2];
     }
     $qpbidpqzyuq = "check";
     if (${$qpbidpqzyuq}["field"] != "crmid") {
         $opnieudoijq = "result";
         $icdvseqgj = "sql";
         $wedbbjpbzg = "check";
         ${"GLOBALS"}["ssickqrh"] = "result";
         $lguveyud = "referenceUitypes";
         ${"GLOBALS"}["fhxqfbe"] = "check";
         ${$icdvseqgj} = "SELECT columnname, tablename, uitype FROM vtiger_field WHERE (fieldname = ? OR columnname = ?) AND tabid = " . getTabId($this->_module);
         ${"GLOBALS"}["ufdgmzwrnd"] = "fieldData";
         ${$opnieudoijq} = $adb->pquery(${${"GLOBALS"}["gewfwuwzyf"]}, array(${${"GLOBALS"}["fhxqfbe"]}["field"], ${$wedbbjpbzg}["field"]), true);
         $vnwwwkurvnc = "fieldData";
         ${${"GLOBALS"}["ufdgmzwrnd"]} = $adb->fetchByAssoc(${${"GLOBALS"}["ssickqrh"]});
         if (${$vnwwwkurvnc}["columnname"] == "idlists" && $this->_module == "Emails") {
             ${${"GLOBALS"}["skdkydufqc"]} = array("vtiger_seactivityrel`.`crmid");
         } else {
             $dknamdhd = "fieldData";
             ${${"GLOBALS"}["skdkydufqc"]} = array("" . ${${"GLOBALS"}["chbluaeolj"]}["tablename"] . "`.`" . ${$dknamdhd}["columnname"]);
         }
         if (in_array(intval(${${"GLOBALS"}["chbluaeolj"]}["uitype"]), VtUtils::${$lguveyud})) {
             ${"GLOBALS"}["usovmy"] = "fieldData";
             ${"GLOBALS"}["fcynigpd"] = "modules";
             ${"GLOBALS"}["mxfotnkuck"] = "modules";
             ${${"GLOBALS"}["mxfotnkuck"]} = VtUtils::getModuleForReference(getTabId($this->_module), ${${"GLOBALS"}["eikcioit"]}["field"], ${${"GLOBALS"}["usovmy"]}["uitype"]);
             if (count(${${"GLOBALS"}["fcynigpd"]}) == 1) {
                 foreach (${${"GLOBALS"}["mkwcgvqozj"]} as ${${"GLOBALS"}["nrfjjlktok"]}) {
                     ${"GLOBALS"}["ynidmvalhyi"] = "tableName";
                     $cegjqy = "fieldNames";
                     ${"GLOBALS"}["fjvfyzyeo"] = "tmpFocus";
                     $npekrqhn = "tableName";
                     $gbhhegbtpt = "fieldData";
                     ${"GLOBALS"}["iijrcvdcux"] = "check";
                     ${${"GLOBALS"}["fjvfyzyeo"]} = \CRMEntity::getInstance(${${"GLOBALS"}["nrfjjlktok"]});
                     ${$npekrqhn} = "t" . count($this->_joinTables) . "_" . ${${"GLOBALS"}["nrfjjlktok"]} . "_" . ${${"GLOBALS"}["iijrcvdcux"]}["field"] . "";
                     $this->_joinTables[] = "LEFT JOIN " . $tmpFocus->table_name . " as " . ${${"GLOBALS"}["vudkckyuiho"]} . " ON (`" . ${${"GLOBALS"}["ynidmvalhyi"]} . "`.`" . $tmpFocus->table_index . "` = `" . ${${"GLOBALS"}["skdkydufqc"]}[0] . "`)";
                     ${${"GLOBALS"}["chbluaeolj"]}["tablename"] = ${${"GLOBALS"}["vudkckyuiho"]};
                     ${${"GLOBALS"}["chbluaeolj"]}["columnname"] = $tmpFocus->list_link_field;
                     ${$cegjqy}[] = "" . ${${"GLOBALS"}["chbluaeolj"]}["tablename"] . "`.`" . ${$gbhhegbtpt}["columnname"];
                 }
             }
         }
     } else {
         $qivvqrqqp = "fieldNames";
         ${$qivvqrqqp} = array("vtiger_crmentity`.`crmid");
     }
     $kmvwkdvr = "fieldNames";
     $this->log("Check field: " . ${${"GLOBALS"}["eikcioit"]}["field"] . " " . ${${"GLOBALS"}["eikcioit"]}["operation"] . " - " . ${$qxtftfelfc});
     if (!empty(${${"GLOBALS"}["eikcioit"]}["not"])) {
         ${"GLOBALS"}["msavtqzgbd"] = "not";
         ${${"GLOBALS"}["msavtqzgbd"]} = true;
     } else {
         $plzzuz = "not";
         ${$plzzuz} = false;
     }
     ${${"GLOBALS"}["dewpeeyj"]} = array();
     foreach (${$kmvwkdvr} as ${${"GLOBALS"}["mtsrsml"]}) {
         ${"GLOBALS"}["pnlaybj"] = "fieldName";
         ${"GLOBALS"}["rgeraojxbe"] = "tmpSQL";
         $gysrpkkbjro = "not";
         ${"GLOBALS"}["xoeshlppye"] = "tmpSQL";
         ${"GLOBALS"}["ufiulnugtpse"] = "not";
         ${"GLOBALS"}["oihhykbnakpg"] = "tmpSQL";
         ${"GLOBALS"}["jhgyja"] = "fieldName";
         $ocjyevynyxer = "fieldName";
         $ddtsdwnjdi = "tmpSQL";
         ${"GLOBALS"}["irkqsiczmnje"] = "fieldName";
         ${"GLOBALS"}["xzodapm"] = "not";
         $wwqfpoc = "tmpSQL";
         $firifzks = "fieldName";
         ${"GLOBALS"}["glhofthvju"] = "fieldName";
         $djtrtm = "checkvalue";
         $fxmphdvibp = "checkvalue";
         $ppsxsaud = "check";
         ${"GLOBALS"}["ctfovcryrmyx"] = "checkvalue";
         switch (${$ppsxsaud}["operation"]) {
             case "equal":
                 ${${"GLOBALS"}["dewpeeyj"]}[] = "`" . ${$firifzks} . "` " . (${${"GLOBALS"}["gltggtgnj"]} ? "!" : "") . "= " . $adb->quote(${${"GLOBALS"}["ctfovcryrmyx"]}) . "";
                 break;
             case "contains":
                 ${${"GLOBALS"}["xoeshlppye"]}[] = "`" . ${${"GLOBALS"}["mtsrsml"]} . "` " . (${${"GLOBALS"}["gltggtgnj"]} ? "NOT " : "") . "LIKE " . $adb->quote("%" . ${${"GLOBALS"}["mhtrtpoxqog"]} . "%") . "";
                 break;
             case "starts_with":
                 ${${"GLOBALS"}["dewpeeyj"]}[] = "`" . ${${"GLOBALS"}["pnlaybj"]} . "` " . (${${"GLOBALS"}["xzodapm"]} ? "NOT " : "") . "LIKE " . $adb->quote(${${"GLOBALS"}["mhtrtpoxqog"]} . "%") . "";
                 break;
             case "ends_with":
                 ${${"GLOBALS"}["oihhykbnakpg"]}[] = "`" . ${${"GLOBALS"}["mtsrsml"]} . "` " . (${${"GLOBALS"}["gltggtgnj"]} ? "NOT " : "") . "LIKE " . $adb->quote("%" . ${$fxmphdvibp} . "") . "";
                 break;
             case "bigger":
                 ${$wwqfpoc}[] = "`" . ${${"GLOBALS"}["irkqsiczmnje"]} . "` " . (${${"GLOBALS"}["gltggtgnj"]} ? "<=" : ">") . " " . $adb->quote("" . ${${"GLOBALS"}["mhtrtpoxqog"]} . "") . "";
                 break;
             case "lower":
                 ${${"GLOBALS"}["dewpeeyj"]}[] = "`" . ${$ocjyevynyxer} . "` " . (${${"GLOBALS"}["gltggtgnj"]} ? ">=" : "<") . " " . $adb->quote("" . ${${"GLOBALS"}["mhtrtpoxqog"]} . "") . "";
                 break;
             case "is_checked":
                 ${$ddtsdwnjdi}[] = "`" . ${${"GLOBALS"}["jhgyja"]} . "` " . (${${"GLOBALS"}["gltggtgnj"]} ? "!" : "") . "= " . $adb->quote("" . ${$djtrtm} . "") . "";
                 break;
             case "is_empty":
                 if (!${$gysrpkkbjro}) {
                     $snfeziwysq = "check";
                     $xbwkmiws = "fieldName";
                     ${${"GLOBALS"}["dewpeeyj"]}[] = "(`" . ${$xbwkmiws} . "` = '' OR`" . ${$snfeziwysq}["field"] . "` = '0')";
                 } else {
                     ${"GLOBALS"}["pldqrvs"] = "fieldName";
                     ${${"GLOBALS"}["dewpeeyj"]}[] = "(`" . ${${"GLOBALS"}["pldqrvs"]} . "` != '')";
                 }
                 break;
             case "date_empty":
                 if (!${${"GLOBALS"}["gltggtgnj"]}) {
                     $qdiribn = "fieldName";
                     $bbosypyhslk = "tmpSQL";
                     ${$bbosypyhslk}[] = "(`" . ${${"GLOBALS"}["mtsrsml"]} . "` IS NULL OR DATE(`" . ${$qdiribn} . "`) = '0000-00-00')";
                 } else {
                     ${"GLOBALS"}["pwcutq"] = "fieldName";
                     $egvstey = "tmpSQL";
                     ${$egvstey}[] = "(`" . ${${"GLOBALS"}["pwcutq"]} . "` IS NOT NULL AND DATE(`" . ${${"GLOBALS"}["mtsrsml"]} . "`) != '0000-00-00')";
                 }
                 break;
             case "is_numeric":
                 ${${"GLOBALS"}["rgeraojxbe"]}[] = "(`" . ${${"GLOBALS"}["glhofthvju"]} . "` " . (${${"GLOBALS"}["ufiulnugtpse"]} ? "NOT " : "") . "REGEXP '-?[0-9]+')";
                 break;
         }
     }
     $this->_sql[] = "((" . implode(") OR (", ${${"GLOBALS"}["dewpeeyj"]}) . "))";
     return false;
 }
コード例 #18
0
 public function process(Vtiger_Request $request)
 {
     $ovoodkiokzvf = "cu_model";
     $reyhvptvyl = "sql";
     ${"GLOBALS"}["tbhhwi"] = "current_user";
     ${${"GLOBALS"}["tbhhwi"]} = ${$ovoodkiokzvf} = Users_Record_Model::getCurrentUserModel();
     $fmivvfyl = "currentLanguage";
     ${"GLOBALS"}["bhgpydrruuti"] = "module";
     ${"GLOBALS"}["fvwjvmicvg"] = "viewer";
     $bwydxjijyuko = "request";
     $dtcicumpi = "row";
     $zxuljoxze = "sql";
     ${$fmivvfyl} = Vtiger_Language_Handler::getLanguage();
     $ahuziprigd = "result";
     $jfnnufy = "crmid";
     ${"GLOBALS"}["oewskmjg"] = "module";
     ${${"GLOBALS"}["bctcwzwr"]} = PearDatabase::getInstance();
     $yvsdkkymncwr = "waitingRST";
     ${"GLOBALS"}["jzipbnwt"] = "crmid";
     $lylgtfgrnf = "waitingRST";
     ${${"GLOBALS"}["fvwjvmicvg"]} = $this->getViewer(${$bwydxjijyuko});
     ${${"GLOBALS"}["bhgpydrruuti"]} = $request->get("source_module");
     ${${"GLOBALS"}["tjndrz"]} = (int) $request->get("record");
     if (${${"GLOBALS"}["ouahvk"]} == "Events") {
         $ilvwhpykw = "module";
         ${$ilvwhpykw} = "Calendar";
     }
     $inyaxscqqtrd = "waiting";
     ${"GLOBALS"}["dswhemd"] = "module";
     ${${"GLOBALS"}["alvjlol"]} = Workflow2::getWorkflowsForModule(${${"GLOBALS"}["ouahvk"]});
     $llkjiwsxj = "module";
     $fnfyuskkd = "workflow";
     ${${"GLOBALS"}["tndywt"]} = array();
     foreach (${${"GLOBALS"}["alvjlol"]} as ${$fnfyuskkd}) {
         $iwogovyptmri = "workflow";
         ${"GLOBALS"}["bctvoft"] = "workflow";
         ${"GLOBALS"}["ghogwrdq"] = "objWorkflow";
         ${${"GLOBALS"}["ghogwrdq"]} = new \Workflow\Main(${${"GLOBALS"}["bctvoft"]}["id"]);
         ${"GLOBALS"}["wlrgageide"] = "crmid";
         if ((${$iwogovyptmri}["authmanagement"] == "0" || $objWorkflow->checkAuth("view")) && $objWorkflow->checkExecuteCondition(${${"GLOBALS"}["wlrgageide"]})) {
             ${"GLOBALS"}["dqmhkhkjgng"] = "workflow";
             ${${"GLOBALS"}["tndywt"]}[] = ${${"GLOBALS"}["dqmhkhkjgng"]};
         }
     }
     ${$zxuljoxze} = "SELECT vtiger_wf_settings.title, vtiger_wf_settings.authmanagement, vtiger_wfp_blocks.text, vtiger_wf_queue.nextStepTime, vtiger_wf_queue.workflow_id, vtiger_wf_queue.crmid, vtiger_wf_queue.execID, vtiger_wf_queue.block_id\n                FROM\n                    vtiger_wf_queue\n                    INNER JOIN vtiger_wf_settings ON(vtiger_wf_settings.id = vtiger_wf_queue.workflow_id)\n                    INNER JOIN vtiger_wfp_blocks ON(vtiger_wfp_blocks.id = vtiger_wf_queue.block_id)\n                WHERE vtiger_wf_queue.crmid = " . ${${"GLOBALS"}["jzipbnwt"]} . "";
     ${$lylgtfgrnf} = $adb->query(${${"GLOBALS"}["ikjiyio"]}, true);
     ${$inyaxscqqtrd} = array();
     $miablnvp = "sql";
     ${"GLOBALS"}["gajholdtee"] = "buttons";
     while (${$dtcicumpi} = $adb->fetchByAssoc(${$yvsdkkymncwr})) {
         ${${"GLOBALS"}["etweqtftj"]}[] = ${${"GLOBALS"}["pdmbilkwen"]};
     }
     ${$reyhvptvyl} = "SELECT * FROM vtiger_wf_frontend_config WHERE module = ?";
     ${$ahuziprigd} = $adb->pquery(${$miablnvp}, array(${${"GLOBALS"}["oewskmjg"]}));
     ${"GLOBALS"}["yeivnisennf"] = "frontendManager";
     if ($adb->num_rows(${${"GLOBALS"}["bloomad"]}) > 0) {
         ${"GLOBALS"}["trovrelooyjo"] = "result";
         ${"GLOBALS"}["hlrngfkuv"] = "frontendconfig";
         ${${"GLOBALS"}["fkhbco"]} = $adb->fetchByAssoc(${${"GLOBALS"}["trovrelooyjo"]});
         $viewer->assign("show_listview", ${${"GLOBALS"}["hlrngfkuv"]}["hide_listview"] == "0");
     } else {
         $viewer->assign("show_listview", true);
     }
     \Workflow\Sidebar::assignMessages(${${"GLOBALS"}["tjndrz"]}, ${${"GLOBALS"}["vjuhfvsmt"]});
     $viewer->assign("isAdmin", $current_user->is_admin == "on");
     $viewer->assign("waiting", ${${"GLOBALS"}["etweqtftj"]});
     $viewer->assign("workflows", ${${"GLOBALS"}["tndywt"]});
     $viewer->assign("source_module", ${$llkjiwsxj});
     $viewer->assign("crmid", ${${"GLOBALS"}["tjndrz"]});
     ${${"GLOBALS"}["yeivnisennf"]} = new \Workflow\FrontendManager();
     ${${"GLOBALS"}["gajholdtee"]} = $frontendManager->getByPosition(${${"GLOBALS"}["dswhemd"]}, "sidebar", ${$jfnnufy});
     $viewer->assign("buttons", ${${"GLOBALS"}["cbmsxefyh"]});
     $viewer->view("SidebarWidget.tpl", "Workflow2");
 }
コード例 #19
0
 public function beforeGetTaskform($viewer)
 {
     global $adb;
     if (!getTabid('PDFMaker') || !vtlib_isModuleActive('PDFMaker')) {
         $viewer->assign('disable', true);
         $this->addConfigHint(getTranslatedString('LBL_FOR_THIS_YOU_NEED_PDFMAKER', 'Settings:Workflow2'));
         return;
     }
     require_once 'modules/PDFMaker/helpers/Version.php';
     $viewer->assign('PDFMAKER_VERSION', PDFMaker_Version_Helper::$version);
     $sql = "SELECT folderid, foldername FROM vtiger_attachmentsfolder ORDER BY sequence";
     $result = $adb->query($sql);
     $folders = array();
     while ($row = $adb->fetch_array($result)) {
         $folders[] = $row;
     }
     $viewer->assign("folders", $folders);
     $sql = "SELECT templateid, filename, description FROM vtiger_pdfmaker WHERE module = '" . $this->getModuleName() . "'";
     $result = $adb->query($sql);
     $templates = array();
     while ($row = $adb->fetch_array($result)) {
         $templates[] = $row;
     }
     $viewer->assign("templates", $templates);
     $workflows = \Workflow2::getWorkflowsForModule("Documents", 1);
     $viewer->assign("workflows", $workflows);
 }
コード例 #20
0
ファイル: ExecuteNew.php プロジェクト: cin-system/cinrepo
 public function handleReturn(Exception $exp = null)
 {
     ${"GLOBALS"}["xhomifgcend"] = "exp";
     if (${${"GLOBALS"}["ersyqfm"]} === null) {
         if (isset($this->_objWorkflow)) {
             $this->checkUserQueue($this->_objWorkflow->getLastExecID());
             ${${"GLOBALS"}["idjaqwrixvz"]} = array("result" => "ready");
             ${${"GLOBALS"}["jbcvqlrloubk"]} = $this->_objWorkflow->getSuccessRedirection();
             if (${${"GLOBALS"}["jbcvqlrloubk"]} !== false) {
                 ${"GLOBALS"}["dqdsybzr"] = "result";
                 ${${"GLOBALS"}["dqdsybzr"]}["redirection"] = ${${"GLOBALS"}["jbcvqlrloubk"]};
                 ${${"GLOBALS"}["idjaqwrixvz"]}["redirection_target"] = $this->_objWorkflow->getSuccessRedirectionTarget();
             }
         } else {
             ${${"GLOBALS"}["idjaqwrixvz"]} = array("result" => "ready");
         }
         ${"GLOBALS"}["lburztt"] = "result";
         Workflow2::${${"GLOBALS"}["fiflovy"]} = false;
         die(json_encode(${${"GLOBALS"}["lburztt"]}));
     }
     ${"GLOBALS"}["bgnkrlnluya"] = "exp";
     if (${${"GLOBALS"}["xhomifgcend"]} instanceof \Workflow\RequestValuesException) {
         $svcmbeqp = "result";
         ${"GLOBALS"}["dvezbpy"] = "fields";
         ${${"GLOBALS"}["vyusgbxkhknd"]} = \Workflow\Queue::addEntry($exp->getTask(), $exp->getContext()->getUser(), $exp->getContext(), "static", false, 1, false);
         \Workflow\Userqueue::add("requestValue", ${${"GLOBALS"}["vyusgbxkhknd"]}, $exp->getMessage(), $this->_objWorkflow->getLastExecID(), array());
         $cvpulpbmvu = "fields";
         $nbyydxlevp = "enableError";
         ${$svcmbeqp} = array("result" => "ready");
         ${${"GLOBALS"}["dvezbpy"]} = $exp->getFields();
         foreach (${${"GLOBALS"}["vjvvxtyxgio"]} as ${${"GLOBALS"}["orcciwacpoo"]} => ${${"GLOBALS"}["bjudgmb"]}) {
             ${"GLOBALS"}["ihmbyreyp"] = "key";
             ${"GLOBALS"}["yxutovlkobh"] = "fields";
             ${"GLOBALS"}["uhzromvror"] = "value";
             ${${"GLOBALS"}["bjudgmb"]}["default"] = trim(\Workflow\VTTemplate::parse(${${"GLOBALS"}["uhzromvror"]}["default"], $this->_objWorkflow->getContext()));
             ${${"GLOBALS"}["yxutovlkobh"]}[${${"GLOBALS"}["ihmbyreyp"]}] = ${${"GLOBALS"}["bjudgmb"]};
         }
         Workflow2::${$nbyydxlevp} = false;
         die(json_encode(array("result" => "reqvalues", "request_message" => $exp->getMessage(), "fields_key" => $exp->getKey(), "execId" => $this->_objWorkflow->getLastExecID() . "##" . $exp->getTask()->getBlockId(), "fields" => ${$cvpulpbmvu})));
     }
     ${"GLOBALS"}["buukyxqqu"] = "enableError";
     Workflow2::error_handler(${${"GLOBALS"}["bgnkrlnluya"]});
     Workflow2::${${"GLOBALS"}["buukyxqqu"]} = false;
 }
コード例 #21
0
ファイル: WfTaskDelay.php プロジェクト: cin-system/cinrepo
 /**
  * @param $context \Workflow\VTEntity
  * @return array
  */
 public function handleTask(&$context)
 {
     $oldTimestamp = time();
     $dynamicUpdateBasefield = false;
     if ($this->get("baseTime") == "now()") {
         $timestamp = time();
     } else {
         $baseTimeField = $this->get("baseTime");
         $timestamp = strtotime($context->get($baseTimeField));
         if ($this->get("update_basefield") == "1") {
             $dynamicUpdateBasefield = true;
         }
         if (empty($timestamp)) {
             $timestamp = time();
         }
     }
     if ($this->isContinued()) {
         return "yes";
     }
     // Evtl. vorhandene Funktion auswerten. Nach der normalen Berechnung der Startzeit, da diese natürlich beachtet werden muss!
     if ($this->get("checkWaitUntilFunction") == "1") {
         $parser = new ExpressionParser($this->get("waitUntilFunction"), $context, false);
         # Last Parameter = DEBUG
         try {
             $parser->run();
         } catch (ExpressionException $exp) {
             Workflow2::error_handler(E_EXPRESSION_ERROR, $exp->getMessage(), "", "");
         }
         $newValue = $parser->getReturn();
         $timestamp = $newValue;
     }
     $timestamp = $this->calculateContinueTS($timestamp, $context);
     if ($timestamp != $oldTimestamp && $timestamp > $oldTimestamp) {
         if (!$dynamicUpdateBasefield) {
             return array("delay" => $timestamp, "checkmode" => "static");
         } else {
             return array("delay" => $timestamp, "field" => $baseTimeField, "checkmode" => "dynamic");
         }
     }
     return "yes";
 }
コード例 #22
0
ファイル: VTEntity.php プロジェクト: cin-system/cinrepo
 public function save()
 {
     if ($this->_deleted == true) {
         return;
     }
     if ($this->_data == false) {
         return;
     }
     if ($this->_isDummy) {
         return;
     }
     if (empty($this->_id)) {
         ${"GLOBALS"}["udgdmdj"] = "result";
         ${"GLOBALS"}["bgfrqsi"] = "result";
         ${${"GLOBALS"}["bgfrqsi"]} = $this->createRecord();
         return ${${"GLOBALS"}["udgdmdj"]};
     }
     if ($this->_changed == false) {
         return;
     }
     global $default_charset;
     $wislscn = "_cache";
     $this->prepareTransfer();
     try {
         $mnjcnqlgng = "metaHandler";
         $elevuutnetl = "metaHandler";
         require_once "data/CRMEntity.php";
         ${$elevuutnetl} = self::getMetaHandler($this->getModuleName());
         $_REQUEST = $this->_data;
         ${${"GLOBALS"}["bnxctgz"]} = CRMEntity::getInstance($this->getModuleName());
         $vanizlvofalw = "focus";
         $focus->id = $this->_id;
         $focus->mode = "edit";
         ${"GLOBALS"}["ivcjrkopdtg"] = "moduleFields";
         $focus->retrieve_entity_info($this->_id, $this->getModuleName());
         $focus->clearSingletonSaveFields();
         $focus->column_fields = \DataTransform::sanitizeDateFieldsForInsert($focus->column_fields, ${${"GLOBALS"}["xjcvkdbwo"]});
         $nlkugopxcby = "value";
         $focus->column_fields = \DataTransform::sanitizeCurrencyFieldsForInsert($focus->column_fields, ${$mnjcnqlgng});
         ${${"GLOBALS"}["ivcjrkopdtg"]} = $metaHandler->getModuleFields();
         foreach ($focus->column_fields as ${${"GLOBALS"}["hjgwjtwk"]} => ${$nlkugopxcby}) {
             if ($this->_data[${${"GLOBALS"}["hjgwjtwk"]}] != ${${"GLOBALS"}["uphxwmiizl"]} && !in_array(${${"GLOBALS"}["hjgwjtwk"]}, array("record_id", "record_module"))) {
                 $dlmyihkhrx = "key";
                 ${"GLOBALS"}["qxesemuz"] = "newValue";
                 ${"GLOBALS"}["iaebjbr"] = "moduleFields";
                 $eklkegifwy = "fieldDataType";
                 $yuelkvntx = "fieldInstance";
                 ${"GLOBALS"}["qfydrxtn"] = "fieldDataType";
                 ${${"GLOBALS"}["qxesemuz"]} = $this->_data[${${"GLOBALS"}["hjgwjtwk"]}];
                 ${$yuelkvntx} = ${${"GLOBALS"}["iaebjbr"]}[${$dlmyihkhrx}];
                 if (empty(${${"GLOBALS"}["rrjhgcneilp"]})) {
                     throw new \Exception("Field " . ${${"GLOBALS"}["hjgwjtwk"]} . " not found in module " . $this->getModuleName() . ".");
                 }
                 ${$eklkegifwy} = $fieldInstance->getFieldDataType();
                 if ("reference" == ${${"GLOBALS"}["xoonpevch"]} || "owner" == ${${"GLOBALS"}["qfydrxtn"]}) {
                     ${"GLOBALS"}["smqnzlzkae"] = "key";
                     ${${"GLOBALS"}["rztsbw"]} = $this->getCrmId(${${"GLOBALS"}["rztsbw"]});
                     $lnakiyyxnloc = "newValue";
                     if ($focus->column_fields[${${"GLOBALS"}["smqnzlzkae"]}] == ${$lnakiyyxnloc}) {
                         continue;
                     }
                 }
                 $focus->column_fields[${${"GLOBALS"}["hjgwjtwk"]}] = ${${"GLOBALS"}["rztsbw"]};
             }
         }
         foreach ($focus->column_fields as ${${"GLOBALS"}["okvmusckd"]} => ${${"GLOBALS"}["naoyqsa"]}) {
             ${"GLOBALS"}["xkqgctp"] = "fieldValue";
             ${"GLOBALS"}["bxkclviriy"] = "default_charset";
             if (is_array(${${"GLOBALS"}["naoyqsa"]})) {
                 throw new \Exception("Wrong input VTEntity::" . __LINE__ . "=" . serialize(${${"GLOBALS"}["naoyqsa"]}));
             }
             $focus->column_fields[${${"GLOBALS"}["okvmusckd"]}] = html_entity_decode(${${"GLOBALS"}["xkqgctp"]}, ENT_QUOTES, ${${"GLOBALS"}["bxkclviriy"]});
         }
         ${$vanizlvofalw} = $this->modifyValuesBeforeSave(${${"GLOBALS"}["bnxctgz"]});
         $_REQUEST["file"] = "";
         $_REQUEST["ajxaction"] = "";
         ${${"GLOBALS"}["djwhrrnnsjk"]} = $_REQUEST["action"];
         $_REQUEST["action"] = "";
         $focus->isLineItemUpdate = false;
         $focus->save($this->getModuleName());
     } catch (\Exception $exp) {
         if ($exp->getCode() == "DATABASE_QUERY_ERROR") {
             $nhkvwsu = "handleResult";
             global $adb;
             ${$nhkvwsu} = $this->_handleDatabaseError($adb->database->_errorMsg);
             return;
         }
         if ($exp->getCode() == "MANDATORY_FIELDS_MISSING") {
             ${"GLOBALS"}["xkshfsxwf"] = "handleResult";
             ${"GLOBALS"}["gmokooantx"] = "handleResult";
             ${${"GLOBALS"}["gmokooantx"]} = $this->_handleMandatoryError(${${"GLOBALS"}["jvdhxqdu"]});
             if (${${"GLOBALS"}["xkshfsxwf"]} !== false) {
                 return;
             }
         }
         \Workflow2::error_handler($exp->getCode(), $exp->getMessage(), $exp->getFile(), $exp->getLine());
     }
     $this->afterTransfer();
     $this->_changed = false;
     $_FILES = ${${"GLOBALS"}["rednnyjghpl"]};
     unset(VTEntity::${$wislscn}[VTEntity::$_user->id][$this->_id]);
     if (!$this instanceof VTInventoryEntity) {
         $this->_data = false;
     }
 }
コード例 #23
0
 public function beforeGetTaskform($viewer)
 {
     global $adb, $vtiger_current_version;
     $new_module = $this->get("new_module");
     if (!empty($_POST["task"]["new_module_setter"])) {
         $new_module = $_POST["task"]["new_module_setter"];
         $mandatoryFields = VtUtils::getMandatoryFields(getTabId($_POST["task"]["new_module_setter"]));
         $startFields = array();
         $counter = 1;
         foreach ($mandatoryFields as $field) {
             $startFields["" . $counter] = array("field" => $field["fieldname"], "mode" => "value", "value" => "", "fixed" => true);
             $counter++;
         }
         if ($_POST["task"]["new_module_setter"] == "Calendar") {
             $startFields["" . $counter] = array("field" => "time_start", "mode" => "value", "value" => "", "fixed" => true);
         }
         $this->set("setter", $startFields);
         $this->set("new_module", $new_module);
     }
     $workflows = Workflow2::getWorkflowsForModule($new_module, 1);
     $viewer->assign("extern_workflows", $workflows);
     $sql = "SELECT id FROM vtiger_ws_entity WHERE name = 'Users'";
     $result = $adb->query($sql);
     $wsTabId = $adb->query_result($result, 0, "id");
     if (!empty($new_module) && $new_module != -1) {
         $viewer->assign("new_module", $new_module);
     }
     $sql = "SELECT * FROM vtiger_tab WHERE presence = 0 AND isentitytype = 1 ORDER BY name";
     $result = $adb->query($sql);
     $module = array();
     while ($row = $adb->fetch_array($result)) {
         if ($row["name"] == "Calendar") {
             continue;
         }
         $module[$row["name"]] = getTranslatedString($row["tablabel"], $row["name"]);
     }
     #$module["Events"] =  getTranslatedString($row["tablabel"],"Events");
     asort($module);
     $viewer->assign("avail_module", $module);
 }
コード例 #24
0
ファイル: FieldSetter.php プロジェクト: cin-system/cinrepo
 public function getFieldValueArray(VTEntity $context, $setterMap)
 {
     ${"GLOBALS"}["qpcsskrqcb"] = "return";
     ${"GLOBALS"}["ikjailgh"] = "setterMap";
     $lmbjulm = "setter";
     ${${"GLOBALS"}["qpcsskrqcb"]} = array();
     foreach (${${"GLOBALS"}["ikjailgh"]} as ${$lmbjulm}) {
         ${"GLOBALS"}["ysgijyp"] = "newValue";
         $nlfnkhvbsydm = "setter";
         ${"GLOBALS"}["jesowuvsevc"] = "setter";
         if (empty(${$nlfnkhvbsydm}["field"])) {
             continue;
         }
         $myyyzqb = "return";
         if (${${"GLOBALS"}["wfwvejp"]}["mode"] == "function") {
             $xcgpolcxqi = "newValue";
             $wghopoiw = "context";
             ${"GLOBALS"}["exnpxogkqow"] = "setter";
             ${${"GLOBALS"}["gnwthoyzmyc"]} = new \Workflow\ExpressionParser(${${"GLOBALS"}["exnpxogkqow"]}["value"], ${$wghopoiw}, false);
             try {
                 $parser->run();
             } catch (ExpressionException $exp) {
                 \Workflow2::error_handler(E_EXPRESSION_ERROR, $exp->getMessage(), "", "");
             }
             ${$xcgpolcxqi} = $parser->getReturn();
         } else {
             ${"GLOBALS"}["epyviwg"] = "setter";
             $oybfubfnlh = "setter";
             ${"GLOBALS"}["fijedwsppbdr"] = "context";
             $ikxlqgdidh = "setter";
             ${"GLOBALS"}["dpxascgg"] = "newValue";
             ${$oybfubfnlh}["value"] = \Workflow\VTTemplate::parse(${$ikxlqgdidh}["value"], ${${"GLOBALS"}["fijedwsppbdr"]});
             ${${"GLOBALS"}["dpxascgg"]} = ${${"GLOBALS"}["epyviwg"]}["value"];
         }
         ${$myyyzqb}[${${"GLOBALS"}["jesowuvsevc"]}["field"]] = ${${"GLOBALS"}["ysgijyp"]};
     }
     return ${${"GLOBALS"}["tkmmiwpj"]};
 }
コード例 #25
0
 protected function functionHandler($match)
 {
     ${${"GLOBALS"}["hefisqmzjjb"]} = new ExpressionParser(${${"GLOBALS"}["fzudcyrhgcof"]}[1], $this->_context, false);
     try {
         $parser->run();
     } catch (ExpressionException $exp) {
         Workflow2::error_handler(E_EXPRESSION_ERROR, $exp->getMessage(), "", "");
     }
     return ${${"GLOBALS"}["yquqpdsvh"]} = $parser->getReturn();
 }
コード例 #26
0
 public function process(Vtiger_Request $request)
 {
     ${"GLOBALS"}["kdeehlyv"] = "TMPworkflows";
     $seemluoths = "viewer";
     $iqrmjuou = "module";
     $oonrwkg = "result";
     $wnxmbyrsjd = "cu_model";
     ${"GLOBALS"}["ujmqtir"] = "current_user";
     $wmcoewcu = "sql";
     ${"GLOBALS"}["sfolfu"] = "workflows";
     $laqtnyra = "ImportWorkflows";
     ${"GLOBALS"}["szyrcsxqnjwy"] = "adb";
     ${"GLOBALS"}["cjryuofsmx"] = "result";
     ${"GLOBALS"}["lyqxydcxb"] = "TMPworkflows";
     $pkqxigbjog = "objWorkflow";
     $nphxkxzqhk = "module";
     ${"GLOBALS"}["awnfeqq"] = "currentLanguage";
     ${${"GLOBALS"}["ujmqtir"]} = ${$wnxmbyrsjd} = Users_Record_Model::getCurrentUserModel();
     ${${"GLOBALS"}["awnfeqq"]} = Vtiger_Language_Handler::getLanguage();
     ${${"GLOBALS"}["szyrcsxqnjwy"]} = PearDatabase::getInstance();
     ${$seemluoths} = $this->getViewer(${${"GLOBALS"}["uxdtkwefwwne"]});
     ${${"GLOBALS"}["dfxtdqgbgfq"]} = $request->get("src_module");
     ${${"GLOBALS"}["kdeehlyv"]} = Workflow2::getWorkflowsForModule(${${"GLOBALS"}["dfxtdqgbgfq"]});
     ${${"GLOBALS"}["sfolfu"]} = array();
     foreach (${${"GLOBALS"}["lyqxydcxb"]} as ${${"GLOBALS"}["gajgjhlo"]}) {
         $abvdowpqhmj = "crmid";
         $ljtimwygf = "workflow";
         ${${"GLOBALS"}["fdbmbwylgb"]} = new \Workflow\Main(${${"GLOBALS"}["gajgjhlo"]}["id"]);
         if ((${$ljtimwygf}["authmanagement"] == "0" || $objWorkflow->checkAuth("view")) && $objWorkflow->checkExecuteCondition(${$abvdowpqhmj})) {
             $cerwfumx = "workflows";
             ${$cerwfumx}[] = ${${"GLOBALS"}["gajgjhlo"]};
         }
     }
     ${$pkqxigbjog} = new Workflow2();
     $cfnbmosu = "sql";
     ${$laqtnyra} = $objWorkflow->getWorkflowsForModule(${$nphxkxzqhk}, 1, "WF2_IMPORTER");
     $ksukmmns = "buttons";
     if (count(${${"GLOBALS"}["fjfxaoqcd"]}) == 0) {
         $viewer->assign("hide_importer", true);
     } else {
         $viewer->assign("hide_importer", false);
     }
     $crjxzwpi = "module";
     $viewer->assign("isAdmin", $current_user->is_admin == "on");
     $viewer->assign("workflows", ${${"GLOBALS"}["ahtwyzverq"]});
     $viewer->assign("source_module", ${${"GLOBALS"}["dfxtdqgbgfq"]});
     $jspfvd = "viewer";
     ${${"GLOBALS"}["kwlufmsfbzr"]} = new \Workflow\FrontendManager();
     ${${"GLOBALS"}["pkuntpkws"]} = $frontendManager->getByPosition(${$iqrmjuou}, "sidebar", ${${"GLOBALS"}["ipaeblf"]});
     ${$cfnbmosu} = "SELECT * FROM vtiger_wf_frontend_config WHERE module = ?";
     ${$oonrwkg} = $adb->pquery(${$wmcoewcu}, array(${$crjxzwpi}));
     if ($adb->num_rows(${${"GLOBALS"}["cjryuofsmx"]}) > 0) {
         $zsffethlyc = "result";
         ${"GLOBALS"}["bvsncmu"] = "frontendconfig";
         ${${"GLOBALS"}["bvsncmu"]} = $adb->fetchByAssoc(${$zsffethlyc});
         $viewer->assign("show_listview", ${${"GLOBALS"}["vwafnyh"]}["hide_listview"] == "0");
     } else {
         $viewer->assign("show_listview", true);
     }
     $viewer->assign("buttons", ${$ksukmmns});
     \Workflow\Sidebar::assignMessages(-1, ${$jspfvd});
     $viewer->view("SidebarListWidget.tpl", "Workflow2");
 }
コード例 #27
0
ファイル: WfTaskPDFMaker.php プロジェクト: cin-system/cinrepo
 public function beforeGetTaskform($viewer)
 {
     global $adb, $current_language, $mod_strings;
     if (!getTabid('PDFMaker') || !vtlib_isModuleActive('PDFMaker')) {
         $viewer->assign('disable', true);
         $this->addConfigHint(getTranslatedString('LBL_FOR_THIS_YOU_NEED_PDFMAKER', 'Settings:Workflow2'));
         return;
     }
     $copies = $this->get('copies');
     if ($copies === -1 || empty($copies)) {
         $this->set('copies', 1);
     }
     $viewer->assign("related_modules", VtUtils::getEntityModules(true));
     $search_module = $this->get("search_module");
     $parts = false;
     if (!empty($_POST["task"]["search_module"])) {
         $parts = explode("#~#", $_POST["task"]["search_module"]);
     } elseif (!empty($search_module)) {
         if ($search_module != -1) {
             $parts = explode("#~#", $search_module);
             $tabid = $parts[1];
         }
     }
     if (!empty($parts)) {
         $moduleName = $parts[0];
         $tabid = $parts[1];
     } else {
         $moduleName = $this->getModuleName();
         $tabid = getTabid($moduleName);
     }
     $viewer->assign("related_tabid", $tabid);
     $fields = VtUtils::getFieldsWithBlocksForModule($moduleName);
     $viewer->assign("sort_fields", $fields);
     require_once 'modules/PDFMaker/helpers/Version.php';
     $viewer->assign('PDFMAKER_VERSION', PDFMaker_Version_Helper::$version);
     $sql = "SELECT folderid, foldername FROM vtiger_attachmentsfolder ORDER BY sequence";
     $result = $adb->query($sql);
     $folders = array();
     while ($row = $adb->fetch_array($result)) {
         $folders[] = $row;
     }
     $viewer->assign("folders", $folders);
     $sql = "SELECT templateid, filename, description FROM vtiger_pdfmaker WHERE module = '" . $moduleName . "'";
     $result = $adb->query($sql);
     $templates = array();
     while ($row = $adb->fetch_array($result)) {
         $templates[] = $row;
     }
     $viewer->assign("templates", $templates);
     $workflows = \Workflow2::getWorkflowsForModule("Documents", 1);
     $viewer->assign("workflows", $workflows);
 }
コード例 #28
0
 /**
  * @param $context \Workflow\VTEntity
  * @return mixed
  */
 public function handleTask(&$context)
 {
     global $adb, $current_user;
     global $current_language;
     if (defined("WF_DEMO_MODE") && constant("WF_DEMO_MODE") == true) {
         return "yes";
     }
     if (!class_exists("Workflow_PHPMailer")) {
         require_once "modules/Workflow2/phpmailer/class.phpmailer.php";
     }
     #$result = $adb->query("select user_name, email1, email2 from vtiger_users where id=1");
     #$from_email = "*****@*****.**";
     #$from_name  = "Stefan Warnat";
     $module = $context->getModuleName();
     $et = new \Workflow\VTTemplate($context);
     $to_email = $et->render(trim($this->get("recepient")), ",");
     #
     $connected = $this->getConnectedObjects("Absender");
     if (count($connected) > 0) {
         $from_name = trim($connected[0]->get("first_name") . " " . $connected[0]->get("last_name"));
         $from_email = $connected[0]->get("email1");
     } else {
         $from_name = $et->render(trim($this->get("from_name")), ",");
         #
         $from_email = $et->render(trim($this->get("from_mail")), ",");
         #
     }
     $cc = $et->render(trim($this->get("emailcc")), ",");
     #
     $bcc = $et->render(trim($this->get("emailbcc")), ",");
     #
     /**
      * Connected BCC Objects
      * @var $connected
      */
     $connected = $this->getConnectedObjects("BCC");
     $bccs = $connected->get("email1");
     if (count($bccs) > 0) {
         $bcc = array($bcc);
         foreach ($bccs as $bccTMP) {
             $bcc[] = $bccTMP;
         }
         $bcc = trim(implode(",", $bcc), ",");
     }
     if (strlen(trim($to_email, " \t\n,")) == 0 && strlen(trim($cc, " \t\n,")) == 0 && strlen(trim($bcc, " \t\n,")) == 0) {
         return "yes";
     }
     $storeid = trim($this->get("storeid", $context));
     if (empty($storeid) || $storeid == -1 || !is_numeric($storeid)) {
         $storeid = $context->getId();
     }
     $embeddedImages = array();
     $content = $this->get("content");
     $subject = $this->get("subject");
     #$subject = utf8_decode($subject);
     #$content = utf8_encode($content);
     $content = html_entity_decode(str_replace("&nbsp;", " ", $content), ENT_QUOTES, "UTF-8");
     #$subject = html_entity_decode(str_replace("&nbsp;", " ", $subject), ENT_QUOTES, "UTF-8");
     $subject = $et->render(trim($subject));
     $content = $et->render(trim($content));
     $mailtemplate = $this->get("mailtemplate");
     if (!empty($mailtemplate) && $mailtemplate != -1) {
         if (strpos($mailtemplate, 's#') === false) {
             $sql = "SELECT * FROM vtiger_emailtemplates WHERE templateid = " . intval($mailtemplate);
             $result = $adb->query($sql);
             $mailtemplate = $adb->fetchByAssoc($result);
             $content = str_replace('$mailtext', $content, html_entity_decode($mailtemplate["body"], ENT_COMPAT, 'UTF-8'));
             $content = Vtiger_Functions::getMergedDescription($content, $context->getId(), $context->getModuleName());
         } else {
             $parts = explode('#', $mailtemplate);
             switch ($parts[1]) {
                 case 'emailmaker':
                     $templateid = $parts[2];
                     $sql = 'SELECT body, subject FROM vtiger_emakertemplates WHERE templateid = ?';
                     $result = $adb->pquery($sql, array($templateid));
                     $EMAILContentModel = \EMAILMaker_EMAILContent_Model::getInstance($this->getModuleName(), $context->getId(), $current_language, $context->getId(), $this->getModuleName());
                     $EMAILContentModel->setSubject($adb->query_result($result, 0, 'subject'));
                     $EMAILContentModel->setBody($adb->query_result($result, 0, 'body'));
                     $EMAILContentModel->getContent(true);
                     $embeddedImages = $EMAILContentModel->getEmailImages();
                     $subject = $EMAILContentModel->getSubject();
                     $content = $EMAILContentModel->getBody();
                     break;
             }
         }
     }
     #$content = htmlentities($content, ENT_NOQUOTES, "UTF-8");
     if (getTabid('Emails') && vtlib_isModuleActive('Emails')) {
         require_once 'modules/Emails/Emails.php';
         $focus = new Emails();
         $focus->column_fields["assigned_user_id"] = \Workflow\VTEntity::getUser()->id;
         $focus->column_fields["activitytype"] = "Emails";
         $focus->column_fields["date_start"] = date("Y-m-d");
         $focus->column_fields["parent_id"] = $storeid;
         $focus->column_fields["email_flag"] = "SAVED";
         $focus->column_fields["subject"] = $subject;
         $focus->column_fields["description"] = $content;
         $focus->column_fields["from_email"] = $from_email;
         $focus->column_fields["saved_toid"] = '["' . str_replace(',', '","', trim($to_email, ",")) . '"]';
         $focus->column_fields["ccmail"] = $cc;
         $focus->column_fields["bccmail"] = $bcc;
         $focus->save("Emails");
         $this->_mailRecord = $focus;
         #error_log("eMail:".$emailID);
         $emailID = $focus->id;
     } else {
         $emailID = "";
     }
     $attachments = json_decode($this->get("attachments"), true);
     if (is_array($attachments) && count($attachments) > 0) {
         // Module greifen auf Datenbank zurück. Daher vorher speichern!
         $context->save();
         foreach ($attachments as $key => $value) {
             if ($value == false) {
                 continue;
             }
             if (is_string($value)) {
                 $value = array($value, false, array());
             }
             // legacy check
             if (strpos($key, 'document#') === 0) {
                 $key = 's#' . $key;
             }
             if (strpos($key, 's#') === 0) {
                 $tmpParts = explode('#', $key, 2);
                 $specialAttachments = \Workflow\Attachment::getAttachments($tmpParts[1], $value, $context, \Workflow\Attachment::MODE_NOT_ADD_NEW_ATTACHMENTS);
                 foreach ($specialAttachments as $attachment) {
                     if ($attachment[0] === 'ID') {
                         $this->attachByAttachmentId($attachment[1]);
                     } elseif ($attachment[0] === 'PATH') {
                         $this->attachFile($attachment[1], $attachment[2], $attachment[3]);
                     }
                 }
             } else {
                 $file = \Workflow\InterfaceFiles::getFile($key, $this->getModuleName(), $context->getId());
                 $this->attachFile($file['path'], $value[1] != false ? $value[1] : $file['name'], $file['type']);
             }
         }
     }
     $receiver = explode(",", $to_email);
     foreach ($receiver as $to_email) {
         $to_email = trim($to_email);
         if (empty($to_email)) {
             continue;
         }
         if (DEMO_MODE == false) {
             // Self using
             $mail = new Workflow_PHPMailer();
             $mail->CharSet = 'utf-8';
             $mail->IsSMTP();
             foreach ($embeddedImages as $cid => $cdata) {
                 $mail->AddEmbeddedImage($cdata["path"], $cid, $cdata["name"]);
             }
             setMailServerProperties($mail);
             $to_email = trim($to_email, ",");
             #setMailerProperties($mail,$subject, $content, $from_email, $from_name, trim($to_email,","), "all", $emailID);
             $mail->Timeout = 60;
             $mail->FromName = $from_name;
             $mail->From = $from_email;
             $this->addStat("From: " . $from_name . " &lt;" . $from_email . "&gt;");
             if ($this->get('trackAccess') == '1') {
                 //Including email tracking details
                 global $site_URL, $application_unique_key;
                 $counterUrl = $site_URL . '/modules/Emails/actions/TrackAccess.php?parentId=' . $storeid . '&record=' . $focus->id . '&applicationKey=' . $application_unique_key;
                 $counterHeight = 1;
                 $counterWidth = 1;
                 if (defined('TRACKING_IMG_HEIGHT')) {
                     $counterHeight = TRACKING_IMG_HEIGHT;
                 }
                 if (defined('TRACKING_IMG_WIDTH')) {
                     $counterWidth = TRACKING_IMG_WIDTH;
                 }
                 $content = "<img src='" . $counterUrl . "' alt='' width='" . $counterWidth . "' height='" . $counterHeight . "'>" . $content;
             }
             $mail->Subject = $subject;
             $this->addStat("Subject: " . $subject);
             $mail->MsgHTML($content);
             $mail->SMTPDebug = 2;
             $mail->addAddress($to_email);
             $this->addStat("To: " . $to_email);
             setCCAddress($mail, 'cc', $cc);
             setCCAddress($mail, 'bcc', $bcc);
             #$mail->IsHTML(true);
             addAllAttachments($mail, $emailID);
             try {
                 ob_start();
                 $mail_return = MailSend($mail);
                 $debug = ob_get_clean();
                 $this->addStat($debug);
             } catch (Workflow_phpmailerException $exp) {
                 Workflow2::error_handler($exp->getCode(), $exp->getMessage(), $exp->getFile(), $exp->getLine());
             }
             #$mail_return = send_mail($module, $to_email,$from_name,$from_email,$subject,$content, $cc, $bcc,'all',$emailID);
         } else {
             $mail_return = 1;
         }
         $this->addStat("Send eMail with following Result:");
         $this->addStat($mail_return);
         if ($mail_return != 1) {
             if (empty($mail->ErrorInfo) && empty($mail_return)) {
                 $mail_return = 1;
             }
         }
         $context->setEnvironment("sendmail_result", $mail_return, $this);
         if ($mail_return != 1) {
             if ($this->isContinued()) {
                 $delay = 180;
             } else {
                 $delay = 60;
             }
             Workflow2::send_error("Sendmail Task couldn't send an email to " . $to_email . "<br>Error: " . var_export($mail->ErrorInfo, true) . "<br><br>The Task will be rerun after " . $delay . " minutes.", __FILE__, __LINE__);
             Workflow2::error_handler(E_NONBREAK_ERROR, "Sendmail Task couldn't send an email to " . $to_email . "<br>Error: " . var_export($mail->ErrorInfo, true) . "<br><br>The Task will be rerun after " . $delay . " minutes.", __FILE__, __LINE__);
             return array("delay" => time() + $delay * 60, "checkmode" => "static");
         }
     }
     // Set Mails as Send
     $sql = "UPDATE vtiger_emaildetails SET email_flag = 'SENT' WHERE emailid = '" . $emailID . "'";
     $adb->query($sql);
     return "yes";
 }
コード例 #29
0
 public function beforeGetTaskform($viewer)
 {
     global $adb;
     $new_module = $this->get("new_module");
     if (!empty($_POST["task"]["new_module_setter"])) {
         $new_module = $_POST["task"]["new_module_setter"];
         #            $viewer->assign("module_name", $_POST["task"]["new_module_setter"]);
         $mandatoryFields = VtUtils::getMandatoryFields(getTabId($_POST["task"]["new_module_setter"]));
         $startFields = array();
         $counter = 1;
         foreach ($mandatoryFields as $field) {
             if ('productid' != $field['fieldname']) {
                 $startFields["" . $counter] = array("field" => $field["fieldname"], "mode" => "value", "value" => "", "fixed" => true);
                 $counter++;
             }
         }
         $startFields["" . $counter++] = array("field" => "currency_id", "mode" => "value", "value" => "", "fixed" => true);
         $startFields["" . $counter++] = array("field" => "hdnTaxType", "mode" => "value", "value" => "", "fixed" => true);
         $startFields["" . $counter++] = array("field" => "hdnS_H_Amount", "mode" => "value", "value" => "", "fixed" => true);
         $this->set("setter", $startFields);
         $this->set("global", array());
     }
     if (!empty($new_module) && $new_module != -1) {
         $field = new StdClass();
         $field->name = "hdnS_H_Amount";
         $field->label = getTranslatedString("Shipping & Handling Charges", $_POST["task"]["new_module_setter"]);
         $additionalFields = array($field);
         $viewer->assign("new_module", $new_module);
     }
     $workflows = Workflow2::getWorkflowsForModule($new_module, 1);
     $viewer->assign("extern_workflows", $workflows);
     $module = array();
     $module["Invoice"] = getTranslatedString("Invoice", "Invoice");
     $module["Quotes"] = getTranslatedString("Quotes", "Quotes");
     $module["PurchaseOrder"] = getTranslatedString("PurchaseOrder", "PurchaseOrder");
     $module["SalesOrder"] = getTranslatedString("SalesOrder", "SalesOrder");
     asort($module);
     $viewer->assign("avail_module", $module);
     $viewer->assign("orig_module_name", $this->getModuleName());
     $viewer->assign("availCurrency", getAllCurrencies());
     $viewer->assign("availTaxes", getAllTaxes("available"));
 }
コード例 #30
0
ファイル: ConditionCheck.php プロジェクト: cin-system/cinrepo
 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;
 }