<?php
/**
 * @copyright (c) Kufer Software GmbH, Oderstraße 7, D-84453 Mühldorf
 */

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

class SendeFeedbackFragenUseCase extends \Kufer\Web\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\Web\KuferTools\Utils\DatamodulHelper\Belegungen\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\Web\KuferTools\Basis\Kursdetails\Detailsreiter\FeedbackBogen\SendeFeedbackFragenRequest
{
  public $belegId;
}