[Vtigercrm-developers] Fwd: Re: Creating a module extension for ver 5.4
Vic Cekvenich
vic.cvc at gmx.com
Sun Aug 17 18:56:40 GMT 2014
-------- Original Message --------
Subject: Re: [Vtigercrm-developers] Creating a module extension for ver 5.4
Date: Sun, 22 Jun 2014 07:17:03 +0530
From: Lajeesh <lajeeshk at gmail.com>
Reply-To: vtigercrm-developers at lists.vtigercrm.com
To: <vtigercrm-developers at lists.vtigercrm.com>
Hi,
This given example for creating new field in existing block of existing
module..just run this script..and u can see a new field in existing
project module..
Regards
Lajeesh
------------------------------------------------------------------------
From: Send Review <mailto:sendreview at gmail.com>
Sent: 21-06-2014 20:23
To: vtigercrm-developers at lists.vtigercrm.com
<mailto:vtigercrm-developers at lists.vtigercrm.com>
Subject: [Vtigercrm-developers] Creating a module extension for ver 5.4
Hello,
Thanks for the kind reply. However, this example shows how to create a
new field for a new new block in a new module.
What I am looking for, is to create a new field in existing user module
so that I have new parameter in the "My preference" user option. In
other words, I am not creating a new module and forces the new block and
field to the existing user module:
/> $module->name = 'Users';
/>/ $module->id = 29;/
I wonder if this is good practice.
Secondly, since I am not creating a new module instance, it will not
appear in the module manager. So that means it will not be exportable. I
wonder what should be the approach.
I looked pretty much around the web for example of module extension (not
how to create a new module) but could not find any literature.
Thanks, Joel
Message: 1
Date: Sat, 21 Jun 2014 09:53:04 +0530
From: lajeesh k <lajeeshk at gmail.com <mailto:lajeeshk at gmail.com>>
To: vtigercrm-developers <vtigercrm-developers at lists.vtigercrm.com
<mailto:vtigercrm-developers at lists.vtigercrm.com>>
Subject: Re: [Vtigercrm-developers] Creating a module extension for
ver 5.4
Message-ID:
<CAA1bLmpB4uTuZ0nJtvJ2NVdfXcvooGSJvRkPJexnhtMJTrqwkg at mail.gmail.com
<mailto:CAA1bLmpB4uTuZ0nJtvJ2NVdfXcvooGSJvRkPJexnhtMJTrqwkg at mail.gmail.com>>
Content-Type: text/plain; charset="utf-8"
Follow the following sample for creating new field,
<?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('Project');
if($module)
{
$block =
Vtiger_Block::getInstance('LBL_PROJECT_INFORMATION',$module);
if($block)
{
$field = Vtiger_Field::getInstance('hours',$module);
if(!$field)
{
$field = new Vtiger_Field();
$field->name = 'hours';
$field->table = 'vtiger_project';
$field->label = 'Hours';
$field->column = 'hours';
$field->columntype = 'VARCHAR(40)';
$field->uitype = 7;
$field->displaytype = 2;
$field->typeofdata = 'V~O';
$block->addField($field);
}
}
else
{
echo "No block";
}
}
else
{
echo "No module";
}
?>
-------------- next part --------------
_______________________________________________
http://www.vtiger.com/
More information about the vtigercrm-developers
mailing list