SugarCRM自定义Basic模板

时间:2013-08-22 14:36:22

标签: templates sugarcrm

我需要在basic template中添加一个字段。任何人都可以帮助我如何以升级安全的方式在include/SugarObjects/templates/basic/vardefs.php中添加另一个字段。

VardefManager's function addTemplate中,与Sugar的一般标准不同,它不需要自定义路径

第107行include/SugarObjects/VardefManager.php附近的

SugarCE6.5.5

   if(empty($templates[$template])){
        $path = 'include/SugarObjects/templates/' . $template . '/vardefs.php';
        if(file_exists($path)){
            require($path);
            $templates[$template] = $vardefs;
        }else{
            $path = 'include/SugarObjects/implements/' . $template . '/vardefs.php';
            if(file_exists($path)){
                require($path);
                $templates[$template] = $vardefs;
            }
        }
    }

真的在等待很棒的回应。

1 个答案:

答案 0 :(得分:0)

在路径custom/include/SugarObjects/VardefManager.php创建一个名为VardefManager.php的文件,并在该文件中包含您的邮件文件include/SugarObjects/VardefManager.php

在这里,您将创建一个具有相同的类,并创建一个名为

的函数
static function addTemplate

在主文件中传递相同的参数。并使用您的自定义代码覆盖此处的方法(因为您想在其中添加一些代码行)。

这将是升级安全的,并且对您来说是可行的。

相关问题