SugarCRM 主表-自定义字段-日期型

  
1.创建字段
\modules\bw_MessageSends\vardefs.php
'send_time' =>array (
'name' => 'send_time',
'type' => 'datetime',
'dbType' => 'datetime',
'vname' => 'LBL_SEND_TIME',
'reportable'=>true,
'len' => 50,
),
2.EditView.html 中调用javaScript
< td class ="dataLabel" >< slot > {MOD.LBL_SEND_TIME} </ slot ></ td >
< td class ="dataField" >< slot >
< input name ='send_time' id ='jscal_fieldSendTime_c'type='text'size='11' maxlength ='10' value ='{SEND_TIME}' >
< img src ='themes/ClassicSugar/images/jscalendar.gif' alt ='Enter Date' id ='jscal_triggerSendTime_c' align ='absmiddle' >
< span class ='dateFormat' > {USER_DATEFORMAT} </ span >
< script type ='text/javascript' > Calendar.setup (
{inputField :
' jscal_fieldSendTime_c ' , ifFormat : ' {CALENDAR_DATEFORMAT} ' , showsTime : false , button : ' jscal_triggerSendTime_c ' , singleClick : true , step : 1 });
addToValidate(
' EditView ' , ' SendTime_c ' , ' date ' , false , ' SendTime_c ' );
</ script >
</ slot >
</ td >
3.赋标签
\modules\bw_MessageSends\language.php
$mod_strings['LBL_SEND_TIME'] = '发送日期';

你可能感兴趣的:(自定义)