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

class ComboboxKurstagStatus extends Combobox
{
  protected function getDatamodulAry(): array
  {
    $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(): string
  {
    return 'status';
  }

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

  protected function getDefaultOption(): ?\ComboboxOption
  {
    return null;
  }

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

    return $datamodul;
  }
}