[Vtigercrm-developers] change bloc to field using vtlibs

Adam Heinz amh at metricwise.net
Wed Oct 24 07:02:15 PDT 2012


I don't quite understand your english, but here goes:

Doesn't the Accounts module already provide for both account
information and related contact information?  If that is insufficient,
maybe this example code can push you in the right direction.

require_once('vtlib/Vtiger/Module.php');
require_once('vtlib/Vtiger/Block.php');
require_once('vtlib/Vtiger/Field.php');

$module = Vtiger_Module::getInstance('Accounts');

$block = new Vtiger_Block();
$block->label = 'LBL_CONTACT_INFORMATION'; // Add label translations
$block->save($module);

$field = new Vtiger_Field();
$field->label = 'foo';
$field->name = 'foo';
$field->table = 'vtiger_accountscf';
$field->column = 'foo';
$field->columntype = 'INTEGER(1)';
$field->uitype = 56; // Checkbox
$field->typeofdata = 'C~O';
$block->addField($field);

2012/10/24 Matteo Baranzoni <barra at greenbitweb.com>:
> Hy,
> in Account modules i create da "contact information" block with email,
> phone, mobile ecc.
>
> Usually i move existing modules working directly on DB.
> it is possible do this via the vtlibs?
>
> --
> Matteo Baranzoni - Greenbit WEB


More information about the vtigercrm-developers mailing list