#*
 * 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($tabs = [["ユーザー一覧", "",""]])
#set ($indicator_id = "indicator-list-")

#macro(ALajaxbuttonCheckboxEnable $name $url $indicator_id $portlet_id $rt)
<input name="ajaxbuttonCheckboxEnable" class="button" type="button" value="$name" onclick="aimluck.io.ajaxCheckboxEnableSubmit(this, '$!utils.escapeXML($url)', '$indicator_id', '$portlet_id', $rt);" />
#end
#macro(ALajaxbuttonCheckboxDisable $name $url $indicator_id $portlet_id $rt)
<input name="ajaxbuttonCheckboxDisable" class="button" type="button" value="$name" onclick="aimluck.io.ajaxCheckboxDisableSubmit(this, '$!utils.escapeXML($url)', '$indicator_id', '$portlet_id', $rt);" />
#end
## ---------------------------------------------------------------------------
#ALtabheader($tabs "")
#ALspacebothheader()
#ALajaxIndicator("${indicator_id}" "$!{portlet.ID}" "")
#ALajaxlistformheader('ユーザー')
#ALtableheaderSimpleWide()
#ALtdcaption('部署')
#ALtditemheader()
<select onchange="aipo.viewPage(this.options[this.selectedIndex].value, '$!portlet.ID')">
<option value="$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","AccountUserListScreen").addQueryData("filter","").addQueryData("filtertype","post"))">（全体）</option>
#foreach( $record in $result.PostMap )
<option value="$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","AccountUserListScreen").addQueryData("filter",$!record.PostId).addQueryData("filtertype","post"))" #if ($!result.CurrentFilter && $!result.CurrentFilter == $!record.PostId.toString()) selected="selected" #end>$!record.PostName</option>
#end
</select>
#ALtditemfooter()
#ALtablefooter()
#if($result.List.size() == 0)
<div class="message">指定された条件に該当するユーザーはありません。</div>
#else
#ALajaxpageview('AccountUserListScreen' $result)
#ALtableheaderWide()
<tr>
#ALtdheadThin("#ALswitchCheckbox()")
#ALtdheadThin("有効/無効")
#ALtdheadThin("#ALajaxsort('login_name' 'ログイン名' $result 'AccountUserListScreen')")
#ALtdheadW33("#ALajaxsort('name_kana' '名前' $result 'AccountUserListScreen')")
#ALtdheadW33("部署名")
#ALtdheadW33("役職名")
#ALtdheadThin(' ')
</tr>
#foreach ($record in $result.List)
#set($disabled_flg = $!record.Disabled)
<tr>
#ALtdcellAtt("<input name='check$!record.UserName' type='checkbox' value='$!record.UserName'/>" 'align="center"')
#if("$disabled_flg" == "N")
#ALtdcell("無効")
#elseif("$disabled_flg" == "F")
#ALtdcell("有効")
#end
#ALtdcellAtt($!record.UserName 'nowrap="nowrap"')
#ALtdcellheader()
<a href="javascript:void(0);" onclick="aipo.common.showDialog('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","AccountUserDetailScreen").addQueryData("entityid",$record.UserName))');">$!record.Name</a>
#ALtdcellfooter()
#ALtdcellheader()
#set($pcount = 0)
#foreach($postname in $!record.PostNameList)
#if($pcount != 0)、&nbsp;#end
$!postname
#set($pcount = $pcount + 1)
#end
#ALtdcellfooter()
#ALtdcellAtt($!record.PositionName '')
#ALtdcellAtt("#ALajaxbuttonLinkCallback('編集' $!jslink.getPortletById($!portlet.ID).addQueryData('template','AccountUserFormScreen').addQueryData('entityid', $!record.UserName) 'images/icon/icon_edit.gif' '$!portlet.ID' 'aipo.account_user.onLoadUserDialog')" 'nowrap="nowrap"')
</tr>
#end
#ALtablefooter()
#ALbuttonheaderRight()
選択したユーザーを 
#ALajaxbuttonCheckboxDelete('削除する' "$!jslink.getPortletById($!portlet.ID).addQueryData('template','AccountUserFormJSONScreen').addQueryData('mode','multi_delete')" "${indicator_id}" "$!portlet.ID" "aipo.account_user.onReceiveMessage")
#ALajaxbuttonCheckboxEnable('有効にする' "$!jslink.getPortletById($!portlet.ID).addQueryData('template','AccountUserFormJSONScreen').addQueryData('mode','multi_enable')" "${indicator_id}" "$!portlet.ID" "aipo.account_user.onReceiveMessage")
#ALajaxbuttonCheckboxDisable('無効にする' "$!jslink.getPortletById($!portlet.ID).addQueryData('template','AccountUserFormJSONScreen').addQueryData('mode','multi_disable')" "${indicator_id}" "$!portlet.ID" "aipo.account_user.onReceiveMessage")
#ALbuttonfooterRight()
#ALajaxpageviewFooter('AccountUserListScreen' $result)
#end
#ALformfooter()
#ALspacebothfooter()
#ALajaxtabfooter()
