]> git.mxchange.org Git - mailer.git/commitdiff
Empty module added, 2 internal TODOs closed
authorRoland Häder <roland@mxchange.org>
Mon, 27 Sep 2010 12:35:24 +0000 (12:35 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 27 Sep 2010 12:35:24 +0000 (12:35 +0000)
- Empty module for ext-booking added
- Internal TODOs closed: Rewrite some array elements, rewrite SQL_FETCHROW() to
  SQL_FETCHARRAY()
- TODOs.txt updated

.gitattributes
DOCS/TODOs.txt
inc/extensions/ext-booking.php
inc/loader/load_cache-
inc/modules/member/what-booking.php [new file with mode: 0644]
inc/modules/member/what-transfer.php
templates/de/html/member/member_transfer_row.tpl

index d08344b75d29e99e0915532f1395379b23509b78..554eb648f687e7e6a661c61a2bde3492d2c48dea 100644 (file)
@@ -569,6 +569,7 @@ inc/modules/member/what-bank_withdraw.php -text svneol=unset#text/plain
 inc/modules/member/what-beg.php -text svneol=unset#text/plain
 inc/modules/member/what-beg2.php -text svneol=unset#text/plain
 inc/modules/member/what-bonus.php -text svneol=unset#text/plain
+inc/modules/member/what-booking.php -text svneol=unset#text/plain
 inc/modules/member/what-categories.php -text svneol=unset#text/plain
 inc/modules/member/what-doubler.php -text svneol=unset#text/plain
 inc/modules/member/what-guest.php -text svneol=unset#text/plain
index 3135e5d234d77025913f78ad874dc6419c7a9312..ef407804c629fe421bb3e2fa93f5dd784cd20d40 100644 (file)
@@ -33,7 +33,7 @@
 ./inc/extensions/ext-network.php:37: * @TODO Yoo!Media: What is LayerAd compared to Layer click?            *
 ./inc/extensions/ext-network.php:91:           // @TODO network_type_handle is an internal name and needs documentation
 ./inc/extensions/ext-newsletter.php:218:               // @TODO Move these into configuration
-./inc/extensions/ext-order.php:342:            // @TODO This should be moved out to inc/reset/
+./inc/extensions/ext-order.php:335:            // @TODO This should be moved out to inc/reset/
 ./inc/extensions/ext-rallye.php:329:           // @TODO Move this code into rallye_functions.php
 ./inc/extensions/ext-rallye.php:92:            // @TODO Fix config_rallye_prices to list_rallye_prices
 ./inc/extensions/ext-yoomedia.php:121:         // @TODO Can this be moved into a database table?
@@ -53,7 +53,7 @@
 ./inc/language/de.php:1104:// @TODO Rewrite these three constants
 ./inc/language/de.php:286:     // @TODO Following two are unused?
 ./inc/language/de.php:789:// @TODO Are these constants longer used?
-./inc/language-functions.php:232:      // @TODO These are all valid languages, again hard-coded
+./inc/language-functions.php:241:      // @TODO These are all valid languages, again hard-coded
 ./inc/language-functions.php:44:// @TODO Rewrite all language constants to this function.
 ./inc/language/newsletter_de.php:13: * @TODO This language file is completely out-dated, please do no       *
 ./inc/language/rallye_de.php:13: * @TODO Naming convention not applied for language strings             *
@@ -92,8 +92,8 @@
 ./inc/libs/yoomedia_functions.php:114: $response = YOOMEDIA_QUERY_API('out_textmail.php', true); // @TODO Ask Yoo!Media for test script
 ./inc/load_config.php:75:      // @TODO Rewrite them to avoid this else block
 ./inc/loader/load_cache-extension.php:13: * @TODO Rewrite this whole file to load_cache-extensions.php           *
-./inc/module-functions.php:225:                        // @TODO Nothing helped???
-./inc/module-functions.php:266:                        // @TODO Rewrite this to a filter
+./inc/module-functions.php:267:                        // @TODO Nothing helped???
+./inc/module-functions.php:308:                        // @TODO Rewrite this to a filter
 ./inc/modules/admin/admin-inc.php:262:         // @TODO Rewrite this to $content = SQL_FETCHARRAY()
 ./inc/modules/admin/admin-inc.php:267:                         // @TODO ACL is 'allow'... hmmm
 ./inc/modules/admin/admin-inc.php:333:                                 // @TODO Rewrite this to $content = SQL_FETCHARRAY()
 ./inc/modules/member/what-reflinks.php:52:// @TODO Move this into a filter
 ./inc/modules/member/what-transfer.php:130:                            // @TODO Rewrite this to a filter
 ./inc/modules/member/what-transfer.php:220:                            // @TODO Try to rewrite his to $content = SQL_FETCHARRAY(), see some lines above for two different queries
-./inc/modules/member/what-transfer.php:302:                    // @TODO This should be somehow rewritten to $row = SQL_FETCHARRAY(), see switch() block above for SQL queries
-./inc/modules/member/what-transfer.php:308:                            // @TODO Rewrite: tid->trans_id,stamp->time_trans
 ./inc/modules/member/what-transfer.php:92:                     // @TODO Rewrite this to a filter
 ./inc/modules/member/what-unconfirmed.php:141: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
 ./inc/modules/member/what-unconfirmed.php:206:                         // @TODO This 'userid' cannot be saved because of encapsulated EL code
index 2e530227cea71249dd09200d27794ba6d7c085e3..e201416f831d140cb6715ae067a64aafbbd19bb6 100644 (file)
@@ -63,6 +63,7 @@ switch (getExtensionMode()) {
 `subject` VARCHAR(255) NOT NULL DEFAULT 'missing',
 `mode` ENUM('add','sub') NOT NULL DEFAULT 'add',
 `points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.0000,
+`recorded` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
 INDEX (`userid`),
 PRIMARY KEY (`id`)
 ) TYPE={?_TABLE_TYPE?} COMMENT='Member points booking table'");
index d87464983423895d14f211f665f3abdc287829ba..e8ce4032e5b57cb5f644ee6d42dab7720271380e 100644 (file)
@@ -55,7 +55,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('foo')) && ($GLOBALS['cache_insta
        $add = runFilterChain('sql_admin_extra_data');
 
        // Query the database about this
-       $result = SQL_QUERY('SELECT * FROM `{?_MYSQL_PREFIX?}_table` ORDER BY `some_column` ASC', __FILE__, __LINE__);
+       $result = SQL_QUERY('SELECT * FROM `{?_MYSQL_PREFIX?}_foos` ORDER BY `some_bar` ASC', __FILE__, __LINE__);
        while ($dummy = SQL_FETCHARRAY($result)) {
                // Save row
                $GLOBALS['cache_instance']->addRow($dummy);
diff --git a/inc/modules/member/what-booking.php b/inc/modules/member/what-booking.php
new file mode 100644 (file)
index 0000000..af404ee
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 09/27/2010 *
+ * ===================                          Last change: 09/27/2010 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-booking.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Display logged account bookings                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Geloggte Kontobewegungen anzeigen                *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       die();
+} elseif (!isMember()) {
+       redirectToIndexMemberOnlyModule();
+}
+
+// Add description as navigation point
+addMenuDescription('member', __FILE__);
+
+// [EOF]
+?>
index 0970463dd01cbd3a29bdbf9aacf59276bc16a51d..b5b2ad477255d063c15f57abbf4acf313f994b77 100644 (file)
@@ -123,7 +123,7 @@ switch ($mode) {
                                $TEST_NICK_REC    = $content['recipient']['nickname'];
 
                                // Default is userids for subject line
-                               $SENDER = getMemberId();
+                               $SENDER    = getMemberId();
                                $RECIPIENT = bigintval(postRequestParameter('to_userid'));
 
                                // If nickname is installed we can set the nickname
@@ -131,11 +131,11 @@ switch ($mode) {
                                if (isExtensionActive('nickname')) {
                                        if (($TEST_NICK_SENDER != getMemberId()) && (!empty($TEST_NICK_SENDER))) {
                                                $SENDER = $content['sender']['nickname'];
-                                       }
+                                       } // END - if
 
                                        if (($TEST_NICK_REC != postRequestParameter('to_userid')) && (!empty($TEST_NICK_REC))) {
                                                $RECIPIENT = $content['recipient']['nickname'];
-                                       }
+                                       } // END - if
                                } // END - if
 
                                // Remember transfer reason and fancy date/time in constants
@@ -146,13 +146,13 @@ switch ($mode) {
                                $content['trans_id'] = bigintval(generateRandomCode('10', mt_rand(0, 99999), getMemberId(), postRequestParameter('reason')));
 
                                // Add entries to both tables
-                               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_transfers_in` (`userid`, `from_userid`, `points`, `reason`, `time_trans`, `trans_id`) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP(),'%s')",
+                               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_transfers_in` (`userid`, `from_userid`, `points`, `reason`, `time_trans`, `trans_id`) VALUES (%s,%s,%s,'%s', UNIX_TIMESTAMP(),%s)",
                                        array(bigintval(postRequestParameter('to_userid')), getMemberId(), bigintval(postRequestParameter('points')), postRequestParameter('reason'), $content['trans_id']), __FILE__, __LINE__);
-                               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_transfers_out` (`userid`, `to_userid`, `points`, `reason`, `time_trans`, `trans_id`) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP(),'%s')",
+                               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_transfers_out` (`userid`, `to_userid`, `points`, `reason`, `time_trans`, `trans_id`) VALUES (%s,%s,%s,'%s', UNIX_TIMESTAMP(),%s)",
                                        array(getMemberId(), bigintval(postRequestParameter('to_userid')), bigintval(postRequestParameter('points')), postRequestParameter('reason'), $content['trans_id']), __FILE__, __LINE__);
 
                                // Add points to account *directly* ...
-                               addPointsDirectly('member_transfer', bigintval(postRequestParameter('to_userid')), bigintval(postRequestParameter('points')));
+                               addPointsDirectly('transfer', bigintval(postRequestParameter('to_userid')), bigintval(postRequestParameter('points')));
 
                                // ... and add it to current user's used points
                                subtractPoints('transfer', getMemberId(), postRequestParameter('points'));
@@ -299,26 +299,20 @@ switch ($mode) {
                // Do we have entries?
                if (!SQL_HASZERONUMS($result)) {
                        $OUT = '';
-                       // @TODO This should be somehow rewritten to $row = SQL_FETCHARRAY(), see switch() block above for SQL queries
-                       while (list($tid, $userid, $points, $reason, $stamp) = SQL_FETCHROW($result)) {
-                               // Rewrite points
-                               if ($type == 'OUT') $points = $points . '-';
+                       while ($content = SQL_FETCHARRAY($result)) {
+                               // Rewrite points, out is subtracted
+                               if ($type == 'OUT') {
+                                       $content['points'] = $content['points'] * -1;
+                               } // END - if
 
                                // Prepare content for template
-                               // @TODO Rewrite: tid->trans_id,stamp->time_trans
-                               $row = array(
-                                       'trans_id' => $tid,
-                                       'stamp'    => generateDateTime($stamp, 3),
-                                       'userid'   => $userid,
-                                       'reason'   => $reason,
-                                       'points'   => $points
-                               );
+                               $$content['time_trans'] = generateDateTime($content['time_trans'], 3);
 
                                // Load row template
-                               $OUT .= loadTemplate('member_transfer_row2', true, $row);
+                               $OUT .= loadTemplate('member_transfer_row2', true, $content);
 
                                // Add points and switch color
-                               $totalPoints += $points;
+                               $totalPoints += $content['points'];
                        } // END - while
 
                        // Free memory
index c1874881810e73fc4ad1a4096db76433d9c6bd62..ea95d1cb0ad9d6c2f075249eaca6cf62ff66c812 100644 (file)
@@ -3,7 +3,7 @@
     <div class="transfer_row1">$content[trans_id]</div>
   </td>
   <td class="transfer_row2 {%template,ColorSwitch%} bottom right">
-    <div class="transfer_row2">$content[time]</div>
+    <div class="transfer_row2">$content[time_trans]</div>
   </td>
   <td class="transfer_row3 {%template,ColorSwitch%} bottom right">
     <div class="transfer_row3">$content[party_userid]</div>