Beispiel #1
0
 /**
  * Things to do before every page load.
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     // AJAX request, so no page layout.
     if (Request::isXhr()) {
         $this->via_ajax = true;
         $this->set_layout(null);
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
         // Open base layout for normal
     } else {
         $layout = $GLOBALS['template_factory']->open('layouts/base');
         $this->set_layout($layout);
         PageLayout::setTitle(_('Anmeldesets'));
         // Get only own courses if user doesn't have permission to edit institute-wide coursesets.
         $this->onlyOwnCourses = true;
         if ($GLOBALS['perm']->have_perm('admin') || $GLOBALS['perm']->have_perm('dozent') && get_config('ALLOW_DOZENT_COURSESET_ADMIN')) {
             // We have access to institute-wide course sets, so all courses may be assigned.
             $this->onlyOwnCourses = false;
             Navigation::activateItem('/tools/coursesets/sets');
         } else {
             throw new AccessDeniedException();
         }
     }
     PageLayout::addSqueezePackage('admission');
     $this->set_content_type('text/html;charset=windows-1252');
     $views = new ViewsWidget();
     $views->setTitle(_('Aktionen'));
     $views->addLink(_('Anmeldeset anlegen'), $this->url_for('admission/courseset/configure'))->setActive($action == 'configure');
     Sidebar::Get()->addWidget($views);
 }
Beispiel #2
0
 /**
  * common tasks for all actions
  */
 function before_filter(&$action, &$args)
 {
     global $perm, $template_factory;
     parent::before_filter($action, $args);
     $perm->check(Config::get()->LOCK_RULE_ADMIN_PERM ? Config::get()->LOCK_RULE_ADMIN_PERM : 'admin');
     $layout = $template_factory->open('layouts/base');
     $this->set_layout($layout);
     PageLayout::setTitle(_('Verwaltung der Sperrebenen'));
     Navigation::activateItem('/admin/locations/lock_rules');
     URLHelper::bindLinkParam('lock_rule_type', $this->lock_rule_type);
     if (!$this->lock_rule_type || !$GLOBALS['perm']->have_perm('root')) {
         $this->lock_rule_type = 'sem';
     }
     if ($this->lock_rule_type == 'sem') {
         $this->lock_rule_permissions = $GLOBALS['perm']->have_perm('root') ? array('tutor', 'dozent', 'admin', 'root') : array('tutor', 'dozent');
     } elseif ($this->lock_rule_type == 'inst') {
         $this->lock_rule_permissions = array('admin', 'root');
     } elseif ($this->lock_rule_type == 'user') {
         $this->lock_rule_permissions = array('tutor', 'dozent', 'admin', 'root');
     }
     $this->rule_type_names = array('sem' => _('Veranstaltung'), 'inst' => _('Einrichtung'), 'user' => _('Person'));
     $this->sidebar = Sidebar::Get();
     $this->sidebar->setTitle(_('Sperrebenen'));
     $this->sidebar->setImage('sidebar/lock-sidebar.png');
 }
 public function initialize()
 {
     PageLayout::addSqueezePackage('lightbox');
     $this->addStylesheet('assets/pluginmarket.less');
     PageLayout::addHeadElement('link', array('rel' => 'alternate', 'type' => 'application/rss+xml', 'href' => PluginEngine::getLink($this, array(), 'rss/newest'), 'title' => _('Neueste Plugins')));
     $sidebar = Sidebar::Get();
     $sidebar->setImage('../../' . $this->getPluginPath() . '/assets/sidebar-marketplace.png');
 }
Beispiel #4
0
 protected function createSidebar($active = 'week', $calendar = null)
 {
     parent::createSidebar($active, $calendar);
     $sidebar = Sidebar::Get();
     $actions = new ActionsWidget();
     $actions->addLink(_('Termin anlegen'), $this->url_for('calendar/group/edit'), Icon::create('add', 'clickable'), array('data-dialog' => 'size=auto'));
     $actions->addLink(_('Kalender freigeben'), $this->url_for('calendar/single/manage_access/' . $GLOBALS['user']->id, array('group_filter' => $this->range_id)), Icon::create('community', 'clickable'), array('id' => 'calendar-open-manageaccess', 'data-dialog' => '', 'data-dialogname' => 'manageaccess'));
     $sidebar->addWidget($actions);
 }
Beispiel #5
0
 /**
  *
  **/
 public function index_action()
 {
     $this->consumers = RESTAPI\UserPermissions::get($GLOBALS['user']->id)->getConsumers();
     $this->types = array('website' => _('Website'), 'program' => _('Herkömmliches Desktopprogramm'), 'app' => _('Mobile App'));
     $widget = new SidebarWidget();
     $widget->setTitle(_('Informationen'));
     $widget->addElement(new WidgetElement(_('Dies sind die Apps, die Zugriff auf Ihren Account haben.')));
     Sidebar::Get()->addWidget($widget);
 }
Beispiel #6
0
 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (Navigation::hasItem("/tools/questionnaire")) {
         Navigation::activateItem("/tools/questionnaire");
     }
     Sidebar::Get()->setImage(Assets::image_path("sidebar/evaluation-sidebar.png"));
     PageLayout::setTitle(_("Fragebögen"));
     class_exists("Test");
     //trigger autoloading
 }
Beispiel #7
0
 public function set_sidebar()
 {
     $sidebar = Sidebar::Get();
     $sidebar->setImage('sidebar/studygroup-sidebar.png');
     $sidebar->setTitle(_('Meine Studiengruppen'));
     if (count($this->studygroups) > 0) {
         $setting_widget = new ActionsWidget();
         $setting_widget->setTitle(_("Aktionen"));
         $setting_widget->addLink(_('Farbgruppierung ändern'), URLHelper::getLink('dispatch.php/my_courses/groups/all/true'), Icon::create('group4', 'clickable'), array('data-dialog' => 'buttons=true'));
         $sidebar->addWidget($setting_widget);
     }
 }
Beispiel #8
0
 protected function createSidebar($active = null, $calendar = null)
 {
     $active = $active ?: $this->last_view;
     $sidebar = Sidebar::Get();
     $sidebar->setTitle(_('Kalender'));
     $sidebar->setImage('sidebar/schedule-sidebar.png');
     $views = new ViewsWidget();
     $views->addLink(_('Tag'), $this->url_for($this->base . 'day'))->setActive($active == 'day');
     $views->addLink(_('Woche'), $this->url_for($this->base . 'week'))->setActive($active == 'week');
     $views->addLink(_('Monat'), $this->url_for($this->base . 'month'))->setActive($active == 'month');
     $views->addLink(_('Jahr'), $this->url_for($this->base . 'year'))->setActive($active == 'year');
     $sidebar->addWidget($views);
 }
Beispiel #9
0
 protected function createSidebar($active = null, $calendar = null)
 {
     parent::createSidebar($active, $calendar);
     $sidebar = Sidebar::Get();
     if ($calendar->havePermission(Calendar::PERMISSION_WRITABLE)) {
         $actions = new ActionsWidget();
         $actions->addLink(_('Termin anlegen'), $this->url_for('calendar/single/edit'), Icon::create('add', 'clickable'), array('data-dialog' => 'size=auto'));
         if ($calendar->havePermission(Calendar::PERMISSION_OWN) && get_config('CALENDAR_GROUP_ENABLE')) {
             $actions->addLink(_('Kalender freigeben'), $this->url_for('calendar/single/manage_access'), Icon::create('community', 'clickable'), array('id' => 'calendar-open-manageaccess', 'data-dialog' => '', 'data-dialogname' => 'manageaccess'));
         }
         $sidebar->addWidget($actions);
     }
     if ($calendar->havePermission(Calendar::PERMISSION_OWN)) {
         $export = new ExportWidget();
         $export->addLink(_('Termine exportieren'), $this->url_for('calendar/single/export_calendar'), Icon::create('download', 'clickable'), array('data-dialog' => 'size=auto'))->setActive($active == 'export_calendar');
         $export->addLink(_('Termine importieren'), $this->url_for('calendar/single/import'), Icon::create('upload', 'clickable'), array('data-dialog' => 'size=auto'))->setActive($active == 'import');
         $export->addLink(_('Kalender teilen'), $this->url_for('calendar/single/share'), Icon::create('group2', 'clickable'), array('data-dialog' => 'size=auto'))->setActive($active == 'share');
         $sidebar->addWidget($export);
     }
 }
Beispiel #10
0
    /**
     * Displays all available tasks.
     *
     * @param int $page Which page to display
     */
    public function index_action($page = 1)
    {
        $this->max_per_page = Config::get()->ENTRIES_PER_PAGE;
        $this->total        = CronjobTask::countBySql('1');
        $this->page         = max(1, min($page, ceil($this->total / $this->max_per_page)));

        $limit = sprintf(" LIMIT %u, %u", ($this->page - 1) * $this->max_per_page, $this->max_per_page);
        $this->tasks = CronjobTask::findBySQL('1' . $limit);

        // Infobox image was produced from an image by Robbert van der Steeg
        // http://www.flickr.com/photos/robbie73/5924985913/
        $sidebar = Sidebar::Get();
        $sidebar->setTitle(_('Cronjobs'));
        $sidebar->setImage('sidebar/admin-sidebar.png');

        // Aktionen
        $actions = new ViewsWidget();
        $actions->addLink(_('Cronjobs verwalten'),$this->url_for('admin/cronjobs/schedules'));
        $actions->addLink(_('Aufgaben verwalten'),$this->url_for('admin/cronjobs/tasks'))->setActive(true);
        $actions->addLink(_('Logs anzeigen'),$this->url_for('admin/cronjobs/logs'));
        $sidebar->addWidget($actions);
    }
Beispiel #11
0
 /**
  * Displays the deputy information of a user.
  */
 public function index_action()
 {
     if (Request::submitted('add_deputy') && ($deputy_id = Request::option('deputy_id'))) {
         $this->check_ticket();
         if (isDeputy($deputy_id, $this->user->user_id)) {
             $this->reportError(_('%s ist bereits als Vertretung eingetragen.'), get_fullname($deputy_id, 'full'));
         } else {
             if ($deputy_id == $this->user->user_id) {
                 $this->reportError(_('Sie können sich nicht als Ihre eigene Vertretung eintragen!'));
             } else {
                 if (addDeputy($deputy_id, $this->user->user_id)) {
                     $this->reportSuccess(_('%s wurde als Vertretung eingetragen.'), get_fullname($deputy_id, 'full'));
                 } else {
                     $this->reportError(_('Fehler beim Eintragen der Vertretung!'));
                 }
             }
         }
         $this->redirect('settings/deputies');
         return;
     }
     $deputies = getDeputies($this->user->user_id, true);
     $exclude_users = array($this->user->user_id);
     if (is_array($deputies)) {
         $exclude_users = array_merge($exclude_users, array_map(function ($d) {
             return $d['user_id'];
         }, $deputies));
     }
     $this->deputies = $deputies;
     $this->search = new PermissionSearch('user', _('Vor-, Nach- oder Benutzername'), 'user_id', array('permission' => getValidDeputyPerms(), 'exclude_user' => $exclude_users));
     $sidebar = Sidebar::Get();
     $sidebar->setTitle(PageLayout::getTitle());
     $actions = new ActionsWidget();
     // add "add dozent" to infobox
     $mp = MultiPersonSearch::get('settings_add_deputy')->setLinkText(_('Neue Standardvertretung festlegen'))->setDefaultSelectedUser(array_keys($this->deputies))->setLinkIconPath('')->setTitle(_('Neue Standardvertretung festlegen'))->setExecuteURL(URLHelper::getLink('dispatch.php/settings/deputies/add_member'))->setSearchObject($this->search)->setNavigationItem('/links/settings/deputies')->render();
     $element = LinkElement::fromHTML($mp, Icon::create('community+add', 'clickable'));
     $actions->addElement($element);
     Sidebar::Get()->addWidget($actions);
 }
Beispiel #12
0
 /**
  * @see AuthenticatedController::before_filter
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (Request::isXhr()) {
         $this->via_ajax = true;
         $this->set_layout(null);
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
     } else {
         $layout = $GLOBALS['template_factory']->open('layouts/base');
         $this->set_layout($layout);
         PageLayout::setTitle(_('Personenlisten'));
         Navigation::activateItem('/tools/coursesets/userlists');
     }
     PageLayout::addSqueezePackage('admission');
     $this->set_content_type('text/html;charset=windows-1252');
     $views = new ViewsWidget();
     $views->setTitle(_('Aktionen'));
     $views->addLink(_('Personenliste anlegen'), $this->url_for('admission/userlist/configure'))->setActive($action == 'configure');
     Sidebar::Get()->addWidget($views);
 }
Beispiel #13
0
 public function index_action()
 {
     $this->prelim_discussion = vorbesprechung($this->course->id);
     $this->title = $this->course->getFullname();
     $this->course_domains = UserDomain::getUserDomainsForSeminar($this->course->id);
     $this->sem = new Seminar($this->course);
     if ($studienmodulmanagement = PluginEngine::getPlugin('StudienmodulManagement')) {
         foreach ($this->course->study_areas->filter(function ($m) {
             return $m->isModule();
         }) as $module) {
             $this->studymodules[] = array('nav' => $studienmodulmanagement->getModuleInfoNavigation($module->id, $this->course->start_semester->id), 'title' => $studienmodulmanagement->getModuleTitle($module->id, $this->course->start_semester->id));
         }
     }
     // Retrive display of sem_tree
     if (Config::get()->COURSE_SEM_TREE_DISPLAY) {
         $this->studyAreaTree = StudipStudyArea::backwards($this->course->study_areas);
     } else {
         $this->study_areas = $this->course->study_areas->filter(function ($m) {
             return !$m->isModule();
         });
     }
     if (Request::isXhr()) {
         $this->set_layout(null);
         $this->response->add_header('Content-Type', 'text/html;charset=Windows-1252');
         header('X-Title: ' . $this->title);
     } else {
         PageLayout::setHelpKeyword("Basis.InVeranstaltungDetails");
         PageLayout::setTitle($this->title . " - " . _("Details"));
         PageLayout::addSqueezePackage('admission');
         PageLayout::addSqueezePackage('enrolment');
         if ($GLOBALS['SessionSeminar'] == $this->course->id) {
             Navigation::activateItem('/course/main/details');
             SkipLinks::addIndex(Navigation::getItem('/course/main/details')->getTitle(), 'main_content', 100);
         } else {
             $sidebarlink = true;
             $enrolment_info = $this->sem->getEnrolmentInfo($GLOBALS['user']->id);
         }
         $sidebar = Sidebar::Get();
         if ($sidebarlink) {
             $sidebar->setContextAvatar(CourseAvatar::getAvatar($this->course->id));
         }
         $sidebar->setTitle(_('Details'));
         $links = new ActionsWidget();
         $links->addLink(_("Drucken"), URLHelper::getScriptLink("dispatch.php/course/details/index/" . $this->course->id), Icon::create('print', 'clickable'), array('class' => 'print_action', 'target' => '_blank'));
         if ($enrolment_info['enrolment_allowed'] && $sidebarlink) {
             if (in_array($enrolment_info['cause'], words('member root courseadmin'))) {
                 $abo_msg = _("direkt zur Veranstaltung");
             } else {
                 $abo_msg = _("Zugang zur Veranstaltung");
             }
             $links->addLink($abo_msg, URLHelper::getScriptLink("dispatch.php/course/enrolment/apply/" . $this->course->id), Icon::create('door-enter', 'clickable'), array('data-dialog' => ''));
         }
         if (Config::get()->SCHEDULE_ENABLE && !$GLOBALS['perm']->have_studip_perm("user", $this->course->id) && !$GLOBALS['perm']->have_perm('admin') && $this->sem->getMetaDateCount()) {
             $query = "SELECT COUNT(*) FROM schedule_seminare WHERE seminar_id = ? AND user_id = ?";
             if (!DBManager::Get()->fetchColumn($query, array($this->course->id, $GLOBALS['user']->id))) {
                 $links->addLink(_("Nur im Stundenplan vormerken"), URLHelper::getLink("dispatch.php/calendar/schedule/addvirtual/" . $this->course->id), Icon::create('info', 'clickable'));
             }
         }
         if ($this->send_from_search_page) {
             $links->addLink(_("Zurück zur letzten Auswahl"), URLHelper::getLink($this->send_from_search_page), Icon::create('link-intern', 'clickable'));
         }
         if ($links->hasElements()) {
             $sidebar->addWidget($links);
         }
         $sidebar->setImage('sidebar/seminar-sidebar.png');
         $sidebar->setContextAvatar(CourseAvatar::getAvatar($this->course->id));
         $sidebar = Sidebar::Get();
         $sidebar->setImage('sidebar/seminar-sidebar.png');
         $sidebar->setContextAvatar(CourseAvatar::getAvatar($this->course->id));
         if ($enrolment_info['description']) {
             PageLayout::postMessage(MessageBox::info($enrolment_info['description']));
         }
     }
 }
Beispiel #14
0
 private function initSidebar($active_id = null)
 {
     $sidebar = Sidebar::Get();
     $letterlist = new SidebarWidget();
     foreach (range('A', 'Z') as $letter) {
         if ($this->contacts[$letter]) {
             $html .= "<a href='#letter_{$letter}'>{$letter}</a>";
         } else {
             $html .= "<span>{$letter}</span>";
         }
     }
     $letterlist->setTitle(_('Schnellzugriff'));
     $letterlist->addElement(new WidgetElement("<div class='letterlist'>{$html}</div>"));
     $sidebar->addWidget($letterlist);
     // Groups
     $actions = new ActionsWidget();
     $actions->addLink(_('Neue Gruppe anlegen'), $this->url_for('contact/editGroup'), Icon::create('group3+add', 'clickable'))->asDialog('size=auto');
     $actions->addLink(_('Nachricht an alle'), $this->url_for('messages/write', array('rec_uname' => $this->allContacts->pluck('username'))), Icon::create('mail', 'clickable'))->asDialog();
     $actions->addLink(_('E-Mail an alle'), URLHelper::getLink('mailto:' . join(',', $this->allContacts->pluck('email'))), Icon::create('mail', 'clickable'));
     $actions->addLink(_('Alle vCards herunterladen'), $this->url_for('contact/vcard/' . $this->filter), Icon::create('vcard', 'clickable'));
     $sidebar->addWidget($actions);
     // Groups navigation
     $groupsWidget = new ViewsWidget();
     $groupsWidget->setTitle(_('Gruppen'));
     $groupsWidget->addLink(_('Alle Kontakte'), URLHelper::getLink('dispatch.php/contact/index'))->setActive(!$active_id);
     foreach ($this->groups as $group) {
         $groupsWidget->addLink($group->name, URLHelper::getLink('dispatch.php/contact/index/' . $group->id))->setActive($group->id == $active_id);
     }
     $sidebar->addWidget($groupsWidget);
 }
Beispiel #15
0
 private function setSidebar($action)
 {
     $sidebar = Sidebar::Get();
     $sidebar->setTitle(PageLayout::getTitle() ?: _('Rollen'));
     $sidebar->setImage('sidebar/roles-sidebar.png');
     $views = new ViewsWidget();
     $views->addLink(_('Rollen verwalten'), $this->url_for('admin/role'))->setActive($action === 'index');
     $views->addLink(_('Personenzuweisungen bearbeiten'), $this->url_for('admin/role/assign_role'))->setActive($action === 'assign_role');
     $views->addLink(_('Pluginzuweisungen bearbeiten'), $this->url_for('admin/role/assign_plugin_role'))->setActive($action === 'assign_plugin_role');
     $views->addLink(_('Rollenzuweisungen anzeigen'), $this->url_for('admin/role/show_role'))->setActive($action === 'show_role');
     $sidebar->addWidget($views);
     $actions = new ActionsWidget();
     $actions->addLink(_('Neue Rolle anlegen'), $this->url_for('admin/role/add'), Icon::create('add', 'clickable'))->asDialog('size=auto');
     $sidebar->addWidget($actions);
 }
Beispiel #16
0
 /**
  * Edits a schedule.
  *
  * @param String $id   Id of the schedule in question (null to create)
  * @param int    $page Return to this page after editing (optional)
  */
 public function edit_action($id = null, $page = 1)
 {
     if (Request::submitted('store')) {
         $parameters = Request::getArray('parameters');
         $schedule = CronjobSchedule::find($id) ?: new CronjobSchedule();
         $schedule->title = Request::get('title');
         $schedule->description = Request::get('description');
         $schedule->active = Request::int('active', 0);
         if ($schedule->isNew()) {
             $schedule->task_id = Request::option('task_id');
         }
         $schedule->parameters = $parameters[$schedule->task_id];
         $schedule->type = Request::option('type') === 'once' ? 'once' : 'periodic';
         if ($schedule->type === 'once') {
             $temp = Request::getArray('once');
             $schedule->next_execution = strtotime($temp['date'] . ' ' . $temp['time']);
         } else {
             $temp = Request::getArray('periodic');
             $schedule->minute = $this->extractCronItem($temp['minute']);
             $schedule->hour = $this->extractCronItem($temp['hour']);
             $schedule->day = $this->extractCronItem($temp['day']);
             $schedule->month = $this->extractCronItem($temp['month']);
             $schedule->day_of_week = strlen($temp['day_of_week']['value']) ? (int) $temp['day_of_week']['value'] : null;
             if ($schedule->active) {
                 $schedule->next_execution = $schedule->calculateNextExecution();
             }
         }
         $schedule->store();
         PageLayout::postMessage(MessageBox::success(_('Die Änderungen wurden gespeichert.')));
         $this->redirect('admin/cronjobs/schedules/index/' . $page);
         return;
     }
     PageLayout::setTitle(_('Cronjob-Verwaltung') . ' - ' . _('Cronjob bearbeiten'));
     // Infobox image was produced from an image by Robbert van der Steeg
     // http://www.flickr.com/photos/robbie73/5924985913/
     $sidebar = Sidebar::Get();
     $sidebar->setImage('sidebar/date-sidebar.png');
     $sidebar->setTitle(_('Cronjobs'));
     $actions = new ActionsWidget();
     $actions->addLink(_('Zurück zur Übersicht'), $this->url_for('admin/cronjobs/schedules/index/' . $page), Icon::create('link-intern', 'clickable'));
     $sidebar->addWidget($actions);
     $this->page = $page;
     $this->tasks = CronjobTask::findBySql('1');
     $this->schedule = CronjobSchedule::find($id) ?: new CronjobSchedule();
 }
Beispiel #17
0
 /**
  * Returns a widget for semester selection
  * @param $sem
  * @return OptionsWidget
  */
 private function setSemesterWidget(&$sem)
 {
     $semesters = new SimpleCollection(Semester::getAll());
     $this->sem = $sem;
     $this->semesters = $semesters->orderBy('beginn desc');
     $sidebar = Sidebar::Get();
     $widget = new SidebarWidget();
     $widget->setTitle(_('Semesterfilter'));
     $this->render_template('my_courses/_semester_filter.php', null);
     $html = $this->response->body;
     $this->erase_response();
     $widget->addElement(new WidgetElement($html));
     $sidebar->addWidget($widget);
 }
Beispiel #18
0
    /**
     * Displays all available log entries according to the set filters.
     *
     * @param int $page Which page to display
     */
    public function index_action($page = 1)
    {
        $filter = $_SESSION['cronlog-filter'];
        
        $this->max_per_page   = Config::get()->ENTRIES_PER_PAGE;
        $this->total          = CronjobLog::countBySql();
        $this->total_filtered = CronjobLog::countBySql($filter['where']);
        $this->page           = max(1, min($page, ceil($this->total_filtered / $this->max_per_page)));

        $order = " ORDER BY executed DESC";
        $limit = sprintf(" LIMIT %u, %u", ($this->page - 1) * $this->max_per_page, $this->max_per_page);
        $this->logs = CronjobLog::findBySQL($filter['where'] . $order . $limit);

        // Filters
        $this->schedules  = CronjobSchedule::findBySql('1');
        $this->tasks      = CronjobTask::findBySql('1');
        $this->filter     = $filter['values'];

        // Infobox image was produced from an image by Robbert van der Steeg
        // http://www.flickr.com/photos/robbie73/5924985913/
        // Aktionen
        $sidebar = Sidebar::Get();
        $sidebar->setTitle(_('Cronjobs'));
        $sidebar->setImage('sidebar/admin-sidebar.png');

        $actions = new ViewsWidget();
        $actions->addLink(_('Cronjobs verwalten'),$this->url_for('admin/cronjobs/schedules'));
        $actions->addLink(_('Aufgaben verwalten'),$this->url_for('admin/cronjobs/tasks'));
        $actions->addLink(_('Logs anzeigen'),$this->url_for('admin/cronjobs/logs'))->setActive(true);
        $sidebar->addWidget($actions);
    }
Beispiel #19
0
 /**
  * Extends this controller with neccessary sidebar
  *
  * @param String $view Currently viewed group
  */
 protected function setSidebar()
 {
     $sidebar = Sidebar::Get();
     $sidebar->setImage('sidebar/admin-sidebar.png');
     $actions = new ActionsWidget();
     $actions->addLink(_('Übersicht'), $this->url_for('admin/banner'), Icon::create('visibility-visible', 'clickable'));
     $actions->addLink(_('Neues Banner anlegen'), $this->url_for('admin/banner/new'), Icon::create('add', 'clickable'));
     $sidebar->addWidget($actions);
 }
Beispiel #20
0
 /**
  * Create the messagebox
  */
 private function setSidebar()
 {
     $sidebar = Sidebar::Get();
     $sidebar->setTitle(_('Studiengänge'));
     $sidebar->setImage('sidebar/admin-sidebar.png');
     $links = new ActionsWidget();
     $links->addLink(_('Gruppierung nach Fächer'), $this->url_for('admin/studycourse/profession'), Icon::create('visibility-visible', 'clickable'));
     $links->addLink(_('Gruppierung nach Abschlüssen'), $this->url_for('admin/studycourse/degree'), Icon::create('visibility-visible', 'clickable'));
     $links->addLink(_('Neue Fächer anlegen'), $this->url_for('admin/studycourse/newprofession'), Icon::create('add', 'clickable'));
     $links->addLink(_('Neue Abschlüsse anlegen'), $this->url_for('admin/studycourse/newdegree'), Icon::create('add', 'clickable'));
     $sidebar->addWidget($links);
 }
Beispiel #21
0
 /**
  * Sets up the sidebar
  *
  * @param bool $user_section Adjust sidebar to user section?
  */
 protected function setupSidebar($user_section = false)
 {
     // Basic info and layout
     $sidebar = Sidebar::Get();
     $sidebar->setTitle(_('Konfiguration'));
     $sidebar->setImage(Assets::image_path('sidebar/admin-sidebar.png'));
     // Views
     $views = new ViewsWidget();
     $views->addLink(_('Globale Konfiguration'), $this->url_for('admin/configuration/configuration'))->setActive(!$user_section);
     $views->addLink(_('Personenkonfiguration'), $this->url_for('admin/configuration/user_configuration'))->setActive($user_section);
     $sidebar->addWidget($views);
     // Add section selector when not in user mode
     if (!$user_section) {
         $options = array();
         foreach (ConfigurationModel::getConfig() as $key => $value) {
             $options[$key] = $key ?: '- ' . _('Ohne Kategorie') . ' -';
         }
         $widget = new SelectWidget(_('Anzeigefilter'), $this->url_for('admin/configuration/configuration'), 'section', 'get');
         $widget->addElement(new SelectElement(-1, _('alle anzeigen')));
         $widget->setOptions($options);
         $sidebar->addWidget($widget);
     }
     // Add specific searches (specific user when in user mode, keyword
     // otherwise)
     if ($user_section) {
         $search = new SearchWidget($this->url_for('admin/configuration/user_configuration'));
         $search->addNeedle(_('Person suchen'), 'user_id', true, new StandardSearch('user_id'), 'function () { $(this).closest("form").submit(); }');
     } else {
         $search = new SearchWidget($this->url_for('admin/configuration/configuration'));
         $search->addNeedle(_('Suchbegriff'), 'needle', true);
     }
     $sidebar->addWidget($search);
 }
Beispiel #22
0
        </tr>
    <? endif; ?>
        <tr>
            <td>&nbsp;</td>
            <td colspan="2" align="center">
                <br>
                <?php 
echo Button::create(_('Übernehmen'));
?>
                <? if ($resObject->isUnchanged()) : ?>
                    <?php 
echo LinkButton::createCancel(_('Abbrechen'), URLHelper::getLink('?cancel_edit=' . $resObject->id));
?>
                <? endif; ?>
                <br>&nbsp;
            </td>
        </tr>
    </tbody>
</table>

</form>
<br><br>
<?
$sidebar = Sidebar::Get();
$sidebar->setTitle(htmlReady($resObject->getName()));
$action = new ActionsWidget();
$action->addLink(_('Ressourcensuche'), URLHelper::getLink('resources.php?view=search&quick_view_mode=' . $view_mode));

$sidebar->addWidget($action);
?>
Beispiel #23
0
 /**
  * edit one room requests
  */
 public function edit_action()
 {
     Helpbar::get()->addPlainText(_('Information'), _('Hier können Sie Angaben zu gewünschten Raumeigenschaften machen.'));
     if (Request::option('new_room_request_type')) {
         $request = new RoomRequest();
         $request->seminar_id = $this->course_id;
         $request->user_id = $GLOBALS['user']->id;
         list($new_type, $id) = explode('_', Request::option('new_room_request_type'));
         if ($new_type == 'course') {
             if ($existing_request = RoomRequest::existsByCourse($this->course_id)) {
                 $request = RoomRequest::find($existing_request);
             }
         }
         if ($new_type == 'date') {
             $request->termin_id = $id;
             if ($existing_request = RoomRequest::existsByDate($id)) {
                 $request = RoomRequest::find($existing_request);
             }
         } elseif ($new_type == 'cycle') {
             $request->metadate_id = $id;
             if ($existing_request = RoomRequest::existsByCycle($id)) {
                 $request = RoomRequest::find($existing_request);
             }
         }
     } else {
         $request = RoomRequest::find(Request::option('request_id'));
     }
     $admission_turnout = Seminar::getInstance($this->course_id)->admission_turnout;
     $attributes = self::process_form($request, $admission_turnout);
     $this->params = array('request_id' => $request->getId());
     $this->params['fromDialog'] = Request::get('fromDialog');
     if (Request::get('origin') !== null) {
         $this->params['origin'] = Request::get('origin');
     }
     if (Request::submitted('save') || Request::submitted('save_close')) {
         if (!($request->getSettedPropertiesCount() || $request->getResourceId())) {
             PageLayout::postMessage(MessageBox::error(_("Die Anfrage konnte nicht gespeichert werden, da Sie mindestens einen Raum oder mindestens eine Eigenschaft (z.B. Anzahl der Sitzplätze) angeben müssen!")));
         } else {
             $request->setClosed(0);
             $this->request_stored = $request->store();
             if ($this->request_stored) {
                 PageLayout::postMessage(MessageBox::success(_("Die Raumanfrage und gewünschte Raumeigenschaften wurden gespeichert")));
             }
             if (Request::submitted('save_close')) {
                 if (!Request::isXhr()) {
                     $this->redirect('course/room_requests/index/' . $this->course_id);
                 } else {
                     if (Request::get('fromDialog') == true && !isset($this->params['origin'])) {
                         $this->relocate('course/room_requests/index/' . $this->course_id);
                     } else {
                         if (isset($this->params['origin'])) {
                             $this->relocate(str_replace('_', '/', $this->params['origin']) . '?cid=' . $this->course_id);
                         } else {
                             $this->relocate('course/room_requests/index/' . $this->course_id);
                         }
                     }
                 }
             }
         }
     }
     if (!$request->isNew() && $request->isDirty()) {
         PageLayout::postMessage(MessageBox::info(_("Die Änderungen an der Raumanfrage wurden noch nicht gespeichert!")));
     }
     $room_categories = array_values(array_filter(getResourcesCategories(), create_function('$a', 'return $a["is_room"] == 1;')));
     if (!$request->getCategoryId() && count($room_categories) == 1) {
         $request->setCategoryId($room_categories[0]['category_id']);
     }
     $this->search_result = $attributes['search_result'];
     $this->search_by_properties = $attributes['search_by_properties'];
     $this->admission_turnout = $admission_turnout;
     $this->request = $request;
     $this->room_categories = $room_categories;
     $this->new_room_request_type = Request::option('new_room_request_type');
     $this->is_resources_admin = getGlobalPerms($GLOBALS['user']->id);
     $actions = new ActionsWidget();
     $actions->addLink(_('Bearbeitung abbrechen'), $this->link_for('index/' . $this->course_id), Icon::create('decline', 'clickable'));
     if (getGlobalPerms($GLOBALS['user']->id) == 'admin' || $GLOBALS['perm']->have_perm('admin') && count(getMyRoomRequests(null, null, true, $request->getId()))) {
         $actions->addLink(_('Raumanfrage auflösen'), URLHelper::getLink('resources.php', array('view' => 'edit_request', 'single_request' => $request->getId())), Icon::create('admin', 'clickable'));
     }
     if (Request::isXhr()) {
         Sidebar::Get()->addWidget($actions);
         $widget = new SidebarWidget();
         $widget->setTitle(_('Informationen'));
         if ($request->isNew()) {
             $widget->addElement(new WidgetElement(_('Dies ist eine neue Raumanfrage.')));
         } else {
             $info_txt = '<p>' . sprintf(_('Erstellt von: %s'), User::find($request->user_id)->getFullname()) . '</p>';
             $info_txt .= '<p>' . sprintf(_('Erstellt am: %s'), strftime('%x %H:%M', $request->mkdate)) . '</p>';
             $info_txt .= '<p>' . sprintf(_('Letzte Änderung: %s'), strftime('%x %H:%M', $request->chdate)) . '</p>';
             $widget->addElement(new WidgetElement($info_txt));
         }
         Sidebar::Get()->addWidget($widget);
     }
 }
Beispiel #24
0
 /**
  * Creates the sidebar
  */
 private function setSidebar()
 {
     $actions = new ActionsWidget();
     $actions->addLink(_('Startsemester ändern'), $this->url_for('course/timesrooms/editSemester'), Icon::create('date', 'clickable'))->asDialog('size=400');
     Sidebar::Get()->addWidget($actions);
     $widget = new SelectWidget(_('Semesterfilter'), $this->url_for('course/timesrooms/index', array('cmd' => 'applyFilter')), 'newFilter');
     foreach ($this->selection as $item) {
         $element = new SelectElement($item['value'], $item['linktext'], $item['is_selected']);
         $widget->addElement($element);
     }
     Sidebar::Get()->addWidget($widget);
     if ($GLOBALS['perm']->have_perm('admin')) {
         $list = new SelectorWidget();
         $list->setUrl($this->url_for('/index'));
         $list->setSelectParameterName('cid');
         foreach (AdminCourseFilter::get()->getCourses(false) as $seminar) {
             $element = new SelectElement($seminar['Seminar_id'], $seminar['Name']);
             $list->addElement($element, 'select-' . $seminar['Seminar_id']);
         }
         $list->setSelection($this->course->id);
         Sidebar::Get()->addWidget($list);
     }
 }
Beispiel #25
0
 /**
  * Get contents of the info box for this action.
  */
 function set_sidebar()
 {
     $sidebar = Sidebar::Get();
     $sidebar->setImage('sidebar/admin-sidebar.png');
     $actions = new ActionsWidget();
     $actions->addLink(_('Neue Nutzerdomäne anlegen'), $this->url_for('admin/domain/new'), Icon::create('add', 'clickable'));
     $sidebar->addWidget($actions);
 }
Beispiel #26
0
 /**
  * Extends this controller with neccessary infobox
  *
  * @param String $view Currently viewed group
  */
 private function setSidebar($view)
 {
     $sidebar = Sidebar::Get();
     $sidebar->setImage('sidebar/smiley-sidebar.png');
     $sidebar->setTitle(PageLayout::getTitle() ?: _('Smileys'));
     // Render items
     $factory = new Flexi_TemplateFactory($this->dispatcher->trails_root . '/views/admin/smileys/');
     $actions = new ActionsWidget();
     $actions->addLink(_('Neues Smiley hochladen'), $this->url_for('admin/smileys/upload', $view), Icon::create('add', 'clickable'))->asDialog('size=auto');
     $actions->addLink(_('Smileys zählen'), $this->url_for('admin/smileys/count', $view), Icon::create('code', 'clickable'));
     $actions->addLink(_('Tabelle aktualisieren'), $this->url_for('admin/smileys/refresh', $view), Icon::create('refresh', 'clickable'));
     $actions->addLink(_('Smiley-Übersicht öffnen'), URLHelper::getLink('dispatch.php/smileys'), Icon::create('smiley', 'clickable'))->asDialog();
     $sidebar->addWidget($actions);
     $widget = new SidebarWidget();
     $filter = $factory->render('selector', array('characters' => Smiley::getUsedCharacters(), 'controller' => $this, 'view' => $view));
     $widget->setTitle(_('Filter'));
     $widget->addElement(new WidgetElement($filter));
     $sidebar->addWidget($widget);
     $widget = new SidebarWidget();
     $statistics = $factory->render('statistics', Smiley::getStatistics());
     $widget->setTitle(_('Statistiken'));
     $widget->addElement(new WidgetElement($statistics));
     $sidebar->addWidget($widget);
 }
Beispiel #27
0
                        <? endif ?>
                    </div>
                </div>
            </li>
        <? endforeach ?>
    </ul>

    <div style="text-align: center;">
        <? if ($material['host_id'] || $material['user_id'] !== $GLOBALS['user']->id) : ?>
            <?php 
echo \Studip\LinkButton::create(_("Review schreiben"), PluginEngine::getLink($plugin, array(), 'market/review/' . $material->getId()), array('data-dialog' => 1));
?>
        <? endif ?>
    </div>

</div>


<?
Sidebar::Get()->setImage($plugin->getPluginURL()."/assets/sidebar-service.png");
if ($GLOBALS['perm']->have_perm("autor")) {
    $actions = new ActionsWidget();
    $actions->addLink(
        _("Eigenes Lernmaterial hochladen"),
        PluginEngine::getURL($plugin, array(), "mymaterial/edit"),
        Icon::create("add", "clickable"),
        array('data-dialog' => "1")
    );
    Sidebar::Get()->addWidget($actions);
}
Beispiel #28
0
 /**
  * Adds a search widget to the sidebar
  */
 private function setSearchWiget()
 {
     $sidebar = Sidebar::Get();
     $search = new SearchWidget(URLHelper::getLink('dispatch.php/admin/courses'));
     $search->addNeedle(_('Freie Suche'), 'search', true, null, null, $GLOBALS['user']->cfg->ADMIN_COURSES_SEARCHTEXT);
     $sidebar->addWidget($search, 'filter_search');
 }
Beispiel #29
0
 public function details_action($plugin_id)
 {
     $this->marketplugin = MarketPlugin::find($plugin_id);
     if (!$this->marketplugin) {
         throw new Trails_Exception(404);
     }
     Navigation::addItem('/pluginmarket/presenting/details', new AutoNavigation(_('Details'), $this->url_for('presenting/details/' . $plugin_id)));
     PageLayout::setTitle($this->marketplugin->name . ' - ' . $this->plugin->getDisplayTitle());
     if (Request::isPost() && Request::submitted("delete_plugin") && $this->marketplugin->isRootable()) {
         $this->marketplugin->delete();
         PageLayout::postMessage(MessageBox::success(_("Plugin wurde gelöscht.")));
         $this->redirect('presenting/overview');
         return;
     }
     $this->marketplugin['rating'] = $this->marketplugin->calculateRating();
     $this->marketplugin->store();
     // Add actions widget
     $sidebar = Sidebar::Get();
     $actions = new ActionsWidget();
     $actions->addLink(_('Nutzung mitteilen'), $this->url_for('presenting/propose_usage/' . $this->marketplugin->id), Icon::create('add', "clickable"))->asDialog('size=auto');
     $sidebar->addWidget($actions);
 }
Beispiel #30
0
 /**
  * Adds the content to sidebar
  */
 private function setSidebar()
 {
     $sidebar = Sidebar::Get();
     $sidebar->setTitle(_('Ferien'));
     $sidebar->setImage('sidebar/admin-sidebar.png');
     $views = new ViewsWidget();
     $views->addLink(_('Alle Einträge'), $this->url_for('admin/holidays', array('filter' => null)))->setActive(!$this->filter);
     $views->addLink(_('Aktuelle/zukünftige Einträge'), $this->url_for('admin/holidays', array('filter' => 'current')))->setActive($this->filter === 'current');
     $views->addLink(_('Vergangene Einträge'), $this->url_for('admin/holidays', array('filter' => 'past')))->setActive($this->filter === 'past');
     $sidebar->addWidget($views);
     $links = new ActionsWidget();
     $links->addLink(_('Neue Ferien anlegen'), $this->url_for('admin/holidays/edit', array('filter' => null)), Icon::create('add', 'clickable'))->asDialog('size=auto');
     $sidebar->addWidget($links);
 }