Ejemplo n.º 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);
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * common tasks for all actions
  */
 function before_filter(&$action, &$args)
 {
     global $perm;
     parent::before_filter($action, $args);
     $course_id = $args[0];
     $this->course_id = Request::option('cid', $course_id);
     Navigation::activateItem('/course/admin/admission');
     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(403);
     }
     $this->course = Course::find($this->course_id);
     $this->user_id = $GLOBALS['user']->id;
     PageLayout::setHelpKeyword("Basis.VeranstaltungenVerwaltenZugangsberechtigungen");
     PageLayout::setTitle($this->course->getFullname() . " - " . _("Verwaltung von Zugangsberechtigungen"));
     $lockrules = words('admission_turnout admission_type admission_endtime admission_binding passwort read_level write_level admission_prelim admission_prelim_txt admission_starttime admission_endtime_sem admission_disable_waitlist user_domain admission_binding admission_studiengang');
     foreach ($lockrules as $rule) {
         $this->is_locked[$rule] = LockRules::Check($this->course_id, $rule) ? 'disabled readonly' : '';
     }
     if (!SeminarCategories::GetByTypeId($this->course->status)->write_access_nobody) {
         $this->is_locked['write_level'] = 'disabled readonly';
     }
     update_admission($this->course->id);
     PageLayout::addSqueezePackage('admission');
     URLHelper::addLinkParam('return_to_dialog', Request::get('return_to_dialog'));
 }
Ejemplo n.º 3
0
 /**
  * Common tasks for all actions
  *
  * @param String $action Called action
  * @param Array  $args   Possible arguments
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     $course_id = $args[0];
     $this->course_id = Request::option('cid', $course_id);
     if (!get_object_type($this->course_id, array('sem')) || SeminarCategories::GetBySeminarId($this->course_id)->studygroup_mode || !$GLOBALS['perm']->have_studip_perm("tutor", $this->course_id)) {
         throw new Trails_Exception(400);
     }
     PageLayout::addSqueezePackage('raumzeit');
     PageLayout::setHelpKeyword('Basis.VeranstaltungenVerwaltenAendernVonZeitenUndTerminen');
     PageLayout::setTitle(Course::findCurrent()->getFullname() . " - " . _('Blockveranstaltungstermine anlegen'));
 }
Ejemplo n.º 4
0
 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     $course_id = Request::option('cid');
     if (isset($_SESSION['seminar_change_view_' . $course_id])) {
         unset($_SESSION['seminar_change_view_' . $course_id]);
         // Reset simulated view, redirect to administration page.
         $this->redirect(URLHelper::getURL('dispatch.php/course/management'));
     } elseif (get_object_type($course_id, array('sem')) && !SeminarCategories::GetBySeminarId($course_id)->studygroup_mode && in_array($GLOBALS['perm']->get_studip_perm($course_id), words('tutor dozent'))) {
         // Set simulated view, redirect to overview page.
         $_SESSION['seminar_change_view_' . $course_id] = 'autor';
         $this->redirect(URLHelper::getURL('seminar_main.php'));
     } else {
         throw new Trails_Exception(400);
     }
 }
Ejemplo n.º 5
0
 /**
  * Common tasks for all actions
  *
  * @param String $action Called action
  * @param Array  $args   Possible arguments
  */
 public function before_filter(&$action, &$args)
 {
     global $perm;
     $this->current_action = $action;
     parent::before_filter($action, $args);
     $course_id = $args[0];
     $this->course_id = Request::option('cid', $course_id);
     if ($course_id != '-') {
         //Navigation in der Veranstaltung:
         Navigation::activateItem('/course/admin/room_requests');
         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::find($this->course_id)->getFullname() . " - " . _("Verwaltung von Raumanfragen"));
     }
 }
Ejemplo n.º 6
0
 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (Config::Get()->STUDYGROUPS_ENABLE || in_array($action, words('globalmodules savemodules deactivate'))) {
         // args at position zero is always the studygroup-id
         if ($args[0]) {
             if (SeminarCategories::GetBySeminarId($args[0])->studygroup_mode == false) {
                 throw new Exception(_('Dieses Seminar ist keine Studiengruppe!'));
             }
         }
         PageLayout::setTitle(_("Studiengruppe bearbeiten"));
         PageLayout::setHelpKeyword('Basis.Studiengruppen');
         PageLayout::addSqueezePackage('tablesorter');
     } else {
         throw new Exception(_("Die von Ihnen gewählte Option ist im System nicht aktiviert."));
     }
     Sidebar::get()->setImage('sidebar/studygroup-sidebar.png');
 }
Ejemplo n.º 7
0
 /**
  * Enter description here...
  *
  * @param unknown_type $range_id
  * @param unknown_type $object_type
  * @param unknown_type $object_class_hint
  * @return unknown
  */
 public static function getDataFieldEntries($range_id, $object_type = '', $object_class_hint = '')
 {
     if (!$range_id) {
         return false;
         // we necessarily need a range ID
     }
     $parameters = array();
     if (is_array($range_id)) {
         // rangeID may be an array ("classic" rangeID and second rangeID used for user roles)
         $secRangeID = $range_id[1];
         $rangeID = $range_id[0];
         // to keep compatible with following code
         if ('usersemdata' !== $object_type && 'roleinstdata' !== $object_type) {
             $object_type = 'userinstrole';
         }
         $clause1 = "AND sec_range_id= :sec_range_id";
         $parameters[':sec_range_id'] = $secRangeID;
     } else {
         $rangeID = $range_id;
     }
     if (!$object_type) {
         $object_type = get_object_type($rangeID);
     }
     if ($object_type) {
         switch ($object_type) {
             case 'sem':
                 if ($object_class_hint) {
                     $object_class = SeminarCategories::GetByTypeId($object_class_hint);
                 } else {
                     $object_class = SeminarCategories::GetBySeminarId($rangeID);
                 }
                 $clause2 = "object_class = :object_class OR object_class IS NULL";
                 $parameters[':object_class'] = (int) $object_class->id;
                 break;
             case 'inst':
             case 'fak':
                 if ($object_class_hint) {
                     $object_class = $object_class_hint;
                 } else {
                     $query = "SELECT type FROM Institute WHERE Institut_id = ?";
                     $statement = DBManager::get()->prepare($query);
                     $statement->execute(array($rangeID));
                     $object_class = $statement->fetchColumn();
                 }
                 $object_type = "inst";
                 $clause2 = "object_class = :object_class OR object_class IS NULL";
                 $parameters[':object_class'] = (int) $object_class;
                 break;
             case 'roleinstdata':
                 //hmm tja, vermutlich so
                 $clause2 = '1';
                 break;
             case 'user':
             case 'userinstrole':
             case 'usersemdata':
                 $object_class = is_object($GLOBALS['perm']) ? DataField::permMask($GLOBALS['perm']->get_perm($rangeID)) : 0;
                 $clause2 = "((object_class & :object_class) OR object_class IS NULL)";
                 $parameters[':object_class'] = (int) $object_class;
                 break;
         }
         $query = "SELECT a.*, content\n                      FROM datafields AS a\n                      LEFT JOIN datafields_entries AS b\n                        ON (a.datafield_id = b.datafield_id AND range_id = :range_id {$clause1})\n                      WHERE object_type = :object_type AND ({$clause2})\n                      ORDER BY priority";
         $parameters[':range_id'] = $rangeID;
         $parameters[':object_type'] = $object_type;
         $rs = DBManager::get()->prepare($query);
         $rs->execute($parameters);
         $entries = array();
         while ($data = $rs->fetch(PDO::FETCH_ASSOC)) {
             $datafield = DataField::buildExisting($data);
             $entries[$data['datafield_id']] = DataFieldEntry::createDataFieldEntry($datafield, $range_id, $data['content']);
         }
     }
     return $entries;
 }
Ejemplo n.º 8
0
                            . "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");
    $template->set_attribute('search_obj', $search_obj);
    // show the tree-view of the statusgroups
    echo $template->render();


}

// there are no roles yet, so we show some informational text
else {
    $template = $GLOBALS['template_factory']->open('statusgruppen/sem_no_statusgroups');
    $template->set_layout('layouts/base.php');

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

    if (Request::submitted('choosePreset')) {
        $template->set_attribute('role_data', array('name' => Request::quoted('presetName')));
    }

    // no parameters necessary, just display a static page
    echo $template->render();
}

page_close();