diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php index 0e94d7e017..72f77fae7c 100644 --- a/phpBB/includes/mcp/mcp_pm_reports.php +++ b/phpBB/includes/mcp/mcp_pm_reports.php @@ -221,7 +221,7 @@ class mcp_pm_reports if ($mode == 'pm_reports') { - $report_state = 'pm.message_reported = 1 AND r.report_closed = 0'; + $report_state = 'p.message_reported = 1 AND r.report_closed = 0'; } else { @@ -229,10 +229,10 @@ class mcp_pm_reports } $sql = 'SELECT r.report_id - FROM ' . PRIVMSGS_TABLE . ' pm, ' . REPORTS_TABLE . ' r ' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . (($sort_order_sql[0] == 'r') ? ', ' . USERS_TABLE . ' ru' : '') . " + FROM ' . PRIVMSGS_TABLE . ' p, ' . REPORTS_TABLE . ' r ' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . (($sort_order_sql[0] == 'r') ? ', ' . USERS_TABLE . ' ru' : '') . " WHERE $report_state - AND r.pm_id = pm.msg_id - " . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = pm.author_id' : '') . ' + AND r.pm_id = p.msg_id + " . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.author_id' : '') . ' ' . (($sort_order_sql[0] == 'r') ? 'AND ru.user_id = r.user_id' : '') . " AND r.post_id = 0 $limit_time_sql diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php index 18195fd0f8..58088032df 100644 --- a/phpBB/language/en/mcp.php +++ b/phpBB/language/en/mcp.php @@ -286,7 +286,7 @@ $lang = array_merge($lang, array( 'REPORT_DELETED_SUCCESS' => 'The selected report has been deleted successfully.', 'REPORT_DETAILS' => 'Report details', 'REPORT_MESSAGE' => 'Report this message', - 'REPORT_MESSAGE_EXPLAIN' => 'Use this form to report the selected private message. Reporting should generally be used only if the message breaks forum rules. Reporting a private message will make its contents visible to all moderators', + 'REPORT_MESSAGE_EXPLAIN' => 'Use this form to report the selected private message. Reporting should generally be used only if the message breaks forum rules. Reporting a private message will make its contents visible to all moderators.', 'REPORT_NOTIFY' => 'Notify me', 'REPORT_NOTIFY_EXPLAIN' => 'Informs you when your report is dealt with.', 'REPORT_POST_EXPLAIN' => 'Use this form to report the selected post to the forum moderators and board administrators. Reporting should generally be used only if the post breaks forum rules.', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index d0ae957340..4a80e568a2 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -374,6 +374,7 @@ $lang = array_merge($lang, array( 'RENAME' => 'Rename', 'RENAME_FOLDER' => 'Rename folder', 'REPLIED_MESSAGE' => 'Replied to message', + 'REPORT_PM' => 'Report private message', 'RESIGN_SELECTED' => 'Resign selected', 'RETURN_FOLDER' => '%1$sReturn to previous folder%2$s', 'RETURN_UCP' => '%sReturn to the User Control Panel%s', diff --git a/phpBB/mcp.php b/phpBB/mcp.php index e04bd7cab2..48cd68500f 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -698,13 +698,13 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, case 'pm_reports_closed': case 'reports': case 'reports_closed': - $type = 'reports'; + $pm = (strpos($mode, 'pm_') === 0) ? true : false; + + $type = ($pm) ? 'pm_reports' : 'reports'; $default_key = 't'; $default_dir = 'd'; $limit_time_sql = ($min_time) ? "AND r.report_time >= $min_time" : ''; - $pm = (strpos($mode, 'pm_') === 0) ? true : false; - if ($topic_id) { $where_sql .= ' p.topic_id = ' . $topic_id . ' AND '; @@ -713,12 +713,12 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, { $where_sql .= ' p.forum_id = ' . $forum_id . ' AND '; } - else if ($pm) + else if (!$pm) { $where_sql .= ' ' . $db->sql_in_set('p.forum_id', get_forum_list(array('!f_read', '!m_report')), true, true) . ' AND '; } - if ($mode == 'reports') + if ($mode == 'reports' || $mode == 'pm_reports') { $where_sql .= ' r.report_closed = 0 AND '; } @@ -785,6 +785,12 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, $sort_by_sql = array('a' => 'u.username_clean', 'r' => 'ru.username', 'p' => 'p.post_time', 't' => 'r.report_time', 's' => 'p.post_subject'); break; + case 'pm_reports': + $limit_days = array(0 => $user->lang['ALL_REPORTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); + $sort_by_text = array('a' => $user->lang['AUTHOR'], 'r' => $user->lang['REPORTER'], 'p' => $user->lang['POST_TIME'], 't' => $user->lang['REPORT_TIME'], 's' => $user->lang['SUBJECT']); + $sort_by_sql = array('a' => 'u.username_clean', 'r' => 'ru.username', 'p' => 'p.message_time', 't' => 'r.report_time', 's' => 'p.message_subject'); + break; + case 'logs': $limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); $sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']);