function show_action() { $this->url_params = array(); if (Request::get('from')) { $this->url_params['from'] = Request::get('from'); } if (Request::get('open_node')) { $this->url_params['open_node'] = Request::get('open_node'); } if (!Request::isXhr()) { Navigation::activateItem('course/admin/study_areas'); $sidebar = Sidebar::get(); $sidebar->setImage('sidebar/admin-sidebar.png'); if ($this->course) { $links = new ActionsWidget(); foreach (Navigation::getItem('/course/admin/main') as $nav) { if ($nav->isVisible(true)) { $image = $nav->getImage(); $links->addLink($nav->getTitle(), URLHelper::getLink($nav->getURL(), array('studip_ticket' => Seminar_Session::get_ticket())), $image); } } $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); } } } if (Request::get('open_node')) { $this->values['StudyAreasWizardStep']['open_node'] = Request::get('open_node'); } $this->tree = $this->step->getStepTemplate($this->values, 0, 0); }
public function decline_inst_action($inst_id) { $institut = Institute::find($inst_id); $ticket_check = Seminar_Session::check_ticket(Request::option('studipticket')); if (Request::option('cmd') != 'kill' && Request::get('cmd') != 'back') { $this->flash['decline_inst'] = true; $this->flash['inst_id'] = $inst_id; $this->flash['name'] = $institut->name; $this->flash['studipticket'] = Seminar_Session::get_ticket(); } else { if (Request::get('cmd') == 'kill' && $ticket_check && Request::get('cmd') != 'back') { $query = "DELETE FROM user_inst WHERE user_id = ? AND Institut_id = ? AND inst_perms = 'user'"; $statement = DBManager::get()->prepare($query); $statement->execute(array($GLOBALS['user']->id, $inst_id)); if ($statement->rowCount() > 0) { PageLayout::postMessage(MessageBox::success(sprintf(_("Die Zuordnung zur Einrichtung %s wurde aufgehoben."), "<b>" . htmlReady($institut->name) . "</b>"))); } else { PageLayout::postMessage(MessageBox::error(_('Datenbankfehler'))); } } } $this->redirect('my_institutes/index'); }
/** * This action remove a user from course * @param $course_id */ public function decline_action($course_id, $waiting = null) { $current_seminar = Seminar::getInstance($course_id); $ticket_check = Seminar_Session::check_ticket(Request::option('studipticket')); if (LockRules::Check($course_id, 'participants')) { $lockdata = LockRules::getObjectRule($course_id); PageLayout::postMessage(MessageBox::error(sprintf(_("Sie können sich nicht von der Veranstaltung <b>%s</b> abmelden."), htmlReady($current_seminar->name)))); if ($lockdata['description']) { PageLayout::postMessage(MessageBox::info(formatLinks($lockdata['description']))); } $this->redirect('my_courses/index'); return; } if (Request::option('cmd') == 'back') { $this->redirect('my_courses/index'); return; } if (Request::option('cmd') != 'kill' && Request::option('cmd') != 'kill_admission') { if ($current_seminar->admission_binding && Request::get('cmd') != 'suppose_to_kill_admission' && !LockRules::Check($current_seminar->getId(), 'participants')) { PageLayout::postMessage(MessageBox::error(sprintf(_("Die Veranstaltung <b>%s</b> ist als <b>bindend</b> angelegt.\n Wenn Sie sich abmelden wollen, müssen Sie sich an die Lehrende der Veranstaltung wenden."), htmlReady($current_seminar->name)))); $this->redirect('my_courses/index'); return; } if (Request::get('cmd') == 'suppose_to_kill') { // check course admission list(, $admission_end_time) = @array_values($current_seminar->getAdmissionTimeFrame()); $admission_enabled = $current_seminar->isAdmissionEnabled(); $admission_locked = $current_seminar->isAdmissionLocked(); if ($admission_enabled || $admission_locked || (int) $current_seminar->admission_prelim == 1) { $message = sprintf(_('Wollen Sie sich von der teilnahmebeschränkten Veranstaltung "%s" wirklich abmelden? Sie verlieren damit die Berechtigung für die Veranstaltung und müssen sich ggf. neu anmelden!'), $current_seminar->name); } else { if (isset($admission_end_time) && $admission_end_time < time()) { $message = sprintf(_('Wollen Sie sich von der teilnahmebeschränkten Veranstaltung "%s" wirklich abmelden? Der Anmeldzeitraum ist abgelaufen und Sie können sich nicht wieder anmelden!'), $current_seminar->name); } else { $message = sprintf(_('Wollen Sie sich von der Veranstaltung "%s" wirklich abmelden?'), $current_seminar->name); } } $this->flash['cmd'] = 'kill'; } else { if (admission_seminar_user_get_position($GLOBALS['user']->id, $course_id) === false) { $message = sprintf(_('Wollen Sie sich von der Anmeldeliste der Veranstaltung "%s" wirklich abmelden?'), $current_seminar->name); } else { $message = sprintf(_('Wollen Sie sich von der Warteliste der Veranstaltung "%s" wirklich abmelden? Sie verlieren damit die bereits erreichte Position und müssen sich ggf. neu anmelden!'), $current_seminar->name); } $this->flash['cmd'] = 'kill_admission'; } $this->flash['decline_course'] = true; $this->flash['course_id'] = $course_id; $this->flash['message'] = $message; $this->flash['studipticket'] = Seminar_Session::get_ticket(); $this->redirect('my_courses/index'); return; } else { if (!LockRules::Check($course_id, 'participants') && $ticket_check && Request::option('cmd') != 'back' && Request::get('cmd') != 'kill_admission') { $query = "DELETE FROM seminar_user WHERE user_id = ? AND Seminar_id = ?"; $statement = DBManager::get()->prepare($query); $statement->execute(array($GLOBALS['user']->id, $course_id)); if ($statement->rowCount() == 0) { PageLayout::postMessage(MessageBox::error(_('In der ausgewählten Veranstaltung wurde die gesuchten Personen nicht gefunden und konnte daher nicht ausgetragen werden.'))); } else { // LOGGING StudipLog::log('SEM_USER_DEL', $course_id, $GLOBALS['user']->id, 'Hat sich selbst ausgetragen'); // enable others to do something after the user has been deleted NotificationCenter::postNotification('UserDidLeaveCourse', $course_id, $GLOBALS['user']->id); // Delete from statusgroups RemovePersonStatusgruppeComplete(get_username(), $course_id); // Are successor available update_admission($course_id); PageLayout::postMessage(MessageBox::success(sprintf(_("Erfolgreich von Veranstaltung <b>%s</b> abgemeldet."), htmlReady($current_seminar->name)))); } } else { // LOGGING StudipLog::log('SEM_USER_DEL', $course_id, $GLOBALS['user']->id, 'Hat sich selbst aus der Warteliste ausgetragen'); if ($current_seminar->isAdmissionEnabled()) { $prio_delete = AdmissionPriority::unsetPriority($current_seminar->getCourseSet()->getId(), $GLOBALS['user']->id, $course_id); } $query = "DELETE FROM admission_seminar_user WHERE user_id = ? AND seminar_id = ?"; $statement = DBManager::get()->prepare($query); $statement->execute(array($GLOBALS['user']->id, $course_id)); if ($statement->rowCount() || $prio_delete) { //Warteliste neu sortieren renumber_admission($course_id); //Pruefen, ob es Nachruecker gibt update_admission($course_id); PageLayout::postMessage(MessageBox::success(sprintf(_("Der Eintrag in der Anmelde- bzw. Warteliste der Veranstaltung <b>%s</b> wurde aufgehoben.\n Wenn Sie an der Veranstaltung teilnehmen wollen, müssen Sie sich erneut bewerben."), htmlReady($current_seminar->name)))); } } $this->redirect('my_courses/index'); return; } }
<?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">
/** * return a studip-ticket * * @return string a unique id referring to a newly created ticket */ function get_ticket() { return Seminar_Session::get_ticket(); }
public function index_action() { global $perm, $PATH_EXPORT; $sem = Seminar::getInstance($this->course_id); // old message style if ($_SESSION['sms_msg']) { $this->msg = $_SESSION['sms_msg']; unset($_SESSION['sms_msg']); } $this->sort_by = Request::option('sortby', 'nachname'); $this->order = Request::option('order', 'desc'); $this->sort_status = Request::get('sort_status'); Navigation::activateItem('/course/members/view'); if (Request::int('toggle')) { $this->order = $this->order == 'desc' ? 'asc' : 'desc'; } $filtered_members = $this->members->getMembers($this->sort_status, $this->sort_by . ' ' . $this->order, !$this->is_tutor ? $this->user_id : null); if ($this->is_tutor) { $filtered_members = array_merge($filtered_members, $this->members->getAdmissionMembers($this->sort_status, $this->sort_by . ' ' . $this->order)); $this->awaiting = $filtered_members['awaiting']->toArray('user_id username vorname nachname visible mkdate'); $this->accepted = $filtered_members['accepted']->toArray('user_id username vorname nachname visible mkdate'); $this->claiming = $filtered_members['claiming']->toArray('user_id username vorname nachname visible mkdate'); } // Check autor-perms if (!$this->is_tutor) { SkipLinks::addIndex(_("Sichtbarkeit ändern"), 'change_visibility'); // filter invisible user $this->invisibles = count($filtered_members['autor']->findBy('visible', 'no')) + count($filtered_members['user']->findBy('visible', 'no')); $current_user_id = $this->user_id; $exclude_invisibles = function ($user) use($current_user_id) { return $user['visible'] != 'no' || $user['user_id'] == $current_user_id; }; $filtered_members['autor'] = $filtered_members['autor']->filter($exclude_invisibles); $filtered_members['user'] = $filtered_members['user']->filter($exclude_invisibles); $this->my_visibility = $this->getUserVisibility(); if (!$this->my_visibility['iam_visible']) { $this->invisibles--; } } // get member informations $this->dozenten = $filtered_members['dozent']->toArray('user_id username vorname nachname'); $this->tutoren = $filtered_members['tutor']->toArray('user_id username vorname nachname mkdate'); $this->autoren = $filtered_members['autor']->toArray('user_id username vorname nachname visible mkdate'); $this->users = $filtered_members['user']->toArray('user_id username vorname nachname visible mkdate'); $this->studipticket = Seminar_Session::get_ticket(); $this->subject = $this->getSubject(); $this->groups = $this->status_groups; // Check Seminar if ($this->is_tutor && $sem->isAdmissionEnabled()) { $this->course = $sem; $distribution_time = $sem->getCourseSet()->getSeatDistributionTime(); if ($sem->getCourseSet()->hasAlgorithmRun()) { $this->waitingTitle = _("Warteliste"); if (!$sem->admission_disable_waitlist_move) { $this->waitingTitle .= ' (' . _("automatisches Nachrücken ist eingeschaltet") . ')'; } else { $this->waitingTitle .= ' (' . _("automatisches Nachrücken ist ausgeschaltet") . ')'; } $this->semAdmissionEnabled = 2; $this->waiting_type = 'awaiting'; } else { $this->waitingTitle = sprintf(_("Anmeldeliste (Losverfahren am %s)"), strftime('%x %R', $distribution_time)); $this->semAdmissionEnabled = 1; $this->awaiting = $this->claiming; $this->waiting_type = 'claiming'; } } // Set the infobox $this->createSidebar($filtered_members, $course); if ($this->is_locked && $this->is_tutor) { $lockdata = LockRules::getObjectRule($this->course_id); if ($lockdata['description']) { PageLayout::postMessage(MessageBox::info(formatLinks($lockdata['description']))); } } // Check for waitlist availability (influences available actions) // People can be moved to waitlist if waitlist available and no automatic moving up. if (!$sem->admission_disable_waitlist && $sem->admission_disable_waitlist_move) { $this->to_waitlist_actions = true; } }
</h1> <?endif;?> <p style="padding-bottom:25px;"><?php echo _("Bitte identifizieren Sie sich mit Benutzername und Passwort:"); ?> </p> <form style="padding-bottom:25px;" name="login" method="post" action="<?php echo URLHelper::getLink(Request::url(), array('cancel_login' => NULL)); ?> "> <?php echo CSRFProtection::tokenTag(); ?> <input type="hidden" name="login_ticket" value="<?php echo Seminar_Session::get_ticket(); ?> "> <input type="hidden" name="resolution" value=""> <input type="hidden" name="device_pixel_ratio" value="1"> <table border="0" cellspacing="0" cellpadding="4"> <tbody> <tr valign="top" align="left"> <td> <label for="loginname"><?php echo _('Benutzername:'); ?> </label> </td> <td> <input type="text" <?php