]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/wernis_functions.php
- Introduced generateDateMonthYearSelectionBox() which is suitable for e.g.
[mailer.git] / inc / libs / wernis_functions.php
index 90e88a01e7ffe298f3c3067112999490019b6e3a..1db29a77bbf6f4e95fd77b053987dcfb4e28da7c 100644 (file)
@@ -539,11 +539,20 @@ function doWernisFinishUserRegistration ($challenge, $challengeResponse, $status
 
                // Is the array filled?
                if ((count($return['mapped_data']) > 0) && (empty($return['message']))) {
+                       // Set must-fillout fields
+                       $return['mapped_data'] = runFilterChain('register_must_fillout', $return['mapped_data']);
+
+                       // Add missing elements
+                       $return['mapped_data']['gender'] = NULL;
+                       $return['mapped_data']['birthday_selection'] = generateDayMonthYearSelectionBox($return['mapped_data']['birth_day'], $return['mapped_data']['birth_month'], $return['mapped_data']['birth_year']);
+
                        // Display form
                        loadTemplate('guest_wernis_registration_form', FALSE, $return['mapped_data']);
+
+                       // All fine
                        return TRUE;
                } else {
-                       // Something bad happened
+                       // Something unexpected happened (e.g. no API requests left)
                        displayMessage($return['message']);
                        return FALSE;
                }
@@ -587,7 +596,7 @@ function getWernisMapedDataFromApiByChallenge ($challenge, $status) {
        } // END - if
 
        // Now call "get.php"
-       $response = executeWernisApiGet($rows[0], 'data', 'anrede|vorname|name|strasse|plz|ort|birth_day|birth_month|birth_year|email|werber');
+       $response = executeWernisApiGet($rows[0], 'data', 'vorname|name|strasse|plz|ort|birth_day|birth_month|birth_year|email|werber');
 
        // Was the status okay?
        if (isHttpResponseStatusOkay($response)) {
@@ -602,10 +611,10 @@ function getWernisMapedDataFromApiByChallenge ($challenge, $status) {
 
                /*
                 * Do some checks on the decoded string, it should be a
-                * serialized array with 11 entries (see above
+                * serialized array with 10 entries (see above
                 * executeWernisApiGet() call).
                 */
-               assert(substr($decodedData, 0, 6) == 'a:11:{');
+               assert(substr($decodedData, 0, 6) == 'a:10:{');
                assert(substr($decodedData, -1, 1) == '}');
 
                // The array seems to be fine, unserialize it
@@ -613,7 +622,6 @@ function getWernisMapedDataFromApiByChallenge ($challenge, $status) {
 
                // All mappings WDS66->mailer
                $mappings = array(
-                       'anrede'      => 'gender',
                        'vorname'     => 'surname',
                        'name'        => 'family',
                        'strasse'     => 'street_nr',