#*
 * 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/>.
 *#

## ---------------------------------------------------------------------------
<script language="JavaScript" type="text/JavaScript">
<!--

function submit2(form) {
  var s_o = form.member_so.options;
  var tmp = '';

  for(i = 0 ; i < s_o.length; i++ ) {
    s_o[i].selected = false;
  }

  if(s_o.length > 0) {
    for(i = 0 ; i < s_o.length-1; i++ ) {
      tmp = tmp + s_o[i].value + ',';
    }
    tmp = tmp + s_o[s_o.length-1].value;
  }
  form.positions.value = tmp;
}

//-->
</script>
#set($link = "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doAccount_list','1')")
##set($toolbars = [["$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doAccount_list','1')", "images/icon/icon_list.gif", "ユーザー一覧"], ["$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doAccount_form','1').addQueryData('entityid', 'new')", "images/icon/icon_add.gif", "ユーザー追加"], ["$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doAccount_change_turn_form','1')", "images/account/account_change_turn.gif", "順番変更"]])
#set($tabs = [["順番変更", "",""]])
##toolbar($toolbars)
##paddingheader(5)
#ALtabheader($tabs "")
##paddingheader(5)
#ALerrmsg($errmsgs)
#if((! $!result.UserList) || $result.UserList.size() == 0)
<div class="message">ユーザーは登録されていません。</div>
#else
<div style="padding:0px 0px 5px 5px"><img src="images/account/account_up_10.gif" align="absmiddle">&nbsp;<img src="images/account/account_up_1.gif" align="absmiddle">&nbsp;<img src="images/account/account_down_1.gif" align="absmiddle">&nbsp;<img src="images/account/account_down_10.gif" align="absmiddle">&nbsp;の各ボタンで、マウスで選択したユーザーの順番を自由に変更できます。<br>
Windows では 『Ctrl キー + マウスクリック』、Macintosh では 『コマンドキー+マウスクリック』 で複数選択ができます。</div>
#ALajaxscreenformheader("accountChangeTurnForm" $jslink $portlet "AccountUserChangeTurnFormJSONScreen" "aimluck.io.submit(this, aipo.account_user.onReceiveMessage)")
<input type="hidden" name="mode" value="update" />
<input type="hidden" name="positions" value="">
#ALtableheaderWide()
#ALtdcaptionAtt("ALrequired(ユーザー一覧)" 'width="150" nowrap')
<td class="item" width="100%">
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>
<td width="23"><table width="100%" border="0">
<tr><td valign="top">
<a href="javascript:doUpOptions10(document.forms[0].member_so)" title="10 ずつ順番を上げる"><img src="images/account/account_up_10.gif" alt="10 ずつ順番を上げる" border="0"></a></td>
</tr>
<tr><td valign="top">
<a href="javascript:doUpOptions(document.forms[0].member_so)" title="1 ずつ順番を上げる"><img src="images/account/account_up_1.gif" alt="1 ずつ順番を上げる" border="0"></a></td>
</tr>
<tr><td height="100%">&nbsp;</td></tr>
<tr>
<td valign="bottom"><a href="javascript:doDownOptions(document.forms[0].member_so)" title="1 ずつ順番を下げる"><img src="images/account/account_down_1.gif" alt="1 ずつ順番を下げる" border="0"></a></td>
</tr>
<tr>
<td valign="bottom"><a href="javascript:doDownOptions10(document.forms[0].member_so)" title="10 ずつ順番を下げる"><img src="images/account/account_down_10.gif" alt="10 ずつ順番を下げる" border="0"></a></td>
</tr>
</table></td>
<td width="100%"><select name="member_so" size="20" multiple="multiple" style="WIDTH: 100%">
#if($!result.UserList.size() <= 0)
<option value=""></option>
#else
#foreach($record in $!result.UserList)
<option value="$!record.Name">$!record.AliasName</option>
#end
#end
</select>
</td>
</tr>
</table>
</td>
<tr>
#ALtdcellAtt("#ALsubmit('eventSubmit_doAccount_change_turn_update' '更新する' 'setHiddenValue(this);submit2(this.form)')#ALsubmit('eventSubmit_doAccount_list' 'キャンセルする' 'setHiddenValue(this)')" )
</tr>
#ALtablefooter()
#ALformfooter()
#end
#ALtabfooter()