<?xml version="1.0" encoding="UTF-8"?> <!-- $Author: ouyangzhaochang2663 $ $Date: 2010/11/15 07:47:58 $ $Revision: 1.4 $ $Purpose: 邮件服务器设置 --> <a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true"> <a:init-procedure/> <a:view> <a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/> <script type="text/javascript"><![CDATA[ function queryMailServer(){ $('sys_mail_server_result_ds').query(); } function resetMailServer(){ $('sys_mail_server_query_ds').reset(); } function mailUsernameEdit(record, name){ if(record.get('auth_login_flag') == 'Y'){ return 'mail_username_grid_tf'; }else{ return ''; } } function mailPasswordEdit(record, name){ if(record.get('auth_login_flag') == 'Y'){ return 'password_grid_password'; }else{ return ''; } } function onUpdate(ds,record,name,value,oldValue){ if(name == 'auth_login_flag'){ var rq = (value == 'Y'); record.getMeta().getField('mail_username').setRequired(rq); record.getMeta().getField('mail_password').setRequired(rq); if(!rq){ record.set('mail_username',''); record.set('mail_password',''); } } } function onAdd(ds,record){ record.getMeta().getField('mail_username').setRequired(true); record.getMeta().getField('mail_password').setRequired(true); } function setPassword(value, record, name){ var passwd =''; if(typeof(record.get('mail_password')) != 'undefined' ){ for(var i=0; i<value.length ; i++){ passwd = passwd + '●'; } return passwd; } } function emailValidator(record, name, value){ var reg = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/; if (!reg.test(value)){ return '${l:THE_ADDRESS_YOU_SENT_IS_NOT_CORRECT}'; } return true; } /*默认缺省值只能为一*/ function clickFunction(checkBox,checked){ var records=$('sys_mail_server_result_ds').getAll(); for(var i=0;i<records.length;i++){ records[i].set('default_flag','N'); } checkBox.record.set('default_flag','Y'); } function sys_1030_grid_add(){ $('sys_mail_server_grid').showEditorByRecord($('sys_mail_server_result_ds').create()); } function sys_1030_grid_clear(){ $('sys_mail_server_grid').clear(); } function sys_1030_grid_remove(){ $('sys_mail_server_grid').remove(); } function sys_1030_grid_submit() { var result_ds = $('sys_mail_server_result_ds'); if (result_ds.validate()) { result_ds.submit(); } } function sys_1030_next(){ history.go(1); } function sys_1030_back(){ history.go(-1); } function sys_1030_quit(){ location.href = $('sys_service_welcome_link').getUrl(); parent.shMenu('show'); } ]]></script> <a:dataSets> <a:dataSet id="sys_mail_server_query_ds" autoCreate="true" model="sys.SYS1030.sys_mail_server"/> <a:dataSet id="sys_mail_server_result_ds" autoQuery="true" fetchAll="false" model="sys.SYS1030.sys_mail_server" queryDataSet="sys_mail_server_query_ds" selectable="true"> <a:fields> <a:field name="mail_address" required="true"/> <a:field name="mail_protocol" required="true"/> <a:field name="mail_smtp_host" required="true"/> <a:field name="auth_login_flag" checkedValue="Y" defaultValue="Y" required="true" uncheckedValue="N"/> <a:field name="mail_port_number" required="true"/> <a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/> <a:field name="default_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/> <a:field name="mail_address" validator="emailValidator"/> <a:field name="charset" defaultValue="UTF-8"/> </a:fields> <a:events> <a:event name="update" handler="onUpdate"/> <a:event name="add" handler="onAdd"/> </a:events> </a:dataSet> </a:dataSets> <a:screenBody> <a:screenTopToolbar> <a:screenTitle/> <a:gridButton click="sys_1030_back" text="HLS.BACK"/> <a:gridButton click="sys_1030_next" text="HLS.FORWARD"/> <a:gridButton click="sys_1030_quit" text="HLS.EXIT"/> <a:gridButton click="sys_1030_grid_add" text="HLS.NEW"/> <a:gridButton click="sys_1030_grid_clear" text="HLS.CLEAR"/> <a:gridButton click="sys_1030_grid_remove" text="HLS.REMOVE"/> <a:gridButton click="sys_1030_grid_submit" text="HLS.SAVE"/> <a:gridButton click="queryMailServer" text="HLS.QUERY"/> </a:screenTopToolbar> <a:form column="3" title="SYS_MAIL_SERVER.MAIL_SERVER_QUERY"> <a:textField name="mail_smtp_host" bindTarget="sys_mail_server_query_ds"> <a:events> <a:event name="enterdown" handler="queryMailServer"/> </a:events> </a:textField> <a:textField name="mail_address" bindTarget="sys_mail_server_query_ds"> <a:events> <a:event name="enterdown" handler="queryMailServer"/> </a:events> </a:textField> <a:textField name="mail_username" bindTarget="sys_mail_server_query_ds"> <a:events> <a:event name="enterdown" handler="queryMailServer"/> </a:events> </a:textField> </a:form> <a:grid id="sys_mail_server_grid" bindTarget="sys_mail_server_result_ds" marginHeight="180" marginWidth="30" navBar="true"> <a:columns> <a:column name="mail_smtp_host" editor="text_grid_tf" width="150"/> <a:column name="mail_protocol" editor="text_grid_tf" width="60"/> <a:column name="mail_port_number" align="right" editor="mail_port_number_grid_numberField" width="60"/> <a:column name="default_flag" align="center" editor="checkbox_grid_ck" width="40"/> <a:column name="enabled_flag" editor="checkbox_grid_ckb" width="40"/> <a:column name="mail_address" editor="text_grid_tf" width="150"/> <a:column name="auth_login_flag" editor="checkbox_grid_ckb" width="80"/> <a:column name="mail_username" editorFunction="mailUsernameEdit"/> <a:column name="mail_password" editorFunction="mailPasswordEdit" renderer="setPassword"/> <!-- <a:column name="display_name" editor="text_grid_tf"/> <a:column name="reply_to" editor="text_grid_tf" width="150"/> <a:column name="mail_signature" editor="text_grid_tf"/> --> <a:column name="charset" editor="text_grid_tf" prompt="字符集"/> <a:column name="attch_directory" editor="text_grid_tf" prompt="附件目录" width="150"/> </a:columns> <a:editors> <a:textField id="text_grid_tf"/> <a:numberField id="mail_port_number_grid_numberField" allowDecimals="false" allowNegative="false"/> <a:checkBox id="checkbox_grid_ckb"/> <a:checkBox id="checkbox_grid_ck"> <a:events> <a:event name="click" handler="clickFunction"/> </a:events> </a:checkBox> <a:passWord id="password_grid_password"/> <a:textField id="mail_username_grid_tf"/> </a:editors> </a:grid> </a:screenBody> </a:view> </a:screen>