Exemplo n.º 1
0
 public function index_action()
 {
     if (Request::isPost() && Request::option("termin_id") && Request::get("topic_title")) {
         $date = new CourseDate(Request::option("termin_id"));
         $seminar_id = $date['range_id'];
         $title = Request::get("topic_title");
         $topic = CourseTopic::findByTitle($seminar_id, $title);
         if (!$topic) {
             $topic = new CourseTopic();
             $topic['title'] = $title;
             $topic['seminar_id'] = $seminar_id;
             $topic['author_id'] = $GLOBALS['user']->id;
             $topic['description'] = "";
             $topic->store();
         }
         $success = $date->addTopic($topic);
         if ($success) {
             PageLayout::postMessage(MessageBox::success(_("Thema wurde hinzugefügt.")));
         } else {
             PageLayout::postMessage(MessageBox::info(_("Thema war schon mit dem Termin verknüpft.")));
         }
     }
     Navigation::activateItem('/course/schedule/dates');
     object_set_visit_module("schedule");
     $this->last_visitdate = object_get_visit(Course::findCurrent()->id, 'schedule');
     $this->dates = Course::findCurrent()->getDatesWithExdates();
     $this->lecturer_count = Course::findCurrent()->countMembersWithStatus('dozent');
 }
Exemplo n.º 2
0
 /**
  * Before filter, set up the page by initializing the session and checking
  * all conditions.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (!Config::Get()->ELEARNING_INTERFACE_ENABLE) {
         throw new AccessDeniedException(_('Elearning-Interface ist nicht aktiviert.'));
     } else {
         $this->elearning_active = true;
     }
     PageLayout::setHelpKeyword('Basis.Ilias');
     PageLayout::setTitle($_SESSION['SessSemName']["header_line"] . " - " . _("Lernmodule"));
     checkObject();
     // do we have an open object?
     checkObjectModule('elearning_interface');
     object_set_visit_module('elearning_interface');
     $this->search_key = Request::get('search_key');
     $GLOBALS['search_key'] = $this->search_key;
     $this->cms_select = Request::quoted('cms_select');
     $GLOBALS['cms_select'] = $this->cms_select;
     $this->open_all = Request::get('open_all');
     $this->close_all = Request::get('close_all');
     $this->new_account_cms = Request::get('new_account_cms');
     $this->module_system_type = Request::get('module_system_type');
     $this->module_id = Request::get('module_id');
     $this->module_type = Request::get('module_type');
     $this->anker_target = Request::get('anker_target');
     $this->seminar_id = $_SESSION['SessSemName'][1];
     $this->rechte = $GLOBALS['perm']->have_studip_perm('tutor', $this->seminar_id);
     if (!isset($GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->new_account_cms])) {
         unset($this->new_account_cms);
     }
     if (!isset($GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->cms_select])) {
         unset($this->cms_select);
     }
     if ($this->seminar_id != $_SESSION['elearning_open_close']["id"]) {
         unset($_SESSION['cache_data']);
         unset($_SESSION['elearning_open_close']);
     }
     if ($this->open_all != "") {
         $_SESSION['elearning_open_close']["all open"] = true;
     } elseif ($this->close_all != "") {
         $_SESSION['elearning_open_close']["all open"] = "";
     }
     $_SESSION['elearning_open_close']["type"] = "seminar";
     $_SESSION['elearning_open_close']["id"] = $this->seminar_id;
     if (Request::get('do_open')) {
         $this->anker_target = Request::get('do_open');
         $_SESSION['elearning_open_close'][Request::get('do_open')] = true;
     } elseif (Request::get('do_close')) {
         $this->anker_target = Request::get('do_close');
         $_SESSION['elearning_open_close'][Request::get('do_close')] = false;
     }
     $this->sidebar = Sidebar::get();
     $this->sidebar->setImage('sidebar/learnmodule-sidebar.png');
     $this->sidebar->setContextAvatar(CourseAvatar::getAvatar($this->seminar_id));
 }
Exemplo n.º 3
0
 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');
 }
Exemplo n.º 4
0
 /**
  * Before filter, set up the page by initializing the session and checking
  * all conditions.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (!Config::Get()->LITERATURE_ENABLE) {
         throw new AccessDeniedException(_('Die Literaturübersicht ist nicht aktiviert.'));
     }
     PageLayout::setHelpKeyword('Basis.Literatur');
     checkObject();
     // do we have an open object?
     checkObjectModule('literature');
     object_set_visit_module('literature');
 }
Exemplo n.º 5
0
 public function create_action($id, $type)
 {
     checkObject();
     checkObjectModule('documents');
     object_set_visit_module('documents');
     if (!$GLOBALS['rechte']) {
         throw new AccessDeniedException();
     }
     PageLayout::setTitle(_('Neuen Ordner erstellen'));
     $options = array();
     $options[md5('new_top_folder')] = _('Namen auswählen oder wie Eingabe') . ' -->';
     $query = "SELECT SUM(1) FROM folder WHERE range_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($id));
     if ($statement->fetchColumn() == 0) {
         $options[$id] = _('Allgemeiner Dateiordner');
     }
     if ($type === 'sem') {
         $query = "SELECT statusgruppe_id AS id, statusgruppen.name AS name\n                      FROM statusgruppen\n                      LEFT JOIN folder ON (statusgruppe_id = folder.range_id)\n                      WHERE statusgruppen.range_id = ? AND folder_id IS NULL\n                      ORDER BY position";
         $statement = DBManager::get()->prepare($query);
         $statement->execute(array($id));
         $statement->setFetchMode(PDO::FETCH_ASSOC);
         foreach ($statement as $row) {
             $options[$row['id']] = sprintf(_('Dateiordner der Gruppe: %s'), $row['name']);
         }
         $issues = array();
         $shown_dates = array();
         $query = "SELECT themen_termine.issue_id, termine.date, folder.name, termine.termin_id, date_typ\n                      FROM termine\n                      LEFT JOIN themen_termine USING (termin_id)\n                      LEFT JOIN folder ON (themen_termine.issue_id = folder.range_id)\n                      WHERE termine.range_id = ? AND folder.folder_id IS NULL\n                      ORDER BY termine.date, name";
         $statement = DBManager::get()->prepare($query);
         $statement->execute(array($id));
         $statement->setFetchMode(PDO::FETCH_ASSOC);
         foreach ($statement as $row) {
             if ($row['name']) {
                 continue;
             }
             $name = sprintf(_('Ordner für %s [%s]'), date('d.m.Y', $row['date']), $GLOBALS['TERMIN_TYP'][$row['date_typ']]['name']);
             if ($row['issue_id']) {
                 if (!$issues[$row['issue_id']]) {
                     $issues[$row['issue_id']] = new Issue(array('issue_id' => $row['issue_id']));
                 }
                 $name .= ', ' . my_substr($issues[$row['issue_id']]->toString(), 0, 20);
                 $option_id = $row['issue_id'];
             } else {
                 $option_id = $row['termin_id'];
             }
             $options[$option_id] = $name;
         }
     }
     $this->options = $options;
     $this->id = $id;
 }
Exemplo n.º 6
0
Arquivo: scm.php Projeto: ratbird/hope
 /**
  * Before filter, set up the page by initializing the session and checking
  * all conditions.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     // open session
     page_open(array('sess' => 'Seminar_Session', 'auth' => 'Seminar_Default_Auth', 'perm' => 'Seminar_Perm', 'user' => 'Seminar_User'));
     // set up user session
     include 'lib/seminar_open.php';
     if (!Config::Get()->SCM_ENABLE) {
         throw new AccessDeniedException(_('Die freien Informationsseiten sind nicht aktiviert.'));
     }
     $GLOBALS['auth']->login_if(Request::get('again') && $GLOBALS['auth']->auth['uid'] == 'nobody');
     $this->priviledged = $GLOBALS['perm']->have_studip_perm('tutor', $GLOBALS['SessSemName'][1]);
     if (Request::isXhr()) {
         $this->set_content_type('text/html;charset=Windows-1252');
     } else {
         $this->set_layout($GLOBALS['template_factory']->open('layouts/base'));
     }
     if (!in_array($action, words('index create edit move delete'))) {
         array_unshift($args, $action);
         $action = 'index';
     }
     if (in_array($action, words('create edit move delete')) && !$this->priviledged) {
         throw new AccessDeniedException();
     }
     if ($GLOBALS['perm']->have_studip_perm('tutor', $GLOBALS['SessSemName'][1])) {
         $widget = new ActionsWidget();
         $widget->addLink(_('Neuen Eintrag anlegen'), URLHelper::getLink('dispatch.php/course/scm/create'), Icon::create('add', 'clickable'))->asDialog();
         Sidebar::get()->addWidget($widget);
     }
     PageLayout::setHelpKeyword('Basis.Informationsseite');
     Navigation::activateItem('/course/scm');
     checkObject();
     // do we have an open object?
     checkObjectModule('scm');
     object_set_visit_module('scm');
     // Set sidebar image
     $sidebar = Sidebar::get();
     $sidebar->setImage('sidebar/info-sidebar.png');
 }
Exemplo n.º 7
0
} elseif ($view == "wikiprintall") {
    printAllWikiPages($SessSemName[1], $SessSemName['header_line']);
    page_close();
    die;
} elseif ($view == "export_pdf") {
    include_once 'lib/classes/exportdocument/ExportPDF.class.php';
    exportWikiPagePDF($keyword, $version);
} elseif ($view == "exportall_pdf") {
    include_once 'lib/classes/exportdocument/ExportPDF.class.php';
    exportAllWikiPagesPDF("all", Request::option('sortby'));
}
checkObject();
// do we have an open object?
checkObjectModule("wiki");
//are we allowed to use this module here?
object_set_visit_module("wiki");
PageLayout::setHelpKeyword("Basis.Wiki");
// Hilfeseite im Hilfewiki
PageLayout::setTitle($SessSemName["header_line"] . " - " . _("Wiki"));
if (in_array(Request::get('view'), words('listnew listall export'))) {
    Navigation::activateItem('/course/wiki/' . $view);
} else {
    Navigation::activateItem('/course/wiki/show');
}
if (Request::option('wiki_comments') == "all") {
    // show all comments
    $show_wiki_comments = "all";
} elseif (Request::option('wiki_comments') == "none") {
    // don't show comments
    $show_wiki_comments = "none";
} else {
Exemplo n.º 8
0
 /**
  * displays a paginated member overview of a studygroup
  *
  * @param string id of a studypgroup
  * @param string page number the current page
  *
  * @return void
  *
  */
 function members_action()
 {
     $id = $_SESSION['SessionSeminar'];
     PageLayout::setTitle(getHeaderLine($_SESSION['SessionSeminar']) . ' - ' . _("Teilnehmende"));
     Navigation::activateItem('/course/members');
     PageLayout::setHelpKeyword('Basis.StudiengruppenBenutzer');
     Request::set('choose_member_parameter', $this->flash['choose_member_parameter']);
     object_set_visit_module('participants');
     $this->last_visitdate = object_get_visit($id, 'participants');
     $sem = Course::find($id);
     $this->anzahl = StudygroupModel::countMembers($id);
     $this->groupname = $sem->getFullname();
     $this->sem_id = $id;
     $this->groupdescription = $sem->beschreibung;
     $this->moderators = $sem->getMembersWithStatus('dozent');
     $this->tutors = $sem->getMembersWithStatus('tutor');
     $this->autors = $sem->getMembersWithStatus('autor');
     $this->accepted = $sem->admission_applicants->findBy('status', 'accepted');
     $this->sem_class = Course::findCurrent()->getSemClass();
     $inviting_search = new SQLSearch("SELECT auth_user_md5.user_id, {$GLOBALS['_fullname_sql']['full_rev']} as fullname, username, perms " . "FROM auth_user_md5 " . "LEFT JOIN user_info ON (auth_user_md5.user_id = user_info.user_id) " . "LEFT JOIN seminar_user ON (auth_user_md5.user_id = seminar_user.user_id AND seminar_user.Seminar_id = '" . addslashes($id) . "') " . "WHERE perms  NOT IN ('root', 'admin') " . "AND " . get_vis_query() . " AND (username LIKE :input OR Vorname LIKE :input " . "OR CONCAT(Vorname,' ',Nachname) LIKE :input " . "OR CONCAT(Nachname,' ',Vorname) LIKE :input " . "OR Nachname LIKE :input OR {$GLOBALS['_fullname_sql']['full_rev']} LIKE :input) " . "ORDER BY fullname ASC", _("Nutzer suchen"), "user_id");
     $this->rechte = $GLOBALS['perm']->have_studip_perm("tutor", $id);
     $actions = new ActionsWidget();
     if ($this->rechte) {
         $mp = MultiPersonSearch::get('studygroup_invite_' . $id)->setLinkText(_('Neue Gruppenmitglieder-/innen einladen'))->setLinkIconPath("")->setTitle(_('Neue Gruppenmitglieder/-innen einladen'))->setExecuteURL($this->url_for('course/studygroup/execute_invite/' . $id, array('view' => Request::get('view'))))->setSearchObject($inviting_search)->addQuickfilter(_('Adressbuch'), User::findCurrent()->contacts->pluck('user_id'))->setNavigationItem('/course/members')->render();
         $element = LinkElement::fromHTML($mp, Icon::create('community+add', 'clickable'));
         $actions->addElement($element);
     }
     if ($this->rechte || $sem->getSemClass()['studygroup_mode']) {
         $actions->addLink(_('Nachricht an alle Gruppenmitglieder verschicken'), $this->url_for('course/studygroup/message/' . $id), Icon::create('mail', 'clickable'), array('data-dialog' => 1));
     }
     if ($actions->hasElements()) {
         Sidebar::get()->addWidget($actions);
     }
     $this->invitedMembers = StudygroupModel::getInvitations($id);
 }
Exemplo n.º 9
0
use Studip\Button, Studip\LinkButton;

require '../lib/bootstrap.php';

ob_start();
page_open(array("sess" => "Seminar_Session",
    "auth" => "Seminar_Auth",
    "perm" => "Seminar_Perm", "" .
    "user" => "Seminar_User"));

include ('lib/seminar_open.php'); // initialise Stud.IP-Session

checkObject();
checkObjectModule('documents');
object_set_visit_module('documents');

// -- here you have to put initialisations for the current page
require_once 'lib/datei.inc.php';
require_once 'lib/msg.inc.php';

$open = Request::option('open');
$close = Request::option('close');
$check_all = Request::option('check_all');

//Switch fuer die Ansichten
URLHelper::bindLinkParam('data', $folder_system_data);
if (Request::option('cmd') == 'tree') {
    URLHelper::removeLinkParam('data');
    $folder_system_data = array();
    $folder_system_data['cmd'] = 'tree';