2014-10-04 25 views
0

我最近下载并安装了sugarcrm社区版:6.5.17。SugarCRM支持链接在模块内部打破

如何修复各个模块中的帮助链接?或者,我怎样才能弄清楚帮助调用是如何工作的,因为我无法在代码中找到正在生成的链接的任何代码引用。

当我点击任何模块内帮助链接,如机会中上:

点击此处详细了解的机会模块。要访问更多信息,请使用位于主导航栏上的用户菜单下拉菜单访问帮助。

凡 “点击这里” 链接查看HTML页面源时,看起来是这样的:?

HREF =“模块=管理&行动= SupportPortal &视图=文档&版本6.5.17 =版& CE = & LANG = & help_module =项目& help_action = &键=”

我得到一个 “403禁止” 错误与此链接:

[链接] http://support.sugarcrm.com/02_Documentation/01_Sugar_Editions/05_Sugar_Community_Edition/Sugar_Community_Edition_6.5/Application_Guide/13_Opportunities/

我手动发现正确的链接为:

[链接] http://support.sugarcrm.com/02_Documentation/01_Sugar_Editions/05_Sugar_Community_Edition/Sugar_Community_Edition_6.5/Sugar_Community_Edition_Application_Guide_6.5.0/13_Opportunities/

Example link that exhibits the problem

回答

1

打开config_override.php并添加custom_help_url一个PARAM指向顶层页面在您找到的网站上。

以下是我发现:

的糖,几乎任何你在屏幕上阅读保存在本地化和翻译的目的,一些语言文件。因此,我们可以通过使用grep搜索系统,该位翻译文本的开始:

[MKP01] [~/Sites/sugar] > grep -r 'to learn more about the' include/ 
include//language/en_us.lang.php: 'MSG_EMPTY_LIST_VIEW_NO_RESULTS_SUBMSG' => "<item4> to learn more about the <item1> module. In order to access more information, use the user menu drop down located on the main navigation bar to access Help.", 

现在我们知道标签的名称,我们可以搜索在使用时的情况:

[MKP01] [~/Sites/nemrace] > grep -r 'MSG_EMPTY_LIST_VIEW_NO_RESULTS_SUBMSG' include/ 
include//language/en_us.lang.php: 'MSG_EMPTY_LIST_VIEW_NO_RESULTS_SUBMSG' => "<item4> to learn more about the <item1> module. In order to access more information, use the user menu drop down located on the main navigation bar to access Help.", 
include//ListView/ListViewGeneric.tpl:     {$APP.MSG_EMPTY_LIST_VIEW_NO_RESULTS_SUBMSG|replace:"<item1>":$moduleName|replace:"<item4>":$helpLink} 

我们已经知道的第一个结果,但第二个结果是你所追求的:它是所有列表视图的默认Smarty模板。如果我们在文本编辑器打开该文件,我们可以跟踪变量$helpLink的定义是只有几行上面它的使用,其中:

{capture assign="helpLink"}<a target="_blank" href='?module=Administration&action=SupportPortal&view=documentation&version={$sugar_info.sugar_version}&edition={$sugar_info.sugar_flavor}&lang=&help_module={$currentModule}&help_action=&key='>{$APP.LBL_CLICK_HERE}</a>{/capture} 

然后,你知道要挖到modules/Administration/SupportPortal.php和读取逻辑,知道找函数get_help_url的定义。我们发现它在include/utils.php

function get_help_url($send_edition = '', $send_version = '', $send_lang = '', $send_module = '', $send_action = '', $dev_status = '', $send_key = '', $send_anchor = '') { 
    global $sugar_config; 

    if (!empty($sugar_config['custom_help_url'])) { 
     $sendUrl = $sugar_config['custom_help_url']; 
    } else { 
     if (!empty($sugar_config['custom_help_base_url'])) { 
      $baseUrl= $sugar_config['custom_help_base_url']; 
     } else { 
      $baseUrl = "http://www.sugarcrm.com/crm/product_doc.php"; 
     } 
     $sendUrl = $baseUrl . "?edition={$send_edition}&version={$send_version}&lang={$send_lang}&module={$send_module}&help_action={$send_action}&status={$dev_status}&key={$  send_key}"; 
     if(!empty($send_anchor)) { 
      $sendUrl .= "&anchor=".$send_anchor; 
     } 
    } 
    return $sendUrl; 
} 

这是一个好消息 - 糖了解到,一些系统管理员都希望自己提供的帮助网址或基本URL,所以我的建议,你会开config_override.php并添加参数有关custom_help_url指向您找到的网站的顶级页面。

+0

感谢Matthew您的快速修复和您的逻辑浏览语言def,smarty,php和模块中的代码是非常有用的。我将这一行添加到config_override.php以获得满意的解决方案:'$ sugar_config ['custom_help_url'] ='http://support.sugarcrm.com/02_Documentation01_Sugar_Editions/05_Sugar_Community_Edition/Sugar_Community_Edition_6.5/Sugar_Community_Edition_Application_Guide_6.5.0/';' – LectureMaker 2014-10-07 19:29:24

+0

我也把这个问题发布到SugarCRM社区论坛。社区经理已将此问题标记为一个错误:{link}(https://community.sugarcrm.com/sugarcrm/topics/application-guide-broken-help-links) – LectureMaker 2014-10-07 22:40:03