From bcb2917dbe62d29e27f36a5f01b1e2e067d6dd45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fa=C3=9Fbender?= Date: Thu, 10 May 2018 09:55:45 +0200 Subject: [PATCH] Wrong begin date saved if user participate to an event #761 --- adm_program/installation/db_scripts/update_3_3.xml | 1 + adm_program/modules/dates/dates_function.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/adm_program/installation/db_scripts/update_3_3.xml b/adm_program/installation/db_scripts/update_3_3.xml index a53811b4b6..fcd06429d7 100644 --- a/adm_program/installation/db_scripts/update_3_3.xml +++ b/adm_program/installation/db_scripts/update_3_3.xml @@ -106,5 +106,6 @@ ComponentUpdateSteps::updateStepMigrateToStandardMenu ComponentUpdateSteps::updateStepDownloadOrgFolderName UPDATE %PREFIX%_user_fields SET usf_registration = 1 WHERE usf_name_intern IN ('LAST_NAME', 'FIRST_NAME', 'EMAIL') + UPDATE %PREFIX%_members SET mem_begin = '2018-04-01' WHERE mem_begin = '0000-00-00' stop diff --git a/adm_program/modules/dates/dates_function.php b/adm_program/modules/dates/dates_function.php index 3c8da96cbd..c634c14b4b 100644 --- a/adm_program/modules/dates/dates_function.php +++ b/adm_program/modules/dates/dates_function.php @@ -627,6 +627,11 @@ $member->readDataByColumns(array('mem_rol_id' => $date->getValue('dat_rol_id'), 'mem_usr_id' => $getUserId)); $member->setValue('mem_comment', $postUserComment); // Comments will be safed in any case. Maybe it is a documentation afterwards by a leader or admin + if ($member->isNewRecord()) + { + $member->setValue('mem_begin', DATE_NOW); + } + // Now check participants limit and save guests if possible if ($date->getValue('dat_max_members') > 0) {