示例#1
0
 public function getOverviewContent($echo = true)
 {
     $time = mktime(0, 0, 1);
     $Datum = new Datum($time);
     $Datum->normalize();
     #$Datum->printer();
     $DC = clone $Datum;
     $DC->addMonth();
     $lastTime = $DC->time();
     #$Datum->subMonth();
     $Woche = date("W");
     $K = $this->getData($time, $lastTime, null, array("mxCalGUI"));
     $hasEvent = array();
     $html = "<div class=\"touchHeader\"><span class=\"lastUpdate\" id=\"lastUpdatemKalenderGUI\"></span><p>Kalender</p></div><div style=\"padding:10px;padding-left:0px;\">";
     $html .= "<div style=\"width:25px;float:left;margin-right:5px;color:grey;font-size:11px;\">%%SMALLCALCONTENT%%</div>";
     $html .= "<div style=\"border-bottom-width:1px;border-bottom-style:dashed;padding:3px;margin-left:30px;\" class=\"borderColor1\">Heute</div>";
     $list = new HTMLList();
     $list->addListStyle("list-style-type:none;margin-left:30px;");
     $events = $K->getEventsOnDay(date("dmY", $Datum->time()));
     if ($events != null and count($events) > 0) {
         foreach ($events as $ev) {
             foreach ($ev as $KE) {
                 $hasEvent[date("d", $K->parseDay($KE->getDay()))] = true;
                 $B = new Button("", $KE->icon(), "icon");
                 $B->style("float:left;margin-right:5px;margin-bottom:10px;");
                 $list->addItem("{$B}<b style=\"font-size:15px;\">" . $KE->title() . "</b><br /><small>" . Datum::getGerWeekArray(date("w", $K->parseDay($KE->getDay()))) . ", " . Util::CLDateParser($K->parseDay($KE->getDay())) . " " . Util::CLTimeParser($K->parseTime($KE->getTime())) . "</small>");
             }
         }
     }
     if (count($events) == 0) {
         $list->addItem("<span style=\"color:grey;\">Kein Eintrag</span>");
     }
     $html .= $list;
     $Datum->addDay();
     $html .= "<div style=\"border-bottom-width:1px;border-bottom-style:dashed;padding:3px;margin-top:15px;margin-left:30px;\" class=\"borderColor1\">Morgen</div>";
     $list = new HTMLList();
     $list->addListStyle("list-style-type:none;margin-left:30px;");
     $events = $K->getEventsOnDay(date("dmY", $Datum->time()));
     if ($events != null and count($events) > 0) {
         foreach ($events as $ev) {
             foreach ($ev as $KE) {
                 $hasEvent[date("d", $K->parseDay($KE->getDay()))] = true;
                 $B = new Button("", $KE->icon(), "icon");
                 $B->style("float:left;margin-right:5px;margin-bottom:10px;");
                 $list->addItem("{$B}<b style=\"font-size:15px;\">" . $KE->title() . "</b><br /><small>" . Datum::getGerWeekArray(date("w", $K->parseDay($KE->getDay()))) . ", " . Util::CLDateParser($K->parseDay($KE->getDay())) . " " . Util::CLTimeParser($K->parseTime($KE->getTime())) . "</small>");
             }
         }
     }
     if (count($events) == 0) {
         $list->addItem("<span style=\"color:grey;\">Kein Eintrag</span>");
     }
     $html .= $list;
     $Datum->addDay();
     $html .= "<div style=\"border-bottom-width:1px;border-bottom-style:dashed;padding:3px;margin-top:15px;margin-left:30px;\" class=\"borderColor1\">Später</div>";
     $list = new HTMLList();
     $list->addListStyle("list-style-type:none;margin-left:30px;");
     $c = 0;
     while ($Datum->time() < $lastTime) {
         $events = $K->getEventsOnDay(date("dmY", $Datum->time()));
         if ($events != null and count($events) > 0) {
             foreach ($events as $ev) {
                 foreach ($ev as $KE) {
                     $hasEvent[date("d", $K->parseDay($KE->currentWhen()->day))] = true;
                     $B = new Button("", $KE->icon(), "icon");
                     $B->style("float:left;margin-right:5px;margin-bottom:10px;");
                     $list->addItem("{$B}<b style=\"font-size:15px;\">" . $KE->title() . "</b><br /><small>" . Datum::getGerWeekArray(date("w", $K->parseDay($KE->currentWhen()->day))) . ", " . Util::CLDateParser($K->parseDay($KE->currentWhen()->day)) . "</small>");
                     if (date("W", $K->parseDay($KE->currentWhen()->day)) > $Woche + 1) {
                         $list->addItemStyle("color:grey;");
                     }
                     $c++;
                 }
             }
         }
         $Datum->addDay();
     }
     if ($c == 0) {
         $list->addItem("<span style=\"color:grey;\">Kein Eintrag</span>");
     }
     $html .= $list . "</div>";
     $smallCal = "";
     $DatumC = clone $Datum;
     for ($i = 0; $i < 14; $i++) {
         $smallCal .= "<div style=\"padding:5px;text-align:right;" . (isset($hasEvent[date("d", $DatumC->time())]) ? "color:black;" : "") . "\" " . (isset($hasEvent[date("d", $DatumC->time())]) ? "class=\"backgroundColor3\"" : "") . "\">" . date("d", $DatumC->time()) . "</div>";
         $DatumC->addDay();
     }
     $html = str_replace("%%SMALLCALCONTENT%%", $smallCal, $html);
     if ($echo) {
         echo $html;
     }
     return $html;
 }
示例#2
0
 function getMeetingData()
 {
     $currentTime = date("Hi");
     //create obj for today
     $D = new Datum();
     $D->normalize();
     $DE = clone $D;
     $DE->addDay();
     $T = new mTodoGUI();
     $K = $T->getCalendarData($D->time(), $DE->time(), Session::currentUser()->getID());
     while ($DE->time() > $D->time()) {
         $termine = $K->getEventsOnDay(date("dmY", $D->time()));
         //debug message
         echo "<div style='display:none'>";
         print_r($termine);
         echo "</div>";
         if ($termine != null) {
             foreach ($termine as $ev) {
                 foreach ($ev as $v) {
                     //start time in future = upcomming
                     if ($v->getTime() > $currentTime) {
                         array_push($this->upcommingMeetings, $v);
                         //current events
                     } else {
                         if ($v->getTime() <= $currentTime && $v->getEndTime() > $currentTime) {
                             array_push($this->currentMeetings, $v);
                         } else {
                             array_push($this->oldMeetings, $v);
                         }
                     }
                     //echo get_class($v).": ".$v->title()."<br>";
                 }
             }
         }
         $D->addDay();
     }
 }
示例#3
0
 function getBusyList($UserID = null, $echo = false)
 {
     $cutoffDatePast = time() - 2 * 24 * 3600;
     $cutoffDateFuture = time() + 84 * 24 * 3600;
     $Kal = new mKalender();
     $K = $Kal->getData($cutoffDatePast, $cutoffDateFuture, $UserID);
     $Datum = new Datum();
     $Datum->normalize();
     $htmlEvents = "";
     $htmlEvents .= "<div class=\"backgroundColor2\"><p class=\"prettySubtitle\">KW " . date("W", $Datum->time()) . "</p></div>";
     while ($Datum->time() < $cutoffDateFuture) {
         $list = "";
         $events = $K->getEventsOnDay(date("dmY", $Datum->time()));
         if ($events != null and count($events) > 0) {
             foreach ($events as $ev) {
                 foreach ($ev as $KE) {
                     $list .= "<div style=\"white-space: nowrap;overflow: hidden;text-overflow: ellipsis;\" title=\"" . $KE->title() . "\"><span>" . Util::CLTimeParser($K->parseTime($KE->currentWhen()->time)) . " - " . Util::CLTimeParser($K->parseTime($KE->getEndTime())) . "</span> <small style=\"color:grey;\">" . $KE->title() . "</small></div>";
                 }
             }
         }
         $Datum->addDay();
         $style = "";
         if ($Datum->w() == 0 or $Datum->w() == 6) {
             continue;
         }
         #$style = "background-color:#DDD;";
         if ($Datum->w() == 1) {
             $htmlEvents .= "<div class=\"backgroundColor2\"><p class=\"prettySubtitle\">KW " . date("W", $Datum->time()) . "</p></div>";
         }
         $htmlEvents .= "<div style=\"margin-bottom:20px;{$style}display:inline-block;width:50%;box-sizing:border-box;vertical-align:top;min-height:60px;\">\n\t\t\t\t<div style=\"background-color:#EEE;padding:5px;\">\n\t\t\t\t\t<span style=\"display:inline-block;width:30px;font-weight:bold;\">" . mb_substr(Util::CLWeekdayName($Datum->w()), 0, 2) . "</span>\n\t\t\t\t\t<span style=\"color:grey;\">" . Util::CLDateParser($Datum->time()) . "</span>\n\t\t\t\t</div>\n\t\t\t\t<div style=\"padding:5px;\">\n\t\t\t\t\t{$list}\n\t\t\t\t</div>\n\t\t\t\t</div>";
     }
     if ($echo) {
         echo $htmlEvents;
     }
     return $htmlEvents;
 }
示例#4
0
 public function reminderDone($target, $id)
 {
     switch ($target) {
         case "KalenderEvent":
             $ex = explode("@", $id);
             if (strpos($ex[0], "TodoID") !== false) {
                 $T = new Todo(str_replace("TodoID", "", $ex[0]));
                 $D = new Datum();
                 $D->normalize();
                 $after = $D->time() + $T->A("TodoFromTime") - 60 * 5;
                 $T->changeA("TodoReminded", $after + 60);
                 $T->saveMe(true, false, false);
             }
             break;
         case "Aufgabe":
             $A = new Aufgabe($id);
             $A->changeA("AufgabeReminded", time());
             $A->saveMe();
             break;
     }
 }
示例#5
0
 public function all()
 {
     $D = new Datum();
     $D->normalize();
     $html = "<div style=\"margin-left:2%;\">";
     while ($W = $this->n()) {
         $data = json_decode($W->A("OpenWeatherMapDataForecastDaily"));
         foreach ($data->list as $value) {
             $time = $value->dt;
             if ($time < $D->time()) {
                 continue;
             }
             $html .= $this->toIcon(false, $value);
         }
     }
     echo $html . "</div>";
 }