Compilation time added, some compileCode() calles removed, ADMIN_WHAT_404 added
[mailer.git] / inc / modules / order.php
index 6fca97ea81416b9ec68112df594fb375f5f30a70..d26647bff32841bc7670dcb4f6053d50a268d982 100644 (file)
@@ -74,7 +74,7 @@ if (empty($URL)) {
        if (SQL_AFFECTEDROWS() == 1) {
                // @TODO Unused: 2,4
                // Load mail again...              0         1          2             3            4         5       6            7
-               $result = SQL_QUERY_ESC("SELECT `subject`, `text`, `receivers`, `payment_id`, `timestamp`, `url`, cat_id`, `target_send` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s AND `sender`=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT `subject`, `text`, `receivers`, `payment_id`, `timestamp`, `url`, `cat_id`, `target_send` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s AND `sender`=%s LIMIT 1",
                        array(bigintval(getRequestElement('order')), getUserId()), __FILE__, __LINE__);
                $content = merge_array($content, SQL_FETCHARRAY($result));
                SQL_FREERESULT($result);
@@ -89,7 +89,6 @@ if (empty($URL)) {
                subtractPoints('order', getUserId(), $usedPoints);
 
                // Compile content
-               $content['block']    = getConfig('max_send');
                $content['payment']  = getPaymentTitlePrice($content['payment_id']);
                $content['category'] = getCategory($content['cat_id']);
 
@@ -100,8 +99,18 @@ if (empty($URL)) {
                // Notify admins about this
                sendAdminNotification(getMessage('ADMIN_NEW_QUEUE'), 'order-admin', $content, getUserId());
 
+               // Create new task
+               createNewTask(
+                       '{--ADMIN_NEW_QUEUE--}',
+                       '<pre>'.loadEmailTemplate('order-admin', $content, getUserId()).'</pre>',
+                       'MEMBER_ORDER',
+                       getUserId(),
+                       0,
+                       false
+               );
+
                // Output back bottom
-               loadTemplate('member_order-back', false);
+               loadTemplate('member_order-back');
        } else {
                // Matching line not found or already 'placed' in send queue
                redirectToUrl('modules.php?module=login');