Exemple #1
0
 private function parseUser($id)
 {
     $restrictions = $GLOBALS['user']->id == $id ? array() : array('CLASS' => 'PUBLIC');
     $events = SingleCalendar::getEventList($id, $this->start, $this->start + $this->timespan, null, $restrictions);
     // Prepare termine
     $this->termine = array();
     foreach ($events as $termin) {
         // Adjust title
         if (date("Ymd", $termin->getStart()) == date("Ymd", time())) {
             $title = _("Heute") . date(", H:i", $termin->getStart());
         } else {
             $title = substr(strftime("%a", $termin->getStart()), 0, 2);
             $title .= date(". d.m.Y, H:i", $termin->getStart());
         }
         if ($termin->getStart() < $termin->getEnd()) {
             if (date("Ymd", $termin->getStart()) < date("Ymd", $termin->getEnd())) {
                 $title .= " - " . substr(strftime("%a", $termin->getEnd()), 0, 2);
                 $title .= date(". d.m.Y, H:i", $termin->getEnd());
             } else {
                 $title .= " - " . date("H:i", $termin->getEnd());
             }
         }
         if ($termin->getTitle()) {
             $tmp_titel = htmlReady(mila($termin->getTitle()));
             //Beschneiden des Titels
             $title .= ", " . $tmp_titel;
         }
         // Store for view
         $this->termine[] = array('id' => $termin->id, 'type' => get_class($termin), 'range_id' => $termin->range_id, 'event_id' => $termin->event_id, 'chdate' => $termin->chdate, 'title' => $title, 'description' => $termin->getDescription(), 'room' => $termin->getLocation(), 'info' => array(_('Kategorie') => $termin->toStringCategories(), _('Priorität') => $termin->toStringPriority(), _('Sichtbarkeit') => $termin->toStringAccessibility(), _('Wiederholung') => $termin->toStringRecurrence()));
     }
 }
 private function getContentAppointments () {
     if (get_config('CALENDAR_ENABLE')) {
         $events = SingleCalendar::getEventList($this->user_id, time(), time() + 60 * 60 * 24 * 7, null, array('class' => 'PUBLIC'), array('CalendarEvent'));
         $content['APPOINTMENTS']['LIST-START'] = ExternModule::ExtHtmlReady(strftime($this->config->getValue('Main', 'dateformat') . ' %X', time()));
         $content['APPOINTMENTS']['LIST-END'] = ExternModule::ExtHtmlReady(strftime($this->config->getValue('Main', 'dateformat') . ' %X', time() + 60 * 60 * 24 * 7));
         if (sizeof($events)) {
             $i = 0;
             foreach ($events as $event) {
                 if ($event->isDayEvent()) {
                     $content['APPOINTMENTS']['ALL-APPOINTMENTS']['SINGLE-APPOINTMENT'][$i]['DATE'] = ExternModule::ExtHtmlReady(strftime($this->config->getValue('Main', 'dateformat'), $event->getStart()) . ' (' . _("ganztügig") . ')');
                 } else {
                     $content['APPOINTMENTS']['ALL-APPOINTMENTS']['SINGLE-APPOINTMENT'][$i]['DATE'] = ExternModule::ExtHtmlReady(strftime($this->config->getValue('Main', 'dateformat') . " %X", $event->getStart()));
                     if (date("dmY", $event->getStart()) == date("dmY", $event->getEnd())) {
                         $content['APPOINTMENTS']['ALL-APPOINTMENTS']['SINGLE-APPOINTMENT'][$i]['DATE'] .= ExternModule::ExtHtmlReady(strftime(" - %X", $event->getEnd()));
                     } else {
                         $content['APPOINTMENTS']['ALL-APPOINTMENTS']['SINGLE-APPOINTMENT'][$i]['DATE'] .= ExternModule::ExtHtmlReady(strftime(" - " . $this->config->getValue('Main', 'dateformat') . " %X", $event->getEnd()));
                     }
                 }
                 $content['APPOINTMENTS']['ALL-APPOINTMENTS']['SINGLE-APPOINTMENT'][$i]['TITLE'] = ExternModule::ExtHtmlReady($event->getTitle());
                 $content['APPOINTMENTS']['ALL-APPOINTMENTS']['SINGLE-APPOINTMENT'][$i]['DESCRIPTION'] = ExternModule::ExtHtmlReady($event->getDescription());
                 $content['APPOINTMENTS']['ALL-APPOINTMENTS']['SINGLE-APPOINTMENT'][$i]['LOCATION'] = ExternModule::ExtHtmlReady($event->getLocation());
                 $content['APPOINTMENTS']['ALL-APPOINTMENTS']['SINGLE-APPOINTMENT'][$i]['REPETITION'] = ExternModule::ExtHtmlReady($event->toStringRecurrence());
                 $content['APPOINTMENTS']['ALL-APPOINTMENTS']['SINGLE-APPOINTMENT'][$i]['CATEGORY'] = ExternModule::ExtHtmlReady($event->toStringCategories());
                 $content['APPOINTMENTS']['ALL-APPOINTMENTS']['SINGLE-APPOINTMENT'][$i]['PRIORITY'] = ExternModule::ExtHtmlReady($event->toStringPriority());
                 $content['APPOINTMENTS']['ALL-APPOINTMENTS']['SINGLE-APPOINTMENT'][$i]['START'] = ExternModule::ExtHtmlReady(strftime($this->config->getValue('Main', 'dateformat') . " %X", $event->getStart()));
                 $content['APPOINTMENTS']['ALL-APPOINTMENTS']['SINGLE-APPOINTMENT'][$i]['END'] = ExternModule::ExtHtmlReady(strftime($this->config->getValue('Main', 'dateformat') . " %X", $event->getEnd()));
                 $i++;
             }
         } else {
             $content['APPOINTMENTS']['NO-APPOINTMENTS']['NO-APPOINTMENTS_TEXT'] = $this->config->getValue('Main', 'noappointmentstext');
         }
         return $content;
     }
     return NULL;
 }
Exemple #3
0
function termine (&$module, $row, $alias_content, $text_div, $text_div_end)
{
    if (Config::get()->CALENDAR_ENABLE && Visibility::verify('dates', $row['user_id']) || 1) {
        if ($margin = $module->config->getValue("TableParagraphSubHeadline", "margin")) {
            $subheadline_div = "<div style=\"margin-left:$margin;\">";
            $subheadline_div_end = "</div>";
        }
        else {
            $subheadline_div = "";
            $subheadline_div_end = "";
        }

        $event_list = SingleCalendar::getEventList($row['user_id'], time(),
                time() + 60 * 60 * 24 * 7, null, array('class' => 'PUBLIC'),
                array('CalendarEvent'));
        if (sizeof($event_list)) {
            echo "<tr><td width=\"100%\">\n";
            echo "<table" . $module->config->getAttributes("TableParagraph", "table") . ">\n";
            echo "<tr" . $module->config->getAttributes("TableParagraphHeadline", "tr") . ">";
            echo "<td" . $module->config->getAttributes("TableParagraphHeadline", "td") . ">";
            echo "<font" . $module->config->getAttributes("TableParagraphHeadline", "font") . ">";
            echo "$alias_content</font></td></tr>\n";

            foreach ($event_list as $event) {
                echo "<tr" . $module->config->getAttributes("TableParagraphSubHeadline", "tr") . ">";
                echo "<td" . $module->config->getAttributes("TableParagraphSubHeadline", "td") . ">";
                echo $subheadline_div;
                echo "<font" . $module->config->getAttributes("TableParagraphSubHeadline", "font") . ">";
                echo strftime($module->config->getValue("Main", "dateformat") . " %H:%M", $event->getStart());
                if (date("dmY", $event->getStart()) == date("dmY", $event->getEnd()))
                    echo strftime(" - %H:%M", $event->getEnd());
                else
                    echo strftime(" - " . $module->config->getValue("Main", "dateformat") . " %H:%M", $event->getEnd());
                echo " &nbsp;" . htmlReady($event->getTitle());
                echo "</font>$subheadline_div_end</td></tr>\n";
                if ($event->getDescription()) {
                    echo "<tr" . $module->config->getAttributes("TableParagraphText", "tr") . ">";
                    echo "<td" . $module->config->getAttributes("TableParagraphText", "td") . ">";
                    echo "$text_div<font" . $module->config->getAttributes("TableParagraphText", "font") . ">";
                    echo htmlReady($event->getDescription());
                    echo "</font>$text_div_end</td></tr>\n";
                }
            }
            echo "</table>\n</td></tr>\n";
        }
    }
}