Exemplo n.º 1
0
 /**
  * Display the list of room requests
  */
 public function index_action()
 {
     $this->url_params = array();
     if (Request::get('origin') !== null) {
         $this->url_params['origin'] = Request::get('origin');
     }
     $room_requests = RoomRequest::findBySQL(sprintf('seminar_id = %s ORDER BY seminar_id, metadate_id, termin_id', DbManager::get()->quote($this->course_id)));
     $this->room_requests = $room_requests;
     $this->request_id = Request::option('request_id');
     $actions = new ActionsWidget();
     $actions->addLink(_('Neue Raumanfrage erstellen'), $this->url_for('course/room_requests/new/' . $this->course_id), Icon::create('add', 'clickable'));
     Sidebar::get()->addWidget($actions);
     if ($GLOBALS['perm']->have_perm("admin")) {
         $list = new SelectorWidget();
         $list->setUrl("?#admin_top_links");
         $list->setSelectParameterName("cid");
         foreach (AdminCourseFilter::get()->getCoursesForAdminWidget() as $seminar) {
             $list->addElement(new SelectElement($seminar['Seminar_id'], $seminar['Name']), 'select-' . $seminar['Seminar_id']);
         }
         $list->setSelection($this->course_id);
         Sidebar::get()->addWidget($list);
     }
 }