From 81d4d624bdf79caff709fe9f23bf4d9fd6b90598 Mon Sep 17 00:00:00 2001
From: David Siegfried <david.siegfried@uni-vechta.de>
Date: Mon, 6 May 2024 11:36:19 +0000
Subject: [PATCH] remove obsolet functions, fixes #4002

Closes #4002

Merge request studip/studip!2851
---
 RELEASE-NOTES.md  |  1 +
 lib/functions.php | 58 -----------------------------------------------
 2 files changed, 1 insertion(+), 58 deletions(-)

diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md
index 9f3f8c6ac85..18c0ae68853 100644
--- a/RELEASE-NOTES.md
+++ b/RELEASE-NOTES.md
@@ -18,6 +18,7 @@
 - Die Funktionen `studip_json_encode()` und `studip_json_decode()` wurden entfernt. Stattdessen müssen die Methode `json_encode()` und `json_decode()` verwendet werden. ([Issue #3814](https://gitlab.studip.de/studip/studip/-/issues/3814))
 - Die `MembersModel.php` wurde entfernt ([Issue #3811](https://gitlab.studip.de/studip/studip/-/issues/3811))
 - Die `admission.inc.php` wurde entfernt. ([Issue #3812](https://gitlab.studip.de/studip/studip/-/issues/3812))
+- Die folgenden Funktionen wurden aus der Datei `lib/functions.php` entfernt: `re_sort_dozenten()`, `re_sort_tutoren()` und `get_next_position()` ([Issue #4002](https://gitlab.studip.de/studip/studip/-/issues/4002))
 - Die Methoden `CronjobScheduler::scheduleOnce()` sowie `CronjobTask::scheduleOnce()` wurden ersatzlos entfernt. ([Issue #4078](https://gitlab.studip.de/studip/studip/-/issues/4078))
 - Die folgenden Klassen wurden innerhalb von Stud.IP verschoben. Da sie über den Autoloader geladen werden, kann jedes manuelle Einbinden ersatzlos entfernt werden. ([Issue #4105](https://gitlab.studip.de/studip/studip/-/issues/4105))
   - `AuthenticatedController`
diff --git a/lib/functions.php b/lib/functions.php
index b68658a25ff..0e806aa7f47 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -504,64 +504,6 @@ function check_and_set_date($tag, $monat, $jahr, $stunde, $minute, &$arr, $field
     return $check;
 }
 
-/**
- * reset the order-positions for the lecturers in the passed seminar,
- * starting at the passed position
- *
- * @param string $s_id     the seminar to work on
- * @param int    $position the position to start with
- * @deprecated since Stud.IP 5.3
- *
- * @return void
- */
-function re_sort_dozenten($s_id, $position)
-{
-    $query = "UPDATE seminar_user
-              SET position = position - 1
-              WHERE Seminar_id = ? AND status = 'dozent' AND position > ?";
-    $statement = DBManager::get()->prepare($query);
-    $statement->execute([$s_id, $position]);
-}
-
-/**
- * reset the order-positions for the tutors in the passed seminar,
- * starting at the passed position
- *
- * @param string $s_id     the seminar to work on
- * @param int    $position the position to start with
- * @deprecated since Stud.IP 5.3
- *
- * @return void
- */
-function re_sort_tutoren($s_id, $position)
-{
-    $query = "UPDATE seminar_user
-              SET position = position - 1
-              WHERE Seminar_id = ? AND status = 'tutor' AND position > ?";
-    $statement = DBManager::get()->prepare($query);
-    $statement->execute([$s_id, $position]);
-}
-
-/**
- * return the highest position-number increased by one for the
- * passed user-group in the passed seminar
- *
- * @param string $status     can be on of 'tutor', 'dozent', ...
- * @param string $seminar_id the seminar to work on
- * @deprecated since Stud.IP 5.3
- *
- * @return int  the next available position
- */
-function get_next_position($status, $seminar_id)
-{
-    $query = "SELECT MAX(position) + 1
-              FROM seminar_user
-              WHERE Seminar_id = ? AND status = ?";
-    $statement = DBManager::get()->prepare($query);
-    $statement->execute([$seminar_id, $status]);
-
-    return $statement->fetchColumn() ?: 0;
-}
 
 /**
  * converts a string to a float, depending on the locale
-- 
GitLab