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

namespace Kufer\KuferTools\Veranstalter\KursUebersicht\KursDetails\Feedback;

class SendFeedbackUseCase extends \Kufer\KuferTools\Basis\KursDetails\Feedback\SendFeedbackUseCase
{
  public function hasAccess($pToolSectionId = null)
  {
    if (!parent::hasAccess()) {
      return false;
    } elseif (!$this->isRechtAllowed('632.0.3')) {
      return false;
    }

    return true;
  }

  public static function getToolSectionId()
  {
    return 632;
  }

  public static function getToolId()
  {
    return \ToolsAPI::TOOL_KURSUEBERSICHT_VA;
  }

  protected function getActionLink(): string
  {
    return 'kursdetails&knr=' . $this->getKursnummer();
  }

  protected function getKursnummer()
  {
    return $this->request->knr;
  }

  protected function getPerson(): \Personn
  {
    return $this->session->getCurrentWebToolsPerson();
  }
}

class SendFeedbackRequest extends \Kufer\KuferTools\Basis\KursDetails\Feedback\SendFeedbackRequest
{
  public $knr;
}