Countless fixes, ext-grade started:
[mailer.git] / inc / modules / admin / admin-inc.php
index 926c89df177e300c00b5f09d6df844b097e2bd53..82cb196abecc01361e90e739d807cffacc204b56 100644 (file)
@@ -697,7 +697,7 @@ function adminGetMenuMode () {
 
 // Change activation status
 function adminChangeActivationStatus ($IDs, $table, $row, $idRow = 'id') {
-       $count = '0'; $newStatus = 'Y';
+       $count = '0';
        if ((is_array($IDs)) && (count($IDs) > 0)) {
                // "Walk" all through and count them
                foreach ($IDs as $id => $selected) {
@@ -708,7 +708,12 @@ function adminChangeActivationStatus ($IDs, $table, $row, $idRow = 'id') {
                        if (!empty($selected)) {
                                // Determine new status
                                $result = SQL_QUERY_ESC("SELECT %s FROM `{?_MYSQL_PREFIX?}_%s` WHERE %s=%s LIMIT 1",
-                               array($row, $table, $idRow, $id), __FUNCTION__, __LINE__);
+                                       array(
+                                               $row,
+                                               $table,
+                                               $idRow,
+                                               $id
+                                       ), __FUNCTION__, __LINE__);
 
                                // Row found?
                                if (SQL_NUMROWS($result) == 1) {
@@ -716,11 +721,17 @@ function adminChangeActivationStatus ($IDs, $table, $row, $idRow = 'id') {
                                        list($currStatus) = SQL_FETCHROW($result);
 
                                        // And switch it N<->Y
-                                       if ($currStatus == 'Y') $newStatus = 'N'; else $newStatus = 'Y';
+                                       $newStatus = convertBooleanToYesNo(!($currStatus == 'Y'));
 
                                        // Change this status
                                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s` SET %s='%s' WHERE %s=%s LIMIT 1",
-                                       array($table, $row, $newStatus, $idRow, $id), __FUNCTION__, __LINE__);
+                                               array(
+                                                       $table,
+                                                       $row,
+                                                       $newStatus,
+                                                       $idRow,
+                                                       $id
+                                               ), __FUNCTION__, __LINE__);
 
                                        // Count up affected rows
                                        $count += SQL_AFFECTEDROWS();