为SugarCRM自定义模块创建管理员设置

时间:2018-12-10 14:45:13

标签: php sugarcrm

我无法使用SugarCRM 8.2为自定义模块创建管理员设置参数。首先,在遵循this post的同时,我将以下代码放在packets中,从而在管理页面上创建了一个带有单个链接链接的新面板:

packet

接下来,我尝试使“管理”面板中的链接指向具有单个文本字段的表单,管理员可以在其中输入供自定义模块用来发送自动通知的电子邮件地址。自定义模块称为snow_Sugar2SvcNowIntegration,而设置的设置由名为MonitorSugar2SvcNowConfiguration的计划作业使用。在遵循《开发人员指南》的this post和“创建布局” page的同时,我添加了布局和视图文件,如下所示:

eth0中的布局

raw-socket

packet中查看

iptables -A FORWARD -i eth0 -s 192.168.0.0/24 -j ACCEPT
iptables -A FORWARD -d 192.168.0.0/24 -j ACCEPT

let array = [ { "sector": "adad" }, { "sector": "adadasdsd" }, { "sector": "sdsdsd" }, { "origin": "sdfsf" }, { "destination": "dfsfsdf" } ] let rearranged = array.reduce((acc, entry) => { if (entry.sector) { acc[0].sector.push(entry.sector); } else if (entry.origin) { acc[1].origin.push(entry.origin); } else { acc[2].destination.push(entry.destination); } return acc; }, [{sector: []}, {origin: []}, {destination: []}]); console.log(rearranged);中的控制器

custom\Extension\modules\Administration\Ext\Administration\MonitorSugar2SvcNowAdminPanel.php

expect在指向$admin_option_defs = array(); $admin_option_defs['Administration']['MonitorSugar2SvcNowConfiguration'] = array( "LBL_MONITORSUGAR2SVCNOW_ADMIN_LINK", "LBL_MONITORSUGAR2SVCNOW_ADMIN_LINK_TITLE", "LBL_MONITORSUGAR2SVCNOW_ADMIN_LINK_DESC", "./index.php?module=snow_Sugar2SvcNowIntegration&action=monitorSugar2SvcNow-settings" ); $admin_group_header[]= array( 'LBL_MONITORSUGAR2SVCNOW_ADMIN_PANEL_TITLE', '', false, $admin_option_defs, 'LBL_MONITORSUGAR2SVCNOW_ADMIN_PANEL_DESC' ); 时看到的是“ Hello world”。相反,我看到空白页。 custom\clients\base\layouts\monitorSugar2SvcNow-settings\monitorSugar2SvcNow-settings.php(请参见上文)中指定的路由实际上是$viewdefs['base']['layout']['monitorSugar2SvcNow-settings'] = array( 'type' => 'simple', 'components' => array( array( 'view' => 'monitorSugar2SvcNow-settings', ), ), ); 。当我转到此URL时,出现“页面不存在”错误。有人可以指出我在这里缺少什么吗?

1 个答案:

答案 0 :(得分:2)

没关系,我已修复它。必须在$ admin_option_defs中将“布局”添加到路由中,如下所示:

"./index.php?module=snow_Sugar2SvcNowIntegration&action=layout/monitorSugar2SvcNow-settings"