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

class ComboboxKurstagStatus extends Combobox
{
  protected function getDatamodulAry()
  {
    $tmpary = array();
    $tmpary[] = $this->getDatamodul('', 'normale Planung');

    if (DBWorkBASysSettings::isInlinguaMuenchen()) {
      $tmpary[] = $this->getDatamodul('X', 'abgesagt');
    } else {
      $tmpary[] = $this->getDatamodul('X', 'durchgeführter Tag');
    }
    $tmpary[] = $this->getDatamodul('P', 'Prüfung');
    if (DBWorkBASysSettings::isInlinguaMuenchen()) {
      $tmpary[] = $this->getDatamodul('A', 'verschoben');
    } else {
      $tmpary[] = $this->getDatamodul('A', 'Ausfall');
    }
    $tmpary[] = $this->getDatamodul('Z', 'zusätzlicher Tag');
    $tmpary[] = $this->getDatamodul('V', 'Vorbesprechung');
    $tmpary[] = $this->getDatamodul('N', 'Nachbesprechung');
    $tmpary[] = $this->getDatamodul('E', 'Elternabend');
    $tmpary[] = $this->getDatamodul('I', 'Informationsabend');
    $tmpary[] = $this->getDatamodul('K', 'Exkursion');
    $tmpary[] = $this->getDatamodul('D', 'Status nicht für Deputatsberechnung');

    return $tmpary;
  }

  protected function getValueFieldName()
  {
    return 'status';
  }

  protected function getTextFieldName()
  {
    return 'text';
  }

  protected function getDefaultOption()
  {
    return null;
  }

  private function getDatamodul($status, $text)
  {
    $datamodul = new class() extends \Datamodul {
      public $status;
      public $text;
    };
    $datamodul->status = $status;
    $datamodul->text = $text;

    return $datamodul;
  }
}