]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/overview-inc.php
Lesser use of double-quotes
[mailer.git] / inc / modules / admin / overview-inc.php
index ecd876f699d3f4ea85a1714e916b560e2f291327..73077463a7090f2e2a0b18a1478ec1e46e318cb5 100644 (file)
@@ -116,7 +116,7 @@ ORDER BY
        `task_created` DESC",
                array(getCurrentAdminId()), __FILE__, __LINE__);
 
-       if (SQL_NUMROWS($result_tasks) > 0) {
+       if (!SQL_HASZERONUMS($result_tasks)) {
                // New jobs found!
                $jobsDone = false;
        } // END - if
@@ -133,7 +133,7 @@ function outputSeletectedTasks ($postData, $result_tasks) {
        if ((isset($postData['assign'])) && (count($postData['sel']) > 0)) {
                // Assign / do tasks
                $OUT = '';
-               foreach ($postData['sel'] as $id => $sel) {
+               foreach ($postData['sel'] as $taskId => $sel) {
                        $result_task = SQL_QUERY_ESC("SELECT
        `id`, `userid`, `task_type`, `subject`, `text`, `task_created`, `status`, `assigned_admin`
 FROM
@@ -142,7 +142,7 @@ WHERE
        `id`=%s AND (`assigned_admin`=%s OR (`assigned_admin`=0 AND `status`='NEW'))
 LIMIT 1",
                                array(
-                                       bigintval($id),
+                                       bigintval($taskId),
                                        getCurrentAdminId()
                                ), __FILE__, __LINE__);
 
@@ -195,14 +195,14 @@ LIMIT 1",
                                $title = '{--TASK_NO_TITLE--}';
 
                                // Shall I list SQL commands assigned to an extension installation or update task?
-                               if ((getConfig('verbose_sql') == 'Y')) {
+                               if ((isVerboseSqlEnabled()) || (!isExtensionInstalled('sql_patches'))) {
                                        // Extract extension name from subject
                                        $ext_name = substr($taskData['subject'], 1, strpos($taskData['subject'], ':') - 1);
 
                                        // Update task or extension task?
                                        if (($taskData['task_type'] == 'EXTENSION') && (!isExtensionInstalled($ext_name))) {
                                                // Load SQL commands for registering in dry-run
-                                               registerExtension($ext_name, $id, true);
+                                               registerExtension($ext_name, $taskId, true);
 
                                                // Is this non-productive?
                                                if (isExtensionProductive() === false) {
@@ -243,7 +243,7 @@ LIMIT 1",
                                        }
 
                                        // Add SQLs to a table
-                                       if ((!empty($ext_name)) && (isExtensionInstalled('sql_patches')) && (getConfig('verbose_sql') == 'Y')) {
+                                       if ((!empty($ext_name)) && (isVerboseSqlEnabled())) {
                                                // Add verbose SQL table
                                                $taskData['text'] .= addExtensionVerboseSqlTable($title, ' class="admin_table top left right"', true, '100%') . "<br />\n";
                                        } // END - if
@@ -258,7 +258,7 @@ LIMIT 1",
                                        $taskData['text'] .= getExtensionNotes();
                                } else {
                                        // This should not normally happen!
-                                       debug_report_bug(__FILE__, __LINE__, 'ext_name(' . $ext_name . ') or ext_ver(' . $ext_ver . ') is empty! sql_patches=' . getExtensionVersion('sql_patches') . '/verbose_sql=' . getConfig('verbose_sql'));
+                                       debug_report_bug(__FILE__, __LINE__, 'ext_name(' . $ext_name . ') or ext_ver(' . $ext_ver . ') is empty! isVerboseSqlEnabled=' . intval(isVerboseSqlEnabled()));
                                }
 
                                // Prepare array for the template
@@ -285,7 +285,7 @@ LIMIT 1",
                                                if ($lines == '0') {
                                                        // New extension found
                                                        $OUT .= loadTemplate('admin_extension_reg_form', true, array(
-                                                               'id'       => bigintval($id),
+                                                               'id'       => bigintval($taskId),
                                                                'ext_name' => $ext_name
                                                        ));
                                                } else {
@@ -378,12 +378,12 @@ LIMIT 1",
                                                break;
 
                                        case 'MEMBER_ORDER': // Member mail orders
-                                               $OUT .= loadTemplate('admin_task_order', true, $id);
+                                               $OUT .= loadTemplate('admin_task_order', true, $taskId);
                                                break;
 
                                        default: // Unknown task type
                                                logDebugMessage(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", $taskData['task_type']));
-                                               $OUT .= '<div class="admin_failed medium">' . sprintf(getMessage('ADMIN_UNKNOWN_TASK_TYPE'), $taskData['task_type'], $id) . '</div>';
+                                               $OUT .= '<div class="admin_failed medium">' . sprintf(getMessage('ADMIN_UNKNOWN_TASK_TYPE'), $taskData['task_type'], $taskId) . '</div>';
                                                break;
                                }
                                $OUT .= '
@@ -402,15 +402,15 @@ LIMIT 1",
                        // Only unassign / delete tasks when there are selected tasks posted
                        if (!empty($postData['unassign'])) {
                                // Unassign from tasks
-                               foreach ($postData['sel'] as $id => $sel) {
+                               foreach ($postData['sel'] as $taskId => $sel) {
                                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=0 WHERE `id`=%s AND `assigned_admin`=%s LIMIT 1",
-                                               array(bigintval($id), getCurrentAdminId()), __FILE__, __LINE__);
+                                               array(bigintval($taskId), getCurrentAdminId()), __FILE__, __LINE__);
                                }
                        } elseif (isset($postData['del'])) {
                                // Delete tasks
-                               foreach ($postData['sel'] as $id => $sel) {
+                               foreach ($postData['sel'] as $taskId => $sel) {
                                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s AND `assigned_admin` IN (%s,0) LIMIT 1",
-                                               array(bigintval($id), getCurrentAdminId()), __FILE__, __LINE__);
+                                               array(bigintval($taskId), getCurrentAdminId()), __FILE__, __LINE__);
                                }
                        } else {
                                // Unknown action