-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathscript-field.php
30 lines (29 loc) · 964 Bytes
/
script-field.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
$Vtiger_Utils_Log = true;
require_once('vtlib/Vtiger/Module.php');
require_once('vtlib/Vtiger/Block.php');
require_once('vtlib/Vtiger/Field.php');
$module = Vtiger_Module::getInstance('Flights');
if ($module) {
$block = Vtiger_Block::getInstance('LBL_FLIGHTS_INFORMATION', $module);
if ($block) {
$field = Vtiger_Field::getInstance('through', $module);
if (!$field) {
$field = new Vtiger_Field();
$field->name = 'through';
$field->table = $module->basetable;
$field->label = 'Through';
$field->column = 'through';
$field->columntype = 'VARCHAR(100)';
$field->uitype = 10;
$field->typeofdata = 'V~O';
$block->addField($field);
$field->setRelatedModules(Array('Airports'));
}
} else {
echo "No block";
}
} else {
echo "No module";
}
?>