<?php
/**
 * @copyright (c) Kufer Software GmbH, Oderstraße 7, D-84453 Mühldorf
 */

namespace Kufer\Web\KuferTools\Basis\Raumplanung\KurstageVorschau;

abstract class KurstageVorschauController extends \Kufer\Web\KuferTools\Basis\Controller\ToolController
{
  protected function getRequestObj()
  {
    $requestObj = new KurstageVorschauRequest();
    $requestObj->knr = \GetOperations::getVarValue('knr');

    $requestObj->anfangsdatum = \PostOperations::getVarValue('anfangsdatum');
    $requestObj->rhythmus = \PostOperations::getVarValue('rhythmus');
    $requestObj->wochentage = \PostOperations::getVarValue('wochentage', array());
    $requestObj->anzahlTermine = \PostOperations::getVarValue('anzahl_termine');
    $requestObj->checkDoppelbelegung = \PostOperations::isDefined('check_doppelbelegung');
    $requestObj->checkSperrzeiten = \PostOperations::isDefined('check_sperrzeiten');

    $requestObj->ktUhrzeitVon = \PostOperations::getVarValue('kt_uhrzeit_von');
    $requestObj->ktUhrzeitBis = \PostOperations::getVarValue('kt_uhrzeit_bis');
    $requestObj->ktPause = \PostOperations::getVarValue('kt_pause');

    $requestObj->ktOrt = \PostOperations::getVarValue('kt_ort');
    $requestObj->ktDnr = \PostOperations::getVarValue('kt_dnr');
    $requestObj->ktBemerkung = \PostOperations::getVarValue('kt_bemerkung');
    $requestObj->ktBestuhlung = \PostOperations::getVarValue('kt_bestuhlung');

    $action = $this->getActionVal();

    return $this->handleXsrf($requestObj, $action, $requestObj->knr);
  }
}