X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Ftask_functions.php;h=d01582467be2939738018496214062c640b5e080;hb=b5e396d81912f97a5752b4a4e61ae08f7c1efbd5;hp=5f705a06b52fb653168ae7cf7a839569c769b63a;hpb=ee3a0b42f93de7676fca549c866c1c2e6f3f0576;p=mailer.git diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index 5f705a06b5..d01582467b 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * + * Copyright (c) 2009 - 2013 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -67,7 +67,7 @@ function outputAdvancedOverview (&$result_main) { foreach ( array( // Member accounts - 'confirmed_members','unconfirmed_members','locked_members','random_refid', + 'confirmed_members','unconfirmed_members','locked_members','random_refid','testers', // Tasks 'update_tasks','new_tasks','closed_tasks','your_tasks','deleted_tasks','solved_tasks', // Mail orders @@ -82,7 +82,7 @@ function outputAdvancedOverview (&$result_main) { } // END - foreach // Extension updates found - $value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, " AND `status`='NEW' AND `task_type`='EXTENSION_UPDATE'"); + $value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', TRUE, " AND `status`='NEW' AND `task_type`='EXTENSION_UPDATE'"); if ($value > 0) { $content['update_tasks'] = '' . $value . ''; @@ -93,19 +93,17 @@ function outputAdvancedOverview (&$result_main) { // // Confirmed accounts $value = getTotalConfirmedUser(); - if ($value > 0) { $content['confirmed_members'] = '' . $value . ''; } // END - if // Unconfirmed accounts $value = getTotalUnconfirmedUser(); - if ($value > 0) { - $content['unconfirmed_members'] = '' . $value . ''; + $content['unconfirmed_members'] = '' . $value . ''; } // END - if - // And locked accounts + // Locked accounts $value = getTotalLockedUser(); if ($value > 0) { $content['locked_members'] = '' . $value . ''; @@ -117,12 +115,20 @@ function outputAdvancedOverview (&$result_main) { if ($value > 0) { $content['random_refid'] = '' . $value . ''; } // END - if + + if (isExtensionInstalledAndNewer('user', '0.5.0')) { + // And tester accounts + $value = getTotalTesterUsers(); + if ($value > 0) { + $content['testers'] = '' . $value . ''; + } // END - if + } // END - if } // END - if // // Unassigned tasks // - $value = countSumTotalData(0, 'task_system', 'id', 'assigned_admin', true, " AND `status` != 'DELETED'"); + $value = countSumTotalData(NULL, 'task_system', 'id', 'assigned_admin', TRUE, " AND `status` != 'DELETED'"); if ($value > 0) { $content['new_tasks'] = '' . $value . ''; @@ -131,7 +137,7 @@ function outputAdvancedOverview (&$result_main) { // // Closed tasks // - $value = countSumTotalData('CLOSED', 'task_system', 'id', 'status', true); + $value = countSumTotalData('CLOSED', 'task_system', 'id', 'status', TRUE); if ($value > 0) { $content['closed_tasks'] = '' . $value . ''; @@ -140,7 +146,7 @@ function outputAdvancedOverview (&$result_main) { // // Deleted tasks // - $value = countSumTotalData('DELETED', 'task_system', 'id', 'status', true); + $value = countSumTotalData('DELETED', 'task_system', 'id', 'status', TRUE); if ($value > 0) { $content['deleted_tasks'] = '' . $value . ''; @@ -149,7 +155,7 @@ function outputAdvancedOverview (&$result_main) { // // Solved tasks // - $value = countSumTotalData('SOLVED', 'task_system', 'id', 'status', true, sprintf(" AND `assigned_admin`=%s", getCurrentAdminId())); + $value = countSumTotalData('SOLVED', 'task_system', 'id', 'status', TRUE, sprintf(" AND `assigned_admin`=%s", getCurrentAdminId())); if ($value > 0) { $content['solved_tasks'] = '' . $value . ''; @@ -158,7 +164,7 @@ function outputAdvancedOverview (&$result_main) { // // Your tasks // - $value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, " AND `status`='NEW' AND task_type != 'EXTENSION_UPDATE'"); + $value = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', TRUE, " AND `status`='NEW' AND task_type != 'EXTENSION_UPDATE'"); if ($value > 0) { $content['your_tasks'] = '' . $value . ''; @@ -167,7 +173,7 @@ function outputAdvancedOverview (&$result_main) { // // Mails waiting to be approved // - $value = countSumTotalData('ADMIN', 'pool', 'id', 'data_type', true); + $value = countSumTotalData('ADMIN', 'pool', 'id', 'data_type', TRUE); if ($value > 0) { $content['pending_mails'] = '' . $value . ''; @@ -176,7 +182,7 @@ function outputAdvancedOverview (&$result_main) { // // Unfinished mail orders // - $value = countSumTotalData('TEMP', 'pool', 'id', 'data_type', true); + $value = countSumTotalData('TEMP', 'pool', 'id', 'data_type', TRUE); if ($value > 0) { $content['canceled_mails'] = '' . $value . ''; @@ -185,7 +191,7 @@ function outputAdvancedOverview (&$result_main) { // // Sent mail orders // - $value = countSumTotalData('SEND', 'pool', 'id', 'data_type', true); + $value = countSumTotalData('SEND', 'pool', 'id', 'data_type', TRUE); if ($value > 0) { $content['send_emails'] = '' . $value . ''; @@ -196,7 +202,7 @@ function outputAdvancedOverview (&$result_main) { // if (isExtensionActive('autopurge')) { // Get auto-purged mails - $value = countSumTotalData('DELETED', 'pool', 'id', 'data_type', true); + $value = countSumTotalData('DELETED', 'pool', 'id', 'data_type', TRUE); if ($value > 0) { $content['purged_mails'] = '' . $value . ''; @@ -207,7 +213,7 @@ function outputAdvancedOverview (&$result_main) { // if (isExtensionInstalledAndNewer('bonus', '0.1.8')) { // Get auto-purged bonus mails - $value = countSumTotalData('DELETED', 'bonus', 'id', 'data_type', true); + $value = countSumTotalData('DELETED', 'bonus', 'id', 'data_type', TRUE); if ($value > 0) { $content['purged_bonus_mails'] = '' . $value . ''; @@ -227,7 +233,7 @@ function outputAdvancedOverview (&$result_main) { // if (isExtensionInstalledAndNewer('bonus', '0.1.8')) { // Get sent bonus mails (but not notifications) - $value = countSumTotalData('SEND', 'bonus', 'id', 'data_type', true, " AND `is_notify`='N'"); + $value = countSumTotalData('SEND', 'bonus', 'id', 'data_type', TRUE, " AND `is_notify`='N'"); if ($value > 0) { $content['send_bonus_mails'] = '' . $value . ''; @@ -241,40 +247,43 @@ function outputAdvancedOverview (&$result_main) { // Both extensions must be there if ((isExtensionActive('autopurge')) && (isExtensionActive('user'))) { // Start finding them... - $EXCLUDE_LIST = ''; + $userExclusionSql = ' '; + $excludedUserids = runFilterChain('config_userid_exclusion_sql', array()); + if (count($excludedUserids) > 0) { + // Exclude all + $userExclusionSql .= ' AND `d`.`userid` NOT IN (' . implode(', ', $excludedUserids) . ')'; + } // END - if // Check for more extensions - // @TODO These can be rewritten to filter - if (isValidUserId(getDefRefid())) $EXCLUDE_LIST .= ' AND d.`userid` != {?def_refid?}'; - if (isExtensionActive('beg')) $EXCLUDE_LIST .= ' AND d.`userid` != {?beg_userid?}'; - if (isExtensionActive('bonus')) $EXCLUDE_LIST .= ' AND d.`userid` != {?bonus_userid?}'; - if (isExtensionActive('doubler')) $EXCLUDE_LIST .= ' AND d.`userid` != {?doubler_userid?}'; + // @TODO This can be rewritten to filter if (isExtensionInstalledAndNewer('holiday', '0.1.3')) { // Recent ext-holiday found - $EXCLUDE_LIST .= " AND d.`holiday_active`='N'"; + $userExclusionSql .= " AND `d`.`holiday_active`='N'"; } // END - if // Check for all accounts addSql("SELECT - d.userid, d.email, d.last_online + `d`.`userid`, + `d`.`email`, + `d`.`last_online` FROM - `{?_MYSQL_PREFIX?}_user_data` AS d + `{?_MYSQL_PREFIX?}_user_data` AS `d` WHERE - d.`status`='CONFIRMED' AND - (UNIX_TIMESTAMP() - d.`joined`) >= {?ap_inactive_since?} AND - (UNIX_TIMESTAMP() - d.`last_online`) >= {?ap_inactive_since?} AND - (UNIX_TIMESTAMP() - d.`ap_notified`) >= {?ap_inactive_since?} -".$EXCLUDE_LIST." + `d`.`status`='CONFIRMED' AND + (UNIX_TIMESTAMP() - `d`.`joined`) >= {?ap_inactive_since?} AND + (UNIX_TIMESTAMP() - `d`.`last_online`) >= {?ap_inactive_since?} AND + (UNIX_TIMESTAMP() - `d`.`ap_notified`) >= {?ap_inactive_since?} + " . runFilterChain('user_exclusion_sql', $userExclusionSql) . " ORDER BY - d.userid ASC"); + `d`.`userid` ASC"); $WHATs[] = 'list_autopurge'; $DESCRs[] = '{--ADMIN_TASK_INACTIVE_AUTOPURGE--}'; $TITLEs[] = '{--ADMIN_TASK_INACTIVE_AUTOPURGE_TITLE--}'; - } + } // END - if if ((isExtensionInstalledAndNewer('sql_patches', '0.3.4')) && (isExtensionActive('user'))) { // Check for accounts without referral - addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `refid`=0 OR `refid` IS NULL ORDER BY `userid` ASC"); + addSql('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `refid`=0 OR `refid` IS NULL ' . runFilterChain('user_exclusion_sql', ' ') . ' ORDER BY `userid` ASC'); $DESCRs[] = '{--ADMIN_TASK_LIST_ACCOUNT_NO_REFERRAL--}'; $TITLEs[] = '{--ADMIN_TASK_LIST_ACCOUNT_NO_REFERRAL_TITLE--}'; $WHATs[] = 'list_user&do=norefs'; @@ -300,14 +309,6 @@ ORDER BY $TITLEs[] = '{--ADMIN_TASK_LIST_WERNIS_ALL_TITLE--}'; } // END - if - if (isExtensionActive('primera')) { - // List new primera requests - addSql('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_primera` ORDER BY `userid` ASC'); - $WHATs[] = 'list_primera'; - $DESCRs[] = '{--ADMIN_TASK_LIST_PRIMERA_ALL--}'; - $TITLEs[] = '{--ADMIN_TASK_LIST_PRIMERA_ALL_TITLE--}'; - } // END - if - if (isExtensionActive('holiday')) { // List holiday requests addSql('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_holidays` ORDER BY `userid` ASC'); @@ -330,9 +331,9 @@ ORDER BY $add = runFilterChain('add_bonus_points_user_columns', ''); // Active rallye, so add more point columns, if not empty - $USE = '`turbo_bonus`'; + $pointsColumns = ''; if (!empty($add)) { - $USE = '(0' . $add . ')'; + $pointsColumns = '(0' . $add . ')'; } // END - if // Init variable @@ -345,12 +346,12 @@ ORDER BY } // END - if addSql("SELECT - " . $USE . " AS `points` + " . $pointsColumns . " AS `points` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `status`='CONFIRMED' AND - " . $USE . " > 0 + " . $pointsColumns . " > 0 " . $lastOnline . " ORDER BY `points` DESC, @@ -515,6 +516,22 @@ ORDER BY $TITLEs[] = '{--ADMIN_TASK_LIST_SURFBAR_URLS_PENDING_TITLE--}'; } // END - if + if (isExtensionInstalledAndNewer('sql_patches', '0.9.2')) { + // Check for wrong "SERVER_NAME" entries + addSql('SELECT `server_name_id` FROM `{?_MYSQL_PREFIX?}_server_name_log`'); + $DESCRs[] = '{--ADMIN_TASK_LIST_SERVER_NAME_LOG--}'; + $TITLEs[] = '{--ADMIN_TASK_LIST_SERVER_NAME_LOG_TITLE--}'; + $WHATs[] = 'list_server_name'; + } // END - if + + if (isExtensionInstalled('network')) { + // Check for HTTP logging entries + addSql('SELECT `network_header_id` FROM `{?_MYSQL_PREFIX?}_network_header_logging`'); + $DESCRs[] = '{--ADMIN_TASK_LIST_NETWORK_HEADER_LOG--}'; + $TITLEs[] = '{--ADMIN_TASK_LIST_NETWORK_HEADER_LOG_TITLE--}'; + $WHATs[] = 'list_network_http_header'; + } // END - if + // Generate extra overview rows $EXTRAS .= createExtraTaskRows($WHATs, $DESCRs, $TITLEs); @@ -527,7 +544,7 @@ ORDER BY $content['extra_table'] = $EXTRAS; // Simply load the template... :-) - loadTemplate('admin_overview_task', false, $content); + loadTemplate('admin_overview_task', FALSE, $content); } // @@ -540,7 +557,7 @@ function createExtraTaskRows ($WHATs, $DESCRs, $TITLEs) { // New format... foreach ($sqls as $key => $sql) { // Run SQL command, get line numbers and free memory - $result = SQL_QUERY($sql, __FUNCTION__, __LINE__); + $result = sqlQuery($sql, __FUNCTION__, __LINE__); // Prepare array for output $content = array( @@ -553,25 +570,25 @@ function createExtraTaskRows ($WHATs, $DESCRs, $TITLEs) { $content['bottom'] = 'bottom'; } // END - if - if ((!SQL_HASZERONUMS($result)) && (!empty($WHATs[$key]))) { + if ((!ifSqlHasZeroNums($result)) && (!empty($WHATs[$key]))) { if (empty($TITLEs[$key])) { $TITLEs[$key] = '{--ADMIN_TASK_UNKNOWN_LIST_TITLE--}'; } // END - if - $content['row_link'] = '' . SQL_NUMROWS($result) . ''; + $content['row_link'] = '' . sqlNumRows($result) . ''; } else { $content['row_link'] = '0'; } // Free result - SQL_FREERESULT($result); + sqlFreeResult($result); // And insert the final string into extras template - $OUT .= loadTemplate('admin_overview_task_rows', true, $content); + $OUT .= loadTemplate('admin_overview_task_rows', TRUE, $content); } // END- foreach } // END - foreach // Return output in the template - return loadTemplate('admin_overview_task_extras', true, $OUT); + return loadTemplate('admin_overview_task_extras', TRUE, $OUT); } // [EOF]