Hak*_*iam 11
您可以通过修改"modules/Users/login.tpl"来创建自定义登录页面
可以通过Modulebuilder或手动创建自定义模块.
手动创建模块时,使用正确的名称非常重要.最简单的方法是文件夹,表和模块的多个名称以及类的单数名称.
手动步骤:
您需要一个模块中的文件夹/命名为您的模块(即CAccounts)
在此文件夹中,您需要一个名为类(即CAccount.php)的文件,其内容类似于内容:
require_once('data/SugarBean.php');
require_once('include/utils.php');
class CAccount extends SugarBean{
var $table_name = 'caccounts';
var $object_name = 'CAccount';
var $module_dir = 'CAccounts';
var $new_schema = true;
var $name;
var $created_by;
var $id;
var $deleted;
var $date_entered;
var $date_modified;
var $modified_user_id;
var $modified_by_name;
function CAccount (){
parent::SugarBean();
}
function get_summary_text(){
return $this->name;
}
function bean_implements($interface)
{
switch($interface)
{
case 'ACL':return true;
}
return false;
}
}
Run Code Online (Sandbox Code Playgroud)
在此文件夹中,您需要一个vardefs.php文件:
$dictionary['CAccount'] = array(
'table'=>'caccounts',
'audited'=>false,
'fields'=>array (
//Your fielddefs here
)
);
require_once('include/SugarObjects/VardefManager.php');
VardefManager::createVardef('CAccounts','CAccount', array('basic'));
Run Code Online (Sandbox Code Playgroud)
对于语言和元数据文件夹,请查看任何其他模块.
接下来是"custom/Extension/application/Ext/Include/CAccounts.include.php"中的文件
$moduleList[] = 'CAccounts';
$beanList['CAccounts'] = 'CAccount';
$beanFiles['CAccount'] = 'modules/CAccounts/CAccount.php';
Run Code Online (Sandbox Code Playgroud)
模块名称的语言文件必须位于"custom/Extension/application/Ext/Language /"中
$app_list_strings['moduleList']['CAccounts'] = 'Custom Accounts';
Run Code Online (Sandbox Code Playgroud)
要在选项卡中显示模块,您需要使用"重建和修复",然后使用管理菜单中的"显示模块和子面板"选项.
对于自定义模块,您不需要"custom /"文件夹结构.如果提供了糖将使用的文件,但通常在自定义模块中不需要它.
有关模块框架的指南可以在sugarcrm支持站点上找到:http: //support.sugarcrm.com/02_Documentation/04_Sugar_Developer/Sugar_Developer_Guide_6.5/03_Module_Framework