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

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

class SendFeedbackUseCase extends \Kufer\KuferTools\Basis\KursDetails\Feedback\SendFeedbackUseCase
{
  public function __construct($request)
  {
    parent::__construct($request);
  }

  public function hasAccess($pToolSectionId = null)
  {
    if (!parent::hasAccess()) {
      return false;
    } elseif (!$this->isRechtAllowed('377.0.6')) {
      return false;
    }

    return true;
  }

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

  public static function getToolSectionId()
  {
    return 377;
  }

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

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

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

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