29 lines
920 B
PHP
29 lines
920 B
PHP
<?php
|
|
|
|
/*
|
|
|
|
create_relation.php
|
|
|
|
Create this file into your root directory of vtiger i.e. vtigercrm/
|
|
|
|
and then run this file directly using your browser
|
|
|
|
for example localhost/vtigercrm/create_relation.php
|
|
|
|
*/
|
|
|
|
include_once('vtlib/Vtiger/Module.php');
|
|
|
|
require_once('vtlib/Vtiger/Block.php');
|
|
|
|
require_once('vtlib/Vtiger/Field.php');
|
|
|
|
|
|
|
|
$moduleInstance = Vtiger_Module::getInstance('Events');
|
|
|
|
$block = Vtiger_Block::getInstance('LBL_DESCRIPTION_INFORMATION',$moduleInstance);
|
|
|
|
|
|
|
|
$field3 = new Vtiger_Field();
|
|
|
|
$field3->name = 'sample_id';
|
|
|
|
$field3->label = 'Echantillon';
|
|
|
|
$field3->table = 'vtiger_activity';//$moduleInstance->basetable;
|
|
|
|
$field3->column = 'sample_id';
|
|
|
|
$field3->columntype = 'VARCHAR(100)';
|
|
|
|
$field3->uitype = 10;
|
|
|
|
$field3->typeofdata = 'V~O';
|
|
|
|
$block->addField($field3);
|
|
|
|
|
|
|
|
$field3->setRelatedModules(Array('Products'));
|
|
|
|
$block->save($moduleInstance);
|
|
|
|
|
|
|
|
echo "done";
|
|
|
|
?>
|