]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_task.php
Added update_year.sh (still not fully flexible) and updated all years with it.
[mailer.git] / inc / modules / admin / what-list_task.php
index c8dfba95932d3841d4bfa859c24774e8cd9fe7ee..0647775f9e0044a7b665b4ddc68108100244beae 100644 (file)
@@ -16,8 +16,8 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
+ * For more information visit: http://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 *
@@ -74,7 +74,7 @@ switch (getRequestElement('type')) {
                break;
 
        default: // Unknown type
-               logDebugMessage(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", getRequestElement('type')));
+               logDebugMessage(__FILE__, __LINE__, sprintf('Unknown task type %s detected.', getRequestElement('type')));
                displayMessage('{%message,ADMIN_TASK_UNKNOWN_MODE' . getRequestElement('type') . '%}');
                break;
 } // END - switch
@@ -87,8 +87,8 @@ if (!empty($whereStatement)) {
                outputSeletectedTasks(postRequestArray(), $dmy);
        } else {
                // Start listing tasks matching selected filter
-               $result_tasks = SQL_QUERY('SELECT
-       `id`,`assigned_admin`,`userid`,`task_type`,`subject`,`text`,`task_created`
+               $result_tasks = sqlQuery('SELECT
+       `id`, `assigned_admin`, `userid`, `task_type`, `subject`, `text`, `task_created`
 FROM
        `{?_MYSQL_PREFIX?}_task_system`
 WHERE
@@ -101,10 +101,10 @@ ORDER BY
                        __FILE__, __LINE__);
                if ((ifPostContainsSelections()) && (!isDemoModeActive())) {
                        // Only unassign / delete tasks when there are selected tasks posted
-                       if (isPostRequestElementSet('unassign')) {
+                       if (isFormSent('unassign')) {
                                // Unassign from tasks
                                foreach (postRequestElement('sel') as $id => $sel) {
-                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=NULL WHERE `id`=%s AND `assigned_admin`=%s LIMIT 1",
+                                       sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=NULL WHERE `id`=%s AND `assigned_admin`=%s LIMIT 1",
                                                array(bigintval($id), getCurrentAdminId()), __FILE__, __LINE__);
                                } // END - foreach
                        } elseif (isFormSent('delete')) {
@@ -112,7 +112,7 @@ ORDER BY
                                foreach (postRequestElement('sel') as $id => $sel) {
                                        if (getRequestElement('type') == 'deleted') {
                                                // Delete task immediately
-                                               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s LIMIT 1",
+                                               sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s LIMIT 1",
                                                        array(bigintval($id)),__FILE__, __LINE__);
                                        } else {
                                                // Mark task as to be deleted (purged by autopurge extension)
@@ -121,12 +121,12 @@ ORDER BY
                                } // END - foreach
                        } else {
                                // Unknown action performed
-                               debug_report_bug(__FILE__, __LINE__, sprintf("Unknown task action performed. data=<pre>%s</pre>", print_r(postRequestArray(), true)));
+                               reportBug(__FILE__, __LINE__, sprintf('Unknown task action performed. data=<pre>%s</pre>', print_r(postRequestArray(), TRUE)));
                        }
 
                        // Update query
-                       $result_tasks = SQL_QUERY('SELECT
-       `id`,`assigned_admin`,`userid`,`task_type`,`subject`,`text`,`task_created`
+                       $result_tasks = sqlQuery('SELECT
+       `id`, `assigned_admin`, `userid`, `task_type`, `subject`, `text`, `task_created`
 FROM
        `{?_MYSQL_PREFIX?}_task_system`
 WHERE
@@ -138,7 +138,7 @@ ORDER BY
 
                // There are uncompleted jobs!
                $OUT = '';
-               while ($content = SQL_FETCHARRAY($result_tasks)) {
+               while ($content = sqlFetchArray($result_tasks)) {
                        // Init infos
                        $content['infos'] = '';
 
@@ -151,12 +151,12 @@ ORDER BY
                        } // END - switch
 
                        // Member assigned with task?
-                       if (isValidUserId($content['userid'])) {
+                       if (isValidId($content['userid'])) {
                                // Member found otherwise it's a system task
                                $content['userid'] = generateUserProfileLink($content['userid']);
                        } else {
                                // Is a system task!
-                               $content['userid'] = '<em>{--ADMIN_IS_SYSTEM_TASK--}</em>';
+                               $content['userid'] = '{--ADMIN_IS_SYSTEM_TASK--}';
                        }
 
                        // Prepare content
@@ -164,22 +164,22 @@ ORDER BY
                                'task_created'  => generateDateTime($content['task_created'], 2)
                        ));
 
-                       // Do we have an extension task?
+                       // Is there an extension task?
                        if (isExtensionTask($content)) {
                                // Load extension row template
-                               $OUT .= loadTemplate('admin_list_task_ext_rows', true, $content);
+                               $OUT .= loadTemplate('admin_list_task_ext_rows', TRUE, $content);
                        } else {
                                // Load default row template
-                               $OUT .= loadTemplate('admin_list_task_rows', true, $content);
+                               $OUT .= loadTemplate('admin_list_task_rows', TRUE, $content);
                        }
                } // END - while
 
                // Free memory
-               SQL_FREERESULT($result_tasks);
+               sqlFreeResult($result_tasks);
 
                // Prepare content
                $content = array(
-                       'message' => '{--ADMIN_OVERVIEW_TASK_' . strtoupper(getRequestElement('type')) . '_TYPE--}',
+                       'message' => '{--ADMIN_OVERVIEW_TASK_' . strtoupper(getRequestElement('type')) . '_TYPE_TITLE--}',
                        'type'    => getRequestElement('type'),
                        'rows'    => $OUT
                );
@@ -187,10 +187,10 @@ ORDER BY
                // Load footer template
                if (getRequestElement('type') == 'deleted') {
                        // Delete now button
-                       loadTemplate('admin_list_task_delete', false, $content);
+                       loadTemplate('admin_list_task_delete', FALSE, $content);
                } else {
                        // Normal footer
-                       loadTemplate('admin_list_task', false, $content);
+                       loadTemplate('admin_list_task', FALSE, $content);
                }
        }
 } // END - if