2014-10-04 31 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