Example #1
0
 /**
  * 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);
         }
     }
 }
Example #2
0
 /**
  * Displays the deputy information of a user.
  */
 public function index_action()
 {
     if (Request::submitted('add_deputy') && ($deputy_id = Request::option('deputy_id'))) {
         $this->check_ticket();
         if (isDeputy($deputy_id, $this->user->user_id)) {
             $this->reportError(_('%s ist bereits als Vertretung eingetragen.'), get_fullname($deputy_id, 'full'));
         } else {
             if ($deputy_id == $this->user->user_id) {
                 $this->reportError(_('Sie können sich nicht als Ihre eigene Vertretung eintragen!'));
             } else {
                 if (addDeputy($deputy_id, $this->user->user_id)) {
                     $this->reportSuccess(_('%s wurde als Vertretung eingetragen.'), get_fullname($deputy_id, 'full'));
                 } else {
                     $this->reportError(_('Fehler beim Eintragen der Vertretung!'));
                 }
             }
         }
         $this->redirect('settings/deputies');
         return;
     }
     $deputies = getDeputies($this->user->user_id, true);
     $exclude_users = array($this->user->user_id);
     if (is_array($deputies)) {
         $exclude_users = array_merge($exclude_users, array_map(function ($d) {
             return $d['user_id'];
         }, $deputies));
     }
     $this->deputies = $deputies;
     $this->search = new PermissionSearch('user', _('Vor-, Nach- oder Benutzername'), 'user_id', array('permission' => getValidDeputyPerms(), 'exclude_user' => $exclude_users));
     $sidebar = Sidebar::Get();
     $sidebar->setTitle(PageLayout::getTitle());
     $actions = new ActionsWidget();
     // add "add dozent" to infobox
     $mp = MultiPersonSearch::get('settings_add_deputy')->setLinkText(_('Neue Standardvertretung festlegen'))->setDefaultSelectedUser(array_keys($this->deputies))->setLinkIconPath('')->setTitle(_('Neue Standardvertretung festlegen'))->setExecuteURL(URLHelper::getLink('dispatch.php/settings/deputies/add_member'))->setSearchObject($this->search)->setNavigationItem('/links/settings/deputies')->render();
     $element = LinkElement::fromHTML($mp, Icon::create('community+add', 'clickable'));
     $actions->addElement($element);
     Sidebar::Get()->addWidget($actions);
 }
Example #3
0
 /**
  * Zeigt die Grunddaten an. Man beachte, dass eventuell zuvor eine andere
  * Action wie Set ausgeführt wurde, von der hierher weitergeleitet worden ist.
  * Wichtige Daten dazu wurden dann über $this->flash übertragen.
  *
  * @param md5 $course_id
  */
 public function view_action($course_id = null)
 {
     global $user, $perm, $_fullname_sql;
     $deputies_enabled = get_config('DEPUTIES_ENABLE');
     //damit QuickSearch funktioniert:
     Request::set('new_doz_parameter', $this->flash['new_doz_parameter']);
     if ($deputies_enabled) {
         Request::set('new_dep_parameter', $this->flash['new_dep_parameter']);
     }
     Request::set('new_tut_parameter', $this->flash['new_tut_parameter']);
     $this->course_id = Request::option('cid', $course_id);
     Navigation::activateItem('/course/admin/details');
     //Berechtigungscheck:
     if (!$perm->have_studip_perm("tutor", $this->course_id)) {
         throw new AccessDeniedException(_("Sie haben keine Berechtigung diese " . "Veranstaltung zu verändern."));
     }
     //Kopf initialisieren:
     PageLayout::setHelpKeyword("Basis.VeranstaltungenVerwaltenGrunddaten");
     PageLayout::setTitle(_("Verwaltung der Grunddaten"));
     if ($this->course_id) {
         PageLayout::setTitle(Course::find($this->course_id)->getFullname() . " - " . PageLayout::getTitle());
     }
     //Daten sammeln:
     $sem = Seminar::getInstance($this->course_id);
     $data = $sem->getData();
     //Erster Reiter des Akkordions: Grundeinstellungen
     $this->attributes = array();
     $this->attributes[] = array('title' => _("Name der Veranstaltung"), 'name' => "course_name", 'must' => true, 'type' => 'text', 'value' => $data['name'], 'locked' => LockRules::Check($this->course_id, 'Name'));
     $this->attributes[] = array('title' => _("Untertitel der Veranstaltung"), 'name' => "course_subtitle", 'type' => 'text', 'value' => $data['subtitle'], 'locked' => LockRules::Check($this->course_id, 'Untertitel'));
     $sem_types = array();
     if ($perm->have_perm("admin")) {
         foreach (SemClass::getClasses() as $sc) {
             foreach ($sc->getSemTypes() as $st) {
                 if (!$sc['course_creation_forbidden']) {
                     $sem_types[$st['id']] = $st['name'] . ' (' . $sc['name'] . ')';
                 }
             }
         }
     } else {
         $sc = $sem->getSemClass();
         foreach ($sc->getSemTypes() as $st) {
             $sem_types[$st['id']] = $st['name'] . ' (' . $sc['name'] . ')';
         }
     }
     if (!isset($sem_types[$data['status']])) {
         $sem_types[$data['status']] = $sem->getSemType()->offsetGet('name');
     }
     $this->attributes[] = array('title' => _("Typ der Veranstaltung"), 'name' => "course_status", 'must' => true, 'type' => 'select', 'value' => $data['status'], 'locked' => LockRules::Check($this->course_id, 'status'), 'choices' => array_map('htmlReady', $sem_types));
     $this->attributes[] = array('title' => _("Art der Veranstaltung"), 'name' => "course_form", 'type' => 'text', 'value' => $data['form'], 'locked' => LockRules::Check($this->course_id, 'art'));
     $this->attributes[] = array('title' => _("Veranstaltungs-Nummer"), 'name' => "course_seminar_number", 'type' => 'text', 'value' => $data['seminar_number'], 'locked' => LockRules::Check($this->course_id, 'VeranstaltungsNummer'));
     $this->attributes[] = array('title' => _("ECTS-Punkte"), 'name' => "course_ects", 'type' => 'text', 'value' => $data['ects'], 'locked' => LockRules::Check($this->course_id, 'ects'));
     $this->attributes[] = array('title' => _("max. Teilnehmerzahl"), 'name' => "course_admission_turnout", 'must' => false, 'type' => 'number', 'value' => $data['admission_turnout'], 'locked' => LockRules::Check($this->course_id, 'admission_turnout'), 'min' => '0');
     $this->attributes[] = array('title' => _("Beschreibung"), 'name' => "course_description", 'type' => 'textarea', 'value' => $data['description'], 'locked' => LockRules::Check($this->course_id, 'Beschreibung'));
     //Zweiter Reiter: Institute
     $this->institutional = array();
     $institute = Institute::getMyInstitutes();
     $choices = array();
     foreach ($institute as $inst) {
         //$choices[$inst['Institut_id']] = $inst['Name'];
         $choices[$inst['Institut_id']] = ($inst['is_fak'] ? "<span style=\"font-weight: bold\">" : "&nbsp;&nbsp;&nbsp;&nbsp;") . htmlReady($inst['Name']) . ($inst['is_fak'] ? "</span>" : "");
     }
     $this->institutional[] = array('title' => _("Heimat-Einrichtung"), 'name' => "course_institut_id", 'must' => true, 'type' => 'select', 'value' => $data['institut_id'], 'choices' => $choices, 'locked' => LockRules::Check($this->course_id, 'Institut_id'));
     $institute = Institute::getInstitutes();
     $choices = array();
     foreach ($institute as $inst) {
         $choices[$inst['Institut_id']] = ($inst['is_fak'] ? "<span style=\"font-weight: bold\">" : "&nbsp;&nbsp;&nbsp;&nbsp;") . htmlReady($inst['Name']) . ($inst['is_fak'] ? "</span>" : "");
     }
     $sem_institutes = $sem->getInstitutes();
     $inst = array_flip($sem_institutes);
     unset($inst[$sem->institut_id]);
     $inst = array_flip($inst);
     $this->institutional[] = array('title' => _("beteiligte Einrichtungen"), 'name' => "related_institutes[]", 'type' => 'multiselect', 'value' => $inst, 'choices' => $choices, 'locked' => LockRules::Check($this->course_id, 'seminar_inst'));
     $this->dozent_is_locked = LockRules::Check($this->course_id, 'dozent');
     $this->tutor_is_locked = LockRules::Check($this->course_id, 'tutor');
     //Dritter Reiter: Personal
     $this->dozenten = $sem->getMembers('dozent');
     $instUsers = new SimpleCollection(InstituteMember::findByInstituteAndStatus($sem->getInstitutId(), 'dozent'));
     $this->lecturersOfInstitute = $instUsers->pluck('user_id');
     if (SeminarCategories::getByTypeId($sem->status)->only_inst_user) {
         $search_template = "user_inst_not_already_in_sem";
     } else {
         $search_template = "user_not_already_in_sem";
     }
     $this->dozentUserSearch = new PermissionSearch($search_template, sprintf(_("%s suchen"), get_title_for_status('dozent', 1, $sem->status)), "user_id", array('permission' => 'dozent', 'seminar_id' => $this->course_id, 'sem_perm' => 'dozent', 'institute' => $sem_institutes));
     $this->dozenten_title = get_title_for_status('dozent', 1, $sem->status);
     $this->deputies_enabled = $deputies_enabled;
     if ($this->deputies_enabled) {
         $this->deputies = getDeputies($this->course_id);
         $this->deputySearch = new PermissionSearch("user_not_already_in_sem_or_deputy", sprintf(_("%s suchen"), get_title_for_status('deputy', 1, $sem->status)), "user_id", array('permission' => getValidDeputyPerms(), 'seminar_id' => $this->course_id));
         $this->deputy_title = get_title_for_status('deputy', 1, $sem->status);
     }
     $this->tutoren = $sem->getMembers('tutor');
     $this->tutorUserSearch = new PermissionSearch($search_template, sprintf(_("%s suchen"), get_title_for_status('tutor', 1, $sem->status)), "user_id", array('permission' => array('dozent', 'tutor'), 'seminar_id' => $this->course_id, 'sem_perm' => array('dozent', 'tutor'), 'institute' => $sem_institutes));
     $this->tutor_title = get_title_for_status('tutor', 1, $sem->status);
     $instUsers = new SimpleCollection(InstituteMember::findByInstituteAndStatus($sem->getInstitutId(), 'tutor'));
     $this->tutorsOfInstitute = $instUsers->pluck('user_id');
     unset($instUsers);
     //Vierter Reiter: Beschreibungen (darunter Datenfelder)
     $this->descriptions[] = array('title' => _("Teilnehmde"), 'name' => "course_participants", 'type' => 'textarea', 'value' => $data['participants'], 'locked' => LockRules::Check($this->course_id, 'teilnehmer'));
     $this->descriptions[] = array('title' => _("Voraussetzungen"), 'name' => "course_requirements", 'type' => 'textarea', 'value' => $data['requirements'], 'locked' => LockRules::Check($this->course_id, 'voraussetzungen'));
     $this->descriptions[] = array('title' => _("Lernorganisation"), 'name' => "course_orga", 'type' => 'textarea', 'value' => $data['orga'], 'locked' => LockRules::Check($this->course_id, 'lernorga'));
     $this->descriptions[] = array('title' => _("Leistungsnachweis"), 'name' => "course_leistungsnachweis", 'type' => 'textarea', 'value' => $data['leistungsnachweis'], 'locked' => LockRules::Check($this->course_id, 'leistungsnachweis'));
     $this->descriptions[] = array('title' => _("Ort") . "<br><span style=\"font-size: 0.8em\"><b>" . _("Achtung:") . "&nbsp;</b>" . _("Diese Ortsangabe wird nur angezeigt, wenn keine " . "Angaben aus Zeiten oder Sitzungsterminen gemacht werden können.") . "</span>", 'name' => "course_location", 'type' => 'textarea', 'value' => $data['location'], 'locked' => LockRules::Check($this->course_id, 'Ort'));
     $datenfelder = DataFieldEntry::getDataFieldEntries($this->course_id, 'sem', $data["status"]);
     if ($datenfelder) {
         foreach ($datenfelder as $datenfeld) {
             if ($datenfeld->isVisible()) {
                 $locked = !$datenfeld->isEditable() || LockRules::Check($this->course_id, $datenfeld->getID());
                 $this->descriptions[] = array('title' => $datenfeld->getName(), 'must' => $datenfeld->isRequired(), 'name' => "datafield_" . $datenfeld->getID(), 'type' => "datafield", 'html_value' => $datenfeld->getHTML("datafields"), 'display_value' => $datenfeld->getDisplayValue(), 'locked' => $locked, 'description' => !$datenfeld->isEditable() ? "Diese Felder werden zentral durch die zuständigen Administratoren erfasst." : $datenfeld->getDescription());
             }
         }
     }
     $this->descriptions[] = array('title' => _("Sonstiges"), 'name' => "course_misc", 'type' => 'textarea', 'value' => $data['misc'], 'locked' => LockRules::Check($this->course_id, 'Sonstiges'));
     $this->perm_dozent = $perm->have_studip_perm("dozent", $this->course_id);
     $this->mkstring = $data['mkdate'] ? date("d.m.Y, G:i", $data['mkdate']) : _("unbekannt");
     $this->chstring = $data['chdate'] ? date("d.m.Y, G:i", $data['chdate']) : _("unbekannt");
     $lockdata = LockRules::getObjectRule($this->course_id);
     if ($lockdata['description'] && LockRules::CheckLockRulePermission($this->course_id, $lockdata['permission'])) {
         $this->flash['msg'] = array_merge((array) $this->flash['msg'], array(array("info", formatLinks($lockdata['description']))));
     }
     $this->flash->discard();
     //schmeißt ab jetzt unnötige Variablen aus der Session.
     $sidebar = Sidebar::get();
     $sidebar->setImage("sidebar/admin-sidebar.png");
     $widget = new ActionsWidget();
     $widget->addLink(_('Bild ändern'), $this->url_for('course/avatar/update', $course_id), Icon::create('edit', 'clickable'));
     if ($this->deputies_enabled) {
         if (isDeputy($user->id, $this->course_id)) {
             $newstatus = 'dozent';
             $text = _('Lehrende werden');
         } else {
             if (in_array($user->id, array_keys($this->dozenten)) && sizeof($this->dozenten) > 1) {
                 $newstatus = 'deputy';
                 $text = _('Vertretung werden');
             }
         }
         $widget->addLink($text, $this->url_for('course/basicdata/switchdeputy', $this->course_id, $newstatus), Icon::create('persons', 'clickable'));
     }
     $sidebar->addWidget($widget);
     // Entry list for admin upwards.
     if ($perm->have_studip_perm("admin", $this->course_id)) {
         $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);
     }
 }
Example #4
0
 /**
  *
  **/
 public function permissions_action($consumer_key = null)
 {
     if (Request::submitted('store')) {
         $perms = $_POST['permission'];
         $permissions = RestIP\Router::getInstance($consumer_key ?: null)->getPermissions();
         foreach ($_POST['permission'] as $route => $methods) {
             foreach ($methods as $method => $granted) {
                 $permissions->set(urldecode($route), urldecode($method), (bool) $granted);
             }
         }
         PageLayout::postMessage(MessageBox::success(_('Die Zugriffsberechtigungen wurden erfolgreich gespeichert')));
         $this->redirect($consumer_key ? 'admin' : 'admin/permissions');
         return;
     }
     $title = $consumer_key ? 'Zugriffsberechtigungen' : 'Globale Zugriffsberechtigungen';
     $title .= ' - ' . PageLayout::getTitle();
     PageLayout::setTitle($title);
     $this->consumer_key = $consumer_key;
     $this->router = RestIP\Router::getInstance($consumer_key);
     $this->routes = $this->router->getRoutes();
     $this->descriptions = $this->router->getDescriptions();
     $this->permissions = $this->router->getPermissions();
     $this->global = $consumer_key ? RestIP\Router::getInstance()->getPermissions() : false;
 }
Example #5
0
 /**
  * Displays a page for literature list administration.
  */
 public function edit_list_action()
 {
     global $_msg;
     if (Request::option('_range_id') == "self") {
         $this->_range_id = $GLOBALS['user']->id;
     } else {
         if (Request::option('_range_id')) {
             $this->_range_id = Request::option('_range_id');
         } else {
             if (Request::get('admin_inst_id')) {
                 $this->view = 'lit_inst';
                 $this->_range_id = Request::option('admin_inst_id');
             } else {
                 $this->_range_id = $_SESSION['_lit_range'];
             }
         }
     }
     if (!$this->_range_id) {
         $this->_range_id = $GLOBALS['user']->id;
     }
     $_SESSION['_lit_range'] = $this->_range_id;
     require_once "lib/classes/lit_import_plugins/StudipLitImportPluginAbstract.class.php";
     PageLayout::setHelpKeyword("Basis.LiteraturListen");
     PageLayout::setTitle(_("Verwaltung von Literaturlisten"));
     if (Request::option('list') || Request::option('view') || Request::option('view_mode') || $this->_range_id != $GLOBALS['user']->id) {
         Navigation::activateItem('/course/literature/edit');
         $this->_range_id = $_SESSION['SessSemName'][1] ? $_SESSION['SessSemName'][1] : $this->_range_id;
     } else {
         Navigation::activateItem('/tools/literature/edit_list');
         closeObject();
     }
     $_the_treeview = new StudipLitListViewAdmin($this->_range_id);
     $_the_tree =& $_the_treeview->tree;
     //Literaturlisten-Import
     $cmd = Request::option('cmd');
     $xmlfile = $_FILES['xmlfile']['tmp_name'];
     $xmlfile_name = $_FILES['xmlfile']['name'];
     $xmlfile_size = $_FILES['xmlfile']['size'];
     $this->plugin_name = Request::option('plugin_name');
     if ($cmd == "import_lit_list" && $xmlfile) {
         StudipLitImportPluginAbstract::use_lit_import_plugins($xmlfile, $xmlfile_size, $xmlfile_name, $this->plugin_name, $this->_range_id);
     }
     $this->msg = $_msg;
     PageLayout::setTitle($_the_tree->root_name . " - " . PageLayout::getTitle());
     //checking rights
     if ($_the_tree->range_type == "sem" && !$GLOBALS['perm']->have_studip_perm("tutor", $this->_range_id) || ($_the_tree->range_type == "inst" || $_the_tree->range_type == "fak") && !$GLOBALS['perm']->have_studip_perm("autor", $this->_range_id)) {
         throw new AccessDeniedException(_('Keine Berechtigung für diese Literaturliste.'));
     }
     $_the_treeview->parseCommand();
     //always show existing lists
     $_the_treeview->open_ranges['root'] = true;
     //if there are no lists always open root element
     if (!$_the_tree->hasKids('root')) {
         $_the_treeview->open_items['root'] = true;
     }
     $_the_clipboard = StudipLitClipBoard::GetInstance();
     $_the_clip_form =& $_the_clipboard->getFormObject();
     if ($_the_clip_form->isClicked("clip_ok")) {
         $clip_cmd = explode("_", $_the_clip_form->getFormFieldValue("clip_cmd"));
         if ($clip_cmd[0] == "ins") {
             if (is_array($_the_clip_form->getFormFieldValue("clip_content"))) {
                 $inserted = $_the_tree->insertElementBulk($_the_clip_form->getFormFieldValue("clip_content"), $clip_cmd[1]);
                 if ($inserted) {
                     $_the_tree->init();
                     $_the_treeview->open_ranges[$clip_cmd[1]] = true;
                     PageLayout::postMessage(MessageBox::success(sprintf(_("%s Einträge aus Ihrer Merkliste wurden in <b>%s</b> eingetragen."), $inserted, htmlReady($_the_tree->tree_data[$clip_cmd[1]]['name']))));
                 }
             } else {
                 PageLayout::postMessage(MessageBox::info(_("Sie haben keinen Eintrag in Ihrer Merkliste ausgewählt!")));
             }
         }
         $_the_clipboard->doClipCmd();
     }
     if (($this->lists = $_the_tree->getListIds()) && $_the_clipboard->getNumElements()) {
         for ($i = 0; $i < count($this->lists); ++$i) {
             $_the_clip_form->form_fields['clip_cmd']['options'][] = array('name' => my_substr(sprintf(_("In \"%s\" eintragen"), $_the_tree->tree_data[$this->lists[$i]]['name']), 0, 50), 'value' => 'ins_' . $this->lists[$i]);
         }
     }
     $this->msg .= $_the_clipboard->msg;
     if (is_array($_the_treeview->msg)) {
         foreach ($_the_treeview->msg as $t_msg) {
             if (!$this->msg || $this->msg && strpos($t_msg, $this->msg) === false) {
                 $this->msg .= $t_msg . "§";
             }
         }
     }
     $this->lists = $_the_tree->getKids('root');
     if ($this->lists) {
         $this->list_count['visible'] = 0;
         $this->list_count['visible_entries'] = 0;
         $this->list_count['invisible'] = 0;
         $this->list_count['invisible_entries'] = 0;
         for ($i = 0; $i < count($this->lists); ++$i) {
             if ($_the_tree->tree_data[$this->lists[$i]]['visibility']) {
                 ++$this->list_count['visible'];
                 $this->list_count['visible_entries'] += $_the_tree->getNumKids($this->lists[$i]);
             } else {
                 ++$this->list_count['invisible'];
                 $this->list_count['invisible_entries'] += $_the_tree->getNumKids($this->lists[$i]);
             }
         }
     }
     $this->treeview = $_the_treeview;
     $this->tree = $_the_tree;
     $this->clipboard = $_the_clipboard;
     $this->clip_form = $_the_clip_form;
 }
Example #6
0
<html>
<head>
    <title><?php 
echo htmlReady(PageLayout::getTitle());
?>
</title>
</head>
<body>

<? if (sizeof($dates)) : ?>
    <table cellspacing="0" cellpadding="0" border="1" width="100%">

        <tr>
            <th colspan="3">
                <h2><?php 
echo htmlReady(PageLayout::getTitle());
?>
</h2>
            </th>
        </tr>

        <?
        $semester = new SemesterData();
        $all_semester = $semester->getAllSemesterData();

        foreach ($dates as $date) :
            if ( ($grenze == 0) || ($grenze < $date['start']) ) {
                foreach ($all_semester as $zwsem) {
                    if ( ($zwsem['beginn'] < $date['start']) && ($zwsem['ende'] > $date['start']) ) {
                        $grenze = $zwsem['ende'];
                        ?>
Example #7
0
PageLayout::setTitle(_("Verwaltung externer Seiten"));

if ($range_id != 'studip') {
    Navigation::activateItem('/admin/institute/external');
    require_once 'lib/admin_search.inc.php';
} else {
    Navigation::activateItem('/admin/locations/external');
}
$mod=Request::quoted('mod');//Change header_line if open object
$header_line = getHeaderLine($range_id);
if ($header_line) {
    PageLayout::setTitle($header_line." - ".PageLayout::getTitle());
    foreach ($GLOBALS['EXTERN_MODULE_TYPES'] as $key => $type) {
        if ($type["module"] == $mod) {
            PageLayout::setTitle(PageLayout::getTitle() . " ({$GLOBALS['EXTERN_MODULE_TYPES'][$key]['name']})");
            break;
        }
    }
}

// upload of configuration
if (Request::option('com') == "do_upload_config") {
    $file_content = file_get_contents($_FILES['the_file']['tmp_name']);

    // revert the changes done by indentJson
    $file_content_wo_tabs = str_replace("\t", '', str_replace("\n", '', $file_content));

    $jsonconfig = json_decode($file_content_wo_tabs, true);

    // utf8-decode the values after json_decode has worked on it
Example #8
0
 /**
  * Extends this controller with neccessary infobox
  *
  * @param String $view Currently viewed group
  */
 private function setSidebar($view)
 {
     $sidebar = Sidebar::Get();
     $sidebar->setImage('sidebar/smiley-sidebar.png');
     $sidebar->setTitle(PageLayout::getTitle() ?: _('Smileys'));
     // Render items
     $factory = new Flexi_TemplateFactory($this->dispatcher->trails_root . '/views/admin/smileys/');
     $actions = new ActionsWidget();
     $actions->addLink(_('Neues Smiley hochladen'), $this->url_for('admin/smileys/upload', $view), Icon::create('add', 'clickable'))->asDialog('size=auto');
     $actions->addLink(_('Smileys zählen'), $this->url_for('admin/smileys/count', $view), Icon::create('code', 'clickable'));
     $actions->addLink(_('Tabelle aktualisieren'), $this->url_for('admin/smileys/refresh', $view), Icon::create('refresh', 'clickable'));
     $actions->addLink(_('Smiley-Übersicht öffnen'), URLHelper::getLink('dispatch.php/smileys'), Icon::create('smiley', 'clickable'))->asDialog();
     $sidebar->addWidget($actions);
     $widget = new SidebarWidget();
     $filter = $factory->render('selector', array('characters' => Smiley::getUsedCharacters(), 'controller' => $this, 'view' => $view));
     $widget->setTitle(_('Filter'));
     $widget->addElement(new WidgetElement($filter));
     $sidebar->addWidget($widget);
     $widget = new SidebarWidget();
     $statistics = $factory->render('statistics', Smiley::getStatistics());
     $widget->setTitle(_('Statistiken'));
     $widget->addElement(new WidgetElement($statistics));
     $sidebar->addWidget($widget);
 }
Example #9
0
 /**
  * Callback function being called after an action is executed.
  *
  * @param string Name of the action to perform.
  * @param array  An array of arguments to the action.
  *
  * @return void
  */
 function after_filter($action, $args)
 {
     parent::after_filter($action, $args);
     if (Request::isXhr() && !isset($this->response->headers['X-Title']) && PageLayout::hasTitle()) {
         $this->response->add_header('X-Title', PageLayout::getTitle());
     }
     if ($this->with_session) {
         page_close();
     }
 }
Example #10
0
 /**
  * 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;
 }
Example #11
0
 private function setSidebar($action)
 {
     $sidebar = Sidebar::Get();
     $sidebar->setTitle(PageLayout::getTitle() ?: _('Rollen'));
     $sidebar->setImage('sidebar/roles-sidebar.png');
     $views = new ViewsWidget();
     $views->addLink(_('Rollen verwalten'), $this->url_for('admin/role'))->setActive($action === 'index');
     $views->addLink(_('Personenzuweisungen bearbeiten'), $this->url_for('admin/role/assign_role'))->setActive($action === 'assign_role');
     $views->addLink(_('Pluginzuweisungen bearbeiten'), $this->url_for('admin/role/assign_plugin_role'))->setActive($action === 'assign_plugin_role');
     $views->addLink(_('Rollenzuweisungen anzeigen'), $this->url_for('admin/role/show_role'))->setActive($action === 'show_role');
     $sidebar->addWidget($views);
     $actions = new ActionsWidget();
     $actions->addLink(_('Neue Rolle anlegen'), $this->url_for('admin/role/add'), Icon::create('add', 'clickable'))->asDialog('size=auto');
     $sidebar->addWidget($actions);
 }
Example #12
0
 /**
  * A person applies for a course.
  */
 function apply_action()
 {
     $user_id = $GLOBALS['user']->id;
     $courseset = CourseSet::getSetForCourse($this->course_id);
     $this->course_name = PageLayout::getTitle();
     if ($courseset) {
         $errors = $courseset->checkAdmission($user_id, $this->course_id);
         if (count($errors)) {
             $this->courseset_message = $courseset->toString(true);
             $this->admission_error = MessageBox::error(_("Die Anmeldung war nicht erfolgreich."), $errors);
             foreach ($courseset->getAdmissionRules() as $rule) {
                 $admission_form .= $rule->getInput();
             }
             if ($admission_form) {
                 $this->admission_form = $admission_form;
             }
         } else {
             if ($courseset->isSeatDistributionEnabled()) {
                 if ($courseset->hasAlgorithmRun()) {
                     if ($courseset->getSeatDistributionTime()) {
                         $msg = _("Die Plätze in dieser Veranstaltung wurden automatisch verteilt.");
                     }
                     if (StudipLock::get('enrolment' . $this->course_id)) {
                         $course = Course::find($this->course_id);
                         if ($course->getFreeSeats() && !$course->getNumWaiting()) {
                             $enrol_user = true;
                         } else {
                             if ($course->isWaitlistAvailable()) {
                                 $seminar = new Seminar($course);
                                 if ($seminar->addToWaitlist($user_id, 'last')) {
                                     $msg_details[] = sprintf(_("Alle Plätze sind belegt, Sie wurden daher auf Platz %s der Warteliste gesetzt."), $maxpos);
                                 }
                             } else {
                                 $this->admission_error = MessageBox::error(_("Die Anmeldung war nicht erfolgreich. Alle Plätze sind belegt und es steht keine Warteliste zur Verfügung."));
                             }
                         }
                     } else {
                         $this->admission_error = MessageBox::error(_("Die Anmeldung war wegen technischer Probleme nicht erfolgreich. Bitte versuchen Sie es später noch einmal."));
                     }
                 } else {
                     $msg = _("Die Plätze in dieser Veranstaltung werden automatisch verteilt.");
                     if ($limit = $courseset->getAdmissionRule('LimitedAdmission')) {
                         $msg_details[] = sprintf(_("Diese Veranstaltung gehört zu einem Anmeldeset mit %s Veranstaltungen. Sie können maximal %s davon belegen. Bei der Verteilung werden die von Ihnen gewünschten Prioritäten berücksichtigt."), count($courseset->getCourses()), $limit->getMaxNumber());
                         $this->user_max_limit = $limit->getMaxNumberForUser($user_id);
                         if (get_config('IMPORTANT_SEMNUMBER')) {
                             $order = "ORDER BY VeranstaltungsNummer, Name";
                         } else {
                             $order = "ORDER BY Name";
                         }
                         $this->priocourses = Course::findMany($courseset->getCourses(), $order);
                         $this->user_prio = AdmissionPriority::getPrioritiesByUser($courseset->getId(), $user_id);
                         $this->max_limit = $limit->getMaxNumber();
                         $this->prio_stats = AdmissionPriority::getPrioritiesStats($courseset->getId());
                         $this->already_claimed = count($this->user_prio);
                     } else {
                         $this->priocourses = Course::find($this->course_id);
                         $this->already_claimed = array_key_exists($this->course_id, AdmissionPriority::getPrioritiesByUser($courseset->getId(), $user_id));
                     }
                     $msg_details[] = _("Zeitpunkt der automatischen Verteilung: ") . strftime("%x %X", $courseset->getSeatDistributionTime());
                     $this->num_claiming = count(AdmissionPriority::getPrioritiesByCourse($courseset->getId(), $this->course_id));
                     if ($this->already_claimed) {
                         $msg_details[] = _("Sie sind bereits für die Verteilung angemeldet.");
                     }
                 }
                 $this->courseset_message = MessageBox::info($msg, $msg_details);
             } else {
                 $enrol_user = true;
             }
         }
     } else {
         $enrol_user = true;
     }
     if ($enrol_user) {
         $course = Seminar::GetInstance($this->course_id);
         if ($course->admission_prelim) {
             if (!$course->isStudygroup() && $course->admission_prelim_txt && !Request::submitted('apply')) {
                 $this->admission_prelim_txt = $course->admission_prelim_txt;
                 $this->admission_prelim_comment = Config::get()->ADMISSION_PRELIM_COMMENT_ENABLE;
                 $this->admission_form = $this->render_template_as_string('course/enrolment/prelim');
             } else {
                 if (Request::get('admission_comment')) {
                     $admission_comment = get_fullname() . ': ' . Request::get('admission_comment');
                 } else {
                     $admission_comment = '';
                 }
                 if ($course->addPreliminaryMember($user_id, $admission_comment)) {
                     if ($course->isStudygroup()) {
                         if (StudygroupModel::isInvited($user_id, $this->course_id)) {
                             // an invitation exists, so accept the join request automatically
                             $status = 'autor';
                             StudygroupModel::accept_user(get_username($user_id), $this->course_id);
                             StudygroupModel::cancelInvitation(get_username($user_id), $this->course_id);
                             $success = sprintf(_("Sie wurden in die Veranstaltung %s als %s eingetragen."), $course->getName(), get_title_for_status($status, 1));
                             PageLayout::postMessage(MessageBox::success($success));
                         } else {
                             $success = sprintf(_("Sie wurden auf die Anmeldeliste der Studiengruppe %s eingetragen. Die Moderatoren der Studiengruppe können Sie jetzt freischalten."), $course->getName());
                             PageLayout::postMessage(MessageBox::success($success));
                         }
                     } else {
                         $success = sprintf(_("Sie wurden in die Veranstaltung %s vorläufig eingetragen."), $course->getName());
                         PageLayout::postMessage(MessageBox::success($success));
                     }
                 }
             }
         } else {
             $status = 'autor';
             if ($course->addMember($user_id, $status)) {
                 $success = sprintf(_("Sie wurden in die Veranstaltung %s als %s eingetragen."), $course->getName(), get_title_for_status($status, 1));
                 PageLayout::postMessage(MessageBox::success($success));
                 $this->enrol_user = true;
                 if (StudygroupModel::isInvited($user_id, $this->course_id)) {
                     // delete an existing invitation
                     StudygroupModel::cancelInvitation(get_username($user_id), $this->course_id);
                 }
             }
         }
         unset($this->courseset_message);
     }
     StudipLock::release();
 }
Example #13
0
File: api.php Project: ratbird/hope
 /**
  *
  **/
 public function permissions_action($consumer_id = null)
 {
     if (Request::submitted('store')) {
         $perms = Request::getArray('permission');
         $permissions = RESTAPI\ConsumerPermissions::get($consumer_id ?: 'global');
         foreach ($perms as $route => $methods) {
             foreach ($methods as $method => $granted) {
                 $permissions->set(urldecode($route), urldecode($method), (bool) $granted, true);
             }
         }
         $permissions->store();
         PageLayout::postMessage(MessageBox::success(_('Die Zugriffsberechtigungen wurden erfolgreich gespeichert')));
         $this->redirect($consumer_id ? 'admin/api' : 'admin/api/permissions');
         return;
     }
     $title = $consumer_id ? _('Zugriffsberechtigungen') : _('Globale Zugriffsberechtigungen');
     $title .= ' - ' . PageLayout::getTitle();
     PageLayout::setTitle($title);
     $this->consumer_id = $consumer_id;
     $this->router = RESTAPI\Router::getInstance();
     $this->routes = $this->router->getRoutes(true, false);
     $this->permissions = RESTAPI\ConsumerPermissions::get($consumer_id ?: 'global');
     $this->global = $consumer_id ? RESTAPI\ConsumerPermissions::get('global') : false;
 }
Example #14
0
                $icon = is_string($row['icon']) ? Icon::create2(str_replace('/black/', '/blue/', $row['icon'])) : $row['icon'];
                $widget->addElement(new InfoboxElement($row['text'], $icon));
            }
        }
        $sidebar->addWidget($widget);
    }
    unset($infobox);
}
?>
<!DOCTYPE html>
<html class="no-js">
<head>
    <meta charset="WINDOWS-1252">
    <title>
      <?php 
echo htmlReady(PageLayout::getTitle() . ' - ' . $GLOBALS['UNI_NAME_CLEAN']);
?>
    </title>
    <?php 
// needs to be included in lib/include/html_head.inc.php as well
include 'app/views/WysiwygHtmlHeadBeforeJS.php';
?>
    <?php 
echo PageLayout::getHeadElements();
?>

    <script src="<?php 
echo URLHelper::getScriptLink('dispatch.php/localizations/' . $_SESSION['_language']);
?>
"></script>
Example #15
0
if ($perm->have_perm('admin')) {
    if (Navigation::hasItem('/browse/my_courses/list')) {
        Navigation::activateItem('/browse/my_courses/list');
    }
} else {
    if (Navigation::hasItem('/course/admin/main/archive')) {
        Navigation::activateItem('/course/admin/main/archive');
    }
}

PageLayout::setTitle(_("Archivieren von Veranstaltungen"));

//Change header_line if open object
if ($SessSemName[1]) {
    PageLayout::setTitle(getHeaderLine($SessSemName[1]) . " - " . PageLayout::getTitle());
}
// single delete (a Veranstaltung is open)
if ($SessSemName[1]) {
    $archiv_sem[] = "_id_" . $SessSemName[1];
    $archiv_sem[] = "on";
}
if (!is_array($archiv_sem)) {
    $archiv_sem = Request::quotedArray('archiv_sem');
}
// Handlings....
// Kill current list and stuff

if (Request::option('new_session'))
    $_SESSION['archiv_assi_data'] = array();
Example #16
0
 /**
  * Show dialog to enter a comment for this user
  * @param String $user_id
  * @throws AccessDeniedException
  */
 public function add_comment_action($user_id = null)
 {
     // Security Check
     if (!$this->is_tutor) {
         throw new AccessDeniedException();
     }
     $course_member = CourseMember::find(array($this->course_id, $user_id));
     if (!$course_member) {
         $course_member = AdmissionApplication::find(array($user_id, $this->course_id));
     }
     if (is_null($course_member)) {
         throw new Trails_Exception(400);
     }
     $this->comment = $course_member->comment;
     $this->user = User::find($user_id);
     PageLayout::setTitle(sprintf(_('Bemerkung für %s'), $this->user->getFullName()));
     // Output as dialog (Ajax-Request) or as Stud.IP page?
     $this->xhr = Request::isXhr();
     if ($this->xhr) {
         $this->set_layout(null);
         header('X-Title: ' . PageLayout::getTitle());
     } else {
         Navigation::activateItem('/course/members/view');
     }
 }
Example #17
0
        Navigation::activateItem('/course/resources/group_schedule');

        $widget = new ExportWidget();
        $widget->addLink(_('Druckansicht'),
                         URLHelper::getLink('?view=openobject_group_schedule&print_view=1'), Icon::create('print', 'clickable'),
                         array('target' => '_blank'));
        $sidebar->addWidget($widget);
    break;
    case 'view_requests_schedule':
        PageLayout::setTitle(_('Anfragenübersicht eines Raums:') . ' ' . ResourceObject::Factory($_SESSION['resources_data']['resolve_requests_one_res'])->getName());
        Navigation::activateItem('/resources/room_requests/schedule');

        $widget = new ViewsWidget();
        $widget->addLink(_('Semesterplan'),
                         URLHelper::getLink('resources.php?actual_object=' . $_SESSION['resources_data']['resolve_requests_one_res'] . '&quick_view=view_sem_schedule&quick_view_mode=no_nav'),
                         Icon::create('schedule', 'clickable'),
                         array('onclick' => "window.open(this.href, '', 'scrollbars=yes,left=10,top=10,width=1000,height=680,resizable=yes');return false;"));
        $sidebar->addWidget($widget);
    break;
    //default
    default:
        PageLayout::setTitle(_('Übersicht der Ressourcen'));
        Navigation::activateItem('/resources/view/hierarchy');
    break;
}

//general naming of resources management pages
if (!$SessSemName) {
    PageLayout::setTitle(_('Ressourcenverwaltung:') . ' ' . PageLayout::getTitle());
}
Example #18
0
 /**
  * Creates the sidebar.
  */
 private function setupSidebar()
 {
     $sidebar = Sidebar::get();
     $sidebar->setImage('sidebar/plugin-sidebar.png');
     $sidebar->setTitle(PageLayout::getTitle());
     $plusconfig = UserConfig::get($GLOBALS['user']->id)->PLUS_SETTINGS;
     if (!isset($_SESSION['profile_plus'])) {
         if (is_array($plusconfig['profile_plus'])) {
             $_SESSION['profile_plus'] = $plusconfig['profile_plus'];
         } else {
             //$_SESSION['profile_plus']['Kategorie']['Lehrorganisation'] = 1;
             $_SESSION['profile_plus']['Kategorie']['Kommunikation und Zusammenarbeit'] = 1;
             //$_SESSION['profile_plus']['Kategorie']['Aufgaben'] = 1;
             $_SESSION['profile_plus']['Kategorie']['Sonstiges'] = 1;
             //$_SESSION['profile_plus']['Kategorie']['Projekte und Entwicklung'] = 1;
             /*$_SESSION['profile_plus']['Komplex'][1] = 1;
               $_SESSION['profile_plus']['Komplex'][2] = 1;
               $_SESSION['profile_plus']['Komplex'][3] = 1;*/
             $_SESSION['profile_plus']['View'] = 'openall';
             $_SESSION['profile_plus']['displaystyle'] = 'category';
         }
     }
     /*if (Request::Get('Komplex1') != null) $_SESSION['profile_plus']['Komplex'][1] = Request::Get('Komplex1');
       if (Request::Get('Komplex2') != null) $_SESSION['profile_plus']['Komplex'][2] = Request::Get('Komplex2');
       if (Request::Get('Komplex3') != null) $_SESSION['profile_plus']['Komplex'][3] = Request::Get('Komplex3');*/
     if (Request::Get('mode') != null) {
         $_SESSION['profile_plus']['View'] = Request::Get('mode');
     }
     if (Request::Get('displaystyle') != null) {
         $_SESSION['profile_plus']['displaystyle'] = Request::Get('displaystyle');
     }
     $widget = new OptionsWidget();
     $widget->setTitle(_('Kategorien'));
     foreach ($_SESSION['profile_plus']['Kategorie'] as $key => $val) {
         if ($key == 'Sonstiges') {
             continue;
         }
         if (Request::Get(md5('cat_' . $key)) != null) {
             $_SESSION['profile_plus']['Kategorie'][$key] = Request::Get(md5('cat_' . $key));
         }
         $widget->addCheckbox($key, $_SESSION['profile_plus']['Kategorie'][$key], URLHelper::getLink('?', array(md5('cat_' . $key) => 1)), URLHelper::getLink('?', array(md5('cat_' . $key) => 0)));
     }
     if (Request::Get(md5('cat_Sonstiges')) != null) {
         $_SESSION['profile_plus']['Kategorie']['Sonstiges'] = Request::Get(md5('cat_Sonstiges'));
     }
     $widget->addCheckbox(_('Sonstiges'), $_SESSION['profile_plus']['Kategorie']['Sonstiges'], URLHelper::getLink('?', array(md5('cat_Sonstiges') => 1)), URLHelper::getLink('?', array(md5('cat_Sonstiges') => 0)));
     $sidebar->addWidget($widget, "Kategorien");
     /*$widget = new OptionsWidget();
       $widget->setTitle(_('Komplexität'));
       $widget->addCheckbox(_('Standard'), $_SESSION['profile_plus']['Komplex'][1],
           URLHelper::getLink('?', array('Komplex1' => 1)), URLHelper::getLink('?', array('Komplex1' => 0)));
       $widget->addCheckbox(_('Erweitert'), $_SESSION['profile_plus']['Komplex'][2],
           URLHelper::getLink('?', array('Komplex2' => 1)), URLHelper::getLink('?', array('Komplex2' => 0)));
       $widget->addCheckbox(_('Intensiv'), $_SESSION['profile_plus']['Komplex'][3],
           URLHelper::getLink('?', array('Komplex3' => 1)), URLHelper::getLink('?', array('Komplex3' => 0)));
       $sidebar->addWidget($widget, "Komplex");*/
     $widget = new ActionsWidget();
     $widget->setTitle(_("Ansichten"));
     if ($_SESSION['profile_plus']['View'] == 'openall') {
         $widget->addLink(_("Alles zuklappen"), URLHelper::getLink('?', array('mode' => 'closeall')), Icon::create('assessment', 'clickable'));
     } else {
         $widget->addLink(_("Alles aufklappen"), URLHelper::getLink('?', array('mode' => 'openall')), Icon::create('assessment', 'clickable'));
     }
     if ($_SESSION['profile_plus']['displaystyle'] == 'category') {
         $widget->addLink(_("Alphabetische Anzeige ohne Kategorien"), URLHelper::getLink('?', array('displaystyle' => 'alphabetical')), Icon::create('assessment', 'clickable'));
     } else {
         $widget->addLink(_("Anzeige nach Kategorien"), URLHelper::getLink('?', array('displaystyle' => 'category')), Icon::create('assessment', 'clickable'));
     }
     $widget->addLink(_('Alle Inhaltselemente aktivieren'), $this->url_for('profilemodules/reset/true'), Icon::create('accept', 'clickable'));
     $widget->addLink(_('Alle Inhaltselemente deaktivieren'), $this->url_for('profilemodules/reset'), Icon::create('decline', 'clickable'));
     $sidebar->addWidget($widget);
     $plusconfig['profile_plus'] = $_SESSION['profile_plus'];
     UserConfig::get($GLOBALS['user']->id)->store(PLUS_SETTINGS, $plusconfig);
 }
Example #19
0
                <? endif ?>
                </form>
            </td>
        </tr>
    </tbody>
</table>

<div id="sem_type_delete_question_title" style="display: none;"><?php 
echo _("Sicherheitsabfrage");
?>
</div>
<div id="sem_type_delete_question" style="display: none;">
    <p class="info"><?php 
echo _("Wirklich den Veranstaltungstyp löschen?");
?>
</p>
    <input type="hidden" id="sem_type_for_deletion">
    <?php 
echo Studip\LinkButton::create(_("Löschen"), array('onclick' => "STUDIP.admin_sem_class.delete_sem_type(); return false;"));
?>
    <?php 
echo Studip\LinkButton::create(_("Abbrechen"), array('onclick' => "jQuery(this).closest('#sem_type_delete_question').dialog('close'); return false;"));
?>
</div>



<?
$sidebar = Sidebar::Get();
$sidebar->setTitle(PageLayout::getTitle());
$sidebar->setImage('sidebar/plugin-sidebar.png');
                    } elseif ($this instanceof Course_BasicdataController){
                        echo _("Veranstaltung") . '<br>',
                            LinkButton::create(_("Bearbeiten"), $this->url_for('course/basicdata/view/' . $seminar_id));
                    } elseif ($this instanceof Course_RoomRequestsController){
                        echo _("Raumanfragen") . '<br>',
                            LinkButton::create(_("Bearbeiten"), $this->url_for('index/' . $seminar_id));
                    } elseif ($this instanceof Course_PlusController){
                        echo _("Inhaltselemente") . '<br>',
                            LinkButton::create(_("Bearbeiten"), $this->url_for('course/plus/index/' . $seminar_id));
                    } elseif ($this instanceof Course_AdmissionController){
                        echo _("Zugangsberechtigungen") . '<br>',
                            LinkButton::create(_("Bearbeiten"), $this->url_for('course/admission/index/' . $seminar_id));
                    }
                    break;
                default:
                    echo _(PageLayout::getTitle())."<br>";
                    echo  LinkButton::create(_("Bearbeiten"), URLHelper::getLink('', array("range_id" => $seminar_id)));

            }
            echo "</tr>";
        }

        //more Options for visibility changing
            if ($i_page == "admin_visibility.php" || $i_page == "admin_aux.php" || $i_page == "admin_lock.php") {
                ?>
                <tr class="table_footer">
                    <td colspan="<?php 
echo $show_rooms_check == 'on' ? 7 : 6;
?>
" align="right">
                    <?php 
Example #21
0
// +---------------------------------------------------------------------------+
/* ---
 * Mögliche Datenschutz-/Sichtbarkeitsentscheidung: Beim ersten Login wird ein
 * informierender Text mit Entscheidungsmöglichkeit: "Ich will sichtbar sein" oder
 * "Ich will unsichtbar sein" angezeigt.
 *
 * Bei Nutzung dieser Funktion unbedingt die Texte unter locale/de/LC_HELP/visibility_decision.php bzw.
 * locale/en/LC_HELP/visibility_decision.php an die lokalen Verhältnisse anpassen!
 */
if ($GLOBALS['USER_VISIBILITY_CHECK'] && is_object($GLOBALS['user']) && $GLOBALS['user']->id != 'nobody') {
    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')) {
Example #22
0
<h1 class="hide-in-dialog"><?php 
echo PageLayout::getTitle();
?>
</h1>
<? if (!$GLOBALS['perm']->have_perm('root') && ($current_lock_rule['permission'] == 'admin' || $current_lock_rule['permission'] == 'root')) : ?>
    <?php 
echo MessageBox::info(sprintf(_('Die eingestellte Sperrebene "%s" dürfen Sie nicht ändern.'), htmlReady($current_lock_rule['name'])));
?>
<? else : ?>
    <form action="<?php 
echo $controller->link_for('course/management/set_lock_rule');
?>
" method="post" class="studip-form">
        <?php 
echo CSRFProtection::tokenTag();
?>
        <section>
            <select name="lock_sem" id="lock_sem" aria-labelledby="<?php 
echo _('Sperrebene auswählen');
?>
">
                <? foreach ($all_lock_rules as $lock_rule) : ?>
                    <option
                        value="<?php 
echo $lock_rule['lock_id'];
?>
" <?php 
echo $current_lock_rule->id == $lock_rule['lock_id'] ? 'selected' : '';
?>
>
                        <?php 
Example #23
0
            if ($send[0]) {
                $_SESSION['semi_logged_in'] = False;
                head(PageLayout::getTitle());
                printf(_('An %s wurde ein Aktivierungslink geschickt.'), Request::quoted('email1'));
                footer();
            } else {
                head(_('Fehler'), True);
                echo parse_msg($send[1]);
                footer();
                head(PageLayout::getTitle());
                reenter_mail();
                footer();
            }
        } else {
            head(PageLayout::getTitle());
            printf('<b>%s</b>', _('Die eingegebenen E-Mail-Adressen stimmen nicht überein. Bitte überprüfen Sie Ihre Eingabe.'));
            reenter_mail();
            footer();
        }
    } else {
        // this never happens unless someone manipulates urls (or the presented link within the mail is broken)
        head(PageLayout::getTitle());
        echo _('Der Aktivierungsschlüssel, der übergeben wurde, ist nicht korrekt.');
        mail_explain();
        footer();
    }
}
$template = $GLOBALS['template_factory']->open('layouts/base.php');
$template->content_for_layout = ob_get_clean();
echo $template->render();
page_close();
Example #24
0
 /**
  * edit one room requests in a dialog
  */
 public function edit_dialog_action()
 {
     if (Request::isXhr()) {
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
         if ($this->course_id != '-') {
             $this->edit_action();
             $title = PageLayout::getTitle();
         } else {
             $sem_create_data =& $_SESSION['sem_create_data'];
             if (Request::option('new_room_request_type')) {
                 if ($sem_create_data['room_requests'][Request::option('new_room_request_type')] instanceof RoomRequest) {
                     $request = clone $sem_create_data['room_requests'][Request::option('new_room_request_type')];
                 } else {
                     $request = new RoomRequest();
                     $request->seminar_id = '-';
                     $request->user_id = $GLOBALS['user']->id;
                     list($new_type, $id) = explode('_', Request::option('new_room_request_type'));
                     if ($new_type == 'date') {
                         $request->termin_id = Request::option('new_room_request_type');
                     } elseif ($new_type == 'cycle') {
                         $request->metadate_id = Request::option('new_room_request_type');
                     }
                 }
                 $room_request_form_attributes = self::process_form($request, $sem_create_data['sem_turnout']);
                 $this->search_result = $room_request_form_attributes['search_result'];
                 $this->search_by_properties = $room_request_form_attributes['search_by_properties'];
                 $this->admission_turnout = $sem_create_data['sem_turnout'];
                 $this->request = $request;
                 $room_categories = array_values(array_filter(getResourcesCategories(), create_function('$a', 'return $a["is_room"] == 1;')));
                 if (!$request->getCategoryId() && count($room_categories) == 1) {
                     $request->setCategoryId($room_categories[0]['category_id']);
                 }
                 $this->room_categories = $room_categories;
                 $this->new_room_request_type = Request::option('new_room_request_type');
                 $this->is_resources_admin = getGlobalPerms($GLOBALS['user']->id);
                 $title = _("Verwaltung von Raumanfragen");
                 if (Request::submitted('save') || Request::submitted('save_close')) {
                     if ($request->getSettedPropertiesCount() || $request->getResourceId()) {
                         $sem_create_data['room_requests'][Request::option('new_room_request_type')] = $request;
                         $this->request_stored = true;
                         if (Request::submitted('save')) {
                             PageLayout::postMessage(MessageBox::success(_("Die Raumanfrage und gewünschte Raumeigenschaften wurden gespeichert")));
                         }
                     } else {
                         PageLayout::postMessage(MessageBox::error(_("Die Anfrage kann noch nicht gespeichert werden, da Sie mindestens einen Raum oder mindestens eine Eigenschaft (z.B. Anzahl der Sitzplätze) angeben müssen!")));
                     }
                 }
                 $old_request = $sem_create_data['room_requests'][Request::option('new_room_request_type')];
                 if (!is_object($old_request) || $request->category_id != $old_request->category_id || $request->resource_id != $old_request->resource_id || $request->getProperties() != $old_request->getProperties() || $request->comment != $old_request->comment) {
                     PageLayout::postMessage(MessageBox::info(_("Die Änderungen an der Raumanfrage wurden noch nicht gespeichert!")));
                 }
             }
         }
         if (Request::submitted('save_close') && isset($this->request_stored)) {
             return $this->render_json(array('auto_close' => true, 'auto_reload' => $this->request_stored));
         } else {
             $this->render_template('course/room_requests/edit_dialog.php', null);
             $this->flash->discard();
             $content = $this->get_response()->body;
             $this->erase_response();
             return $this->render_json(array('title' => studip_utf8encode($title), 'content' => studip_utf8encode($content)));
         }
     } else {
         return $this->render_text('');
     }
 }
Example #25
0
File: scm.php Project: ratbird/hope
 /**
  * After filter, closes the page.
  *
  * @param String $action Name of the action that has been invoked
  * @param Array  $args   Arguments that were passed to the action method
  */
 public function after_filter($action, $args)
 {
     parent::after_filter($action, $args);
     if (Request::isXhr()) {
         $this->response->add_header('X-Title', PageLayout::getTitle());
     }
     page_close();
 }
Example #26
0
Navigation::activateItem('/course/members/edit_groups');

//get ID, if a object is open
if ($SessSemName[1])
  $range_id = $SessSemName[1];
elseif (Request::option('range_id'))
    $range_id = Request::option('range_id');

URLHelper::bindLinkParam('range_id', $range_id);
URLHelper::setBaseURL($GLOBALS['ABSOLUTE_URI_STUDIP']);

//Change header_line if open object
$header_line = getHeaderLine($range_id);
if ($header_line)
  PageLayout::setTitle($header_line." - ".PageLayout::getTitle());

//Output starts here

// Rechtecheck
$_range_type = get_object_type($range_id);
if ($_range_type != 'sem' || !$perm->have_studip_perm('tutor', $range_id)) {
    echo "</td></tr></table>";
    page_close();
    die;
}

if(LockRules::Check($range_id, 'groups')) {
        $lockdata = LockRules::getObjectRule($range_id);
        $msg = 'error§' . _("Die Gruppen / Funktionen dieser Veranstaltung dürfen nicht verändert werden.").'§';
        if ($lockdata['description']){