Beispiel #1
0
    }
}

//inform the owner of the requests
//if ($snd_closed_request_sms) {
if ($_sendMessage) {
    require_once 'lib/messaging.inc.php';

    $messaging = new messaging;

    foreach ($_SESSION['resources_data']["requests_working_on"] as $val) {
        //$request_ids[] = $val["request_id"];
        $request_data[$val["request_id"]] = $val;
    }

    $reqObj = new RoomRequest($_sendMessage['request_id']);
    $semObj = new Seminar($_sendMessage['seminar_id']);

    // first we have to get all users to which the message will be sent
    // -> creator of request

    $users = Array($reqObj->getUserId());
    if ($reqObj->reply_recipients == 'lecturer') {
         $users = array_merge($users, array_keys($semObj->getMembers('dozent')));
    }

    // the room-request has been declined
    if ($_sendMessage['type'] == 'declined') {
        $decline_message = Request::get('decline_message');
        if ($semObj->seminar_number) {
            $message = sprintf(_("ABGELEHNTE RAUMANFRAGE: Ihre Raumanfrage zur Veranstaltung %s (%s) wurde abgelehnt.") . "\n\n" .
Beispiel #2
0
 /**
  * delete one room request
  */
 public function delete_action()
 {
     $request = RoomRequest::find(Request::option('request_id'));
     if (!$request) {
         throw new Trails_Exception(403);
     }
     if (Request::isGet()) {
         $factory = new Flexi_TemplateFactory($this->dispatcher->trails_root . '/views/');
         $template = $factory->open('course/room_requests/_del.php');
         $template->action = $this->link_for('delete/' . $this->course_id, array('request_id' => $request->getid()));
         $template->question = sprintf(_('Möchten Sie die Raumanfrage "%s" löschen?'), $request->getTypeExplained());
         $this->flash['message'] = $template->render();
     } else {
         CSRFProtection::verifyUnsafeRequest();
         if (Request::submitted('kill')) {
             if ($request->delete()) {
                 $this->flash['message'] = MessageBox::success("Die Raumanfrage wurde gelöscht.");
             }
         }
     }
     $this->redirect('course/room_requests/index/' . $this->course_id);
 }
    /**
     *
     * @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%">&nbsp;
                </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 "&nbsp;&nbsp;&nbsp;&nbsp;"._("Art der Anfrage").": ".$reqObj->getTypeExplained()."<br>";
                        print "&nbsp;&nbsp;&nbsp;&nbsp;"._("Erstellt von").": <a href=\"".URLHelper::getLink('dispatch.php/profile?username='******'%x %H:%M', $reqObj->mkdate) . '<br>';
                        print "&nbsp;&nbsp;&nbsp;&nbsp;"._("Letzte Änderung") . ": ". strftime('%x %H:%M', $reqObj->chdate) . '<br>';
                        print "&nbsp;&nbsp;&nbsp;&nbsp;"._("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 "&nbsp;&nbsp;&nbsp;&nbsp;"._("verantwortliche Einrichtung").": ".htmlReady($names['inst_name'])."<br>";
                        print "&nbsp;&nbsp;&nbsp;&nbsp;"._("verantwortliche Fakultät").": ".htmlReady($names['fak_name'])."<br>";
                        print "&nbsp;&nbsp;&nbsp;&nbsp;"._("aktuelle Teilnehmerzahl").": ".$semObj->getNumberOfParticipants('total').'<br>';
                        ?>
                    </font>
                </td>
            </tr>
            <tr>
                <td class="<? $cssSw->switchClass(); echo $cssSw->getClass() ?>" width="4%">&nbsp;
                </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 "&nbsp;";
                                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%">&nbsp;
                </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%">&nbsp;
                </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%">&nbsp;
                </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%">&nbsp;
                </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>
        <?
    }
Beispiel #4
0
    /**
     *  Deletes the current seminar
     *
     * @return void       returns success-message if seminar could be deleted
     *                    otherwise an  error-message
     */

    public function delete()
    {
        $s_id = $this->id;

        // Delete that Seminar.

        // Alle Benutzer aus dem Seminar rauswerfen.
        $query = "DELETE FROM seminar_user WHERE Seminar_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));
        if (($db_ar = $statement->rowCount()) > 0) {
            $this->createMessage(sprintf(_("%s Teilnehmende und Lehrende archiviert."), $db_ar));
        }

        // Alle Benutzer aus Wartelisten rauswerfen
        $query = "DELETE FROM admission_seminar_user WHERE seminar_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));

        // Alle beteiligten Institute rauswerfen
        $query = "DELETE FROM seminar_inst WHERE Seminar_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));
        if (($db_ar = $statement->rowCount()) > 0) {
            $this->createMessage(sprintf(_("%s Zuordnungen zu Einrichtungen archiviert."), $db_ar));
        }

        // user aus den Statusgruppen rauswerfen
        $count = DeleteAllStatusgruppen($s_id);
        if ($count > 0) {
            $this->createMessage(_("Einträge aus Funktionen / Gruppen gelöscht."));
        }

        // Alle Eintraege aus dem Vorlesungsverzeichnis rauswerfen
        $db_ar = StudipSemTree::DeleteSemEntries(null, $s_id);
        if ($db_ar > 0) {
            $this->createMessage(sprintf(_("%s Zuordnungen zu Bereichen archiviert."), $db_ar));
        }

        // Alle Termine mit allem was dranhaengt zu diesem Seminar loeschen.
        if (($db_ar = SingleDateDB::deleteAllDates($s_id)) > 0) {
            $this->createMessage(sprintf(_("%s Veranstaltungstermine archiviert."), $db_ar));
        }

        //Themen
        IssueDB::deleteAllIssues($s_id);

        //Cycles
        SeminarCycleDate::deleteBySQL('seminar_id = ' . DBManager::get()->quote($s_id));

        // Alle weiteren Postings zu diesem Seminar in den Forums-Modulen löschen
        foreach (PluginEngine::getPlugins('ForumModule') as $plugin) {
            $plugin->deleteContents($s_id);  // delete content irrespective of plugin-activation in the seminar

            if ($plugin->isActivated($s_id)) {   // only show a message, if the plugin is activated, to not confuse the user
                $this->createMessage(sprintf(_('Einträge in %s archiviert.'), $plugin->getPluginName()));
            }
        }


        // Alle Dokumente zu diesem Seminar loeschen.
        if (($db_ar = delete_all_documents($s_id)) > 0) {
            $this->createMessage(sprintf(_("%s Dokumente und Ordner archiviert."), $db_ar));
        }

        // Freie Seite zu diesem Seminar löschen
        $query = "DELETE FROM scm WHERE range_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));
        if (($db_ar = $statement->rowCount()) > 0) {
            $this->createMessage(_("Freie Seite der Veranstaltung archiviert."));
        }

        // delete literatur
        $del_lit = StudipLitList::DeleteListsByRange($s_id);
        if ($del_lit) {
            $this->createMessage(sprintf(_("%s Literaturlisten archiviert."),$del_lit['list']));
        }

        // Alle News-Verweise auf dieses Seminar löschen
        if ( ($db_ar = StudipNews::DeleteNewsRanges($s_id)) ) {
            $this->createMessage(sprintf(_("%s Ankündigungen gelöscht."), $db_ar));
        }
        //delete entry in news_rss_range
        StudipNews::UnsetRssId($s_id);

        //kill the datafields
        DataFieldEntry::removeAll($s_id);

        //kill all wiki-pages
        $query = "DELETE FROM wiki WHERE range_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));
        if (($db_wiki = $statement->rowCount()) > 0) {
            $this->createMessage(sprintf(_("%s Wiki-Seiten archiviert."), $db_wiki));
        }

        $query = "DELETE FROM wiki_links WHERE range_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));

        $query = "DELETE FROM wiki_locks WHERE range_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));

        // kill all the ressources that are assigned to the Veranstaltung (and all the linked or subordinated stuff!)
        if (Config::get()->RESOURCES_ENABLE) {
            $killAssign = new DeleteResourcesUser($s_id);
            $killAssign->delete();
            if ($rr = RoomRequest::existsByCourse($s_id)) {
                RoomRequest::find($rr)->delete();
            }
        }

        // kill virtual seminar-entries in calendar
        $query = "DELETE FROM schedule_seminare WHERE seminar_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));

        if(get_config('ELEARNING_INTERFACE_ENABLE')){
            global $connected_cms;
            $del_cms = 0;
            $cms_types = ObjectConnections::GetConnectedSystems($s_id);
            if(count($cms_types)){
                foreach($cms_types as $system){
                    ELearningUtils::loadClass($system);
                    $del_cms += $connected_cms[$system]->deleteConnectedModules($s_id);
                }
                $this->createMessage(sprintf(_("%s Verknüpfungen zu externen Systemen gelöscht."), $del_cms ));
            }
        }

        //kill the object_user_vists for this seminar
        object_kill_visits(null, $s_id);

        // Logging...
        $query = "SELECT CONCAT(seminare.VeranstaltungsNummer, ' ', seminare.name, '(', semester_data.name, ')')
                  FROM seminare
                  LEFT JOIN semester_data ON (seminare.start_time = semester_data.beginn)
                  WHERE seminare.Seminar_id='$s_id'";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($s_id));
        $semlogname = $statement->fetchColumn() ?: sprintf('unknown sem_id: %s', $s_id);

        StudipLog::log("SEM_ARCHIVE",$s_id,NULL,$semlogname);
        // ...logged

        // delete deputies if necessary
        deleteAllDeputies($s_id);

        UserDomain::removeUserDomainsForSeminar($s_id);

        AutoInsert::deleteSeminar($s_id);

        //Anmeldeset Zordnung entfernen
        $cs = $this->getCourseSet();
        if ($cs) {
            CourseSet::removeCourseFromSet($cs->getId(), $this->getId());
            $cs->load();
            if (!count($cs->getCourses())
                && $cs->isGlobal()
                && $cs->getUserid() != '') {
                $cs->delete();
            }
        }
        AdmissionPriority::unsetAllPrioritiesForCourse($this->getId());
        // und das Seminar loeschen.
        $this->course->delete();
        $this->restore();
        return true;
    }
Beispiel #5
0
 /**
  * Primary function to edit date-informations
  * @param      $termin_id
  * @param null $metadate_id
  */
 public function editDate_action($termin_id)
 {
     $this->date = CourseDate::find($termin_id) ?: CourseExDate::find($termin_id);
     $this->attributes = array();
     if ($request = RoomRequest::findByDate($this->date->id)) {
         $this->params = array('request_id' => $request->getId());
     } else {
         $this->params = array('new_room_request_type' => 'date_' . $this->date->id);
     }
     $this->params['fromDialog'] = Request::get('fromDialog');
     if (Request::get('fromDialog') == 'true') {
         $this->attributes['data-dialog'] = 'size=big';
     } else {
         $this->attributes['fromDialog'] = 'false';
     }
     $this->resList = ResourcesUserRoomsList::getInstance($GLOBALS['user']->id, true, false, true);
     //UMSTELLEN AUF COURSE
     $this->dozenten = $this->course->getMembers('dozent');
     $this->gruppen = Statusgruppen::findBySeminar_id($this->course->id);
     $this->related_persons = array();
     foreach (User::findDozentenByTermin_id($this->date->id) as $user) {
         $this->related_persons[] = $user->user_id;
     }
     $this->related_groups = array();
     foreach (Statusgruppen::findByTermin_id($this->date->id) as $group) {
         $this->related_groups[] = $group->statusgruppe_id;
     }
 }
Beispiel #6
0
 function getRoomRequest()
 {
     if ($request = RoomRequest::findByDate($this->termin_id)) {
         $this->room_request = $request;
         return $this->room_request;
     }
     return false;
 }
Beispiel #7
0
function getSeminarRoomRequest($seminar_id)
{
    return RoomRequest::existsByCourse($seminar_id);
}
    function deleteRequests()
    {
        $column = $this->object_type == 'sem'
                ? 'seminar_id'
                : 'termin_id';

        $query = "SELECT request_id FROM resources_requests WHERE :column = :value";
        $statement = DBManager::get()->prepare($query);
        $statement->bindValue(':column', $column, StudipPDO::PARAM_COLUMN);
        $statement->bindValue(':value', $this->range_id);
        $statement->execute();

        while ($request_id = $statement->fetchColumn()) {
            $killRequest = new RoomRequest($request_id);
            $killRequest->delete();
        }
    }
    function killDateAssign($termin_id)
    {
        if (!$termin_id) {
            return;
        }

        $query = "SELECT assign_id
                  FROM resources_assign
                  LEFT JOIN resources_objects USING (resource_id)
                  LEFT JOIN resources_categories USING (category_id)
                  WHERE assign_user_id = ? AND resources_categories.is_room = 1";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($termin_id));
        while ($assign_id = $statement->fetchColumn()) {
            AssignObject::Factory($assign_id)->delete();
        }

        $query = "SELECT request_id FROM resources_requests WHERE termin_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($termin_id));
        while ($request_id = $statement->fetchColumn()) {
            $killRequest = new RoomRequest ($request_id);
            $killRequest->delete();
        }
    }
Beispiel #10
0
 static function deleteSingleDate($id, $ex_termin)
 {
     if (Config::get()->RESOURCES_ENABLE) {
         // delete resource assignment, if any
         $killAssign = AssignObject::Factory(self::getAssignID($id));
         $killAssign->delete();
         if ($request_id = self::getRequestID($id)) {
             $rr = new RoomRequest($request_id);
             $rr->delete();
         }
     }
     // Prepare query that deletes all entries for a given termin id
     // from a given table
     $query = "DELETE FROM :table WHERE termin_id = :termin_id";
     $statement = DBManager::get()->prepare($query);
     $statement->bindValue(':termin_id', $id);
     // Execute statement for the termin itself (ex_termin if neccessary)
     $statement->bindValue(':table', $ex_termin ? 'ex_termine' : 'termine', StudipPDO::PARAM_COLUMN);
     $statement->execute();
     // Execute statement for themen_termine
     $statement->bindValue(':table', 'themen_termine', StudipPDO::PARAM_COLUMN);
     $statement->execute();
     // Execute statement for termin_related_persons
     $query = "DELETE FROM termin_related_persons WHERE range_id = :termin_id";
     $statement = DBManager::get()->prepare($query);
     $statement->bindValue(':termin_id', $id);
     $statement->execute();
     return true;
 }