Skip to content
Snippets Groups Projects
Select Git revision
  • 10256569f3acab959fdeeaccc88b3f6301403e28
  • 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

TimedFolder.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.
    export.php 19.30 KiB
    <?php
    
    /**
     * requests.php - contains Resources_ExportController
     *
     * 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      Moritz Strohm <strohm@data-quest.de>
     * @license     http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
     * @copyright   2017
     * @category    Stud.IP
     * @since       4.1
     */
    
    
    /**
     * Resources_ExportController contains functionality for data export
     * for resources and especially rooms, buildings and locations.
     */
    class Resources_ExportController extends AuthenticatedController
    {
        protected function returnCsvData($data = [], $file_name = '')
        {
            if (!is_array($data)) {
                throw new InvalidArgumentException(
                    'Resources_ExportController::returnCsvData requires an array as parameter!'
                );
            }
            $this->render_csv(
                $data,
                $file_name
            );
        }
    
        protected function returnHtmlData($data = '')
        {
            $this->set_content_type('text/html');
            $this->render_text($data);
        }
    
        public function before_filter(&$action, &$args)
        {
            parent::before_filter($action, $args);
    
            $this->export_type  = Request::get('export_type', 'default');
            $this->export_param = Request::get('export_param', '');
    
            if (Navigation::hasItem('/resources/export')) {
                Navigation::activateItem('/resources/export');
            }
        }
    
        public function select_booking_sources_action($range_with_id = null)
        {
            if (Navigation::hasItem('/resources/export/select_booking_sources')) {
                Navigation::activateItem('/resources/export/select_booking_sources');
            }
            if (
                !ResourceManager::userHasGlobalPermission(User::findCurrent())
                && !ResourceManager::userHasResourcePermissions(User::findCurrent(), 'user')
            ) {
                throw new AccessDeniedException();
            }
    
            $this->available_rooms = [];
            $this->available_clipboards = [];