示例#1
0
 static function getLockRuleBySemId($sem_id) 
 {
     $stmt = DBManager::get()->prepare("SELECT aux_lock_rule FROM seminare WHERE Seminar_id = ?");
     $stmt->execute(array($sem_id));
     if ($data = $stmt->fetch(PDO::FETCH_ASSOC)) {
         return AuxLockRules::getLockRuleById($data['aux_lock_rule']);
     }
     return NULL;
 }
示例#2
0
 /**
  * Delete a rule, using a modal dialog
  *
  * @param md5 $rule_id
  */
 function delete_action($rule_id)
 {
     $this->flash['delete'] = AuxLockRules::getLockRuleByID($rule_id);
     //sicherheitsabfrage
     if (Request::get('delete') == 1) {
         if (AuxLockRules::deleteLockRule($rule_id)) {
             $this->flash['success'] = _("Die Regel wurde erfolgreich gelöscht!");
         } else {
             $this->flash['error'] = _("Es können nur nicht verwendete Regeln gelöscht werden!");
             unset($this->flash['delete']);
         }
     } elseif (Request::get('back')) {
         unset($this->flash['delete']);
     }
     $this->redirect('admin/specification');
 }
示例#3
0
文件: index.php 项目: ratbird/hope
    $num_dozenten = count($dozenten);
    $show_dozenten = array();
    foreach($dozenten as $dozent) {
        $show_dozenten[] = '<a href="'.URLHelper::getLink("dispatch.php/profile?username="******">'
                            . htmlready($num_dozenten > 10 ? get_fullname($dozent['user_id'], 'no_title_short') : $dozent['fullname'])
                            . '</a>';
    }
    printf("<br><b>%s: </b>%s", get_title_for_status('dozent', $num_dozenten), implode(', ', $show_dozenten));

    ?>
        <br>
        <br>
    <?
        // Ticket #68
        if (!$GLOBALS["perm"]->have_studip_perm('dozent', $course_id)) {
            $rule = AuxLockRules::getLockRuleBySemId($course_id);
            if (isset($rule)) {
                $show = false;
                foreach ((array)$rule['attributes'] as $val) {
                    if ($val == 1) {
                        // Es gibt also Zusatzangaben. Nun noch überprüfen ob der Nutzer diese Angaben schon gemacht hat...
                        $query = "SELECT 1
                                  FROM datafields
                                  LEFT JOIN datafields_entries USING (datafield_id)
                                  WHERE object_type = 'usersemdata' AND sec_range_id = ? AND range_id = ?";
                        $statement = DBManager::get()->prepare($query);
                        $statement->execute(array($course_id, $GLOBALS['user']->id));
                        if (!$statement->fetchColumn()) {
                            $show = true;
                        }
                        break;
        $view_mode;

// clear session data of seminar-assi, otherwise the navigation item "back to seminar" will vanish
$_SESSION['links_admin_data']['assi'] = false;

if ($perm->have_perm('tutor')) {    // Navigationsleiste ab status "Tutor"
    //ob_start();

    require_once 'lib/dates.inc.php';
    require_once 'lib/msg.inc.php';
    require_once 'lib/visual.inc.php';
    require_once 'lib/functions.php';

    $cssSw=new cssClassSwitcher;
    $semester=new SemesterData;
    $aux_rules=new AuxLockRules();
    $all_aux_rules=$aux_rules->getAllLockRules();

    //Einheitliches Auswahlmenu fuer Einrichtungen
    //if (((!$SessSemName[1]) || ($SessSemName["class"] == "sem")) && $list && ($view_mode == "inst")) {
        //Save data back to database and start a connection  - so we avoid some problems with large search results and data is writing back to db too late
        //page_close();
        //if(isset($admin_view)){
        //     URLHelper::bindLinkParam('admin_view',$admin_view);
        //}
        ?>
        <table width="100%" cellspacing=0 cellpadding=0 border=0>
        <?
        if ($msg) {
            echo "<tr> <td class=\"blank\" colspan=2><br>";
            parse_msg ($msg);
示例#5
0
文件: courses.php 项目: ratbird/hope
 /**
  * Show all courses with more options
  */
 public function index_action()
 {
     $this->sem_create_perm = in_array(Config::get()->SEM_CREATE_PERM, array('root', 'admin', 'dozent')) ? Config::get()->SEM_CREATE_PERM : 'dozent';
     // get courses only if institutes available
     $this->actions = $this->getActions();
     $config_my_course_type_filter = $GLOBALS['user']->cfg->MY_COURSES_TYPE_FILTER;
     // Get the view filter
     $this->view_filter = $this->getFilterConfig();
     if (Request::get('sortFlag')) {
         $GLOBALS['user']->cfg->store('MEINE_SEMINARE_SORT_FLAG', Request::get('sortFlag') == 'asc' ? 'DESC' : 'ASC');
     }
     if (Request::option('sortby')) {
         $GLOBALS['user']->cfg->store('MEINE_SEMINARE_SORT', Request::option('sortby'));
     }
     $this->selected_action = $GLOBALS['user']->cfg->MY_COURSES_ACTION_AREA;
     if (is_null($this->selected_action)) {
         $this->selected_action = 1;
     }
     $this->sortby = $GLOBALS['user']->cfg->MEINE_SEMINARE_SORT;
     $this->sortFlag = $GLOBALS['user']->cfg->MEINE_SEMINARE_SORT_FLAG ?: 'ASC';
     $this->courses = $this->getCourses(array('sortby' => $this->sortby, 'sortFlag' => $this->sortFlag, 'view_filter' => $this->view_filter, 'typeFilter' => $config_my_course_type_filter));
     if (in_array('contents', $this->view_filter)) {
         $this->nav_elements = MyRealmModel::calc_nav_elements(array($this->courses));
     }
     // get all available teacher for infobox-filter
     // filter by selected teacher
     $_SESSION['MY_COURSES_LIST'] = array_map(function ($c, $id) {
         return array('Name' => $c['Name'], 'Seminar_id' => $id);
     }, array_values($this->courses), array_keys($this->courses));
     $this->all_lock_rules = new SimpleCollection(array_merge(array(array('name' => '--' . _("keine Sperrebene") . '--', 'lock_id' => 'none')), LockRule::findAllByType('sem')));
     $this->aux_lock_rules = array_merge(array(array('name' => '--' . _("keine Zusatzangaben") . '--', 'lock_id' => 'none')), AuxLockRules::getAllLockRules());
     $sidebar = Sidebar::get();
     $sidebar->setImage("sidebar/seminar-sidebar.png");
     $this->setSearchWiget();
     $this->setInstSelector();
     $this->setSemesterSelector();
     $this->setTeacherWidget();
     $this->setCourseTypeWidget($config_my_course_type_filter);
     $this->setActionsWidget($this->selected_action);
     if ($this->sem_create_perm) {
         $actions = new ActionsWidget();
         $actions->addLink(_('Neue Veranstaltung anlegen'), URLHelper::getLink('dispatch.php/course/wizard'), Icon::create('seminar+add', 'clickable'))->asDialog('size=50%');
         $sidebar->addWidget($actions, 'links');
     }
     $this->setViewWidget($this->view_filter);
     if ($this->sem_create_perm) {
         $params = array();
         if ($GLOBALS['user']->cfg->ADMIN_COURSES_SEARCHTEXT) {
             $params['search'] = $GLOBALS['user']->cfg->ADMIN_COURSES_SEARCHTEXT;
         }
         $export = new ExportWidget();
         $export->addLink(_('Als Excel exportieren'), URLHelper::getLink('dispatch.php/admin/courses/export_csv', $params), Icon::create('file-excel', 'clickable'));
         $sidebar->addWidget($export);
     }
 }