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

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

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

  protected function getJSDeclarations()
  {
    $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()
  {
    $jsArray = parent::getJsFilesSrcAryWeitere();

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

    return $jsArray;
  }
}