Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
add image field in organization
#1
Hi,

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

Rgds
Reply
#2
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.
Reply
#3
Do you know if this module it's still working?
[color=#000000]I love art and technology. | Actually I've a blog of[/color] [url=https://www.tatuajesinks.com/][color=#000000]meaning of tattoos[/color][/url]. | [color=#000000]I'm studying data science.[/color]
Reply
#4
sorry, @aleex20, what are you asking?
Joe
TSolucio
Reply
#5
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)