私はvtigerの初心者です。TroubleTicketモジュールのサービスモジュールから「サービス名」フィールドを挿入しようとしていますが、今までできませんでした。
一般的に言えば、別のモジュールからモジュールにフィールドを挿入することは可能ですか? もしそうなら、それはどのように行われるべきですか?
質問する
4778 次
1 に答える
5
このコードを使用して、これをvTigerルートディレクトリの下に置き、ブラウザから呼び出すことができます。
<?php
$Vtiger_Utils_Log = true;
include_once('vtlib/Vtiger/Menu.php');
include_once('vtlib/Vtiger/Module.php');
$module = Vtiger_Module::getInstance('HelpDesk');
if($module) {
$blockInstance = Vtiger_Block::getInstance('LBL_TICKET_INFORMATION', $module);
if($blockInstance) {
$fieldInstance = Vtiger_Field::getInstance('Service1', $module);
if(!$fieldInstance) {
$fieldInstance = new Vtiger_Field();
$fieldInstance->name = 'Service1';
$fieldInstance->label = 'Service Name';
$fieldInstance->uitype = 10;
$fieldInstance->typeofdata = 'V~O';
$blockInstance->addField($fieldInstance);
$fieldInstance->setRelatedModules(Array('Services'));
}
}
}
?>
于 2013-01-21T08:40:23.227 に答える