<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */

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


class PrintStundenplanGrafikController extends \Kufer\KuferTools\Basis\PdfListen\PrintPdfListen\PrintPdfListenBySettingsController
{
  protected function getUseCase(): \Kufer\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();
  }
}