#*
 * 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 ($newUrl1 = $!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","AddressBookFormScreen").addQueryData("entityid","new")))
#set ($newUrl2 = $!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","AddressBookGroupFormScreen").addQueryData("entityid","new")))
#set ($newUrl3 = $!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","AddressBookCompanyFormScreen").addQueryData("entityid","new")))
#set ($submenulist = [["アドレスを追加する","javascript:aipo.common.showDialog('$newUrl1','$!portlet.ID',aipo.addressbook.onLoadAddressbookDialog);","images/icon/icon_add.gif"],["会社情報を追加する","javascript:aipo.common.showDialog('$newUrl3','$!portlet.ID',aipo.addressbook.onLoadAddressbookCompanyDialog);","images/icon/icon_add.gif"],["グループを追加する","javascript:aipo.common.showDialog('$newUrl2','$!portlet.ID',aipo.addressbook.onLoadAddressbookGroupDialog);","images/icon/icon_add.gif"]])
#set ($indicator_id = "indicator-list-")
## ---------------------------------------------------------------------------
#ALsubmenubar($submenulist "")

#macro(ALajaxsortaddressbook $key $name $result $screen)
#if($!result.CurrentSort && $!result.CurrentSort == "$key" && $!result.CurrentSortType && $!result.CurrentSortType == "asc")#set($sorttype ="desc")#set($sortHead ="headDown") #else #set($sorttype ="asc")#set($sortHead ="headUp")#end
<a#if($!result.CurrentSort && $!result.CurrentSort == "$key") class="$sortHead"#end href="javascript:void(0);" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template",$screen).addQueryData("start","$result.CurrentPage").addQueryData("sort","$key").addQueryData("sorttype","$sorttype").addQueryData("idx","$result.Index"))', '$!portlet.ID');">$name</a>
#end
 
#if($result.SearchWord && $result.SearchWord.toString() != "")
#set($link = "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doAddressbook_company_search_list','1')")
#else
#set($link = "$!jslink.getPortletById($!portlet.ID).addQueryData('eventSubmit_doAddressbook_company_list','1')")
#end
#set($tabs = [["会社情報", "", ""]])

<form name="addressbook$!portlet.ID" id="addressbook$!portlet.ID" action="#" method="post" onsubmit="aipo.addressbook.onSubmitSerchButton(this,'$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData('template','AddressBookCompanyListScreen').addQueryData('mode','ajaxsearch'))','$!portlet.ID','$!result.currentTab'); return false;">
#ALtableheaderSimpleWide()
#ALtdcaption('検索')
#ALtditemheader()
#ALtextfield('sword' "$!result.SearchWord" "120px" 100 'active')
#ALsubmitJS('submit' ' 検索する ' 'setHiddenValue(this)')
<span class="middle">（会社名・部署名・住所・電話番号で検索します）</span>
#ALtditemfooter()
#ALtablefooter()
<input name="mode" type="hidden" value="ajaxsearch" />
</form>
#ALajaxtabheader($tabs "")
#ALspacebothheader()
#ALajaxIndicator("${indicator_id}" "$!{portlet.ID}" "")
<div id="listmessageDiv"></div>
#ALajaxlistformheader('会社情報')
#ALtableheaderSimpleWide()
#ALtdcaption("絞込み条件")
#ALtditemheader()
<div class="spaceTop spaceBottom">
#if($result.SearchWord && $result.SearchWord.toString() != "")
<a href="javascript:void(0);" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData('template','AddressBookCompanyListScreen'))', '$!portlet.ID')">[一覧へ戻る]</a>
#else
<span class="navi">
さらに索引で絞る ⇒
[<a #if($idx.equals("-1") || $idx.equals("")) style="color:darkorange;" #end href="javascript:void(0);" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData('template','AddressBookCompanyListScreen').addQueryData('eventSubmit_doAddressbook_list','1').addQueryData('idx', "-1"))', '$!portlet.ID')"> 全て </a>]
[<a #if($idx.equals("1")) style="color:darkorange;" #end href="javascript:void(0);" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData('template','AddressBookCompanyListScreen').addQueryData('eventSubmit_doAddressbook_list','1').addQueryData('idx', "1"))', '$!portlet.ID')"> あ </a>]
[<a #if($idx.equals("6")) style="color:darkorange;" #end href="javascript:void(0);" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData('template','AddressBookCompanyListScreen').addQueryData('eventSubmit_doAddressbook_list','1').addQueryData('idx', "6"))', '$!portlet.ID')"> か </a>]
[<a #if($idx.equals("11")) style="color:darkorange;" #end href="javascript:void(0);" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData('template','AddressBookCompanyListScreen').addQueryData('eventSubmit_doAddressbook_list','1').addQueryData('idx', "11"))', '$!portlet.ID')"> さ </a>]
[<a #if($idx.equals("16")) style="color:darkorange;" #end href="javascript:void(0);" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData('template','AddressBookCompanyListScreen').addQueryData('eventSubmit_doAddressbook_list','1').addQueryData('idx', "16"))', '$!portlet.ID')"> た </a>]
[<a #if($idx.equals("21")) style="color:darkorange;" #end href="javascript:void(0);" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData('template','AddressBookCompanyListScreen').addQueryData('eventSubmit_doAddressbook_list','1').addQueryData('idx', "21"))', '$!portlet.ID')"> な </a>]
[<a #if($idx.equals("26")) style="color:darkorange;" #end href="javascript:void(0);" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData('template','AddressBookCompanyListScreen').addQueryData('eventSubmit_doAddressbook_list','1').addQueryData('idx', "26"))', '$!portlet.ID')"> は </a>]
[<a #if($idx.equals("31")) style="color:darkorange;" #end href="javascript:void(0);" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData('template','AddressBookCompanyListScreen').addQueryData('eventSubmit_doAddressbook_list','1').addQueryData('idx', "31"))', '$!portlet.ID')"> ま </a>]
[<a #if($idx.equals("36")) style="color:darkorange;" #end href="javascript:void(0);" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData('template','AddressBookCompanyListScreen').addQueryData('eventSubmit_doAddressbook_list','1').addQueryData('idx', "36"))', '$!portlet.ID')"> や </a>]
[<a #if($idx.equals("41")) style="color:darkorange;" #end href="javascript:void(0);" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData('template','AddressBookCompanyListScreen').addQueryData('eventSubmit_doAddressbook_list','1').addQueryData('idx', "41"))', '$!portlet.ID')"> ら </a>]
[<a #if($idx.equals("46")) style="color:darkorange;" #end href="javascript:void(0);" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData('template','AddressBookCompanyListScreen').addQueryData('eventSubmit_doAddressbook_list','1').addQueryData('idx', "46"))', '$!portlet.ID')"> わ </a>]
[<a #if($idx.equals("52")) style="color:darkorange;" #end href="javascript:void(0);" onclick="aipo.viewPage('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData('template','AddressBookCompanyListScreen').addQueryData('eventSubmit_doAddressbook_list','1').addQueryData('idx', "52"))', '$!portlet.ID')"> 英数 </a>]
</span>
#end
</div>
#ALtditemfooter()
#ALtablefooter()
#if($result.List.size() ==0)
#if($result.Index || ($result.SearchWord && $result.SearchWord.toString() != ""))
<div class="message">指定された条件に該当する会社情報はありません。</div>
#else
<div class="message">会社情報を登録しておくことで、アドレスを会社単位で管理することが可能となります。</div>
<div class="message">『会社情報追加』 ボタンを押して、追加してください。 </div>
#end
#else
#ALajaxpageview('AddressBookCompanyListScreen' $result)
##ALformheader('会社名' $jslink $portlet)
#ALtableheaderWide()
<tr>
#ALtdheadThin("#ALswitchCheckbox()")
#ALtdhead("#ALajaxsort('company_name_kana' '会社名' $result 'AddressBookCompanyListScreen')") ##検索結果からきたときはmode=ajaxsearchをいれるように書き換え
#ALtdhead('部署名')
#ALtdhead('住所')
#ALtdhead('電話番号')
#ALtdheadThin(' ')
#ALtdheadThin(' ')
</tr>
#foreach ($record in $result.List)
<tr>
#ALtdcellAtt("<input name='check$!record.CompanyId' type='checkbox' value='$!record.CompanyId' />" 'align="center"')
#ALtdcellheader()
<a href="javascript:void(0);" onclick="aipo.common.showDialog('$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","AddressBookCompanyDetailScreen").addQueryData("entityid",$record.CompanyId))');">$result.getStringCR($!record.CompanyName)</a>
#ALtdcellfooter()
#ALtdcell($result.getStringCR($!record.PostName))
#ALtdcell($result.getStringCR($!record.Address))
#ALtdcell($!record.Telephone)
#if ($!record.getUrl() && $!record.getUrl().toString().length() > 0)
#ALtdcellAtt("<a href='$!record.Url' target='_blank'>HPへ</a>" "nowrap='nowrap'")
#else
#ALtdcell("")
#end
#ALtdcellAtt("#ALajaxbuttonLinkCallback('編集' $!jslink.getPortletById($!portlet.ID).addQueryData('template','AddressBookCompanyFormScreen').addQueryData('eventSubmit_doAddressbook_company_form','1').addQueryData('entityid', $!record.CompanyId) 'images/icon/icon_edit.gif' $!portlet.ID 'aipo.addressbook.onLoadAddressbookCompanyDialog')" 'nowrap')
#end
</tr>
#ALtablefooter()
#ALbuttonheaderRight()
選択した 会社情報 を #ALajaxbuttonCheckboxDelete('削除する' "$!jslink.getPortletById($!portlet.ID).addQueryData('template','AddressBookCompanyFormJSONScreen').addQueryData('mode','multi_delete')" "${indicator_id}" "$!portlet.ID" "aipo.addressbook.onListReceiveMessage")
#ALbuttonfooterRight()
#ALajaxpageviewFooter('AddressBookCompanyListScreen' $result)
#end
#ALformfooter()
#ALspacebothfooter()
#ALajaxtabfooter()
