/*
 * MosP - Mind Open Source Project         http://www.mosp.jp/
 * Copyright (C) 1987-2008 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.payroll.action;

import jp.mosp.common.CommonConst;
import jp.mosp.common.action.MosPMenuArrangeAction;

import jp.mosp.payroll.vo.AttendanceCalculateMenuVo;

public class AttendanceCalculateMenuAction extends MosPMenuArrangeAction {

	// コマンド定数
	//public static final String CMD_SHOW = "P1010";

	/**
	 * コンストラクタ
	 */
	public AttendanceCalculateMenuAction() {
		super();
	}

	/**
	 * アクション
	 */
	public void action() throws Exception {
		// セッション保持情報の除去
		initStoredData();
		// コネクション取得
		getConnection();
		// PAYROLL権限確認
		confirmPayrollAuth();
		// VOの取得
		AttendanceCalculateMenuVo vo = new AttendanceCalculateMenuVo();
		vo.initVo(cfg, msg, cmd, aspUser, user);
		// VO及びフォワード先URLの設定
		setVo(vo);
		setUrl(vo.getRetUrl());
		// 表示ボタンの制御
		cmCompoDto = getMenuComponent(getUserAuthDto(), AUTH_CALCULATE_MENU);
		// デフォルトコードの設定
		if (cmCompoDto == null) {
			if (user.getMospAuthority().equals(CommonConst.AUTHORITY_CALCULATE)) {
				cmCompoDto = getDefaultCompoDto(AUTH_CALCULATE_MENU);
			} else {
				cmCompoDto = getDefaultCompoDto(AUTH_PAYROLL_MENU);
			}
		}
		// 勤怠計算ボタン表示設定
		vo.setFields(getMenuList(getCalcButton(cmCompoDto, false)));
	}

}
