function SemScheduleWeek($start_hour = '', $end_hour = '', $show_days = '', $start_date = '') { parent::ScheduleWeek($start_hour, $end_hour, $show_days, $start_date, false); //the base_date have to be 0:00 $first_monday = date("j", $this->start_date) - (date("w", $this->start_date) - 1); if (date("w", $this->start_date) > 1) { $first_monday += 7; } $this->base_date = mktime(0, 0, 0, date("n", $this->start_date), $first_monday, date("Y", $this->start_date)); }
function showScheduleGraphical($print_view = false) { global $RELATIVE_PATH_RESOURCES, $cssSw, $view_mode, $ActualObjectPerms; $categories["na"] = 4; $categories["sd"] = 4; $categories["y"] = 3; $categories["m"] = 3; $categories["w"] = 0; $categories["d"] = 2; //an assign for a date corresponding to a (seminar-)metadate $categories["meta"] = 1; //match start_time & end_time for a whole week $dow = date ("w", $this->start_time); if (date ("w", $this->start_time) >1) $offset = 1 - date ("w", $this->start_time); if (date ("w", $this->start_time) <1) $offset = -6; //select view to jump from the schedule if ($this->used_view == "openobject_schedule") $view = "openobject_assign"; else $view = "edit_object_assign"; $start_time = mktime (0, 0, 0, date("n",$this->start_time), date("j", $this->start_time)+$offset+($this->week_offset*7), date("Y", $this->start_time)); $end_time = mktime (23, 59, 59, date("n",$start_time), date("j", $start_time)+6, date("Y", $start_time)); if ($_SESSION['resources_data']["schedule_time_range"] == -1) { $start_hour = 0; $end_hour = 12; } elseif ($_SESSION['resources_data']["schedule_time_range"] == 1) { $start_hour = 12; $end_hour = 23; } else { $start_hour = 8; $end_hour = 22; } $schedule = new ScheduleWeek($start_hour, $end_hour, FALSE, $start_time, true); if ($ActualObjectPerms->havePerm("autor")) $schedule->add_link = "resources.php?cancel_edit_assign=1&quick_view=$view&quick_view_mode=".$view_mode."&add_ts="; //fill the schedule $assign_events=new AssignEventList ($start_time, $end_time, $this->resource_id, '', '', TRUE, $_SESSION['resources_data']["show_repeat_mode"]); while ($event=$assign_events->nextEvent()) { $repeat_mode = $event->getRepeatMode(TRUE); $add_info = ''; if ($event->getOwnerType() == 'date') { $sem_obj = Seminar::GetInstance(Seminar::GetSemIdByDateId($event->getAssignUserId())); $date = new SingleDate($event->getAssignUserId()); $dozenten = array_intersect_key($sem_obj->getMembers('dozent'), array_flip($date->getRelatedPersons())); $sem_doz_names = array_map(create_function('$a', 'return $a["Nachname"];'), array_slice($dozenten,0,3, true)); $add_info = '(' . join(', ', $sem_doz_names) . ')'; } $schedule->addEvent($event->getName(get_config('RESOURCES_SCHEDULE_EXPLAIN_USER_NAME')), $event->getBegin(), $event->getEnd(), URLHelper::getLink('?cancel_edit_assign=1&quick_view=' . $view . '&quick_view_mode='.$view_mode.'&edit_assign_object='.$event->getAssignId()), $add_info, $categories[$repeat_mode]); } ?> <table border=0 celpadding=2 cellspacing=0 width="99%" align="center"> <tr> <td class="<? $cssSw->switchClass(); echo $cssSw->getClass() ?>" width="4%"> </td> <td class="<? echo $cssSw->getClass() ?> hidden" width="10%" align="left"> <a href="<? echo URLHelper::getLink('?quick_view='.$this->used_view.'&quick_view_mode='.$view_mode.'&previous_week=TRUE') ?> "><?= Icon::create('arr_2left', 'clickable', ['title' => _("Vorherige Woche anzeigen")])->asImg(16, ["alt" => _("Vorherige Woche anzeigen"), "border" => 0]) ?></a> </td> <td class="<? echo $cssSw->getClass() ?>" width="76%" align="center" style="font-weight:bold"> <? printf(_("Anzeige der Woche vom %s bis %s (KW %s)"), strftime("%x", $start_time), strftime("%x", $end_time),strftime("%V", $start_time));?> <br> <?php $this->showSemWeekNumber($start_time); ?> <br> <?php $room = ResourceObject::Factory($this->resource_id); echo "Raum: ".htmlReady($room->getName()); ?> </td> <td class="<? echo $cssSw->getClass() ?> hidden" width="10%" align="center"> <a href="<? echo URLHelper::getLink('?quick_view='.$this->used_view.'&quick_view_mode='.$view_mode.'&next_week=TRUE')?>"><?= Icon::create('arr_2right', 'clickable', ['title' => _("Nächste Woche anzeigen")])->asImg(16, ["alt" => _("Nächste Woche anzeigen"), "border" => 0]) ?></a> </td> </tr> <tr> <td class="<? $cssSw->switchClass(); echo $cssSw->getClass() ?> hidden" width="4%" align="center" valign="bottom"> <? if ((!$_SESSION['resources_data']["schedule_time_range"]) || ($_SESSION['resources_data']["schedule_time_range"] == 1)): ?> <a href="<?= URLHelper::getLink('', array('quick_view' => $this->used_view, 'quick_view_mode' => $view_mode, 'time_range' => $_SESSION['resources_data']['schedule_time_range'] ? 'FALSE' : -1)) ?>"> <?= Icon::create('arr_2up', 'clickable', ['title' => _('Frühere Belegungen anzeigen')])->asImg(['class' => 'middle']) ?> </a> <? endif; ?> </td> <td class="<? echo $cssSw->getClass() ?>" width="76%" colspan="2"> <? echo " <font size=-1>"._("Anzahl der Belegungen in diesem Zeitraum:")." ", $assign_events->numberOfEvents()."</font><br> "; ?> </td> <td class="<? echo $cssSw->getClass() ?> hidden" width="20%" nowrap> <? print "<select style=\"font-size:10px;\" name=\"show_repeat_mode\">"; printf ("<option style=\"font-size:10px;\" %s value=\"all\">"._("alle Belegungen")."</option>", ($_SESSION['resources_data']["show_repeat_mode"] == "all") ? "selected" : ""); printf ("<option %s style=\"font-size:10px;\" value=\"single\">"._("nur Einzeltermine")."</option>", ($_SESSION['resources_data']["show_repeat_mode"] == "single") ? "selected" : ""); printf ("<option %s style=\"font-size:10px;\" value=\"repeated\">"._("nur Wiederholungstermine")."</option>", ($_SESSION['resources_data']["show_repeat_mode"] == "repeated") ? "selected" : ""); print "</select>"; print " " . Icon::create('accept', 'accept', ['title' => _("Ansicht umschalten")])->asInput(["type" => "image", "class" => "middle", "name" => "send_schedule_repeat_mode"]); ?> </td> </tr> <tr> <td class="<? echo $cssSw->getClass() ?> hidden" width="4%"> </td> <td class="<? echo $cssSw->getClass() ?>" width="96%" colspan="3"> <? $schedule->showSchedule("html", $print_view); ?> </td> </tr> <tr> <td class="<? echo $cssSw->getClass() ?> hidden" width="4%" align="center" valign="bottom"> <? if ((!$_SESSION['resources_data']['schedule_time_range']) || ($_SESSION['resources_data']['schedule_time_range'] == -1)): ?> <a href="<?= URLHelper::getLink('', array('quick_view' => $this->used_view, 'quick_view_mode' => $view_mode, 'time_range' => $_SESSION['resources_data']['schedule_time_range'] ? 'FALSE' : 1)) ?>"> <?= Icon::create('arr_2down', 'clickable', ['title' => _('Spätere Belegungen anzeigen')])->asImg() ?> </a> <? endif; ?> </td> <td class="<? echo $cssSw->getClass() ?>" width="20%" nowrap colspan="3"> </td> </tr> </table> </form> <? }
function ScheduleWeekRequests($start_hour = '', $end_hour = '', $show_days = '', $start_date = '', $show_dates = true) { parent::ScheduleWeek($start_hour, $end_hour, $show_days, $start_date); $this->categories[5] = array("bg-picture" => Assets::image_path('calendar/category12_small.jpg'), "border-color" => "#d082b0"); $this->categories[6] = array("bg-picture" => Assets::image_path('calendar/category10_small.jpg'), "border-color" => "#ffbd33"); }