/*
 * MosP - Mind Open Source Project         http://www.mosp.jp/
 * Copyright (C) 1987-2009 MIND Co., Ltd.  http://www.e-mind.co.jp/
 * 
 * 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 2
 * 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, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
package jp.mosp.kintai.vo;

public class ScheduleConfirmListVo extends ScheduleMenuVo {

	private static final long serialVersionUID = -3930861402120064453L;

	// URL、CSS
	private static final String RETURN_URL = "/jsp/kintai/scheduleConfirmList.jsp";
	private static final String EXTRA_JS   = "/pub/kintai/js/scheduleConfirmList.js";
	private static final String EXTRA_CSS  = "/pub/kintai/css/scheduleConfirmList.css";

	// 画面サブタイトル
	public final String SUB_TITLE = TTL_SCHEDULE_CONFIRM;

	// フィールド
	private String workTimes;
	private String breakTimes;

	private String presence;
	private String paidHoliday;
	private String particularHoliday;
	private String absence;
	private String sick;
	private String compensationLeave;
	private String transfer;
	private String other;

	private String[][] arySchedule;
	private String[] aryLabel;

	// プルダウンリスト
	public String[][] aryPltYear ;
	public String[][] aryPltMonth;

	/**
	 * コンストラクタ
	 */
	public ScheduleConfirmListVo() {
		super();
		setRetUrl(RETURN_URL);
		addExtraJs(EXTRA_JS);
		setExtraCss(EXTRA_CSS);
		arySchedule = new String[0][0];
		aryLabel = new String[0];
	}

	/**
	 * フィールド設定
	 * @param arySchedule 予定一覧配列
	 * @param aryCompile 月集計データ配列
	 * @param aryLabel 月集計ラベル配列
	 */
	public void setFields(String[][] arySchedule, String[] aryCompile, String[] aryLabel) {
		this.arySchedule 	= escapeArray(arySchedule.clone());
		this.aryLabel 		= escapeArray(aryLabel.clone());
		workTimes			= aryCompile[0];
		breakTimes			= aryCompile[1];
		presence			= aryCompile[2];
		paidHoliday			= aryCompile[3];
		particularHoliday	= aryCompile[4];
		absence				= aryCompile[5];
		sick 				= aryCompile[6];
		compensationLeave	= aryCompile[7];
		transfer			= aryCompile[8];
		other				= aryCompile[9];
	}

	/**
	 * JavaScript設定
	 * @param cls 情報取得クラス
	 * @throws IllegalAccessException
	 */
	@Override
	public String getDirectJs(Class cls) throws IllegalAccessException {
		StringBuffer sb = new StringBuffer();
		sb.append(super.getDirectJs(cls));
		return sb.toString();
	}

	// アクセサメソッド
	public String[][]	getEscArySchedule	() { return arySchedule.clone()		; }
	public String[]		getEscAryLabel		() { return aryLabel.clone()		; }	

	public String getEscWorkTimes		() { return escapeHTML(workTimes		); }
	public String getEscBreakTimes		() { return escapeHTML(breakTimes		); }

	public String getEscPresence			() { return escapeHTML(presence				); }
	public String getEscPaidHoliday			() { return escapeHTML(paidHoliday			); }
	public String getEscParticularHoliday	() { return escapeHTML(particularHoliday	); }
	public String getEscAbsence				() { return escapeHTML(absence				); }
	public String getEscSick				() { return escapeHTML(sick					); }
	public String getEscCompensationLeave	() { return escapeHTML(compensationLeave	); }
	public String getEscTransfer			() { return escapeHTML(transfer				); }
	public String getEscOther				() { return escapeHTML(other				); }

}
