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

namespace Kufer\KuferTools\Teilnehmer\KursUebersicht\Detailsreiter\FeedbackBogen;

class SendeFeedbackFragenUseCase extends \Kufer\KuferTools\Basis\Kursdetails\DetailsReiter\FeedbackBogen\SendeFeedbackFragenUseCase
{
  private $belegHelper;

  public function __construct($pRequest)
  {
    parent::__construct($pRequest);
    
    $user = $this->getUser();
    $this->userNr = $user->tnr;
    
    $this->belegHelper = new \Kufer\KuferTools\Utils\DatamodulHelper\BelegungsHelper\TeilnehmerBelegungen($this->toolSettings, $this->userNr);

    
    $this->doAnonym = $this->toolSettings->erfasseFeedbackBogenAnonym;
  }

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

  public static function getToolSectionId()
  {
    return 335;
  }

  
  protected function createFeedbackCode($pBogenId)
  {
    $tool0Settings = \ToolSettingsAPI::getToolSettings(0);

    
    

    
    

    return \FeedBackAPI::getNewCode(
      $this->request->belegId,
      $pBogenId,
      $this->doAnonym,
      $tool0Settings->direktMaKuerzel,
      $this->shouldOnlyUseWebDatabase() ? \FeedBackAPI::FEEDBACK_DATA_ONLY_WEB : \FeedBackAPI::FEEDBACK_DATA_DEFAULT
    );
  }

  

  protected function getRechteKey()
  {
    
    return $this->getToolSectionId() . '.0.8';
  }

  
  protected function getBogenTyp()
  {
    return 'T';
  }

  
  
  protected function getRequestedId()
  {
    return $this->request->belegId;
  }

  protected function getAllowedIds()
  {
    return $this->belegHelper->getIdsOhneFilter();
  }

  protected function getBackLink()
  {
    return 'index.php?tool_id=' . $this->getToolId() . '&amp;action=kursdetails&amp;belid=' . $this->request->belegId;
  }
} 

class SendeFeedbackFragenRequest extends \Kufer\KuferTools\Basis\Kursdetails\DetailsReiter\FeedbackBogen\SendeFeedbackFragenRequest
{
  public $belegId;
}