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

标签 php sugarcrm

我在使用 SugarCRM 8.2 为自定义模块创建管理设置参数时遇到问题。首先,同时关注this post我通过将此代码放在 custom\Extension\modules\Administration\Ext\Administration\MonitorSugar2SvcNowAdminPanel.php 中,在管理页面上创建了一个新面板,其中包含一个链接。 :

$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'
);

接下来,我尝试让管理面板中的链接指向具有单个文本字段的表单,管理员将能够在其中输入自定义模块用于发送自动通知的电子邮件地址。自定义模块称为 Snow_Sugar2SvcNowIntegration,设置由名为 MonitorSugar2SvcNowConfiguration 的计划作业使用。在关注this post时和“创建布局”page在开发人员指南中,我添加了如下布局和 View 文件:

布局在 custom\clients\base\layouts\monitorSugar2SvcNow-settings\monitorSugar2SvcNow-settings.php

$viewdefs['base']['layout']['monitorSugar2SvcNow-settings'] = array(
    'type' => 'simple',
    'components' => array(
        array(
            'view' => 'monitorSugar2SvcNow-settings',
        ),
    ),
);

查看custom\clients\base\views\monitorSugar2SvcNow-settings\monitorSugar2SvcNow-settings.hbs

<p> Hello world.</p>

custom\clients\base\views\monitorSugar2SvcNow-settings\monitorSugar2SvcNow-settings.js中的 Controller

{
    className: 'monitorSugar2SvcNow-settings',
});

我全部expect这里是指向<my sugar URL>/#snow_Sugar2SvcNowIntegration/layout/monitorSugar2SvcNow-settings时看到“Hello world” 。相反,我看到一个空白的白页。 $admin_option_defs中指定的路线(见上文)实际上是 <sugar URL>/#snow_Sugar2SvcNowIntegration/monitorSugar2SvcNow-settings 。当我访问此 URL 时,收到“页面不存在”错误。有人可以指出我在这里缺少什么吗?

最佳答案

没关系,我已经修好了。 “layout”必须添加到 $admin_option_defs 中的路由中,如下所示:

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

关于php - 为 SugarCRM 自定义模块创建管理设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53708014/

相关文章:

php - SugarCRM 6.5 中的动态下拉菜单故障排除

javascript - 从 Sugarcrm 中的 QuickCreate 中删除必填字段

php - MySQL数据库到android ListView

php - 从 ajax 调用中解析 JSON 数据

PHP创建多个目录

java - 我可以通过文档对象将 PDF 上传到 SugarCRM 吗?

php - 升级后sugarcrm文件下载错误

php - 我如何使用 php 从一系列问题中回显选定的选项

php - 在匿名函数中调用匿名函数(Inception)