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

namespace Kufer\KuferTools\Veranstalter\KursUebersichtDerMitarbeiter\KursUebersicht\Detailsreiter\Feedback;

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

    return true;
  }

  public static function getToolId()
  {
    return 61;
  }

  public static function getToolSectionId()
  {
    return 722;
  }

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

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

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

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