SugarCRM 主表字段自定义下拉菜单

(1)创建: \include\language\zh_cn.lang.php 文件中加入下拉列表项的内容
$app_list_strings['account_type_dom1'] = array (
'' => '',
'Analyst' => '分析者',
'Manufacturer' => '生产厂商',
'Other' => '其它',
);
说明:$app_list_strings['种类ABC'] 种类ABC为下拉菜单的名
"=>" 表示默认为-- 无 -- 如果没有此项则默认为第一个项目
如果有两个 '' => '', '' => '', 则表在列表中也有个 -- 无 -- 可供选择

(2)调用
模板页(html)
<select name="account_type">{OPTIONS_ACCOUNT_TYPE}</select></slot></td> <!-- 正常情况下此段代码应在页面布局中自动完成 -->
EditView.php
$xtpl->assign("OPTIONS_ACCOUNT_TYPE", get_select_options_with_id($app_list_strings['account_type_dom1'], $focus->account_type));
说明: $app_list_strings 为全局的下拉列表数组
$app_list_strings['account_type_dom1'] 为下拉列表项目集合的名称
$focus->account_type 设置是为了下拉列表赋值
account_type 为
<select name="message_type"> 中的name值
DetailView.php
$xtpl->assign("Region", $app_list_strings['Region_options'][$focus->Region]);
原文地址:https://www.cnblogs.com/hailexuexi/p/1953225.html