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

namespace Kufer\Web\KuferTools\Basis\AnwesenheitenKurs;

class AnwesenheitenView extends \Kufer\Web\KuferTools\Basis\View\ViewSight
{
  public function getTemplatePathRelative()
  {
    return 'basis/anwesenheiten/anw.sgt';
  }

  protected function getHeaderDataModulArray()
  {
    $this->viewModel->kurs->zeige_anw_in_prozent = $this->viewModel->zeigeAnwInProzent;
    $this->viewModel->kurs->zeige_anw_tage = $this->viewModel->zeigeAnwTage;
    $this->viewModel->kurs->zeige_abw_tage = $this->viewModel->zeigeAbwTage;
    $this->viewModel->kurs->ist_bearbeitbar = $this->viewModel->isBearbeitbar;

    $this->viewModel->kurs->ist_bearbeitbar = $this->viewModel->isBearbeitbar;
    $this->viewModel->kurs->ist_bearbeitbar = $this->viewModel->isBearbeitbar;
    $this->viewModel->kurs->in_zukunft_bearbeitbar = $this->viewModel->anwInZukunftBearbeitenErlaubt;
    $this->viewModel->kurs->anderer_doz_bearbeitbar = $this->viewModel->anwVonAnderenDozentenBearbeitbar;

    $this->viewModel->kurs->messageSuccess = $this->viewModel->messageSuccess;
    $this->viewModel->kurs->messageError = $this->viewModel->messageError;
    $this->viewModel->kurs->messageWarning = $this->viewModel->messageWarning;
    $this->viewModel->kurs->messageInfo = $this->viewModel->messageInfo;

    return array($this->viewModel->kurs);
  }

  protected function getHeaderExportAdapter()
  {
    return new \ExpKurse();
  }

  protected function getBodyDataModulArray()
  {
    $anzKtInfo = count($this->viewModel->kursTageInfo);
    for ($i = 0; $i < $anzKtInfo; $i++) {
      $this->viewModel->kursTageInfo[$i]->zeige_uhrzeit = $this->viewModel->zeigeUhrzeit;
      $this->viewModel->kursTageInfo[$i]->zeige_ue = $this->viewModel->zeigeUE;
      $this->viewModel->kursTageInfo[$i]->zeige_dozent = $this->viewModel->zeigeDozent;
      $this->viewModel->kursTageInfo[$i]->zeige_faecher = $this->viewModel->zeigeFaecher;
      $this->viewModel->kursTageInfo[$i]->zeige_bemerkung = $this->viewModel->zeigeBemerkung;
    }

    return $this->viewModel->kursTageInfo;
  }

  protected function getFooterDataModulArray()
  {  
    
    $this->viewModel->kurs->toolId = $this->viewModel->toolId;
    $this->viewModel->kurs->show_filter_button = $this->viewModel->showFilterButton;
    $this->viewModel->kurs->set_filter = $this->viewModel->setFilter;
    $this->viewModel->kurs->backButtonLabel = $this->viewModel->backButtonLabel;
    $this->viewModel->kurs->backButtonLink = $this->viewModel->backButtonLink;
    $this->viewModel->kurs->ist_bearbeitbar = $this->viewModel->isBearbeitbar;
    $this->viewModel->kurs->in_zukunft_bearbeitbar = $this->viewModel->anwInZukunftBearbeitenErlaubt;
    $this->viewModel->kurs->anderer_doz_bearbeitbar = $this->viewModel->anwVonAnderenDozentenBearbeitbar;
    $this->viewModel->kurs->htmllegende = $this->viewModel->htmllegende;

    return array($this->viewModel->kurs);
  }

  protected function getFooterExportAdapter()
  {
    return new \ExpKurse();
  }

  protected function getNoColumnDataModulArray()
  {
    return array($this->viewModel->kurs);
  }

  protected function getNoColumnExportAdapter()
  {
    return new \ExpKurse();
  }

  protected function getNoDataDataModulArray()
  {  
    
    $this->viewModel->kurs->toolId = $this->viewModel->toolId;
    $this->viewModel->kurs->show_filter_button = $this->viewModel->showFilterButton;
    $this->viewModel->kurs->set_filter = $this->viewModel->setFilter;
    $this->viewModel->kurs->backButtonLabel = $this->viewModel->backButtonLabel;
    $this->viewModel->kurs->backButtonLink = $this->viewModel->backButtonLink;

    return array($this->viewModel->kurs);
  }

  protected function getNoDataExportAdapter()
  {
    return new \ExpKurse();
  }
}

class AnwesenheitenViewModel
{
  public $toolId;
  public $kurs;
  public $kursTageInfo;
  public $showFilterButton;
  public $zeigeUhrzeit;
  public $zeigeUE;
  public $zeigeDozent;
  public $zeigeFaecher;
  public $zeigeBemerkung;
  public $zeigeAnwInProzent;
  public $zeigeAnwTage;
  public $zeigeAbwTage;
  public $backButtonLabel;
  public $backButtonLink;
  public $isBearbeitbar;
  public $anwInZukunftBearbeitenErlaubt;
  public $anwVonAnderenDozentenBearbeitbar;
  public $setFilter;
  public $messageSuccess;
  public $messageError;
  public $messageWarning;
  public $messageInfo;
  public $htmllegende;
}