aboutsummaryrefslogtreecommitdiff
path: root/lib/cronjobs/expire_studygroups.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cronjobs/expire_studygroups.class.php')
-rw-r--r--lib/cronjobs/expire_studygroups.class.php53
1 files changed, 0 insertions, 53 deletions
diff --git a/lib/cronjobs/expire_studygroups.class.php b/lib/cronjobs/expire_studygroups.class.php
deleted file mode 100644
index 3ad9b93..0000000
--- a/lib/cronjobs/expire_studygroups.class.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-/**
- * expire_studygroups.class.php - Removes studygroups that have reached their expiration date
- * and also notifies about upcoming expirations to the founders of the studygroups.
- *
- * @author Rasmus Fuhse <fuhse@data-quest.de>
- * @access public
- * @since 6.0
- */
-
-class ExpireStudygroups extends CronJob
-{
-
- public static function getName()
- {
- return _('Studiengruppen abräumen');
- }
-
- public static function getDescription()
- {
- return _('Löscht ablaufende Studiengruppen und benachrichtigt einen Monat vor Ablauf der Studiengruppe über die Löschung.');
- }
-
- public function execute($last_result, $parameters = [])
- {
- $statement = DBManager::get()->prepare("
- SELECT `seminare`.*
- FROM `seminare`
- INNER JOIN `config_values` ON (`config_values`.`range_id` = `seminare`.`Seminar_id` AND `config_values`.`field` = 'STUDYGROUP_EXPIRATION_DATE')
- WHERE `config_values`.`value` >= UNIX_TIMESTAMP()
- ");
- $statement->execute();
- while ($course = Course::buildExisting($statement->fetch(PDO::FETCH_ASSOC))) {
- $course->delete();
- }
-
- //now the notifications
- $messaging = new messaging();
- $statement = DBManager::get()->prepare("
- SELECT `seminare`.*
- FROM `seminare`
- INNER JOIN `config_values` ON (`config_values`.`range_id` = `seminare`.`Seminar_id` AND `config_values`.`field` = 'STUDYGROUP_EXPIRATION_DATE')
- WHERE `config_values`.`value` >= UNIX_TIMESTAMP() - 86400 * 31
- AND `config_values`.`value` < UNIX_TIMESTAMP() - 86400 * 30
- ");
- $statement->execute([
- 'last_time' => $last_result
- ]);
- while ($course = Course::buildExisting($statement->fetch(PDO::FETCH_ASSOC))) {
-
- }
- }
-}