Ejemplo n.º 1
0
    public function getNextDate($return_mode = 'string')
    {
        $next_date = '';
        if ($return_mode == 'int') {
            echo __class__.'::'.__function__.', line '.__line__.', return_mode "int" ist not supported by this function!';die;
        }

        if (!$termine = SeminarDB::getNextDate($this->id))
            return false;

        foreach ($termine['termin'] as $singledate_id) {
            $next_date .= DateFormatter::formatDateAndRoom($singledate_id, $return_mode) . '<br>';
        }

        if (!empty($termine['ex_termin'])) {
            foreach ($termine['ex_termin'] as $ex_termin_id) {
                $ex_termin = new SingleDate($ex_termin_id);

                $missing_date  = '<div style="border:1px solid black; background:#FFFFDD;">';
                $missing_date .= sprintf(_("Der Termin am %s findet nicht statt."),
                    DateFormatter::formatDateAndRoom($ex_termin_id, $return_mode));

                $missing_date .= '<br>' . _("Kommentar"). ': '.htmlReady($ex_termin->getComment());

                if (!empty($termine['termin'])) {
                    $termin = new SingleDate($termine['termin'][0]);
                    if ($ex_termin->getStartTime() <= $termin->getStartTime()) {
                        return $next_date .'<br>'. $missing_date . '<br>'. _('Die anderen Termine finden wie angegeben statt!') . '</div>';
                    } else {
                        return $next_date;
                    }
                } else {
                    return $missing_date . '</div>';
                }
            }
        } else {
            return $next_date;
        }

        return false;
    }