From d0911bbc9929a4d09ee5b0d1d111fad9a27bce3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michaela=20Br=C3=BCckner?= Date: Tue, 2 Jan 2024 09:02:08 +0000 Subject: Neuentwicklung der Exporte closes StEP #1959 Closes #1959, #3451, #3424, #3435, #3454, #3455, and #3456 Merge request studip/studip!2212 --- app/controllers/admin/courses.php | 31 +- app/controllers/admin/user.php | 78 ++ app/controllers/course/grouping.php | 2 - app/controllers/course/members.php | 90 +- app/controllers/course/statusgroups.php | 105 ++- app/controllers/institute/members.php | 79 +- app/controllers/studip_controller.php | 36 + app/views/admin/courses/batch_export_members.php | 9 + app/views/admin/user/batch_export_members.php | 42 + composer.json | 3 +- composer.lock | 503 +++++++++-- .../classes/EvaluationExportManager.class.php | 2 - lib/export/csv-p-1.xsl | 96 --- lib/export/csv-p-2.xsl | 72 -- lib/export/csv-t-1.xsl | 194 ----- lib/export/csv-t-2.xsl | 194 ----- lib/export/csv-t-3.xsl | 189 ----- lib/export/csv-v-1.xsl | 120 --- lib/export/csv-v-2.xsl | 66 -- lib/export/export_choose_xslt.inc.php | 244 ------ lib/export/export_config.inc.php | 42 - lib/export/export_linking_func.inc.php | 222 ----- lib/export/export_run_fop.inc.php | 132 --- lib/export/export_run_xslt.inc.php | 219 ----- lib/export/export_start.inc.php | 137 --- lib/export/export_studipdata_func.inc.php | 923 --------------------- lib/export/export_tmp_gc.inc.php | 64 -- lib/export/export_view.inc.php | 110 --- lib/export/export_xml.inc.php | 167 ---- lib/export/export_xml_func.inc.php | 162 ---- lib/export/export_xml_vars.inc.php | 118 --- lib/export/export_xslt_vars.inc.php | 190 ----- lib/export/html-t-1.xsl | 116 --- lib/export/html-v-4.xsl | 380 --------- lib/export/html-vp-1.xsl | 478 ----------- lib/export/html-vp-2.xsl | 473 ----------- lib/export/html-vp-3.xsl | 265 ------ lib/export/oscar.php | 40 - lib/export/pdf-v-3.xsl | 422 ---------- lib/export/pdf-v-4.xsl | 401 --------- lib/export/pdf-vp-1.xsl | 406 --------- lib/export/pdf-vp-2.xsl | 504 ----------- lib/export/rtf-t-1.xsl | 85 -- lib/export/rtf-t-2.xsl | 73 -- lib/export/rtf-t-3.xsl | 79 -- lib/export/rtf-v-4.xsl | 231 ------ lib/export/rtf-vp-1.xsl | 264 ------ lib/export/rtf-vp-2.xsl | 195 ----- lib/export/rtf-vp-3.xsl | 293 ------- lib/export/txt-v-3.xsl | 151 ---- lib/export/txt-vp-1.xsl | 202 ----- lib/export/txt-vp-2.xsl | 194 ----- lib/functions.php | 12 + lib/models/CourseMember.class.php | 75 ++ lib/navigation/BrowseNavigation.php | 7 +- lib/navigation/StartNavigation.php | 4 - public/eval_summary.php | 2 - public/eval_summary_export.php | 3 - public/export.php | 154 ---- public/show_bereich.php | 43 - 60 files changed, 926 insertions(+), 9267 deletions(-) create mode 100644 app/views/admin/courses/batch_export_members.php create mode 100644 app/views/admin/user/batch_export_members.php delete mode 100644 lib/export/csv-p-1.xsl delete mode 100644 lib/export/csv-p-2.xsl delete mode 100644 lib/export/csv-t-1.xsl delete mode 100644 lib/export/csv-t-2.xsl delete mode 100644 lib/export/csv-t-3.xsl delete mode 100644 lib/export/csv-v-1.xsl delete mode 100644 lib/export/csv-v-2.xsl delete mode 100644 lib/export/export_choose_xslt.inc.php delete mode 100644 lib/export/export_config.inc.php delete mode 100644 lib/export/export_linking_func.inc.php delete mode 100644 lib/export/export_run_fop.inc.php delete mode 100644 lib/export/export_run_xslt.inc.php delete mode 100644 lib/export/export_start.inc.php delete mode 100644 lib/export/export_studipdata_func.inc.php delete mode 100644 lib/export/export_tmp_gc.inc.php delete mode 100644 lib/export/export_view.inc.php delete mode 100644 lib/export/export_xml.inc.php delete mode 100644 lib/export/export_xml_func.inc.php delete mode 100644 lib/export/export_xml_vars.inc.php delete mode 100644 lib/export/export_xslt_vars.inc.php delete mode 100644 lib/export/html-t-1.xsl delete mode 100644 lib/export/html-v-4.xsl delete mode 100644 lib/export/html-vp-1.xsl delete mode 100644 lib/export/html-vp-2.xsl delete mode 100644 lib/export/html-vp-3.xsl delete mode 100644 lib/export/oscar.php delete mode 100644 lib/export/pdf-v-3.xsl delete mode 100644 lib/export/pdf-v-4.xsl delete mode 100644 lib/export/pdf-vp-1.xsl delete mode 100644 lib/export/pdf-vp-2.xsl delete mode 100644 lib/export/rtf-t-1.xsl delete mode 100644 lib/export/rtf-t-2.xsl delete mode 100644 lib/export/rtf-t-3.xsl delete mode 100644 lib/export/rtf-v-4.xsl delete mode 100644 lib/export/rtf-vp-1.xsl delete mode 100644 lib/export/rtf-vp-2.xsl delete mode 100644 lib/export/rtf-vp-3.xsl delete mode 100644 lib/export/txt-v-3.xsl delete mode 100644 lib/export/txt-vp-1.xsl delete mode 100644 lib/export/txt-vp-2.xsl delete mode 100644 public/export.php diff --git a/app/controllers/admin/courses.php b/app/controllers/admin/courses.php index 46515b7..04c2b07 100644 --- a/app/controllers/admin/courses.php +++ b/app/controllers/admin/courses.php @@ -226,7 +226,7 @@ class Admin_CoursesController extends AuthenticatedController } $export = new ExportWidget(); $export->addLink( - _('Als Excel exportieren'), + _('Als CSV-Datei exportieren'), URLHelper::getURL('dispatch.php/admin/courses/export_csv', $params), Icon::create('file-excel') )->asDialog('size=auto'); @@ -461,6 +461,16 @@ class Admin_CoursesController extends AuthenticatedController 'data-dialog' => 'size=big' ]); break; + case 22: //Mehrfachzuordnung Studienbereiche + $data['buttons_top'] = ''; + $data['buttons_bottom'] = (string) \Studip\Button::createAccept( + _('Teilnehmendenexport'), 'batch_export_members', + [ + 'formaction' => URLHelper::getURL('dispatch.php/admin/user/batch_export_members'), + 'data-dialog' => 'size=big' + ]); + break; default: foreach (PluginManager::getInstance()->getPlugins('AdminCourseAction') as $plugin) { if ($GLOBALS['user']->cfg->MY_COURSES_ACTION_AREA === get_class($plugin)) { @@ -756,6 +766,16 @@ class Admin_CoursesController extends AuthenticatedController $template->course = $course; $d['action'] = $template->render(); break; + case 22: //Masssenexport Teilnehmendendaten + $template = $tf->open('admin/courses/batch_export_members'); + $template->course = $course; + $d['action'] = $template->render(); + break; + case 22: //Masssenexport Teilnehmendendaten + $template = $tf->open('admin/courses/batch_export_members'); + $template->course = $course; + $d['action'] = $template->render(); + break; default: foreach (PluginManager::getInstance()->getPlugins('AdminCourseAction') as $plugin) { if ($GLOBALS['user']->cfg->MY_COURSES_ACTION_AREA === get_class($plugin)) { @@ -1342,6 +1362,15 @@ class Admin_CoursesController extends AuthenticatedController 'multimode' => true, 'partial' => 'batch_assign_semtree.php' ], + 22 => [ + 'name' => _('Teilnehmendenexport'), + 'title' => _('Teilnehmendenexport'), + 'url' => 'dispatch.php/admin/user/batch_export_members', + 'dialogform' => true, + 'multimode' => true, + 'partial' => 'batch_export_members.php' + + ], ]; if (!$GLOBALS['perm']->have_perm('admin')) { diff --git a/app/controllers/admin/user.php b/app/controllers/admin/user.php index 74daee1..f7bf81a 100644 --- a/app/controllers/admin/user.php +++ b/app/controllers/admin/user.php @@ -15,6 +15,11 @@ * @package admin * @since 2.1 */ + +use PhpOffice\PhpSpreadsheet\Spreadsheet; +use PhpOffice\PhpSpreadsheet\Writer\Csv; +use PhpOffice\PhpSpreadsheet\Writer\Xlsx; + require_once 'vendor/email_message/blackhole_message.php'; require_once 'lib/statusgruppe.inc.php'; @@ -1613,6 +1618,79 @@ class Admin_UserController extends AuthenticatedController $this->redirect($this->show_user_coursesURL($user)); } + public function batch_export_members_action() + { + PageLayout::setTitle(_('Teilnehmendendaten exportieren')); + + $courseIds = Request::optionArray('export_members'); + $order = Config::get()->IMPORTANT_SEMNUMBER + ? "ORDER BY `start_time` DESC, `VeranstaltungsNummer`, `Name`" + : "ORDER BY `start_time` DESC, `Name`"; + $this->courses = array_filter( + Course::findMany($courseIds, $order), + function (Course $course): bool { + /* + * Check if sem_tree entries are allowed and may be changed and remove all courses + * where this is not the case. + */ + return !LockRules::Check($course->id, 'sem_tree', 'sem') + && $course->getSemClass()['bereiche']; + } + ); + + // check if at least one course was selected (this can only happen from admin courses overview): + if (count($this->courses) === 0) { + PageLayout::postWarning('Es wurde keine Veranstaltung gewählt.'); + $this->relocate('admin/courses'); + } + + } + + /* + * Export member data of all selected courses + */ + public function do_batch_export_action() + { + CSRFProtection::verifyUnsafeRequest(); + + if (Request::submitted('xlsx')) { + $export_format = 'xlsx'; + } else if (Request::submitted('csv')) { + $export_format = 'csv'; + } else { + PageLayout::postError('Nicht unterstütztes Exportformat.'); + $this->relocate('admin/courses'); + } + + $tmp_folder = $GLOBALS['TMP_PATH'] . '/temp_folder_' . md5(uniqid()); + mkdir($tmp_folder); + + $courses = Course::findMany(Request::optionArray('courses')); + + foreach ($courses as $course) { + $header = ['Status', 'Anrede', 'Titel', 'Vorname', 'Nachname', 'Titel nachgestellt', 'Benutzername', 'Adresse', 'Telefonnr.', + 'E-Mail', 'Anmeldedatum', 'Matrikelnummer', 'Studiengänge']; + $members = CourseMember::getMemberDataByCourse($course->seminar_id); + + foreach ($members as &$member) { + $member['Anmeldedatum'] = $member['Anmeldedatum'] ? date('d.m.Y', $member['Anmeldedatum']) : _('unbekannt'); + unset($member['user_id']); + } + + $filename = FileManager::cleanFileName('Teilnehmendenexport ' . $course->Name . '.' . $export_format); + $filepath = $tmp_folder . '/'. $filename; + + $this->render_spreadsheet($header, $members, $export_format, $filename, $filepath); + + } + $archive_file_path = $GLOBALS['TMP_PATH'] . '/archiv.zip'; + $archive_filename = 'Export_Teilnehmendendaten.zip'; + FileArchiveManager::createArchiveFromPhysicalFolder($tmp_folder, $archive_file_path); + rmdirr($tmp_folder); + $this->render_temporary_file($archive_file_path, $archive_filename, 'application/zip'); + } + + /** * Init sidebar */ diff --git a/app/controllers/course/grouping.php b/app/controllers/course/grouping.php index 526217f..5202967 100644 --- a/app/controllers/course/grouping.php +++ b/app/controllers/course/grouping.php @@ -13,8 +13,6 @@ * @package admin */ -require_once 'lib/export/export_studipdata_func.inc.php'; // Funktionne für den Export -require_once 'lib/export/export_linking_func.inc.php'; /** * @addtogroup notifications diff --git a/app/controllers/course/members.php b/app/controllers/course/members.php index 6cf3b92..5f5a859 100644 --- a/app/controllers/course/members.php +++ b/app/controllers/course/members.php @@ -16,9 +16,10 @@ */ require_once 'lib/messaging.inc.php'; //Funktionen des Nachrichtensystems -require_once 'lib/export/export_studipdata_func.inc.php'; // Funktionne für den Export -require_once 'lib/export/export_linking_func.inc.php'; +use PhpOffice\PhpSpreadsheet\Spreadsheet; +use PhpOffice\PhpSpreadsheet\Writer\Csv; +use PhpOffice\PhpSpreadsheet\Writer\Xlsx; class Course_MembersController extends AuthenticatedController { @@ -1655,35 +1656,21 @@ class Course_MembersController extends AuthenticatedController if (Config::get()->EXPORT_ENABLE) { $widget = $sidebar->addWidget(new ExportWidget()); - // create csv-export link - $csvExport = export_link( - $this->course_id, - 'person', - sprintf('%s %s', $this->status_groups['autor'], $this->course_title), - 'csv', - 'csv-teiln', - '', - _('Liste als csv-Dokument exportieren'), - 'passthrough' - ); - $widget->addLinkFromHTML( - $csvExport, + $widget->addLink( + _('Als Excel-Datei exportieren'), + URLHelper::getURL('dispatch.php/course/members/export', [ + 'course_id' => $this->course_id, + 'format' => 'xlsx', + ]), Icon::create('export') ); - // create csv-export link - $rtfExport = export_link( - $this->course_id, - 'person', - sprintf('%s %s', $this->status_groups['autor'], $this->course_title), - 'rtf', - 'rtf-teiln', - '', - _('Liste als rtf-Dokument exportieren'), - 'passthrough' - ); - $widget->addLinkFromHTML( - $rtfExport, + $widget->addLink( + _('Als CSV-Datei exportieren'), + URLHelper::getURL('dispatch.php/course/members/export', [ + 'course_id' => $this->course_id, + 'format' => 'csv', + ]), Icon::create('export') ); @@ -1763,38 +1750,27 @@ class Course_MembersController extends AuthenticatedController } } - public function export_members_csv_action() + public function export_action() { - if (!$this->is_tutor) { - throw new AccessDeniedException(); + $export_format = Request::get('format'); + + if ($export_format !== 'csv' && $export_format !== 'xlsx') { + throw new Exception('Wrong format'); } - $filtered_members = CourseMember::getMembers($this->sort_status, $this->sort_by . ' ' . $this->order); - $filtered_members = array_merge( - $filtered_members, - AdmissionApplication::getAdmissionMembers( - $this->course_id, - $this->sort_status, - $this->sort_by . ' ' . $this->order ) - ); - $dozenten = $filtered_members['dozent']->toArray('user_id username vorname nachname visible mkdate'); - $tutoren = $filtered_members['tutor']->toArray('user_id username vorname nachname visible mkdate'); - $autoren = $filtered_members['autor']->toArray('user_id username vorname nachname visible mkdate'); - - $header = [_('Titel'), _('Vorname'), _('Nachname'), _('Titel2'), _('Nutzernamen'), _('Privatadr'), _('Privatnr'), _('E-Mail'), _('Anmeldedatum'), _('Studiengänge')]; - $data = [$header]; - foreach ([$dozenten, $tutoren, $autoren] as $usergroup) { - foreach ($usergroup as $dozent) { - $line = [ - '', - $dozent['Vorname'], - $dozent['Nachname'], - '', - $dozent['username'] - ]; - $data[] = $line; - } + + $header = [_('Status'), _('Anrede'), _('Titel'), _('Vorname'), _('Nachname'), _('Titel nachgestellt'), _('Benutzername'), _('Adresse'), _('Telefonnr.'), + _('E-Mail'), _('Anmeldedatum'), _('Matrikelnummer'), _('Studiengänge')]; + $members = CourseMember::getMemberDataByCourse($this->course_id); + + foreach ($members as &$member) { + $member['Anmeldedatum'] = $member['Anmeldedatum'] ? date("d.m.Y", $member['Anmeldedatum']) : _("unbekannt"); + unset($member['user_id']); } - $csv = array_to_csv($data); + + $filename = _('Teilnehmendenexport') . ' ' . $this->course_title . '.' . $export_format; + + $this->render_spreadsheet($header, $members, $export_format, $filename); + $this->render_nothing(); } public function toggle_student_mailing_action($state) diff --git a/app/controllers/course/statusgroups.php b/app/controllers/course/statusgroups.php index a6f6b72..826cd07 100644 --- a/app/controllers/course/statusgroups.php +++ b/app/controllers/course/statusgroups.php @@ -13,9 +13,11 @@ * @since 3.5 */ +use PhpOffice\PhpSpreadsheet\Spreadsheet; +use PhpOffice\PhpSpreadsheet\Writer\Csv; +use PhpOffice\PhpSpreadsheet\Writer\Xlsx; + require_once 'lib/messaging.inc.php'; //Funktionen des Nachrichtensystems -require_once 'lib/export/export_studipdata_func.inc.php'; // Funktionen für den Export -require_once 'lib/export/export_linking_func.inc.php'; class Course_StatusgroupsController extends AuthenticatedController { @@ -253,23 +255,23 @@ class Course_StatusgroupsController extends AuthenticatedController } if (Config::get()->EXPORT_ENABLE) { $export = new ExportWidget(); - // create csv-export link - $csvExport = export_link($this->course_id, 'person', - sprintf('%s %s', _('Gruppenliste'), htmlReady($this->course_title)), - 'csv', 'csv-gruppen', 'status', - _('Als CSV-Dokument exportieren'), - 'passthrough'); - $element = LinkElement::fromHTML($csvExport, Icon::create('export')); - $export->addElement($element); - - // create rtf-export link - $rtfExport = export_link($this->course_id, 'person', - sprintf('%s %s', _('Gruppenliste'), htmlReady($this->course_title)), - 'rtf', 'rtf-gruppen', 'status', - _('Als RTF-Dokument exportieren'), - 'passthrough'); - $element = LinkElement::fromHTML($rtfExport, Icon::create('export')); - $export->addElement($element); + $export->addLink( + _('Als Excel-Datei exportieren'), + URLHelper::getURL('dispatch.php/course/statusgroups/export', [ + 'course_id' => $this->course_id, + 'format' => 'xlsx', + ]), + Icon::create('export') + ); + + $export->addLink( + _('Als .csv exportieren'), + URLHelper::getURL('dispatch.php/course/statusgroups/export', [ + 'course_id' => $this->course_id, + 'format' => 'csv', + ]), + Icon::create('export') + ); $sidebar->addWidget($export); } @@ -299,6 +301,71 @@ class Course_StatusgroupsController extends AuthenticatedController } /** + * + */ + public function export_action() + { + $export_format = Request::get('format'); + + if ($export_format !== 'csv' && $export_format !== 'xlsx') { + throw new Exception('Wrong format'); + } + + if (Request::get('institute_id')) { + $institute_id = Request::get('institute_id'); + } + + $header = [_('Gruppe'), _('Titel'), _('Vorname'), _('Nachname'), _('Titel nachgestellt'), _('Nutzername'), + _('Privatadresse'), _('Privatnr.'), _('E-Mail'), _('Anmeldedatum'), _('Studiengänge')]; + + $temp = []; + + $groups = Statusgruppen::findBySeminar_id($this->course_id); + if ($groups) { + foreach ($groups as $group) { + foreach ($group['members'] as $mem) { + $member_data = CourseMember::getMemberDataByCourse($this->course_id, $mem['user_id']); + + foreach ($member_data as &$mem_data) { + $mem_data['Anmeldedatum'] = $mem_data['Anmeldedatum'] ? date('d.m.Y', $mem_data['Anmeldedatum']) : _('unbekannt'); + + if (!isset($temp[$group['name']])) { + $temp[$group['name']] = []; + } + $temp[$group['name']][$mem_data['user_id']] = [ + 'Gruppe' => $group['name'], + 'Titel' => $mem_data['title_front'], + 'Vorname' => $mem_data['Vorname'], + 'Nachname' => $mem_data['Nachname'], + 'Titel nachgestellt' => $mem_data['title_rear'], + 'Nutzername' => $mem_data['title_front'], + 'Privatadresse' => $mem_data['privadr'], + 'Privatnr.' => $mem_data['privatnr'], + 'E-Mail' => $mem_data['Email'], + 'Anmeldedatum' => $mem_data['Anmeldedatum'], + 'Studiengänge' => $mem_data['studiengaenge'], + ]; + } + } + } + } + + $statusgroup_data = []; + + foreach ($temp as $group => $group_members) { + foreach ($group_members as $member) { + $statusgroup_data[] = $member; + } + + } + + $filename = FileManager::cleanFileName(_('Gruppenliste') . ' ' . $this->course_title . '.' . $export_format); + + $this->render_spreadsheet($header, $statusgroup_data, $export_format, $filename); + $this->render_nothing(); + } + + /** * Fetches the members of the given group. * * @param String $group_id the statusgroup to get members for. diff --git a/app/controllers/institute/members.php b/app/controllers/institute/members.php index 99dd0f8..5cbefe2 100644 --- a/app/controllers/institute/members.php +++ b/app/controllers/institute/members.php @@ -7,8 +7,10 @@ * @todo test datafields! */ -require_once 'lib/export/export_studipdata_func.inc.php'; // Funktionen für den Export -require_once 'lib/export/export_linking_func.inc.php'; +use PhpOffice\PhpSpreadsheet\Spreadsheet; +use PhpOffice\PhpSpreadsheet\Writer\Csv; +use PhpOffice\PhpSpreadsheet\Writer\Xlsx; + class Institute_MembersController extends AuthenticatedController { @@ -517,6 +519,56 @@ class Institute_MembersController extends AuthenticatedController return $table_structure; } + public function export_action() + { + $export_format = Request::get('format'); + + if ($export_format !== 'csv' && $export_format !== 'xlsx') { + throw new Exception('Wrong format'); + } + + if (Request::get('institute_id')) { + $institute_id = Request::get('institute_id'); + } + + $inst_sql = "SELECT inst.Name AS institute, fak.Name AS faculty FROM Institute as inst + JOIN Institute as fak ON (inst.fakultaets_id = fak.Institut_id) + WHERE inst.Institut_id = :institut_id"; + $res = DBManager::get()->fetchOne($inst_sql, ['institut_id' => $institute_id]); + $faculty = $res['faculty']; + + $header = [_('Einrichtung'), _('Fakultät'), _('Gruppe'), _('Titel'), _('Vorname'), _('Nachname'), _('Titel nachgestellt'), + _('Telefon'), _('Raum'), _('Sprechzeiten'), _('E-Mail')]; + $members = InstituteMember::findByInstitute($institute_id); + + $sg_sql = "SELECT name FROM statusgruppen as sg + JOIN statusgruppe_user USING (statusgruppe_id) + WHERE user_id = :user_id + AND range_id = :range_id"; + $temp = []; + foreach ($members as $member) { + $res = DBManager::get()->fetchOne($sg_sql, ['user_id' => $member['user_id'], 'range_id' => $institute_id]); + $temp[$member['id']] = [ + 'Einrichtung' => (string) $this->institute->name, + 'Fakultät' => $faculty, + 'Gruppe' => $res['name'], + 'Titel' => $member->title_front, + 'Vorname' => $member->Vorname, + 'Nachname' => $member->Nachname, + 'Titel nachgestellt' => $member->title_rear, + 'Telefon' => $member->Telefon, + 'Raum' => $member->raum, + 'Sprechzeiten' => $member->sprechzeiten, + 'Email' => $member->Email, + ]; + } + + $filename = FileManager::cleanFileName(_('Mitarbeitendenexport') . ' ' . $this->institute->name . ' ' . $faculty . '.' . $export_format); + + $this->render_spreadsheet($header, $temp, $export_format, $filename); + $this->render_nothing(); + } + private function setupSidebar() { $sidebar = Sidebar::get(); @@ -592,11 +644,24 @@ class Institute_MembersController extends AuthenticatedController $sidebar->addWidget($widget); if (Config::get()->EXPORT_ENABLE && $GLOBALS['perm']->have_perm('tutor')) { - $widget = new SidebarWidget(); - $widget->setTitle(_('Export')); - $widget->addElement(new WidgetElement(export_form_sidebar($this->institute->id, - 'person', $this->institute->Name))); - $sidebar->addWidget($widget); + $widget = $sidebar->addWidget(new ExportWidget()); + + $widget->addLink( + _('Als Excel-Datei exportieren'), + URLHelper::getURL('dispatch.php/institute/members/export', [ + 'institute_id' => $this->institute->id, + 'format' => 'xlsx', + ]), + Icon::create('export') + ); + $widget->addLink( + _('Als .csv exportieren'), + URLHelper::getURL('dispatch.php/institute/members/export', [ + 'institute_id' => $this->institute->id, + 'format' => 'csv', + ]), + Icon::create('export') + ); } } diff --git a/app/controllers/studip_controller.php b/app/controllers/studip_controller.php index 7a4da54..06383ec 100644 --- a/app/controllers/studip_controller.php +++ b/app/controllers/studip_controller.php @@ -9,6 +9,10 @@ * the License, or (at your option) any later version. */ +use PhpOffice\PhpSpreadsheet\Spreadsheet; +use PhpOffice\PhpSpreadsheet\Writer\Csv; +use PhpOffice\PhpSpreadsheet\Writer\Xlsx; + require_once 'studip_controller_properties_trait.php'; require_once 'studip_response.php'; @@ -798,6 +802,38 @@ abstract class StudipController extends Trails_Controller } /** + * Export xlsx and csv files via PhpSpreadsheet + * @param $header + * @param $data + * @param $format + * @param $filename + * @param $filepath + * @return void + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception + */ + public function render_spreadsheet($header, $data, $format, $filename, $filepath = null) + { + if ($filepath == null) { + $filepath = 'php://output'; + } + $spreadsheet = new Spreadsheet(); + $activeWorksheet = $spreadsheet->getActiveSheet(); + $activeWorksheet->fromArray($header, NULL, 'A1'); + $activeWorksheet->fromArray($data, NULL, 'A2'); + + $this->set_content_type('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); + $this->response->add_header('Content-Disposition', 'attachment;' . encode_header_parameter('filename', $filename)); + $this->response->add_header('Cache-Control', 'cache, must-revalidate'); + if ($format == 'xlsx') { + $writer = new Xlsx($spreadsheet); + } else if ($format == 'csv') { + $writer = new Csv($spreadsheet); + } + + $writer->save($filepath); + } + + /** * Creates the body element id for this controller a given action. * * @param string $unconsumed_path Unconsumed path to extract action from diff --git a/app/views/admin/courses/batch_export_members.php b/app/views/admin/courses/batch_export_members.php new file mode 100644 index 0000000..703c3bd --- /dev/null +++ b/app/views/admin/courses/batch_export_members.php @@ -0,0 +1,9 @@ + + diff --git a/app/views/admin/user/batch_export_members.php b/app/views/admin/user/batch_export_members.php new file mode 100644 index 0000000..258df5b --- /dev/null +++ b/app/views/admin/user/batch_export_members.php @@ -0,0 +1,42 @@ +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ + getFullname('number-name-semester')) ?> + + + getMembersWithStatus('dozent')) ?>getMembersWithStatus('tutor')) ?>getMembersWithStatus('autor')) ?>
+
+ + + +
+ + + 'close']) ?> +
+
+ diff --git a/composer.json b/composer.json index f64b56e..671d914 100644 --- a/composer.json +++ b/composer.json @@ -62,7 +62,8 @@ "phpowermove/docblock": "^2.0", "ksubileau/color-thief-php": "^2.0", "symfony/polyfill-php82": "^1.28", - "symfony/polyfill-php83": "^1.28" + "symfony/polyfill-php83": "^1.28", + "phpoffice/phpspreadsheet": "^1.19" }, "replace": { "symfony/polyfill-php54": "*", diff --git a/composer.lock b/composer.lock index b078b59..5b69bf8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b39a0d6902b667c47851b3899c5884fc", + "content-hash": "69792b2073d4bfc2b8ba69de88ab068b", "packages": [ { "name": "algo26-matthias/idna-convert", @@ -1173,6 +1173,188 @@ "time": "2021-06-28T04:27:21+00:00" }, { + "name": "maennchen/zipstream-php", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/maennchen/ZipStream-PHP.git", + "reference": "c4c5803cc1f93df3d2448478ef79394a5981cc58" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/c4c5803cc1f93df3d2448478ef79394a5981cc58", + "reference": "c4c5803cc1f93df3d2448478ef79394a5981cc58", + "shasum": "" + }, + "require": { + "myclabs/php-enum": "^1.5", + "php": ">= 7.1", + "psr/http-message": "^1.0", + "symfony/polyfill-mbstring": "^1.0" + }, + "require-dev": { + "ext-zip": "*", + "guzzlehttp/guzzle": ">= 6.3", + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": ">= 7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "ZipStream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paul Duncan", + "email": "pabs@pablotron.org" + }, + { + "name": "Jonatan Männchen", + "email": "jonatan@maennchen.ch" + }, + { + "name": "Jesse Donat", + "email": "donatj@gmail.com" + }, + { + "name": "András Kolesár", + "email": "kolesar@kolesar.hu" + } + ], + "description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.", + "keywords": [ + "stream", + "zip" + ], + "support": { + "issues": "https://github.com/maennchen/ZipStream-PHP/issues", + "source": "https://github.com/maennchen/ZipStream-PHP/tree/2.1.0" + }, + "funding": [ + { + "url": "https://github.com/maennchen", + "type": "github" + }, + { + "url": "https://opencollective.com/zipstream", + "type": "open_collective" + } + ], + "time": "2020-05-30T13:11:16+00:00" + }, + { + "name": "markbaker/complex", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPComplex.git", + "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9", + "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-master", + "phpcompatibility/php-compatibility": "^9.3", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "squizlabs/php_codesniffer": "^3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Complex\\": "classes/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@lange.demon.co.uk" + } + ], + "description": "PHP Class for working with complex numbers", + "homepage": "https://github.com/MarkBaker/PHPComplex", + "keywords": [ + "complex", + "mathematics" + ], + "support": { + "issues": "https://github.com/MarkBaker/PHPComplex/issues", + "source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2" + }, + "time": "2022-12-06T16:21:08+00:00" + }, + { + "name": "markbaker/matrix", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPMatrix.git", + "reference": "728434227fe21be27ff6d86621a1b13107a2562c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c", + "reference": "728434227fe21be27ff6d86621a1b13107a2562c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-master", + "phpcompatibility/php-compatibility": "^9.3", + "phpdocumentor/phpdocumentor": "2.*", + "phploc/phploc": "^4.0", + "phpmd/phpmd": "2.*", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "sebastian/phpcpd": "^4.0", + "squizlabs/php_codesniffer": "^3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Matrix\\": "classes/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@demon-angel.eu" + } + ], + "description": "PHP Class for working with matrices", + "homepage": "https://github.com/MarkBaker/PHPMatrix", + "keywords": [ + "mathematics", + "matrix", + "vector" + ], + "support": { + "issues": "https://github.com/MarkBaker/PHPMatrix/issues", + "source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1" + }, + "time": "2022-12-02T22:17:43+00:00" + }, + { "name": "mishal/iless", "version": "2.2.0", "source": { @@ -1332,6 +1514,66 @@ "time": "2023-02-06T13:44:46+00:00" }, { + "name": "myclabs/php-enum", + "version": "1.7.7", + "source": { + "type": "git", + "url": "https://github.com/myclabs/php-enum.git", + "reference": "d178027d1e679832db9f38248fcc7200647dc2b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/d178027d1e679832db9f38248fcc7200647dc2b7", + "reference": "d178027d1e679832db9f38248fcc7200647dc2b7", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7", + "squizlabs/php_codesniffer": "1.*", + "vimeo/psalm": "^3.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "MyCLabs\\Enum\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP Enum contributors", + "homepage": "https://github.com/myclabs/php-enum/graphs/contributors" + } + ], + "description": "PHP Enum implementation", + "homepage": "http://github.com/myclabs/php-enum", + "keywords": [ + "enum" + ], + "support": { + "issues": "https://github.com/myclabs/php-enum/issues", + "source": "https://github.com/myclabs/php-enum/tree/1.7.7" + }, + "funding": [ + { + "url": "https://github.com/mnapoli", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum", + "type": "tidelift" + } + ], + "time": "2020-11-14T18:14:52+00:00" + }, + { "name": "neomerx/cors-psr7", "version": "v2.0.2", "source": { @@ -2020,6 +2262,110 @@ "time": "2020-10-12T12:39:22+00:00" }, { + "name": "phpoffice/phpspreadsheet", + "version": "1.19.0", + "source": { + "type": "git", + "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", + "reference": "a9ab55bfae02eecffb3df669a2e19ba0e2f04bbf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/a9ab55bfae02eecffb3df669a2e19ba0e2f04bbf", + "reference": "a9ab55bfae02eecffb3df669a2e19ba0e2f04bbf", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-dom": "*", + "ext-fileinfo": "*", + "ext-gd": "*", + "ext-iconv": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "ext-xml": "*", + "ext-xmlreader": "*", + "ext-xmlwriter": "*", + "ext-zip": "*", + "ext-zlib": "*", + "ezyang/htmlpurifier": "^4.13", + "maennchen/zipstream-php": "^2.1", + "markbaker/complex": "^3.0", + "markbaker/matrix": "^3.0", + "php": "^7.2 || ^8.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/simple-cache": "^1.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-master", + "dompdf/dompdf": "^1.0", + "friendsofphp/php-cs-fixer": "^2.18", + "jpgraph/jpgraph": "^4.0", + "mpdf/mpdf": "^8.0", + "phpcompatibility/php-compatibility": "^9.3", + "phpstan/phpstan": "^0.12.82", + "phpstan/phpstan-phpunit": "^0.12.18", + "phpunit/phpunit": "^8.5", + "squizlabs/php_codesniffer": "^3.5", + "tecnickcom/tcpdf": "^6.3" + }, + "suggest": { + "dompdf/dompdf": "Option for rendering PDF with PDF Writer (doesn't yet support PHP8)", + "jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers", + "mpdf/mpdf": "Option for rendering PDF with PDF Writer", + "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer (doesn't yet support PHP8)" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Maarten Balliauw", + "homepage": "https://blog.maartenballiauw.be" + }, + { + "name": "Mark Baker", + "homepage": "https://markbakeruk.net" + }, + { + "name": "Franck Lefevre", + "homepage": "https://rootslabs.net" + }, + { + "name": "Erik Tilt" + }, + { + "name": "Adrien Crivelli" + } + ], + "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine", + "homepage": "https://github.com/PHPOffice/PhpSpreadsheet", + "keywords": [ + "OpenXML", + "excel", + "gnumeric", + "ods", + "php", + "spreadsheet", + "xls", + "xlsx" + ], + "support": { + "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", + "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.19.0" + }, + "time": "2021-10-31T15:09:20+00:00" + }, + { "name": "phpowermove/docblock", "version": "v2.0.1", "source": { @@ -2341,6 +2687,58 @@ "time": "2021-03-05T17:36:06+00:00" }, { + "name": "psr/http-client", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client/tree/master" + }, + "time": "2020-06-29T06:28:15+00:00" + }, + { "name": "psr/http-factory", "version": "1.0.2", "source": { @@ -2613,6 +3011,57 @@ "time": "2021-05-03T11:20:27+00:00" }, { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, + "time": "2017-10-23T01:57:42+00:00" + }, + { "name": "ralouphie/getallheaders", "version": "3.0.3", "source": { @@ -6069,58 +6518,6 @@ "time": "2019-01-08T18:20:26+00:00" }, { - "name": "psr/http-client", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-client.git", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP clients", - "homepage": "https://github.com/php-fig/http-client", - "keywords": [ - "http", - "http-client", - "psr", - "psr-18" - ], - "support": { - "source": "https://github.com/php-fig/http-client/tree/master" - }, - "time": "2020-06-29T06:28:15+00:00" - }, - { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.2", "source": { diff --git a/lib/evaluation/classes/EvaluationExportManager.class.php b/lib/evaluation/classes/EvaluationExportManager.class.php index 890a9a8..0c88e7f 100644 --- a/lib/evaluation/classes/EvaluationExportManager.class.php +++ b/lib/evaluation/classes/EvaluationExportManager.class.php @@ -24,7 +24,6 @@ # Include all required files ================================================ # require_once 'lib/evaluation/evaluation.config.php'; -require_once 'lib/export/export_tmp_gc.inc.php'; require_once EVAL_FILE_EVALDB; require_once EVAL_FILE_ANSWERDB; require_once EVAL_FILE_OBJECT; @@ -250,7 +249,6 @@ class EvaluationExportManager extends AuthorObject { $randomID = StudipObject::createNewID(); $this->filename = $randomID . "." . $this->extension; - export_tmp_gc(); if (!is_dir($GLOBALS['TMP_PATH'])) { return $this->throwError(1, sprintf(_("ExportManager::Das Verzeichnis %s existiert nicht."), $GLOBALS['TMP_PATH'])); } diff --git a/lib/export/csv-p-1.xsl b/lib/export/csv-p-1.xsl deleted file mode 100644 index 7ca6d53..0000000 --- a/lib/export/csv-p-1.xsl +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - -  - Typ; - Name; - Fakultaet; - Gruppe; - Titel; - Vorname; - Name; - Titel2; - Telefon; - Raum; - Sprechzeiten; - E-Mail - - - - - - - - - - - - - - - - - " - - - ";" - - - ";" - - - ";" - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - " - - - - - - - - diff --git a/lib/export/csv-p-2.xsl b/lib/export/csv-p-2.xsl deleted file mode 100644 index d344b3b..0000000 --- a/lib/export/csv-p-2.xsl +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - -  - Gruppe; - Titel; - Vorname; - Name; - Titel2; - Telefon; - E-Mail - - - - - - - - - - - - - - - - - " - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - " - - - - - - - - diff --git a/lib/export/csv-t-1.xsl b/lib/export/csv-t-1.xsl deleted file mode 100644 index 79f5700..0000000 --- a/lib/export/csv-t-1.xsl +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  - Anrede; - Titel; - Vorname; - Nachname; - Titel2; - Nutzernamen; - Privatadr; - Privatnr; - E-Mail; - Anmeldedatum; - Studiengänge; - - - " - - "; - - - - - " - - "; - - - Bemerkung - - - - - - - - - - - - - - - - - - " - - Herr - Frau - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - - ";" - - - - - - - - - - - - " - - - - - - - - - - - - - - - ";" - - - - - - - - - - - - - ";" - - - - - - - - - - - - - - - - - diff --git a/lib/export/csv-t-2.xsl b/lib/export/csv-t-2.xsl deleted file mode 100644 index 53e2eb8..0000000 --- a/lib/export/csv-t-2.xsl +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  - Position; - Anrede; - Titel; - Vorname; - Nachname; - Titel2; - Nutzernamen; - Privatadr; - Privatnr; - E-Mail; - Studiengänge; - - - " - - "; - - - - - " - - "; - - - Bemerkung - - - - - - - - - - - - - - - - - - " - - - - - ";" - - Herr - Frau - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - - ";" - - - - - - - - - - - - " - - - - - - - - - - - - - - - ";" - - - - - - - - - - - - - ";" - - - - - - - - - - - - - - - - - diff --git a/lib/export/csv-t-3.xsl b/lib/export/csv-t-3.xsl deleted file mode 100644 index 7ae2f49..0000000 --- a/lib/export/csv-t-3.xsl +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  - Gruppe; - Titel; - Vorname; - Nachname; - Titel2; - Nutzernamen; - Privatadr; - Privatnr; - E-Mail; - Anmeldedatum; - Studiengänge; - - - " - - "; - - - - - " - - "; - - - - - - - - - - - - - - - - - - - - - " - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - - ";" - - - - - - - - - " - - - - - - - - - - - - - - - ";" - - - - - - - - - - - - - ";" - - - - - - - - - - - - - - - - - diff --git a/lib/export/csv-v-1.xsl b/lib/export/csv-v-1.xsl deleted file mode 100644 index d14f87c..0000000 --- a/lib/export/csv-v-1.xsl +++ /dev/null @@ -1,120 +0,0 @@ - - - - - -  - Einrichtung-Typ; - Einrichtung-Name; - Einrichtung-Fakultaet; - Typ; - Lehrende; - Titel; - Untertitel; - Raum; - Art; - max. Teilnehmende; - ECTS; - Vorbesprechung; - erster Termin; - Termin; - Lernorganisation; - sonstiges - - - - - - - - - - - - - - - - - - " - - - ";" - - - ";" - - - ";" - - - ";" - - - - , - - - - ";" - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - ";" - - - - - " - - - - - - - diff --git a/lib/export/csv-v-2.xsl b/lib/export/csv-v-2.xsl deleted file mode 100644 index d993881..0000000 --- a/lib/export/csv-v-2.xsl +++ /dev/null @@ -1,66 +0,0 @@ - - - - - -  - Typ; - Lehrende; - Titel; - max. Teilnehmende; - ECTS; - Termin - - - - - - - - - - - - - - - - - - " - - - ";" - - - - , - - - - ";" - - - ";" - - - - - ";" - - - - - ";" - - - - - " - - - - - - - diff --git a/lib/export/export_choose_xslt.inc.php b/lib/export/export_choose_xslt.inc.php deleted file mode 100644 index 3bddbc3..0000000 --- a/lib/export/export_choose_xslt.inc.php +++ /dev/null @@ -1,244 +0,0 @@ - - * @access public - * @modulegroup export_modules - * @module export_choose_xslt - * @package Export - */ -// +---------------------------------------------------------------------------+ -// This file is part of Stud.IP -// export_choose_xslt.inc.php -// pages for choosing an xslt-script -// -// Copyright (c) 2002 Arne Schroeder -// Suchi & Berg GmbH -// +---------------------------------------------------------------------------+ -// 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 any later version. -// +---------------------------------------------------------------------------+ -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +---------------------------------------------------------------------------+ - -use Studip\Button, Studip\LinkButton; - -$perm->check('tutor'); - -require_once 'lib/export/export_xslt_vars.inc.php'; // Liste der XSLT-Skripts -require_once 'lib/dates.inc.php'; // Datumsfunktionen - -/** - * Checks given parameters - * - * This function checks the given parameters. If some are missing or refer to a XSL-file that - * doesn't exist it returns false and adds a warning to export_error. - * - * @access public - * @return boolean - */ -function CheckParamXSLT() -{ - global $ex_type, $xml_file_id, $page, $o_mode, $format, $choose, $xslt_files, $export_o_modes, $export_ex_types, $export_error, $export_error_num; - $mod_counter = 0; - $page = (int)$page; - if ($page === 1) { - reset($xslt_files); - foreach ($xslt_files as $val) { - if (!empty($val[$ex_type]) && !empty($val[$format])) { - $mod_counter++; - } - } - if ($mod_counter === 0 && $format !== "xml") { - $export_error .= _("Für dieses Format sind keine Ausgabemodule installiert.
Bitte wählen Sie ein anderes Ausgabeformat.") . "
"; - $page = 0; - } - - if (!$format) { - $page = 0; - } - reset($xslt_files); - } - - if ($page === 2 && !$choose) { - $page = 1; - } - if ( /*($xml_file_id != "") AND */ (in_array($ex_type, $export_ex_types)) && (in_array($o_mode, $export_o_modes))) { - return true; - } - - $export_error .= "" . _("Unzulässiger Seitenaufruf!") . "
"; - $export_error_num++; - return false; -} - -$export_pagename = _("Konvertierung der Daten: "); -$export_pagecontent = ''; -$xslt_filename = mb_strlen(Request::get('xslt_filename')) ? basename(stripslashes(Request::get('xslt_filename'))) : $xslt_filename_default; - -if (!CheckParamXSLT()) { - $export_pagename .= _('Es ist ein Fehler aufgetreten.'); - $export_pagecontent .= MessageBox::error( - _('Die Parameter, mit denen diese Seite aufgerufen wurde, sind fehlerhaft oder unvollständig.') - ); -} - -// Die Seiten 2 und 3 ueberspringen, wenn als Dateiformat XML gewaehlt wurde -if ($format === "xml" && $page === 1) { - $xml_file_id = ""; - $o_mode = "file"; - $page = 3; -// Seite 1 : Auswahl des Dateiformats -} elseif (!isset($page) || $page === 0) { - $export_pagename .= _("Auswahl des Dateiformats"); - - unset($export_msg); - unset($xml_printimage); - unset($xml_printlink); - unset($xml_printdesc); - unset($xml_printcontent); - - $export_info = null; - - $export_pagecontent .= "
"; - $export_pagecontent .= "
" . _("Bitte wählen Sie, in welchem Format die Daten ausgegeben werden sollen!") . ""; - - $export_pagecontent .= CSRFProtection::tokenTag(); - $export_pagecontent .= "
"; - $export_weiter_button = '
' . Button::create('<< ' . _('Zurück'), 'back'); - $export_weiter_button .= Button::create(_('Weiter') . ' >>', 'next') . ""; - - $export_weiter_button .= "
"; -// Seite 2 : Auswahl des XSLT-Scripts -} elseif ($page === 1) { - if (mb_strpos($choose, $format) === false) { - unset($choose); - } - $export_pagename .= _("Auswahl des Ausgabemoduls"); - $export_info = null; - $export_pagecontent .= '
'; - $export_pagecontent .= '
' . _('Ausgabemodul') . ''; - $export_pagecontent .= CSRFProtection::tokenTag(); - $export_pagecontent .= ""; - - $opt_num = 0; - foreach ($xslt_files as $key => $val) { - if (!empty($val[$ex_type]) && !empty($val[$format])) { - $export_pagecontent .= "