Fixes/rewrites
authorRoland Häder <roland@mxchange.org>
Mon, 4 Jul 2011 00:45:40 +0000 (00:45 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 4 Jul 2011 00:45:40 +0000 (00:45 +0000)
inc/functions.php
inc/language/coupon_de.php
inc/modules/admin/what-send_coupon.php

index 7e6e5f8adb8056580c5f65314a41f357a9aa2b69..f539b61a2d36b5f7ec9f9dc6a30c37ff87ad375b 100644 (file)
@@ -266,7 +266,7 @@ function generatePassword ($length = '0', $exclude =  array()) {
 // Generates a human-readable timestamp from the Uni* stamp
 function generateDateTime ($time, $mode = '0') {
        // If the stamp is zero it mostly didn't "happen"
-       if ($time == '0') {
+       if (($time == '0') || (is_null($time))) {
                // Never happend
                return '{--NEVER_HAPPENED--}';
        } // END - if
index 1974e5cacf148abc96ac330c3c027ce00bce5cdf..53b82e28d3663910ec71199a4143050e4e5e70e4 100644 (file)
@@ -57,6 +57,7 @@ addMessages(array(
        'ADMIN_SEND_COUPON' => "Gutschein versenden",
        'ADMIN_SEND_COUPON_POINTS_NOT_ENTERED' => "Bitte geben Sie eine Verg&uuml;tung (in {?POINTS?}) ein.",
        'ADMIN_SEND_COUPON_DESCRIPTION_NOT_ENTERED' => "Bitte geben Sie eine kurze Beschreibung (oder einen Hinweis an Ihre Mitglieder) ein.",
+       'ADMIN_SEND_COUPON_DONE' = "Es wurde ein Gutschein an alle empfangsbereiten Mitglieder versendet.",
 
        // Admin - More
        'ADMIN_LIST_CASHED_COUPONS_TITLE' => "Administrative Auflistung aller Gutscheine",
index 9cf143b81f21d6dca7a0a78058c75913b6a7da56..84309479f8c63f8d0573fcdd9cde9562c6d0a055 100644 (file)
@@ -116,24 +116,27 @@ if (isFormSent()) {
                                // Rember this user for the admin email
                                $adminUserids[] = $userid;
                        } // END - while
+
+                       // Prepare content for template
+                       $content = array(
+                               'userids'            => implode(',', $adminUserids),
+                               'userid_count'       => count($adminUserids),
+                               'coupon_id'          => $couponId,
+                               'points'             => bigintval(postRequestParameter('points')),
+                               'coupon_description' => postRequestParameter('coupon_description'),
+                               'coupon_expired'     => generateDateTime($expirationTime, '0')
+                       );
+
+                       // Send admin notification
+                       sendAdminNotification('{--ADMIN_COUPON_SUBJECT--}', 'admin_coupon_code', $content);
+
+                       // Coupon has been sent
+                       displayMessage('{--ADMIN_SEND_COUPON_DONE--}');
                } else {
                        // No user was found
                        displayMessage('{--ADMIN_SEND_COUPON_USER_404--}');
                }
 
-               // Prepare content for template
-               $content = array(
-                       'userids'            => implode(',', $adminUserids),
-                       'userid_count'       => count($adminUserids),
-                       'coupon_id'          => $couponId,
-                       'points'             => bigintval(postRequestParameter('points')),
-                       'coupon_description' => postRequestParameter('coupon_description'),
-                       'coupon_expired'     => generateDateTime($expirationTime, '0')
-               );
-
-               // Send admin notification
-               sendAdminNotification('{--ADMIN_COUPON_SUBJECT--}', 'admin_coupon_code', $content);
-
                // Free result
                SQL_FREERESULT($result);
        }