private function synchronizeOjbects($resource, $objects)
 {
     ResourceObject::model()->deleteAll('resource_id = :id', array('id' => $resource->id));
     $order = 0;
     foreach ($objects as $object) {
         $resourceObject = new ResourceObject();
         $resourceObject->resource_id = $resource->id;
         $resourceObject->object_id = $object->id;
         $resourceObject->order = $order++;
         if (!$resourceObject->save()) {
             throw new Exception('Could not save ResourceObject');
         }
     }
 }
Example #2
0
	function getLocationForResource(&$resource)
	{
		$geoinfo	= array();
		$location	= array();
		$plainProp	= $resource->getPlainProperties( false );
		$regex		= "#(?:geoLocation:\s)([0-9\.]+)-([0-9\.]+)#";
		if (preg_match_all($regex, $plainProp, $geoinfo) > 0)
		{
			//pattern gefunden
			$location["longitude"]	= $geoinfo[2][0];
			$location["latitude"]	= $geoinfo[1][0];
			return $location;
		}
		$parentID = $resource->getParentId();
		$parentObject = $resObject	= \ResourceObject::Factory( $parentID ); 
		if ($parentObject->getId()	== $parentObject->getRootId())
		{
			return false;
		}
		else
		{
			//suche nach geoinfo am parent
			return Resource::getLocationForResource($parentObject);
		}
		
	}
 function createGroups(){
     $resources = array();
     $db = DBManager::get();
     $st = $db->prepare("SELECT resource_id
         FROM resources_objects
         WHERE owner_id = ?
         UNION DISTINCT
         SELECT resource_id
         FROM resources_user_resources 
         WHERE user_id = ?");
     if($st->execute(array($this->range_id, $this->range_id))){
         while($resource_id = $st->fetchColumn()){
             $resources[] = $resource_id;
             $resources = array_merge($resources, $this->getResourcesChildren($resource_id));
         }
     }
     $rs = $db->query(sprintf("SELECT parent_id,resource_id FROM resources_objects
         WHERE resource_id IN('%s') ORDER BY name", join("','", $resources)));
     $res_obj = ResourceObject::Factory();
     $offset = 0;
     foreach($rs->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP) as $parent_id => $resource_ids){
         if (is_array($resource_ids) && count($resource_ids)){
             $res_obj->restore($parent_id);
             $this->groups[$offset]['name'] = $res_obj->getPathToString(true);
             foreach ($resource_ids as $resource_id){
                 $res_obj->restore($resource_id);
                 $this->groups[$offset]['resources'][] = $resource_id;  
             }
             ++$offset;
         }
     }
 }
 function addResource($resource_id)
 {
     // check, if the added resources needs to be checked
     $resObj = ResourceObject::Factory($resource_id);
     if (!$resObj->getMultipleAssign()) {
         if (!$this->begin || !$this->end) {
             throw new RuntimeException(__METHOD__ . ' could not add resource without time range');
         }
         $this->resource_ids[] = $resource_id;
         $parameters = array();
         $query = "SELECT DISTINCT assign_id\n                FROM resources_assign ra\n                LEFT JOIN resources_temporary_events rte USING(assign_id,resource_id)\n                WHERE rte.event_id IS NULL AND\n                ra.resource_id = :resource_id AND\n                (ra.begin BETWEEN :begin AND :end OR (ra.begin <= :end AND (ra.repeat_end > :begin OR ra.end > :begin)))";
         $parameters[':resource_id'] = $resource_id;
         $parameters[':begin'] = $this->begin;
         $parameters[':end'] = $this->end;
         $statement = DBManager::get()->prepare($query);
         $statement->execute($parameters);
         $missing_temporary_assigns = $statement->fetchAll(PDO::FETCH_COLUMN);
         if (count($missing_temporary_assigns)) {
             foreach ($missing_temporary_assigns as $assign_id) {
                 $assign = new AssignObject($assign_id);
                 $assign->updateResourcesTemporaryEvents();
             }
         }
         return true;
     }
     return false;
 }
 function getColumnName($id, $print_view = false)
 {
     $res_obj = ResourceObject::Factory($this->show_columns[$id]);
     if (!$print_view) {
         $ret = '<a class="tree" href="' . URLHelper::getLink('?show_object=' . $this->show_columns[$id] . '&view=' . (Request::option('view') == 'openobject_group_schedule' ? 'openobject_schedule' : 'view_schedule')) . '">' . htmlReady($res_obj->getName()) . '</a>' . ($res_obj->getSeats() ? '<br>(' . $res_obj->getSeats() . ')' : '');
     } else {
         $ret = '<span style="font-size:10pt;">' . htmlReady($res_obj->getName()) . '</span>';
     }
     return $ret . chr(10);
 }
Example #6
0
    function ShowObject($resource_id)
    {
        $this->resObject = ResourceObject::Factory($resource_id);
        $this->cssSw = new cssClassSwitcher;

        $this->list = new ShowList;
        $this->list->setRecurseLevels(0);
        $this->list->setViewHiearchyLevels(TRUE);
        $this->list->setSimpleList(TRUE);
    }
Example #7
0
 function createVirtualGroups(){
     $db = DBManager::get();
     $room_list = new ResourcesUserRoomsList($GLOBALS['user']->id, false, false, true);
     $res_obj = ResourceObject::Factory();
     $offset = count($this->groups);
     if ($room_list->numberOfRooms()){
         $rs = $db->query("SELECT parent_id,resource_id 
             FROM resources_objects 
             WHERE resource_id IN('"
             . join("','", array_keys($room_list->getRooms()))."') ORDER BY name");
         foreach($rs->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP) as $parent_id => $resource_ids){
             if (is_array($resource_ids) && count($resource_ids)){
                 $res_obj->restore($parent_id);
                 $this->groups[$offset]['name'] = $res_obj->getPathToString(true);
                 foreach ($resource_ids as $resource_id){
                     $this->groups[$offset]['resources'][] = $resource_id;  
                 }
                 ++$offset;
             }
         }
     }
 }
Example #8
0
    function showPermsForms()
    {
        $template = $GLOBALS['template_factory']->open('resources/edit_perms');

        if (!Request::submitted('reset_search_root_user')) {
            $template->search_string_search_root_user = Request::get('search_string_search_root_user');
        }
        
        $template->users = $this->selectRootUser();
        $template->resObject = ResourceObject::Factory();
        echo $template->render();
    }
Example #9
0
    function showThreadLevel ($root_id, $level=0, $lines='')
    {
        global $edit_structure_object, $RELATIVE_PATH_RESOURCES, $ActualObjectPerms;

        // Prepare statement that obtains all children of a given resource
        $query = "SELECT resource_id
                  FROM resources_objects
                  WHERE parent_id = ?
                  ORDER BY name";
        $children_statement = DBManager::get()->prepare($query);

        //Daten des Objects holen
        $query = "SELECT resource_id
                  FROM resources_objects
                  WHERE resource_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($root_id));
        $resource_ids = $statement->fetchAll(PDO::FETCH_COLUMN);

        foreach ($resource_ids as $resource_id) {
            //Untergeordnete Objekte laden
            $children_statement->execute(array($resource_id));
            $children = $children_statement->fetchAll(PDO::FETCH_COLUMN);
            $children_statement->closeCursor();

            //Struktur merken
            $weitere = count($children);
            $this->lines[$level + 1] = $weitere;

            //Object erstellen
            $resObject = ResourceObject::Factory($resource_id);

            //Daten vorbereiten
            if (!$resObject->getCategoryIconnr())
                $icon = Icon::create('folder-full', 'inactive')->asImg(['class' => 'text-top']);
            else
                $icon = Assets::img('cont_res' . $resObject->getCategoryIconnr() . '.gif');

            if ($_SESSION['resources_data']["move_object"]) {
                $temp  = "&nbsp;<a href=\"".URLHelper::getLink('?target_object='.$resObject->id)."#a\">";
                $temp .= Icon::create('arr_2right', 'sort', ['title' => _('Objekt in diese Ebene verschieben')])->asImg();
                $temp .= "</a>";
                $icon = $temp . $icon;
            }

            if ($_SESSION['resources_data']["structure_opens"][$resObject->id]) {
                $link = URLHelper::getLink('?structure_close=' . $resObject->id . '#a');
                $open = 'open';
                if ($_SESSION['resources_data']["actual_object"] == $resObject->id)
                    echo '<a name="a"></a>';
            } else {
                $link = URLHelper::getLink('?structure_open=' . $resObject->id . '#a');
                $open = 'close';
            }

            if ($resObject->getCategoryName())
                $titel=$resObject->getCategoryName().": ";
            if ($edit_structure_object==$resObject->id) {
                echo "<a name=\"a\"></a>";
                $titel.="<input style=\"font-size: 8pt; width: 100%;\" type=\"text\" size=20 maxlength=255 name=\"change_name\" value=\"".htmlReady($resObject->getName())."\">";
            } else {
                $titel.=htmlReady($resObject->getName());
            }

            //create a link on the titel, too
            if (($link) && ($edit_structure_object != $resObject->id))
                $titel = "<a href=\"$link\" class=\"tree\" >$titel</a>";

            if ($resObject->getOwnerLink())
                $zusatz=sprintf (_("verantwortlich:") . " <a href=\"%s\"><font color=\"#333399\">%s</font></a>", $resObject->getOwnerLink(), htmlReady($resObject->getOwnerName()));
            else
                $zusatz=sprintf (_("verantwortlich:") . " %s", htmlReady($resObject->getOwnerName()));

            $new = true;

            $edit .= '<div style="text-align: center"><div class="button-group">';

            if ($open == 'open') {
                //load the perms
                if (($ActualObjectPerms) && ($ActualObjectPerms->getId() == $resObject->getId())) {
                    $perms = $ActualObjectPerms->getUserPerm();
                } else {
                    $ThisObjectPerms = ResourceObjectPerms::Factory($resObject->getId());
                    $perms = $ThisObjectPerms->getUserPerm();
                }

                if ($edit_structure_object==$resObject->id) {
                    $content.= "<br><textarea name=\"change_description\" rows=3 cols=40>".htmlReady($resObject->getDescription())."</textarea><br>";
                    $content .= Button::create(_('Übernehmen'), 'send', array('value' => _('Änderungen speichern')));
                    $content .= LinkButton::createCancel(_('Abbrechen'), URLHelper::getURL('?cancel_edit=' . $resObject->id));
                    $content.= "<input type=\"hidden\" name=\"change_structure_object\" value=\"".$resObject->getId()."\">";
                    $open="open";
                } else {
                    $content=htmlReady($resObject->getDescription());
                }
                if ($_SESSION['resources_data']["move_object"] == $resObject->id) {
                    $content .= '<br>';
                    $content .= sprintf(_('Dieses Objekt wurde zum Verschieben markiert. '
                                         .'Bitte wählen Sie das Einfügen-Symbol %s, um es in die gewünschte Ebene zu verschieben.'),
                                        Icon::create('arr_2right', 'sort', ['title' => _('Klicken Sie auf dieses Symbol, um dieses Objekt in eine andere Ebene zu verschieben')])->asImg(16));
                }

                if ($resObject->getCategoryId()) {
                    $edit .= LinkButton::create(_('Belegung'), URLHelper::getURL('?view=view_schedule&show_object=' . $resObject->id));
                }
                $edit .= LinkButton::create(_('Eigenschaften'), URLHelper::getURL('?view=view_details&show_object=' . $resObject->id));


                if ($perms == "admin") {
                    if ($resObject->isRoom()) {
                        $edit .= LinkButton::create(_('Benachrichtigung'), UrlHelper::getScriptURL('dispatch.php/resources/helpers/resource_message/' . $resObject->id), array('data-dialog' => ''));
                    }
                    $edit .= "&nbsp;&nbsp;&nbsp;&nbsp;";
                    $edit .= LinkButton::create(_('Neues Objekt'), URLHelper::getURL('?create_object=' . $resObject->id));
                    $edit .= LinkButton::create(_('Neue Ebene'), URLHelper::getURL('?create_hierachie_level=' . $resObject->id));
                }

                $edit.= "&nbsp;&nbsp;&nbsp;&nbsp;";

                if ($weitere) {
                    $edit .= LinkButton::create(_('Liste öffnen'), URLHelper::getURL('?open_list=' . $resObject->id));
                }

                if ($_SESSION['resources_data']["move_object"] == $resObject->id) {
                    $edit .= LinkButton::createCancel(_('Abbrechen'), URLHelper::getURL('?cancel_move=TRUE'));
                } else if ($perms == "admin") {
                    $edit .= LinkButton::create(_('Verschieben'), URLHelper::getURL('?pre_move_object=' . $resObject->id));
                }

                if (!$weitere && $perms == "admin" && $resObject->isDeletable()) {
                    $edit .= LinkButton::create(_('Löschen'), '?kill_object=' . $resObject->id);
                }
            }

            $edit .= '</div></div>';

            //Daten an Ausgabemodul senden (aus resourcesVisual)
            $this->showRow($icon, $link, $titel, $zusatz, $level, $lines, $weitere, $new, $open, $content, $edit);

            //in weitere Ebene abtauchen &nbsp;
            foreach ($children as $child_id) {
                if ($_SESSION['resources_data']['structure_opens'][$resource_id])
                    $this->showThreadLevel($child_id, $level + 1, $lines);
            }
        }
    }
Example #10
0
    function getHistory($id)
    {
        global $UNI_URL, $UNI_NAME_CLEAN;

        $query = "SELECT name, parent_id, resource_id, owner_id
                  FROM resources_objects
                  WHERE resource_id = ?";
        $statement = DBManager::get()->prepare($query);

        $result_arr = array();
        while ($id) {
            $statement->execute(array($id));
            $object = $statement->fetch(PDO::FETCH_ASSOC);
            $statement->closeCursor();

            $result_arr[] = array(
                'id'       => $object['resource_id'],
                'name'     => $object['name'],
                'owner_id' => $object['owner_id']
            );
            $id = $object['parent_id'];
        }

        if (count($result_arr) > 0)
            switch (ResourceObject::getOwnerType($result_arr[count($result_arr)-1]["owner_id"])) {
                case "global":
                    $top_level_name = $UNI_NAME_CLEAN;
                break;
                case "sem":
                    $top_level_name = _("Veranstaltungsressourcen");
                break;
                case "inst":
                    $top_level_name = _("Einrichtungsressourcen");
                break;
                case "fak":
                    $top_level_name = _("Fakultätsressourcen");
                break;
                case "user":
                    $top_level_name = _("persönliche Ressourcen");
                break;
            }

            if (Request::option('view') == 'search') {
                $result  = '<a href="'. URLHelper::getLink('?view=search&quick_view_mode='. Request::option('view_mode') .'&reset=TRUE') .'">';
                $result .=  $top_level_name;
                $result .= '</a>';
            }
                
            for ($i = sizeof($result_arr)-1; $i>=0; $i--) {
                if (Request::option('view')) {
                    $result .= ' &gt; <a href="'.URLHelper::getLink(sprintf('?quick_view='.Request::option('view').'&quick_view_mode='.Request::option('view_mode').'&%s='.$result_arr[$i]["id"],(Request::option('view')=='search') ? "open_level" : "actual_object" ) );
                        
                    $result .= '">'. htmlReady($result_arr[$i]["name"]) .'</a>';
                } else {
                    $result.= sprintf (" &gt; %s", htmlReady($result_arr[$i]["name"]));
                }
            }
        return $result;
    }
Example #11
0
        }
        PageLayout::setTitle($SessSemName['header_line'] . ' - ' . ('Belegung anzeigen/bearbeiten'));
        Navigation::activateItem('/course/resources/edit_assign');
    break;
    case 'openobject_group_schedule':
        PageLayout::setTitle($SessSemName['header_line'] . ' - ' . _('Belegungszeiten aller Ressourcen pro Tag ausgeben'));
        Navigation::activateItem('/course/resources/group_schedule');

        $widget = new ExportWidget();
        $widget->addLink(_('Druckansicht'),
                         URLHelper::getLink('?view=openobject_group_schedule&print_view=1'), Icon::create('print', 'clickable'),
                         array('target' => '_blank'));
        $sidebar->addWidget($widget);
    break;
    case 'view_requests_schedule':
        PageLayout::setTitle(_('Anfragenübersicht eines Raums:') . ' ' . ResourceObject::Factory($_SESSION['resources_data']['resolve_requests_one_res'])->getName());
        Navigation::activateItem('/resources/room_requests/schedule');

        $widget = new ViewsWidget();
        $widget->addLink(_('Semesterplan'),
                         URLHelper::getLink('resources.php?actual_object=' . $_SESSION['resources_data']['resolve_requests_one_res'] . '&quick_view=view_sem_schedule&quick_view_mode=no_nav'),
                         Icon::create('schedule', 'clickable'),
                         array('onclick' => "window.open(this.href, '', 'scrollbars=yes,left=10,top=10,width=1000,height=680,resizable=yes');return false;"));
        $sidebar->addWidget($widget);
    break;
    //default
    default:
        PageLayout::setTitle(_('Übersicht der Ressourcen'));
        Navigation::activateItem('/resources/view/hierarchy');
    break;
}
Example #12
0
 public function getInfo()
 {
     if ($this->isNew()) {
         if (!($this->getSettedPropertiesCount() || $this->getResourceId())) {
             $requestData[] = _('Die Raumanfrage ist unvollständig, und kann so nicht dauerhaft gespeichert werden!');
         } else {
             $requestData[] = _('Die Raumanfrage ist neu.');
         }
         $requestData[] = '';
     } else {
         $requestData[] = _('Erstellt von') . ': ' . get_fullname($this->user_id);
         $requestData[] = _('Erstellt am') . ': ' . strftime('%x %H:%M', $this->mkdate);
         $requestData[] = _('Letzte Änderung') . ': ' . strftime('%x %H:%M', $this->chdate);
         $requestData[] = _('Letzte Änderung von') . ': ' . get_fullname($this->last_modified_by ?: $this->user_id);
     }
     if ($this->resource_id) {
         $resObject = ResourceObject::Factory($this->resource_id);
         $requestData[] = _('Raum') . ': ' . $resObject->getName();
         $requestData[] = _('verantwortlich') . ': ' . $resObject->getOwnerName();
     } else {
         $requestData[] = _('Es wurde kein spezifischer Raum gewünscht');
     }
     $requestData[] = '';
     foreach ($this->getAvailableProperties() as $val) {
         if ($this->getPropertyState($val['property_id']) !== null) {
             $state = $this->getPropertyState($val['property_id']);
             $prop = $val['name'] . ': ';
             if ($val['type'] == 'bool') {
                 if ($state == 'on') {
                     $prop .= _('vorhanden');
                 } else {
                     $prop .= _('nicht vorhanden');
                 }
             } else {
                 $prop .= $state;
             }
             $requestData[] = $prop;
         }
     }
     $requestData[] = '';
     $requestData[] = sprintf(_('Bearbeitung durch: %s'), $this->getStatusExplained());
     $requestData[] = '';
     // if the room-request has been declined, show the decline-notice placed by the room-administrator
     if ($this->getClosed() == 3) {
         $requestData[] = _('Nachricht Raumadminstration') . ':';
         $requestData[] = $this->getReplyComment();
     } else {
         $requestData[] = _('Nachricht an Raumadministration') . ':';
         $requestData[] = $this->getComment();
     }
     return join("\n", $requestData);
 }
Example #13
0
 protected function addResource(&$keys, ResourceObject $resource)
 {
     $type = $resource->type();
     $id = $resource->id();
     $this->resources[$type . "." . $id] = $resource;
     $keys[$type . "." . $id] =& $this->resources[$type . "." . $id];
 }
 public function getAllDates($seminar, $start, $end)
 {
     $data = $seminar->getUndecoratedData();
     $date = array();
     $i = 0;
     if (is_array($data['regular']['turnus_data'])) {
         foreach ($data['regular']['turnus_data'] as $cycle_id => $cycle) {
             $date[$i]['time'] = sprintf('%02d:%02d - %02d:%02d', $cycle['start_hour'], $cycle['start_minute'], $cycle['end_hour'], $cycle['end_minute']);
             $date[$i]['interval'] = empty($data['regular']['turnus']) ? '' : _("14-täglich");
             if (Config::get()->RESOURCES_ENABLE) {
                 if ($room_ids = $seminar->metadate->cycles[$cycle_id]->getPredominantRoom($start, $end)) {
                     foreach ($room_ids as $room_id) {
                         $res_obj = ResourceObject::Factory($room_id);
                         $room_names[] = $res_obj->getName();
                     }
                     $date[$i]['room'] = implode(', ', $room_names);
                 } else {
                     $date[$i]['room'] = trim($seminar->metadate->cycles[$cycle_id]->getFreeTextPredominantRoom($start, $end));
                 }
                 $date[$i]['dow'] = getWeekDay($cycle['day']);
             }
             $i++;
         }
     }
     if (sizeof((array) $data['irregular'])) {
         foreach ($data['irregular'] as $irregular_date) {
             if ($irregular_date['start_time'] >= $start && $irregular_date['start_time'] <= $end) {
                 $date[$i]['time'] = date('H:i', $irregular_date['start_time']) . date(' - H:i', $irregular_date['end_time']);
                 $date[$i]['date'] = strftime('%x', $irregular_date['start_time']);
                 $date[$i]['dow'] = getWeekDay(date('w', $irregular_date['start_time']));
                 if (Config::get()->RESOURCES_ENABLE && $irregular_date['resource_id']) {
                     $res_obj = ResourceObject::Factory($irregular_date['resource_id']);
                     $date[$i]['room'] = $res_obj->getName();
                 } else {
                     $date[$i]['room'] = trim($irregular_date['raum']);
                 }
                 $i++;
             }
         }
     }
     return $date;
 }
Example #15
0
    /**
     *
     * @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>
        <?
    }
Example #16
0
Berechtigungen verwalten, views: edit_perms
/*****************************************************************************/
if ($view == "edit_perms") {
    require_once ($RELATIVE_PATH_RESOURCES."/views/EditSettings.class.php");

    $editSettings=new EditSettings;
    $editSettings->showPermsForms();
}

/*****************************************************************************
Belegungen ausgeben, views: view_schedule, openobject_schedule
/*****************************************************************************/
if ($view == "view_schedule" || $view == "openobject_schedule") {
    require_once ($RELATIVE_PATH_RESOURCES."/views/ShowSchedules.class.php");
    if ($_SESSION['resources_data']["actual_object"] &&
            ResourceObject::isScheduleViewAllowed($_SESSION['resources_data']["actual_object"])) {
        $ViewSchedules=new ShowSchedules($_SESSION['resources_data']["actual_object"]);
        $ViewSchedules->setStartTime($_SESSION['resources_data']["schedule_start_time"]);
        $ViewSchedules->setEndTime($_SESSION['resources_data']["schedule_end_time"]);
        $ViewSchedules->setLengthFactor($_SESSION['resources_data']["schedule_length_factor"]);
        $ViewSchedules->setLengthUnit($_SESSION['resources_data']["schedule_length_unit"]);
        $ViewSchedules->setWeekOffset($_SESSION['resources_data']["schedule_week_offset"]);
        $ViewSchedules->setUsedView($view);

        if (!Request::get('print_view')) {
            $ViewSchedules->navigator();
        }

        ?>                      </td>
                            </tr>
                        </table>
Example #17
0
    /**
     * creates a textual, status-dependent representation of a room-request for a seminar.
     *
     * @return string conatining room, responsible person, properties, current status and message / decline-message
     */
    public function getRoomRequestInfo()
    {
        $room_request = $this->getRoomRequestStatus();
        if ($room_request) {
            if (!$this->requestData) {
                $rD = new RoomRequest($this->request_id);
                $resObject = ResourceObject::Factory($rD->resource_id);
                $this->requestData .= 'Raum: '.$resObject->getName() . "\n";
                $this->requestData .= 'verantwortlich: '.$resObject->getOwnerName() ."\n\n";
                foreach ($rD->getProperties() as $val) {
                    $this->requestData .= $val['name'].': ';
                    if ($val['type'] == 'bool') {
                        if ($val['state'] == 'on') {
                            $this->requestData .= "vorhanden\n";
                        } else {
                            $this->requestData .= "nicht vorhanden\n";
                        }
                    } else {
                        $this->requestData .= $val['state'] . "\n";
                    }
                }
                if  ($rD->getClosed() == 0) {
                    $txt = _("Die Anfrage wurde noch nicht bearbeitet.");
                } else if ($rD->getClosed() == 3) {
                    $txt = _("Ihre Anfrage wurde abgelehnt!");
                } else {
                    $txt = _("Die Anfrage wurde bearbeitet.");
                }

                $this->requestData .= "\nStatus: $txt\n";

                // if the room-request has been declined, show the decline-notice placed by the room-administrator
                if ($room_request == 'declined') {
                    if ($rD->getReplyComment()) {
                        $this->requestData .= "\nNachricht Raumadmin:\n";
                        $this->requestData .= $rD->getReplyComment();
                    }
                } else {
                    if ($rD->getComment()) {
                        $this->requestData .= "\nNachricht an Raumadmin:\n";
                        $this->requestData .= $rD->getComment();
                    }
                }

            }

            return $this->requestData;
        } else {
            return FALSE;
        }
    }
Example #18
0
<?php
if (!isset($show)) $show = 3;
if (!isset($link)) $link = true;

if (is_array($dates['regular']['turnus_data'])) foreach ($dates['regular']['turnus_data'] as $cycle) :
    $pos = 0;
    if ($cycle['metadate_id'] == $cycle_id && is_array($cycle['assigned_rooms'])) foreach ($cycle['assigned_rooms'] as $resource_id => $count) :
        // get string-representation of predominant booked rooms
        if ($pos >= $show) :
            if ($show > 1)$roominfo .= ', '.sprintf(_("und %s weitere"), (sizeof($rooms)-$show));
            break;
        else :
            if ($pos > 0) $roominfo .= ', ';

            $resObj = ResourceObject::Factory($resource_id);
            if ($link) :
                $roominfo .= $resObj->getFormattedLink(TRUE, TRUE, TRUE);
            else :
                $roominfo .= htmlReady($resObj->getName());
            endif;
            unset($resObj);
        endif;

        $pos++;
    endforeach; ?>
    <?= $roominfo ?>
    <? $roominfo = '';
endforeach ?>
Example #19
0
 function getRequestedRoom()
 {
     if ($this->hasRoomRequest()) {
         $rD = new RoomRequest($this->request_id);
         $resObject = ResourceObject::Factory($rD->resource_id);
         return $resObject->getName();
     }
     return false;
 }
Example #20
0
 private function formatLocationText($date)
 {
     if ($this->hasResource($date)) {
         $resObj = ResourceObject::Factory($date->getResourceID());
         return $this->generateLocationTextFromResourceObject($resObj);
     } else {
         if ($this->hasFreeRoomText($date)) {
             return $this->generateLocationTextFromFreeRoomText($date);
         } else {
             return '';
         }
     }
 }
Example #21
0
endforeach;


// condense irregular dates by room
if (is_array($dates['irregular'])) foreach ($dates['irregular'] as $date) :
    if ($date['resource_id']) :
        $output_dates[$date['resource_id']][] = $date;
    elseif ($date['raum']) :
        $output_dates[$date['raum']][] = $date;
    endif;
endforeach;

// now shrink the dates for each room/freetext and add them to the output
if (is_array($output_dates)) foreach ($output_dates as $dates) :
    if ($dates[0]['resource_id']) :
        $resObj = ResourceObject::Factory($dates[0]['resource_id']);
        if ($link) {
            $output[$resObj->getFormattedLink(TRUE, TRUE, TRUE)][] = implode('<br>', shrink_dates($dates));
        } else {
            $output[htmlReady($resObj->getName())][] = implode('<br>', shrink_dates($dates));
        }
    elseif ($dates[0]['raum']) :
        $output['('. htmlReady($dates[0]['raum']) .')'][] = implode('<br>', shrink_dates($dates));
    endif;
endforeach;
?>

<? if (sizeof($output) == 0) : ?>
    <?php 
echo htmlReady($ort) ?: _("nicht angegeben");
?>
Example #22
0
?>
            <? else : ?>
                <?php 
echo htmlReady($request->getStatusExplained());
?>
            <? endif ?>
        </article>
    </section>
</section>


<div style="clear: both"></div>

<?
if ($request_resource_id = $request->getResourceId()) :
    $resObject = ResourceObject::Factory($request_resource_id);
?>
    <section style="margin: 20px 0;">
        <h2><?php 
echo _('Gewünschter Raum');
?>
</h2>

        <p>
            <strong><?php 
echo htmlReady($resObject->getName());
?>
</strong>
        </p>

        <p><?php 
Example #23
0
    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%">&nbsp;</td>
                <td class="<? echo $cssSw->getClass() ?> hidden"  width="10%" align="left">&nbsp;
                    <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">&nbsp;
                    <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">&nbsp;
                <? 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 "&nbsp;<font size=-1>"._("Anzahl der Belegungen in diesem Zeitraum:")." ", $assign_events->numberOfEvents()."</font><br>&nbsp;";
                    ?>
                </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 "&nbsp;" . 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%">&nbsp;
                </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">&nbsp;
                <? 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">
                &nbsp;
                </td>
            </tr>

        </table>
        </form>
    <?
    }
Example #24
0
 /**
  * Save date-information
  * @param $termin_id
  * @throws Trails_DoubleRenderError
  */
 public function saveDate_action($termin_id)
 {
     $termin = CourseDate::find($termin_id);
     $date = strtotime(sprintf('%s %s:00', Request::get('date'), Request::get('start_time')));
     $end_time = strtotime(sprintf('%s %s:00', Request::get('date'), Request::get('end_time')));
     //time changed for regular date. create normal singledate and cancel the regular date
     if (($termin->metadate_id != '' || isset($termin->metadate_id)) && ($date != $termin->date || $end_time != $termin->end_time)) {
         $termin_values = $termin->toArray();
         $termin_info = $termin->getFullname();
         $termin->cancelDate();
         PageLayout::postInfo(sprintf(_('Der Termin %s wurde aus der Liste der regelmäßigen Termine' . ' gelöscht und als unregelmäßiger Termin eingetragen, da Sie die Zeiten des Termins verändert haben,' . ' so dass dieser Termin nun nicht mehr regelmäßig ist.'), $termin_info));
         $termin = new CourseDate();
         unset($termin_values['termin_id']);
         unset($termin_values['metadate_id']);
         $termin->setData($termin_values);
     }
     $termin->date = $date;
     $termin->end_time = $end_time;
     $termin->date_typ = Request::get('course_type');
     $related_groups = Request::get('related_statusgruppen');
     $termin->statusgruppen = array();
     if (!empty($related_groups)) {
         $related_groups = explode(',', $related_groups);
         $termin->statusgruppen = Statusgruppen::findMany($related_groups);
     }
     $related_users = Request::get('related_teachers');
     $termin->dozenten = array();
     if (!empty($related_users)) {
         $related_users = explode(',', $related_users);
         $termin->dozenten = User::findMany($related_users);
     }
     // Set Room
     if (Request::option('room') == 'room') {
         $room_id = Request::option('room_sd', '0');
         if ($room_id != '0' && $room_id != $termin->room_assignment->resource_id) {
             ResourceAssignment::deleteBySQL('assign_user_id = :termin', array(':termin' => $termin->termin_id));
             $resObj = new ResourceObject($room_id);
             $termin->raum = '';
             $room = new ResourceAssignment();
             $room->assign_user_id = $termin->termin_id;
             $room->resource_id = Request::get('room_sd');
             $room->begin = $termin->date;
             $room->end = $termin->end_time;
             $room->repeat_end = $termin->end_time;
             $room->store();
             $this->course->createMessage(sprintf(_('Der Termin %s wurde geändert und der Raum %s gebucht, etwaige freie Ortsangaben wurden entfernt.'), $termin->getFullname(), $resObj->getName()));
         } elseif ($room_id == '0') {
             $this->course->createError(sprintf(_('Der angegebene Raum konnte für den Termin %s nicht gebucht werden!'), $termin->getFullname()));
         }
     } elseif (Request::option('room') == 'noroom') {
         $termin->raum = '';
         ResourceAssignment::deleteBySQL('assign_user_id = :termin', array(':termin' => $termin->termin_id));
         $this->course->createMessage(sprintf(_('Der Termin %s wurde geändert, etwaige freie Ortsangaben und Raumbuchungen wurden entfernt.'), '<b>' . $termin->getFullname() . '</b>'));
     } elseif (Request::option('room') == 'freetext') {
         $termin->raum = Request::get('freeRoomText_sd');
         ResourceAssignment::deleteBySQL('assign_user_id = :termin', array(':termin' => $termin->termin_id));
         $this->course->createMessage(sprintf(_('Der Termin %s wurde geändert, etwaige Raumbuchungen wurden entfernt und stattdessen der angegebene Freitext eingetragen!'), '<b>' . $termin->getFullname() . '</b>'));
     }
     if ($termin->store()) {
         NotificationCenter::postNotification('CourseDidChangeSchedule', $this->course);
         $this->displayMessages();
     }
     $this->redirect($this->url_for('course/timesrooms/index#' . $termin->metadate_id, array('contentbox_open' => $termin->metadate_id)));
 }
Example #25
0
    function showListObject ($resource_id, $admin_buttons=FALSE) {
        global $edit_structure_object, $RELATIVE_PATH_RESOURCES, $ActualObjectPerms, $SessSemName,
            $user, $perm, $clipObj, $view_mode, $view;

        //Object erstellen
        $resObject = ResourceObject::Factory($resource_id);

        if (!$resObject->getId())
            return FALSE;

        //link add for special view mode (own window)
        if ($view_mode == "no_nav")
            $link_add = "&quick_view=".$view."&quick_view_mode=".$view_mode;

        if ($this->simple_list){
            //create a simple list intead of printhead/printcontent-design
            $return="<li><a href=\"".URLHelper::getLink('?view=view_details&actual_object='.$resObject->getId().$link_add)."\">".htmlReady($resObject->getName())."</a></li>\n";
            print $return;
        } else {
            //Daten vorbereiten
            if (!$resObject->getCategoryIconnr())
                $icon = Icon::create('folder-full', 'inactive')->asImg(['class' => 'text-top']);
            else
                $icon = Assets::img('cont_res' . $resObject->getCategoryIconnr() . '.gif');

            if ($_SESSION['resources_data']["structure_opens"][$resObject->id]) {
                $link = URLHelper::getLink('?structure_close=' . $resObject->id . $link_add . '#a');
                $open = 'open';
                if ($_SESSION['resources_data']["actual_object"] == $resObject->id)
                    echo '<a name="a"></a>';
            } else {
                $link = URLHelper::getLink('?structure_open=' . $resObject->id . $link_add . '#a');
                $open = 'close';
            }

            $titel='';
            if ($resObject->getCategoryName())
                $titel=$resObject->getCategoryName().": ";
            if ($edit_structure_object == $resObject->id) {
                echo "<a name=\"a\"></a>";
                $titel.="<input style=\"font-size: 8pt; width: 100%;\" type=\"text\" size=20 maxlength=255 name=\"change_name\" value=\"".htmlReady($resObject->getName())."\">";
            } else {
                $titel.=htmlReady($resObject->getName());
            }

            //create a link on the titel, too
            if (($link) && ($edit_structure_object != $resObject->id))
                $titel = "<a href=\"$link\" class=\"tree\" >$titel</a>";

            if ($resObject->getOwnerLink())
                $zusatz=sprintf (_("verantwortlich:")." <a href=\"%s\"><font color=\"#333399\">%s</font></a>", $resObject->getOwnerLink(), htmlReady($resObject->getOwnerName()));
            else
                $zusatz=sprintf (_("verantwortlich:")." %s", htmlReady($resObject->getOwnerName()));

            if ($perm->have_perm('root') || getGlobalPerms($user->id) == "admin"){
                $simple_perms = 'admin';
            } elseif (ResourcesUserRoomsList::CheckUserResource($resObject->getId())){
                $simple_perms = 'tutor';
            } else {
                $simple_perms = false;
            }

            //clipboard in/out
            if ((is_object($clipObj)) && $simple_perms && $resObject->getCategoryId())
                if ($clipObj->isInClipboard($resObject->getId()))
                    $zusatz .= " <a href=\"".URLHelper::getLink('?clip_out='.$resObject->getId().$link_add)."\">" . Icon::create('resources+remove', 'clickable', ['title' => _("Aus der Merkliste entfernen")])->asImg(16, ["alt" => _("Aus der Merkliste entfernen")]) . "</a>";
                else
                    $zusatz .= " <a href=\"".URLHelper::getLink('?clip_in='.$resObject->getId().$link_add)."\">" . Icon::create('resources+add', 'clickable', ['title' => _("In Merkliste aufnehmen")])->asImg(16, ["alt" => _("In Merkliste aufnehmen")]) . "</a>";

            $new=TRUE;

            $edit .= '<div style="text-align: center"><div class="button-group">';

            if ($open == 'open') {
                // check if the edit buttons for admins shell be shown
                if ($admin_buttons && ($simple_perms == "admin")) {
                    $edit .= LinkButton::create(_('Neues Objekt'), URLHelper::getURL('?create_object=' . $resObject->id));
                    if ($resObject->isDeletable()) {
                        $edit .= LinkButton::create(_('Löschen'), URLHelper::getURL('?kill_object=' . $resObject->id));
                    }
                }


                if ($resObject->getCategoryId()) {
                    if (ResourceObject::isScheduleViewAllowed($resObject->getId())) {
                        if ($view_mode == 'no_nav') {
                            $edit .= LinkButton::create(_('Belegung'), URLHelper::getURL('?show_object=' . $resObject->id
                                . '&quick_view=view_schedule&quick_view_mode=' . $view_mode));
                        } else {
                            $edit .= LinkButton::create(_('Belegung'), URLHelper::getURL('?show_object=' . $resObject->id
                                . '&view=view_schedule'));
                        }
                    }
                }
                if ($simple_perms && $resObject->isRoom()) {
                    $edit .= LinkButton::create(_('Benachrichtigung'), UrlHelper::getScriptURL('dispatch.php/resources/helpers/resource_message/' . $resObject->id), array('data-dialog' => ''));
                }
                if ($view_mode == 'no_nav') {
                    $edit .= LinkButton::create(_('Eigenschaften'), URLHelper::getURL('?show_object=' . $resObject->id
                        . '&quick_view=view_details&quick_view_mode=' . $view_mode));
                } else {
                    $edit .= LinkButton::create(_('Eigenschaften'), URLHelper::getURL('?show_object=' . $resObject->id
                        . '&view=view_details'));
                }

                //clipboard in/out
                if (is_object($clipObj) && $simple_perms && $resObject->getCategoryId())
                    if ($clipObj->isInClipboard($resObject->getId())) {
                        $edit .= LinkButton::create(_('Aus Merkliste entfernen'),
                            URLHelper::getURL('?clip_out=' .$resObject->getId() . $link_add));
                    } else {
                        $edit .= LinkButton::create(_('In Merkliste aufnehmen') . ' >',
                            URLHelper::getURL('?clip_in=' .$resObject->getId() . $link_add));
                    }
            }
            $edit .= '</div></div>';
            $content = $resObject->getDescription();
            //Daten an Ausgabemodul senden
            $this->showRow($icon, $link, $titel, $zusatz, 0, 0, 0, $new, $open, $content, $edit);
        }
        return TRUE;
    }
Example #26
0
 private static function getRoomForSingleDate($val)
 {
     /* css-Klasse auswählen, sowie Template-Feld für den Raum mit Text füllen */
     if (\Config::get()->RESOURCES_ENABLE) {
         if ($val->getResourceID()) {
             $resObj = \ResourceObject::Factory($val->getResourceID());
             $room = _("Raum: ");
             $room .= $resObj->getFormattedLink(TRUE, TRUE, TRUE, 'view_schedule', 'no_nav', $val->getStartTime());
         } else {
             if (\Config::get()->RESOURCES_SHOW_ROOM_NOT_BOOKED_HINT) {
                 $room = '(' . _("kein gebuchter Raum") . ')';
             } else {
                 $room = _("keine Raumangabe");
             }
             if ($val->isExTermin()) {
                 if ($name = $val->isHoliday()) {
                     $room = '(' . $name . ')';
                 } else {
                     $room = '(' . _('fällt aus') . ')';
                 }
             } else {
                 if ($val->getFreeRoomText()) {
                     $room = '(' . htmlReady($val->getFreeRoomText()) . ')';
                 }
             }
         }
     } else {
         $room = '';
         if ($val->getFreeRoomText()) {
             $room = '(' . htmlReady($val->getFreeRoomText()) . ')';
         }
     }
     return html_entity_decode(strip_tags($room));
 }
Example #27
0
function getPlainRooms($rooms)
{
    $room_list = array();
    if (is_array($rooms)) {
        foreach ($rooms as $room_id => $count) {
            if ($room_id) {
                $resObj =& ResourceObject::Factory($room_id);
                $room_list[] = $resObj->getName();
            }
        }
    }
    return $room_list;
}
Example #28
0
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or any later version.
// +---------------------------------------------------------------------------+
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
// +---------------------------------------------------------------------------+
require_once dirname(__FILE__) . '/studip_cli_env.inc.php';
require_once $GLOBALS['RELATIVE_PATH_RESOURCES'] . "/lib/ResourceObject.class.php";
require_once "lib/classes/DbSnapshot.class.php";
$res_obj = ResourceObject::Factory();
$snap = new DbSnapshot(new DB_Seminar("SELECT resource_id, parent_id FROM resources_objects INNER JOIN resources_categories USING(category_id) WHERE is_room = 1"));
if ($snap->numRows) {
    fwrite(STDOUT, "<?php\n//copy to \$STUDIP_BASE_PATH/config/config_room_groups.inc.php\n//generated " . date('r') . "\n");
    foreach ($snap->getGroupedResult('parent_id') as $parent_id => $rooms) {
        if (is_array($rooms['resource_id'])) {
            $res_obj->restore($parent_id);
            fwrite(STDOUT, "//--------------------------------------------------------------------\n");
            fwrite(STDOUT, "\$room_groups[\$c]['name'] = '" . $res_obj->getPathToString(true) . "';\n");
            foreach (array_keys($rooms['resource_id']) as $room_id) {
                $res_obj->restore($room_id);
                fwrite(STDOUT, "\$room_groups[\$c]['rooms'][] = '{$room_id}';  //" . $res_obj->getPathToString(true) . "\n");
            }
        }
    }
    fwrite(STDOUT, "?>\n");
Example #29
0
    $forbiddenObject = ResourceObject::Factory($_SESSION['resources_data']["actual_object"]);
    if ($forbiddenObject->isLocked()) {
        $lock_ts = getLockPeriod("edit");
        $msg->addMsg(31, array(date("d.m.Y, G:i", $lock_ts[0]), date("d.m.Y, G:i", $lock_ts[1])));
    }
    $msg->displayAllMsg("window");
    die;
}

//show object, this object will be edited or viewed
if (Request::option('show_object'))
    $_SESSION['resources_data']["actual_object"]=Request::option('show_object');

if (Request::option('show_msg')) {
    if ($msg_resource_id = Request::option('msg_resource_id')) {
        $msgResourceObj = ResourceObject::Factory($msg_resource_id);
    }
    $msg->addMsg(Request::option('show_msg'), $msg_resource_id ? array(htmlReady($msgResourceObj->getName())) : FALSE);
}

//if ObjectPerms for actual user and actual object are not loaded, load them!

if ($ObjectPerms) {
    if (($ObjectPerms->getId() == $_SESSION['resources_data']["actual_object"]) && ($ObjectPerms->getUserId()  == $user->id))
        $ActualObjectPerms = $ObjectPerms;
     else
        $ActualObjectPerms = ResourceObjectPerms::Factory($_SESSION['resources_data']["actual_object"]);
} else {
    $ActualObjectPerms = ResourceObjectPerms::Factory($_SESSION['resources_data']["actual_object"]);
}
Example #30
0
 /**
  * Returns the name of the resource for the resource id found in the
  * given field or the resource id if the resource is unknown.
  *
  * @param string $field The name of the table field.
  * @return string The name of the resource or resource id.
  */
 protected function formatResource($field)
 {
     $resObj = ResourceObject::Factory($this->{$field});
     if ($resObj->getName()) {
         return $resObj->getFormattedLink();
     }
     return $this->{$field};
 }