宾果 - 和谢谢马修
我不知道在哪里可以找到这一点,在Sugar论坛上,没有人似乎知道,所以谢谢马修。
所以,是的,这是非常容易使用,马修指出
添加一个名为事件面板中的代码SugarCRM的面板添加到现有的模块,在
/自定义/模块/会计/语言/ en_us.lang.php
(添加到这个或创建新的文件,如果你喜欢)
添加
$mod_strings = array ('LBL_DETAILVIEW_PANEL1' => 'Events',);
,然后在安装包的/ scripts目录中的文件post_install.php把
<?php
function post_install()
{
// Debug point - checking to see if get to post_install script
echo "Made it to the post_install script.<br />";
// Use the ParserFactory to edit the view arrays
// Fetch the existing view into an array called $view_array
require_once('modules/ModuleBuilder/parsers/ParserFactory.php');
$view_array = ParserFactory::getParser('detailview','Accounts');
// Declare the additional content
$new_content = array
(
0 => array
(
0 => array
(
'name' => 'created_by_name',
'label' => 'LBL_CREATED',
),
1 => array
(
'name' => 'modified_by_name',
'label' => 'LBL_MODIFIED_NAME',
),
),
);
// Add the new content to the desired section of the view array
$view_array->_viewdefs['panels']['lbl_detailview_panel1'] = $new_content;
//Save the layout
$view_array->handleSave(false);
return;
}
?>
(我刚刚把现有的两个领域在新的面板,但你可以很容易地将新创建的域(从清单文件)到新的面板以及
马修,对不起,延迟响应;这看起来不错,但我无法让脚本通过解析器= ParserFactory :: getParser('detailview','Accounts');线。我到了post_install.php文件中的post_install函数。我用了你的确切线(复制它),但它挂在那里。有什么建议么? – Ramblin
SugarCRM.log或PHP错误日志中的任何内容?也许你需要要求类文件。 –
http://support.sugarcrm。com/02_Documentation/04_Sugar_Developer/Sugar_Developer_Guide_6.7/03_Module_Framework/02_Metadata/Examples/Manipulating_Layouts_Programmatically this example have the details details。 –