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

namespace Kufer\KuferTools\Dozent\KursUebersicht\PdfListen\KurstageArbeitsbericht;

class ShowSettingsKurstageArbeitsberichtUseCase extends \Kufer\KuferTools\Basis\UseCase\ToolUseCase
{
  public function __construct($pRequest)
  {
    parent::__construct($pRequest, new ShowSettingsKurstageArbeitsberichtResponse());
  }

  public static function getToolId()
  {
    return 1;
  }

  public static function getToolSectionId()
  {
    return 334;
  }

  public function hasAccess($pToolSectionId = null)
  {
    if (!parent::hasAccess()) {
      return false;
    }
    if (!\DBWorkBASysSettings::isBFI() || !$this->isRechtAllowed('334.1.3')) { 
      return false;
    }

    return true;
  }

  public function action()
  {
    return $this->getResponse();
  }

  protected function getResponse()
  {
    $this->response->knr = $this->request->knr;

    return $this->response;
  }
}

class ShowSettingsKurstageArbeitsberichtRequest
{
  public $knr;
}

class ShowSettingsKurstageArbeitsberichtResponse extends \Kufer\KuferTools\Basis\UseCase\ToolResponse
{
  public $knr;
}