function ShowGroupSchedulesDaily ($group_id, $start_time, $resources_groups = null) { $this->dow = false; $this->group_id = $group_id; parent::ShowSemSchedules(null, null, null); $this->start_time = $start_time ? strtotime('midnight', $start_time) : strtotime('today'); $this->end_time = strtotime('tomorrow', $this->start_time) - 1; if(is_object($resources_groups)) $this->resources_groups = $resources_groups; else $this->resources_groups = RoomGroups::GetInstance(); }
public static function GetInstance($refresh_cache = false){ if ($refresh_cache){ self::$room_group_object = null; } if (is_object(self::$room_group_object)){ return self::$room_group_object; } else { self::$room_group_object = new RoomGroups(); return self::$room_group_object; } }
$semester = new SemesterData; $all_semester = $semester->getAllSemesterData(); $reqObj = new RoomRequest($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["request_id"]); $semObj = Seminar::GetInstance($reqObj->getSeminarId(), true); $multiOverlaps = new CheckMultipleOverlaps(); $semResAssign = new VeranstaltungResourcesAssign($semObj->getId()); //add the requested ressource to selection if ($reqObj->getResourceId()) $_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["considered_resources"][$reqObj->getResourceId()] = array("type"=>"requested"); //add resource_ids from room groups if (get_config('RESOURCES_ENABLE_GROUPING')){ $room_group = RoomGroups::GetInstance(); $group_id = $_SESSION['resources_data']['actual_room_group']; if ($room_group->getGroupCount($group_id)){ foreach ($room_group->getGroupContent($group_id) as $val) { $_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["considered_resources"][$val] = array("type"=>"grouped"); } } } //add the matching ressources to selection if (getGlobalPerms($user->id) != "admin") $resList = new ResourcesUserRoomsList ($user->id, FALSE, FALSE); $matching_resources = $reqObj->searchRooms(FALSE, TRUE, 0, 0, TRUE, (is_object($resList)) ? array_keys($resList->getRooms()) : FALSE); if ($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["search_limit_high"] > $reqObj->last_search_result_count) { $_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["search_limit_high"] = $reqObj->last_search_result_count; }
/** * * @param $request_id */ function showRequest($request_id) { global $cssSw, $perm; $reqObj = new RoomRequest($request_id); $semObj = new Seminar($reqObj->getSeminarId()); $sem_link = $perm->have_studip_perm('tutor', $semObj->getId()) ? "seminar_main.php?auswahl=" . $semObj->getId() : "dispatch.php/course/details/?sem_id=" . $semObj->getId() . "&send_from_search=1&send_from_search_page=" . URLHelper::getLink("resources.php?working_on_request=$request_id"); ?> <form method="POST" action="<?echo URLHelper::getLink('?working_on_request=' . $request_id);?>"> <?php echo CSRFProtection::tokenTag(); ?> <input type="hidden" name="view" value="edit_request"> <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() ?>" colspan="2" width="96%" valign="top"> <a href="<?php echo URLHelper::getLink($sem_link); ?> "> <b><?php echo $semObj->seminar_number ? htmlReady($semObj->seminar_number) . ':' : ''; echo htmlReady($semObj->getName()); ?> </b> </a> <font size="-1"> <br> <? $names = $this->selectSemInstituteNames($semObj->getInstitutId()); print " "._("Art der Anfrage").": ".$reqObj->getTypeExplained()."<br>"; print " "._("Erstellt von").": <a href=\"".URLHelper::getLink('dispatch.php/profile?username='******'%x %H:%M', $reqObj->mkdate) . '<br>'; print " "._("Letzte Änderung") . ": ". strftime('%x %H:%M', $reqObj->chdate) . '<br>'; print " "._("Letzte Änderung von") . ": <a href=\"".URLHelper::getLink('dispatch.php/profile?username='******': '; foreach ($semObj->getMembers('dozent') as $doz) { if ($dozent){ echo ", "; } echo '<a href ="'. URLHelper::getLink('dispatch.php/profile?username='******'username']). '">'.HtmlReady($doz['fullname'])."</a>"; $dozent = true; } print "<br>"; print " "._("verantwortliche Einrichtung").": ".htmlReady($names['inst_name'])."<br>"; print " "._("verantwortliche Fakultät").": ".htmlReady($names['fak_name'])."<br>"; print " "._("aktuelle Teilnehmerzahl").": ".$semObj->getNumberOfParticipants('total').'<br>'; ?> </font> </td> </tr> <tr> <td class="<? $cssSw->switchClass(); echo $cssSw->getClass() ?>" width="4%"> </td> <td class="<? echo $cssSw->getClass() ?>" width="35%" valign="top"> <font size="-1"><b><?php echo _("angeforderte Belegungszeiten"); ?> :</b><br><br> <? $dates = $semObj->getGroupedDates($reqObj->getTerminId(),$reqObj->getMetadateId()); if ($dates['first_event']) { $i = 1; if(is_array($dates['info']) && sizeof($dates['info']) > 0 ){ foreach ($dates['info'] as $info) { $name = $info['name']; if ($info['weekend']) $name = '<span style="color:red">'. $info['name'] . '</span>'; printf ("<font color=\"blue\"><i><b>%s</b></i></font>. %s<br>", $i, $name); $i++; } } if ($reqObj->getType() != 'date') { echo _("regelmäßige Buchung ab").": ".strftime("%x", $dates['first_event']); } } else { print _("nicht angegeben"); } ?> </font> </td> <td style="border-left:1px dotted black; background-color: #f3f5f8" width="51%" rowspan="4" valign="top"> <table cellpadding="2" cellspacing="0" border="0" width="90%"> <tr> <td width="70%"> <font size="-1"><b><?php echo _("angeforderter Raum"); ?> :</b></font> </td> <? unset($resObj); $cols=0; if (is_array($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["groups"])) foreach ($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["groups"] as $key => $val) { $cols++; print "<td width=\"1%\" align=\"left\"><font size=\"-1\" color=\"blue\"><i><b>".$cols.".</b></i></font></td>"; } ?> <td width="29%" align="right"> <!--<font style="font-size:10px;color:blue;"><?//=_("Kapazität")?></font>--> </td> </tr> <tr> <td width="70%"> <? if ($request_resource_id = $reqObj->getResourceId()) { $resObj = ResourceObject::Factory($request_resource_id); print $resObj->getFormattedLink($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["first_event"]); print tooltipicon(_('Der ausgewählte Raum bietet folgende der wünschbaren Eigenschaften:') . "\n" . $resObj->getPlainProperties(TRUE), $resObj->getOwnerId() == 'global'); if ($resObj->getOwnerId() == 'global') { print ' [global]'; } } else print _("Es wurde kein Raum angefordert."); ?> </td> <? $i=0; if(is_array($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["groups"]) && sizeof($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["groups"]) > 0 ) foreach ($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["groups"] as $key => $val) { print "<td width=\"1%\" nowrap><font size=\"-1\">"; if ($request_resource_id) { if ($request_resource_id == $val["resource_id"]) { print Icon::create('accept', 'accept', ['title' => _("Dieser Raum ist augenblicklich gebucht"), TRUE])->asImg(); echo '<input type="radio" name="selected_resource_id['. $i .']" value="'. $request_resource_id .'" checked="checked">'; } else { $overlap_status = $this->showGroupOverlapStatus($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["detected_overlaps"][$request_resource_id], $val["events_count"], $val["overlap_events_count"][$request_resource_id], $val["termin_ids"]); print $overlap_status["html"]; printf ("<input type=\"radio\" name=\"selected_resource_id[%s]\" value=\"%s\" %s %s>", $i, $request_resource_id, ($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["selected_resources"][$i] == $request_resource_id) ? "checked" : "", ($overlap_status["status"] == 2 || !ResourcesUserRoomsList::CheckUserResource($request_resource_id)) ? "disabled" : ""); } } else print " "; print "</font></td>"; $i++; } ?> <td width="29%" align="right"> <? if (is_object($resObj)) { $seats = $resObj->getSeats(); $requested_seats = $reqObj->getSeats(); if ((is_numeric($seats)) && (is_numeric($requested_seats))) { $percent_diff = (100 / $requested_seats) * $seats; if ($percent_diff > 0) $percent_diff = "+".$percent_diff; if ($percent_diff < 0) $percent_diff = "-".$percent_diff; print "<font style=\"font-size:10px;\">".round($percent_diff)."%</font>"; } } ?> </td> </tr> <? if (get_config('RESOURCES_ENABLE_GROUPING')) { $room_group = RoomGroups::GetInstance(); $group_id = $_SESSION['resources_data']['actual_room_group']; ?> <tr> <td style="border-top:1px solid;" width="100%" colspan="<?php echo $cols + 2; ?> "> <font size="-1"><b><?php echo _("Raumgruppe berücksichtigen"); ?> :</b></font> </td> </tr> <tr> <td colspan="<?php echo $cols; ?> "><font size="-1"> <select name="request_tool_choose_group"> <option <?php echo is_null($group_id) ? 'selected' : ''; ?> value="-"><?php echo _("Keine Raumgruppe anzeigen"); ?> </option> <? foreach($room_group->getAvailableGroups() as $gid){ echo '<option value="'.$gid.'" ' . (!is_null($group_id) && $group_id == $gid ? 'selected' : '') . '>' .htmlReady(my_substr($room_group->getGroupName($gid),0,45)) .' ('.$room_group->getGroupCount($gid).')</option>'; } ?> </select> </font> </td> <td colspan="2"><font size="-1"> <?php echo Button::create(_('Auswählen'), 'request_tool_group'); ?> <br> </font> </td> </tr> <? if ($room_group->getGroupCount($group_id)){ foreach ($room_group->getGroupContent($group_id) as $key) { ?> <tr> <td width="70%"> <? $resObj = ResourceObject::Factory($key); print $resObj->getFormattedLink($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["first_event"]); print tooltipicon(_('Der ausgewählte Raum bietet folgende der wünschbaren Eigenschaften:') . "\n" . $resObj->getPlainProperties(TRUE), $resObj->getOwnerId() == 'global'); if ($resObj->getOwnerId() == 'global') { print ' [global]'; } ?> </td> <? $i=0; if (is_array($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["groups"])) { foreach ($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["groups"] as $key2 => $val2) { print "<td width=\"1%\" nowrap><font size=\"-1\">"; if ($key == $val2["resource_id"]) { print Icon::create('accept', 'accept', ['title' => _("Dieser Raum ist augenblicklich gebucht"), TRUE])->asImg(); echo '<input type="radio" name="selected_resource_id['. $i .']" value="'. $key .'" checked="checked">'; } else { $overlap_status = $this->showGroupOverlapStatus($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["detected_overlaps"][$key], $val2["events_count"], $val2["overlap_events_count"][$resObj->getId()], $val2["termin_ids"]); print $overlap_status["html"]; printf ("<input type=\"radio\" name=\"selected_resource_id[%s]\" value=\"%s\" %s %s>", $i, $key, ($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["selected_resources"][$i] == $key) ? "checked" : "", ($overlap_status["status"] == 2 || !ResourcesUserRoomsList::CheckUserResource($key)) ? "disabled" : ""); } print "</font></td>"; $i++; } } ?> <td width="29%" align="right"> <? if (is_object($resObj)) { $seats = $resObj->getSeats(); $requested_seats = $reqObj->getSeats(); if ((is_numeric($seats)) && (is_numeric($requested_seats))) { $percent_diff = (100 / $requested_seats) * $seats; if ($percent_diff > 0) $percent_diff = "+".$percent_diff; if ($percent_diff < 0) $percent_diff = "-".$percent_diff; print "<font style=\"font-size:10px;\">".round($percent_diff)."%</font>"; } } ?> </td> </tr> <? } } } ?> <tr> <td style="border-top:1px solid;" width="100%" colspan="<?php echo $cols + 2; ?> "> <font size="-1"><b><?php echo _("weitere passende Räume"); ?> :</b> </font> </td> </tr> <? if (is_array($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["considered_resources"])) foreach ($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["considered_resources"] as $key=>$val) { if ($val["type"] == "matching") $matching_rooms[$key] = TRUE; if ($val["type"] == "clipped") $clipped_rooms[$key] = TRUE; if ($val["type"] == "grouped") $grouped_rooms[$key] = TRUE; } if (sizeof($matching_rooms)) { // filter list to [search_limit_low]...[search_limit_high] $search_limit_low = $_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["search_limit_low"]; $search_limit_high = $_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["search_limit_high"]; $matching_rooms = array_slice($matching_rooms, $search_limit_low, $search_limit_high - $search_limit_low); foreach ($matching_rooms as $key=>$val) { ?> <tr> <td width="70%"> <? $resObj = ResourceObject::Factory($key); print $resObj->getFormattedLink($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["first_event"]); print tooltipicon(_('Der ausgewählte Raum bietet folgende der wünschbaren Eigenschaften:') . "\n" . $resObj->getPlainProperties(TRUE), $resObj->getOwnerId() == 'global'); if ($resObj->getOwnerId() == 'global') { print ' [global]'; } ?> </td> <? $i=0; if (is_array($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["groups"])) { foreach ($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["groups"] as $key2 => $val2) { print "<td width=\"1%\" nowrap><font size=\"-1\">"; if ($key == $val2["resource_id"]) { print Icon::create('accept', 'accept', ['title' => _("Dieser Raum ist augenblicklich gebucht"), TRUE])->asImg(); echo '<input type="radio" name="selected_resource_id['. $i .']" value="'. $key .'" checked="checked">'; } else { $overlap_status = $this->showGroupOverlapStatus($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["detected_overlaps"][$key], $val2["events_count"], $val2["overlap_events_count"][$resObj->getId()], $val2["termin_ids"]); print $overlap_status["html"]; printf ("<input type=\"radio\" name=\"selected_resource_id[%s]\" value=\"%s\" %s %s>", $i, $key, ($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["selected_resources"][$i] == $key) ? "checked" : "", ($overlap_status["status"] == 2 || !ResourcesUserRoomsList::CheckUserResource($key)) ? "disabled" : ""); } print "</font></td>"; $i++; } } ?> <td width="29%" align="right"> <? if (is_object($resObj)) { $seats = $resObj->getSeats(); $requested_seats = $reqObj->getSeats(); if ((is_numeric($seats)) && (is_numeric($requested_seats))) { $percent_diff = (100 / $requested_seats) * $seats; if ($percent_diff > 0) $percent_diff = "+".$percent_diff; if ($percent_diff < 0) $percent_diff = "-".$percent_diff; print "<font style=\"font-size:10px;\">".round($percent_diff)."%</font>"; } } ?> </td> </tr> <? } ?> <tr> <td colspan="<?php echo $cols + 2; ?> " align="center"> <font size="-1"> <?php echo _("zeige Räume"); ?> <a href="<?php echo URLHelper::getLink('?dec_limit_low=1'); ?> ">-</a> <input type="text" name="search_rooms_limit_low" size="1" value="<?php echo $_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["search_limit_low"] + 1; ?> "> <a href="<?php echo URLHelper::getLink('?inc_limit_low=1'); ?> ">+</a> bis <a href="<?php echo URLHelper::getLink('?dec_limit_high=1'); ?> ">-</a> <input type="text" name="search_rooms_limit_high" size="1" value="<?php echo $_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["search_limit_high"]; ?> "> <a href="<?php echo URLHelper::getLink('?inc_limit_high=1'); ?> ">+</a> <?php echo Icon::create('arr_2up', 'sort', ['title' => 'ausgewählten Bereich anzeigen'])->asInput(array('name' => 'matching_rooms_limit_submit')); ?> </font> </td> </tr> <? } else print "<tr><td width=\"100%\" colspan=\"".($cols+1)."\"><font size=\"-1\">"._("keine gefunden")."</font></td></tr>"; //Clipped Rooms if (sizeof($clipped_rooms)) { ?> <tr> <td style="border-top:1px solid;" width="100%" colspan="<?php echo $cols + 2; ?> "> <font size="-1"><b><?php echo _("Räume aus der Merkliste"); ?> :</b></font> </td> </tr> <? foreach ($clipped_rooms as $key=>$val) { ?> <tr> <td width="70%"> <? $resObj = ResourceObject::Factory($key); print $resObj->getFormattedLink($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["first_event"]); print tooltipicon(_('Der ausgewählte Raum bietet folgende der wünschbaren Eigenschaften:') . "\n" . $resObj->getPlainProperties(TRUE), $resObj->getOwnerId() == 'global'); if ($resObj->getOwnerId() == 'global') { print ' [global]'; } ?> </td> <? $i=0; if (is_array($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["groups"])) { foreach ($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["groups"] as $key2 => $val2) { print "<td width=\"1%\" nowrap><font size=\"-1\">"; if ($key == $val2["resource_id"]) { print Icon::create('accept', 'clickable', ['title' => _('Dieser Raum ist augenblicklich gebucht'), TRUE])->asImg(); } else { $overlap_status = $this->showGroupOverlapStatus($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["detected_overlaps"][$key], $val2["events_count"], $val2["overlap_events_count"][$resObj->getId()], $val2["termin_ids"]); print $overlap_status["html"]; printf ("<input type=\"radio\" name=\"selected_resource_id[%s]\" value=\"%s\" %s %s>", $i, $key, ($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["selected_resources"][$i] == $key) ? "checked" : "", ($overlap_status["status"] == 2 || !ResourcesUserRoomsList::CheckUserResource($key)) ? "disabled" : ""); } print "</font></td>"; $i++; } } ?> <td width="29%" align="right"> <? if (is_object($resObj)) { $seats = $resObj->getSeats(); $requested_seats = $reqObj->getSeats(); if ((is_numeric($seats)) && (is_numeric($requested_seats))) { $percent_diff = (100 / $requested_seats) * $seats; if ($percent_diff > 0) $percent_diff = "+".$percent_diff; if ($percent_diff < 0) $percent_diff = "-".$percent_diff; print "<font style=\"font-size:10px;\">".round($percent_diff)."%</font>"; } } ?> </td> </font></td> </tr> <? } } ?> </table> </td> </tr> <tr> <td class="<? $cssSw->switchClass(); echo $cssSw->getClass() ?>" width="4%"> </td> <td class="<? echo $cssSw->getClass() ?>" width="35%" valign="top"> <font size="-1"><b><?php echo _("gewünschte Raumeigenschaften"); ?> :</b><br><br> <? $properties = $reqObj->getProperties(); if (sizeof($properties)) { ?> <table width="99%" cellspacing="0" cellpadding="2" border="0"> <? foreach ($properties as $key=>$val) { ?> <tr> <td width="70%"> <li><font size="-1"><?php echo htmlReady($val["name"]); ?> </font></li> </td> <td width="30%"><font size="-1"> <? switch ($val["type"]) { case "bool": /*printf ("%s", ($val["state"]) ? htmlReady($val["options"]) : " - ");*/ break; case "num": case "text": print htmlReady($val["state"]); break; case "select": $options=explode (";",$val["options"]); foreach ($options as $a) { if ($val["state"] == $a) print htmlReady($a); } break; } ?></font> </td> </tr> <? } ?> </table> <? } else print _("Es wurden keine Raumeigenschaften gewünscht."); ?> </font> </td> </tr> <tr> <td class="<? $cssSw->switchClass(); echo $cssSw->getClass() ?>" width="4%"> </td> <td class="<? echo $cssSw->getClass() ?>" width="35%" valign="top"> <font size="-1"><b><?php echo _("Kommentar des Anfragenden"); ?> :</b><br><br> <? if ($comment = $reqObj->getComment()) print $comment; else print _("Es wurde kein Kommentar eingegeben"); ?> </font> </td> </tr> <tr> <td class="<? $cssSw->switchClass(); echo $cssSw->getClass() ?>" width="4%"> </td> <td class="<? echo $cssSw->getClass() ?>" width="35%" valign="top"> <? $user_status_mkdate = $reqObj->getUserStatus($GLOBALS['user']->id); ?> <b><?php echo "Benachrichtigungen"; ?> :</b><br> <input type="radio" onChange="jQuery(this).closest('form').submit()" name="reply_recipients" id="reply_recipients_requester" value="requester" checked> <label for="reply_recipients_requester"> <?php echo _("Ersteller"); ?> </label> <input type="radio" onChange="jQuery(this).closest('form').submit()" name="reply_recipients" id="reply_recipients_lecturer" value="lecturer" <?php echo $reqObj->reply_recipients == 'lecturer' ? 'checked' : ''; ?> > <label for="reply_recipients_lecturer"> <?php echo _("Ersteller und alle Lehrenden"); ?> </label> <br> <b><?php echo "Anfrage markieren"; ?> :</b><br> <input type="radio" onChange="jQuery(this).closest('form').submit()" name="request_user_status" id="request_user_status_0" value="0" checked> <label for="request_user_status_0"> <?php echo _("unbearbeitet"); ?> </label> <input type="radio" onChange="jQuery(this).closest('form').submit()" name="request_user_status" id="request_user_status_1" value="1" <?php echo $user_status_mkdate ? 'checked' : ''; ?> > <label for="request_user_status_1"> <?php echo _("bearbeitet"); ?> </label> <br><br> <b><?php echo _("Kommentar zur Belegung (intern)"); ?> :</b><br><br> <textarea name="comment_internal" style="width: 90%" rows="2"></textarea> </td> </tr> <tr> <td class="<? $cssSw->switchClass(); echo $cssSw->getClass() ?>" width="4%"> </td> <td class="<? echo $cssSw->getClass() ?>" colspan="2" width="96%" valign="top" align="center"> <div class="button-group"> <? // can we dec? if ($_SESSION['resources_data']["requests_working_pos"] > 0) { $d = -1; if ($_SESSION['resources_data']["skip_closed_requests"]) while ((!$_SESSION['resources_data']["requests_open"][$_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"] + $d]["request_id"]]) && ($_SESSION['resources_data']["requests_working_pos"] + $d > 0)) $d--; if ((sizeof($_SESSION['resources_data']["requests_open"]) > 1) && (($_SESSION['resources_data']["requests_open"][$_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"] + $d]["request_id"]]) || (!$_SESSION['resources_data']["skip_closed_requests"]))) $inc_possible = TRUE; } if ($inc_possible) { echo Button::create('<< ' . _('Zurück'), 'dec_request'); } echo Button::createCancel(_('Abbrechen'), 'cancel_edit_request'); echo Button::create(_('Löschen'), 'delete_request'); if ((($reqObj->getResourceId()) || (sizeof($matching_rooms)) || (sizeof($clipped_rooms)) || (sizeof($grouped_rooms))) && ((is_array($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["groups"])) || ($_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"]]["assign_objects"]))) { echo Button::createAccept(_('Speichern'), 'save_state'); echo Button::createCancel(_('Ablehnen'), 'suppose_decline_request'); } // can we inc? if ($_SESSION['resources_data']["requests_working_pos"] < sizeof($_SESSION['resources_data']["requests_working_on"])-1) { $i = 1; if ($_SESSION['resources_data']["skip_closed_requests"]) while ((!$_SESSION['resources_data']["requests_open"][$_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"] + $i]["request_id"]]) && ($_SESSION['resources_data']["requests_working_pos"] + $i < sizeof($_SESSION['resources_data']["requests_working_on"])-1)) $i++; if ((sizeof($_SESSION['resources_data']["requests_open"]) > 1) && (($_SESSION['resources_data']["requests_open"][$_SESSION['resources_data']["requests_working_on"][$_SESSION['resources_data']["requests_working_pos"] + $i]["request_id"]]) || (!$_SESSION['resources_data']["skip_closed_requests"]))) $dec_possible = TRUE; } if ($dec_possible) { echo Button::create(_('Weiter') . ' >>', 'inc_request'); } ?> </div> <? if (sizeof($_SESSION['resources_data']["requests_open"]) > 1) printf ("<br><font size=\"-1\">" . _("<b>%s</b> von <b>%s</b> Anfragen in der Bearbeitung wurden noch nicht aufgelöst.") . "</font>", sizeof($_SESSION['resources_data']["requests_open"]), sizeof($_SESSION['resources_data']["requests_working_on"])); printf ("<br><font size=\"-1\">" . _("Aktueller Request: ")."<b>%s</b></font>", $_SESSION['resources_data']["requests_working_pos"]+1); ?> </td> </tr> </table> </form> <br><br> <? }
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; //select view to jump from the schedule if ($this->used_view == "openobject_schedule") $view = "openobject_assign"; else $view = "edit_object_assign"; $start_time = $this->start_time; $end_time = $this->end_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; } $room_group = RoomGroups::GetInstance(); if ($room_group->getGroupCount($this->group_id)){ $schedule=new SemGroupScheduleDayOfWeek($start_hour, $end_hour,$room_group->getGroupContent($this->group_id), $start_time, $this->dow); $schedule->add_link = "resources.php?cancel_edit_assign=1&quick_view=$view&quick_view_mode=".$view_mode."&add_ts="; $num_rep_events = 0; $num_single_events = 0; $num = 1; foreach ($room_group->getGroupContent($this->group_id) as $room_to_show_id => $room_id){ if ($_SESSION['resources_data']["show_repeat_mode"] == 'repeated' || $_SESSION['resources_data']["show_repeat_mode"] == 'all'){ $events = createNormalizedAssigns($room_id, $start_time, $end_time,get_config('RESOURCES_SCHEDULE_EXPLAIN_USER_NAME'), $this->dow); foreach($events as $id => $event){ $repeat_mode = $event['repeat_mode']; $add_info = ($event['sem_doz_names'] ? '('.$event['sem_doz_names'].') ' : ''); $add_info .= ($repeat_mode == 'w' && $event['repeat_interval'] == 1 ? '('._("wöchentlich").')' : ''); $add_info .= ($repeat_mode == 'w' && $event['repeat_interval'] > 1 ? '('.$event['repeat_interval'].'-'._("wöchentlich").')' : ''); $name = $event['name']; $schedule->addEvent($room_to_show_id, $name, $event['begin'], $event['end'], URLHelper::getLink('?show_object='.$room_id.'&cancel_edit_assign=1&quick_view='.$view.'&quick_view_mode='.$view_mode.'&edit_assign_object='.$event['assign_id']), $add_info, $categories[$repeat_mode]); ++$num_rep_events; } } // nur zukünftige Einzelbelegungen if ( ($end_time > time()) && ($_SESSION['resources_data']["show_repeat_mode"] == 'single' || $_SESSION['resources_data']["show_repeat_mode"] == 'all')){ $a_start_time = ($start_time > time() ? $start_time : time()); $a_end_time = $end_time; $assign_events = new AssignEventList ($a_start_time, $a_end_time, $room_id, '', '', TRUE, 'semschedulesingle', $this->dow); while ($event = $assign_events->nextEvent()) { //mehrtägige nur am passenden Tag anzeigen if ($event->repeat_mode == 'sd' && date('N', $event->begin) != $this->dow) continue; if(in_array($event->repeat_mode, array('w','d','m','y'))){ if(strftime('%u', $event->getBegin()) != $this->dow) continue; $assign = AssignObject::Factory($event->getAssignId()); switch($event->repeat_mode){ case 'd': $add_info = '('.sprintf(_("täglich, %s bis %s"), strftime('%x',$assign->getBegin()), strftime('%x',$assign->getRepeatEnd())).')'; break; case 'w': if($assign->getRepeatInterval() == 1) $add_info = '('._("wöchentlich").')'; else $add_info = '('.$assign->getRepeatInterval().'-'._("wöchentlich").')'; break; case 'm': if($assign->getRepeatInterval() == 1) $add_info = '('._("monatlich").')'; else $add_info = '('.$assign->getRepeatInterval().'-'._("monatlich").')'; break; case 'y': if($assign->getRepeatInterval() == 1) $add_info = '('._("jährlich").')'; else $add_info = '('.$assign->getRepeatInterval().'-'._("jährlich").')'; break; } } else { $add_info = ''; } $schedule->addEvent($room_to_show_id, 'EB'.$num++.':' . $event->getName(get_config('RESOURCES_SCHEDULE_EXPLAIN_USER_NAME')), $event->getBegin(), $event->getEnd(), URLHelper::getLink('?show_object='.$room_id.'&cancel_edit_assign=1&quick_view='.$view.'&quick_view_mode='.$view_mode.'&edit_assign_object='.$event->getAssignId()), $add_info, $categories[$event->repeat_mode]); ++$num_single_events; $single_assigns[] = $event; } } } } else { return; } if(!$print_view){ ?> <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() ?>" width="10%" align="left"> <a href="<?= URLHelper::getLink('?quick_view='.$this->used_view.'&quick_view_mode='.$view_mode.'&previous_day=1') ?>"> <?= Icon::create('arr_2left', 'clickable')->asImg(['class' => "middle", 'alt' => "Vorherigen Tag anzeigen", 'title' => "Vorherigen Tag anzeigen"]) ?> </a> </td> <td class="<? echo $cssSw->getClass() ?>" width="76%" align="center"> <b> <? printf(_("Wochentag: %s"), htmlReady(strftime('%A', $schedule->base_date))); echo '<br>' . htmlReady($this->semester['name']) . ' - ' . date ("d.m.Y", $start_time), " - ", date ("d.m.Y", $end_time); ?> </b> <br> </td> <td class="<? echo $cssSw->getClass() ?>" width="10%" align="center"> <a href="<?= URLHelper::getLink('?quick_view='.$this->used_view.'&quick_view_mode='.$view_mode.'&next_day=1') ?>"> <?= Icon::create('arr_2right', 'clickable')->asImg(['class' => "middle", 'alt' => _("Nächsten Tag anzeigen"), 'title' => _("Nächsten Tag anzeigen")]) ?> </td> </tr> <tr> <td class="<? $cssSw->switchClass(); echo $cssSw->getClass() ?>" 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"> <? if ($_SESSION['resources_data']["show_repeat_mode"] == 'repeated' || $_SESSION['resources_data']["show_repeat_mode"] == 'all'){ echo " <font size=-1>"._("Anzahl der regelmäßigen Belegungen in diesem Zeitraum:")." ".$num_rep_events."</font><br>"; } if ($_SESSION['resources_data']["show_repeat_mode"] == 'single' || $_SESSION['resources_data']["show_repeat_mode"] == 'all'){ echo " <font size=-1>"._("Anzahl der Einzelbelegungen in diesem Zeitraum:")." ".$num_single_events."</font><br>"; } ?> </td> <td class="<? echo $cssSw->getClass() ?>" 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() ?>" width="4%"> </td> <td class="<? echo $cssSw->getClass() ?>" width="96%" colspan="3"> <? $schedule->showSchedule("html"); ?> </td> </tr> <tr> <td class="<? echo $cssSw->getClass() ?>" 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' => _('Frühere Belegungen anzeigen')])->asImg(['class' => 'middle']) ?> </a> <? endif; ?> </td> <td class="<? echo $cssSw->getClass() ?>" width="20%" nowrap colspan="3"> </td> </tr> <?php if (($_SESSION['resources_data']["show_repeat_mode"] == 'single' || $_SESSION['resources_data']["show_repeat_mode"] == 'all') && $num_single_events ){ ?> <tr> <td class="<? echo $cssSw->getClass() ?>" width="4%" align="center" valign="bottom"> </td> <td class="<? echo $cssSw->getClass() ?>" colspan="3"> <strong><?=_("Einzelbelegungen:")?></strong> <br> <?php $num = 1; foreach($single_assigns as $event) { echo LinkButton::create(_('Eigenschaften'), URLHelper::getURL('?show_object=' . $event->getResourceId() . '&quick_view=' . $view . '&quick_view_mode=' . $quick_view_mode . '&edit_assign_object=' . $event->getAssignId())); printf (" <font size=-1>"._("%s ist von <b>%s</b> bis <b>%s</b>, belegt von <b>%s</b>")."</font><br>",'EB'.$num++.': ' . htmlReady(getResourceObjectName($event->getResourceId())), strftime("%A, %d.%m.%Y %H:%M", $event->getBegin()), strftime("%A, %d.%m.%Y %H:%M", $event->getEnd()), $event->getName()); } ?> </tr> <?php } ?> </table> </form> <? } else { ?> <table border="0" cellpadding="0" cellspacing="0" width="100%" align="center"> <tr> <td align="center"> <div style="font-size:150%;font-weight:bold;"> <?=htmlReady($room_group->getGroupName($this->group_id) . ' - ' . $this->semester['name'])?> <br> <? printf(_("Wochentag: %s"), htmlReady(strftime('%A', $schedule->base_date))); ?> </div> <div style="font-size:100%;font-weight:bold;margin-bottom:10px;"> <?=date ("d.m.Y", $start_time). " - ". date ("d.m.Y", $end_time)?> (<?=($this->timespan == 'course_time' ? _("Vorlesungszeit") : _("vorlesungsfreie Zeit"))?>) </div> </td> </tr> <tr> <td> <? $schedule->showSchedule("html", true); ?> </td> </tr> <? if (($_SESSION['resources_data']["show_repeat_mode"] == 'single' || $_SESSION['resources_data']["show_repeat_mode"] == 'all') && $num_single_events ){ ?> <tr> <td> <strong> <?=_("Einzelbelegungen:")?> (<?=strftime("%d.%m.%Y",$a_start_time) . ' - ' . strftime("%d.%m.%Y",$a_end_time)?>) </strong> <br> <? $num = 1; foreach($single_assigns as $event) { printf ("<font size=-1>"._("%s ist von <b>%s</b> bis <b>%s</b>, belegt von <b>%s</b>")."</font><br>",'EB'.$num++.': ' . htmlReady(getResourceObjectName($event->getResourceId())), strftime("%A, %d.%m.%Y %H:%M", $event->getBegin()), strftime("%A, %d.%m.%Y %H:%M", $event->getEnd()), htmlready($event->getName())); } ?> </td> </tr> <?}?> </table> <? } }