コード例 #1
0
 public function process(Vtiger_Request $request)
 {
     ${"GLOBALS"}["kntwfslol"] = "adb";
     ${"GLOBALS"}["cqcqlnrkx"] = "response";
     ${${"GLOBALS"}["kntwfslol"]} = PearDatabase::getInstance();
     ${${"GLOBALS"}["cqcqlnrkx"]} = new Vtiger_Response();
     try {
         $wtjgzysvem = "sql";
         $oeptxvdvox = "execID";
         $zwwfbo = "result";
         ${$oeptxvdvox} = preg_replace("/[^a-zA-Z0-9]/", "", $request->get("execID"));
         ${"GLOBALS"}["yhkcnorwnk"] = "result";
         ${$wtjgzysvem} = "SELECT * FROM vtiger_wf_log WHERE execID = ?";
         ${$zwwfbo} = $adb->pquery(${${"GLOBALS"}["cxjkyjhyclpd"]}, array(${${"GLOBALS"}["pbqqoiw"]}));
         ${${"GLOBALS"}["ezmcfbv"]} = array();
         while (${${"GLOBALS"}["lndkyrocpr"]} = $adb->fetch_array(${${"GLOBALS"}["yhkcnorwnk"]})) {
             $vjmvxw = "row";
             $mroetkdbdx = "row";
             $lmqbvml = "row";
             ${${"GLOBALS"}["ezmcfbv"]}[] = array(${$lmqbvml}["blockid"], ${$mroetkdbdx}["lastblockid"], ${${"GLOBALS"}["lndkyrocpr"]}["lastblockoutput"], "timestamp" => \Workflow\VtUtils::formatUserDate(${$vjmvxw}["timestamp"]));
         }
         $response->setResult(array("success" => true, "execID" => ${${"GLOBALS"}["pbqqoiw"]}, "data" => ${${"GLOBALS"}["ezmcfbv"]}));
     } catch (Exception $exp) {
         $response->setResult(array("success" => false, "error" => $exp->getMessage()));
     }
     $response->emit();
 }
コード例 #2
0
 public function getByPosition($module_name, $position, $crmid = null)
 {
     $jqynibqldv = "result";
     ${"GLOBALS"}["nevhqjyksh"] = "adb";
     ${"GLOBALS"}["mutjauyhbo"] = "return";
     ${"GLOBALS"}["gvogqnedhc"] = "position";
     ${${"GLOBALS"}["nevhqjyksh"]} = \PearDatabase::getInstance();
     ${"GLOBALS"}["olgoojgyvdp"] = "return";
     ${${"GLOBALS"}["xcedpvrs"]} = "SELECT * FROM\n                    vtiger_wf_frontendmanager\n                        INNER JOIN vtiger_wf_settings ON (vtiger_wf_settings.id = vtiger_wf_frontendmanager.workflow_id AND module_name = ?)\n                WHERE position = ? ORDER BY `vtiger_wf_frontendmanager`.`order`";
     ${${"GLOBALS"}["uumvmqjs"]} = $adb->pquery(${${"GLOBALS"}["xcedpvrs"]}, array(${${"GLOBALS"}["qjtejuot"]}, ${${"GLOBALS"}["gvogqnedhc"]}), true);
     ${${"GLOBALS"}["olgoojgyvdp"]} = array();
     while (${${"GLOBALS"}["xugmxtwse"]} = $adb->fetchByAssoc(${$jqynibqldv})) {
         ${"GLOBALS"}["rhazqx"] = "crmid";
         $locspkchpkpv = "crmid";
         $bkcxzm = "objWorkflow";
         ${$bkcxzm} = new \Workflow\Main(${${"GLOBALS"}["xugmxtwse"]}["workflow_id"]);
         if ((${${"GLOBALS"}["xugmxtwse"]}["authmanagement"] == "0" || ${${"GLOBALS"}["rhazqx"]} === null || $objWorkflow->checkAuth("view")) && $objWorkflow->checkExecuteCondition(${$locspkchpkpv})) {
             $prloexwxnpq = "row";
             ${"GLOBALS"}["knvjubdlgb"] = "row";
             if (empty(${${"GLOBALS"}["xugmxtwse"]}["color"])) {
                 $lfypjipklox = "row";
                 ${$lfypjipklox}["color"] = "#3D57FF";
             }
             if (${$prloexwxnpq}["position"] == "sidebar") {
                 $pqtbnmbnphs = "row";
                 ${$pqtbnmbnphs}["textcolor"] = \Workflow\VtUtils::getTextColor(${${"GLOBALS"}["xugmxtwse"]}["color"]);
             }
             ${${"GLOBALS"}["mjznoky"]}[] = ${${"GLOBALS"}["knvjubdlgb"]};
         }
     }
     return ${${"GLOBALS"}["mutjauyhbo"]};
 }
コード例 #3
0
ファイル: URL.inc.php プロジェクト: cin-system/cinrepo
 /**
  * @param $key
  * @param $value
  * @param $context \Workflow\VTEntity
  * @return array|void
  */
 public function generateAttachments($key, $value, $context)
 {
     global $current_user;
     $adb = \PearDatabase::getInstance();
     $url = $value[2]['val'];
     $url = \Workflow\VTTemplate::parse($url, $context);
     $filename = \Workflow\VTTemplate::parse($value[2]['name'], $context);
     if (empty($filename)) {
         $filename = basename($url);
     }
     $filecontent = \Workflow\VtUtils::getContentFromUrl($url);
     if (empty($filecontent)) {
         return array();
     }
     $filename = preg_replace('/[^A-Za-z0-9-_.]/', '_', $filename);
     if ($this->_mode === self::MODE_NOT_ADD_NEW_ATTACHMENTS) {
         $tmpfile = tempnam(sys_get_temp_dir(), 'Url');
         @unlink($tmpfile);
         file_put_contents($tmpfile, $filecontent);
         $this->addAttachmentRecord('PATH', $tmpfile, $filename);
         return;
     }
     $upload_file_path = decideFilePath();
     $next_id = $adb->getUniqueID("vtiger_crmentity");
     file_put_contents($upload_file_path . $next_id . "_" . $filename, $filecontent);
     $filesize = filesize($upload_file_path . $next_id . "_" . $filename);
     $filetype = "application/octet-stream";
     $sql1 = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values(?, ?, ?, ?, ?, ?, ?)";
     $params1 = array($next_id, $current_user->id, $current_user->id, "Documents Attachment", 'Documents Attachment', date("Y-m-d H:i:s"), date("Y-m-d H:i:s"));
     $adb->pquery($sql1, $params1);
     $sql2 = "insert into vtiger_attachments(attachmentsid, name, description, type, path) values(?, ?, ?, ?, ?)";
     $params2 = array($next_id, $filename, '', $filetype, $upload_file_path);
     $adb->pquery($sql2, $params2);
     $this->addAttachmentRecord('ID', $next_id);
 }
コード例 #4
0
ファイル: StaticFields.php プロジェクト: cin-system/cinrepo
 public function getFromFields()
 {
     if ($this->_fromFields === null) {
         $this->_fromFields = VtUtils::getFieldsWithBlocksForModule($this->parameter["fromModule"], true);
     }
     return $this->_fromFields;
 }
コード例 #5
0
ファイル: Reference.inc.php プロジェクト: cin-system/cinrepo
 /**
  * @param $data     - Config Array of this Input with the following Structure
  *                      array(
  *                          'label' => 'Label the Function should use',
  *                          'name' => 'The Fieldname, which should submit the value, the Workflow will be write to Environment',
  *                          'config' => Key-Value Array with all configurations, done by admin
  *                      )
  * @param \Workflow\VTEntity $context - Current Record, which is assigned to the Workflow
  * @return array - The rendered content, shown to the user with the following structure
  *                  array(
  *                      'html' => '<htmlContentOfThisInputField>',
  *                      'javascript' => 'A Javascript executed after html is shown'
  *                  )
  *
  */
 public function renderFrontend($data, $context)
 {
     $relmod = $data['config']['reference'];
     $mainData = array();
     $records = \Workflow\VtUtils::getRelatedRecords($context->getModuleName(), $context->getId(), $relmod);
     if (count($records) > 0) {
         $mainData = \Workflow\VtUtils::getMainRecordData($relmod, $records);
         $fieldId = 'field_' . preg_replace('/[^a-zA-Z0-9_]/', '_', $data['name']);
         uasort($mainData, function ($a, $b) {
             return strcmp($a["number"], $b["number"]);
         });
     }
     $html = '';
     $script = '';
     $field = '<select style="width:410px;" name="' . $data['name'] . '" id="' . $fieldId . '" class="select2" data-placeholder="' . vtranslate('choose Reference', 'Workflow2') . '">';
     if (!empty($data['config']['nullable'])) {
         $field .= '<option value="" selected="selected"><em>- ' . vtranslate('no Selection', 'Workflow2') . '</em></option>';
     }
     if (count($mainData) > 0) {
         foreach ($mainData as $crmid => $record) {
             $field .= '<option value="' . $crmid . '" data-url="' . $record['link'] . '">[' . $record['number'] . '] ' . $record['label'] . '</option>';
         }
     }
     $field .= '</select>';
     $html = "<label><div style='min-height:26px;padding:2px 0;'><div style=''><strong>" . $data['label'] . "</strong></div><div style='text-align:right;'>" . $field . "<div style='display:none;margin-top:5px;' id='url_" . $data['name'] . "'></div></div></div></label>";
     $script = '';
     if (!empty($data['config']['nullable'])) {
         $script .= 'jQuery("#' . $fieldId . '").select2("val", "");';
     }
     $script .= 'jQuery("#' . $fieldId . '").on("change", function(e) {var selected = jQuery("#' . $fieldId . ' option:selected"); if(selected.val() == "") { jQuery("#url_' . $data['name'] . '").html("");return;}; jQuery("#url_' . $data['name'] . '").show().html("Link: <a href=\'" + selected.data("url") + "\' target=\'_blank\'><strong>" + selected.text() + "</strong></a>");
      });';
     return array('html' => $html, 'javascript' => $script);
 }
コード例 #6
0
 public function beforeGetTaskform($viewer)
 {
     global $adb;
     if (!\Workflow\VtUtils::existTable("vtiger_wf_customnumbering")) {
         echo "Create table vtiger_wf_confirmation_user ... ok<br>";
         $adb->query("CREATE TABLE IF NOT EXISTS `vtiger_wf_customnumbering` (\r\n              `serie` varchar(24) NOT NULL,\r\n              `prefix` varchar(16) NOT NULL,\r\n              `current` int(10) unsigned NOT NULL,\r\n              `length` tinyint(4) NOT NULL,\r\n              PRIMARY KEY (`serie`)\r\n            ) ENGINE=InnoDB;");
     }
     $crmidColObj = CRMEntity::getInstance($this->getModuleName());
     $viewer->assign('crmidCol', $crmidColObj->table_index);
     $moduleName = $this->getModuleName();
     $fields = VtUtils::getFieldsWithBlocksForModule($moduleName, false);
     $selectedId = $this->get('field');
     if ($selectedId === -1 || empty($selectedId)) {
         $sql = 'SELECT * FROM vtiger_field WHERE uitype = 4 AND tabid = ' . getTabid($moduleName);
         $result = $adb->query($sql);
         $selectedId = $adb->query_result($result, 0, 'fieldname');
         $this->set('field', $selectedId);
     }
     $sql = 'SELECT * FROM vtiger_wf_customnumbering';
     $result = $adb->query($sql);
     $series = array();
     while ($row = $adb->fetchByAssoc($result)) {
         $series[$row['serie']] = $row;
     }
     if (isset($series[$this->get('serie')])) {
         $viewer->assign('lockFields', true);
     }
     $viewer->assign('series', $series);
     $viewer->assign('fields', $fields);
     /* Insert here source code to create custom configurations pages */
 }
コード例 #7
0
ファイル: Manager.php プロジェクト: cin-system/cinrepo
 public static function getTaskHandler($type, $taskID, $workflow = false)
 {
     $difkiadcjj = "sql";
     global $adb;
     ${"GLOBALS"}["vigeayiuagj"] = "result";
     ${"GLOBALS"}["ymbusetiqjad"] = "className";
     ${$difkiadcjj} = "SELECT `handlerClass`, `file`,`module`,`id`  FROM vtiger_wf_types WHERE `type` = '" . ${${"GLOBALS"}["dtigdoiadd"]} . "'";
     ${${"GLOBALS"}["tydgcp"]} = \Workflow\VtUtils::query(${${"GLOBALS"}["nlgdcz"]});
     $efyvkmgcanpn = "className";
     $egguqrhvnyo = "row";
     $haxggxetire = "objTask";
     ${${"GLOBALS"}["mghkudhvefbq"]} = $adb->fetch_array(${${"GLOBALS"}["vigeayiuagj"]});
     if (!empty(${${"GLOBALS"}["mghkudhvefbq"]}["file"])) {
         ${"GLOBALS"}["ndwllnkrw"] = "row";
         require_once "modules/" . ${${"GLOBALS"}["ndwllnkrw"]}["module"] . "/" . ${${"GLOBALS"}["mghkudhvefbq"]}["file"];
     } else {
         ${"GLOBALS"}["iukyxvxgjf"] = "taskDir";
         ${"GLOBALS"}["kbotayscdosb"] = "taskDir";
         ${${"GLOBALS"}["wvrcehb"]} = dirname(__FILE__) . "/../../../" . ${${"GLOBALS"}["mghkudhvefbq"]}["module"] . "/";
         if (!file_exists(${${"GLOBALS"}["kbotayscdosb"]} . "/tasks/" . preg_replace("/[^a-zA-z0-9]/", "", ${${"GLOBALS"}["mghkudhvefbq"]}["handlerclass"]) . ".php")) {
             $lcncgpegplw = "row";
             $dbzwqvvloo = "type";
             throw new \Exception("Taskfile '" . preg_replace("/[^a-zA-z0-9]/", "", ${$lcncgpegplw}["handlerclass"]) . ".php" . "' not found. TypeID: " . ${${"GLOBALS"}["mghkudhvefbq"]}["id"] . " / Type: " . ${$dbzwqvvloo});
             exit;
         }
         require_once ${${"GLOBALS"}["iukyxvxgjf"]} . "tasks/" . preg_replace("/[^a-zA-z0-9]/", "", ${${"GLOBALS"}["mghkudhvefbq"]}["handlerclass"]) . ".php";
     }
     ${$efyvkmgcanpn} = ${$egguqrhvnyo}["handlerclass"];
     ${$haxggxetire} = new ${${"GLOBALS"}["ymbusetiqjad"]}(${${"GLOBALS"}["ncvolctk"]});
     if (${${"GLOBALS"}["bvxigqve"]} !== false) {
         $akonekfkw = "workflow";
         $objTask->setWorkflow(${$akonekfkw});
     }
     return ${${"GLOBALS"}["lyeyccstdk"]};
 }
コード例 #8
0
 /**
  * @param $data     - Config Array of this Input with the following Structure
  *                      array(
  *                          'label' => 'Label the Function should use',
  *                          'name' => 'The Fieldname, which should submit the value, the Workflow will be write to Environment',
  *                          'config' => Key-Value Array with all configurations, done by admin
  *                      )
  * @param \Workflow\VTEntity $context - Current Record, which is assigned to the Workflow
  * @return array - The rendered content, shown to the user with the following structure
  *                  array(
  *                      'html' => '<htmlContentOfThisInputField>',
  *                      'javascript' => 'A Javascript executed after html is shown'
  *                  )
  *
  */
 public function renderFrontend($data, $context)
 {
     $relmod = $data['config']['module'];
     if (empty($data['config']['condition'])) {
         echo 'please configure condition!';
         return;
     }
     $adb = \PearDatabase::getInstance();
     $conditions = \Zend_Json::decode(base64_decode($data['config']['condition']));
     $logger = new \Workflow\ConditionLogger();
     $objMySQL = new \Workflow\ConditionMysql($relmod, $context);
     $objMySQL->setLogger($logger);
     $main_module = \CRMEntity::getInstance($relmod);
     $sqlCondition = $objMySQL->parse($conditions['condition']);
     if (strlen($sqlCondition) > 3) {
         $sqlCondition .= "AND vtiger_crmentity.deleted = 0";
     } else {
         $sqlCondition .= "vtiger_crmentity.deleted = 0";
     }
     $logs = $logger->getLogs();
     //$this->setStat($logs);
     $sqlTables = $objMySQL->generateTables();
     $idColumn = $main_module->table_name . "." . $main_module->table_index;
     $sqlQuery = "SELECT {$idColumn} as idcol " . $sqlTables . " WHERE " . (strlen($sqlCondition) > 3 ? $sqlCondition : "") . ' GROUP BY vtiger_crmentity.crmid';
     //$this->addStat("MySQL Query: ".$sqlQuery);
     $result = $adb->query($sqlQuery);
     $ids = array();
     while ($row = $adb->fetchByAssoc($result)) {
         $ids[] = $row['idcol'];
     }
     $mainData = \Workflow\VtUtils::getMainRecordData($relmod, $ids);
     uasort($mainData, function ($a, $b) {
         return strcmp($a["number"], $b["number"]);
     });
     $html = '';
     $script = '';
     $fieldId = 'field_' . preg_replace('/[^a-zA-Z0-9_]/', '_', $data['name']);
     $field = '<select style="width:410px;" name="' . $data['name'] . '" id="' . $fieldId . '" class="select2" data-placeholder="' . vtranslate('choose Reference', 'Workflow2') . '">';
     if (!empty($data['config']['nullable'])) {
         $field .= '<option value="" selected="selected"><em>- ' . vtranslate('no Selection', 'Workflow2') . '</em></option>';
     }
     if (count($mainData) > 0) {
         foreach ($mainData as $crmid => $record) {
             $field .= '<option value="' . $crmid . '" data-url="' . $record['link'] . '">[' . $record['number'] . '] ' . $record['label'] . '</option>';
         }
     }
     $field .= '</select>';
     $html = "<label><div style='min-height:26px;padding:2px 0;'><div style=''><strong>" . $data['label'] . "</strong></div><div style='text-align:right;'>" . $field . "<div style='display:none;margin-top:5px;' id='url_" . $data['name'] . "'></div></div></div></label>";
     $script = '';
     if (!empty($data['config']['nullable'])) {
         $script .= 'jQuery("#' . $fieldId . '").select2("val", "");';
     }
     $script .= 'jQuery("#' . $fieldId . '").on("change", function(e) {var selected = jQuery("#' . $fieldId . ' option:selected"); if(selected.val() == "") { jQuery("#url_' . $data['name'] . '").html("");return;}; jQuery("#url_' . $data['name'] . '").show().html("Link: <a href=\'" + selected.data("url") + "\' target=\'_blank\'><strong>" + selected.text() + "</strong></a>");
      });';
     return array('html' => $html, 'javascript' => $script);
 }
コード例 #9
0
 public function beforeGetTaskform($viewer)
 {
     global $adb, $app_strings;
     $fields = \Workflow\VtUtils::getFieldsForModule($this->getModuleName(), array(51, 57, 58, 59, 73, 75, 81, 76, 78, 80, 68, 10));
     $references = array();
     foreach ($fields as $field) {
         switch ($field->uitype) {
             case "51":
                 $module = "Accounts";
                 break;
             case "57":
                 $module = "Contacts";
                 break;
             case "58":
                 $module = "Campaigns";
                 break;
             case "59":
                 $module = "Products";
                 break;
             case "73":
                 $module = "Accounts";
                 break;
             case "75":
                 $module = "Vendors";
                 break;
             case "81":
                 $module = "Vendors";
                 break;
             case "76":
                 $module = "Potentials";
                 break;
             case "78":
                 $module = "Quotes";
                 break;
             case "80":
                 $module = "SalesOrder";
                 break;
             case "68":
                 $module = "Accounts";
                 break;
             case "10":
                 # Possibly multiple relations
                 $result = $adb->pquery('SELECT relmodule FROM `vtiger_fieldmodulerel` WHERE fieldid = ?', array($field->id));
                 while ($data = $adb->fetch_array($result)) {
                     $module = $data["relmodule"];
                 }
                 break;
         }
         $field->targetModule = !empty($app_strings[$module]) ? $app_strings[$module] : $module;
         $references[] = $field;
     }
     $viewer->assign("references", $references);
 }
コード例 #10
0
 public function handleTask(&$context)
 {
     $printer = $this->get('printer');
     if (empty($printer) || $printer == -1) {
         $this->addStat('You must configure printer before you could use this block!');
         return "yes";
     }
     $workingFiles = array();
     $files = json_decode($this->get("files"), true);
     if (is_array($files) && count($files) > 0) {
         // Module greifen auf Datenbank zurück. Daher vorher speichern!
         $context->save();
         foreach ($files as $key => $value) {
             if (is_string($value)) {
                 $value = array($value, false, array());
             }
             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') {
                         $tmp = \Workflow\VtUtils::getFileDataFromAttachmentsId($attachment[1]);
                         $workingFiles[] = array('path' => $tmp['path'], 'filename' => $tmp['filename']);
                     } elseif ($attachment[0] === 'PATH') {
                         $workingFiles[] = array('path' => $attachment[1], 'filename' => $attachment[2]['filename']);
                     }
                 }
             }
         }
         if (count($workingFiles) > 0) {
             $capabilities = $this->get('capability');
             $capabilityOption = array();
             foreach ($capabilities as $capability => $value) {
                 switch ($capability) {
                     case 'page_orientation':
                         $capabilityOption['page_orientation']['type'] = $value;
                         break;
                     case 'duplex':
                         $capabilityOption['duplex']['type'] = $value;
                         break;
                 }
             }
             foreach ($workingFiles as $file) {
                 $resarray = $this->gcp->sendPrintToPrinter($printer, 'VtigerCRM Print ' . $file['filename'], $file['path'], "application/pdf", json_encode($capabilityOption));
             }
         }
     }
     return "yes";
 }
コード例 #11
0
ファイル: WfTaskRelcheck.php プロジェクト: cin-system/cinrepo
 /**
  * @param $context \Workflow\VTEntity
  * @return string
  */
 public function handleTask(&$context)
 {
     global $list_max_entries_per_page, $adb, $currentModule;
     $old_list_max_entries_per_page = $list_max_entries_per_page;
     if ($this->get("related_module") == -1) {
         return "no";
     }
     $currentModule = $this->getModuleName();
     $found_rows = $this->get("found_rows");
     if (empty($found_rows) || $found_rows == -1) {
         $found_rows = 1;
     }
     $parts = explode("#~#", $this->get("related_module"));
     $functionName = $parts[0];
     $relatedModuleName = \Workflow\VtUtils::getModuleName($parts[1]);
     //$relationListView = Vtiger_RelationListView_Model::getInstance($parentRecordModel, $relatedModuleName, $label);
     $parentRecordModel = Vtiger_Record_Model::getInstanceById($context->getId(), $context->getModuleName());
     /**
      * @var Vtiger_RelationListView_Model $relatedListView
      */
     $relationListView = Vtiger_RelationListView_Model::getInstance($parentRecordModel, $relatedModuleName);
     $query = $relationListView->getRelationQuery();
     $query = preg_replace('/SELECT(.+)FROM/imU', 'SELECT vtiger_crmentity.crmid FROM', $query);
     $logger = new \Workflow\ConditionLogger();
     $relModule = \Workflow\VtUtils::getModuleName($parts[1]);
     $objMySQL = new \Workflow\ConditionMysql($relModule, $context);
     $objMySQL->setLogger($logger);
     $main_module = \CRMEntity::getInstance($relModule);
     $sqlCondition = $objMySQL->parse($this->get("condition"));
     $sqlTables = $objMySQL->generateTables();
     $logs = $logger->getLogs();
     $this->setStat($logs);
     $idColumn = $main_module->table_name . "." . $main_module->table_index;
     $sqlQuery = "SELECT {$idColumn} " . $sqlTables . " WHERE {$idColumn} IN (" . $query . ")" . (strlen($sqlCondition) > 3 ? " AND " . $sqlCondition : "");
     $this->addStat("MySQL Query: " . $sqlQuery);
     $result = $adb->query($sqlQuery, true);
     $this->addStat("num Rows: " . $adb->num_rows($result));
     $this->addStat("have to at least x rows: " . $found_rows);
     if ($adb->num_rows($result) >= $found_rows) {
         return 'yes';
     }
     return "no";
 }
コード例 #12
0
 public function beforeGetTaskform($viewer)
 {
     $pause_rows = $this->get("pause_rows");
     if ($pause_rows == -1) {
         $this->set("pause_rows", 50);
     }
     $cols = $this->get("cols");
     if ($cols == -1) {
         $cols = array();
     }
     foreach ($cols["key"] as $index => $col) {
         if (empty($col)) {
             unset($cols["key"][$index]);
             unset($cols["value"][$index]);
         }
     }
     $viewer->assign("cols", $cols);
     $references = \Workflow\VtUtils::getReferenceFieldsForModule($this->getModuleName());
     $viewer->assign("reference", $references);
 }
コード例 #13
0
ファイル: Index.php プロジェクト: cin-system/vtigercrm-cin
 public function process(Vtiger_Request $request)
 {
     ${"GLOBALS"}["pibzelpsusj"] = "result";
     $ntqfzuj = "sql";
     ${"GLOBALS"}["luyxepol"] = "result";
     $atcphewm = "qualifiedModuleName";
     ${"GLOBALS"}["invpyjfekp"] = "old_id";
     $ecucgikkeee = "activeSidebarWidget";
     $djufxynvms = "sql";
     ${"GLOBALS"}["vkwkldnuxx"] = "workflows";
     ${"GLOBALS"}["khcvmhggtihl"] = "old_id";
     global $current_user;
     $qglsatdvfad = "sql";
     ${"GLOBALS"}["pubvxkvh"] = "adb";
     ${${"GLOBALS"}["pubvxkvh"]} = PearDatabase::getInstance();
     ${"GLOBALS"}["fgbmjolpmk"] = "workflows";
     ${$qglsatdvfad} = "UPDATE vtiger_cron_task SET status = 1 WHERE name = \"Workflow2 Queue\" AND status = 0 AND laststart < " . (time() - 1800);
     ${"GLOBALS"}["wyxsvveyyo"] = "sql";
     $adb->query(${${"GLOBALS"}["edqgalfykx"]}, true);
     $vjvjzmfelj = "row";
     $qldtbywqn = "as2df";
     ${${"GLOBALS"}["gtlqvftw"]} = $request->getModule();
     $etwlsqrug = "request";
     $xsfwty = "blockTransfer";
     ${$atcphewm} = $request->getModule(false);
     ${${"GLOBALS"}["ttxqicptt"]} = $this->getViewer(${$etwlsqrug});
     ${${"GLOBALS"}["uspdfmeyp"]} = Vtiger_Module_Model::getInstance("Workflow2");
     ${${"GLOBALS"}["jekhhbkce"]} = Settings_Vtiger_Module_Model::getInstance(${${"GLOBALS"}["mtqthklxc"]});
     ${"GLOBALS"}["axkszdy"] = "sql";
     ${"GLOBALS"}["alhvvss"] = "result";
     ${${"GLOBALS"}["xktaolnbz"]} = "S" . "WE" . "xt" . "ension_" . "Workflow2_" . "f54fc8d8ea40c20ed7b" . "ded50c0d717b52c263a9f";
     ${$qldtbywqn} = new ${${"GLOBALS"}["xktaolnbz"]}("Workflow2", $moduleModel->version);
     ${"GLOBALS"}["bmcjqqm"] = "sql";
     $uypwsnpeqwg = "sql";
     ${"GLOBALS"}["nbmuhulet"] = "row";
     ${"GLOBALS"}["ygymfbpkuuy"] = "result";
     if (false === $as2df->g5e88fdd0c90580423fdf35595dceef598bcb2487()) {
         echo "<br/><br/><p style='text-align:center;color:red;font-weight:bold;'>" . getTranslatedString("Failure during Reactivation.", "Settings:Workflow2") . "<br>" . getTranslatedString("You couldn't use the Workflow Designer Admin at the moment. Workflows are not stopped!", "Settings:Workflow2") . "<br><br>" . getTranslatedString("Please make sure, the VtigerCRM could connect to the internet.", "Settings:Workflow2") . "</p>";
         ${"GLOBALS"}["efilhxpcrkr"] = "method";
         ${${"GLOBALS"}["efilhxpcrkr"]} = "ha" . "sLi" . "cen" . "seKe" . "y";
         if (!$as2df->{${${"GLOBALS"}["shqygphxvur"]}}()) {
             echo "<button type=\"button\" class=\"btn addButton\" style=\"float:right;\" onclick=\"setLicense();\">Set License</button>";
         } else {
             echo "<div style=\"text-align:center;font-weight:bold;\">" . getTranslatedString("LBL_ALREADY_SET_KEY", "Settings:Workflow2") . "</div>";
             echo "<button type=\"button\" class=\"btn addButton\" style=\"float:right;\" onclick=\"setLicense();\">Set License</button>";
         }
         return;
     }
     ${"GLOBALS"}["qgsvjsdvo"] = "row";
     $yzqmqqli = "sql";
     ${"GLOBALS"}["pmbqtjd"] = "sql";
     $toyuxr = "sql";
     $cuwvvwjvyzki = "sql";
     ${"GLOBALS"}["tdagjajxs"] = "allowCreation";
     $qfeqitm = "values";
     $gohobpd = "visibility";
     ${"GLOBALS"}["cyktxk"] = "row";
     $viewer->assign("ERROR_HANDLER_VALUE", ERROR_HANDLER_VALUE);
     ${"GLOBALS"}["bckjbji"] = "sql";
     ${"GLOBALS"}["teckkxvltb"] = "visibility";
     $viewer->assign("is_admin", $current_user->is_admin == "on");
     $cgyitklv = "sql";
     $tmvqcnr = "sql";
     ${"GLOBALS"}["tgmvphjv"] = "sql";
     $xrectw = "key";
     ${"GLOBALS"}["adqkrjyod"] = "old_id";
     ${"GLOBALS"}["pyunhhvj"] = "old_id";
     $gotxbhwhxh = "sql";
     ${${"GLOBALS"}["oghtdoi"]} = true;
     $hgjsltk = "sql";
     switch ($request->get("act")) {
         case "create":
             if (${${"GLOBALS"}["tdagjajxs"]}) {
                 ${"GLOBALS"}["dppsuiipvmto"] = "workflow_id";
                 ${"GLOBALS"}["nqmswkhavv"] = "workflow_id";
                 ${${"GLOBALS"}["edqgalfykx"]} = "INSERT INTO vtiger_wf_settings SET active = 0";
                 ${"GLOBALS"}["bqqjfgkwump"] = "sql";
                 $psejmjowxo = "sql";
                 ${"GLOBALS"}["iqngfky"] = "sql";
                 $adb->query(${${"GLOBALS"}["iqngfky"]});
                 ${${"GLOBALS"}["dppsuiipvmto"]} = $adb->getLastInsertID();
                 ${${"GLOBALS"}["edqgalfykx"]} = "UPDATE vtiger_wf_settings SET title = 'Workflow " . ${${"GLOBALS"}["nqmswkhavv"]} . "', `trigger` = 'WF2_MANUELL' WHERE id = " . ${${"GLOBALS"}["dctyrvoxp"]};
                 $adb->query(${${"GLOBALS"}["edqgalfykx"]});
                 ${${"GLOBALS"}["bqqjfgkwump"]} = "INSERT INTO vtiger_wfp_blocks SET workflow_id = " . ${${"GLOBALS"}["dctyrvoxp"]} . ", active = 1, type = 'start', `x` = 300, y = 300";
                 $gybdgteykhbj = "workflow_id";
                 $adb->query(${$psejmjowxo});
                 ob_get_clean();
                 header("Location:index.php?module=Workflow2&view=Config&parent=Settings&workflow=" . ${$gybdgteykhbj});
                 echo "Success. You will be redirected";
                 echo "<meta http-equiv=\"refresh\" content=\"0; url=index.php?module=Workflow2&view=Config&parent=Settings&workflow=" . ${${"GLOBALS"}["dctyrvoxp"]} . "\">";
                 exit;
             } else {
                 echo "<div style='font-weight:bold;color:red;'>" . getTranslatedString("LBL_WAR" . "NING" . "_LICE" . "NSE_COU" . "NT", "Workflow2") . "</div>";
             }
             break;
         case "deactivate":
             ${$cgyitklv} = "UPDATE vtiger_wf_settings SET active = 0 WHERE id = " . intval($request->get("workflow"));
             $adb->query(${${"GLOBALS"}["bckjbji"]});
             break;
         case "activate":
             ${${"GLOBALS"}["edqgalfykx"]} = "UPDATE vtiger_wf_settings SET active = 1 WHERE id = " . intval($request->get("workflow"));
             $adb->query(${${"GLOBALS"}["edqgalfykx"]});
             break;
         case "toggleTrigger":
             break;
         case "duplicate":
             ${${"GLOBALS"}["adqkrjyod"]} = intval($_GET["workflow"]);
             ${${"GLOBALS"}["edqgalfykx"]} = "SELECT * FROM vtiger_wf_settings WHERE id = " . ${${"GLOBALS"}["khcvmhggtihl"]};
             ${${"GLOBALS"}["afjlhexbb"]} = $adb->query(${${"GLOBALS"}["edqgalfykx"]}, true);
             ${${"GLOBALS"}["nbmuhulet"]} = $adb->fetchByAssoc(${${"GLOBALS"}["afjlhexbb"]});
             ${${"GLOBALS"}["ecmvxz"]} = array();
             ${${"GLOBALS"}["brvtvfejirl"]} = array();
             unset(${${"GLOBALS"}["vjwrascz"]}["id"]);
             ${${"GLOBALS"}["vjwrascz"]}["active"] = 0;
             ${${"GLOBALS"}["vjwrascz"]}["title"] .= " Copy";
             foreach (${${"GLOBALS"}["vjwrascz"]} as ${$xrectw} => ${${"GLOBALS"}["xcqbxzdsdh"]}) {
                 $eynwddmlihts = "setter";
                 ${"GLOBALS"}["wldxnzdkf"] = "key";
                 ${$eynwddmlihts}[] = "`" . ${${"GLOBALS"}["wldxnzdkf"]} . "` = ?";
                 ${${"GLOBALS"}["brvtvfejirl"]}[] = utf8_encode(html_entity_decode(${${"GLOBALS"}["xcqbxzdsdh"]}));
             }
             ${$gotxbhwhxh} = "INSERT INTO vtiger_wf_settings SET " . implode(",", ${${"GLOBALS"}["ecmvxz"]});
             $adb->pquery(${${"GLOBALS"}["edqgalfykx"]}, ${$qfeqitm}, false);
             ${${"GLOBALS"}["dctyrvoxp"]} = $adb->getLastInsertID();
             ${${"GLOBALS"}["edqgalfykx"]} = "SELECT * FROM vtiger_wfp_blocks WHERE workflow_id = " . ${${"GLOBALS"}["pyunhhvj"]};
             ${${"GLOBALS"}["afjlhexbb"]} = $adb->query(${$cuwvvwjvyzki}, true);
             ${$xsfwty} = array();
             while (${${"GLOBALS"}["qgsvjsdvo"]} = $adb->fetchByAssoc(${${"GLOBALS"}["luyxepol"]})) {
                 $ksutspgn = "row";
                 ${"GLOBALS"}["asnznccj"] = "setter";
                 $sjceuonjt = "sql";
                 ${"GLOBALS"}["tupkfll"] = "row";
                 ${${"GLOBALS"}["ecmvxz"]} = array();
                 ${${"GLOBALS"}["brvtvfejirl"]} = array();
                 ${$ksutspgn}["workflow_id"] = ${${"GLOBALS"}["dctyrvoxp"]};
                 ${${"GLOBALS"}["wiwmayyks"]} = ${${"GLOBALS"}["tupkfll"]}["id"];
                 $zjegvaw = "sql";
                 unset(${${"GLOBALS"}["vjwrascz"]}["id"]);
                 foreach (${${"GLOBALS"}["vjwrascz"]} as ${${"GLOBALS"}["hdgbwss"]} => ${${"GLOBALS"}["xcqbxzdsdh"]}) {
                     ${"GLOBALS"}["fmbsibr"] = "setter";
                     $nqfjiccdgv = "key";
                     $qmpbtoeqxqi = "value";
                     $yvijtopxd = "values";
                     ${${"GLOBALS"}["fmbsibr"]}[] = "`" . ${$nqfjiccdgv} . "` = ?";
                     ${$yvijtopxd}[] = utf8_encode(html_entity_decode(${$qmpbtoeqxqi}));
                 }
                 ${$sjceuonjt} = "INSERT INTO vtiger_wfp_blocks SET " . implode(",", ${${"GLOBALS"}["asnznccj"]});
                 ${"GLOBALS"}["xppwxkhop"] = "values";
                 $adb->pquery(${$zjegvaw}, ${${"GLOBALS"}["xppwxkhop"]}, false);
                 ${${"GLOBALS"}["noheckx"]}["block_" . ${${"GLOBALS"}["wiwmayyks"]}] = $adb->getLastInsertID();
             }
             ${${"GLOBALS"}["edqgalfykx"]} = "SELECT * FROM vtiger_wfp_connections WHERE workflow_id = " . ${${"GLOBALS"}["rnbmskgw"]} . " AND deleted = 0";
             ${${"GLOBALS"}["ygymfbpkuuy"]} = $adb->query(${${"GLOBALS"}["edqgalfykx"]}, false);
             while (${${"GLOBALS"}["vjwrascz"]} = $adb->fetchByAssoc(${${"GLOBALS"}["afjlhexbb"]})) {
                 ${"GLOBALS"}["utdriuhjhb"] = "key";
                 ${"GLOBALS"}["avjnuqiwo"] = "row";
                 $qupaisk = "row";
                 ${"GLOBALS"}["rovwwcx"] = "setter";
                 ${"GLOBALS"}["xsknwrpw"] = "values";
                 $vgnqig = "row";
                 $qudfqcvnf = "row";
                 ${${"GLOBALS"}["rovwwcx"]} = array();
                 $qomxnvbmfl = "values";
                 ${"GLOBALS"}["oypfcifam"] = "setter";
                 ${"GLOBALS"}["zesmgm"] = "workflow_id";
                 ${${"GLOBALS"}["xsknwrpw"]} = array();
                 ${$qudfqcvnf}["workflow_id"] = ${${"GLOBALS"}["zesmgm"]};
                 ${${"GLOBALS"}["vjwrascz"]}["source_id"] = ${${"GLOBALS"}["noheckx"]}["block_" . ${${"GLOBALS"}["vjwrascz"]}["source_id"]];
                 ${${"GLOBALS"}["vjwrascz"]}["destination_id"] = ${${"GLOBALS"}["noheckx"]}["block_" . ${${"GLOBALS"}["avjnuqiwo"]}["destination_id"]];
                 ${"GLOBALS"}["bffkjor"] = "sql";
                 unset(${$qupaisk}["id"]);
                 foreach (${$vgnqig} as ${${"GLOBALS"}["utdriuhjhb"]} => ${${"GLOBALS"}["xcqbxzdsdh"]}) {
                     ${"GLOBALS"}["nsecfsvjqia"] = "setter";
                     $xhwkdilmbk = "key";
                     ${${"GLOBALS"}["nsecfsvjqia"]}[] = "`" . ${$xhwkdilmbk} . "` = ?";
                     ${${"GLOBALS"}["brvtvfejirl"]}[] = utf8_encode(html_entity_decode(${${"GLOBALS"}["xcqbxzdsdh"]}));
                 }
                 ${${"GLOBALS"}["edqgalfykx"]} = "INSERT INTO vtiger_wfp_connections SET " . implode(",", ${${"GLOBALS"}["oypfcifam"]});
                 $adb->pquery(${${"GLOBALS"}["bffkjor"]}, ${$qomxnvbmfl}, false);
             }
             ${${"GLOBALS"}["edqgalfykx"]} = "SELECT * FROM vtiger_wfp_objects WHERE workflow_id = " . ${${"GLOBALS"}["invpyjfekp"]} . "";
             ${${"GLOBALS"}["pibzelpsusj"]} = $adb->query(${${"GLOBALS"}["edqgalfykx"]}, false);
             while (${$vjvjzmfelj} = $adb->fetchByAssoc(${${"GLOBALS"}["afjlhexbb"]})) {
                 ${"GLOBALS"}["qhcsutvrqo"] = "sql";
                 ${"GLOBALS"}["cqvwwkuov"] = "setter";
                 ${"GLOBALS"}["roqysivc"] = "key";
                 ${"GLOBALS"}["vhgionsxivd"] = "values";
                 ${"GLOBALS"}["nzloaptnze"] = "row";
                 ${${"GLOBALS"}["cqvwwkuov"]} = array();
                 ${${"GLOBALS"}["vhgionsxivd"]} = array();
                 $dbrjffxed = "row";
                 $sxcgcx = "workflow_id";
                 ${${"GLOBALS"}["vjwrascz"]}["workflow_id"] = ${$sxcgcx};
                 $wpxdsrqvn = "sql";
                 unset(${${"GLOBALS"}["nzloaptnze"]}["id"]);
                 foreach (${$dbrjffxed} as ${${"GLOBALS"}["roqysivc"]} => ${${"GLOBALS"}["xcqbxzdsdh"]}) {
                     ${"GLOBALS"}["sqsgbujjppl"] = "setter";
                     ${"GLOBALS"}["bmbjyjwl"] = "values";
                     $wubjvehaf = "key";
                     ${${"GLOBALS"}["sqsgbujjppl"]}[] = "`" . ${$wubjvehaf} . "` = ?";
                     ${${"GLOBALS"}["bmbjyjwl"]}[] = utf8_encode(html_entity_decode(${${"GLOBALS"}["xcqbxzdsdh"]}));
                 }
                 ${$wpxdsrqvn} = "INSERT INTO vtiger_wfp_objects SET " . implode(",", ${${"GLOBALS"}["ecmvxz"]});
                 $adb->pquery(${${"GLOBALS"}["qhcsutvrqo"]}, ${${"GLOBALS"}["brvtvfejirl"]}, false);
             }
             echo "<script type='text/javascript'>window.location.href='index.php?module=Workflow2&view=Index&parent=Settings';</script>";
             exit;
             break;
         case "delete":
             ${$uypwsnpeqwg} = "DELETE FROM vtiger_wf_settings WHERE id = " . intval($_GET["workflow"]);
             $adb->query(${${"GLOBALS"}["pmbqtjd"]});
             ${$djufxynvms} = "DELETE FROM vtiger_wf_queue WHERE workflow_id = " . intval($_GET["workflow"]);
             $adb->query(${$ntqfzuj});
             ${${"GLOBALS"}["axkszdy"]} = "DELETE FROM vtiger_wf_log WHERE workflow_id = " . intval($_GET["workflow"]);
             $adb->query(${${"GLOBALS"}["bmcjqqm"]});
             ${${"GLOBALS"}["edqgalfykx"]} = "DELETE FROM vtiger_wfp_objects WHERE workflow_id = " . intval($_GET["workflow"]);
             $adb->query(${$toyuxr});
             ${${"GLOBALS"}["edqgalfykx"]} = "DELETE FROM vtiger_wfp_connections WHERE workflow_id = " . intval($_GET["workflow"]);
             $adb->query(${$yzqmqqli});
             ${${"GLOBALS"}["edqgalfykx"]} = "DELETE FROM vtiger_wfp_blocks WHERE workflow_id = " . intval($_GET["workflow"]);
             $adb->query(${${"GLOBALS"}["edqgalfykx"]});
             ${$tmvqcnr} = "DELETE FROM vtiger_wf_confirmation WHERE workflow_id = " . intval($_GET["workflow"]);
             $adb->query(${${"GLOBALS"}["edqgalfykx"]});
             break;
     }
     ${${"GLOBALS"}["ccfgwckn"]} = array();
     ${$hgjsltk} = "SELECT * FROM vtiger_wf_trigger";
     ${${"GLOBALS"}["afjlhexbb"]} = $adb->query(${${"GLOBALS"}["wyxsvveyyo"]});
     while (${${"GLOBALS"}["cyktxk"]} = $adb->fetchByAssoc(${${"GLOBALS"}["alhvvss"]})) {
         ${"GLOBALS"}["tfagjuejdsc"] = "triggerLabel";
         ${"GLOBALS"}["edcgseb"] = "row";
         ${${"GLOBALS"}["tfagjuejdsc"]}[${${"GLOBALS"}["vjwrascz"]}["key"]] = getTranslatedString(${${"GLOBALS"}["edcgseb"]}["label"], "Settings:Workflow2");
     }
     ${${"GLOBALS"}["edqgalfykx"]} = "SELECT * FROM vtiger_wf_settings WHERE module_name != '' ORDER BY module_name, active DESC, title";
     ${${"GLOBALS"}["afjlhexbb"]} = $adb->query(${${"GLOBALS"}["tgmvphjv"]});
     ${${"GLOBALS"}["vkwkldnuxx"]} = array();
     ${${"GLOBALS"}["jrykoqs"]} = "";
     ${"GLOBALS"}["zphcnjdwlb"] = "result";
     ${$ecucgikkeee} = false;
     while (${${"GLOBALS"}["vjwrascz"]} = $adb->fetch_array(${${"GLOBALS"}["zphcnjdwlb"]})) {
         $fhrzqhk = "moduleName";
         $syqvdho = "row";
         $pemejnmlth = "moduleName";
         ${"GLOBALS"}["biucup"] = "row";
         $ugentitt = "row";
         ${$pemejnmlth} = getTranslatedString(${${"GLOBALS"}["vjwrascz"]}["module_name"], ${$syqvdho}["module_name"]);
         if (vtlib_isModuleActive(${$ugentitt}["module_name"])) {
             $kolpbzuyi = "sidebarWidget";
             $klwbjbibkuk = "sql";
             ${${"GLOBALS"}["edqgalfykx"]} = "SELECT linkid FROM vtiger_links WHERE linktype = 'DETAILVIEWSIDEBARWIDGET' AND linklabel = 'Workflow Designer' AND tabid = " . Vtiger_Functions::getModuleId(${${"GLOBALS"}["vjwrascz"]}["module_name"]);
             ${$kolpbzuyi} = $adb->query(${$klwbjbibkuk});
             if ($adb->num_rows(${${"GLOBALS"}["umjjhn"]}) > 0) {
                 ${${"GLOBALS"}["efrlteqj"]} = true;
             } else {
                 ${${"GLOBALS"}["efrlteqj"]} = false;
             }
         } else {
             $wwlkbodpqwc = "activeSidebarWidget";
             ${$wwlkbodpqwc} = false;
         }
         ${${"GLOBALS"}["vjwrascz"]}["sidebar_active"] = ${${"GLOBALS"}["efrlteqj"]};
         $xyymxnicxf = "workflows";
         ${${"GLOBALS"}["vjwrascz"]}["startCondition"] = "";
         if (${${"GLOBALS"}["vjwrascz"]}["active"] == "1") {
             ${"GLOBALS"}["sxjcovjpp"] = "row";
             $fhjfgyklxht = "row";
             ${"GLOBALS"}["fldqyuvjeh"] = "triggerLabel";
             ${$fhjfgyklxht}["startCondition"] = ${${"GLOBALS"}["fldqyuvjeh"]}[${${"GLOBALS"}["sxjcovjpp"]}["trigger"]];
         }
         ${$xyymxnicxf}[${$fhrzqhk}][] = ${${"GLOBALS"}["biucup"]};
     }
     $viewer->assign("workflows", ${${"GLOBALS"}["fgbmjolpmk"]});
     ${${"GLOBALS"}["teckkxvltb"]} = array();
     ${${"GLOBALS"}["zwguosgfv"]} = \Workflow\VtUtils::getEntityModules();
     ${"GLOBALS"}["fyucnzvhtra"] = "qualifiedModuleName";
     if (!empty($_COOKIE["wf_visibility"])) {
         ${"GLOBALS"}["vvhiholwe"] = "userVisibility";
         ${${"GLOBALS"}["vvhiholwe"]} = @json_decode($_COOKIE["wf_visibility"], true);
     } else {
         $hducbauoni = "userVisibility";
         ${$hducbauoni} = false;
     }
     ${$gohobpd} = unserialize($_COOKIE["visibility"]);
     foreach (${${"GLOBALS"}["zwguosgfv"]} as ${${"GLOBALS"}["grzebuhfpa"]} => ${${"GLOBALS"}["ijswsgpsaq"]}) {
         ${"GLOBALS"}["mqwbfl"] = "userVisibility";
         $epesznuwll = "tabid";
         $sbbmqnsueshi = "userVisibility";
         $cgidubdrmxw = "visibility";
         ${$cgidubdrmxw}[${${"GLOBALS"}["ijswsgpsaq"]}[0]] = ${${"GLOBALS"}["mqwbfl"]} !== false && ${$sbbmqnsueshi}[${$epesznuwll}] ? true : false;
     }
     $viewer->assign("visibility", ${${"GLOBALS"}["petqipvorwmw"]});
     $viewer->view("Index.tpl", ${${"GLOBALS"}["fyucnzvhtra"]});
 }
コード例 #14
0
 public function process(Vtiger_Request $request)
 {
     ${"GLOBALS"}["fhroilgzonyy"] = "page";
     $mlhumypv = "adb";
     ${$mlhumypv} = PearDatabase::getInstance();
     ${${"GLOBALS"}["hqudficgecd"]} = new Vtiger_Response();
     ${${"GLOBALS"}["lolccjqn"]} = 10;
     ${${"GLOBALS"}["ebuqkxmsj"]} = $request->get("page");
     if (empty(${${"GLOBALS"}["fhroilgzonyy"]})) {
         $moizev = "page";
         ${$moizev} = 1;
     }
     try {
         ${"GLOBALS"}["hsitlbs"] = "sql2";
         $heqfgpoydpcn = "source";
         $zkntfoshn = "sourceParts";
         ${$heqfgpoydpcn} = $request->get("source");
         ${${"GLOBALS"}["xrwbikdvfh"]} = $request->get("destination");
         $cfjdvntdrre = "startDate";
         $imxrfvdjfn = "result";
         $oypicnzev = "page";
         $yadbqslg = "resultLimit";
         ${"GLOBALS"}["kckljssu"] = "sourceParts";
         ${${"GLOBALS"}["sfjciicw"]} = date("Y-m-d", strtotime($request->get("startDate")));
         ${${"GLOBALS"}["npplbckxxrk"]} = date("Y-m-d", strtotime($request->get("endDate")));
         ${${"GLOBALS"}["kcklyqteqi"]} = $request->get("module_name");
         ${${"GLOBALS"}["kixsuliubye"]} = explode("__", ${${"GLOBALS"}["rujvorudc"]});
         ${${"GLOBALS"}["zrqwcwjukd"]} = explode("__", ${${"GLOBALS"}["xrwbikdvfh"]});
         $utpusbb = "sql";
         ${"GLOBALS"}["mflbymktjc"] = "recordsPerPage";
         $xfvvvlyflsvh = "endDate";
         ${$utpusbb} = "SELECT SQL_CALC_FOUND_ROWS vtiger_crmentity.label as link_field, vtiger_wf_log.crmid, vtiger_wf_log.timestamp, vtiger_wf_log.execID\n                    FROM vtiger_wf_log\n                    LEFT JOIN vtiger_crmentity ON (vtiger_crmentity.crmid = vtiger_wf_log.crmid)\n                WHERE lastBlockId = " . ${${"GLOBALS"}["kckljssu"]}[1] . " AND lastBlockOutput = '" . ${$zkntfoshn}[2] . "' AND blockID = '" . ${${"GLOBALS"}["zrqwcwjukd"]}[1] . "' AND timestamp >= '" . ${$cfjdvntdrre} . " 00:00:00' AND timestamp <= '" . ${$xfvvvlyflsvh} . " 23:59:00' ORDER BY timestamp DESC LIMIT " . (${$oypicnzev} - 1) * ${${"GLOBALS"}["lolccjqn"]} . ", " . ${${"GLOBALS"}["lolccjqn"]};
         ${"GLOBALS"}["tcccbbpfstfn"] = "page";
         ${$imxrfvdjfn} = $adb->query(${${"GLOBALS"}["qnnyqmyvf"]}, true);
         ${${"GLOBALS"}["hsitlbs"]} = "SELECT FOUND_ROWS() as num";
         ${$yadbqslg} = $adb->query(${${"GLOBALS"}["xtupcus"]});
         ${${"GLOBALS"}["suhtsvbd"]} = $adb->query_result(${${"GLOBALS"}["rezcfzhix"]}, 0, "num");
         ${${"GLOBALS"}["lmivvvbjgld"]} = array();
         while (${${"GLOBALS"}["fnofpor"]} = $adb->fetch_array(${${"GLOBALS"}["bwxlxr"]})) {
             ${"GLOBALS"}["mvawfmjqccp"] = "row";
             $lsambsthxfgd = "row";
             $kycwglrul = "data";
             $eptvvpebu = "row";
             if (empty(${${"GLOBALS"}["mvawfmjqccp"]}["link_field"])) {
                 ${${"GLOBALS"}["fnofpor"]}["link_field"] = "no Record";
             }
             ${$kycwglrul}[] = array("title" => substr(${${"GLOBALS"}["fnofpor"]}["link_field"], 0, 25), "execID" => ${${"GLOBALS"}["fnofpor"]}["execid"], "timestamp" => \Workflow\VtUtils::formatUserDate(${$eptvvpebu}["timestamp"]), "crmid" => ${$lsambsthxfgd}["crmid"], "url" => "index.php?module=" . ${${"GLOBALS"}["kcklyqteqi"]} . "&view=Detail&record=" . ${${"GLOBALS"}["fnofpor"]}["crmid"]);
         }
         $response->setResult(array("success" => true, "data" => ${${"GLOBALS"}["lmivvvbjgld"]}, "page" => ${${"GLOBALS"}["tcccbbpfstfn"]}, "totalpages" => ceil(${${"GLOBALS"}["suhtsvbd"]} / ${${"GLOBALS"}["mflbymktjc"]})));
     } catch (Exception $exp) {
         $response->setResult(array("success" => false, "error" => $exp->getMessage()));
     }
     $response->emit();
 }
    function content_5694a3581fc1b($_smarty_tpl)
    {
        ?>
<link href='//fonts.googleapis.com/css?family=Source+Code+Pro' rel='stylesheet' type='text/css'>

<div class="TaskConfigContainer">
    <div id="pageOverlay" onclick="closePageOverlay();" style='cursor:url("modules/Workflow2/icons/cross-button.png"), auto;position:fixed;z-index:20000;top:0;left:0;display:none;height:100%;width:100%;background-image:url("modules/Workflow2/icons/modal.png");'><div id='pageOverlayContent' style='position:fixed;cursor:default;top:100px;margin:auto;left:50%;padding:10px;background-color:#ffffff;'>&nbsp;</div></div>
		<form method="POST" action="#" onsubmit="return checkForm();" id="mainTaskForm" name="mainTaskForm" accept-charset="UTF-8" enctype="multipart/form-data">
            <?php 
        echo $_smarty_tpl->tpl_vars['csrf']->value;
        ?>


			<input type="hidden" id="save_workflow_id" name="editID" value="<?php 
        echo $_smarty_tpl->tpl_vars['DATA']->value['id'];
        ?>
">

            <div id="fixedHeader">
			<table class="tableHeading" id="ConfigHeadline" width="100%" border="0" cellspacing="0" cellpadding="5">
				<tr>
					<td class="big blockHeader" nowrap="nowrap">
						<strong><?php 
        echo $_smarty_tpl->tpl_vars['MOD']->value['LBL_ZUSAMMENFASSUNG'];
        ?>
</strong>
					</td>
					<td class="small buttonbar blockHeader" align="right" style="padding:5px 5px 10px 10px;">
                        <?php 
        if ($_smarty_tpl->tpl_vars['helpUrl']->value != '') {
            ?>
                        <div class="buttonbar inline" style="margin-right:50px;">
                            <input type="button" onclick="window.open('<?php 
            echo $_smarty_tpl->tpl_vars['helpUrl']->value;
            ?>
');" name="help_page" class="btn green" value="<?php 
            echo vtranslate("LBL_DOCUMENTATION", "Settings:Workflow2");
            ?>
" id="help_page">
                        </div>
                        <?php 
        }
        ?>
                        <?php 
        if ($_smarty_tpl->tpl_vars['DATA']->value['type'] != "start") {
            ?>
                        <div class="buttonbar inline" style="margin-right:10px;">
                            <input type="button" id="edittask_duplicate_button" onclick="duplicateBlock(<?php 
            echo $_smarty_tpl->tpl_vars['block_id']->value;
            ?>
);" class="btn" value="<?php 
            echo vtranslate("LBL_DUPLICATE_BLOCK", "Settings:Workflow2");
            ?>
">
                            <input type="button" id="edittask_remove_button" onclick="removeBlock(<?php 
            echo $_smarty_tpl->tpl_vars['block_id']->value;
            ?>
);" class="btn" value="<?php 
            echo vtranslate("LBL_DELETE_BLOCK", "Settings:Workflow2");
            ?>
">
                        </div>
                        <?php 
        }
        ?>
                        <div class="buttonbar inline">
                            <input type="submit" name="save" class="btn green" value="<?php 
        echo vtranslate("LBL_SAVE", "Settings:Workflow2");
        ?>
" id="save">
                            <input type="button" onclick="window.close();" id="edittask_cancel_button" class="btn" value="<?php 
        echo vtranslate("LBL_CLOSE", "Settings:Workflow2");
        ?>
">
                        </div>
					</td>
				</tr>
			</table>
            </div>
        <?php 
        $_smarty_tpl->tpl_vars['message'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['message']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['hint']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['message']->key => $_smarty_tpl->tpl_vars['message']->value) {
            $_smarty_tpl->tpl_vars['message']->_loop = true;
            ?>
            <?php 
            if ($_smarty_tpl->tpl_vars['message']->value != '') {
                ?>
                <div style='background-color:#fed22f;padding:5px;text-align:center;'><?php 
                echo $_smarty_tpl->tpl_vars['message']->value;
                ?>
</div>
            <?php 
            }
            ?>
        <?php 
        }
        ?>
		<table border="0" cellpadding="5" cellspacing="0" width="100%" class="newTable">
            <?php 
        if ($_smarty_tpl->tpl_vars['DATA']->value['type'] != "start") {
            ?>
			<tr>
				<td class="dvtCellLabel" align=right width=15% nowrap="nowrap"><b><font color="red">*</font> <?php 
            echo vtranslate("LBL_AUFGABENBEZEICHNUNG", "Settings:Workflow2");
            ?>
</b></td>
				<td class="dvtCellInfo" align="left" ><input type="text" class="detailedViewTextBox textfield taskTitle" name="taskSettings[text]" onblur="saveTaskText(this.value);" value="<?php 
            echo htmlentities($_smarty_tpl->tpl_vars['DATA']->value['text']);
            ?>
" id="task_text">&nbsp;<img src='modules/Workflow2/icons/save-indicator.gif' style="display:none;margin-left:5px;margin-bottom:-5px;" id="text_save_indicator"></td>
			</tr>
            <?php 
        }
        ?>
			<tr>
				<td class="dvtCellLabel" align=right width=15% nowrap="nowrap"><b><?php 
        echo vtranslate("LBL_STATUS", "Settings:Workflow2");
        ?>
</b></td>
				<td class="dvtCellInfo" align="left">
					<select name="active" class="small chzn-select-nosearch" id="taskSelectActive" style="width:100px;">
						<option value="true"><?php 
        echo vtranslate("LBL_ACTIVE", "Settings:Workflow2");
        ?>
</option>
						<option value="false" <?php 
        if ($_smarty_tpl->tpl_vars['DATA']->value['active'] == "0") {
            ?>
selected='selected'<?php 
        }
        ?>
><?php 
        echo vtranslate("LBL_INACTIVE", "Settings:Workflow2");
        ?>
</option>
					</select> <?php 
        echo \Workflow\VtUtils::Smarty_HelpURL(array('url' => "workflowdesigner:tasks", 'height' => 28), $_smarty_tpl);
        ?>

				</td>
			</tr>
		</table>

	<script src="modules/Workflow2/resources/jquery.timepicker.js" type="text/javascript" charset="utf-8"></script>

	<script src="modules/Workflow2/resources/functional.js" type="text/javascript" charset="utf-8"></script>
	<script src="modules/Workflow2/resources/VTUtils.js" type="text/javascript" charset="utf-8"></script>
	<script src="modules/Workflow2/resources/json2.js" type="text/javascript" charset="utf-8"></script>
	<script src="modules/Workflow2/resources/fieldvalidator.js" type="text/javascript" charset="utf-8"></script>
	<script src="modules/Workflow2/resources/edittaskscript.js?v=<?php 
        echo @WORKFLOW2_VERSION;
        ?>
" type="text/javascript" charset="utf-8"></script>
    <script src="modules/Workflow2/resources/vtigerwebservices.js" type="text/javascript" charset="utf-8"></script>
    <script src="libraries/jquery/jquery_windowmsg.js?&v=6.0.0" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="modules/Workflow2/views/resources/js/complexecondition.js?v=<?php 
        echo $_smarty_tpl->tpl_vars['CURRENT_VERSION']->value;
        ?>
"></script>
    <script type="text/javascript" src="modules/Workflow2/views/resources/js/jquery.form.min.js?v=<?php 
        echo $_smarty_tpl->tpl_vars['CURRENT_VERSION']->value;
        ?>
"></script>
    <script type="text/javascript" src="modules/Settings/Workflow2/views/resources/ConditionPopup.js?v=<?php 
        echo $_smarty_tpl->tpl_vars['CURRENT_VERSION']->value;
        ?>
"></script>

	<script type="text/javascript" charset="utf-8">

		var returnUrl = '/index.php?module=Workflow2&action=Workflow2Ajax&file=configBlock&id=<?php 
        echo $_smarty_tpl->tpl_vars['DATA']->value['id'];
        ?>
';
		var validator;
		edittaskscript(jQuery);
        function handleError(fn){
        	return function(status, result){
        		if(status){
        			fn(result);
        		} else {
        		    // alert('Failure:'+result);
                    wsFields = {};
        		}
        	};
        }
        function initChosen() {
            jQuery(".chzn-select").chosen();
            
            jQuery(".chzn-select-nosearch").chosen({disable_search_threshold: 20});
        }

        function saveTaskText(text) {
            jQuery("#text_save_indicator").show();
            jQuery.post("index.php?module=Workflow2&parent=Settings&action=TaskSaveTitle", { ajaxaction:'setTaskText', block_id:'<?php 
        echo $_smarty_tpl->tpl_vars['block_id']->value;
        ?>
', text:text}, function() {
                jQuery("#text_save_indicator").hide();
            });
        }

        jQuery(function() {
            initChosen();


    jQuery(document).keydown(function(e) {
               if ( (e.which == '115' || e.which == '83' ) && (e.ctrlKey || e.metaKey) )
               {
                   e.preventDefault();
                   jQuery("#mainTaskForm").trigger("submit");
                   return false;
               }
               else
               {
                   return true;
               }
           });
        });

	</script>
	<script type="text/javascript">
        var moduleName = '<?php 
        echo $_smarty_tpl->tpl_vars['workflow_module_name']->value;
        ?>
';
	</script>
    <script type="text/javascript">
        var MOD = <?php 
        echo json_encode($_smarty_tpl->tpl_vars['MOD']->value);
        ?>
;
    </script>
    <script type="text/javascript">
        var oldTask = <?php 
        echo json_encode($_smarty_tpl->tpl_vars['task']->value);
        ?>
;
    </script>
    <script type="text/javascript">
        /** For various field **/
        var dateFormat = '<?php 
        echo $_smarty_tpl->tpl_vars['current_user']->value['date_format'];
        ?>
';
        var workflowID = <?php 
        echo $_smarty_tpl->tpl_vars['workflowID']->value;
        ?>
;
        var workflowModuleName = moduleName;
    </script>
    <script type="text/javascript">
        <?php 
        echo $_smarty_tpl->tpl_vars['additionalInlineJS']->value;
        ?>

    </script>
    <?php 
        if (count($_smarty_tpl->tpl_vars['envSettings']->value) > 0) {
            ?>
    <div id="contEnvironmental" style="display:none;">
        <table class="tableHeading" border="0"  width="100%" cellspacing="0" cellpadding="5">
            <tr>
                <td class="big blockHeader" nowrap="nowrap">
                    <strong><?php 
            echo vtranslate('LBL_ENVIRONMENTAL_VARS_HEAD', 'Settings:Workflow2');
            ?>
</strong>
                </td>
            </tr>
        </table>
        <p style="font-style:italic;margin: 10px;">
          <?php 
            echo $_smarty_tpl->tpl_vars['MOD']->value['LBL_ENVIRONMENTAL_DESCRIPTION'];
            ?>

        </p>
        <table border="0" cellpadding="5" cellspacing="0" width="100%" class="small newTable">
            <?php 
            $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['value']->_loop = false;
            $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['envSettings']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value) {
                $_smarty_tpl->tpl_vars['value']->_loop = true;
                $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['value']->key;
                ?>
            <tr>
                <td class='dvtCellLabel' align="right" width=15% nowrap="nowrap"><?php 
                echo $_smarty_tpl->tpl_vars['value']->value;
                ?>
</td>
                <td class='dvtCellInfo'><input type="text" name="task[env][<?php 
                echo $_smarty_tpl->tpl_vars['key']->value;
                ?>
]" value="<?php 
                echo $_smarty_tpl->tpl_vars['task']->value['env'][$_smarty_tpl->tpl_vars['key']->value];
                ?>
" class="form_input textfield" style='margin-right:10px;float:left;width: 250px;'></td>
            </tr>
            <?php 
            }
            ?>
        </table>
    </div>
    <?php 
        }
        ?>
		<table class="tableHeading" border="0"  width="100%" cellspacing="0" cellpadding="5">
			<tr>
				<td class="big blockHeader" nowrap="nowrap">
                <?php 
        if (count($_smarty_tpl->tpl_vars['envSettings']->value) > 0) {
            ?>
<a style="float:right;" href="#" onclick="jQuery('#contEnvironmental').slideToggle('fast');return false;"><?php 
            echo $_smarty_tpl->tpl_vars['MOD']->value['LBL_ENVIRONMENTAL_VARS_HEAD'];
            ?>
</a><?php 
        }
        ?>
                    <strong><?php 
        echo $_smarty_tpl->tpl_vars['MOD']->value['LBL_AUSGABENBEZEICHNUNG'];
        ?>
</strong>
				</td>
			</tr>
		</table>
			<?php 
        echo $_smarty_tpl->tpl_vars['CONTENT']->value;
        ?>

		</form>
</div><?php 
    }
コード例 #16
0
ファイル: Main.php プロジェクト: cin-system/vtigercrm-cin
 public function start()
 {
     global $adb, $current_user;
     Workflow2::log($this->_context->getWsId(), $this->_workflowID, 0, "Exec WF");
     ${"GLOBALS"}["bkqjdft"] = "sql";
     ${${"GLOBALS"}["lpkalvdeh"]} = $this->getSettings();
     if (${${"GLOBALS"}["lpkalvdeh"]}["once_per_record"] == "1" && !$this->_context->isDummy()) {
         $inxxzeyok = "dataKey";
         ${"GLOBALS"}["bivgbqxtk"] = "result";
         $qmpoys = "sql";
         ${$inxxzeyok} = "__internal_oncePerRecord_" . $this->getId();
         ${$qmpoys} = "SELECT dataid FROM vtiger_wf_entityddata WHERE crmid = ? AND `key` = ?";
         ${${"GLOBALS"}["bivgbqxtk"]} = $adb->pquery(${${"GLOBALS"}["dutcyticanf"]}, array($this->_context->getId(), ${${"GLOBALS"}["dosuzoyzgm"]}));
         if ($adb->num_rows(${${"GLOBALS"}["jegtsurybn"]}) > 0) {
             return false;
         } else {
             ${"GLOBALS"}["qlpvaphhfspn"] = "sql";
             $icdpopmw = "sql";
             ${$icdpopmw} = "INSERT INTO vtiger_wf_entityddata SET `crmid` = ?, `key` = ?, `value` = ?";
             $adb->pquery(${${"GLOBALS"}["qlpvaphhfspn"]}, array($this->_context->getId(), ${${"GLOBALS"}["dosuzoyzgm"]}, array(serialize(1))), true);
         }
     }
     ${"GLOBALS"}["wbsbbykpc"] = "current_user";
     ${${"GLOBALS"}["wbsbbykpc"]} = $this->getUser();
     $jbjrvuk = "current_user";
     VTEntity::setUser(${$jbjrvuk});
     $skdddiceo = "row";
     $sugjsbwz = "row";
     ${${"GLOBALS"}["dutcyticanf"]} = "SELECT id FROM vtiger_wfp_blocks WHERE workflow_id = " . $this->_workflowID . " AND type='start' LIMIT 1";
     ${${"GLOBALS"}["jegtsurybn"]} = \Workflow\VtUtils::query(${${"GLOBALS"}["bkqjdft"]});
     $xrzjxx = "start";
     ${$sugjsbwz} = $adb->fetch_array(${${"GLOBALS"}["jegtsurybn"]});
     $vrjfwkerv = "start";
     ${$xrzjxx} = \Workflow\Manager::getTaskHandler("start", ${$skdddiceo}["id"], $this);
     $start->setExecId($this->_execID);
     $_SERVER["runningWorkflow" . $this->_workflowID] = true;
     $this->pushExecutionStack(${$vrjfwkerv});
     $this->handleExecutionStack();
     unset($_SERVER["runningWorkflow" . $this->_workflowID]);
     Workflow2::log($this->_context->getWsId(), $this->_workflowID, 0, "Finish WF");
 }
コード例 #17
0
 public function repairEnvironment($value)
 {
     ${"GLOBALS"}["miefmvgnprc"] = "i";
     $kebzfrd = "lastPos";
     $riqfucb = "value";
     ${"GLOBALS"}["jiteqvw"] = "value";
     ${"GLOBALS"}["yeyzuzu"] = "newString";
     ${"GLOBALS"}["vfjpzckbq"] = "count";
     ${${"GLOBALS"}["qhkqnpx"]} = substr_count(${${"GLOBALS"}["jiteqvw"]}, "\$env");
     ${"GLOBALS"}["peqtxtcn"] = "newString";
     ${${"GLOBALS"}["qoppnvj"]} = 0;
     $yqotlhvwnurm = "i";
     $eaklzilccc = "value";
     ${"GLOBALS"}["gvdpeephwj"] = "i";
     ${${"GLOBALS"}["yeyzuzu"]} = "";
     if (is_array(${${"GLOBALS"}["rgkrfxq"]}) || is_object(${$eaklzilccc})) {
         $fyekhorm = "value";
         throw new \Exception("Wrong input VTTemplate::243 \$value=" . serialize(${$fyekhorm}));
     }
     for (${${"GLOBALS"}["miefmvgnprc"]} = 0; ${${"GLOBALS"}["kmptlmxqx"]} < ${${"GLOBALS"}["vfjpzckbq"]}; ${$yqotlhvwnurm}++) {
         $jqawvzi = "lastPos";
         $uomenoomce = "keys";
         $ixkyotijnzx = "pos";
         $oxknpnb = "value";
         ${"GLOBALS"}["ngymfwmmjaor"] = "newKey";
         ${"GLOBALS"}["sswidin"] = "value";
         $zuduvpsstnf = "completeString";
         $qjqnon = "lastPos";
         $gnlnhqninq = "started";
         ${"GLOBALS"}["dkuhizoa"] = "lastPos";
         ${"GLOBALS"}["qyhbpxxasioi"] = "value";
         ${${"GLOBALS"}["yuwlqycd"]} = strpos(${${"GLOBALS"}["sswidin"]}, "\$env", ${${"GLOBALS"}["qoppnvj"]});
         ${${"GLOBALS"}["kjaxluitq"]} .= substr(${${"GLOBALS"}["qyhbpxxasioi"]}, ${${"GLOBALS"}["dkuhizoa"]}, ${${"GLOBALS"}["yuwlqycd"]} - ${$jqawvzi});
         ${$zuduvpsstnf} = "\$env";
         $wmjukhn = "j";
         ${${"GLOBALS"}["ngymfwmmjaor"]} = false;
         ${$uomenoomce} = array();
         ${${"GLOBALS"}["qkjdresuzj"]} = false;
         for (${${"GLOBALS"}["mnckunqlbnjk"]} = ${$ixkyotijnzx} + 4; ${${"GLOBALS"}["mnckunqlbnjk"]} < strlen(${$oxknpnb}); ${${"GLOBALS"}["mnckunqlbnjk"]}++) {
             $xxvphjkt = "value";
             ${${"GLOBALS"}["wcdxefjfx"]} = ${$xxvphjkt}[${${"GLOBALS"}["mnckunqlbnjk"]}];
             $bzvenpc = "newKey";
             ${"GLOBALS"}["rcgyqxjcytf"] = "char";
             if (${${"GLOBALS"}["rcgyqxjcytf"]} == "[") {
                 $fhsirsxrz = "newKey";
                 $rfofcccxylf = "completeString";
                 ${$fhsirsxrz} = "";
                 ${$rfofcccxylf} .= ${${"GLOBALS"}["wcdxefjfx"]};
                 ${${"GLOBALS"}["qkjdresuzj"]} = true;
             } elseif (${${"GLOBALS"}["wcdxefjfx"]} == "]") {
                 ${"GLOBALS"}["xygxkqcevt"] = "completeString";
                 $bynbldwbrz = "newKey";
                 ${"GLOBALS"}["blwuqropto"] = "newKey";
                 ${"GLOBALS"}["srinumexbjd"] = "keys";
                 ${${"GLOBALS"}["srinumexbjd"]}[] = trim(${$bynbldwbrz}, "\"'");
                 ${${"GLOBALS"}["blwuqropto"]} = false;
                 ${${"GLOBALS"}["xygxkqcevt"]} .= ${${"GLOBALS"}["wcdxefjfx"]};
                 ${${"GLOBALS"}["qkjdresuzj"]} = true;
             } elseif (${$bzvenpc} === false) {
                 ${"GLOBALS"}["cjizlgt"] = "started";
                 ${"GLOBALS"}["imkhqyqushp"] = "newString";
                 ${"GLOBALS"}["lvisgumynuy"] = "value";
                 if (${${"GLOBALS"}["cjizlgt"]} === false) {
                     break;
                 }
                 $dgufvrvgq = "completeString";
                 ${"GLOBALS"}["dsgkivb"] = "completeString";
                 ${${"GLOBALS"}["imkhqyqushp"]} .= "\${ return " . ${${"GLOBALS"}["jpjvutghmnk"]} . "; }}>";
                 ${${"GLOBALS"}["lvisgumynuy"]} = \Workflow\VtUtils::str_replace_first(${${"GLOBALS"}["dsgkivb"]}, str_repeat("#", strlen(${$dgufvrvgq})), ${${"GLOBALS"}["rgkrfxq"]});
                 ${${"GLOBALS"}["qkjdresuzj"]} = false;
                 break;
             } else {
                 $eqwdmkpuahbv = "newKey";
                 ${$eqwdmkpuahbv} .= ${${"GLOBALS"}["wcdxefjfx"]};
                 ${${"GLOBALS"}["jpjvutghmnk"]} .= ${${"GLOBALS"}["wcdxefjfx"]};
             }
         }
         ${$qjqnon} = ${$wmjukhn};
         if (${$gnlnhqninq} !== false) {
             ${"GLOBALS"}["xxauqkurc"] = "newString";
             $killmyj = "completeString";
             $vgehcvocmqj = "completeString";
             ${"GLOBALS"}["lhiwkm"] = "value";
             ${${"GLOBALS"}["xxauqkurc"]} .= "\${ return " . ${$vgehcvocmqj} . "; }}>";
             $wrjvcs = "value";
             ${$wrjvcs} = \Workflow\VtUtils::str_replace_first(${$killmyj}, str_repeat("#", strlen(${${"GLOBALS"}["jpjvutghmnk"]})), ${${"GLOBALS"}["lhiwkm"]});
         }
     }
     ${${"GLOBALS"}["kjaxluitq"]} .= substr(${${"GLOBALS"}["rgkrfxq"]}, ${$kebzfrd}, strlen(${$riqfucb}) - ${${"GLOBALS"}["gvdpeephwj"]} - 1);
     return ${${"GLOBALS"}["peqtxtcn"]};
 }
コード例 #18
0
ファイル: Condition.php プロジェクト: cin-system/cinrepo
 public function beforeGetTaskform($transferData)
 {
     $futzgaa = "data";
     $ogwqikpcgwb = "toModule";
     $oxzkuqayf = "availCurrency";
     $hvhxen = "field";
     ${"GLOBALS"}["mfdishkhmbh"] = "moduleModel";
     ${"GLOBALS"}["fczcubm"] = "moduleFields";
     ${"GLOBALS"}["ihrryyzseju"] = "sql";
     list(${$futzgaa}, ${${"GLOBALS"}["nisdgrmszn"]}) = ${${"GLOBALS"}["tjhhnvym"]};
     ${$hvhxen} = $this->field;
     ${${"GLOBALS"}["mfdishkhmbh"]} = \Vtiger_Module_Model::getInstance("Workflow2");
     ${"GLOBALS"}["buxnwpglobps"] = "sql";
     if (isset($this->parameter["enableHasChanged"])) {
         ${"GLOBALS"}["tttxhjyleji"] = "enableHasChanged";
         ${${"GLOBALS"}["tttxhjyleji"]} = !empty($this->parameter["enableHasChanged"]);
     } else {
         ${${"GLOBALS"}["iiudodshy"]} = true;
     }
     ${"GLOBALS"}["tjbdgtpqmhj"] = "script";
     $johcdmhjaxfw = "wsTabId";
     $dnedugi = "group";
     if (isset($this->parameter["fromModule"])) {
         ${${"GLOBALS"}["ketqimlw"]} = $this->parameter["fromModule"];
     } else {
         ${${"GLOBALS"}["eehnle"]} = $this->workflow->getSettings();
         ${"GLOBALS"}["xpvvphgyhoot"] = "workflowSettings";
         $gkxoxqnqgh = "fromModule";
         ${$gkxoxqnqgh} = ${${"GLOBALS"}["xpvvphgyhoot"]}["module_name"];
     }
     ${"GLOBALS"}["vincrcg"] = "field";
     if (isset($this->parameter["toModule"])) {
         $jhftvtk = "toModule";
         ${$jhftvtk} = $this->parameter["toModule"];
     } else {
         $ewcqikint = "toModule";
         ${$ewcqikint} = ${${"GLOBALS"}["ketqimlw"]};
     }
     ${$oxzkuqayf} = getAllCurrencies();
     ${${"GLOBALS"}["tzpkjjhxtd"]} = array("user" => array(), "group" => array());
     ${${"GLOBALS"}["glqlydonrpn"]} = \PearDatabase::getInstance();
     ${"GLOBALS"}["fttyubs"] = "result";
     $qmeejpvhzth = "conditionals";
     $mzyjynil = "containerName";
     ${"GLOBALS"}["suvgdn"] = "conditionals";
     $cocmzfwvcpc = "sql";
     ${${"GLOBALS"}["ltbisovwtf"]} = "SELECT id FROM vtiger_ws_entity WHERE name = 'Users'";
     ${${"GLOBALS"}["qvhuiqaclp"]} = $adb->query(${$cocmzfwvcpc});
     ${${"GLOBALS"}["dijcomvrqk"]} = $adb->query_result(${${"GLOBALS"}["qvhuiqaclp"]}, 0, "id");
     $fpftlvbdhjlb = "user";
     $hiblckeor = "result";
     ${${"GLOBALS"}["buxnwpglobps"]} = "SELECT id,user_name,first_name,last_name FROM vtiger_users WHERE status = 'Active'";
     ${${"GLOBALS"}["qvhuiqaclp"]} = $adb->query(${${"GLOBALS"}["ltbisovwtf"]});
     while (${$fpftlvbdhjlb} = $adb->fetchByAssoc(${${"GLOBALS"}["qvhuiqaclp"]})) {
         $imgpfplskq = "user";
         $ddymunniulzr = "user";
         ${${"GLOBALS"}["ylyjfunyve"]}["id"] = ${${"GLOBALS"}["ylyjfunyve"]}["id"];
         ${${"GLOBALS"}["tzpkjjhxtd"]}["user"][${$imgpfplskq}["id"]] = ${$ddymunniulzr}["user_name"] . " (" . ${${"GLOBALS"}["ylyjfunyve"]}["last_name"] . ", " . ${${"GLOBALS"}["ylyjfunyve"]}["first_name"] . ")";
     }
     $pblpwpbisgp = "fromModule";
     $tmukhkhac = "moduleFields";
     ${"GLOBALS"}["yjmrbok"] = "availCurrency";
     ${${"GLOBALS"}["ltbisovwtf"]} = "SELECT id FROM vtiger_ws_entity WHERE name = 'Groups'";
     ${${"GLOBALS"}["fttyubs"]} = $adb->query(${${"GLOBALS"}["ihrryyzseju"]});
     ${$johcdmhjaxfw} = $adb->query_result(${${"GLOBALS"}["qvhuiqaclp"]}, 0, "id");
     ${${"GLOBALS"}["ltbisovwtf"]} = "SELECT * FROM vtiger_groups ORDER BY groupname";
     ${$hiblckeor} = $adb->query(${${"GLOBALS"}["ltbisovwtf"]});
     while (${$dnedugi} = $adb->fetchByAssoc(${${"GLOBALS"}["qvhuiqaclp"]})) {
         ${"GLOBALS"}["tckqkgybrvdq"] = "group";
         ${${"GLOBALS"}["nyybekfeupw"]}["groupid"] = ${${"GLOBALS"}["tckqkgybrvdq"]}["groupid"];
         $mmnlotc = "group";
         ${"GLOBALS"}["yjskbdzrv"] = "group";
         ${${"GLOBALS"}["tzpkjjhxtd"]}["group"][${$mmnlotc}["groupid"]] = ${${"GLOBALS"}["yjskbdzrv"]}["groupname"];
     }
     ${${"GLOBALS"}["fbpqshu"]} = "conditional_container";
     if (!empty($this->parameter["container"])) {
         $vxgckojuxo = "containerName";
         ${$vxgckojuxo} = $this->parameter["container"];
     }
     ${${"GLOBALS"}["suvgdn"]} = ${${"GLOBALS"}["duxlgzdhkg"]}[${${"GLOBALS"}["vincrcg"]}];
     $vrjtcdhjz = "script";
     ${${"GLOBALS"}["fczcubm"]} = VtUtils::getFieldsWithBlocksForModule(${${"GLOBALS"}["hawytcifomf"]}, true);
     $viewer->assign("conditionalContent", "<div id=\"" . ${$mzyjynil} . "\"><div style=\"margin:50px auto;text-align:center;font-weight:bold;color:#aaa;font-size:18px;\">" . getTranslatedString("LOADING_INDICATOR", "Workflow2") . "<br><br><img src=\"modules/Workflow2/loader.gif\" alt=\"Loading ...\"></div></div>");
     ${${"GLOBALS"}["hsdbnpvhdl"]} = "var condition_module = \"" . ${$ogwqikpcgwb} . "\";";
     ${${"GLOBALS"}["tjbdgtpqmhj"]} .= "var condition_fromModule = \"" . ${$pblpwpbisgp} . "\";";
     ${${"GLOBALS"}["hsdbnpvhdl"]} .= "var enableIsChanged = true;\n\n            jQuery(function() {\n                jQuery.loadScript(\"modules/Workflow2/views/resources/js/complexecondition.js?v=" . $moduleModel->version . "}\", function() {\n\n                    WFCondition.setModuleFields(" . json_encode(${$tmukhkhac}) . ");\n                    WFCondition.importCurrency(" . json_encode(${${"GLOBALS"}["yjmrbok"]}) . ");\n                    WFCondition.importUser(" . json_encode(${${"GLOBALS"}["tzpkjjhxtd"]}) . ");\n\n                    WFCondition.import(" . json_encode(empty(${${"GLOBALS"}["qfarxgfuowq"]}) || ${$qmeejpvhzth} == -1 ? array() : ${${"GLOBALS"}["qfarxgfuowq"]}) . ");\n\n                    WFCondition.enableHasChanged(" . (${${"GLOBALS"}["iiudodshy"]} ? "true" : "false") . ");\n\n                    WFCondition.init(\"" . ${${"GLOBALS"}["fbpqshu"]} . "\");\n                });\n            }, true);\n        ";
     $this->addInlineJS(${$vrjtcdhjz});
     return ${${"GLOBALS"}["tjhhnvym"]};
 }
コード例 #19
0
ファイル: Queue.php プロジェクト: cin-system/vtigercrm-cin
 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());
 }
コード例 #20
0
ファイル: WfTaskDelay.php プロジェクト: cin-system/cinrepo
 public function beforeGetTaskform($viewer)
 {
     $weekDays = $this->weekDays;
     foreach ($weekDays as $key => $value) {
         $weekDays[$key] = getTranslatedString($value, "Workflow2");
     }
     $viewer->assign("weekdays", $weekDays);
     $hours = range(1, 24);
     $viewer->assign("hours", $hours);
     $viewer->assign("minutes", range(0, 59));
     $datefields = \Workflow\VtUtils::getFieldsForModule($this->getModuleName(), array(5, 6, 23));
     $viewer->assign("datefields", $datefields);
 }
コード例 #21
0
 /**
  * @param $context \Workflow\VTEntity
  */
 public function handleTask(&$context)
 {
     $setterMap = $this->get("setter");
     $newModule = $this->get("new_module");
     if (empty($newModule)) {
         $this->addStat("NO Configuration set");
         return "yes";
     }
     $uniqueCheck = $this->get('uniquecheck');
     $createNew = true;
     if ($uniqueCheck !== -1 && is_array($uniqueCheck) && !empty($uniqueCheck)) {
         $setterMap = $this->get('setter');
         $fieldValue = $this->fieldSetter->getFieldValueArray($context, $setterMap);
         $condition = array();
         foreach ($uniqueCheck as $checkField) {
             $condition[$checkField] = $fieldValue[$checkField];
         }
         $records = \Workflow\VtUtils::findRecordIDs($newModule, $condition);
         if (count($records) > 0) {
             // duplicate records found
             $this->addStat('duplicate Record found [' . implode(',', $records) . '] -> do not create new');
             $updateexisting = $this->get('updateexisting');
             if ($updateexisting !== -1 && is_array($updateexisting) && !empty($updateexisting)) {
                 foreach ($records as $crmid) {
                     $entity = \Workflow\VTEntity::getForId($crmid);
                     foreach ($updateexisting as $field) {
                         $entity->set($field, $fieldValue[$field]);
                     }
                     $entity->save();
                     break;
                 }
             }
             $context->setEnvironment("new_record_id", $records[0], $this);
             $context->setEnvironment("was_created_new", 'false', $this);
             $createNew = false;
             $newObj = \Workflow\VTEntity::getForId($records[0]);
         }
     }
     if ($createNew === true) {
         $newObj = VTEntity::create($newModule);
         $this->fieldSetter->apply($newObj, $setterMap, $context, $this);
         try {
             $newObj->save();
         } catch (WebServiceException $exp) {
             // Somethink is wrong with the values. missing mandatory fields?
         }
         $context->setEnvironment("new_record_id", $newObj->getId(), $this);
         $context->setEnvironment("was_created_new", 'true', $this);
     }
     if ($context->getModuleName() == "Assets" && $newModule == "HelpDesk") {
         global $adb;
         $sql = "INSERT INTO vtiger_crmentityrel SET crmid = ?, module = ?, relcrmid = ?, relmodule = ?";
         $adb->pquery($sql, array($context->getId(), $context->getModuleName(), $newObj->getId(), $newObj->getModuleName()));
     }
     if ($this->get("redirectAfter") == "1") {
         $this->getWorkflow()->setSuccessRedirection("index.php?module=" . $newModule . "&view=Detail&record=" . $newObj->getId());
     }
     if ($this->get("exec_workflow") !== "" && $this->get("exec_workflow") != -1) {
         $newContext = VTEntity::getForId($newObj->getId(), $newObj->getModuleName());
         $newContext->loadEnvironment($context->getEnvironment());
         $objWorkflow = new \Workflow\Main($this->get("exec_workflow"), false, $context->getUser());
         $objWorkflow->isSubWorkflow(true);
         $objWorkflow->setContext($newContext);
         $objWorkflow->start();
     }
     Workflow2::$enableError = true;
     return "yes";
 }
コード例 #22
0
ファイル: ExecuteNew.php プロジェクト: cin-system/cinrepo
 public function process(Vtiger_Request $request)
 {
     $xhqrbyal = "cu_model";
     $awzoousbijac = "result";
     Workflow2::${${"GLOBALS"}["fiflovy"]} = true;
     if (!empty($_SERVER["HTTP_X_REQUESTED_WITH"]) && strtolower($_SERVER["HTTP_X_REQUESTED_WITH"]) == "xmlhttprequest") {
         Workflow2::${${"GLOBALS"}["sxluqscobil"]} = true;
     }
     $aldkggvnocb = "params";
     ${"GLOBALS"}["qiswqpb"] = "continueExecId";
     ${${"GLOBALS"}["mlokrunke"]} = PearDatabase::getInstance();
     ${"GLOBALS"}["batkhioplbv"] = "allow_parallel";
     $dduumoti = "result";
     ${"GLOBALS"}["aughjdxffu"] = "continueExecId";
     ${$aldkggvnocb} = $request->getAll();
     ${${"GLOBALS"}["fyvmsq"]} = ${$xhqrbyal} = Users_Record_Model::getCurrentUserModel();
     ${"GLOBALS"}["vsxpiyis"] = "requestValues";
     ${${"GLOBALS"}["batkhioplbv"]} = $request->get("allowParallel", "false") === "1";
     ${${"GLOBALS"}["eeennsbvlt"]} = (int) $request->get("workflowID");
     ${${"GLOBALS"}["vsxpiyis"]} = $request->get("requestValues");
     ${${"GLOBALS"}["nztqmvnrgzi"]} = $request->get("requestValuesKey");
     ${${"GLOBALS"}["pajxdehcky"]} = $request->get("continueExecId");
     $hfvpdtq = "sql";
     ${${"GLOBALS"}["qwgmpolil"]} = $request->get("continueBlockId");
     if (strpos(${${"GLOBALS"}["aughjdxffu"]}, "##") !== false) {
         ${"GLOBALS"}["mkuklgbjodtb"] = "continueExecId";
         ${"GLOBALS"}["vpmdfnx"] = "parts";
         $cnibibbpik = "continueExecId";
         ${${"GLOBALS"}["ukdeacyi"]} = explode("##", ${${"GLOBALS"}["mkuklgbjodtb"]});
         ${$cnibibbpik} = ${${"GLOBALS"}["vpmdfnx"]}[0];
         ${${"GLOBALS"}["qwgmpolil"]} = ${${"GLOBALS"}["ukdeacyi"]}[1];
     }
     if (!empty(${${"GLOBALS"}["qiswqpb"]})) {
         $ohjszugmnxs = "requestValuesKey";
         if (${$ohjszugmnxs} == "authPermission") {
             ${"GLOBALS"}["ycnxjrdysji"] = "requestValues";
             ${"GLOBALS"}["zwrvvswpwb"] = "continueExecId";
             $pujwrhxk = "requestValues";
             ${${"GLOBALS"}["qerhyklwh"]} = $this->handleSetPermissions(${${"GLOBALS"}["zwrvvswpwb"]}, ${${"GLOBALS"}["qwgmpolil"]}, ${${"GLOBALS"}["ycnxjrdysji"]});
             if (${${"GLOBALS"}["qerhyklwh"]} === false) {
                 $this->handleReturn();
             }
             ${${"GLOBALS"}["nztqmvnrgzi"]} = "";
             ${$pujwrhxk} = "";
         }
         ${${"GLOBALS"}["sszaqio"]} = \Workflow\Queue::getQueueEntryByExecId(${${"GLOBALS"}["pajxdehcky"]}, ${${"GLOBALS"}["qwgmpolil"]});
         if (${${"GLOBALS"}["sszaqio"]} !== false) {
             $sdfjrtmbv = "workflow";
             \Workflow\Queue::stopEntry(${$sdfjrtmbv});
             ${"GLOBALS"}["vwpxff"] = "requestValuesKey";
             $this->_objWorkflow = ${${"GLOBALS"}["sszaqio"]}["task"]->getWorkflow();
             if (!empty(${${"GLOBALS"}["vwpxff"]})) {
                 $cmiqvsy = "env";
                 ${"GLOBALS"}["qoskdafhutd"] = "workflow";
                 ${"GLOBALS"}["dqxzmxov"] = "env";
                 ${"GLOBALS"}["yfgrwwgyxjh"] = "env";
                 ${${"GLOBALS"}["dqxzmxov"]} = ${${"GLOBALS"}["sszaqio"]}["context"]->getEnvironment("_reqValues");
                 ${"GLOBALS"}["entqbm"] = "requestValues";
                 $cdrbilhs = "workflow";
                 ${$cmiqvsy}[${${"GLOBALS"}["nztqmvnrgzi"]}] = true;
                 ${$cdrbilhs}["context"]->setEnvironment("_reqValues", ${${"GLOBALS"}["rwsybopbofy"]});
                 ${"GLOBALS"}["humlvehh"] = "requestValues";
                 ${${"GLOBALS"}["yfgrwwgyxjh"]} = ${${"GLOBALS"}["sszaqio"]}["context"]->getEnvironment("value");
                 if (!is_array(${${"GLOBALS"}["rwsybopbofy"]})) {
                     ${"GLOBALS"}["kkxlfvg"] = "env";
                     ${${"GLOBALS"}["kkxlfvg"]} = array();
                 }
                 $kvkqyovgu = "env";
                 ${${"GLOBALS"}["wdevzzyv"]} = ${${"GLOBALS"}["ksqrqhcnhk"]}["_fieldtype"];
                 ${"GLOBALS"}["dyfarxu"] = "requestValues";
                 unset(${${"GLOBALS"}["humlvehh"]}["_fieldtype"]);
                 foreach (${${"GLOBALS"}["entqbm"]} as ${${"GLOBALS"}["fxeookd"]} => ${${"GLOBALS"}["bjudgmb"]}) {
                     ${"GLOBALS"}["cwdeawsawnz"] = "fieldTypes";
                     ${"GLOBALS"}["bnsjdgky"] = "requestValues";
                     $kkuxpn = "index";
                     if (!empty(${${"GLOBALS"}["cwdeawsawnz"]}[${${"GLOBALS"}["fxeookd"]}])) {
                         $ulquytqvf = "type";
                         ${"GLOBALS"}["pjngmgj"] = "fieldTypes";
                         $iwcpla = "index";
                         ${"GLOBALS"}["tnxyhf"] = "workflow";
                         ${$ulquytqvf} = \Workflow\Fieldtype::getType(${${"GLOBALS"}["wdevzzyv"]}[${$iwcpla}]);
                         $bygtvss = "index";
                         ${${"GLOBALS"}["bjudgmb"]} = $type->getValue(trim(${${"GLOBALS"}["bjudgmb"]}), ${$bygtvss}, ${${"GLOBALS"}["pjngmgj"]}[${${"GLOBALS"}["fxeookd"]}], ${${"GLOBALS"}["tnxyhf"]}["context"]);
                     }
                     ${${"GLOBALS"}["bnsjdgky"]}[${$kkuxpn}] = trim(${${"GLOBALS"}["bjudgmb"]});
                 }
                 ${$kvkqyovgu} = array_merge(${${"GLOBALS"}["rwsybopbofy"]}, ${${"GLOBALS"}["dyfarxu"]});
                 ${${"GLOBALS"}["qoskdafhutd"]}["context"]->setEnvironment("value", ${${"GLOBALS"}["rwsybopbofy"]});
             }
             try {
                 $fpunbpanmn = "workflow";
                 \Workflow\Queue::runEntry(${$fpunbpanmn});
             } catch (\Exception $exp) {
                 $pqrukkuo = "exp";
                 $this->handleReturn(${$pqrukkuo});
             }
             $this->handleReturn();
             exit;
         }
     }
     ${${"GLOBALS"}["jdijirbbp"]} = "SELECT * FROM vtiger_wf_settings WHERE id = ? AND active = 1";
     ${$dduumoti} = \Workflow\VtUtils::pquery(${$hfvpdtq}, array(${${"GLOBALS"}["eeennsbvlt"]}));
     while (${${"GLOBALS"}["rmniutpwd"]} = $adb->fetch_array(${$awzoousbijac})) {
         ${"GLOBALS"}["ifzwgcvh"] = "user";
         $exbcmtusi = "user";
         if (${${"GLOBALS"}["rmniutpwd"]}["execution_user"] == "0") {
             ${${"GLOBALS"}["rmniutpwd"]}["execution_user"] = $current_user->id;
         }
         ${${"GLOBALS"}["dmcfeolmh"]} = new Users();
         ${"GLOBALS"}["brdhenkjcoeb"] = "context";
         $user->retrieveCurrentUserInfoFromFile(${${"GLOBALS"}["rmniutpwd"]}["execution_user"]);
         ${"GLOBALS"}["eisghylycg"] = "context";
         VTEntity::setUser(${${"GLOBALS"}["ifzwgcvh"]});
         $this->_objWorkflow = new \Workflow\Main(${${"GLOBALS"}["rmniutpwd"]}["id"], false, ${$exbcmtusi});
         $this->_objWorkflow->setExecutionTrigger("WF2_MANUELL");
         if (${${"GLOBALS"}["frhjlwprw"]} == false && $this->_objWorkflow->isRunning($_POST["crmid"])) {
             continue;
         }
         ${${"GLOBALS"}["brdhenkjcoeb"]} = VTEntity::getForId(intval($_POST["crmid"]));
         $this->_objWorkflow->setContext(${${"GLOBALS"}["eisghylycg"]});
         try {
             $this->_objWorkflow->start();
         } catch (\Exception $exp) {
             ${"GLOBALS"}["gikexcyv"] = "exp";
             $this->handleReturn(${${"GLOBALS"}["gikexcyv"]});
         }
         $context->save();
     }
     $this->handleReturn();
 }
コード例 #23
0
ファイル: Config.php プロジェクト: cin-system/cinrepo
 public function preProcess($request)
 {
     ${"GLOBALS"}["rkgmoxvznlb"] = "request";
     ${${"GLOBALS"}["socqiptt"]} = $request->get("workflow");
     if (!empty(${${"GLOBALS"}["socqiptt"]})) {
         ${"GLOBALS"}["yreglrnv"] = "values";
         ${"GLOBALS"}["zvauiryc"] = "adb";
         ${${"GLOBALS"}["zvauiryc"]} = PearDatabase::getInstance();
         ${${"GLOBALS"}["yreglrnv"]} = array();
         if (isset(${${"GLOBALS"}["socqiptt"]}["mainmodule"])) {
             ${"GLOBALS"}["cocdvbaiflk"] = "workflow";
             ${${"GLOBALS"}["wounomveyrd"]} = $request->get("workflow");
             ${${"GLOBALS"}["rmbbwt"]}[] = VtUtils::getModuleName(${${"GLOBALS"}["cocdvbaiflk"]}["mainmodule"]);
             ${${"GLOBALS"}["fwjxwcmhme"]}[] = "`module_name` = ?";
         }
         if (count(${${"GLOBALS"}["fwjxwcmhme"]}) > 0) {
             ${"GLOBALS"}["bejhrqdh"] = "sql";
             ${${"GLOBALS"}["wounomveyrd"]} = $request->get("workflow");
             ${${"GLOBALS"}["bejhrqdh"]} = "UPDATE vtiger_wf_settings SET " . implode(",", ${${"GLOBALS"}["fwjxwcmhme"]}) . " WHERE id = " . intval(${${"GLOBALS"}["wounomveyrd"]}["id"]);
             $adb->pquery(${${"GLOBALS"}["npnwejaci"]}, array(${${"GLOBALS"}["rmbbwt"]}));
         }
     }
     parent::preProcess(${${"GLOBALS"}["rkgmoxvznlb"]});
 }
コード例 #24
0
ファイル: Task.php プロジェクト: cin-system/cinrepo
 public function beforeGetTaskform($viewer)
 {
     ${"GLOBALS"}["fceqgls"] = "data";
     global $adb;
     ${${"GLOBALS"}["lbujtjnghu"]} = \Workflow\VtUtils::query("SELECT file, module, handlerClass, helpUrl FROM vtiger_wf_types WHERE type = '" . $this->_data["type"] . "'");
     ${${"GLOBALS"}["fceqgls"]} = $adb->fetch_array(${${"GLOBALS"}["lbujtjnghu"]});
     if ($this->_internalConfiguration == true && is_array($this->_configFields)) {
         ${"GLOBALS"}["pdkxqwi"] = "value";
         ${${"GLOBALS"}["npgeqww"]} = array();
         foreach ($this->_configFields as ${${"GLOBALS"}["ugekeupolkiq"]} => ${${"GLOBALS"}["pdkxqwi"]}) {
             $jxydnk = "fields";
             $xnmqjcuqhg = "index";
             ${"GLOBALS"}["xnpbkzjhl"] = "data";
             $ekeaslrj = "index";
             ${"GLOBALS"}["okfdfmrvgj"] = "index";
             ${"GLOBALS"}["tgowlekrr"] = "value";
             ${$ekeaslrj} = getTranslatedString(${$xnmqjcuqhg}, ${${"GLOBALS"}["xnpbkzjhl"]}["module"]);
             foreach (${${"GLOBALS"}["cqtreswpfgh"]} as ${${"GLOBALS"}["hvydudmd"]} => ${${"GLOBALS"}["docyqevipjfu"]}) {
                 $jsbsdlukbixe = "data";
                 ${"GLOBALS"}["tgjzhzjgqm"] = "field";
                 ${${"GLOBALS"}["docyqevipjfu"]}["label"] = getTranslatedString(${${"GLOBALS"}["docyqevipjfu"]}["label"], "Settings:" . ${$jsbsdlukbixe}["module"]);
                 ${${"GLOBALS"}["cqtreswpfgh"]}[${${"GLOBALS"}["hvydudmd"]}] = ${${"GLOBALS"}["tgjzhzjgqm"]};
             }
             ${$jxydnk}[${${"GLOBALS"}["okfdfmrvgj"]}] = ${${"GLOBALS"}["tgowlekrr"]};
         }
         $viewer->assign("CONFIG_FIELDS", ${${"GLOBALS"}["npgeqww"]});
     }
 }
コード例 #25
0
ファイル: VTEntity.php プロジェクト: cin-system/cinrepo
 public function getCrmId($idString, $fieldInstance = null)
 {
     ${"GLOBALS"}["iclxxkvi"] = "idString";
     ${"GLOBALS"}["elwxxhb"] = "idString";
     ${"GLOBALS"}["flcpttn"] = "fieldInstance";
     $bcwmvce = "idString";
     if (strpos(${${"GLOBALS"}["iclxxkvi"]}, "x") !== false) {
         ${"GLOBALS"}["pvhcesfd"] = "idString";
         ${${"GLOBALS"}["fvqttrwn"]} = explode("x", ${${"GLOBALS"}["pvhcesfd"]});
         $ywoinxvis = "idParts";
         return ${$ywoinxvis}[1];
     }
     if (strpos(${$bcwmvce}, "@") !== false) {
         ${"GLOBALS"}["xxrpwv"] = "id";
         $whtnmlla = "id";
         ${${"GLOBALS"}["xxrpwv"]} = explode("@", ${${"GLOBALS"}["lwtxyxejo"]});
         return ${$whtnmlla}[0];
     }
     if (is_numeric(${${"GLOBALS"}["lwtxyxejo"]})) {
         return ${${"GLOBALS"}["lwtxyxejo"]};
     }
     if (${${"GLOBALS"}["flcpttn"]} !== null && !empty(${${"GLOBALS"}["elwxxhb"]})) {
         ${"GLOBALS"}["jldxotsaj"] = "sql";
         $cvyqpfjbxe = "idString";
         global $adb;
         $vwhjwakpqy = "result";
         ${"GLOBALS"}["xcpfhjni"] = "modules";
         ${${"GLOBALS"}["mdffogqqo"]} = \VtUtils::getModuleForReference($fieldInstance->getTabId(), $fieldInstance->getFieldName(), $fieldInstance->getUIType());
         ${${"GLOBALS"}["jldxotsaj"]} = "SELECT * FROM vtiger_crmentity WHERE setype IN (\"" . implode("\",\"", ${${"GLOBALS"}["xcpfhjni"]}) . "\") AND label = ?";
         ${${"GLOBALS"}["orgnykvnkpk"]} = $adb->pquery(${${"GLOBALS"}["clnussj"]}, array(${$cvyqpfjbxe}));
         if ($adb->num_rows(${$vwhjwakpqy}) > 0) {
             return $adb->query_result(${${"GLOBALS"}["orgnykvnkpk"]}, 0, "crmid");
         }
     }
     return false;
 }
コード例 #26
0
ファイル: FieldSetter.php プロジェクト: cin-system/cinrepo
 public function beforeGetTaskform($data)
 {
     $wcecbkmkmsx = "data";
     ${"GLOBALS"}["eqfxppvrlcg"] = "sql";
     ${"GLOBALS"}["sxuujyumdvv"] = "script";
     $rvezxijr = "adb";
     $uwoefflj = "result";
     global $current_user;
     $lnxjswg = "sql";
     $rakhgqmsey = "result";
     ${"GLOBALS"}["dhrsrgll"] = "data";
     ${$rvezxijr} = \PearDatabase::getInstance();
     list(${$wcecbkmkmsx}, ${${"GLOBALS"}["gxggivfo"]}) = ${${"GLOBALS"}["dhrsrgll"]};
     ${${"GLOBALS"}["hvlighrh"]} = $this->parameter["fromModule"];
     $sbxdhyqvqj = "script";
     $qybdsfhc = "sql";
     ${${"GLOBALS"}["hpoksfzufvi"]} = $this->parameter["toModule"];
     ${${"GLOBALS"}["oyjhbrdojleb"]} = $this->parameter["additionalToFields"];
     ${${"GLOBALS"}["ohrkdvokqlbt"]} = !empty($this->parameter["refFields"]) ? true : false;
     if (${${"GLOBALS"}["hvlighrh"]} === false) {
         ${${"GLOBALS"}["hvlighrh"]} = ${${"GLOBALS"}["hpoksfzufvi"]};
     }
     ${${"GLOBALS"}["eqfxppvrlcg"]} = "SELECT id FROM vtiger_ws_entity WHERE name = 'Users'";
     ${"GLOBALS"}["yefvtwdbtg"] = "fields";
     ${"GLOBALS"}["roaznbo"] = "result";
     ${"GLOBALS"}["hncdfohpf"] = "sql";
     $yzltgwdg = "script";
     $xobfnidjmu = "result";
     ${${"GLOBALS"}["gcfgsatc"]} = $adb->query(${${"GLOBALS"}["txneufzr"]});
     ${${"GLOBALS"}["zypsnrvnkiti"]} = $adb->query_result(${${"GLOBALS"}["roaznbo"]}, 0, "id");
     ${"GLOBALS"}["gtxvsrw"] = "wsTabId";
     ${${"GLOBALS"}["txneufzr"]} = "SELECT id,user_name,first_name,last_name FROM vtiger_users WHERE status = 'Active'";
     ${"GLOBALS"}["fsmvqyhawbr"] = "index1";
     $xngmezo = "fields";
     ${"GLOBALS"}["tywugloncxe"] = "options";
     ${${"GLOBALS"}["gcfgsatc"]} = $adb->query(${${"GLOBALS"}["hncdfohpf"]});
     ${${"GLOBALS"}["mrugtuu"]} = array("user" => array(), "group" => array());
     ${"GLOBALS"}["titxeedu"] = "availUser";
     $stljtvxgmshw = "result";
     while (${${"GLOBALS"}["yptigqgnbbw"]} = $adb->fetchByAssoc(${$uwoefflj})) {
         ${"GLOBALS"}["rjiaktga"] = "user";
         $xwwbcezkcg = "user";
         ${"GLOBALS"}["hjtqjfi"] = "user";
         ${${"GLOBALS"}["hjtqjfi"]}["id"] = ${${"GLOBALS"}["rjiaktga"]}["id"];
         ${${"GLOBALS"}["mrugtuu"]}["user"][] = ${$xwwbcezkcg};
     }
     ${"GLOBALS"}["xuceoxb"] = "toModule";
     ${${"GLOBALS"}["txneufzr"]} = "SELECT id FROM vtiger_ws_entity WHERE name = 'Groups'";
     ${$xobfnidjmu} = $adb->query(${$qybdsfhc});
     ${${"GLOBALS"}["gtxvsrw"]} = $adb->query_result(${${"GLOBALS"}["gcfgsatc"]}, 0, "id");
     $mzhfkmici = "sql";
     ${"GLOBALS"}["fqawgodflt"] = "refFields";
     ${$lnxjswg} = "SELECT * FROM vtiger_groups ORDER BY groupname";
     $wzihhlpcl = "data";
     ${$stljtvxgmshw} = $adb->query(${$mzhfkmici});
     while (${${"GLOBALS"}["kxxnbbihik"]} = $adb->fetchByAssoc(${$rakhgqmsey})) {
         $wuctugbbuk = "availUser";
         ${"GLOBALS"}["dglkcz"] = "group";
         $pdkdlnmwh = "group";
         ${${"GLOBALS"}["dglkcz"]}["groupid"] = ${${"GLOBALS"}["kxxnbbihik"]}["groupid"];
         ${$wuctugbbuk}["group"][] = ${$pdkdlnmwh};
     }
     $viewer->assign("availUsers", ${${"GLOBALS"}["mrugtuu"]});
     ${$xngmezo} = VtUtils::getFieldsWithBlocksForModule(${${"GLOBALS"}["xuceoxb"]}, ${${"GLOBALS"}["fqawgodflt"]} == true ? true : false);
     if (${${"GLOBALS"}["oyjhbrdojleb"]} !== false) {
         ${"GLOBALS"}["tnvuuieutqe"] = "fields";
         reset(${${"GLOBALS"}["tnvuuieutqe"]});
         $jexjswdeqysq = "addField";
         ${${"GLOBALS"}["tbwjkww"]} = key(${${"GLOBALS"}["yxsjdkh"]});
         foreach (${${"GLOBALS"}["oyjhbrdojleb"]} as ${$jexjswdeqysq}) {
             $uwpklhsk = "fields";
             ${"GLOBALS"}["ouxgywsbfd"] = "addField";
             ${"GLOBALS"}["iiedjg"] = "firstKey";
             ${$uwpklhsk}[${${"GLOBALS"}["iiedjg"]}][] = ${${"GLOBALS"}["ouxgywsbfd"]};
         }
     }
     $viewer->assign("fields", ${${"GLOBALS"}["yefvtwdbtg"]});
     ${"GLOBALS"}["dbqfvyhyty"] = "script";
     $afbxguwxvx = "setter_blocks";
     $viewer->assign("fromFields", $this->getFromFields());
     ${${"GLOBALS"}["eifgrvstdko"]} = array();
     ${${"GLOBALS"}["qjntqv"]} = array();
     foreach (${${"GLOBALS"}["yxsjdkh"]} as ${${"GLOBALS"}["fsmvqyhawbr"]} => ${${"GLOBALS"}["esuxyxb"]}) {
         ${"GLOBALS"}["voyvrmu"] = "block";
         $hwxflshrpina = "field";
         foreach (${${"GLOBALS"}["voyvrmu"]} as ${${"GLOBALS"}["qvktopqw"]} => ${$hwxflshrpina}) {
             $bohdzzxeqtf = "blockId";
             ${"GLOBALS"}["cdrckm"] = "blockId";
             ${${"GLOBALS"}["axgtprtc"]} = !empty($field->block->id) ? $field->block->id : 0;
             ${"GLOBALS"}["ghimyenlsug"] = "setter_fields";
             if ($field->name == "eventstatus") {
                 if ($this->parameter["activityType"] == "Task") {
                     global $current_language;
                     $bfscdk = "language";
                     ${"GLOBALS"}["ejmqgpjwwyv"] = "language";
                     ${${"GLOBALS"}["ejmqgpjwwyv"]} = \Vtiger_Language_Handler::getModuleStringsFromFile(${${"GLOBALS"}["yddleyi"]}, "Calendar");
                     if (empty(${$bfscdk})) {
                         $nplkqgugw = "language";
                         ${$nplkqgugw} = \Vtiger_Language_Handler::getModuleStringsFromFile("en_us", "Calendar");
                     }
                     $field->type->picklistValues = getAllPickListValues("taskstatus", ${${"GLOBALS"}["lssuihizyw"]}["languageStrings"]);
                 }
             }
             ${${"GLOBALS"}["ghimyenlsug"]}[] = array("type" => $field->type, "name" => $field->name, "label" => $field->label, "blockId" => ${${"GLOBALS"}["cdrckm"]}, "sequence" => $field->sequence);
             if (!isset(${${"GLOBALS"}["qjntqv"]}["block_" . ${$bohdzzxeqtf}])) {
                 $fodrrj = "blockId";
                 $ttvkvbxiqr = "toModule";
                 ${${"GLOBALS"}["qjntqv"]}["block_" . ${$fodrrj}] = array(${${"GLOBALS"}["axgtprtc"]}, getTranslatedString($field->block->label, ${$ttvkvbxiqr}));
             }
         }
     }
     $viewer->assign("setter_blocks", ${$afbxguwxvx});
     $agvhdwtg = "script";
     $viewer->assign("setterContent", $viewer->fetch("modules/Settings/Workflow2/helpers/Setter.tpl"));
     ${${"GLOBALS"}["nbtorrl"]} = $this->parameter;
     ${${"GLOBALS"}["tnnhuvubw"]} = "var setter_fields = " . json_encode(${${"GLOBALS"}["eifgrvstdko"]}) . ";\n";
     ${$sbxdhyqvqj} .= "var setter_values = " . json_encode(${$wzihhlpcl}[$this->field]) . ";\n";
     ${${"GLOBALS"}["sxuujyumdvv"]} .= "var available_users = " . json_encode(${${"GLOBALS"}["titxeedu"]}) . ";\n";
     ${$yzltgwdg} .= "var WfSetterToModule = '" . ${${"GLOBALS"}["hpoksfzufvi"]} . "';\n";
     ${${"GLOBALS"}["tnnhuvubw"]} .= "var WfSetterFromModule = '" . ${${"GLOBALS"}["hvlighrh"]} . "';\n";
     ${${"GLOBALS"}["dbqfvyhyty"]} .= "var WfSetterOptions = " . json_encode(${${"GLOBALS"}["tywugloncxe"]}) . ";\n";
     ${$agvhdwtg} .= "var availCurrency = " . json_encode(getAllCurrencies()) . ";\n";
     ${${"GLOBALS"}["tnnhuvubw"]} .= "var dateFormat = '" . $current_user->date_format . "';\n";
     $this->addInlineJS(${${"GLOBALS"}["tnnhuvubw"]});
 }
コード例 #27
0
 function wf_fieldlabel($module, $fieldName)
 {
     if (!is_array($fieldName)) {
         $fieldName = array($fieldName);
         $single = true;
     } else {
         $single = false;
     }
     $tabid = getTabid($module);
     foreach ($fieldName as $field) {
         if ($field == 'crmid') {
             $fieldLabel = 'CRMID';
         } else {
             $fieldInfo = \Workflow\VtUtils::getFieldInfo($field, $tabid);
             $fieldLabel = $fieldInfo['fieldlabel'];
         }
         if (empty($fieldLabel)) {
             $fieldLabel = $field;
         }
         $return[] = $fieldLabel;
     }
     if ($single === true) {
         return $return[0];
     } else {
         return $return;
     }
 }
コード例 #28
0
ファイル: VtUtils.php プロジェクト: cin-system/cinrepo
 public static function getRelatedModules($module_name)
 {
     $clnasch = "result";
     global $adb, $current_user, $app_strings;
     ${"GLOBALS"}["rnoyrpjcfhr"] = "sql";
     require "user_privileges/user_privileges_" . $current_user->id . ".php";
     ${${"GLOBALS"}["rnoyrpjcfhr"]} = "SELECT vtiger_relatedlists.related_tabid,vtiger_relatedlists.label, vtiger_relatedlists.name, vtiger_tab.name as module_name FROM\n                vtiger_relatedlists\n                    INNER JOIN vtiger_tab ON(vtiger_tab.tabid = vtiger_relatedlists.related_tabid)\n                WHERE vtiger_relatedlists.tabid = '" . getTabId(${${"GLOBALS"}["luxsvwk"]}) . "' AND related_tabid not in (SELECT tabid FROM vtiger_tab WHERE presence = 1) ORDER BY sequence, vtiger_relatedlists.relation_id";
     $pwwrtsww = "sql";
     ${$clnasch} = \Workflow\VtUtils::query(${$pwwrtsww});
     ${"GLOBALS"}["hpteydlzekv"] = "result";
     ${${"GLOBALS"}["sekdixmdyjad"]} = array();
     while (${${"GLOBALS"}["mnxpcyvt"]} = $adb->fetch_array(${${"GLOBALS"}["hpteydlzekv"]})) {
         if (${${"GLOBALS"}["rphtkvjmiom"]}[${${"GLOBALS"}["mnxpcyvt"]}["related_tabid"]] == 0) {
             $jtnacqi = "profileActionPermission";
             ${"GLOBALS"}["geomnpsrb"] = "row";
             if (${$jtnacqi}[${${"GLOBALS"}["geomnpsrb"]}["related_tabid"]][3] == 0) {
                 ${"GLOBALS"}["ehyili"] = "app_strings";
                 $jdcqowf = "row";
                 ${"GLOBALS"}["rywpvnrpf"] = "row";
                 ${"GLOBALS"}["ruzokfcil"] = "row";
                 ${${"GLOBALS"}["sekdixmdyjad"]}[] = array("related_tabid" => ${${"GLOBALS"}["ruzokfcil"]}["related_tabid"], "module_name" => ${${"GLOBALS"}["rywpvnrpf"]}["module_name"], "action" => ${${"GLOBALS"}["mnxpcyvt"]}["name"], "label" => isset(${${"GLOBALS"}["uqqtduge"]}[${${"GLOBALS"}["mnxpcyvt"]}["label"]]) ? ${${"GLOBALS"}["ehyili"]}[${$jdcqowf}["label"]] : ${${"GLOBALS"}["mnxpcyvt"]}["label"]);
             }
         }
     }
     return ${${"GLOBALS"}["sekdixmdyjad"]};
 }