From 5349bf7e4b20c3ff8fb36f0d366770307fd7750e Mon Sep 17 00:00:00 2001 From: Nikolaus Krondraf Date: Thu, 20 Aug 2020 09:16:55 +0200 Subject: [PATCH] =?UTF-8?q?bPk=20kann=20per=20config=20f=C3=BCr=20alle=20B?= =?UTF-8?q?enutzer=20abgefragt=20werden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/vilesci.config-default.inc.php | 3 +++ vilesci/cronjobs/bpk.php | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/config/vilesci.config-default.inc.php b/config/vilesci.config-default.inc.php index 1647cb59a..9654ce79a 100644 --- a/config/vilesci.config-default.inc.php +++ b/config/vilesci.config-default.inc.php @@ -249,4 +249,7 @@ define('BIS_FUNKTIONSCODE_6_ARR', array( 'Team' )); +// bPk Abfrage +define('BPK_FUER_ALLE_BENUTZER_ABFRAGEN', false); + ?> diff --git a/vilesci/cronjobs/bpk.php b/vilesci/cronjobs/bpk.php index 2d26634e3..3a7ac4395 100644 --- a/vilesci/cronjobs/bpk.php +++ b/vilesci/cronjobs/bpk.php @@ -75,7 +75,22 @@ else $webservice = new dvb(DVB_USERNAME, DVB_PASSWORD, $debug); -$qry = " +if (defined('BPK_FUER_ALLE_BENUTZER_ABFRAGEN') && BPK_FUER_ALLE_BENUTZER_ABFRAGEN) +{ + $qry = " + SELECT + distinct person_id, vorname, nachname + FROM + public.tbl_person + JOIN public.tbl_benutzer USING(person_id) + WHERE + public.tbl_benutzer.aktiv = true + AND tbl_person.bpk is null + AND gebdatum is not null"; +} +else +{ + $qry = " SELECT distinct person_id, vorname, nachname FROM @@ -89,6 +104,7 @@ $qry = " AND studiengang_kz<10000 AND EXISTS(SELECT 1 FROM public.tbl_prestudent WHERE person_id=tbl_person.person_id AND bismelden=true) AND gebdatum is not null"; +} if ($limit != '') $qry .= " LIMIT ".$limit;