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

namespace Kufer\KuferTools\Basis\DozentenInfo\SammelEMail;

abstract class SendSammelEMailView extends \Kufer\KuferTools\Basis\View\ViewSight
{
  
  public function show()
  {
    if ($this->viewModel->doppeltSenden || $this->viewModel->uploadFailed) {
      return $this->getNoColumn();
    }

    return parent::show();
  }

  protected function getDefaultDataModulArray()
  {
    $datamodul = new \Datamodul();
    $datamodul->backLink = $this->viewModel->backLink;
    $datamodul->backButtonLabel = $this->viewModel->backButtonLabel;

    $datamodul->uploadFailed = $this->viewModel->uploadFailed;
    $datamodul->doppeltSenden = $this->viewModel->doppeltSenden;

    $datamodul->errorMessage = $this->viewModel->errorMessage;
    $datamodul->toolId = $this->viewModel->toolId;

    return array($datamodul);
  }

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

  protected function getBodyDataModulArray()
  {
    return $this->viewModel->dozenten;
  }

  protected function getBodyExportAdapter()
  {
    return new \ExpDozenten();
  }
}

class SendSammelEMailViewModel
{
  public $dozenten;
  public $uploadFailed = false;
  public $doppeltSenden = false;
  

  public $backLink;
  public $backButtonLabel;

  public $toolId;
  public $errorMessage;
}