Beispiel #1
0
        PageLayout::setTitle(_('Übersicht der Ressourcen'));
        Navigation::activateItem('/resources/view/hierarchy');
    break;
    case 'search':
        PageLayout::setTitle(_('Suche nach Ressourcen'));
        Navigation::activateItem('/search/resources');

        $widget = new OptionsWidget();
        $widget->setTitle(_('Suchoptionen'));
        $widget->addCheckbox(_('Eigenschaften anzeigen'),
                             $_SESSION['resources_data']['search_mode'] === 'properties',
                             URLHelper::getLink('?view=search&quick_view_mode=' . $view_mode . '&mode=properties'),
                             URLHelper::getLink('?view=search&quick_view_mode=' . $view_mode . '&mode=browse'));
        // Show only if viewing all room occupations is allowed.
        if (hasGlobalOccupationAccess() ||
                ResourcesUserRoomsList::getInstance($GLOBALS['user']->id, false, false)->numberOfRooms()) {
            $widget->addCheckbox(_('Belegungszeit anzeigen'),
                $_SESSION['resources_data']['check_assigns'],
                URLHelper::getLink('?view=search&quick_view_mode=' . $view_mode . '&check_assigns=TRUE'),
                URLHelper::getLink('?view=search&quick_view_mode=' . $view_mode . '&check_assigns=FALSE'));
        }
        $widget->addCheckbox(_('Nur Räume anzeigen'),
                             $_SESSION['resources_data']['search_only_rooms'],
                             URLHelper::getLink('?view=search&quick_view_mode=' . $view_mode . '&search_only_rooms=1'),
                             URLHelper::getLink('?view=search&quick_view_mode=' . $view_mode . '&search_only_rooms=0'));
        
        $sidebar->addWidget($widget);
    break;
    //Reiter "Listen"
    case 'lists':
        PageLayout::setTitle(_('Bearbeiten und ausgeben von Listen'));
Beispiel #2
0
    /**
     * Checks if the resource occupation may be seen by current user.
     */
    public static function isScheduleViewAllowed($object_id) {
        // Check if room occupation may be seen.
        $allowed = false;

        // Globally allowed via config, for admins, roots and resource admins.
        if (hasGlobalOccupationAccess()) {
            $allowed = true;

        // View occupation only if own room.
        } else {
            $list = ResourcesUserRoomsList::getInstance($GLOBALS['user']->id, false, false, false);
            if (in_array($object_id, array_keys($list->getRooms()))) {
                $allowed = true;
            }
        }

        return $allowed;
    }
Beispiel #3
0
 /**
  * Edits a stack/cycle.
  *
  * @param String $cycle_id Id of the cycle to be edited.
  */
 private function editStack($cycle_id)
 {
     $this->cycle_id = $cycle_id;
     $this->teachers = $this->course->getMembers('dozent');
     $this->gruppen = Statusgruppen::findBySeminar_id($this->course->id);
     $this->resList = ResourcesUserRoomsList::getInstance($GLOBALS['user']->id, true, false, true);
     $this->editParams = array('fromDialog' => Request::get('fromDialog'));
     $this->render_template('course/timesrooms/editStack');
 }
Beispiel #4
0
 function bookRoom($roomID)
 {
     if ($this->ex_termin || !$roomID) {
         return false;
     }
     // create a resource-object of the passed room
     $resObj = ResourceObject::Factory($roomID);
     // there is no room with the passed id
     if (!$resObj->id) {
         return false;
     }
     // check permissions (is current user allowed to book the passed room?)
     $resList = ResourcesUserRoomsList::getInstance($user_id, true, false, true);
     if (in_array($roomID, array_keys($resList->resources)) === false) {
         return false;
     }
     // clear the freetext-field, if we book a room
     $this->setFreeRoomText('');
     $this->store();
     // if there is already a room assigned, change the assignment, else create a new one
     if ($this->resource_id != '') {
         $this->changeAssign($roomID);
     } else {
         $this->insertAssign($roomID);
     }
     return $resObj;
 }