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

namespace Kufer\KuferTools\Utils\DatamodulHelper\KursTageHelper;

class DozIcsKalenderKurstage extends IcsKalenderKurstage
{
  protected function getKurstage($dbwKurseTage)
  {
    return $dbwKurseTage->getKurstageByDozLimit($this->user->dnr, null, 0, true, $this->request->kursnummern, \SessionOperations::isAdmin());
  }

  protected function setzeEinstellungen($dbwKurseTage)
  {
    parent::setzeEinstellungen($dbwKurseTage);
    if (!$this->request->auchTermineAndererDozenten) {
      $dbwKurseTage->fromobject->dnr = $this->user->dnr;
      $dbwKurseTage->toobject->dnr = $this->user->dnr;
    }

    $dbwKurseTage->toobject->nodoztool = true;

    return $dbwKurseTage;
  }
}