本文整理汇总了PHP中Vtiger_Block::getAllForModule方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Block::getAllForModule方法的具体用法?PHP Vtiger_Block::getAllForModule怎么用?PHP Vtiger_Block::getAllForModule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Block
的用法示例。
在下文中一共展示了Vtiger_Block::getAllForModule方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update_Blocks
/**
* Update Blocks of the module
* @access private
*/
function update_Blocks($modulenode, $moduleInstance)
{
if (empty($modulenode->blocks) || empty($modulenode->blocks->block)) {
return;
}
foreach ($modulenode->blocks->block as $blocknode) {
$this->listBlocks[] = strval($blocknode->label);
$blockInstance = Vtiger_Block::getInstance((string) $blocknode->label, $moduleInstance);
if (!$blockInstance) {
$blockInstance = $this->import_Block($modulenode, $moduleInstance, $blocknode);
} else {
$this->update_Block($modulenode, $moduleInstance, $blocknode, $blockInstance);
}
$this->update_Fields($blocknode, $blockInstance, $moduleInstance);
}
// Deleting removed blocks
$listBlockBeforeUpdate = Vtiger_Block::getAllForModule($moduleInstance);
foreach ($listBlockBeforeUpdate as $blockInstance) {
if (!in_array($blockInstance->label, $this->listBlocks)) {
$blockInstance->delete();
}
}
}
示例2: getAllForModule
/**
* Function to retrieve block instances for a module
* @param <type> $moduleModel - module instance
* @return <array> - list of Vtiger_Block_Model
*/
public static function getAllForModule($moduleModel)
{
$blockObjects = Vtiger_Cache::get('ModuleBlock', $moduleModel->getName());
if (!$blockObjects) {
$blockObjects = parent::getAllForModule($moduleModel);
Vtiger_Cache::set('ModuleBlock', $moduleModel->getName(), $blockObjects);
}
$blockModelList = array();
if ($blockObjects) {
foreach ($blockObjects as $blockObject) {
$blockModelList[] = self::getInstanceFromBlockObject($blockObject);
}
}
return $blockModelList;
}
示例3: getFieldsWithBlocksForModule
public static function getFieldsWithBlocksForModule($module_name, $references = false, $refTemplate = "([source]: ([module]) [destination])")
{
$wmdpupqmkw = "modLang";
global $current_language, $adb, $app_strings;
$jyoclduhijw = "instance";
if (empty(${${"GLOBALS"}["dtigqiycyl"]}) && ${${"GLOBALS"}["uoikifoisc"]} == true) {
$hepidzbf = "refTemplate";
${$hepidzbf} = "([source]: ([module]) [destination])";
}
${"GLOBALS"}["qdchdj"] = "module";
${"GLOBALS"}["dlxjxqbp"] = "current_language";
$kquvbsysfcu = "moduleFields";
include_once "vtlib/Vtiger/Module.php";
${${"GLOBALS"}["qdchdj"]} = ${${"GLOBALS"}["kgrlqorxi"]};
${${"GLOBALS"}["visvlqiwmar"]} = Vtiger_Module::getInstance(${${"GLOBALS"}["fmewvndt"]});
${"GLOBALS"}["gkjcbzii"] = "blocks";
${${"GLOBALS"}["tuyqii"]} = Vtiger_Block::getAllForModule(${$jyoclduhijw});
${"GLOBALS"}["otfgztbcykam"] = "module";
${"GLOBALS"}["dwkjhu"] = "addReferences";
if (${${"GLOBALS"}["otfgztbcykam"]} != "Events") {
${"GLOBALS"}["isokwmqve"] = "langModule";
${${"GLOBALS"}["isokwmqve"]} = ${${"GLOBALS"}["fmewvndt"]};
} else {
$oivtxenk = "langModule";
${$oivtxenk} = "Calendar";
}
${$wmdpupqmkw} = return_module_language(${${"GLOBALS"}["dlxjxqbp"]}, ${${"GLOBALS"}["pdnqbcq"]});
${$kquvbsysfcu} = array();
${${"GLOBALS"}["sereklx"]} = array();
${"GLOBALS"}["qpvmpezinov"] = "moduleFields";
if (is_array(${${"GLOBALS"}["gkjcbzii"]})) {
${"GLOBALS"}["twqgybnkx"] = "block";
$wmhyxeckigh = "blocks";
foreach (${$wmhyxeckigh} as ${${"GLOBALS"}["twqgybnkx"]}) {
$vsrjrtsyjwuy = "block";
$jtvjnrg = "fields";
${"GLOBALS"}["fybcdi"] = "fields";
$jiroosdtbga = "instance";
${"GLOBALS"}["wzbaaqfp"] = "fields";
${${"GLOBALS"}["wzbaaqfp"]} = Vtiger_Field::getAllForBlock(${$vsrjrtsyjwuy}, ${$jiroosdtbga});
${"GLOBALS"}["qindbfrv"] = "fields";
if (empty(${${"GLOBALS"}["fybcdi"]}) || !is_array(${${"GLOBALS"}["qindbfrv"]})) {
continue;
}
foreach (${$jtvjnrg} as ${${"GLOBALS"}["iswxctbj"]}) {
${"GLOBALS"}["gpvotsermfo"] = "module";
${"GLOBALS"}["ltyuthgs"] = "references";
$field->label = getTranslatedString($field->label, ${${"GLOBALS"}["gpvotsermfo"]});
if (${${"GLOBALS"}["ltyuthgs"]} !== false) {
${"GLOBALS"}["txxkntyfk"] = "addReferences";
$dcbsrjwyigh = "addReferences";
$qqmucyy = "field";
$svmyfptxpk = "field";
$msdeydhan = "addReferences";
${"GLOBALS"}["kwkccfh"] = "field";
$amiqkcrlotrq = "result";
${"GLOBALS"}["duvygkbpexkh"] = "addReferences";
$kxrugplfiqo = "result";
$bjhinyeqy = "addReferences";
$yiujkrbxum = "field";
${"GLOBALS"}["ltyirzpnpba"] = "field";
$qynnew = "field";
$jrfetwc = "field";
${"GLOBALS"}["roilmn"] = "addReferences";
switch ($field->uitype) {
case "51":
${${"GLOBALS"}["sereklx"]}[] = array(${${"GLOBALS"}["iswxctbj"]}, "Accounts");
break;
case "52":
${${"GLOBALS"}["txxkntyfk"]}[] = array(${${"GLOBALS"}["iswxctbj"]}, "Users");
break;
case "53":
${${"GLOBALS"}["roilmn"]}[] = array(${${"GLOBALS"}["iswxctbj"]}, "Users");
break;
case "57":
${${"GLOBALS"}["duvygkbpexkh"]}[] = array(${${"GLOBALS"}["iswxctbj"]}, "Contacts");
break;
case "58":
${${"GLOBALS"}["sereklx"]}[] = array(${${"GLOBALS"}["kwkccfh"]}, "Campaigns");
break;
case "59":
${${"GLOBALS"}["sereklx"]}[] = array(${${"GLOBALS"}["ltyirzpnpba"]}, "Products");
break;
case "73":
${$bjhinyeqy}[] = array(${${"GLOBALS"}["iswxctbj"]}, "Accounts");
break;
case "75":
${${"GLOBALS"}["sereklx"]}[] = array(${$svmyfptxpk}, "Vendors");
break;
case "81":
${$dcbsrjwyigh}[] = array(${$qynnew}, "Vendors");
break;
case "76":
${${"GLOBALS"}["sereklx"]}[] = array(${${"GLOBALS"}["iswxctbj"]}, "Potentials");
break;
case "78":
${${"GLOBALS"}["sereklx"]}[] = array(${$qqmucyy}, "Quotes");
break;
case "80":
${${"GLOBALS"}["sereklx"]}[] = array(${$yiujkrbxum}, "SalesOrder");
//.........这里部分代码省略.........
示例4: handle
public function handle() {
if ($this->interactive) {
$uitypes = array (
1 => array("columntype" => "VARCHAR(255)", "typeofdata" => "V~O", "descript" => "текстовое поле"),
2 => array("columntype" => "VARCHAR(255)", "typeofdata" => "V~M", "descript" => "текстовое поле (обязательное)"),
21 => array("columntype" => "TEXT", "typeofdata" => "V~O", "descript" => "textarea (в 1 поле)"),
19 => array("columntype" => "TEXT", "typeofdata" => "V~O", "descript" => "textarea (широкое)"),
6 => array("columntype" => "DATETIME", "typeofdata" => "DT~O", "descript" => "дата и время"),
5 => array("columntype" => "DATE", "typeofdata" => "D~O", "descript" => "дата"),
23 => array("columntype" => "DATE", "typeofdata" => "D~O", "descript" => "дата (конечная)"),
14 => array("columntype" => "TIME", "typeofdata" => "T~O", "descript" => "время"),
7 => array("columntype" => "INT(11)", "typeofdata" => "I~O", "descript" => "целое число"),
9 => array("columntype" => "decimal(11,0)", "typeofdata" => "N~O", "descript" => "проценты"),
71 => array("columntype" => "decimal(25,8)", "typeofdata" => "N~O", "descript" => "сумма в рублях"),
17 => array("columntype" => "VARCHAR(255)", "typeofdata" => "V~O", "descript" => "ссылка"),
15 => array("columntype" => "VARCHAR(60)", "typeofdata" => "V~O~LE~60", "descript" => "PickList (по Ролям)"),
16 => array("columntype" => "VARCHAR(60)", "typeofdata" => "V~O~LE~60", "descript" => "PickList (для всех)"),
56 => array("columntype" => "VARCHAR(3)", "typeofdata" => "C~O", "descript" => "галочка (да/нет)")
);
echo "------------------------------------ >>> CREATE FIELD <<< ---\n";
$mmodule = $this->prompt("Module name: ", self::PROMPT_NAME);
$mmoduleInstance = Vtiger_Module::getInstance($mmodule);
if (!$mmoduleInstance) {
echo "ERROR: Module $mmodule not found, try another.\n";
} else {
do {
$field3 = new Vtiger_Field();
$field3->table = $mmoduleInstance->basetable;
$field3->masseditable = 2;
$field3->label = $this->prompt("Field Label: ", self::PROMPT_NAME);
$field3->name = str_replace(" ", "_", strtolower($field3->label));
$lfieldName = $this->prompt("Field Name (" . $field3->name . "?): ", self::PROMPT_OPTIONAL);
if ($lfieldName) $field3->name = $lfieldName;
$field3->column = $field3->name;
foreach ($uitypes as $uikey => $uivalue) { echo "$uikey. ".$uivalue['descript'].".\n"; }
$field3->uitype = $this->prompt("Select UI Type: ", self::PROMPT_NUMERIC);
if (array_key_exists($field3->uitype, $uitypes)) {
$field3->typeofdata = $uitypes[$field3->uitype]['typeofdata'];
$field3->columntype = $uitypes[$field3->uitype]['columntype'];
}
$lfieldColumntype = $this->prompt("columntype: (" . $field3->columntype . "?)", self::PROMPT_OPTIONAL);
if ($lfieldColumntype) $field3->columntype = $lfieldColumntype;
$lfieldTypeofdata = $this->prompt("typeofdata: (" . $field3->typeofdata . "?)", self::PROMPT_OPTIONAL);
if ($lfieldTypeofdata) $field3->typeofdata = $lfieldTypeofdata;
echo "Field ".$field3->label." [".$field3->table.".".$field3->column."] creating ... ";
$moduleBlocks = Vtiger_Block::getAllForModule($mmoduleInstance);
$block1 = $moduleBlocks[0];
$block1->addField($field3);
echo "DONE.\n";
} while (true);
}
echo "----------------------------------\n\n";
} else {
echo "ERROR: Interactive only.\n";
}
}
示例5: getAllForModule
/**
* Function to retrieve block instances for a module
* @param <type> $moduleModel - module instance
* @return <array> - list of Vtiger_Block_Model
*/
public static function getAllForModule($moduleModel)
{
global $log;
$log->debug("Entering ./models/Block.php::staticgetAllForModule");
$blockObjects = Vtiger_Cache::get('ModuleBlock', $moduleModel->getName());
if (!$blockObjects) {
$blockObjects = parent::getAllForModule($moduleModel);
Vtiger_Cache::set('ModuleBlock', $moduleModel->getName(), $blockObjects);
}
$blockModelList = array();
if ($blockObjects) {
foreach ($blockObjects as $blockObject) {
$blockModelList[] = self::getInstanceFromBlockObject($blockObject);
}
}
return $blockModelList;
}