#*
 * 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($link = "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doWebmail_pageview','1')")
#if($!result.currentTab == "receive")
#set($tabname = "受信")
#set ($unreadNum = $result.getUnReadMailSumByFolderId($result.FolderId))
#if ($unreadNum > 0)
#set($pagetitle = "${tabname}トレイ - ${result.SelectedFolder.FolderName}(${unreadNum})")
#else
#set($pagetitle = "${tabname}トレイ - ${result.SelectedFolder.FolderName}")
#end
#set($linklist = [["アカウント一覧へ", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doWebmail_accountlist-max','1')"],["送信トレイへ", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doWebmail_show_sent_mails','1')"],["メール作成", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doWebmail_create_mail','1')"]])
#else
#set($tabname = "送信")
#set($pagetitle = "${tabname}トレイ")
#set($linklist = [["アカウント一覧へ", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doWebmail_accountlist-max','1')"],["受信トレイへ", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doWebmail_receive_mails','1')"],["メール作成", "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doWebmail_create_mail','1')"]])
#end
#set ($StatStr = $!{result.StatStr})
## ---------------------------------------------------------------------------
#ALcell_pagetitle_iphone($career $pagetitle)
#ALcell_linklist_iphone($career $linklist)
#ALcell_contents_header($career)
<p class="center">$!{result.Error}</p>
#if ($result.List.size() == 0)
<p class="center">${tabname}メールはありません。</p>
#else

#if($StatStr && !($StatStr == ''))
${StatStr}
#end
#if($!result.PagesNum > 1)
#ALcell_pageview($career $link $result)
#end
#ALcell_radius_header($career)
#foreach ($record in $result.List)
#if(($!record.Subject) && ($!record.getSubject().toString() != ""))
#set($MailSubject = $!record.Subject)
#elseif($!record.Subject)
#set($MailSubject = "無題")
#end
#ALcell_li_header($career)
<a href="$!jslink.getPortletById($!portlet.getID()).addQueryData('eventSubmit_doWebmail_show_mail','1').addQueryData('entityid', $!record.MailId).addQueryData('tab', $!result.currentTab)">$MailSubject<br /><small>
$!record.Person&nbsp;$!{record.Date.Month}/$!{record.Date.Day}/ $!{record.Date.Hour}:$!{record.Date.Minute}</small></a>
#ALcell_li_footer($career)
#end
#ALcell_radius_footer($career)
#if($result.PagesNum > 1)
#ALcell_pageview($career $link $result)
#end
#end
#ALcell_contents_footer($career)
#if($!result.currentTab == "receive")
<ul class="submenu">
<li>フォルダ移動:</li>
#foreach($record in $!result.FolderList)
#set ($unreadNum = $result.getUnReadMailSumByFolderId($record.FolderId))
#if($result.FolderId != $record.FolderId)
<li>
#if ($unreadNum > 0)
<a class="btn" href="$!jslink.getPortletById($!portlet.getID()).addQueryData('eventSubmit_doWebmail_list','1').addQueryData("accountid", "$!result.AccountId").addQueryData("folderid" ,"$!record.FolderId")">${record.FolderName}(${unreadNum})</a>
#else
<a class="btn" href="$!jslink.getPortletById($!portlet.getID()).addQueryData('eventSubmit_doWebmail_list','1').addQueryData("accountid", "$!result.AccountId").addQueryData("folderid" ,"$!record.FolderId")">${record.FolderName}</a>
#end
</li>
#end
#end
</ul>
#end
#ALcell_linklist_iphone($career $linklist)
