function __construct()
 {
     $this->dataFile = "chart";
     parent::__construct();
     $this->bps = BPS::getAllProperties("StatistikControllingGUI");
     $D1 = new Datum(time());
     $D1->setToJan1st(date("Y"));
     $D2 = new Datum(time());
     $D2->setToJan1st(date("Y") + 1);
     $D2->subDay();
     $this->startDatum = isset($this->bps["start"]) ? $this->bps["start"] : Util::CLFormatDate($D1->time());
     $this->endDatum = isset($this->bps["ende"]) ? $this->bps["ende"] : Util::CLFormatDate($D2->time());
     $this->mK = null;
 }
Exemple #2
0
 function getBrowserHTML($lineWithId = -1, $useBPS = true)
 {
     T::load(Util::getRootPath() . "libraries");
     $canDelete = mUserdata::isDisallowedTo("cantDelete" . $this->className);
     #$canEdit = mUserdata::isDisallowedTo("cantEdit".$this->className);
     if (!$canDelete) {
         $this->showTrash = false;
     }
     #if(!$canEdit) //KILLS SEARCH-FIELD!!
     #	$this->showEdit = false;
     $bps = BPS::getAllProperties("m" . $this->className . "GUI");
     if (!$useBPS) {
         $bps = false;
     }
     $GUIF = $this->GUIFactory;
     $GUIF->setMultiPageDetails($this->multiPageDetails);
     $GUIF->setTableMode($this->displayMode);
     $GUIF->options($this->showTrash, $this->showEdit, $this->showNew);
     if ($this->blacklists != null) {
         $GUIF->blacklists($this->blacklists);
     }
     if (isset($bps["selectionMode"])) {
         $GUIF->selection($bps["selectionMode"]);
     }
     #$GUIF->features($this->features);
     #$this->multiPageDetails["target"] = $this->frame;#"contentRight";
     #$GUIF->setMultiPageDetails($this->multiPageDetails);
     if ($this->targetFrame != null) {
         $GUIF->targetFrame($this->targetFrame);
     }
     $E = $this->object->getNextEntry();
     if ($this->attributes == null and $E != null) {
         $this->attributes = PMReflector::getAttributesArrayAnyObject($E->getA());
     }
     #if($E == null) //To fix display error when no entry
     #	$this->attributes = array("");
     if ($this->caption == null and $this->caption !== false) {
         $this->caption($this->displayMode == "BrowserLeft" ? $this->name == null ? $this->className : $this->name : "");
     }
     #"Bitte ".($this->name == null ? $this->className : $this->name)." auswählen:");
     $Tab = $GUIF->getTable($E == null ? array("") : $this->attributes, $this->colStyle, $this->caption);
     if ($this->tableWeight) {
         $Tab->weight($this->tableWeight);
     }
     $Tab->setTableID("Browserm{$this->className}");
     $Tab->addTableClass("contentBrowser");
     if ($this->useScreenHeight) {
         $Tab->useScreenHeight();
     }
     if ($this->header != null and $this->object->numLoaded() > 0) {
         $Tab->addHeaderRow($this->header);
     }
     if ($lineWithId == -1) {
         if ($this->showQuicksearch) {
             $GUIF->buildQuickSearchLine();
         }
         #if($this->multiPageDetails["total"] > $this->multiPageDetails["perPage"])
         if ($this->showPageFlip) {
             $GUIF->buildFlipPageLine("top");
         }
         if ($this->object->isFiltered()) {
             $GUIF->buildFilteredWarningLine($this->object->isFilteredLabel());
         }
         $GUIF->buildNewEntryLine(($this->name == null ? $this->className : $this->name) . " neu anlegen");
     }
     $this->object->resetPointer();
     $DisplayGroup = null;
     while ($E = $this->object->getNextEntry()) {
         /**
          * DisplayGroup
          */
         if ($lineWithId == -1 and $this->displayGroup != null and $DisplayGroup != $E->A($this->displayGroup[0])) {
             if ($this->displayGroup[1] != null) {
                 $DGP = explode("::", $this->displayGroup[1]);
                 $GUIF->buildGroupLine(Util::invokeStaticMethod($DGP[0], $DGP[1], array($E->A($this->displayGroup[0]), $E)));
             } else {
                 $GUIF->buildGroupLine($E->A($this->displayGroup[0]));
             }
         }
         $Line = array();
         foreach ($this->attributes as $attributeName) {
             $LineContent = $E->A($attributeName);
             if (isset($this->parsers[$attributeName])) {
                 $LineContent = $this->invokeParser($this->parsers[$attributeName], $LineContent, $E);
             } else {
                 $LineContent = htmlspecialchars($LineContent);
             }
             $Line[] = $LineContent;
         }
         $GUIF->buildLine($E->getID(), $Line);
         if ($this->displayGroup != null) {
             $DisplayGroup = $E->A($this->displayGroup[0]);
         }
     }
     if ($lineWithId == -1) {
         if ($this->object->isFiltered()) {
             $GUIF->buildFilteredWarningLine($this->object->isFilteredLabel());
         }
         if ($this->multiPageDetails["total"] > $this->multiPageDetails["perPage"] and $this->showPageFlip) {
             $GUIF->buildFlipPageLine("bottom");
         }
         if ($this->object->numLoaded() == 0) {
             $GUIF->buildNoEntriesLine();
         }
     } else {
         return $Tab->getHTMLForUpdate();
     }
     $prepend = "";
     foreach ($this->prepended as $PE) {
         $prepend .= $PE;
     }
     $appended = "";
     foreach ($this->appended as $PE) {
         $appended .= $PE;
     }
     return "<div class=\"browserContainer contentBrowser\">" . $prepend . $this->sideButtons($bps) . $GUIF->getContainer($Tab, $this->caption, $appended, $this->topButtons($bps)) . "</div>" . str_replace("%CLASSNAME", $this->className, $this->sortable) . $this->tip;
 }
 public function getTable($GUI)
 {
     $bps = BPS::getAllProperties("mKalenderGUI");
     $K = $GUI->getData($this->first, $this->last, isset($bps["KID"]) ? $bps["KID"] : Session::currentUser()->getID());
     $cols = $this->cols;
     $rows = $this->rows;
     #"<table id=\"KalenderHeader\" style=\"position:absolute;margin-left:10px;border-spacing: 0px;width:auto;\" class=\"backgroundColor0\">
     $tableHeader = "\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th style=\"border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#EEE;padding-top:10px;text-align:right;\" class=\"backgroundColor0\">Monat</th>";
     for ($j = 0; $j < $this->cols; $j++) {
         $tableHeader .= "\n\t\t\t\t<th style=\"border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#EEE;padding-top:10px;\" class=\"backgroundColor0\">" . ($j + 1) . "</th>";
     }
     $tableHeader .= "\n\t\t</tr>\n\t\t</thead>\n\t\t";
     #</table>
     $html = "\n\t\t\t\n\t\t<div style=\"\">\n\t\t<!--<table id=\"KalenderHeader\" style=\"position:absolute;margin-left:10px;border-spacing: 0px;\">\n\t\t\t{$tableHeader}\n\t\t</table>-->\n\t\t<table style=\"margin-left:10px;border-spacing: 0px;\" id=\"KalenderTable\">\n\t\t\t<colgroup>\n\t\t\t\t<col></col>";
     for ($j = 0; $j < $cols; $j++) {
         #
         $html .= "\n\t\t\t\t<col style=\"width:" . 100 / $cols . "%;\" />";
     }
     $html .= "";
     $html .= "\n\t\t{$tableHeader}\n\t\t<tbody>";
     $D = clone $this->date;
     for ($i = 0; $i < $rows; $i++) {
         $html .= "\n\t\t\t<tr class=\"cellHeight\">\n\t\t\t\t<td class=\"Day borderColor1 backgroundColor3\" style=\"text-align:right;\">" . Util::CLMonthName($i + 1) . "</td>";
         for ($j = 0; $j < $cols; $j++) {
             $entry = "";
             $events = $K->getEventsOnDay(date("dmY", $D->time()));
             $holidays = $K->getHolidaysOnDay(date("dmY", $D->time()));
             #$hasMultiDay = $K->hasMultiDayEvents($this->first, $this->last);
             if ($events != null) {
                 foreach ($events as $ev) {
                     foreach ($ev as $v) {
                         $entry .= $v->getMinimal($D->time());
                     }
                 }
             }
             if ($holidays != null) {
                 foreach ($holidays as $ev) {
                     foreach ($ev as $v) {
                         $entry .= $v->getMinimal($D->time());
                     }
                 }
             }
             $bgColor = "none";
             if (date("w", $D->time()) == 6) {
                 $bgColor = $this->colorBgSaturday;
             }
             if (date("w", $D->time()) == 0) {
                 $bgColor = $this->colorBgSunday;
             }
             #".((date("m.Y",$D->time()) != date("m.Y",$currentMonth->time())) ? "color:grey;" : "")."
             if ($j < $cols) {
                 $html .= "\n\t\t\t\t<td\n\t\t\t\t\tstyle=\"vertical-align:top;padding:0px;background-color:{$bgColor};overflow:auto;\"\n\t\t\t\t\tclass=\"" . (date("d.m.Y", $D->time()) == date("d.m.Y") ? "backgroundColor1" : "") . " Day borderColor1\">\n\t\t\t\t\t<div style=\"font-size:10px;\">{$entry}</div>\n\t\t\t\t</td>";
             }
             $D->addDay();
             #if(date("d", $D->time()) == 1){
             #for(;$j < $cols;$j++)
             #	$html .= "<td class=\"Day borderColor1\"></td>";
             #}
         }
         $html .= "\n\t\t\t</tr>";
     }
     $html .= "\n\t\t\t</tbody>\n\t\t</table>\n\t\t</div>";
     #.OnEvent::script("\$j('#KalenderTable thead th').each(function(k, v){ \$j(\$j('#KalenderHeader thead th').get(k)).css('width', \$j(v).width()); console.log(\$j(v).width()); }); \$j('#KalenderHeader').css('width', \$j('#KalenderTable').width())");#.OnEvent::script("\$j('#KalenderTable').fixedHeaderTable({ footer: false, cloneHeadToFoot: false, fixedColumn: true });");
     return $html;
 }
 protected function getMyBPSData()
 {
     return BPS::getAllProperties(get_class($this));
 }
 function getBrowserHTML($lineWithId = -1, $useBPS = true)
 {
     $bps = BPS::getAllProperties("m" . $this->className . "GUI");
     if (!$useBPS) {
         $bps = false;
     }
     $GUIF = $this->GUIFactory;
     $GUIF->setMultiPageDetails($this->multiPageDetails);
     $GUIF->setTableMode($this->displayMode);
     $GUIF->options($this->showTrash, $this->showEdit, $this->showNew);
     if ($this->blacklists != null) {
         $GUIF->blacklists($this->blacklists);
     }
     if (isset($bps["selectionMode"])) {
         $GUIF->selection($bps["selectionMode"]);
     }
     #$GUIF->features($this->features);
     #$this->multiPageDetails["target"] = $this->frame;#"contentRight";
     #$GUIF->setMultiPageDetails($this->multiPageDetails);
     $E = $this->object->getNextEntry();
     if ($this->attributes == null and $E != null) {
         $this->attributes = PMReflector::getAttributesArrayAnyObject($E->getA());
     }
     if ($E == null) {
         //To fix display error when no entry
         $this->attributes = array("");
     }
     if ($this->caption == null) {
         $this->caption("Bitte " . ($this->name == null ? $this->className : $this->name) . " auswählen:");
     }
     $Tab = $GUIF->getTable($this->attributes, $this->colStyle, $this->caption);
     $Tab->setTableID("Browserm{$this->className}");
     if ($this->header != null) {
         $Tab->addHeaderRow($this->header);
     }
     if ($lineWithId == -1) {
         if ($this->showQuicksearch) {
             $GUIF->buildQuickSearchLine();
         }
         if ($this->multiPageDetails["total"] > $this->multiPageDetails["perPage"]) {
             $GUIF->buildFlipPageLine("top");
         }
         $GUIF->buildNewEntryLine(($this->name == null ? $this->className : $this->name) . " neu anlegen");
         if ($this->object->isFiltered()) {
             $GUIF->buildFilteredWarningLine();
         }
     }
     $this->object->resetPointer();
     $DisplayGroup = null;
     while ($E = $this->object->getNextEntry()) {
         /**
          * DisplayGroup
          */
         if ($lineWithId == -1 and $this->displayGroup != null and $DisplayGroup != $E->A($this->displayGroup[0])) {
             if ($this->displayGroup[1] != null) {
                 $DGP = explode("::", $this->displayGroup[1]);
                 $GUIF->buildGroupLine(Util::invokeStaticMethod($DGP[0], $DGP[1], array($E->A($this->displayGroup[0]), $E)));
             } else {
                 $GUIF->buildGroupLine($E->A($this->displayGroup[0]));
             }
         }
         $Line = array();
         foreach ($this->attributes as $attributeName) {
             $LineContent = $E->A($attributeName);
             if (isset($this->parsers[$attributeName])) {
                 $LineContent = $this->invokeParser($this->parsers[$attributeName], $LineContent, $E);
             } else {
                 $LineContent = htmlspecialchars($LineContent);
             }
             $Line[] = $LineContent;
         }
         $GUIF->buildLine($E->getID(), $Line);
         if ($this->displayGroup != null) {
             $DisplayGroup = $E->A($this->displayGroup[0]);
         }
     }
     if ($lineWithId == -1) {
         if ($this->object->isFiltered()) {
             $GUIF->buildFilteredWarningLine();
         }
         if ($this->multiPageDetails["total"] > $this->multiPageDetails["perPage"]) {
             $GUIF->buildFlipPageLine("bottom");
         }
     } else {
         return $Tab->getHTMLForUpdate();
     }
     return $this->topButtons($bps) . $this->sideButtons($bps) . $GUIF->getContainer($Tab, $this->caption) . str_replace("%CLASSNAME", $this->className, $this->sortable) . $this->tip;
 }
 public static function adviceAboveList()
 {
     $bps = BPS::getAllProperties("FileManagerGUI");
     #
     $bps["path"] = str_replace('\\', "/", preg_replace("/^([A-Z]):/", "\\1%", $bps["path"]));
     #print_r($bps);
     $mF = new mFileGUI();
     return $mF->getUploadForm($bps["path"], BPS::getProperty("FileManagerGUI", "reloadFunction", "contentManager.reloadFrame('contentLeft');"), false, "width:100%;");
 }
 public function getTable($GUI)
 {
     $bps = BPS::getAllProperties("mKalenderGUI");
     $K = $GUI->getData($this->first, $this->last, isset($bps["KID"]) ? $bps["KID"] : Session::currentUser()->getID());
     $ansicht = $this->ansicht;
     $cols = $this->cols;
     $rows = $this->rows;
     $html = "<table style=\"margin-left:10px;border-spacing: 0px;\" id=\"KalenderTable\">\n\t\t\t<colgroup>";
     for ($j = 0; $j < $cols - 2; $j++) {
         #
         $html .= "\n\t\t\t\t<col " . ($ansicht == "woche" ? "class=\"backgroundColor" . ($j % 2 + 2) . "\" " : "") . " style=\"width:" . 100 / $cols . "%;\" />";
     }
     $html .= "\n\t\t\t\t<col style=\"background-color:{$this->colorBgSaturday};width:" . 100 / $cols . "%;\" />\n\t\t\t\t<col style=\"background-color:{$this->colorBgSunday};width:" . 100 / $cols . "%;\" />\n\t\t\t</colgroup>";
     if ($ansicht != "tag") {
         $html .= "\n\t\t\t\t<tr>";
         $D2 = clone $this->date;
         for ($j = 0; $j < $cols; $j++) {
             $html .= "\n\t\t\t\t\t\t<th style=\"border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#EEE;padding-top:10px;\" class=\"backgroundColor0\">" . Util::CLWeekdayName(date("w", $D2->time())) . "</th>";
             $D2->addDay();
         }
         unset($D2);
         $html .= "\n\t\t\t</tr>";
     }
     $D = clone $this->date;
     for ($i = 0; $i < $rows; $i++) {
         $html .= "\n\t\t\t<tr class=\"cellHeight noHover\">";
         for ($j = 0; $j < $cols; $j++) {
             $entry = "";
             $events = $K->getEventsOnDay(date("dmY", $D->time()));
             $holidays = $K->getHolidaysOnDay(date("dmY", $D->time()));
             $hasMultiDay = $K->hasMultiDayEvents($this->first, $this->last);
             if ($ansicht == "tag") {
                 #$dayContent = "";
                 $dayDivs = "";
                 for ($i = 0; $i < 24; $i++) {
                     $dayDivs .= "\n\t\t\t\t\t\t<div style=\"height:40px;z-index:10;\" class=\"backgroundColor" . ($i % 2 == 0 ? "3" : "2") . "\">\n\t\t\t\t\t\t\t";
                     $BN = "";
                     if (Session::isPluginLoaded("mTodo")) {
                         $BN = new Button("Neuer Termin", "./ubiquitous/Kalender/addToDo.png", "icon");
                         $BN->className("KalenderButton");
                         $BN->popup("", "Neuer Termin", "mKalender", "-1", "newTodo", array("-1", $D->time(), "'Kalender'", "-1", $i), "", "Kalender.popupOptions");
                         $BN->style("float:left;margin-left:5px;margin-top:5px;");
                     }
                     $dayDivs .= "\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class=\"borderColor1\" style=\"height:35px;border-right-width:1px;border-right-style:dotted;float:left;width:40px;padding-top:5px;padding-right:5px;font-weight:bold;text-align:right;color:grey;\">" . ($i < 10 ? "0" : "") . "{$i}:00</div>\n\t\t\t\t\t\t{$BN}</div>";
                 }
                 $eventsDiv = "";
                 for ($i = 0; $i < 24; $i++) {
                     if (count($events) > 0) {
                         foreach ($events as $time => $ev) {
                             if (substr($time, 0, 2) * 1 != $i) {
                                 continue;
                             }
                             foreach ($ev as $KE) {
                                 $eventsDiv .= $KE->getDayViewHTML($D->time());
                             }
                         }
                     }
                 }
                 $entry = "\n\t\t\t\t\t\t<div class=\"cellHeight\" style=\"overflow:auto;width:961px;\" id=\"tagDiv\">\n\t\t\t\t\t\t\t<div style=\"height:961px;\">\n\t\t\t\t\t\t\t{$dayDivs}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div style=\"margin-top:-961px;\">\n\t\t\t\t\t\t\t\t{$eventsDiv}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>";
             } elseif ($ansicht == "woche") {
                 $dayDivs = "";
                 for ($k = 0; $k < $hasMultiDay; $k++) {
                     $dayDivs .= "<div style=\"height:22px;z-index:10;\" class=\"borderColor0\"></div>";
                 }
                 for ($k = 0; $k < 24; $k++) {
                     $bgColor = "";
                     if ($k < 7 or $k > 19) {
                         $bgColor = "background-color:rgba(255, 255, 255, 0.3)";
                     }
                     $border = "border-top:1px dotted white;";
                     if ($k == 23) {
                         $border .= "border-bottom:1px dotted white;";
                     }
                     if ($k == 12) {
                         $border = "border-top:1px solid white;";
                     }
                     $dayDivs .= "\n\t\t\t\t\t\t<div style=\"height:" . ($k < 6 ? "10" : "21") . "px;z-index:10;{$border}{$bgColor}\" class=\"borderColor0\">\n\t\t\t\t\t\t\t";
                     if ($k > 5 and $k < 21 and $k % 2 == 0 and $j % 2 == 1) {
                         $dayDivs .= "\n\t\t\t\t\t\t\t\t<div class=\"borderColor1\" style=\"color:#777;padding-left:3px;\">" . ($k < 10 ? "0" : "") . "{$k}</div>";
                     }
                     $dayDivs .= "\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t</div>";
                 }
                 $eventsDiv = "";
                 for ($i = 0; $i < 24; $i++) {
                     if (count($events) > 0) {
                         foreach ($events as $time => $ev) {
                             if (substr($time, 0, 2) * 1 != $i) {
                                 continue;
                             }
                             foreach ($ev as $KE) {
                                 $eventsDiv .= $KE->getWeekViewHTML($D->time(), $hasMultiDay);
                             }
                         }
                     }
                 }
                 $entry = "\n\t\t\t\t\t\t<div style=\"overflow:auto;height:" . (11 * 6 + 22 * 18 + 1 + $hasMultiDay * 22) . "px;width:100%;\">\n\t\t\t\t\t\t\t<div style=\"height:" . (11 * 6 + 22 * 18 + 1) . "px;\">\n\t\t\t\t\t\t\t\t{$dayDivs}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div style=\"margin-top:-" . (11 * 6 + 22 * 18 + 1) . "px;\">\n\t\t\t\t\t\t\t\t{$eventsDiv}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>";
             } else {
                 if ($events != null) {
                     foreach ($events as $time => $ev) {
                         foreach ($ev as $v) {
                             $entry .= $v->getMinimal($D->time());
                         }
                     }
                 }
                 if ($holidays != null) {
                     foreach ($holidays as $ev) {
                         foreach ($ev as $v) {
                             $entry .= $v->getMinimal($D->time());
                         }
                     }
                 }
             }
             $BD = new Button("Tagesansicht", "./ubiquitous/Kalender/showDetails.png");
             $BD->type("icon");
             $BD->rmePCR("mKalender", "-1", "setView", array("'tag'", "'" . $D->time() . "'"), "contentManager.loadFrame('contentScreen','mKalender');");
             $BD->style("float:left;");
             $BN = "";
             if (Session::isPluginLoaded("mTodo")) {
                 $BN = new Button("Neuer Termin", "./ubiquitous/Kalender/addToDo.png");
                 $BN->type("icon");
                 $BN->popup("", "Neuer Termin", "mKalender", "-1", "newTodo", array("-1", $D->time(), "'Kalender'", "-1"), "", "Kalender.popupOptions");
                 $BN->style("float:left;margin-left:5px;");
             }
             #".((date("m.Y",$D->time()) != date("m.Y",$currentMonth->time())) ? "color:grey;" : "")."
             if ($j < $cols) {
                 $html .= "\n\t\t\t\t<td\n\t\t\t\t\tstyle=\"vertical-align:top;padding:0px;\"\n\t\t\t\t\tclass=\"" . ((date("d.m.Y", $D->time()) == date("d.m.Y") and $ansicht != "tag") ? "backgroundColor1" : "") . " Day borderColor1\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle=\"" . ($ansicht == "tag" ? "display:none;" : "") . "height:21px;padding-top:2px;padding-left:5px;text-align:right;padding-right:5px;\"\n\t\t\t\t\t\tclass=\"innerCellTitle\">\n\t\t\t\t\t\t" . ($ansicht != "tag" ? "<span class=\"dayOptions\">{$BD}{$BN}</span>" : "") . "\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tstyle=\"color:grey;\">\n\t\t\t\t\t\t\t" . ($ansicht != "tag" ? date("d", $D->time()) : "&nbsp;") . "\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"overflow:auto;" . ($ansicht == "monat" ? "margin-top:0px;width:100%;" : "") . "\" class=\"" . ($ansicht == "monat" ? "innerCellHeight" : "") . "\">{$entry}</div>\n\t\t\t\t</td>";
             }
             $D->addDay();
         }
         for ($j = 0; $j < 7 - $cols; $j++) {
             $D->addDay();
         }
         $html .= "\n\t\t\t</tr>";
     }
     $html .= "\n\t\t</table>";
     return $html;
 }
Exemple #8
0
 public static function getCalendarCategories()
 {
     $tabs = array();
     $bps = BPS::getAllProperties("mKalenderGUI");
     $tabs[] = new stdClass();
     $tabs[0]->onclick = OnEvent::reload("Screen", "_mKalenderGUI;KID:" . Session::currentUser()->getID());
     $tabs[0]->elementID = "TodoCurrentUser";
     $tabs[0]->label = "Mein Kalender";
     $tabs[0]->isCurrent = (!isset($bps["KID"]) or $bps["KID"] == Session::currentUser()->getID());
     $ACS = anyC::get("Userdata", "name", "shareCalendarTo" . Session::currentUser()->getID());
     $ACS->addAssocV3("name", "=", "shareCalendarTo0", "OR");
     while ($Share = $ACS->getNextEntry()) {
         $U = new User($Share->A("UserID"));
         $C = new stdClass();
         $C->onclick = OnEvent::reload("Screen", "_mKalenderGUI;KID:" . $U->getID());
         $C->elementID = "TodoCurrentUser";
         $C->label = $U->A("name");
         $C->isCurrent = $bps["KID"] == $U->getID();
         $tabs[] = $C;
     }
     return $tabs;
 }
 public function getTable($GUI)
 {
     $bps = BPS::getAllProperties("mKalenderGUI");
     $K = $GUI->getData($this->first, $this->last, isset($bps["KID"]) ? $bps["KID"] : Session::currentUser()->getID());
     $cols = $this->cols;
     $rows = $this->rows;
     $html = "<div style=\"border-top:1px solid #DDD;width:" . ($cols * 65 + 80) . "px;\">";
     $D = clone $this->date;
     for ($i = 0; $i < $rows; $i++) {
         #if($i == 0){
         $html .= "<div style=\"width:" . ($cols * 65 + 80) . "px;\">" . "<div class=\"backgroundColor3\" style=\"vertical-align:top;display:inline-block;width:76px;padding:2px;\">" . Util::CLMonthName($i + 1) . "</div>";
         for ($j = 0; $j < $cols; $j++) {
             $Max = $D->getMaxDaysOfMonth();
             $day = "&nbsp;";
             if ($j < $Max) {
                 $day = $j + 1;
             }
             $html .= "<div class=\"MonthDay MonthDayHeader backgroundColor3\" style=\"vertical-align:top;display:inline-block;width:60px;padding:2px;text-align:right;color:grey;\"><small>{$day}</small></div>";
         }
         $html .= "</div>";
         #}
         $html .= "<div style=\"width:" . ($cols * 65 + 80) . "px;height:300px;min-height:70px;border-bottom:0px;\" class=\"Month\">" . "<div style=\"vertical-align:top;display:inline-block;width:80px;\"></div>";
         $DM = clone $D;
         $monthFirst = $DM->time();
         $DM->setToMonthLast();
         $monthLast = $DM->time();
         $K->getEventsOnDay(date("dmY", $DM->time()));
         //initializes data
         #echo Util::CLDateParser($monthFirst)."-".Util::CLDateParser($monthLast).":";
         $hasMultiDay = $K->hasMultiDayEvents($monthFirst, $monthLast);
         for ($j = 0; $j < $cols; $j++) {
             $bgColor = "none";
             if (date("w", $D->time()) == 6) {
                 $bgColor = $this->colorBgSaturday;
             }
             if (date("w", $D->time()) == 0) {
                 $bgColor = $this->colorBgSunday;
             }
             if ($j >= $D->getMaxDaysOfMonth()) {
                 $bgColor = "none";
             }
             $html .= "<div class=\"MonthDay\" style=\"background-Color:{$bgColor};position:relative;min-height:70px;display:inline-block;width:64px;vertical-align:top;\">";
             if ($j < $D->getMaxDaysOfMonth()) {
                 $entry = "";
                 $events = $K->getEventsOnDay(date("dmY", $D->time()));
                 $holidays = $K->getHolidaysOnDay(date("dmY", $D->time()));
                 $entry .= "<div class=\"MonthMultiDay backgroundColor4\" style=\"min-height:" . $hasMultiDay * 17 . "px;\">";
                 if ($events != null) {
                     foreach ($events as $ev) {
                         foreach ($ev as $v) {
                             $entry .= $v->getMinimal($D->time());
                         }
                     }
                 }
                 $entry .= "</div>";
                 if ($holidays != null) {
                     foreach ($holidays as $ev) {
                         foreach ($ev as $v) {
                             $entry .= $v->getMinimal($D->time());
                         }
                     }
                 }
                 $html .= $entry;
             }
             $html .= "</div>";
             if ($D->d() >= $D->getMaxDaysOfMonth()) {
                 continue;
             }
             $D->addDay();
         }
         $D->addDay();
         $html .= "</div>";
     }
     $html .= "</div>";
     return $html . OnEvent::script("\$j('.Month').each(function(k, v){ var max = 0; max += \$j(this).find('.MonthMultiDay').outerHeight(); \$j(this).find('.MonthDay').each(function(k, v){ var l =\$j(this).find('div').each(function(){ var mt = parseInt(\$j(this).css('margin-top')); if(mt > max) max = mt + \$j(this).outerHeight(); }); }); \$j(this).css('height', max + \$j('.MonthDayHeader').outerHeight()).find('.MonthDay').css('height', max + \$j('.MonthDayHeader').outerHeight()); })");
     #"<table id=\"KalenderHeader\" style=\"position:absolute;margin-left:10px;border-spacing: 0px;width:auto;\" class=\"backgroundColor0\">
     $tableHeader = "\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th style=\"border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#EEE;padding-top:10px;text-align:right;\" class=\"backgroundColor0\">Monat</th>";
     for ($j = 0; $j < $this->cols; $j++) {
         $tableHeader .= "\n\t\t\t\t<th style=\"border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#EEE;padding-top:10px;\" class=\"backgroundColor0\">" . ($j + 1) . "</th>";
     }
     $tableHeader .= "\n\t\t</tr>\n\t\t</thead>\n\t\t";
     #</table>
     $html = "\n\t\t\t\n\t\t<div style=\"\">\n\t\t<!--<table id=\"KalenderHeader\" style=\"position:absolute;margin-left:10px;border-spacing: 0px;\">\n\t\t\t{$tableHeader}\n\t\t</table>-->\n\t\t<table style=\"margin-left:10px;border-spacing: 0px;\" id=\"KalenderTable\">\n\t\t\t<colgroup>\n\t\t\t\t<col></col>";
     for ($j = 0; $j < $cols; $j++) {
         #
         $html .= "\n\t\t\t\t<col style=\"width:" . 100 / $cols . "%;\" />";
     }
     $html .= "\n\t\t{$tableHeader}\n\t\t<tbody>";
     $D = clone $this->date;
     for ($i = 0; $i < $rows; $i++) {
         $html .= "\n\t\t\t<tr class=\"cellHeight\">\n\t\t\t\t<td class=\"Day borderColor1 backgroundColor3\" style=\"text-align:right;\">" . Util::CLMonthName($i + 1) . "</td>";
         for ($j = 0; $j < $cols; $j++) {
             $entry = "";
             $events = $K->getEventsOnDay(date("dmY", $D->time()));
             $holidays = $K->getHolidaysOnDay(date("dmY", $D->time()));
             #$hasMultiDay = $K->hasMultiDayEvents($this->first, $this->last);
             if ($events != null) {
                 foreach ($events as $ev) {
                     foreach ($ev as $v) {
                         $entry .= $v->getMinimal($D->time());
                     }
                 }
             }
             if ($holidays != null) {
                 foreach ($holidays as $ev) {
                     foreach ($ev as $v) {
                         $entry .= $v->getMinimal($D->time());
                     }
                 }
             }
             $bgColor = "none";
             if (date("w", $D->time()) == 6) {
                 $bgColor = $this->colorBgSaturday;
             }
             if (date("w", $D->time()) == 0) {
                 $bgColor = $this->colorBgSunday;
             }
             #".((date("m.Y",$D->time()) != date("m.Y",$currentMonth->time())) ? "color:grey;" : "")."
             if ($j < $cols) {
                 $html .= "\n\t\t\t\t<td\n\t\t\t\t\tstyle=\"vertical-align:top;padding:0px;background-color:{$bgColor};overflow:auto;\"\n\t\t\t\t\tclass=\"" . (date("d.m.Y", $D->time()) == date("d.m.Y") ? "backgroundColor1" : "") . " Day borderColor1\">\n\t\t\t\t\t<div style=\"font-size:10px;\">{$entry}</div>\n\t\t\t\t</td>";
             }
             $D->addDay();
             #if(date("d", $D->time()) == 1){
             #for(;$j < $cols;$j++)
             #	$html .= "<td class=\"Day borderColor1\"></td>";
             #}
         }
         $html .= "\n\t\t\t</tr>";
     }
     $html .= "\n\t\t\t</tbody>\n\t\t</table>\n\t\t</div>";
     #.OnEvent::script("\$j('#KalenderTable thead th').each(function(k, v){ \$j(\$j('#KalenderHeader thead th').get(k)).css('width', \$j(v).width()); console.log(\$j(v).width()); }); \$j('#KalenderHeader').css('width', \$j('#KalenderTable').width())");#.OnEvent::script("\$j('#KalenderTable').fixedHeaderTable({ footer: false, cloneHeadToFoot: false, fixedColumn: true });");
     return $html;
 }