将Vtiger活动模块添加到自定义模块

时间:2017-04-07 09:56:09

标签: php crm vtiger vtigercrm

http://community.vtiger.com/help/vtigercrm/developers/extensions/examples/entity-module.html

使用上面链接中给出的文档,我创建了一个名为Leaves的自定义模块。现在,接下来的任务是将活动模块添加到Leaves模块。我用下面的代码做了同样的事。

include_once('vtlib/Vtiger/Module.php');
$moduleInstance = Vtiger_Module::getInstance('Leaves');
$accountsModule = Vtiger_Module::getInstance('Calendar');
$relationLabel  = 'Activities';
$moduleInstance->setRelatedList(
      $accountsModule, $relationLabel, Array('ADD','SELECT'), 'get_activities'
);

现在,在module / Leaves / Leaves.php中,我从Accounts模块的Accounts.php模块中复制了get_activities函数。它现在应该有效,但事实并非如此。

我添加了一个假,并打开了它的详细视图。看到活动标签,我感到高兴。我点击它并为特定的单一假期添加了2个事件。理想情况下,所有事件,即我最近添加的2个事件必须列在那里,但没有事件。

我检查了代码,发现关系存储在'vtiger_seactivityrel'表中,其中包含activityid和single leave id(crmid)。但是当我从Leaves模块添加事件时。已创建活动但关系未存储在“vtiger_seactivityrel”中。我通过添加activityid和crmid手动建立了关系,然后它开始显示事件。

因此,这里提出的问题是为什么'vtiger_seactivityrel'表没有填充。

如果您有解决方案,请有人帮助我。I have attached Image of one such leave which is showing blank even after adding event.

1 个答案:

答案 0 :(得分:0)

经过大量研究后我发现我需要更新vtiger_ws_referencetype表来建立关系。这是同样的查询。在我的情况下,custommodulename将被Leaves替换。

insert into vtiger_ws_referencetype(fieldtypeid,type) values (34,'custommodulename');
相关问题