コード例 #1
0
ファイル: cancel_dates.php プロジェクト: ratbird/hope
 /**
  * common tasks for all actions
  */
 function before_filter(&$action, &$args)
 {
     global $perm;
     parent::before_filter($action, $args);
     if (Request::get('termin_id')) {
         $this->dates[0] = new SingleDate(Request::option('termin_id'));
         $this->course_id = $this->dates[0]->range_id;
     }
     if (Request::get('issue_id')) {
         $this->issue_id = Request::option('issue_id');
         $this->dates = array_values(array_map(function ($data) {
             $d = new SingleDate();
             $d->fillValuesFromArray($data);
             return $d;
         }, IssueDB::getDatesforIssue(Request::option('issue_id'))));
         $this->course_id = $this->dates[0]->range_id;
     }
     if (!get_object_type($this->course_id, array('sem')) || SeminarCategories::GetBySeminarId($this->course_id)->studygroup_mode || !$perm->have_studip_perm("tutor", $this->course_id)) {
         throw new Trails_Exception(400);
     }
     PageLayout::setHelpKeyword("Basis.VeranstaltungenVerwaltenAendernVonZeitenUndTerminen");
     PageLayout::setTitle(Course::findCurrent()->getFullname() . " - " . _("Veranstaltungstermine absagen"));
     $this->set_content_type('text/html;charset=windows-1252');
     if (Request::isXhr()) {
         $this->set_layout(null);
         $this->response->add_header('X-Title', PageLayout::getTitle());
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
     }
 }
コード例 #2
0
ファイル: dates.php プロジェクト: ratbird/hope
 public function new_topic_action()
 {
     Navigation::activateItem('/course/schedule/dates');
     if (Request::isAjax()) {
         PageLayout::setTitle(_("Thema hinzufügen"));
     }
     $this->date = new CourseDate(Request::option("termin_id"));
     $this->course = Course::findCurrent();
 }
コード例 #3
0
ファイル: topics.php プロジェクト: ratbird/hope
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     checkObject();
     checkObjectModule("schedule");
     PageLayout::setTitle(sprintf('%s - %s', Course::findCurrent()->getFullname(), _("Themen")));
     $seminar = new Seminar(Course::findCurrent());
     $this->forum_activated = $seminar->getSlotModule('forum');
     $this->documents_activated = $seminar->getSlotModule('documents');
 }
コード例 #4
0
ファイル: members.php プロジェクト: ratbird/hope
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     global $perm;
     checkObject();
     checkObjectModule("participants");
     $this->course_id = $_SESSION['SessSemName'][1];
     $this->course_title = $_SESSION['SessSemName'][0];
     $this->user_id = $GLOBALS['auth']->auth['uid'];
     // Check dozent-perms
     if ($perm->have_studip_perm('dozent', $this->course_id)) {
         $this->is_dozent = true;
     }
     // Check tutor-perms
     if ($perm->have_studip_perm('tutor', $this->course_id)) {
         $this->is_tutor = true;
     }
     // Check autor-perms
     if ($perm->have_studip_perm('autor', $this->course_id)) {
         $this->is_autor = true;
     }
     if ($this->is_tutor) {
         PageLayout::setHelpKeyword("Basis.VeranstaltungenVerwaltenTeilnehmer");
     } else {
         PageLayout::setHelpKeyword("Basis.InVeranstaltungTeilnehmer");
     }
     // Check lock rules
     $this->dozent_is_locked = LockRules::Check($this->course_id, 'dozent');
     $this->tutor_is_locked = LockRules::Check($this->course_id, 'tutor');
     $this->is_locked = LockRules::Check($this->course_id, 'participants');
     // Layoutsettings
     PageLayout::setTitle(sprintf('%s - %s', Course::findCurrent()->getFullname(), _("Teilnehmende")));
     PageLayout::addScript('members.js');
     SkipLinks::addIndex(Navigation::getItem('/course/members')->getTitle(), 'main_content', 100);
     object_set_visit_module('participants');
     $this->last_visitdate = object_get_visit($this->course_id, 'participants');
     // Check perms and set the last visit date
     if (!$this->is_tutor) {
         $this->last_visitdate = time() + 10;
     }
     // Get the max-page-value for the pagination
     $this->max_per_page = Config::get()->ENTRIES_PER_PAGE;
     $this->status_groups = array('dozent' => get_title_for_status('dozent', 2), 'tutor' => get_title_for_status('tutor', 2), 'autor' => get_title_for_status('autor', 2), 'user' => get_title_for_status('user', 2), 'accepted' => get_title_for_status('accepted', 2), 'awaiting' => _("Wartende Personen"), 'claiming' => _("Wartende Personen"));
     // StatusGroups for the view
     $this->decoratedStatusGroups = array('dozent' => get_title_for_status('dozent', 1), 'autor' => get_title_for_status('autor', 1), 'tutor' => get_title_for_status('tutor', 1), 'user' => get_title_for_status('user', 1));
     //check for admission / waiting list
     update_admission($this->course_id);
     // Create new MembersModel, to get additionanl informations to a given Seminar
     $this->members = new MembersModel($this->course_id, $this->course_title);
     $this->members->checkUserVisibility();
     // Set default sidebar image
     $sidebar = Sidebar::get();
     $sidebar->setImage('sidebar/person-sidebar.png');
 }
コード例 #5
0
ファイル: block_appointments.php プロジェクト: ratbird/hope
 /**
  * Common tasks for all actions
  *
  * @param String $action Called action
  * @param Array  $args   Possible arguments
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     $course_id = $args[0];
     $this->course_id = Request::option('cid', $course_id);
     if (!get_object_type($this->course_id, array('sem')) || SeminarCategories::GetBySeminarId($this->course_id)->studygroup_mode || !$GLOBALS['perm']->have_studip_perm("tutor", $this->course_id)) {
         throw new Trails_Exception(400);
     }
     PageLayout::addSqueezePackage('raumzeit');
     PageLayout::setHelpKeyword('Basis.VeranstaltungenVerwaltenAendernVonZeitenUndTerminen');
     PageLayout::setTitle(Course::findCurrent()->getFullname() . " - " . _('Blockveranstaltungstermine anlegen'));
 }
コード例 #6
0
ファイル: show.php プロジェクト: anantace/Kursadministration
 public function before_filter(&$action, &$args)
 {
     $this->set_layout($GLOBALS['template_factory']->open('layouts/base'));
     $this->course = Course::findCurrent();
     if (!$this->course) {
         throw new CheckObjectException(_('Sie haben kein Objekt gewählt.'));
     } else {
         $this->sem_id = $this->course->getID();
         $this->seminar = new Seminar($this->sem_id);
     }
     //if ($GLOBALS['perm']->have_studip_perm('tutor', $GLOBALS['SessSemName'][1])) {
     $widget = new ActionsWidget();
     $widget->addLink(_('Kursverwaltung'), $this->url_for('show/course'), false);
     $widget->addLink(_('Teilnehmerverwaltung'), $this->url_for('show'), false);
     Sidebar::get()->addWidget($widget);
     //}
     Navigation::activateItem('/admin/kursadmin');
 }
コード例 #7
0
ファイル: overview.php プロジェクト: ratbird/hope
 function before_filter(&$action, &$args)
 {
     global $SEM_TYPE, $SEM_CLASS;
     parent::before_filter($action, $args);
     checkObject();
     $this->course = Course::findCurrent();
     if (!$this->course) {
         throw new CheckObjectException(_('Sie haben kein Objekt gewählt.'));
     }
     $this->course_id = $this->course->id;
     PageLayout::setHelpKeyword("Basis.InVeranstaltungKurzinfo");
     PageLayout::setTitle($GLOBALS['SessSemName']["header_line"] . " - " . _("Kurzinfo"));
     Navigation::activateItem('/course/main/info');
     // add skip link
     SkipLinks::addIndex(Navigation::getItem('/course/main/info')->getTitle(), 'main_content', 100);
     $this->sem = Seminar::getInstance($this->course_id);
     $sem_class = $this->sem->getSemClass();
     $this->studygroup_mode = $sem_class["studygroup_mode"];
 }
コード例 #8
0
ファイル: avatar.php プロジェクト: ratbird/hope
 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     $this->course_id = current($args);
     if ($this->course_id === '' || get_object_type($this->course_id) !== 'sem' || !$GLOBALS['perm']->have_studip_perm("tutor", $this->course_id)) {
         $this->set_status(403);
         return FALSE;
     }
     $this->body_id = 'custom_avatar';
     PageLayout::setTitle(Course::findCurrent()->getFullname() . ' - ' . _('Bild ändern'));
     $sem = Seminar::getInstance($this->course_id);
     $this->studygroup_mode = $sem->getSemClass()->offsetget("studygroup_mode");
     if ($this->studygroup_mode) {
         $this->avatar = StudygroupAvatar::getAvatar($this->course_id);
     } else {
         $this->avatar = CourseAvatar::getAvatar($this->course_id);
     }
     Navigation::activateItem('/course/admin/avatar');
 }
コード例 #9
0
ファイル: study_areas.php プロジェクト: ratbird/hope
 function before_filter(&$action, &$args)
 {
     global $perm;
     parent::before_filter($action, $args);
     // Search for course object
     $this->course = Course::findCurrent();
     // check course object and perms
     if (!is_null($this->course) && !$perm->have_studip_perm("tutor", $this->course->id)) {
         $this->set_status(403);
         return FALSE;
     }
     $this->set_content_type('text/html; charset=windows-1252');
     // Init Studyareas-Step for
     $this->step = new StudyAreasWizardStep();
     $this->values = array();
     $this->values['StudyAreasWizardStep']['studyareas'] = $this->get_area_ids($this->course->id);
     $this->values['StudyAreasWizardStep']['ajax_url'] = $this->url_for('course/study_areas/ajax');
     $this->values['StudyAreasWizardStep']['no_js_url'] = $this->url_for('course/study_areas/show');
     PageLayout::setTitle($this->course->getFullname() . ' - ' . _('Studienbereiche'));
 }
コード例 #10
0
ファイル: SeminarTabs.php プロジェクト: anantace/SeminarTabs
 /**
  * @var Container
  */
 public function __construct()
 {
     parent::__construct();
     global $perm;
     $this->course = Course::findCurrent();
     $this->course_id = $this->course->id;
     $this->course = Course::findCurrent();
     if ($this->course) {
         $this->setupStudIPNavigation();
         if (Navigation::hasItem('/course/admin') && $perm->have_studip_perm('dozent', $this->course_id)) {
             $url = PluginEngine::getURL($this);
             $scormItem = new Navigation(_('Inhaltselemente bearbeiten'), $url);
             Navigation::addItem('/course/admin/seminar_tabs', $scormItem);
         } else {
             if (Navigation::hasItem('/admin/course/details')) {
                 $url = PluginEngine::getURL($this);
                 $scormItem = new Navigation(_('Inhaltselemente bearbeiten'), $url);
                 Navigation::addItem('/admin/course/seminar_tabs', $scormItem);
             }
         }
     }
 }
コード例 #11
0
ファイル: timesrooms.php プロジェクト: ratbird/hope
 /**
  * Common actions before any other action
  *
  * @param String $action Action to be executed
  * @param Array $args Arguments passed to the action
  * @throws Trails_Exception when either no course was found or the user
  *                          may not access this area
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     // Try to find a valid course
     if (Course::findCurrent()) {
         $course_id = Course::findCurrent()->id;
     } else {
         throw new Trails_Exception(404, _('Es wurde keine Veranstaltung ausgewählt!'));
     }
     if (!$GLOBALS['perm']->have_studip_perm('tutor', $course_id)) {
         throw new Trails_Exception(400);
     }
     // Get seminar instance
     $this->course = Seminar::getInstance($course_id);
     if (Navigation::hasItem('course/admin/dates')) {
         Navigation::activateItem('course/admin/dates');
     }
     $this->show = array('regular' => true, 'irregular' => true, 'roomRequest' => true);
     PageLayout::setHelpKeyword('Basis.Veranstaltungen');
     PageLayout::addSqueezePackage('raumzeit');
     $title = _('Verwaltung von Zeiten und Räumen');
     $title = $this->course->getFullname() . ' - ' . $title;
     PageLayout::setTitle($title);
     $_SESSION['raumzeitFilter'] = Request::get('newFilter');
     // bind linkParams for chosen semester and opened dates
     URLHelper::bindLinkParam('raumzeitFilter', $_SESSION['raumzeitFilter']);
     $this->checkFilter();
     $this->selection = $this->getSemestersForCourse($this->course, $_SESSION['raumzeitFilter']);
     if (!Request::isXhr()) {
         $this->setSidebar();
     } elseif (Request::isXhr() && $this->flash['update-times']) {
         $semester_id = $GLOBALS['user']->cfg->MY_COURSES_SELECTED_CYCLE;
         if ($semester_id === 'all') {
             $semester_id = '';
         }
         $this->response->add_header('X-Raumzeit-Update-Times', json_encode(studip_utf8encode(array('course_id' => $this->course->id, 'html' => Seminar::GetInstance($this->course->id)->getDatesHTML(array('semester_id' => $semester_id, 'show_room' => true)) ?: _('nicht angegeben')))));
     }
 }
コード例 #12
0
ファイル: show.php プロジェクト: anantace/SeminarTabs
 public function before_filter(&$action, &$args)
 {
     $this->set_layout($GLOBALS['template_factory']->open('layouts/base_without_infobox'));
     $this->course = Course::findCurrent();
     if (!$this->course) {
         throw new CheckObjectException(_('Sie haben kein Objekt gewählt.'));
     } else {
         if (Navigation::hasItem('/course/admin')) {
             Navigation::activateItem('/course/admin/seminar_tabs');
         } else {
             if (Navigation::hasItem('/admin/course/seminar_tabs')) {
                 Navigation::activateItem('/admin/course/seminar_tabs');
             }
         }
         $this->ignore_tabs = array('modules', 'mini_course');
         $this->ignore_visibility_tabs = array('admin', 'main');
         $this->course_id = $this->course->id;
         $this->sem = Seminar::getInstance($this->course_id);
         $sem_class = $GLOBALS['SEM_CLASS'][$GLOBALS['SEM_TYPE'][$this->sem->status]['class']];
         $sem_class || ($sem_class = SemClass::getDefaultSemClass());
         $this->studygroup_mode = $SEM_CLASS[$SEM_TYPE[$this->sem->status]["class"]]["studygroup_mode"];
     }
 }
コード例 #13
0
ファイル: CoreAdmin.class.php プロジェクト: ratbird/hope
 function getTabNavigation($course_id)
 {
     $sem_create_perm = in_array(get_config('SEM_CREATE_PERM'), array('root', 'admin', 'dozent')) ? get_config('SEM_CREATE_PERM') : 'dozent';
     if ($GLOBALS['perm']->have_studip_perm('tutor', $course_id)) {
         $navigation = new Navigation(_('Verwaltung'));
         $navigation->setImage(Icon::create('admin', 'info_alt'));
         $navigation->setActiveImage(Icon::create('admin', 'info'));
         $main = new Navigation(_('Verwaltung'), 'dispatch.php/course/management');
         $navigation->addSubNavigation('main', $main);
         if ($GLOBALS['SessSemName']['class'] !== "inst") {
             $item = new Navigation(_('Grunddaten'), 'dispatch.php/course/basicdata/view/' . $course_id);
             $item->setImage(Icon::create('edit', 'clickable'));
             $item->setDescription(_('Bearbeiten der Grundeinstellungen dieser Veranstaltung.'));
             $navigation->addSubNavigation('details', $item);
             $item = new Navigation(_('Infobild'), 'dispatch.php/course/avatar/update/' . $course_id);
             $item->setImage(Icon::create('file-pic', 'clickable'));
             $item->setDescription(_('Infobild dieser Veranstaltung bearbeiten oder löschen.'));
             $navigation->addSubNavigation('avatar', $item);
             $item = new Navigation(_('Studienbereiche'), 'dispatch.php/course/study_areas/show/' . $course_id);
             $item->setImage(Icon::create('module', 'clickable'));
             $item->setDescription(_('Zuordnung dieser Veranstaltung zu Studienbereichen für die Darstellung im Verzeichnis aller Veranstaltungen.'));
             $navigation->addSubNavigation('study_areas', $item);
             $item = new Navigation(_('Zeiten/Räume'), 'dispatch.php/course/timesrooms');
             $item->setImage(Icon::create('date', 'clickable'));
             $item->setDescription(_('Regelmäßige Veranstaltungszeiten, Einzeltermine und Ortsangaben ändern.'));
             $navigation->addSubNavigation('dates', $item);
             if (get_config('RESOURCES_ENABLE') && get_config('RESOURCES_ALLOW_ROOM_REQUESTS')) {
                 $item = new Navigation(_('Raumanfragen'), 'dispatch.php/course/room_requests/index/' . $course_id);
                 $item->setImage(Icon::create('resources', 'clickable'));
                 $item->setDescription(_('Raumanfragen zu Veranstaltungszeiten verwalten.'));
                 $navigation->addSubNavigation('room_requests', $item);
             }
             $item = new Navigation(_('Zugangsberechtigungen'), 'dispatch.php/course/admission');
             $item->setImage(Icon::create('lock-locked', 'clickable'));
             $item->setDescription(_('Zugangsbeschränkungen, Anmeldeverfahren oder einen Passwortschutz für diese Veranstaltung einrichten.'));
             $navigation->addSubNavigation('admission', $item);
             $item = new AutoNavigation(_('Zusatzangaben'), 'dispatch.php/admin/additional');
             $item->setImage(Icon::create('add', 'clickable'));
             $item->setDescription(_('Vorlagen zur Erhebung weiterer Angaben von Teilnehmenden auswählen.'));
             $navigation->addSubNavigation('additional_data', $item);
             if ($GLOBALS['perm']->have_perm($sem_create_perm)) {
                 if (!LockRules::check($course_id, 'seminar_copy')) {
                     $item = new Navigation(_('Veranstaltung kopieren'), 'dispatch.php/course/wizard/copy/' . $course_id);
                     $item->setImage(Icon::create('seminar+add', 'clickable'));
                     $main->addSubNavigation('copy', $item);
                 }
                 if (get_config('ALLOW_DOZENT_ARCHIV') || $GLOBALS['perm']->have_perm('admin')) {
                     $item = new Navigation(_('Veranstaltung archivieren'), 'archiv_assi.php');
                     $item->setImage(Icon::create('seminar+remove', 'clickable'));
                     $main->addSubNavigation('archive', $item);
                 }
                 if ((get_config('ALLOW_DOZENT_VISIBILITY') || $GLOBALS['perm']->have_perm('admin')) && !LockRules::Check($course_id, 'seminar_visibility')) {
                     $is_visible = Course::findCurrent()->visible;
                     $item = new Navigation(_('Sichtbarkeit ändern') . ' (' . ($is_visible ? _('sichtbar') : _('unsichtbar')) . ')', 'dispatch.php/course/management/change_visibility');
                     $item->setImage(Icon::create('visibility-' . ($is_visible ? 'visible' : 'invisible'), 'clickable'));
                     $main->addSubNavigation('visibility', $item);
                 }
                 if ($GLOBALS['perm']->have_perm('admin')) {
                     $is_locked = Course::findCurrent()->lock_rule;
                     $item = new Navigation(_('Sperrebene ändern') . ' (' . ($is_locked ? _('gesperrt') : _('nicht gesperrt')) . ')', 'dispatch.php/course/management/lock');
                     $item->setImage(Icon::create('lock-' . ($is_locked ? 'locked' : 'unlocked'), 'clickable'), ['data-dialog' => 'size=auto']);
                     $main->addSubNavigation('lock', $item);
                 }
             }
             // show entry for simulated participant view
             if (in_array($GLOBALS['perm']->get_studip_perm($course_id), words('tutor dozent'))) {
                 $item = new Navigation('Studierendenansicht simulieren', 'dispatch.php/course/change_view?cid=' . Request::option('cid'));
                 $item->setDescription(_('Hier können Sie sich die Veranstaltung aus der Sicht von Studierenden sehen.'));
                 $item->setImage(Icon::create('visibility-invisible', 'clickable'));
                 $main->addSubNavigation('change_view', $item);
             }
         }
         // endif modules only seminars
         if ($GLOBALS['perm']->have_studip_perm('tutor', $course_id)) {
             if (get_config('VOTE_ENABLE')) {
                 $item = new Navigation(_('Umfragen und Tests'), 'admin_vote.php?view=vote_sem');
                 $item->setImage(Icon::create('vote', 'clickable'));
                 $item->setDescription(_('Erstellen und bearbeiten von einfachen Umfragen und Tests.'));
                 $navigation->addSubNavigation('vote', $item);
                 $item = new Navigation(_('Evaluationen'), 'admin_evaluation.php?view=eval_sem');
                 $item->setImage(Icon::create('evaluation', 'clickable'));
                 $item->setDescription(_('Richten Sie fragebogenbasierte Umfragen und Lehrevaluationen ein.'));
                 $navigation->addSubNavigation('evaluation', $item);
             }
         }
         return array('admin' => $navigation);
     } else {
         return array();
     }
 }
コード例 #14
0
ファイル: studygroup.php プロジェクト: ratbird/hope
 /**
  * displays a paginated member overview of a studygroup
  *
  * @param string id of a studypgroup
  * @param string page number the current page
  *
  * @return void
  *
  */
 function members_action()
 {
     $id = $_SESSION['SessionSeminar'];
     PageLayout::setTitle(getHeaderLine($_SESSION['SessionSeminar']) . ' - ' . _("Teilnehmende"));
     Navigation::activateItem('/course/members');
     PageLayout::setHelpKeyword('Basis.StudiengruppenBenutzer');
     Request::set('choose_member_parameter', $this->flash['choose_member_parameter']);
     object_set_visit_module('participants');
     $this->last_visitdate = object_get_visit($id, 'participants');
     $sem = Course::find($id);
     $this->anzahl = StudygroupModel::countMembers($id);
     $this->groupname = $sem->getFullname();
     $this->sem_id = $id;
     $this->groupdescription = $sem->beschreibung;
     $this->moderators = $sem->getMembersWithStatus('dozent');
     $this->tutors = $sem->getMembersWithStatus('tutor');
     $this->autors = $sem->getMembersWithStatus('autor');
     $this->accepted = $sem->admission_applicants->findBy('status', 'accepted');
     $this->sem_class = Course::findCurrent()->getSemClass();
     $inviting_search = new SQLSearch("SELECT auth_user_md5.user_id, {$GLOBALS['_fullname_sql']['full_rev']} as fullname, username, perms " . "FROM auth_user_md5 " . "LEFT JOIN user_info ON (auth_user_md5.user_id = user_info.user_id) " . "LEFT JOIN seminar_user ON (auth_user_md5.user_id = seminar_user.user_id AND seminar_user.Seminar_id = '" . addslashes($id) . "') " . "WHERE perms  NOT IN ('root', 'admin') " . "AND " . get_vis_query() . " AND (username LIKE :input OR Vorname LIKE :input " . "OR CONCAT(Vorname,' ',Nachname) LIKE :input " . "OR CONCAT(Nachname,' ',Vorname) LIKE :input " . "OR Nachname LIKE :input OR {$GLOBALS['_fullname_sql']['full_rev']} LIKE :input) " . "ORDER BY fullname ASC", _("Nutzer suchen"), "user_id");
     $this->rechte = $GLOBALS['perm']->have_studip_perm("tutor", $id);
     $actions = new ActionsWidget();
     if ($this->rechte) {
         $mp = MultiPersonSearch::get('studygroup_invite_' . $id)->setLinkText(_('Neue Gruppenmitglieder-/innen einladen'))->setLinkIconPath("")->setTitle(_('Neue Gruppenmitglieder/-innen einladen'))->setExecuteURL($this->url_for('course/studygroup/execute_invite/' . $id, array('view' => Request::get('view'))))->setSearchObject($inviting_search)->addQuickfilter(_('Adressbuch'), User::findCurrent()->contacts->pluck('user_id'))->setNavigationItem('/course/members')->render();
         $element = LinkElement::fromHTML($mp, Icon::create('community+add', 'clickable'));
         $actions->addElement($element);
     }
     if ($this->rechte || $sem->getSemClass()['studygroup_mode']) {
         $actions->addLink(_('Nachricht an alle Gruppenmitglieder verschicken'), $this->url_for('course/studygroup/message/' . $id), Icon::create('mail', 'clickable'), array('data-dialog' => 1));
     }
     if ($actions->hasElements()) {
         Sidebar::get()->addWidget($actions);
     }
     $this->invitedMembers = StudygroupModel::getInvitations($id);
 }
コード例 #15
0
ファイル: header.php プロジェクト: ratbird/hope
    require_once 'lib/user_visible.inc.php';
    first_decision($GLOBALS['user']->id);
}
if (PageLayout::isHeaderEnabled()) {
    $header_template = $GLOBALS['template_factory']->open('header');
    $header_template->current_page = PageLayout::getTitle();
    $header_template->link_params = array_fill_keys(array_keys(URLHelper::getLinkParams()), NULL);
    if (is_object($GLOBALS['user']) && $GLOBALS['user']->id != 'nobody') {
        // only mark course if user is logged in and free access enabled
        if (get_config('ENABLE_FREE_ACCESS') && Navigation::hasItem('/course') && Navigation::getItem('/course')->isActive()) {
            // indicate to the template that this course is publicly visible
            // need to handle institutes separately (always visible)
            if ($GLOBALS['SessSemName']['class'] == 'inst') {
                $header_template->public_hint = _('öffentliche Einrichtung');
            } else {
                if (Course::findCurrent()->lesezugriff == 0) {
                    $header_template->public_hint = _('öffentliche Veranstaltung');
                }
            }
        }
        if ($GLOBALS['user']->cfg->getValue('ACCESSKEY_ENABLE')) {
            $header_template->accesskey_enabled = true;
        }
        // fetch semester for quick search box in the link bar
        $semester_data = SemesterData::GetSemesterArray();
        $default_semester = $_SESSION['_default_sem'] ? SemesterData::GetSemesterIndexById($_SESSION['_default_sem']) : 'all';
        $header_template->search_semester_nr = $default_semester;
        $header_template->search_semester_name = $default_semester != 'all' ? $semester_data[$default_semester]['name'] : _("alle Semester");
    }
} else {
    $header_template = $GLOBALS['template_factory']->open('noheader');
コード例 #16
0
ファイル: index.php プロジェクト: ratbird/hope
<?php

# Lifter010: TODO
/* * * * * * * * * * * * *
 * * * I N F O B O X * * *
 * * * * * * * * * * * * */
$sidebar = Sidebar::get();
$sidebar->setImage('sidebar/admin-sidebar.png');
if (Course::findCurrent()) {
    $links = new ActionsWidget();
    foreach (Navigation::getItem('/course/admin/main') as $nav) {
        if ($nav->isVisible(true)) {
            $links->addLink($nav->getTitle(), URLHelper::getLink($nav->getURL(), array('studip_ticket' => Seminar_Session::get_ticket())), $nav->getImage(), $nav->getLinkAttributes());
        }
    }
    $sidebar->addWidget($links);
    // Entry list for admin upwards.
    if ($GLOBALS['perm']->have_studip_perm("admin", $GLOBALS['SessionSeminar'])) {
        $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->addWidget($list);
    }
}
?>

<ul class="boxed-grid">
コード例 #17
0
ファイル: SCMPlugin.php プロジェクト: anantace/SCMTabs
 public function __construct()
 {
     parent::__construct();
     $this->course = Course::findCurrent();
     $this->course_id = $this->course->id;
 }
コード例 #18
0
ファイル: details.php プロジェクト: ratbird/hope
echo _("Art des Termins");
?>
</strong></td>
            <td><?php 
echo htmlReady($GLOBALS['TERMIN_TYP'][$date['date_typ']]['name']);
?>
</td>
        </tr>
        <tr>
            <td><strong><?php 
echo _("Durchführende Dozenten");
?>
</strong></td>
            <td>
                <? $dozenten = $date->dozenten ?>
                <? count($dozenten) > 0 || $dozenten = array_map(function ($m) { return $m->user; }, (Course::findCurrent()->getMembersWithStatus("dozent"))) ?>
                <ul class="dozenten_list clean">
                <? foreach ($dozenten as $dozent) : ?>
                    <li>
                        <a href="<?php 
echo URLHelper::getLink("dispatch.php/profile", array('username' => $dozent['username']));
?>
"><?php 
echo Avatar::getAvatar($dozent['user_id'])->getImageTag(Avatar::SMALL) . " " . htmlReady($dozent->getFullName());
?>
</a>
                    </li>
                <? endforeach ?>
                </ul>
            </td>
        </tr>
コード例 #19
0
ファイル: Sidebar.php プロジェクト: ratbird/hope
 /**
  * Renders the sidebar.
  * The sidebar will only be rendered if it actually contains any widgets.
  * It will use the template "sidebar.php" located at "templates/sidebar".
  * A notification is dispatched before and after the actual rendering
  * process.
  *
  * @return String The HTML code of the rendered sidebar.
  */
 public function render()
 {
     $content = '';
     if ($this->context_avatar === null) {
         $breadcrumbs = $this->getBreadCrumbs();
         $keys = array_keys($breadcrumbs);
         if (reset($keys) === 'course') {
             $course = Course::findCurrent();
             if ($course) {
                 if ($course->getSemClass()->offsetGet('studygroup_mode')) {
                     $avatar = StudygroupAvatar::getAvatar($course->id);
                 } else {
                     $avatar = CourseAvatar::getAvatar($course->id);
                 }
             } else {
                 $institute = Institute::findCurrent();
                 $avatar = InstituteAvatar::getAvatar($institute->id);
             }
             $this->setContextAvatar($avatar);
         }
     }
     NotificationCenter::postNotification('SidebarWillRender', $this);
     if ($this->hasWidgets()) {
         $template = $GLOBALS['template_factory']->open('sidebar/sidebar');
         $template->widgets = $this->widgets;
         $template->image = $this->getImage();
         $template->title = $this->getTitle();
         $template->avatar = $this->context_avatar;
         $content = $template->render();
     }
     NotificationCenter::postNotification('SidebarDidRender', $this);
     return $content;
 }
コード例 #20
0
ファイル: functions.php プロジェクト: ratbird/hope
/**
 * This function "selects" a Veranstaltung to work with it
 *
 * The following variables will bet set:
 *   $SessionSeminar                 Veranstaltung id<br>
 *   $SessSemName[0]                 Veranstaltung name<br>
 *   $SessSemName[1]                 Veranstaltung id<br>
 *   $SessSemName[2]                 Veranstaltung ort (room)<br>
 *   $SessSemName[3]                 Veranstaltung Untertitel (subtitle)<br>
 *   $SessSemName[4]                 Veranstaltung start_time (the Semester start_time)<br>
 *   $SessSemName[5]                 Veranstaltung institut_id (the home-intitute)<br>
 *   $SessSemName["art"]             Veranstaltung type in alphanumeric form<br>
 *   $SessSemName["art_num"]         Veranstaltung type in numeric form<br>
 *   $SessSemName["art_generic"]     Veranstaltung generic type in alhanumeric form (self description)<br>
 *   $SessSemName["class"]               Veranstaltung class (sem or inst, in this function always sem)<br>
 *   $SessSemName["header_line"]     the header-line to use on every page of the Veranstaltung<br>
 *
 * @param string $sem_id the id of the Veranstaltung
 *
 * @return boolean  true if successful
 *
 */
function selectSem($sem_id)
{
    global $perm, $SEM_TYPE, $SEM_TYPE_MISC_NAME, $SessionSeminar, $SessSemName, $SemUserStatus, $rechte, $auth;
    closeObject();
    $SessionSeminar = $sem_id;
    $course = Course::findCurrent();
    if ($course) {
        $rechte = $perm->have_studip_perm("tutor", $course["Seminar_id"]);
        if (!($SemUserStatus = $perm->get_studip_perm($course["Seminar_id"]))) {
            $SemUserStatus = "nobody";
            if ($course['lesezugriff'] > 0 || !get_config('ENABLE_FREE_ACCESS')) {
                // redirect to login page if user is not logged in
                $auth->login_if($auth->auth["uid"] == "nobody");
                throw new AccessDeniedException();
            }
        }
        $SessionSeminar = $course["Seminar_id"];
        $SessSemName[0] = $course["Name"];
        $SessSemName[1] = $course["Seminar_id"];
        $SessSemName[3] = $course["Untertitel"];
        $SessSemName[4] = $course["start_time"];
        $SessSemName[5] = $course["Institut_id"];
        $SessSemName["art_generic"] = _("Veranstaltung");
        $SessSemName["class"] = "sem";
        $SessSemName["art_num"] = $course["status"];
        if ($SEM_TYPE[$row["status"]]["name"] == $SEM_TYPE_MISC_NAME) {
            $SessSemName["art"] = _("Veranstaltung");
        } else {
            $SessSemName["art"] = $SEM_TYPE[$row["status"]]["name"];
        }
        $SessSemName["header_line"] = $course->getFullname();
        $_SESSION['SessionSeminar'] =& $SessionSeminar;
        $_SESSION['SessSemName'] =& $SessSemName;
        URLHelper::addLinkParam('cid', $SessionSeminar);
        // if the aux data is forced for this seminar forward all user that havent made an input to this site
        if ($course["aux_lock_rule_forced"] && !$perm->have_studip_perm('tutor', $course["Seminar_id"]) && !in_array($_SERVER['PATH_INFO'], array('/course/members/additional_input', '/course/change_view'))) {
            $statement = DBManager::get()->prepare("SELECT 1 FROM datafields_entries WHERE range_id = ? AND sec_range_id = ? LIMIT 1");
            $statement->execute(array($GLOBALS['user']->id, $course["Seminar_id"]));
            if (!$statement->rowCount()) {
                header('location: ' . URLHelper::getURL('dispatch.php/course/members/additional_input'));
                page_close();
                die;
            }
        }
        return true;
    } else {
        $SessionSeminar = null;
        return false;
    }
}
コード例 #21
0
ファイル: management.php プロジェクト: ratbird/hope
 /**
  * set the lock rule
  *
  * @return void
  */
 public function set_lock_rule_action()
 {
     CSRFProtection::verifyUnsafeRequest();
     if (!$GLOBALS['perm']->have_studip_perm('admin', $GLOBALS['SessionSeminar'])) {
         throw new AccessDeniedException();
     }
     $course = Course::findCurrent();
     if ($course) {
         $rule_id = Request::get('lock_sem') != 'none' ? Request::get('lock_sem') : null;
         $course->lock_rule = $rule_id;
         if ($course->store()) {
             if (!is_null($rule_id)) {
                 $lock_rule = LockRule::find($rule_id);
                 $msg = sprintf(_('Die Sperrebene %s wurde erfolgreich übernommen!'), $lock_rule->name);
             } else {
                 $msg = _('Die Sperrebene wurde erfolgreich zurückgesetzt!');
             }
             PageLayout::postMessage(MessageBox::success($msg));
         }
     }
     $this->relocate($this->url_for('/index'));
 }