CoreBOSBB
add image field in organization - Printable Version

+- CoreBOSBB (https://discussions.corebos.org)
+-- Forum: Open (https://discussions.corebos.org/forumdisplay.php?fid=20)
+--- Forum: Open Discussions (https://discussions.corebos.org/forumdisplay.php?fid=10)
+--- Thread: add image field in organization (/showthread.php?tid=71)



add image field in organization - saidmsl - 11-29-2014

Hi,

does anyone have the vtlib code to add a field type image in organization?

Rgds


Re: add image field in organization - omarllorens - 12-01-2014

Hi.

I don't have, but you can replicate the same that in Contacts module.

You can create a new field like imagename in contacts, look in vtiger_field table to find the uitype. And after you can reproduce the Contacts save_module():

Code:
    function save_module($module)
{
    $this->insertIntoAttachment($this->id,$module);
}
Just copy the insertIntoAttachment function defination and adapt to Accounts module.


RE: add image field in organization - aleex20 - 07-14-2019

Do you know if this module it's still working?


RE: add image field in organization - joebordes - 07-14-2019

sorry, @aleex20, what are you asking?


RE: add image field in organization - abuislam - 04-20-2024

Adding an image field type in Vtiger's vtlib involves a bit of customization. Below is a basic example of how you could achieve this:

php
Copy code
// Define the custom field in the organization module
$module = Vtiger_Module::getInstance('Accounts');
$field = new Vtiger_Field();
$field->name = 'imagename';
$field->label = 'Image';
$field->uitype = 10; // Image type
$field->column = $field->name;
$field->columntype = 'VARCHAR(255)';
$field->typeofdata = 'V~O';
$module->setEntityField($field);

// Add the custom field to the layout
$blockInstance = Vtiger_Block::getInstance('LBL_ACCOUNT_INFORMATION', $module);
$fieldInstance = Vtiger_Field::getInstance($field->name, $module);
$blockInstance->addField($fieldInstance);
This code adds an image field named 'Image' to the organization module. Replace 'Accounts' with the appropriate module name if you're working with a different module.

Remember to customize this code according to your specific needs and to ensure compatibility with your Vtiger CRM version. Additionally, consider backing up your database before making any customizations.