#*
 * Aipo is a groupware program developed by Aimluck,Inc.
 * Copyright (C) 2004-2010 Aimluck,Inc.
 * http://aipostyle.com/
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *#

## ---------------------------------------------------------------------------
#set ($DefTypeCompany = $!result.TypeCompany.toString())
#set ($subtitle = "アドレス帳")
#set($internalScreenlink = "$jslink.getPortletById($!portlet.ID).addPathInfo('template','UserEmailLiteJSONScreen')")
#set($externalScreenlink = "$jslink.getPortletById($!portlet.ID).addPathInfo('template','AddressBookUserEmailLiteJSONScreen')")
## ---------------------------------------------------------------------------
#ALaddressbookDialogheader($subtitle)
<div class="spaceLeft">メールアドレスを選択してください。<br>Windows では 『Ctrl キー + マウスクリック』、Macintosh では 『コマンドキー+マウスクリック』 で複数選択ができます。</div>
#ALajaxdetailformheader("webmailAddressbookForm")
#ALtableheaderWide()
<tr>
<td width="40%" rowspan="3" class="item" valign="top">
<div style="width: 270px;">
<input name="type_company" type="radio" value="1" id="corpId$!{portlet.ID}" #if($DefTypeCompany == "1") checked="checked" #end onclick="aipo.webmail.switchTypeCompany(this)">
<label for="corpId$!{portlet.ID}">社内アドレス</label>
<input name="type_company" type="radio" value="0" id="syagaiId$!{portlet.ID}" #if($DefTypeCompany == "0") checked="checked" #end onclick="aipo.webmail.switchTypeCompany(this)">
<label for="syagaiId$!{portlet.ID}">社外アドレス</label>
<br>
<div id="Block_Internal_Group" #if($DefTypeCompany == "0") style="display:none;" #end>
グループ&nbsp;<select name="currentInternalGroupName" id="currentInternalGroupName" style="width: 80%" onchange="aipo.webmail.changeInternalGroup('$internalScreenlink', this.options[this.selectedIndex].value)">
<option value="LoginUser" #if ($!result.CurrentInternalGroupName.toString()== "all") selected="selected" #end>（全体）</option>
#foreach( $record in $!result.InternalGroupList )
<option value="$!record.Name" #if ($!result.CurrentInternalGroupName.toString()== $!record.Name.toString()) selected="selected" #end>$!record.AliasName</option>
#end
#if(($result.InternalGroupList.size() > 0) && ($result.PostMap.size() > 0))
<option value="$!record.Name" #if ($!result.CurrentInternalGroupName.toString() == $!record.Name.toString()) selected="selected" #end>----------</option>
#end
#foreach( $record in $!result.PostMap )
<option value="$!record.GroupName" #if ($!result.CurrentInternalGroupName.toString() == $!record.GroupName.toString()) selected="selected" #end>$!record.PostName</option>
#end
</select>
</div>
<div id="userDiv" #if($DefTypeCompany == "0") style="display:none;" #end></div>
<div id="Block_External_Group" #if($DefTypeCompany == "1") style="display:none;" #end>
グループ&nbsp;<select name="currentExternalGroupName" id="currentExternalGroupName" style="width: 80%" onchange="aipo.webmail.changeExternalGroup('$externalScreenlink', this.options[this.selectedIndex].value)">
<option value="" #if ($!result.CurrentExternalGroupName.toString()== "") selected="selected" #end>（全体）</option>
#foreach( $record in $!result.ExternalGroupList )
<option value="$!record.GroupId" #if ($!result.CurrentExternalGroupName.toString() == $!record.GroupId.toString()) selected="selected" #end>$!record.Name</option>
#end
</select>
</div>
<div id="addrDiv" #if($DefTypeCompany == "1") style="display:none;" #end></div>
#ALbutton('add_to' '宛先に追加' "aipo.webmail.exAddMember(this.form, this.form.detail_to_recipients, '${portlet.ID}')")
#ALbutton('add_cc' 'CCに追加' "aipo.webmail.exAddMember(this.form, this.form.detail_cc_recipients, '${portlet.ID}')")
#ALbutton('add_bcc' 'BCCに追加' "aipo.webmail.exAddMember(this.form, this.form.detail_bcc_recipients, '${portlet.ID}')")
</div>
</td>
<td class="caption">宛先</td>
#ALtditemheader()
<select name="detail_to_recipients" id="detail_to_recipients" size="3" multiple="multiple" style="width: 230px;">
#foreach( $record in $!result.ToRecipientList )
<option value="$record.toString()">$record.toString()</option>
#end
</select>
<div class="alignright">選択したアドレスを#ALbutton('del_to' '削除する' 'aimluck.io.removeOptions(this.form.detail_to_recipients)')</div>
#ALtditemfooter()
<td  class="caption">CC</td>
#ALtditemheader()
<select name="detail_cc_recipients" id="detail_cc_recipients" size="3" multiple="multiple" style="width: 230px;">
#foreach( $record in $!result.CcRecipientList )
<option value="$record.toString()">$record.toString()</option>
#end
</select>
<div class="alignright">選択したアドレスを#ALbutton('del_cc' '削除する' 'aimluck.io.removeOptions(this.form.detail_cc_recipients)')</div>
#ALtditemfooter()
<td  class="caption">BCC</td>
#ALtditemheader()
<select name="detail_bcc_recipients" id="detail_bcc_recipients" size="3" multiple="multiple" style="width: 230px;">
#foreach( $record in $!result.BccRecipientList )
<option value="$record.toString()">$record.toString()</option>
#end
</select>
<div class="alignright">選択したアドレスを#ALbutton('del_bcc' '削除する' 'aimluck.io.removeOptions(this.form.detail_bcc_recipients)')</div>
#ALtditemfooter()
</tr>
#ALtablefooter()
#ALbuttonheader()
#ALbutton('addAddresses' '決定する' 'aipo.webmail.insertData()')
<input name="ajaxbuttonClose" class="button" type="button" value="　閉じる　" onclick="dijit.byId('addressbookDialog').hide();" />
#ALbuttonfooter()
<input type="hidden" id="urlUserlist$!portlet.ID" name="urlUserlist$!portlet.ID" value="$internalScreenlink" />
<input type="hidden" id="urlAddrlist$!portlet.ID" name="urlAddrlist$!portlet.ID" value="$externalScreenlink" />
#ALformfooter()
#ALaddressbookDialogfooter()
