コード例 #1
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');
 }
コード例 #2
0
ファイル: dates.php プロジェクト: ratbird/hope
 public function details_action($termin_id)
 {
     Navigation::activateItem('/course/schedule/dates');
     $this->date = new CourseDate($termin_id);
     $this->cancelled_dates_locked = LockRules::Check($this->date->range_id, 'cancelled_dates');
     $this->dates_locked = LockRules::Check($this->date->range_id, 'room_time');
     if (Request::isXhr()) {
         $this->set_layout(null);
         $this->set_content_type('text/html;Charset=windows-1252');
         $this->response->add_header('X-Title', $this->date->getTypeName() . ": " . $this->date->getFullname());
     }
 }
コード例 #3
0
ファイル: management.php プロジェクト: ratbird/hope
 /**
  * change the visibility of a course
  *
  * @return void
  */
 function change_visibility_action()
 {
     if ((Config::get()->ALLOW_DOZENT_VISIBILITY || $GLOBALS['perm']->have_perm('admin')) && !LockRules::Check($GLOBALS['SessionSeminar'], 'seminar_visibility') && Seminar_Session::check_ticket(Request::option('studip_ticket'))) {
         $course = Course::findCurrent();
         if (!$course->visible) {
             StudipLog::log('SEM_VISIBLE', $course->id);
             $course->visible = 1;
             $msg = _("Die Veranstaltung wurde sichtbar gemacht.");
         } else {
             StudipLog::log('SEM_INVISIBLE', $course->id);
             $course->visible = 0;
             $msg = _("Die Veranstaltung wurde versteckt.");
         }
         if ($course->store()) {
             PageLayout::postMessage(MessageBox::success($msg));
         }
     }
     $this->redirect($this->url_for('/index'));
 }
コード例 #4
0
ファイル: index.php プロジェクト: ratbird/hope
            <input type="text" size="80" <?php 
echo LockRules::Check($institute->id, 'email') ? 'readonly disabled' : '';
?>
 id="email" name="email"
                   value="<?php 
echo htmlReady(Request::get('email', $institute->email));
?>
">
        </label>

        <label>
            <?php 
echo _('Homepage');
?>
            <input type="text" size="80" <?php 
echo LockRules::Check($institute->id, 'url') ? 'readonly disabled' : '';
?>
 id="home" name="home"
                   value="<?php 
echo htmlReady(Request::get('home', $institute->url));
?>
">
        </label>

    <? if (get_config('LITERATURE_ENABLE') && $institute->is_fak): // choose preferred lit plugin ?>
        <label>
            <?php 
echo _('Bevorzugter Bibliothekskatalog');
?>
            <select id="lit_plugin_name" name="lit_plugin_name">
            <? foreach (StudipLitSearch::GetAvailablePlugins() as $name => $title): ?>
コード例 #5
0
ファイル: my_courses.php プロジェクト: ratbird/hope
 /**
  * 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;
     }
 }
コード例 #6
0
ファイル: archiv_assi.php プロジェクト: ratbird/hope
        if ((sizeof($_SESSION['archiv_assi_data']["sem_check"]) > 1) && ($_SESSION['archiv_assi_data']["sem_check"][$_SESSION['archiv_assi_data']["sems"][$_SESSION['archiv_assi_data']["pos"] + $i]["id"]]))
            $_SESSION['archiv_assi_data']["pos"] = $_SESSION['archiv_assi_data']["pos"] + $i;
    }

// dec if we have lectures left in the lower
if (Request::option('dec'))
    if ($_SESSION['archiv_assi_data']["pos"] > 0) {
        $d = -1;
        while ((!$_SESSION['archiv_assi_data']["sem_check"][$_SESSION['archiv_assi_data']["sems"][$_SESSION['archiv_assi_data']["pos"] + $d]["id"]]) && ($_SESSION['archiv_assi_data']["pos"] + $d > 0))
            $d--;
        if ((sizeof($_SESSION['archiv_assi_data']["sem_check"]) > 1) && ($_SESSION['archiv_assi_data']["sem_check"][$_SESSION['archiv_assi_data']["sems"][$_SESSION['archiv_assi_data']["pos"] + $d]["id"]]))
            $_SESSION['archiv_assi_data']["pos"] = $_SESSION['archiv_assi_data']["pos"] + $d;
    }


if (LockRules::Check($_SESSION['archiv_assi_data']["sems"][$_SESSION['archiv_assi_data']["pos"]]["id"], 'seminar_archive')) {
    $lockdata = LockRules::getObjectRule($_SESSION['archiv_assi_data']["sems"][$_SESSION['archiv_assi_data']["pos"]]["id"]);
    if ($lockdata['description']) {
        $details = formatLinks($lockdata['description']);
    } else {
        $details = _("Die Veranstaltung kann nicht archiviert werden.");
    }
    throw new AccessDeniedException($details);
}

// Delete (and archive) the lecture
if (Request::option('archive_kill')) {
    $run = TRUE;
    $s_id = $_SESSION['archiv_assi_data']["sems"][$_SESSION['archiv_assi_data']["pos"]]["id"];
    // # Do we have permission to do so?
コード例 #7
0
ファイル: topics.php プロジェクト: ratbird/hope
 public function index_action()
 {
     if (Request::isPost() && Request::get("edit") && $GLOBALS['perm']->have_studip_perm("tutor", $_SESSION['SessionSeminar'])) {
         $topic = new CourseTopic(Request::option("issue_id"));
         if ($topic['seminar_id'] && $topic['seminar_id'] !== $_SESSION['SessionSeminar']) {
             throw new AccessDeniedException();
         }
         if (Request::submitted("delete_topic")) {
             $topic->delete();
             PageLayout::postMessage(MessageBox::success(_("Thema gelöscht.")));
         } else {
             $topic['title'] = Request::get("title");
             $topic['description'] = Studip\Markup::purifyHtml(Request::get("description"));
             if ($topic->isNew()) {
                 $topic['seminar_id'] = $_SESSION['SessionSeminar'];
             }
             $topic->store();
             //change dates for this topic
             $former_date_ids = $topic->dates->pluck("termin_id");
             $new_date_ids = array_keys(Request::getArray("date"));
             foreach (array_diff($former_date_ids, $new_date_ids) as $delete_termin_id) {
                 $topic->dates->unsetByPk($delete_termin_id);
             }
             foreach (array_diff($new_date_ids, $former_date_ids) as $add_termin_id) {
                 $date = CourseDate::find($add_termin_id);
                 if ($date) {
                     $topic->dates[] = $date;
                 }
             }
             $topic->store();
             if (Request::get("folder") && !$topic->folder) {
                 $topic->connectWithDocumentFolder();
             }
             // create a connection to the module forum (can be anything)
             // will update title and description automagically
             if (Request::get("forumthread")) {
                 $topic->connectWithForumThread();
             }
             if (Request::option("issue_id") === "new") {
                 Request::set("open", $topic->getId());
             }
             PageLayout::postMessage(MessageBox::success(_("Thema gespeichert.")));
             $this->redirect("course/topics/index");
         }
     }
     if (Request::isPost() && Request::option("move_down")) {
         $topics = CourseTopic::findBySeminar_id($_SESSION['SessionSeminar']);
         $mainkey = null;
         foreach ($topics as $key => $topic) {
             if ($topic->getId() === Request::option("move_down")) {
                 $mainkey = $key;
             }
             $topic['priority'] = $key + 1;
         }
         if ($mainkey !== null && $mainkey < count($topics)) {
             $topics[$mainkey]->priority++;
             $topics[$mainkey + 1]->priority--;
         }
         foreach ($topics as $key => $topic) {
             $topic->store();
         }
     }
     if (Request::isPost() && Request::option("move_up")) {
         $topics = CourseTopic::findBySeminar_id($_SESSION['SessionSeminar']);
         foreach ($topics as $key => $topic) {
             if ($topic->getId() === Request::option("move_up") && $key > 0) {
                 $topic['priority'] = $key;
                 $topics[$key - 1]->priority = $key + 1;
                 $topics[$key - 1]->store();
             } else {
                 $topic['priority'] = $key + 1;
             }
             $topic->store();
         }
     }
     Navigation::activateItem('/course/schedule/topics');
     $this->topics = CourseTopic::findBySeminar_id($_SESSION['SessionSeminar']);
     $this->cancelled_dates_locked = LockRules::Check($_SESSION['SessionSeminar'], 'cancelled_dates');
 }
コード例 #8
0
ファイル: basicdata.php プロジェクト: ratbird/hope
 /**
  * Ändert alle Grunddaten der Veranstaltung (bis auf Personal) und leitet
  * danach weiter auf View.
  */
 public function set_action($course_id)
 {
     global $perm;
     $sem = Seminar::getInstance($course_id);
     $this->msg = array();
     $old_settings = $sem->getSettings();
     //Seminar-Daten:
     if ($perm->have_studip_perm("tutor", $sem->getId())) {
         $changemade = false;
         foreach (Request::getInstance() as $req_name => $req_value) {
             if (substr($req_name, 0, 7) === "course_") {
                 $varname = substr($req_name, 7);
                 if ($varname === "name" && !$req_value) {
                     $this->msg[] = array("error", _("Name der Veranstaltung darf nicht leer sein."));
                 } elseif ($sem->{$varname} != $req_value) {
                     $sem->{$varname} = $req_value;
                     $changemade = true;
                 }
             }
         }
         //seminar_inst:
         if (!LockRules::Check($course_id, 'seminar_inst') && $sem->setInstitutes(Request::optionArray('related_institutes'))) {
             $changemade = true;
         }
         //Datenfelder:
         $invalid_datafields = array();
         $all_fields_types = DataFieldEntry::getDataFieldEntries($sem->id, 'sem', $sem->status);
         foreach (Request::getArray('datafields') as $datafield_id => $datafield_value) {
             $datafield = $all_fields_types[$datafield_id];
             $valueBefore = $datafield->getValue();
             $datafield->setValueFromSubmit($datafield_value);
             if ($valueBefore != $datafield->getValue()) {
                 if ($datafield->isValid()) {
                     $datafield->store();
                     $changemade = true;
                 } else {
                     $invalid_datafields[] = $datafield->getName();
                 }
             }
         }
         if (count($invalid_datafields)) {
             $message = ngettext('%s der Veranstaltung wurde falsch angegeben', '%s der Veranstaltung wurden falsch angegeben', count($invalid_datafields));
             $message .= ', ' . _('bitte korrigieren Sie dies unter "Beschreibungen"') . '.';
             $message = sprintf($message, join(', ', array_map('htmlReady', $invalid_datafields)));
             $this->msg[] = array('error', $message);
         }
         $sem->store();
         // Logging
         $before = array_diff_assoc($old_settings, $sem->getSettings());
         $after = array_diff_assoc($sem->getSettings(), $old_settings);
         //update admission, if turnout was raised
         if ($after['admission_turnout'] > $before['admission_turnout'] && $sem->isAdmissionEnabled()) {
             update_admission($sem->getId());
         }
         if (sizeof($before) && sizeof($after)) {
             foreach ($before as $k => $v) {
                 $log_message .= "{$k}: {$v} => " . $after[$k] . " \n";
             }
             log_event('CHANGE_BASIC_DATA', $sem->getId(), " ", $log_message);
         }
         // end of logging
         if ($changemade) {
             $this->msg[] = array("msg", _("Die Grunddaten der Veranstaltung wurden verändert."));
         }
     } else {
         $this->msg[] = array("error", _("Sie haben keine Berechtigung diese Veranstaltung zu verändern."));
     }
     //Labels/Funktionen für Dozenten und Tutoren
     if ($perm->have_studip_perm("dozent", $sem->getId())) {
         foreach (Request::getArray("label") as $user_id => $label) {
             $sem->setLabel($user_id, $label);
         }
     }
     foreach ($sem->getStackedMessages() as $key => $messages) {
         foreach ($messages['details'] as $message) {
             $this->msg[] = array($key !== "success" ? $key : "msg", $message);
         }
     }
     $this->flash['msg'] = $this->msg;
     $this->flash['open'] = Request::get("open");
     $this->redirect($this->url_for('course/basicdata/view/' . $sem->getId()));
 }
コード例 #9
0
ファイル: index.php プロジェクト: ratbird/hope
        <?php 
echo $table_content;
?>
    </table>
<?
}
$sidebar = Sidebar::get();
$sidebar->setImage('sidebar/person-sidebar.png');
$widget = new ViewsWidget();
$widget->addLink(_('Standard'), URLHelper::getURL('?extend=no'))->setActive($extend != 'yes');
$widget->addLink(_('Erweitert'), URLHelper::getURL('?extend=yes'))->setActive($extend == 'yes');
$sidebar->addWidget($widget);

if ($admin_view) {

    if (!LockRules::Check($inst_id, 'participants')) {

        $edit = new SidebarWidget();
        $edit->setTitle(_('Personenverwaltung'));
        $edit->addElement(new WidgetElement($mp));
        $sidebar->addWidget($edit);
    }


    if (!empty($mail_list)) {
        $actions = new ActionsWidget();
        $actions->addLink(_('Stud.IP Rundmail'), $controller->url_for('messages/write', array('inst_id' => $inst_id, 'emailrequest' => 1)), Icon::create('mail', 'clickable'), array('data-dialog' => 'size=50%'));
        $sidebar->addWidget($actions);
    }
}
コード例 #10
0
ファイル: edit.php プロジェクト: ratbird/hope
echo $entry->getID();
?>
">
                    <?php 
echo htmlReady($entry->getName());
?>
:
                </label>
            <? if (!$entry->isVisible($user['perms'])): ?>
                <?php 
echo tooltipIcon(_('Systemfeld (für die Person selbst nicht sichtbar)'), true);
?>
            <? endif; ?>
            </td>
            <td colspan="2">
            <? if ($entry->isEditable() && !LockRules::Check($user['user_id'], $entry->getId())) : ?>
                <?php 
echo $entry->getHTML("datafields");
?>
            <? else : ?>
                <?php 
echo $entry->getDisplayValue();
?>
            <? endif ?>
        </td>
    </tr>
    <? endif ?>
<? endforeach ?>
</tbody>
<? endif ?>
<tbody>
コード例 #11
0
ファイル: basicdata.php プロジェクト: ratbird/hope
 /**
  * show institute basicdata page
  *
  * @param mixed $i_id Optional institute id 
  * @throws AccessDeniedException
  */
 public function index_action($i_id = false)
 {
     PageLayout::setTitle(_('Verwaltung der Grunddaten'));
     Navigation::activateItem('/admin/institute/details');
     //get ID from an open Institut
     $i_view = $i_id ?: Request::option('i_view', $GLOBALS['SessSemName'][1]);
     if (!$i_view) {
         require_once 'lib/admin_search.inc.php';
         // This search just died a little inside, so it should be safe to
         // continue here but we nevertheless return just to be sure
         return;
     } elseif ($i_view === 'new') {
         closeObject();
     }
     //  allow only inst-admin and root to view / edit
     if ($i_view && !$GLOBALS['perm']->have_studip_perm('admin', $i_view) && $i_view !== 'new') {
         throw new AccessDeniedException();
     }
     //Change header_line if open object
     $header_line = getHeaderLine($i_view);
     if ($header_line) {
         PageLayout::setTitle($header_line . ' - ' . PageLayout::getTitle());
     }
     if (Request::get('i_trykill')) {
         $message = _('Sind Sie sicher, dass Sie diese Einrichtung löschen wollen?');
         $post['i_kill'] = 1;
         $post['studipticket'] = get_ticket();
         $this->question = createQuestion2($message, $post, array(), $this->url_for('institute/basicdata/delete/' . $i_view));
     }
     $lockrule = LockRules::getObjectRule($i_view);
     if ($lockrule->description && LockRules::CheckLockRulePermission($i_view, $lockrule['permission'])) {
         PageLayout::postMessage(MessageBox::info(formatLinks($lockrule->description)));
     }
     // Load institute data
     $institute = new Institute($i_view === 'new' ? null : $i_view);
     //add the free administrable datafields
     $datafields = array();
     $localEntries = DataFieldEntry::getDataFieldEntries($institute->id, 'inst');
     if ($localEntries) {
         $invalidEntries = $this->flash['invalid_entries'] ?: array();
         foreach ($localEntries as $entry) {
             if (!$entry->isVisible()) {
                 continue;
             }
             $color = '#000000';
             if (in_array($entry->getId(), $invalidEntries)) {
                 $color = '#ff0000';
             }
             $datafields[] = array('color' => $color, 'title' => $entry->getName(), 'value' => $GLOBALS['perm']->have_perm($entry->isEditable()) && !LockRules::Check($institute['Institut_id'], $entry->getId()) ? $entry->getHTML('datafields') : $entry->getDisplayValue());
         }
     }
     // Read faculties if neccessary
     if (count($institute->sub_institutes) === 0) {
         if ($GLOBALS['perm']->have_perm('root')) {
             $this->faculties = Institute::findBySQL('Institut_id = fakultaets_id ORDER BY Name ASC', array($i_view));
         } else {
             $temp = User::find($GLOBALS['user']->id)->institute_memberships->findBy('inst_perms', 'admin')->pluck('institute');
             $institutes = SimpleORMapCollection::createFromArray($temp);
             $faculties = $institutes->filter(function ($institute) {
                 return $institute->is_fak;
             });
             $this->faculties = $faculties;
         }
     }
     // Indicates whether the current user is allowed to delete the institute
     $this->may_delete = $i_view !== 'new' && !(count($institute->home_courses) || count($institute->sub_institutes)) && ($GLOBALS['perm']->have_perm('root') || $GLOBALS['perm']->is_fak_admin() && get_config('INST_FAK_ADMIN_PERMS') == 'all');
     if (!$this->may_delete) {
         //Set infotext for disabled delete-button
         $reason_txt = _('Löschen nicht möglich.');
         if (count($institute->home_courses) > 0) {
             $reason_txt .= ' ';
             $reason_txt .= sprintf(ngettext('Es ist eine Veranstaltung zugeordnet.', 'Es sind %u Veranstaltungen zugeordnet.', count($institute->home_courses)), count($institute->home_courses));
         }
         if (count($institute->sub_institutes) > 0) {
             $reason_txt .= ' ';
             $reason_txt .= sprintf(ngettext('Es ist eine Einrichtung zugeordnet.', 'Es sind %u Einrichtungen zugeordnet.', count($institute->sub_institutes)), count($institute->sub_institutes));
         }
     }
     // Indicates whether the current user is allowed to change the faculty
     $this->may_edit_faculty = $GLOBALS['perm']->is_fak_admin() && !LockRules::Check($institute['Institut_id'], 'fakultaets_id') && ($GLOBALS['perm']->have_studip_perm('admin', $institute['fakultaets_id']) || $i_view === 'new');
     // Prepare template
     $this->institute = $institute;
     $this->i_view = $i_view;
     $this->datafields = $datafields;
     $this->reason_txt = $reason_txt;
 }
コード例 #12
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();
     }
 }
コード例 #13
0
ファイル: admission.php プロジェクト: ratbird/hope
 function change_course_set_action()
 {
     CSRFProtection::verifyUnsafeRequest();
     if (Request::submitted('change_course_set_assign') && Request::get('course_set_assign') && !LockRules::Check($this->course_id, 'admission_type')) {
         $cs = new CourseSet(Request::option('course_set_assign'));
         if ($cs->isUserAllowedToAssignCourse($this->user_id, $this->course_id)) {
             CourseSet::addCourseToSet($cs->getId(), $this->course_id);
             $cs->load();
             if (in_array($this->course_id, $cs->getCourses())) {
                 PageLayout::postMessage(MessageBox::success(sprintf(_("Die Zuordnung zum Anmeldeset %s wurde durchgeführt."), htmlReady($cs->getName()))));
             }
         }
     }
     if (Request::submitted('change_course_set_unassign') && !LockRules::Check($this->course_id, 'admission_type')) {
         $this->response->add_header('X-Title', _('Anmelderegeln aufheben'));
         if ($this->course->getNumWaiting() && !Request::submitted('change_course_set_unassign_yes')) {
             $question = sprintf(_("In dieser Veranstaltung existiert eine Warteliste. Die bestehende Warteliste mit %s Einträgen wird gelöscht. Sind sie sicher?"), $this->course->getNumWaiting());
         }
         $cs = CourseSet::getSetForCourse($this->course_id);
         if ($cs) {
             $priorities = AdmissionPriority::getPrioritiesByCourse($cs->getId(), $this->course_id);
             if (count($priorities) && !Request::submitted('change_course_set_unassign_yes')) {
                 $question = sprintf(_("In dieser Veranstaltung existiert eine Anmeldeliste (Losverfahren am %s). Die bestehende Anmeldeliste mit %s Einträgen wird gelöscht. Sind sie sicher?"), strftime('%x %R', $cs->getSeatDistributionTime()), count($priorities));
             }
         }
         if (!$question && $cs) {
             CourseSet::removeCourseFromSet($cs->getId(), $this->course_id);
             $cs->load();
             if (!in_array($this->course_id, $cs->getCourses())) {
                 PageLayout::postMessage(MessageBox::success(sprintf(_("Die Zuordnung zum Anmeldeset %s wurde aufgehoben."), htmlReady($cs->getName()))));
             }
             if (!count($cs->getCourses()) && $cs->isGlobal() && $cs->getUserid() != '') {
                 $cs->delete();
             }
             if ($this->course->getNumWaiting()) {
                 $num_moved = 0;
                 foreach ($this->course->admission_applicants->findBy('status', 'awaiting') as $applicant) {
                     setTempLanguage($applicant->user_id);
                     $message_body = sprintf(_('Die Warteliste der Veranstaltung **%s** wurde deaktiviert, Sie sind damit __nicht__ zugelassen worden.'), $this->course->name);
                     $message_title = sprintf(_("Statusänderung %s"), $this->course->name);
                     messaging::sendSystemMessage($applicant->user_id, $message_title, $message_body);
                     restoreLanguage();
                     $num_moved += $applicant->delete();
                 }
                 if ($num_moved) {
                     PageLayout::postMessage(MessageBox::success(sprintf(_("%s Wartende wurden entfernt."), $num_moved)));
                 }
             }
         }
     }
     if (!$question) {
         $this->redirect($this->url_for('/index'));
     } else {
         $this->request = array('change_course_set_unassign' => 1);
         $this->button_yes = 'change_course_set_unassign_yes';
         PageLayout::postMessage(MessageBox::info($question));
         $this->render_template('course/admission/_change_admission.php');
     }
 }
コード例 #14
0
ファイル: _table_body.php プロジェクト: ratbird/hope
                            if (in_array($e_id, $dview) === TRUE) {
                                echo '<td><font size="-1">';
                                if ($entry->getValue() == 'default_value') {
                                    echo $default_entries[$e_id]->getDisplayValue();
                                } else {
                                    echo $entry->getDisplayValue();
                                }
                                echo '</font></td>';
                            }
                        }
                    } else {
                        for ($i = 0; $i < sizeof($struct); $i++) {
                            echo '<td>&nbsp;</td>';
                        }
                    }
                    if ($admin_view && !LockRules::Check($range_id, 'participants')) {
                        echo '<td>';
                        echo '<a href="'.URLHelper::getLink('dispatch.php/settings/statusgruppen/switch/' . $id . '?username='******'username']).'"><font size="-1">';
                        echo Icon::create('edit', 'clickable')->asImg();
                        echo '</font></a></td>';

                        echo '<td>';
                        echo '&nbsp;<a href="'.URLHelper::getLink('?cmd=removeFromGroup&username='******'username'].'&role_id='.$id).'">';
                        echo Icon::create('trash', 'clickable')->asImg(['class' => 'text-top']);
                        echo '</a>&nbsp</td>';
                    }
                    elseif ($structure["nachricht"]) {
                        echo '<td colspan=\"2\">&nbsp;</td>';
                    }
                    echo '</tr>', "\n";
                }
コード例 #15
0
ファイル: statusgroups.php プロジェクト: ratbird/hope
 private function types()
 {
     return array('inst' => array('name' => _('Institut'), 'after_user_add' => function ($user_id) {
         $newInstUser = new InstituteMember(array($user_id, $_SESSION['SessionSeminar']));
         if ($newInstUser->isNew()) {
             $user = new User($user_id);
             $newInstUser->inst_perms = $user->perms;
             if ($newInstUser->store()) {
                 StudipLog::INST_USER_ADD($_SESSION['SessionSeminar'], $user->id, $user->perms);
             }
         }
     }, 'after_user_delete' => function ($user_id) {
         null;
     }, 'after_user_move' => function ($user_id) {
         null;
     }, 'view' => function ($user_id) {
         return true;
     }, 'needs_size' => false, 'needs_self_assign' => false, 'edit' => function ($user_id) {
         return $GLOBALS['perm']->have_studip_perm('admin', $_SESSION['SessionSeminar']) && !LockRules::Check($_SESSION['SessionSeminar'], 'groups');
     }, 'redirect' => function () {
         require_once 'lib/admin_search.inc.php';
         die;
         //must not return
     }, 'groups' => array('members' => array('name' => _('Mitglieder')))));
 }
コード例 #16
0
ファイル: Seminar.class.php プロジェクト: ratbird/hope
 /**
  * returns array with information about enrolment to this course for given user_id
  * ['enrolment_allowed'] : true or false
  * ['cause']: keyword to describe the cause
  * ['description'] : readable description of the cause
  *
  * @param string $user_id
  * @return array
  */
 public function getEnrolmentInfo($user_id)
 {
     $info = array();
     $user = User::find($user_id);
     if ($this->read_level == 0 && get_config('ENABLE_FREE_ACCESS') && !$GLOBALS['perm']->get_studip_perm($this->getId(), $user_id)) {
         $info['enrolment_allowed'] = true;
         $info['cause'] = 'free_access';
         $info['description'] = _("Für die Veranstaltung ist keine Anmeldung erforderlich.");
         return $info;
     }
     if (!$user) {
         $info['enrolment_allowed'] = false;
         $info['cause'] = 'nobody';
         $info['description'] = _("Sie sind nicht angemeldet.");
         return $info;
     }
     if ($GLOBALS['perm']->have_perm('root', $user_id)) {
         $info['enrolment_allowed'] = true;
         $info['cause'] = 'root';
         $info['description'] = _("Sie dürfen ALLES.");
         return $info;
     }
     if ($GLOBALS['perm']->have_studip_perm('admin', $this->getId(), $user_id)) {
         $info['enrolment_allowed'] = true;
         $info['cause'] = 'courseadmin';
         $info['description'] = _("Sie sind Administrator_in der Veranstaltung.");
         return $info;
     }
     if ($GLOBALS['perm']->have_perm('admin', $user_id)) {
         $info['enrolment_allowed'] = false;
         $info['cause'] = 'admin';
         $info['description'] = _("Als Administrator_in können Sie sich nicht für eine Veranstaltung anmelden.");
         return $info;
     }
     //Ist bereits Teilnehmer
     if ($GLOBALS['perm']->have_studip_perm('user', $this->getId(), $user_id)) {
         $info['enrolment_allowed'] = true;
         $info['cause'] = 'member';
         $info['description'] = _("Sie sind für die Veranstaltung angemeldet.");
         return $info;
     }
     $admission_status = $user->admission_applications->findBy('seminar_id', $this->getId())->val('status');
     if ($admission_status == 'accepted') {
         $info['enrolment_allowed'] = false;
         $info['cause'] = 'accepted';
         $info['description'] = _("Sie wurden für diese Veranstaltung vorläufig akzeptiert.");
         return $info;
     }
     if ($admission_status == 'awaiting') {
         $info['enrolment_allowed'] = false;
         $info['cause'] = 'awaiting';
         $info['description'] = _("Sie stehen auf der Warteliste für diese Veranstaltung.");
         return $info;
     }
     if ($GLOBALS['perm']->get_perm($user_id) == 'user') {
         $info['enrolment_allowed'] = false;
         $info['cause'] = 'user';
         $info['description'] = _("Sie haben nicht die erforderliche Berechtigung sich für eine Veranstaltung anzumelden.");
         return $info;
     }
     //falsche Nutzerdomäne
     $same_domain = true;
     $user_domains = UserDomain::getUserDomainsForUser($user_id);
     if (count($user_domains) > 0) {
         $seminar_domains = UserDomain::getUserDomainsForSeminar($this->getId());
         $same_domain = count(array_intersect($seminar_domains, $user_domains)) > 0;
     }
     if (!$same_domain && !$this->isStudygroup()) {
         $info['enrolment_allowed'] = false;
         $info['cause'] = 'domain';
         $info['description'] = _("Sie sind nicht in einer zugelassenenen Nutzerdomäne, Sie können sich nicht eintragen!");
         return $info;
     }
     //Teilnehmerverwaltung mit Sperregel belegt
     if (LockRules::Check($this->getId(), 'participants')) {
         $info['enrolment_allowed'] = false;
         $info['cause'] = 'locked';
         $lockdata = LockRules::getObjectRule($this->getId());
         $info['description'] = _("In diese Veranstaltung können Sie sich nicht eintragen!") . ($lockdata['description'] ? '<br>' . formatLinks($lockdata['description']) : '');
         return $info;
     }
     //Veranstaltung unsichtbar für aktuellen Nutzer
     if (!$this->visible && !$this->isStudygroup() && !$GLOBALS['perm']->have_perm(get_config('SEM_VISIBILITY_PERM'), $user_id)) {
         $info['enrolment_allowed'] = false;
         $info['cause'] = 'invisible';
         $info['description'] = _("Die Veranstaltung ist gesperrt, Sie können sich nicht eintragen!");
         return $info;
     }
     if ($courseset = $this->getCourseSet()) {
         $info['enrolment_allowed'] = true;
         $info['cause'] = 'courseset';
         $info['description'] = _("Die Anmeldung zu dieser Veranstaltung folgt speziellen Regeln. Lesen Sie den Hinweistext.");
         $user_prio = AdmissionPriority::getPrioritiesByUser($courseset->getId(), $user_id);
         if (isset($user_prio[$this->getId()])) {
             $info['description'] .= ' ' . sprintf(_("(Sie stehen auf der Anmeldeliste für die automatische Platzverteilung mit der Priorität %s.)"), $user_prio[$this->getId()]);
         }
         return $info;
     }
     $info['enrolment_allowed'] = true;
     $info['cause'] = 'normal';
     $info['description'] = '';
     return $info;
 }
コード例 #17
0
ファイル: roles.php プロジェクト: ratbird/hope
        <? if ($role['role']->hasFolder()) :
            echo Icon::create('files', 'clickable')->asImg();
        endif; ?>

        &nbsp;
    </td>
</tr>
<?

    // if the current $role has followers, we need to display a straight line later
    $new_followers = $followers;
    $new_followers[$indent] = (sizeof($roles) > $pos);

    // if we have opened an entry, we show edit fields
    if ($open == $id) :
        $partial = LockRules::Check($range_id, 'groups') ?
                   'statusgruppen/role_administration_locked.php' :
                   'statusgruppen/role_administration.php';
        echo $this->render_partial($partial,
            array('indent' => $indent, 'followers' => $new_followers,
                'persons' => getPersonsForRole($id), 'role_id' => $id, 'editRole' => ($editRole == $id), 'role' => $role['role'],
                'role_size' => sizeof($roles), 'role_pos' => $pos, 'has_child' => ($role['child']) ? true : false, 'all_roles' => $all_roles)
        );
    endif;

    // if we have childs, we display them with the same template and some indention
    if($role['child']) {
        echo $this->render_partial('statusgruppen/roles.php',
            array('indent' => $indent + 1, 'roles' => $role['child'], 'followers' => $new_followers, 'all_roles' => $all_roles));
    }
コード例 #18
0
ファイル: wizard.php プロジェクト: ratbird/hope
 /**
  * Copy an existing course.
  */
 public function copy_action($id)
 {
     if (!$GLOBALS['perm']->have_studip_perm('dozent', $id) || LockRules::Check($id, 'seminar_copy')) {
         throw new AccessDeniedException(_("Sie dürfen diese Veranstaltung nicht kopieren"));
     }
     $course = Course::find($id);
     $values = array();
     for ($i = 0; $i < sizeof($this->steps); $i++) {
         $step = $this->getStep($i);
         $values = $step->copy($course, $values);
     }
     $values['source_id'] = $course->id;
     $this->initialize();
     $_SESSION['coursewizard'][$this->temp_id] = $values;
     $this->redirect($this->url_for('course/wizard/step/0/' . $this->temp_id, array('cid' => '')));
 }
コード例 #19
0
ファイル: infobox.php プロジェクト: ratbird/hope
            <?php 
echo Icon::create('info', 'info')->asImg();
?>
        </td>
        <td width="99%" align="left">
            <a href="<?php 
echo $help_url = format_help_url("Basis.EinrichtungenVerwaltenGruppen");
?>
" target="_blank">
                <?php 
echo _("Bedienungshinweise in der Hilfe");
?>
            </a>
        </td>
      </tr>
      <? if (!LockRules::Check($range_id, 'groups')) :?>
      <tr>
          <td align="center" width="1%" valign="top">
            <?php 
echo Icon::create('community+add', 'info')->asImg();
?>
          </td>
          <td width="99%" align="left">

                <a href="<?php 
echo URLHelper::getLink('?cmd=newRole&range_id=' . $range_id);
?>
"><?php 
echo _("neue Gruppe anlegen");
?>
</a>
コード例 #20
0
ファイル: admin_statusgruppe.php プロジェクト: ratbird/hope
    // set the options for the box
    list($self_assign_all, $self_assign_exclusive) = CheckSelfAssignAll($range_id);
    $template->set_attribute('self_assign_all', $self_assign_all);
    $template->set_attribute('self_assign_exclusive', $self_assign_exclusive);

    $template->set_attribute('seminar_class', SeminarCategories::GetBySeminarId($range_id)->id);

    if (Request::option('cmd') == 'editRole') {
        $role = new Statusgruppe(Request::option('role_id'));
        $template->set_attribute('role_data', $role->getData());
        $template->set_attribute('edit_role', $role->getId());
    } else if (Request::submitted('choosePreset')) {
        $template->set_attribute('role_data', array('name' => Request::quoted('presetName')));
    }
    $template->set_attribute('show_search_and_members_form', !LockRules::Check($range_id, 'participants'));

    // quickfilters
    foreach (getPersons($range_id, 'sem') as $k=>$v) {
        $quickfilter_sem[] = $k;
    }
    $template->set_attribute('quickfilter_sem', $quickfilter_sem);
    foreach (getPersons($range_id, 'sem_no_group') as $k=>$v) {
        $quickfilter_sem_no_group[] = $k;
    }
    $template->set_attribute('quickfilter_sem_no_group', $quickfilter_sem_no_group);
    foreach (getPersons($range_id, 'inst') as $k=>$v) {
        $quickfilter_inst[] = $k;
    }
    $template->set_attribute('quickfilter_inst', $quickfilter_inst);
    // search