From b33e5273942c4f67e8168763eec224fd61edaa8f Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Tue, 9 Oct 2012 22:02:49 -0500 Subject: [ticket/11103] Working on report notifications (post/pm) PHPBB3-11103 --- phpBB/report.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'phpBB/report.php') diff --git a/phpBB/report.php b/phpBB/report.php index 29b46a6211..8bede2cffd 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -131,7 +131,7 @@ else $message .= '

' . sprintf($user->lang['RETURN_PM'], '', ''); trigger_error($message); } - + $reported_post_text = $report_data['message_text']; } @@ -184,6 +184,9 @@ if ($submit && $reason_id) $lang_return = $user->lang['RETURN_TOPIC']; $lang_success = $user->lang['POST_REPORTED_SUCCESS']; + + // Notify relevant users + $phpbb_notifications->add_notifications('report_post', array_merge($report_data, $row, $forum_data)); } else { @@ -210,6 +213,9 @@ if ($submit && $reason_id) $lang_return = $user->lang['RETURN_PM']; $lang_success = $user->lang['PM_REPORTED_SUCCESS']; + + // Notify relevant users + //$phpbb_notifications->add_notifications('report_pm', $report_data); } meta_refresh(3, $redirect_url); -- cgit v1.2.1 From 6d53bd4675e00419bcfcf476b03166b9774bebca Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Tue, 9 Oct 2012 22:28:41 -0500 Subject: [ticket/11103] Finishing up PM Report notifications PHPBB3-11103 --- phpBB/report.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'phpBB/report.php') diff --git a/phpBB/report.php b/phpBB/report.php index 8bede2cffd..dd1cc2514c 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -215,7 +215,10 @@ if ($submit && $reason_id) $lang_success = $user->lang['PM_REPORTED_SUCCESS']; // Notify relevant users - //$phpbb_notifications->add_notifications('report_pm', $report_data); + $phpbb_notifications->add_notifications('report_pm', array_merge($report_data, $row, array( + 'from_user_id' => $report_data['author_id'], + 'report_id' => $report_id, + ))); } meta_refresh(3, $redirect_url); -- cgit v1.2.1 From 3839fe69027836d0c9083095208e4ed548a7ea38 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Tue, 16 Oct 2012 17:44:46 -0500 Subject: [ticket/11103] Use report text for report notification, never notify reporter PHPBB3-11103 --- phpBB/report.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'phpBB/report.php') diff --git a/phpBB/report.php b/phpBB/report.php index dd1cc2514c..9f3b09d5ba 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -186,7 +186,9 @@ if ($submit && $reason_id) $lang_success = $user->lang['POST_REPORTED_SUCCESS']; // Notify relevant users - $phpbb_notifications->add_notifications('report_post', array_merge($report_data, $row, $forum_data)); + $phpbb_notifications->add_notifications('report_post', array_merge($report_data, $row, $forum_data, array( + 'report_text' => $report_text, + ))); } else { @@ -216,6 +218,7 @@ if ($submit && $reason_id) // Notify relevant users $phpbb_notifications->add_notifications('report_pm', array_merge($report_data, $row, array( + 'report_text' => $report_text, 'from_user_id' => $report_data['author_id'], 'report_id' => $report_id, ))); -- cgit v1.2.1 From ae670cc87df197e44b768667b853e1dae3009b4d Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Thu, 18 Oct 2012 18:32:13 -0500 Subject: [ticket/11103] Remove unnecessary comments Comments that are not needed because the actions are completely self-explanatory PHPBB3-11103 --- phpBB/report.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'phpBB/report.php') diff --git a/phpBB/report.php b/phpBB/report.php index 9f3b09d5ba..07b9711ae1 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -185,7 +185,6 @@ if ($submit && $reason_id) $lang_return = $user->lang['RETURN_TOPIC']; $lang_success = $user->lang['POST_REPORTED_SUCCESS']; - // Notify relevant users $phpbb_notifications->add_notifications('report_post', array_merge($report_data, $row, $forum_data, array( 'report_text' => $report_text, ))); @@ -216,7 +215,6 @@ if ($submit && $reason_id) $lang_return = $user->lang['RETURN_PM']; $lang_success = $user->lang['PM_REPORTED_SUCCESS']; - // Notify relevant users $phpbb_notifications->add_notifications('report_pm', array_merge($report_data, $row, array( 'report_text' => $report_text, 'from_user_id' => $report_data['author_id'], -- cgit v1.2.1 From 94d682f77431add84867bb0b196ad0719b293606 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sat, 20 Oct 2012 20:54:18 -0500 Subject: [ticket/11103] Use the full class name as the item_type/method This is going to require you recreate the db tables. PHPBB3-11103 --- phpBB/report.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/report.php') diff --git a/phpBB/report.php b/phpBB/report.php index 07b9711ae1..63e6afcf66 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -185,7 +185,7 @@ if ($submit && $reason_id) $lang_return = $user->lang['RETURN_TOPIC']; $lang_success = $user->lang['POST_REPORTED_SUCCESS']; - $phpbb_notifications->add_notifications('report_post', array_merge($report_data, $row, $forum_data, array( + $phpbb_notifications->add_notifications('phpbb_notification_type_report_post', array_merge($report_data, $row, $forum_data, array( 'report_text' => $report_text, ))); } @@ -215,7 +215,7 @@ if ($submit && $reason_id) $lang_return = $user->lang['RETURN_PM']; $lang_success = $user->lang['PM_REPORTED_SUCCESS']; - $phpbb_notifications->add_notifications('report_pm', array_merge($report_data, $row, array( + $phpbb_notifications->add_notifications('phpbb_notification_type_report_pm', array_merge($report_data, $row, array( 'report_text' => $report_text, 'from_user_id' => $report_data['author_id'], 'report_id' => $report_id, -- cgit v1.2.1 From 2afb8b9df873c3f9572a32ab7a62ea8ba8d8a45b Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Tue, 20 Nov 2012 18:14:48 -0600 Subject: [ticket/11103] Create user loader class, update for DIC Create a very basic user loader class to handle querying/storing user data in a centralized location. Use DIC collection service for notification types/methods. Cleanup unused dependencies. Fix some other issues. PHPBB3-11103 --- phpBB/report.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/report.php') diff --git a/phpBB/report.php b/phpBB/report.php index 95043a6978..07cec7afbc 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -191,7 +191,7 @@ if ($submit && $reason_id) $lang_return = $user->lang['RETURN_TOPIC']; $lang_success = $user->lang['POST_REPORTED_SUCCESS']; - $phpbb_notifications->add_notifications('phpbb_notification_type_report_post', array_merge($report_data, $row, $forum_data, array( + $phpbb_notifications->add_notifications('report_post', array_merge($report_data, $row, $forum_data, array( 'report_text' => $report_text, ))); } @@ -221,7 +221,7 @@ if ($submit && $reason_id) $lang_return = $user->lang['RETURN_PM']; $lang_success = $user->lang['PM_REPORTED_SUCCESS']; - $phpbb_notifications->add_notifications('phpbb_notification_type_report_pm', array_merge($report_data, $row, array( + $phpbb_notifications->add_notifications('report_pm', array_merge($report_data, $row, array( 'report_text' => $report_text, 'from_user_id' => $report_data['author_id'], 'report_id' => $report_id, -- cgit v1.2.1 From 91246c20fa8b9218fe0ddc8b52236d4b878346dd Mon Sep 17 00:00:00 2001 From: Bruno Ais Date: Sun, 2 Dec 2012 23:07:40 +0000 Subject: [ticket/11171] Adapted the code in report.php Added the variable aliases needed (to look and feel the same as it was before) Added the variables into the table insert. PHPBB3-11171 --- phpBB/report.php | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) (limited to 'phpBB/report.php') diff --git a/phpBB/report.php b/phpBB/report.php index d792b8df6a..be38bad2f3 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -71,11 +71,14 @@ if ($post_id) trigger_error('POST_NOT_EXIST'); } - $forum_id = (int) $report_data['forum_id']; - $topic_id = (int) $report_data['topic_id']; - $reported_post_text = $report_data['post_text']; - $reported_post_bitfield = $report_data['bbcode_bitfield']; - $reported_post_uid = $report_data['bbcode_uid']; + $forum_id = (int) $report_data['forum_id']; + $topic_id = (int) $report_data['topic_id']; + $reported_post_text = $report_data['post_text']; + $reported_post_bitfield = $report_data['bbcode_bitfield']; + $reported_post_uid = $report_data['bbcode_uid']; + $reported_post_enable_bbcode = $report_data['enable_bbcode']; + $reported_post_enable_smilies = $report_data['enable_smilies']; + $reported_post_enable_magic_url = $report_data['enable_magic_url']; $sql = 'SELECT * FROM ' . FORUMS_TABLE . ' @@ -134,9 +137,11 @@ else trigger_error($message); } - $reported_post_text = $report_data['message_text']; - $reported_post_bitfield = $report_data['bbcode_bitfield']; - $reported_post_uid = $report_data['bbcode_uid']; + $reported_post_text = $report_data['message_text']; + $reported_post_bitfield = $report_data['bbcode_bitfield']; + $reported_post_enable_bbcode = $report_data['reported_post_enable_bbcode']; + $reported_post_enable_smilies = $report_data['reported_post_enable_smilies']; + $reported_post_enable_magic_url = $report_data['reported_post_enable_magic_url']; } // Submit report? @@ -155,17 +160,20 @@ if ($submit && $reason_id) } $sql_ary = array( - 'reason_id' => (int) $reason_id, - 'post_id' => $post_id, - 'pm_id' => $pm_id, - 'user_id' => (int) $user->data['user_id'], - 'user_notify' => (int) $user_notify, - 'report_closed' => 0, - 'report_time' => (int) time(), - 'report_text' => (string) $report_text, - 'reported_post_text' => $reported_post_text, - 'reported_post_uid' => $reported_post_uid, - 'reported_post_bitfield'=> $reported_post_bitfield, + 'reason_id' => (int) $reason_id, + 'post_id' => $post_id, + 'pm_id' => $pm_id, + 'user_id' => (int) $user->data['user_id'], + 'user_notify' => (int) $user_notify, + 'report_closed' => 0, + 'report_time' => (int) time(), + 'report_text' => (string) $report_text, + 'reported_post_text' => $reported_post_text, + 'reported_post_uid' => $reported_post_uid, + 'reported_post_bitfield' => $reported_post_bitfield, + 'reported_post_enable_bbcode' => $reported_post_enable_bbcode, + 'reported_post_enable_smilies' => $reported_post_enable_smilies, + 'reported_post_enable_magic_url' => $reported_post_enable_magic_url, ); $sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); -- cgit v1.2.1 From 249f3c8885d461ae3981dfd7b62093c2175175e3 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Thu, 13 Dec 2012 19:19:40 -0600 Subject: [ticket/11103] Instantiate $phpbb_notifications as needed https://github.com/phpbb/phpbb3/pull/992#discussion_r2413976 PHPBB3-11103 --- phpBB/report.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'phpBB/report.php') diff --git a/phpBB/report.php b/phpBB/report.php index 07cec7afbc..f9f6b572ef 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -172,6 +172,8 @@ if ($submit && $reason_id) $db->sql_query($sql); $report_id = $db->sql_nextid(); + $phpbb_notifications = $phpbb_container->get('notification_manager'); + if ($post_id) { $sql = 'UPDATE ' . POSTS_TABLE . ' -- cgit v1.2.1