コード例 #1
0
 public function checkCustomInventoryFields()
 {
     $oesoqqdz = "fieldName";
     $bleola = "additionalFields";
     ${"GLOBALS"}["jijoahqi"] = "defaulColumns";
     ${${"GLOBALS"}["wsskyhh"]} = \Workflow\VTInventoryEntity::getAdditionalProductFields();
     ${${"GLOBALS"}["bogjpbm"]} = vglobal("root_directory") . "modules" . DIRECTORY_SEPARATOR . "Workflow2" . DIRECTORY_SEPARATOR . "extends" . DIRECTORY_SEPARATOR . "InventoryFields.inc.php";
     ${"GLOBALS"}["bkgvtdi"] = "row";
     ${"GLOBALS"}["hjjwamijf"] = "additionalFields";
     if (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "extends" . DIRECTORY_SEPARATOR . "")) {
         ${${"GLOBALS"}["nnxpesshwam"]} = \PearDatabase::getInstance();
     }
     ${${"GLOBALS"}["jijoahqi"]} = array_merge(array("id", "productid", "sequence_no", "quantity", "listprice", "discount_percent", "discount_amount", "comment", "description", "incrementondel", "lineitem_id"), array_keys(${${"GLOBALS"}["hjjwamijf"]}));
     ${${"GLOBALS"}["bcibcujqqmt"]} = $adb->query("DESCRIBE  `vtiger_inventoryproductrel`");
     ${${"GLOBALS"}["bznhoevufr"]} = array();
     ${${"GLOBALS"}["znaqipryaqg"]} = array();
     while (${${"GLOBALS"}["bkgvtdi"]} = $adb->fetchByAssoc(${${"GLOBALS"}["bcibcujqqmt"]})) {
         $miuqabxq = "row";
         if (!in_array(${${"GLOBALS"}["tocxgfbc"]}["field"], ${${"GLOBALS"}["kyxyvcilhts"]})) {
             if (!preg_match("/tax[0-9]+/", ${${"GLOBALS"}["tocxgfbc"]}["field"])) {
                 ${"GLOBALS"}["enjkfymf"] = "additionalFields";
                 ${"GLOBALS"}["sttdrrc"] = "row";
                 ${${"GLOBALS"}["enjkfymf"]}[${${"GLOBALS"}["sttdrrc"]}["field"]] = array("inventoryField" => ${${"GLOBALS"}["tocxgfbc"]}["field"], "label" => ${${"GLOBALS"}["tocxgfbc"]}["field"], "implemented" => false);
                 echo "add inventory field `" . ${${"GLOBALS"}["tocxgfbc"]}["field"] . "`<br/>";
             }
         }
         ${${"GLOBALS"}["znaqipryaqg"]}[] = ${$miuqabxq}["field"];
     }
     foreach (${$bleola} as ${$oesoqqdz} => ${${"GLOBALS"}["wrqgydmcxj"]}) {
         if (!in_array(${${"GLOBALS"}["gsceseu"]}, ${${"GLOBALS"}["znaqipryaqg"]})) {
             $gkfjwcric = "additionalFields";
             $kqvjbcppym = "fieldName";
             $ieqbicj = "fieldName";
             unset(${$gkfjwcric}[${$kqvjbcppym}]);
             echo "remove inventory field `" . ${$ieqbicj} . "`<br/>";
         }
     }
     if (count(${${"GLOBALS"}["wsskyhh"]}) > 0) {
         $tprfdfaahjh = "cacheFile";
         file_put_contents(${$tprfdfaahjh}, "<?php return " . var_export(${${"GLOBALS"}["wsskyhh"]}, true) . ";");
     }
 }
コード例 #2
0
 public function addProducts2Entity($products, \Workflow\VTEntity $context, \Workflow\VTEntity $newObj)
 {
     $ntuvkohe = "newObj";
     $byrhbpbrk = "availTaxes";
     ${"GLOBALS"}["whorey"] = "index";
     $ffgqftdius = "products";
     ${$byrhbpbrk} = getAllTaxes("available");
     foreach (${$ffgqftdius} as ${${"GLOBALS"}["whorey"]} => ${${"GLOBALS"}["sjtfmhhrl"]}) {
         ${"GLOBALS"}["iidnejxe"] = "productid";
         ${"GLOBALS"}["mkhslsympqx"] = "value";
         ${"GLOBALS"}["dwhdtozvynqw"] = "additionalProductFields";
         $kruolocojg = "aTax";
         $hovdgrthnuug = "productid";
         $qtcncloye = "value";
         if (!empty(${${"GLOBALS"}["mkhslsympqx"]}["productid_individual"])) {
             $wyriktxohly = "value";
             ${"GLOBALS"}["sgtcyhxie"] = "context";
             ${${"GLOBALS"}["abiiqvys"]} = \Workflow\VTTemplate::parse(${$wyriktxohly}["productid_individual"], ${${"GLOBALS"}["sgtcyhxie"]});
         } else {
             $upfwkclmyw = "value";
             ${${"GLOBALS"}["abiiqvys"]} = ${$upfwkclmyw}["productid"];
         }
         $ftfrgn = "additional";
         $rjivvcng = "value";
         $txyfsrjjlt = "key";
         if (strpos(${${"GLOBALS"}["abiiqvys"]}, "x") !== false) {
             $iicydljc = "productid";
             ${${"GLOBALS"}["beraxrr"]} = explode("x", ${${"GLOBALS"}["abiiqvys"]});
             ${$iicydljc} = ${${"GLOBALS"}["beraxrr"]}[1];
         }
         ${${"GLOBALS"}["exevmtidn"]} = \CRMEntity::getInstance("Products");
         $crmProduct->id = ${${"GLOBALS"}["abiiqvys"]};
         ${"GLOBALS"}["sjserddrpvq"] = "template";
         ${"GLOBALS"}["yxkoqgfdppa"] = "tax";
         $tzdqzqwys = "value";
         $crmProduct->retrieve_entity_info(${${"GLOBALS"}["iidnejxe"]}, "Products");
         ${"GLOBALS"}["wwkmvdqqkc"] = "value";
         ${"GLOBALS"}["kefwiymrs"] = "notUsed";
         $context->setEnvironment("product", $crmProduct->column_fields);
         ${${"GLOBALS"}["yxkoqgfdppa"]} = array();
         foreach (${${"GLOBALS"}["vplitvux"]} as ${$kruolocojg}) {
             $aupvkbaasytu = "aTax";
             if (${${"GLOBALS"}["sjtfmhhrl"]}["tax" . ${$aupvkbaasytu}["taxid"] . "_enable"] == 1) {
                 ${"GLOBALS"}["ogkgbpocs"] = "value";
                 ${"GLOBALS"}["ijrycbkkr"] = "aTax";
                 $mkhbocmhrmpk = "tax";
                 ${"GLOBALS"}["dtghrs"] = "context";
                 ${$mkhbocmhrmpk}[${${"GLOBALS"}["umtsmnroiv"]}["taxid"]] = \Workflow\VTTemplate::parse(${${"GLOBALS"}["ogkgbpocs"]}["tax" . ${${"GLOBALS"}["ijrycbkkr"]}["taxid"]], ${${"GLOBALS"}["dtghrs"]});
             }
         }
         foreach (${${"GLOBALS"}["wwkmvdqqkc"]} as ${$txyfsrjjlt} => ${${"GLOBALS"}["sjserddrpvq"]}) {
             ${"GLOBALS"}["xlrnmfcvpv"] = "context";
             ${"GLOBALS"}["zhharvcx"] = "value";
             ${"GLOBALS"}["qhcuwjgl"] = "template";
             ${${"GLOBALS"}["zhharvcx"]}[${${"GLOBALS"}["emvpxgxubu"]}] = \Workflow\VTTemplate::parse(${${"GLOBALS"}["qhcuwjgl"]}, ${${"GLOBALS"}["xlrnmfcvpv"]});
         }
         ${${"GLOBALS"}["blrjuuukpb"]} = \Workflow\VTInventoryEntity::getAdditionalProductFields();
         ${${"GLOBALS"}["cjsxrrce"]} = array();
         foreach (${${"GLOBALS"}["dwhdtozvynqw"]} as ${${"GLOBALS"}["mvrectngpf"]} => ${${"GLOBALS"}["kefwiymrs"]}) {
             $fvxbkhyucq = "fieldIndex";
             ${"GLOBALS"}["wqqxwewdo"] = "value";
             ${"GLOBALS"}["scwnykwdcxs"] = "additional";
             $gjgvfrgxj = "fieldIndex";
             ${${"GLOBALS"}["scwnykwdcxs"]}[${$gjgvfrgxj}] = ${${"GLOBALS"}["wqqxwewdo"]}[${$fvxbkhyucq}];
         }
         $newObj->addProduct(${$hovdgrthnuug}, ${$tzdqzqwys}["description"], ${${"GLOBALS"}["sjtfmhhrl"]}["comment"], ${${"GLOBALS"}["sjtfmhhrl"]}["quantity"], ${${"GLOBALS"}["sjtfmhhrl"]}["unitprice"], ${$qtcncloye}["discount_mode"] == "percentage" ? ${${"GLOBALS"}["sjtfmhhrl"]}["discount_value"] : 0, ${${"GLOBALS"}["sjtfmhhrl"]}["discount_mode"] == "amount" ? ${$rjivvcng}["discount_value"] : 0, ${${"GLOBALS"}["itmavwvym"]}, ${$ftfrgn});
     }
     return ${$ntuvkohe};
 }