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

namespace Kufer\Web\KuferTools\Hausmeister\Raumbelegung\Stundenplan\Ausgabe;


class PrintStundenplanGrafikController extends \Kufer\Web\KuferTools\Basis\PdfListen\PrintPdfListen\PrintPdfListenBySettingsController
{
  protected function getUseCase(): \Kufer\Web\KuferTools\Basis\UseCase\UseCase
  {
    return new PrintStundenplanGrafikUseCase(
      $this->getRequestObj()
    );
  }

  protected function getToolId()
  {
    return PrintStundenplanGrafikUseCase::getToolId();
  }

  protected function getRequestObj()
  {
    $requestObj = parent::getRequestObj();
    $requestObj->schablonId = \PostOperations::getVarValue('schablone');

    return $requestObj;
  }

  protected function getId()
  {
    return \PostOperations::getVarValue('schablone');
  }

  protected function _getPostSettings()
  {
    $schablonenId = \PostOperations::getVarValue('schablone');
    
    $settingsObj = new \webtools\drucklisten\DruckGrafikSettings();
    $raumIds = ''; 
    $listObj = \DruckListeFactory::create($this->listName, 5, $raumIds, '', $schablonenId);
    $settingsObj->loadFromPOST($listObj);


    $settingsObj->kurstage->von = \PostOperations::getVarValue('kt_von');
    $settingsObj->kurstage->bis = \PostOperations::getVarValue('kt_bis');

    return $settingsObj;
  }

  protected function _getDruckSettingsObject()
  {
    return new \webtools\drucklisten\DruckGrafikSettings();
  }
}