// @TODO This function does also check for uncompleted tasks
function outputStandardOverview (&$result_tasks) {
// First check for solved and not assigned tasks and assign them to current admin
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=%s WHERE assigned_admin < 1 AND status != 'NEW'",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=%s WHERE `assigned_admin` IS NULL AND status != 'NEW'",
array(getCurrentAdminId()), __FILE__, __LINE__);
// We currently don't want to install an extension so let's find out if we need...
if ($taskData['assigned_admin'] == '0') {
// Assgin current admin to unassgigned task
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=%s WHERE `id`=%s AND `assigned_admin`=NULL LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=%s WHERE `id`=%s AND `assigned_admin` IS NULL LIMIT 1",
array(
getCurrentAdminId(),
bigintval($taskData['id'])
} elseif (isset($postData['delete'])) {
// Delete tasks
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",
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s AND `assigned_admin` IN (%s,0,NULL) LIMIT 1",
array(bigintval($taskId), getCurrentAdminId()), __FILE__, __LINE__);
} // END - foreach
} else {