#*
 * Aipo is a groupware program developed by Aimluck,Inc.
 * Copyright (C) 2004-2008 Aimluck,Inc.
 * http://aipostyle.com/
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *#
## ---------------------------------------------------------------------------
#set ($indicator_id = "indicator-dlg-")
#if($mode=="new_form")
#set ($action_str = "追加する")
#set ($event_submit = "eventSubmit_doWebmail_mailaccount_insert")
#set ($subtitle = 'メールアカウント追加')
#else
#set ($action_str = "更新する")
#set ($subtitle = 'メールアカウント編集')
#set ($event_submit = "eventSubmit_doWebmail_mailaccount_update")
#end
##----------------------------------------------------------------------------------
#ALdialogheaderCloseJS($subtitle "aipo.webmail.hideDialogAdmin()")
#ALerrmsg($errmsgs)
<div id="messageDiv"></div>
#ALajaxIndicator("$indicator_id" "$!portlet.ID" "")
#ALajaxscreenformheader("webmailForm" $jslink $portlet "WebMailAdminFormJSONScreen" "aimluck.io.submit(this,'$indicator_id','$!portlet.ID',aipo.webmail.onReceiveMessageAdmin)")
#if($mode=="new_form")
<input type="hidden" name="mode" value="insert" />
#else
<input type="hidden" name="mode" value="update" />
#end
#ALtableheaderWide()
#ALtdcaptionAtt("#ALrequired($!result.getFieldName('account_name'))" "style='width:210px;'")
#ALtditem("#ALtextfield('account_name' $!result.AccountName '60%' 20 'active')")
#ALtdcaptionAtt("#ALrequired($!result.getFieldName('smtpserver_name'))" "style='width:210px;'")
#ALtditem("#ALtextfield('smtpserver_name' $!result.SmtpserverName '60%' 50 'disabled')#ALcaution('（半角英数字）')")
#ALtdcaptionAtt("#ALrequired($!result.getFieldName('pop3server_name'))" "style='width:210px;'")
#ALtditem("#ALtextfield('pop3server_name' $!result.Pop3serverName '60%' 50 'disabled')#ALcaution('（半角英数字）')")
#ALtdcaptionAtt("#ALrequired($!result.getFieldName('pop3user_name'))" "style='width:210px;'")
#ALtditem("#ALtextfield('pop3user_name' $!result.Pop3userName '60%' 50 'disabled')#ALcaution('（半角英数字）')")
#ALtdcaptionAtt("#ALrequired($!result.getFieldName('pop3_password'))" "style='width:210px;'")
#ALtditemheader()
<input class="text" name="pop3_password" value="$!result.Pop3Password" type="password" size="20" maxlength="50" >#ALcaution('（半角英数字）')
#ALtditemfooter()
#ALtdcaptionAtt("#ALrequired($!result.getFieldName('mail_user_name'))" "style='width:210px;'")
#ALtditem("#ALtextfield('mail_user_name' $!result.MailUserName '60%' 50 'active')")
#ALtdcaptionAtt("#ALrequired($!result.getFieldName('mail_address'))" "style='width:210px;'")
#ALtditem("#ALtextfield('mail_address' $!result.MailAddress '60%' 50 'disabled')#ALcaution('（半角英数字）')")
#ALtdcaptionAtt("#ALrequired($!result.getFieldName('smtp_port'))" "style='width:210px;'")
#ALtditem("#ALtextfield('smtp_port' $!result.SmtpPort '60%' 5 'disabled')#ALcaution('（半角数字）')")
#ALtdcaptionAtt("#ALrequired($!result.getFieldName('pop3_port'))" "style='width:210px;'")
#ALtditem("#ALtextfield('pop3_port' $!result.Pop3Port '60%' 5 'disabled')#ALcaution('（半角数字）')")
#ALtdcaptionAtt("#ALrequired($!result.getFieldName('auth_send_flg'))" "style='width:210px;'")
#ALtditemheader()
<input name="auth_send_flg" type="radio" value="0" id="$!{portlet.ID}auth_send_id0" #if ($!result.AuthSendFlg.toString() == "0") checked="checked" #end onclick="aipo.webmail.switchAuthSend(this)" />
<label for="$!{portlet.ID}auth_send_id0">認証なし</label>
<input name="auth_send_flg" type="radio" value="1" id="$!{portlet.ID}auth_send_id1" #if ($!result.AuthSendFlg.toString() == "1") checked="checked" #end onclick="aipo.webmail.switchAuthSend(this)" />
<label for="$!{portlet.ID}auth_send_id1">POP before SMTP</label>
<input name="auth_send_flg" type="radio" value="2" id="$!{portlet.ID}auth_send_id2" #if ($!result.AuthSendFlg.toString() == "2") checked="checked" #end onclick="aipo.webmail.switchAuthSend(this)" />
<label for="$!{portlet.ID}auth_send_id2">SMTP認証</label>
<span id="smtp_auth_field" style="display:#if (! ($!result.AuthSendFlg.toString() == "2"))none#end">
<div class="spaceTop">
<h3>SMTP認証情報</h3>
<div style="padding:3px;width:70px;float:left;">ユーザー</div>#ALtextfield('auth_send_user_id' $!{result.AuthSendUserId} '30%' 50 'disabled')#ALcaution('（半角英数字）')<br />
<div style="padding:3px;width:70px;float:left;">パスワード</div>#ALpasswdfield('auth_send_user_password' $!{result.AuthSendUserPasswd} '30%' 50 'disabled')#ALcaution('（半角英数字）')
</div>
</span> 
#ALtditemfooter()
#ALtablefooter()
#ALbuttonheader()
#ALsubmit($event_submit $action_str)<input name="ajaxbuttonClose" class="button" type="button" value="　閉じる　" onclick="aipo.webmail.hideDialogAdmin();" />
#ALbuttonfooter()
#ALformfooter()
#ALdialogfooter()
