public function getCreateViewUrl()
 {
     $createViewUrl = parent::getCreateViewUrl();
     $currentUserModel = Users_Record_Model::getCurrentUserModel();
     $parentRecordModel = $this->getParentRecordModel();
     $currencyValue = $parentRecordModel->get('hdnGrandTotal');
     $parentRecordModelCurrencyId = $parentRecordModel->get('currency_id');
     if ($parentRecordModelCurrencyId == $currentUserModel->get('currency_id')) {
         $amount = CurrencyField::convertToUserFormat($currencyValue, null, true);
     } else {
         $baseCurrencyId = CurrencyField::getDBCurrencyId();
         $allCurrencies = getAllCurrencies();
         foreach ($allCurrencies as $currencyInfo) {
             if ($parentRecordModelCurrencyId == $currencyInfo['currency_id']) {
                 $currencyValue = CurrencyField::convertToDollar($currencyValue, $currencyInfo['conversionrate']);
             }
         }
         foreach ($allCurrencies as $currencyInfo) {
             if ($baseCurrencyId == $currencyInfo['currency_id']) {
                 $currencyValue = CurrencyField::convertFromMasterCurrency($currencyValue, $currencyInfo['conversionrate']);
             }
         }
         $amount = CurrencyField::convertToUserFormat($currencyValue);
     }
     return $createViewUrl . '&relatedcontact=' . $parentRecordModel->get('contact_id') . '&relatedorganization=' . $parentRecordModel->get('account_id') . '&amount=' . $amount;
 }
 public function beforeGetTaskform($data)
 {
     $pplkpxdfnevl = "viewer";
     $iuekfubh = "data";
     ${${"GLOBALS"}["cgfmjwwpip"]} = \PearDatabase::getInstance();
     list(${${"GLOBALS"}["nhsboiruw"]}, ${$pplkpxdfnevl}) = ${$iuekfubh};
     ${"GLOBALS"}["kqvmnsqcq"] = "productCache";
     $viewer->assign("availTaxes", getAllTaxes("available"));
     $viewer->assign("availCurrency", getAllCurrencies());
     ${${"GLOBALS"}["kqvmnsqcq"]} = array();
     foreach (${${"GLOBALS"}["nhsboiruw"]}[$this->field] as ${${"GLOBALS"}["lbltvfz"]}) {
         if (!empty(${${"GLOBALS"}["lbltvfz"]}["productid"])) {
             ${"GLOBALS"}["bcfngarcjdy"] = "product";
             ${${"GLOBALS"}["djmvvsgdvdv"]} = \Vtiger_Record_Model::getInstanceById(${${"GLOBALS"}["lbltvfz"]}["productid"]);
             $kkoeiyxt = "productCache";
             ${$kkoeiyxt}[${${"GLOBALS"}["bcfngarcjdy"]}["productid"]] = array("data" => $dataObj->getData(), "tax" => $dataObj->getTaxes(), "label" => \Vtiger_Functions::getCRMRecordLabel(${${"GLOBALS"}["lbltvfz"]}["productid"]));
         }
     }
     $viewer->assign("productCache", ${${"GLOBALS"}["nmqsaly"]});
     $viewer->assign("selectedProducts", ${${"GLOBALS"}["nhsboiruw"]}[$this->field]);
     $viewer->assign("additionalProductFields", \Workflow\VTInventoryEntity::getAdditionalProductFields());
     $this->addInlineJS("");
     $viewer->assign("ProductChooser", $viewer->fetch("modules/Settings/Workflow2/helpers/ProductChooser.tpl"));
 }
示例#3
0
        $smarty->assign("MOD_SEQ_ID", $autostr);
    }
} else {
    $smarty->assign("MOD_SEQ_ID", $focus->column_fields[$mod_seq_field['name']]);
}
//if create PO, get all available product taxes and shipping & Handling taxes
if ($focus->mode != 'edit') {
    $tax_details = getAllTaxes('available');
    $sh_tax_details = getAllTaxes('available', 'sh');
} else {
    $tax_details = getAllTaxes('available', '', $focus->mode, $focus->id);
    $sh_tax_details = getAllTaxes('available', 'sh', 'edit', $focus->id);
}
$smarty->assign('GROUP_TAXES', $tax_details);
$smarty->assign('SH_TAXES', $sh_tax_details);
$smarty->assign("CURRENCIES_LIST", getAllCurrencies());
if ($focus->mode == 'edit') {
    $inventory_cur_info = getInventoryCurrencyInfo('PurchaseOrder', $focus->id);
    $smarty->assign("INV_CURRENCY_ID", $inventory_cur_info['currency_id']);
} else {
    $smarty->assign("INV_CURRENCY_ID", $currencyid);
}
$smarty->assign('CREATEMODE', vtlib_purify($_REQUEST['createmode']));
// Gather the help information associated with fields
$smarty->assign('FIELDHELPINFO', vtlib_getFieldHelpInfo($currentModule));
$picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($currentModule);
$smarty->assign("PICKIST_DEPENDENCY_DATASOURCE", Zend_Json::encode($picklistDependencyDatasource));
//Get Service or Product by default when create
$smarty->assign('PRODUCT_OR_SERVICE', GlobalVariable::getVariable('product_service_default', 'Products', $currentModule, $current_user->id));
//Set taxt type group or individual by default when create
$smarty->assign('TAX_TYPE', GlobalVariable::getVariable('Tax_Type_Default', 'individual', $currentModule, $current_user->id));
示例#4
0
 /**	function to save the service price information in vtiger_servicecurrencyrel table
  *	@param string $tablename - vtiger_tablename to save the service currency relationship (servicecurrencyrel)
  *	@param string $module	 - current module name
  *	$return void
  */
 function insertPriceInformation($tablename, $module)
 {
     global $adb, $log, $current_user;
     $log->debug("Entering into insertPriceInformation({$tablename}, {$module}) method ...");
     //removed the update of currency_id based on the logged in user's preference : fix 6490
     $currency_details = getAllCurrencies('all');
     //Delete the existing currency relationship if any
     if ($this->mode == 'edit' && $_REQUEST['action'] != 'MassEditSave' && $_REQUEST['action'] != 'ProcessDuplicates') {
         for ($i = 0; $i < count($currency_details); $i++) {
             $curid = $currency_details[$i]['curid'];
             $sql = "delete from vtiger_productcurrencyrel where productid=? and currencyid=?";
             $adb->pquery($sql, array($this->id, $curid));
         }
     }
     $service_base_conv_rate = getBaseConversionRateForProduct($this->id, $this->mode, $module);
     //Save the Product - Currency relationship if corresponding currency check box is enabled
     for ($i = 0; $i < count($currency_details); $i++) {
         $curid = $currency_details[$i]['curid'];
         $curname = $currency_details[$i]['currencylabel'];
         $cur_checkname = 'cur_' . $curid . '_check';
         $cur_valuename = 'curname' . $curid;
         $base_currency_check = 'base_currency' . $curid;
         $requestPrice = CurrencyField::convertToDBFormat($_REQUEST['unit_price'], null, true);
         $actualPrice = CurrencyField::convertToDBFormat($_REQUEST[$cur_valuename], null, true);
         if ($_REQUEST[$cur_checkname] == 'on' || $_REQUEST[$cur_checkname] == 1) {
             $conversion_rate = $currency_details[$i]['conversionrate'];
             $actual_conversion_rate = $service_base_conv_rate * $conversion_rate;
             $converted_price = $actual_conversion_rate * $requestPrice;
             $log->debug("Going to save the Product - {$curname} currency relationship");
             $query = "insert into vtiger_productcurrencyrel values(?,?,?,?)";
             $adb->pquery($query, array($this->id, $curid, $converted_price, $actualPrice));
             // Update the Product information with Base Currency choosen by the User.
             if ($_REQUEST['base_currency'] == $cur_valuename) {
                 $adb->pquery("update vtiger_service set currency_id=?, unit_price=? where serviceid=?", array($curid, $actualPrice, $this->id));
             }
         }
     }
     $log->debug("Exiting from insertPriceInformation({$tablename}, {$module}) method ...");
 }
示例#5
0
 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"]};
 }
 public function beforeGetTaskform($viewer)
 {
     global $adb;
     $new_module = $this->getWorkflow()->getSettings();
     $new_module = $new_module["module_name"];
     if (!empty($new_module) && $new_module != -1) {
         $viewer->assign("new_module", $new_module);
     }
     $sql = "SELECT\r\n                    vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.description,\r\n                    vtiger_products.*,\r\n                    vtiger_productcf.*\r\n                FROM vtiger_products\r\n                    INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_products.productid\r\n                    INNER JOIN vtiger_productcf ON vtiger_products.productid = vtiger_productcf.productid\r\n                    LEFT JOIN vtiger_vendor ON vtiger_vendor.vendorid = vtiger_products.vendor_id\r\n                    LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\r\n                    LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\r\n                WHERE\r\n                    vtiger_products.productid > 0 AND\r\n                    vtiger_crmentity.deleted = 0 and\r\n                    vtiger_products.discontinued <> 0 AND\r\n                    (vtiger_products.productid NOT IN (\r\n                        SELECT crmid FROM vtiger_seproductsrel WHERE vtiger_products.productid > 0 AND setype='Products'\r\n                        )\r\n                    )";
     $result = $adb->query($sql);
     $products = array();
     $taxes = array();
     while ($row = $adb->fetchByAssoc($result)) {
         $products[$row["productid"]] = $row;
         $taxes[$row["productid"]] = getTaxDetailsForProduct($row["productid"], 'all');
         if (empty($taxes[$row["productid"]])) {
             $taxes[$row["productid"]] = array("a" => "b");
         }
     }
     $viewer->assign("taxlist", $taxes);
     $viewer->assign("productlist", $products);
     $workflows = Workflow2::getWorkflowsForModule($new_module, 1);
     $viewer->assign("extern_workflows", $workflows);
     $module = array();
     $module["Invoice"] = getTranslatedString("Invoice", "Invoice");
     $module["Quotes"] = getTranslatedString("Quotes", "Quotes");
     $module["PurchaseOrder"] = getTranslatedString("PurchaseOrder", "PurchaseOrder");
     $module["SalesOrder"] = getTranslatedString("SalesOrder", "SalesOrder");
     asort($module);
     $viewer->assign("avail_module", $module);
     $viewer->assign("orig_module_name", $this->getModuleName());
     $viewer->assign("availCurrency", getAllCurrencies());
     $viewer->assign("availTaxes", getAllTaxes("available"));
 }
<?php

global $db;
require_once '../confy.php';
require_once '../functions.php';
require_once '../functions-2.php';
tep_db_connect();
use_class('logger');
$logger = new logger('cron', 'daily-exchange-rate');
$api_status_ok = true;
$exchange_rate = array();
$exchange_rate['date'] = date('d.m.Y H:i:s');
$currencies = getAllCurrencies();
foreach ($currencies as $c_from) {
    foreach ($currencies as $c_to) {
        $key = generateExchangeRateKey($c_from, $c_to);
        if ($c_from == $c_to) {
            $rate = 1;
        } else {
            $rate = getExchangeRateOnline($c_from, $c_to);
            if ($rate == 0 || $rate === false) {
                $api_status_ok = false;
            }
        }
        $exchange_rate[$key] = $rate;
        $logger->write('Rate for ' . $key . ': ' . $rate);
    }
}
if ($api_status_ok) {
    save_config('exchange-rate', $exchange_rate);
    $logger->write('Save rate to configuration file');
 public function beforeGetTaskform($viewer)
 {
     global $adb;
     $new_module = $this->get("new_module");
     if (!empty($_POST["task"]["new_module_setter"])) {
         $new_module = $_POST["task"]["new_module_setter"];
         #            $viewer->assign("module_name", $_POST["task"]["new_module_setter"]);
         $mandatoryFields = VtUtils::getMandatoryFields(getTabId($_POST["task"]["new_module_setter"]));
         $startFields = array();
         $counter = 1;
         foreach ($mandatoryFields as $field) {
             if ('productid' != $field['fieldname']) {
                 $startFields["" . $counter] = array("field" => $field["fieldname"], "mode" => "value", "value" => "", "fixed" => true);
                 $counter++;
             }
         }
         $startFields["" . $counter++] = array("field" => "currency_id", "mode" => "value", "value" => "", "fixed" => true);
         $startFields["" . $counter++] = array("field" => "hdnTaxType", "mode" => "value", "value" => "", "fixed" => true);
         $startFields["" . $counter++] = array("field" => "hdnS_H_Amount", "mode" => "value", "value" => "", "fixed" => true);
         $this->set("setter", $startFields);
         $this->set("global", array());
     }
     if (!empty($new_module) && $new_module != -1) {
         $field = new StdClass();
         $field->name = "hdnS_H_Amount";
         $field->label = getTranslatedString("Shipping & Handling Charges", $_POST["task"]["new_module_setter"]);
         $additionalFields = array($field);
         $viewer->assign("new_module", $new_module);
     }
     $workflows = Workflow2::getWorkflowsForModule($new_module, 1);
     $viewer->assign("extern_workflows", $workflows);
     $module = array();
     $module["Invoice"] = getTranslatedString("Invoice", "Invoice");
     $module["Quotes"] = getTranslatedString("Quotes", "Quotes");
     $module["PurchaseOrder"] = getTranslatedString("PurchaseOrder", "PurchaseOrder");
     $module["SalesOrder"] = getTranslatedString("SalesOrder", "SalesOrder");
     asort($module);
     $viewer->assign("avail_module", $module);
     $viewer->assign("orig_module_name", $this->getModuleName());
     $viewer->assign("availCurrency", getAllCurrencies());
     $viewer->assign("availTaxes", getAllTaxes("available"));
 }
示例#9
0
 public function beforeGetTaskform($data)
 {
     $gjvwsfdwphi = "adb";
     ${"GLOBALS"}["mobqittrqmph"] = "sql";
     ${"GLOBALS"}["brxwfzkewr"] = "refFields";
     ${"GLOBALS"}["eodvapxxo"] = "fromModule";
     global $current_user;
     ${$gjvwsfdwphi} = \PearDatabase::getInstance();
     ${"GLOBALS"}["ctokneejikc"] = "sql";
     list(${${"GLOBALS"}["npsngu"]}, ${${"GLOBALS"}["mfspoprsj"]}) = ${${"GLOBALS"}["npsngu"]};
     ${"GLOBALS"}["ivjufwhitffu"] = "sql";
     $knqlakyv = "script";
     ${${"GLOBALS"}["eodvapxxo"]} = $this->parameter["fromModule"];
     ${"GLOBALS"}["ninqoem"] = "script";
     ${${"GLOBALS"}["naeruxoeyjd"]} = $this->parameter["additionalToFields"];
     $rjyeyvvuck = "result";
     $vjidqahbem = "result";
     ${"GLOBALS"}["ywzrgro"] = "wsTabId";
     ${${"GLOBALS"}["brxwfzkewr"]} = !empty($this->parameter["refFields"]) ? true : false;
     ${${"GLOBALS"}["ivjufwhitffu"]} = "SELECT id FROM vtiger_ws_entity WHERE name = 'Users'";
     ${"GLOBALS"}["fltynfv"] = "sql";
     ${"GLOBALS"}["wwrciyhya"] = "user";
     $ficpkwfh = "options";
     ${"GLOBALS"}["ktlswxil"] = "sql";
     ${${"GLOBALS"}["bfdqrczmru"]} = $adb->query(${${"GLOBALS"}["qsgbvwbkfgw"]});
     ${${"GLOBALS"}["ywzrgro"]} = $adb->query_result(${$vjidqahbem}, 0, "id");
     $hdhygr = "sql";
     ${${"GLOBALS"}["ckglijlvuoe"]} = array("user" => array(), "group" => array());
     $lrgvmdcbot = "script";
     ${${"GLOBALS"}["ctokneejikc"]} = "SELECT id,user_name,first_name,last_name FROM vtiger_users WHERE status = 'Active'";
     ${"GLOBALS"}["ngysvqgcqub"] = "fromModule";
     ${${"GLOBALS"}["bfdqrczmru"]} = $adb->query(${$hdhygr});
     $qkpocngrrnk = "sql";
     while (${${"GLOBALS"}["wwrciyhya"]} = $adb->fetchByAssoc(${${"GLOBALS"}["bfdqrczmru"]})) {
         ${"GLOBALS"}["usjcwgu"] = "user";
         $wicrcvyxfku = "user";
         ${$wicrcvyxfku}["id"] = ${${"GLOBALS"}["usjcwgu"]}["id"];
         ${${"GLOBALS"}["ckglijlvuoe"]}["user"][] = ${${"GLOBALS"}["cwkkeqmke"]};
     }
     ${"GLOBALS"}["uurckyfs"] = "availUser";
     ${${"GLOBALS"}["ktlswxil"]} = "SELECT id FROM vtiger_ws_entity WHERE name = 'Groups'";
     $qswfljlu = "script";
     $hvwjixajy = "script";
     ${${"GLOBALS"}["bfdqrczmru"]} = $adb->query(${${"GLOBALS"}["fltynfv"]});
     ${${"GLOBALS"}["ogvjgo"]} = $adb->query_result(${${"GLOBALS"}["bfdqrczmru"]}, 0, "id");
     ${${"GLOBALS"}["mobqittrqmph"]} = "SELECT * FROM vtiger_groups ORDER BY groupname";
     ${${"GLOBALS"}["bfdqrczmru"]} = $adb->query(${$qkpocngrrnk});
     while (${${"GLOBALS"}["fmpjsdqdf"]} = $adb->fetchByAssoc(${$rjyeyvvuck})) {
         $isuxpajm = "group";
         ${"GLOBALS"}["wimlolo"] = "availUser";
         ${${"GLOBALS"}["fmpjsdqdf"]}["groupid"] = ${${"GLOBALS"}["fmpjsdqdf"]}["groupid"];
         ${${"GLOBALS"}["wimlolo"]}["group"][] = ${$isuxpajm};
     }
     ${${"GLOBALS"}["tebpsz"]} = array();
     $viewer->assign("fromFields", $this->getFromFields());
     $viewer->assign("StaticFieldsField", $this->field);
     $viewer->assign("staticFields", $viewer->fetch("modules/Settings/Workflow2/helpers/StaticFields.tpl"));
     ${$ficpkwfh} = $this->parameter;
     ${$knqlakyv} = "var StaticFieldsFrom = " . json_encode($this->getFromFields()) . ";\n";
     ${$qswfljlu} .= "var StaticFieldsCols = " . json_encode(${${"GLOBALS"}["npsngu"]}[$this->field]) . ";\n";
     ${${"GLOBALS"}["ninqoem"]} .= "var StaticFieldsField = '" . $this->field . "';\n";
     ${${"GLOBALS"}["ovshwmbh"]} .= "var available_users = " . json_encode(${${"GLOBALS"}["uurckyfs"]}) . ";\n";
     ${$lrgvmdcbot} .= "var WfStaticFieldsFromModule = '" . ${${"GLOBALS"}["ngysvqgcqub"]} . "';\n";
     $ifnqcqhhu = "script";
     ${$hvwjixajy} .= "var availCurrency = " . json_encode(getAllCurrencies()) . ";\n";
     ${${"GLOBALS"}["ovshwmbh"]} .= "var dateFormat = '" . $current_user->date_format . "';\n";
     $this->addInlineJS(${$ifnqcqhhu});
 }
示例#10
0
 static function getAllCurrencies()
 {
     return getAllCurrencies();
 }
示例#11
0
 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"]});
 }
示例#12
0
 public static function getFieldsWithBlocksForModule($module_name, $references = false, $refTemplate = "([source]: ([module]) [destination])")
 {
     global $current_language, $adb, $app_strings;
     \Vtiger_Cache::$cacheEnable = false;
     $start = microtime(true);
     if (empty($refTemplate) && $references == true) {
         $refTemplate = "([source]: ([module]) [destination])";
     }
     //////echo 'C'.__LINE__.': '.round(microtime(true) - $start, 2).'<br/>';
     // Fields in this module
     include_once "vtlib/Vtiger/Module.php";
     #$alle = glob(dirname(__FILE__).'/functions/*.inc.php');
     #foreach($alle as $datei) { include $datei;		 }
     $module = $module_name;
     $instance = Vtiger_Module::getInstance($module);
     $blocks = Vtiger_Block::getAllForModule($instance);
     ////echo 'C'.__LINE__.': '.round(microtime(true) - $start, 2).'<br/>';
     if ($module != "Events") {
         $langModule = $module;
     } else {
         $langModule = "Calendar";
     }
     $modLang = return_module_language($current_language, $langModule);
     //echo 'C'.__LINE__.': '.round(microtime(true) - $start, 2).'<br/>';
     $moduleFields = array();
     $addReferences = array();
     if (is_array($blocks)) {
         foreach ($blocks as $block) {
             $fields = Vtiger_Field::getAllForBlock($block, $instance);
             //echo 'C'.__LINE__.': '.round(microtime(true) - $start, 2).'<br/>';
             if (empty($fields) || !is_array($fields)) {
                 continue;
             }
             foreach ($fields as $field) {
                 $field->label = getTranslatedString($field->label, $langModule);
                 $field->type = new StdClass();
                 $field->type->name = self::getFieldTypeName($field->uitype);
                 if ($field->type->name == 'picklist') {
                     $language = \Vtiger_Language_Handler::getModuleStringsFromFile($current_language, $field->block->module->name);
                     if (empty($language)) {
                         $language = \Vtiger_Language_Handler::getModuleStringsFromFile('en_us', $field->block->module->name);
                     }
                     switch ($field->name) {
                         case 'hdnTaxType':
                             $field->type->picklistValues = array('group' => 'Group', 'individual' => 'Individual');
                             break;
                         case 'email_flag':
                             $field->type->picklistValues = array('SAVED' => 'SAVED', 'SENT' => 'SENT', 'MAILSCANNER' => 'MAILSCANNER');
                             break;
                         case 'currency_id':
                             $field->type->picklistValues = array();
                             $currencies = getAllCurrencies();
                             foreach ($currencies as $currencies) {
                                 $field->type->picklistValues[$currencies['currency_id']] = $currencies['currencylabel'];
                             }
                             break;
                         default:
                             $field->type->picklistValues = getAllPickListValues($field->name, $language['languageStrings']);
                             break;
                     }
                 }
                 if (in_array($field->uitype, self::$referenceUitypes)) {
                     $modules = self::getModuleForReference($field->block->module->id, $field->name, $field->uitype);
                     $field->type->refersTo = $modules;
                 }
                 if ($references !== false) {
                     switch ($field->uitype) {
                         case "51":
                             $addReferences[] = array($field, "Accounts");
                             break;
                         case "52":
                             $addReferences[] = array($field, "Users");
                             break;
                         case "53":
                             $addReferences[] = array($field, "Users");
                             break;
                         case "57":
                             $addReferences[] = array($field, "Contacts");
                             break;
                         case "58":
                             $addReferences[] = array($field, "Campaigns");
                             break;
                         case "59":
                             $addReferences[] = array($field, "Products");
                             break;
                         case "73":
                             $addReferences[] = array($field, "Accounts");
                             break;
                         case "75":
                             $addReferences[] = array($field, "Vendors");
                             break;
                         case "81":
                             $addReferences[] = array($field, "Vendors");
                             break;
                         case "76":
                             $addReferences[] = array($field, "Potentials");
                             break;
                         case "78":
                             $addReferences[] = array($field, "Quotes");
                             break;
                         case "80":
                             $addReferences[] = array($field, "SalesOrder");
                             break;
                         case "68":
                             $addReferences[] = array($field, "Accounts");
                             $addReferences[] = array($field, "Contacts");
                             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)) {
                                 $addReferences[] = array($field, $data["relmodule"]);
                             }
                             break;
                     }
                 }
                 $moduleFields[getTranslatedString($block->label, $langModule)][] = $field;
             }
         }
         $crmid = new StdClass();
         $crmid->name = 'crmid';
         $crmid->label = 'ID';
         $crmid->type = 'string';
         reset($moduleFields);
         $first_key = key($moduleFields);
         $moduleFields[$first_key] = array_merge(array($crmid), $moduleFields[$first_key]);
     }
     //echo 'C'.__LINE__.': '.round(microtime(true) - $start, 2).'<br/>';
     $rewriteFields = array("assigned_user_id" => "smownerid");
     if ($references !== false) {
         $field = new StdClass();
         $field->name = "current_user";
         $field->label = getTranslatedString("LBL_CURRENT_USER", "CloudFile");
         $addReferences[] = array($field, "Users");
     }
     if (is_array($addReferences)) {
         foreach ($addReferences as $refField) {
             //echo 'C'.__LINE__.': '.round(microtime(true) - $start, 2).'<br/>';
             $fields = self::getFieldsForModule($refField[1]);
             foreach ($fields as $field) {
                 $field->label = "(" . (isset($app_strings[$refField[1]]) ? $app_strings[$refField[1]] : $refField[1]) . ") " . $field->label;
                 if (!empty($rewriteFields[$refField[0]->name])) {
                     $refField[0]->name = $rewriteFields[$refField[0]->name];
                 }
                 $name = str_replace(array("[source]", "[module]", "[destination]"), array($refField[0]->name, $refField[1], $field->name), $refTemplate);
                 $field->name = $name;
                 $moduleFields["References (" . $refField[0]->label . ")"][] = $field;
             }
         }
     }
     \Vtiger_Cache::$cacheEnable = true;
     return $moduleFields;
 }
示例#13
0
 public static function getFieldsWithBlocksForModule($module_name, $references = false, $refTemplate = "([source]: ([module]) [destination])", $activityType = 'Event')
 {
     ${"GLOBALS"}["gmkxubmgqr"] = "module";
     ${"GLOBALS"}["tckseueixvr"] = "start";
     ${"GLOBALS"}["nyjbntl"] = "activityType";
     global $current_language, $adb, $app_strings;
     \Vtiger_Cache::${${"GLOBALS"}["xmcqwbwjg"]} = false;
     ${${"GLOBALS"}["tckseueixvr"]} = microtime(true);
     if (empty(${${"GLOBALS"}["edetoedh"]}) && ${${"GLOBALS"}["joqrqyq"]} == true) {
         ${${"GLOBALS"}["edetoedh"]} = "([source]: ([module]) [destination])";
     }
     include_once "vtlib/Vtiger/Module.php";
     $ixhjukqo = "blocks";
     ${"GLOBALS"}["uwtsvavwe"] = "module_name";
     if (${${"GLOBALS"}["luxsvwk"]} == "Calendar" && ${${"GLOBALS"}["nyjbntl"]} == "Task") {
         $htxexutwez = "module_name";
         ${$htxexutwez} = "Events";
     }
     ${"GLOBALS"}["kgthgvdjgye"] = "langModule";
     ${"GLOBALS"}["lefzyldkv"] = "rewriteFields";
     ${${"GLOBALS"}["dmoyzhsy"]} = ${${"GLOBALS"}["uwtsvavwe"]};
     ${${"GLOBALS"}["fqnjxp"]} = Vtiger_Module::getInstance(${${"GLOBALS"}["gmkxubmgqr"]});
     ${"GLOBALS"}["cembvymw"] = "moduleFields";
     ${$ixhjukqo} = Vtiger_Block::getAllForModule(${${"GLOBALS"}["fqnjxp"]});
     if (${${"GLOBALS"}["dmoyzhsy"]} != "Events") {
         $yurstcpqdq = "langModule";
         ${"GLOBALS"}["odbegiygfxd"] = "module";
         ${$yurstcpqdq} = ${${"GLOBALS"}["odbegiygfxd"]};
     } else {
         ${${"GLOBALS"}["hfdgvhqkst"]} = "Calendar";
     }
     ${${"GLOBALS"}["odweooain"]} = return_module_language(${${"GLOBALS"}["tlshanufgw"]}, ${${"GLOBALS"}["kgthgvdjgye"]});
     ${${"GLOBALS"}["jthlbvy"]} = array();
     ${${"GLOBALS"}["kpscbcovfo"]} = array();
     ${${"GLOBALS"}["iwqzew"]} = array();
     if (is_array(${${"GLOBALS"}["bnieibcdywdw"]})) {
         ${"GLOBALS"}["xtfdbcuqc"] = "crmid";
         $xolbwjrhxv = "first_key";
         $pgrvdhpa = "moduleFields";
         $zqkmhpowhabu = "blocks";
         foreach (${$zqkmhpowhabu} as ${${"GLOBALS"}["crfolbxyozx"]}) {
             $ujbljy = "fields";
             $dzmyfbqqwco = "fields";
             ${$ujbljy} = Vtiger_Field::getAllForBlock(${${"GLOBALS"}["crfolbxyozx"]}, ${${"GLOBALS"}["fqnjxp"]});
             $dccevwqqnq = "fields";
             if (empty(${${"GLOBALS"}["tobmkodw"]}) || !is_array(${$dzmyfbqqwco})) {
                 continue;
             }
             foreach (${$dccevwqqnq} as ${${"GLOBALS"}["eswxvskrqln"]}) {
                 $qxwayslw = "field";
                 $field->label = getTranslatedString($field->label, ${${"GLOBALS"}["hfdgvhqkst"]});
                 $field->type = new StdClass();
                 $field->type->name = self::getFieldTypeName($field->uitype);
                 if ($field->type->name == "picklist" || $field->type->name == "multipicklist") {
                     ${"GLOBALS"}["iksvvksq"] = "currencies";
                     $oddvouy = "currencies";
                     ${"GLOBALS"}["ljzqlguwfbi"] = "language";
                     $pmkgbyr = "language";
                     switch ($field->name) {
                         case "hdnTaxType":
                             $field->type->picklistValues = array("group" => "Group", "individual" => "Individual");
                             break;
                         case "currency_id":
                             $field->type->picklistValues = array();
                             ${$oddvouy} = getAllCurrencies();
                             foreach (${${"GLOBALS"}["sxrrhtqc"]} as ${${"GLOBALS"}["iksvvksq"]}) {
                                 ${"GLOBALS"}["qbjjpiyh"] = "currencies";
                                 $field->type->picklistValues[${${"GLOBALS"}["qbjjpiyh"]}["currency_id"]] = ${${"GLOBALS"}["sxrrhtqc"]}["currencylabel"];
                             }
                             break;
                         default:
                             ${${"GLOBALS"}["ljzqlguwfbi"]} = \Vtiger_Language_Handler::getModuleStringsFromFile(${${"GLOBALS"}["tlshanufgw"]}, $field->block->module->name);
                             if (empty(${$pmkgbyr})) {
                                 ${"GLOBALS"}["buzjfrxmswvm"] = "language";
                                 ${${"GLOBALS"}["buzjfrxmswvm"]} = \Vtiger_Language_Handler::getModuleStringsFromFile("en_us", $field->block->module->name);
                             }
                             $field->type->picklistValues = getAllPickListValues($field->name, ${${"GLOBALS"}["fztutztrkj"]}["languageStrings"]);
                             break;
                     }
                 }
                 if ($field->uitype == 26) {
                     $field->type->name = "picklist";
                     ${"GLOBALS"}["xrxfzxhc"] = "sql";
                     ${${"GLOBALS"}["xrxfzxhc"]} = "SELECT * FROM vtiger_attachmentsfolder ORDER BY foldername";
                     ${${"GLOBALS"}["yxurcyqzbn"]} = $adb->query(${${"GLOBALS"}["trhmtwd"]});
                     $field->type->picklistValues = array();
                     while (${${"GLOBALS"}["mnxpcyvt"]} = $adb->fetchByAssoc(${${"GLOBALS"}["yxurcyqzbn"]})) {
                         ${"GLOBALS"}["njqgidyefk"] = "row";
                         $field->type->picklistValues[${${"GLOBALS"}["njqgidyefk"]}["folderid"]] = ${${"GLOBALS"}["mnxpcyvt"]}["foldername"];
                     }
                 }
                 if (in_array($field->uitype, self::${${"GLOBALS"}["rjqzcd"]})) {
                     ${${"GLOBALS"}["szphwyugr"]} = self::getModuleForReference($field->block->module->id, $field->name, $field->uitype);
                     $field->type->refersTo = ${${"GLOBALS"}["szphwyugr"]};
                 }
                 if ($field->type->name == "reference") {
                     ${"GLOBALS"}["xejhaonrgfo"] = "field";
                     $zqrofcrhbmr = "referenceFields";
                     ${$zqrofcrhbmr}[] = ${${"GLOBALS"}["xejhaonrgfo"]};
                 }
                 $hmawaqcn = "langModule";
                 $badccgfkws = "references";
                 if (${$badccgfkws} !== false) {
                     $hsfvndvp = "addReferences";
                     ${"GLOBALS"}["xjiagoolbl"] = "addReferences";
                     $zsvcjvgvzpi = "addReferences";
                     $hcfjsh = "addReferences";
                     $qrnywhi = "addReferences";
                     $ikrxlsms = "addReferences";
                     ${"GLOBALS"}["wahhwrswkass"] = "addReferences";
                     ${"GLOBALS"}["jqkkoegemsx"] = "addReferences";
                     ${"GLOBALS"}["lvdytrgaztu"] = "addReferences";
                     $zttgnnv = "field";
                     ${"GLOBALS"}["rchdzecqkwbn"] = "field";
                     $quunxooexcy = "field";
                     $xsyuflgxpgdz = "addReferences";
                     $vfrcqsgkwos = "field";
                     $yckigulnbsk = "addReferences";
                     ${"GLOBALS"}["issxnl"] = "field";
                     ${"GLOBALS"}["fyhpevqw"] = "addReferences";
                     ${"GLOBALS"}["ypyeok"] = "field";
                     ${"GLOBALS"}["vfgwlu"] = "field";
                     ${"GLOBALS"}["tqjctxrneb"] = "field";
                     $hgnhsyoeuxsi = "field";
                     switch ($field->uitype) {
                         case "51":
                             ${${"GLOBALS"}["kpscbcovfo"]}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "Accounts");
                             break;
                         case "52":
                             ${${"GLOBALS"}["xjiagoolbl"]}[] = array(${$vfrcqsgkwos}, "Users");
                             break;
                         case "53":
                             ${$hsfvndvp}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "Users");
                             break;
                         case "57":
                             ${${"GLOBALS"}["kpscbcovfo"]}[] = array(${${"GLOBALS"}["issxnl"]}, "Contacts");
                             break;
                         case "58":
                             ${$xsyuflgxpgdz}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "Campaigns");
                             break;
                         case "59":
                             ${${"GLOBALS"}["kpscbcovfo"]}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "Products");
                             break;
                         case "73":
                             ${${"GLOBALS"}["lvdytrgaztu"]}[] = array(${$hgnhsyoeuxsi}, "Accounts");
                             break;
                         case "75":
                             ${${"GLOBALS"}["jqkkoegemsx"]}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "Vendors");
                             break;
                         case "81":
                             ${$hcfjsh}[] = array(${${"GLOBALS"}["tqjctxrneb"]}, "Vendors");
                             break;
                         case "76":
                             ${$yckigulnbsk}[] = array(${${"GLOBALS"}["vfgwlu"]}, "Potentials");
                             break;
                         case "78":
                             ${$ikrxlsms}[] = array(${${"GLOBALS"}["rchdzecqkwbn"]}, "Quotes");
                             break;
                         case "80":
                             ${$qrnywhi}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "SalesOrder");
                             break;
                         case "66":
                             ${${"GLOBALS"}["kpscbcovfo"]}[] = array(${$zttgnnv}, "Accounts");
                             ${${"GLOBALS"}["kpscbcovfo"]}[] = array(${$quunxooexcy}, "Leads");
                             ${$zsvcjvgvzpi}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "Potentials");
                             ${${"GLOBALS"}["kpscbcovfo"]}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "HelpDesk");
                             ${${"GLOBALS"}["wahhwrswkass"]}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "Campaigns");
                             break;
                         case "68":
                             ${${"GLOBALS"}["kpscbcovfo"]}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, "Accounts");
                             ${${"GLOBALS"}["fyhpevqw"]}[] = array(${${"GLOBALS"}["ypyeok"]}, "Contacts");
                             break;
                         case "10":
                             ${${"GLOBALS"}["yxurcyqzbn"]} = \Workflow\VtUtils::pquery("SELECT relmodule FROM `vtiger_fieldmodulerel` WHERE fieldid = ?", array($field->id));
                             while (${${"GLOBALS"}["rpgtsocbjybb"]} = $adb->fetch_array(${${"GLOBALS"}["yxurcyqzbn"]})) {
                                 ${"GLOBALS"}["etvsumie"] = "data";
                                 ${${"GLOBALS"}["kpscbcovfo"]}[] = array(${${"GLOBALS"}["eswxvskrqln"]}, ${${"GLOBALS"}["etvsumie"]}["relmodule"]);
                             }
                             break;
                     }
                 }
                 ${${"GLOBALS"}["jthlbvy"]}[getTranslatedString($block->label, ${$hmawaqcn})][] = ${$qxwayslw};
             }
         }
         ${"GLOBALS"}["bysquph"] = "InventoryModules";
         ${${"GLOBALS"}["xtfdbcuqc"]} = new StdClass();
         $crmid->name = "crmid";
         $crmid->label = "ID";
         $crmid->type = "string";
         reset(${${"GLOBALS"}["jthlbvy"]});
         ${${"GLOBALS"}["hohxkflr"]} = key(${${"GLOBALS"}["jthlbvy"]});
         ${${"GLOBALS"}["jthlbvy"]}[${$xolbwjrhxv}] = array_merge(array(${${"GLOBALS"}["jyctope"]}), ${$pgrvdhpa}[${${"GLOBALS"}["hohxkflr"]}]);
         if (in_array(${${"GLOBALS"}["dmoyzhsy"]}, self::${${"GLOBALS"}["bysquph"]})) {
             ${"GLOBALS"}["henyvjuckpi"] = "module";
             ${"GLOBALS"}["gxxfsgd"] = "first_key";
             ${${"GLOBALS"}["jyctope"]} = new StdClass();
             $kpjfmvzmghs = "first_key";
             ${"GLOBALS"}["cwnxyjn"] = "moduleFields";
             ${"GLOBALS"}["ktmspctvob"] = "crmid";
             $crmid->name = "hdnS_H_Amount";
             $crmid->label = getTranslatedString("Shipping & Handling Charges", ${${"GLOBALS"}["henyvjuckpi"]});
             $crmid->type = "string";
             reset(${${"GLOBALS"}["jthlbvy"]});
             ${${"GLOBALS"}["hohxkflr"]} = key(${${"GLOBALS"}["jthlbvy"]});
             ${${"GLOBALS"}["cwnxyjn"]}[${${"GLOBALS"}["gxxfsgd"]}] = array_merge(${${"GLOBALS"}["jthlbvy"]}[${$kpjfmvzmghs}], array(${${"GLOBALS"}["ktmspctvob"]}));
         }
     }
     ${"GLOBALS"}["upopmkvwurai"] = "addReferences";
     ${${"GLOBALS"}["lefzyldkv"]} = array("assigned_user_id" => "smownerid");
     ${"GLOBALS"}["scqvcmen"] = "cacheEnable";
     if (${${"GLOBALS"}["joqrqyq"]} !== false) {
         ${"GLOBALS"}["dsrwuu"] = "addReferences";
         ${"GLOBALS"}["sslclqqnfbw"] = "field";
         $kmoixogjhxu = "field";
         ${$kmoixogjhxu} = new StdClass();
         $field->name = "current_user";
         $field->label = getTranslatedString("LBL_CURRENT_USER", "Workflow2");
         ${${"GLOBALS"}["dsrwuu"]}[] = array(${${"GLOBALS"}["sslclqqnfbw"]}, "Users");
         if (!empty(${${"GLOBALS"}["iwqzew"]})) {
             foreach (${${"GLOBALS"}["iwqzew"]} as ${${"GLOBALS"}["mmuqgvsylc"]}) {
                 $xvnqxelu = "first_key";
                 $xsxglkjgmm = "crmid";
                 $sbihixyuih = "crmid";
                 ${$xsxglkjgmm} = new StdClass();
                 $crmid->name = str_replace(array("[source]", "[module]", "[destination]"), array($refField->name, "ModuleName", "ModuleName"), ${${"GLOBALS"}["edetoedh"]});
                 $bdnfiyflkc = "moduleFields";
                 ${"GLOBALS"}["etcbqubpb"] = "moduleFields";
                 $crmid->label = $refField->label . " / Modulename";
                 $dmskkogg = "first_key";
                 $crmid->type = "string";
                 reset(${${"GLOBALS"}["etcbqubpb"]});
                 ${$xvnqxelu} = key(${${"GLOBALS"}["jthlbvy"]});
                 ${${"GLOBALS"}["jthlbvy"]}[${${"GLOBALS"}["hohxkflr"]}] = array_merge(${$bdnfiyflkc}[${$dmskkogg}], array(${$sbihixyuih}));
             }
         }
     }
     if (is_array(${${"GLOBALS"}["upopmkvwurai"]})) {
         ${"GLOBALS"}["fokpcifdbil"] = "addReferences";
         foreach (${${"GLOBALS"}["fokpcifdbil"]} as ${${"GLOBALS"}["mmuqgvsylc"]}) {
             ${"GLOBALS"}["cxtkmhcqyn"] = "fields";
             ${"GLOBALS"}["qcadikqoac"] = "fields";
             ${${"GLOBALS"}["cxtkmhcqyn"]} = self::getFieldsForModule(${${"GLOBALS"}["mmuqgvsylc"]}[1]);
             foreach (${${"GLOBALS"}["qcadikqoac"]} as ${${"GLOBALS"}["eswxvskrqln"]}) {
                 ${"GLOBALS"}["ivtfijph"] = "app_strings";
                 $hatpiz = "refTemplate";
                 ${"GLOBALS"}["ithqigutpn"] = "refField";
                 ${"GLOBALS"}["dhtzrkv"] = "app_strings";
                 ${"GLOBALS"}["bmvbvwup"] = "refField";
                 $sxktrqfnbw = "rewriteFields";
                 ${"GLOBALS"}["rsspnimhzpn"] = "refField";
                 $skfigxcabc = "name";
                 $field->label = "(" . (isset(${${"GLOBALS"}["ivtfijph"]}[${${"GLOBALS"}["rsspnimhzpn"]}[1]]) ? ${${"GLOBALS"}["dhtzrkv"]}[${${"GLOBALS"}["mmuqgvsylc"]}[1]] : ${${"GLOBALS"}["ithqigutpn"]}[1]) . ") " . $field->label;
                 if (!empty(${$sxktrqfnbw}[${${"GLOBALS"}["mmuqgvsylc"]}[0]->name])) {
                     $uykopfvgof = "rewriteFields";
                     ${${"GLOBALS"}["mmuqgvsylc"]}[0]->name = ${$uykopfvgof}[${${"GLOBALS"}["mmuqgvsylc"]}[0]->name];
                 }
                 ${"GLOBALS"}["ufmoguryf"] = "moduleFields";
                 ${${"GLOBALS"}["urtuhewdod"]} = str_replace(array("[source]", "[module]", "[destination]"), array(${${"GLOBALS"}["mmuqgvsylc"]}[0]->name, ${${"GLOBALS"}["mmuqgvsylc"]}[1], $field->name), ${$hatpiz});
                 $kgqlxq = "field";
                 $field->name = ${$skfigxcabc};
                 ${${"GLOBALS"}["ufmoguryf"]}["References (" . ${${"GLOBALS"}["bmvbvwup"]}[0]->label . ")"][] = ${$kgqlxq};
             }
         }
     }
     \Vtiger_Cache::${${"GLOBALS"}["scqvcmen"]} = true;
     return ${${"GLOBALS"}["cembvymw"]};
 }