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

namespace Kufer\KuferTools\Teilnehmer\KursUebersicht\Detailsreiter\Termine\TerminVerschiebenWunschDialog;

class TerminVerschiebenWunschDialogPresenter extends \Kufer\KuferTools\Basis\Presenter\Presenter
{
  protected function getView()
  {
    return new TerminVerschiebenWunschDialogView($this->getViewModel());
  }

  protected function getViewModel()
  {
    $result = new TerminVerschiebenWunschDialogViewModel();
    $result->vhsname = $this->useCaseResponse->vhsname;
    $result->belegung = $this->useCaseResponse->belegung;
    $result->toolId = $this->useCaseResponse->toolId;
    $result->replacementKurstage = $this->useCaseResponse->replacementKurstage;
    $result->ktId = $this->useCaseResponse->ktId;
    $result->notFutureKurstag = $this->useCaseResponse->notFutureKurstag;

    return $result;
  }

  public function present()
  {
    $view = $this->getView();
    if (empty($this->useCaseResponse->replacementKurstage)) {
      return $view->getNoColumn();
    }

    return $view->getHeader() . $view->getBody() . $view->getFooter() . $view->getNoData();
  }
}