[Vtigercrm-developers] vtlib module & activities

Alan Lord alanslists at gmail.com
Wed Aug 15 09:59:46 PDT 2012


Am trying to add relationships to the Calendar module in my custom module:

// Link to Calendar Module
$modActivities = Vtiger_Module::getInstance('Calendar');
$module->unsetRelatedList($modActivities);
$module->setRelatedList($modActivities, 'Activities', 
Array('ADD,SELECT'), 'get_activities');

$field_parentid = Vtiger_Field::getInstance('parent_id', $modActivities);
$field_parentid->setRelatedModules(array('Memberships'));

I get the Related List View for Activities in my module's Detail View 
but when I click on "Add" and it opens a new Event dialogue, the 
"Related To" picklist and field are not populated as they are when you 
go from one of the standard modules and the picklist itself doesn't 
contain my module's name either.

Anyone successfully done this before?

TIA

Al

PS - I'd also like to add Action links to Add Event/Todo too. Have 
created the code but without getting the relationship between Calendar 
and my module there seems little point in going any further...

// Add an action link to add an event. (Doesn't work right now)
//$url = 
'index.php?module=Calendar&action=EditView&return_module=Memberships&return_action=DetailView&activity_mode=Events&return_id=$RECORD$&parent_id=$RECORD$';
//$module->addLink('DETAILVIEWBASIC', 'Add Event', $url);



More information about the vtigercrm-developers mailing list