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

namespace Kufer\Web\KuferTools\Firma\KursUebersicht\KursDetails;

class KursDetailsPresenter extends \Kufer\Web\KuferTools\Basis\Kursdetails\KursDetailsPresenter
{
  protected function getView()
  {
    return new KursDetailsView($this->getViewModel());
  }

  protected function getJSDeclarations(): string
  {
    $result = parent::getJSDeclarations();
    $result .= \JsOperations::getDeclarationInt('KuferTools.BelegId', $this->useCaseResponse->belegId);

    return $result;
  }

  protected function getViewModel()
  {
    $viewModel = parent::getViewModel();
    $viewModel->kurs->belegId = '&belid=' . $this->useCaseResponse->belegId;

    $viewModel->kurs->previousBelegId = $this->useCaseResponse->previousBelegId;
    $viewModel->kurs->nextBelegId = $this->useCaseResponse->nextBelegId;

    return $viewModel;
  }

  
  protected function getJsFilesSrcAryWeitere(): array
  {
    $jsArray = parent::getJsFilesSrcAryWeitere();

    if (\DBWorkBASysSettings::isMDS()) {
      $jsArray[] = $this->getJsFileFromSys('anmeldenMds.js');
    }

    return $jsArray;
  }
}