Skip to content
Snippets Groups Projects
Select Git revision
  • 0565945451e03b65cdb14be8a210a4d9a2213926
  • main default protected
  • step-3263
  • feature/plugins-cli
  • feature/vite
  • step-2484-peerreview
  • biest/issue-5051
  • tests/simplify-jsonapi-tests
  • fix/typo-in-1a70031
  • feature/broadcasting
  • database-seeders-and-factories
  • feature/peer-review-2
  • feature-feedback-jsonapi
  • feature/peerreview
  • feature/balloon-plus
  • feature/stock-images-unsplash
  • tic-2588
  • 5.0
  • 5.2
  • biest/unlock-blocks
  • biest-1514
21 results

autoinsert.php

Blame
  • Forked from Stud.IP / Stud.IP
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    autoinsert.php 9.50 KiB
    <?php
    /**
     * autu_insert.php - controller class for the auto insert seminars
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License as
     * published by the Free Software Foundation; either version 2 of
     * the License, or (at your option) any later version.
     *
     * @author      Nico Müller <nico.mueller@uni-oldenburg.de>
     * @author      Michael Riehemann <michael.riehemann@uni-oldenburg.de>
     * @license     http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
     * @category    Stud.IP
     * @package     admin
     * @since       2.1
     */
    class Admin_AutoinsertController extends AuthenticatedController
    {
        /**
         * Common tasks for all actions.
         */
        public function before_filter(&$action, &$args)
        {
            parent::before_filter($action, $args);
    
            // user must have root permission
            $GLOBALS['perm']->check('root');
            Navigation::activateItem('/admin/user/auto_insert');
            PageLayout::setTitle(_('Automatisiertes Eintragen verwalten'));
            PageLayout::setHelpKeyword('Admins.AutomatisiertesEintragen');
        }
    
        /**
         * Maintenance view for the auto insert parameters
         *
         */
        public function index_action()
        {
            $this->sem_search = '';
            $this->sem_select = '';
            $this->seminar_search = [];
    
            // search seminars
            if (Request::submitted('suchen')) {
                if (Request::get('sem_search')) {
                    $this->sem_search = Request::get('sem_search');
                    $this->sem_select = Request::option('sem_select');
                    $search = new SeminarSearch();
                    $this->seminar_search = $search->getResults
                        (Request::get('sem_search'),
                        ['search_sem_sem' => Request::option('sem_select')]
                    );
                    if (count($this->seminar_search) == 0) {
                        PageLayout::postInfo(_('Es wurden keine Veranstaltungen gefunden.'));
                    }
                } else {
                    PageLayout::postError(_('Bitte geben Sie einen Suchparameter ein.'));
                }
            }
            $seminare = AutoInsert::getAllSeminars();
            $this->auto_sems = $seminare;
    
            $domains = [];
            $domains[] = [
                'id'   => 'keine',
                'name' => _('Ohne Domäne'),
            ];
            foreach (UserDomain::getUserDomains() as $domain) {
                $domains[] = $domain;
            }