aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp/mcp_queue.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2014-05-02 12:11:09 +0200
committerNils Adermann <naderman@naderman.de>2014-05-02 12:11:09 +0200
commitd36795b844d54fbb05f923540c06970bf270caea (patch)
tree137bedc6f4d629e8ab74ccd1cf1f9116f5717c5e /phpBB/includes/mcp/mcp_queue.php
parent73b950d2f191eb5590c43df6c555f1f217b3b2ee (diff)
parent5c7199f3dd1e0dd99c173f90ada615c68d486f51 (diff)
downloadforums-d36795b844d54fbb05f923540c06970bf270caea.tar
forums-d36795b844d54fbb05f923540c06970bf270caea.tar.gz
forums-d36795b844d54fbb05f923540c06970bf270caea.tar.bz2
forums-d36795b844d54fbb05f923540c06970bf270caea.tar.xz
forums-d36795b844d54fbb05f923540c06970bf270caea.zip
Merge remote-tracking branch 'github-nickvergessen/ticket/12371' into develop-ascraeus
* github-nickvergessen/ticket/12371: [ticket/12371] Fix language string [ticket/12371] Fix typos in comment [ticket/12371] Fix redirect link for approve_post and post_in_queue [ticket/12371] Delete the approve_post notification when editing a post [ticket/12371] Fix language in comment [ticket/12371] Reapprove the post and topic again in tests [ticket/12371] Correctly set is_starter when editing first post of the topic [ticket/12371] Add functional tests for reapproving [ticket/12371] Fix query in mcp_sorting() [ticket/12371] Rename disapprove and softdelete tests [ticket/12371] We do not group quote notifications anymore [ticket/12371] Fix SQL query [ticket/11772] Do not send out new topic/post notifications when reapproving [ticket/12052] Use different visibility when post was edited [ticket/12052] Add support for ITEM_UNAPPROVED to set_post_visibility method [ticket/12371] Do not add unlimited users as responders [ticket/12371] Do not update the notification entry unneccessarily [ticket/12371] Do not delete post related notifications when a post is deleted [ticket/12371] Allow notification types to redirect to a different url [ticket/12371] Do not group "quote" notifications
Diffstat (limited to 'phpBB/includes/mcp/mcp_queue.php')
-rw-r--r--phpBB/includes/mcp/mcp_queue.php45
1 files changed, 30 insertions, 15 deletions
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index f0a38db033..a71bc997e9 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -115,10 +115,10 @@ class mcp_queue
if (!empty($topic_id_list))
{
- $post_visibility = ($mode == 'deleted_topics') ? ITEM_DELETED : ITEM_UNAPPROVED;
+ $post_visibility = ($mode == 'deleted_topics') ? ITEM_DELETED : array(ITEM_UNAPPROVED, ITEM_REAPPROVE);
$sql = 'SELECT post_id
FROM ' . POSTS_TABLE . '
- WHERE post_visibility = ' . $post_visibility . '
+ WHERE ' . $db->sql_in_set('post_visibility', $post_visibility) . '
AND ' . $db->sql_in_set('topic_id', $topic_id_list);
$result = $db->sql_query($sql);
@@ -281,7 +281,7 @@ class mcp_queue
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;p=$post_id&amp;f=$forum_id"),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_POST_REPORTED' => $post_info['post_reported'],
- 'S_POST_UNAPPROVED' => ($post_info['post_visibility'] == ITEM_UNAPPROVED),
+ 'S_POST_UNAPPROVED' => $post_info['post_visibility'] == ITEM_UNAPPROVED || $post_info['post_visibility'] == ITEM_REAPPROVE,
'S_POST_LOCKED' => $post_info['post_edit_locked'],
'S_USER_NOTES' => true,
'S_POST_DELETED' => ($post_info['post_visibility'] == ITEM_DELETED),
@@ -330,7 +330,7 @@ class mcp_queue
$m_perm = 'm_approve';
$is_topics = ($mode == 'unapproved_topics' || $mode == 'deleted_topics') ? true : false;
$is_restore = ($mode == 'deleted_posts' || $mode == 'deleted_topics') ? true : false;
- $visibility_const = (!$is_restore) ? ITEM_UNAPPROVED : ITEM_DELETED;
+ $visibility_const = (!$is_restore) ? array(ITEM_UNAPPROVED, ITEM_REAPPROVE) : ITEM_DELETED;
$user->add_lang(array('viewtopic', 'viewforum'));
@@ -418,7 +418,7 @@ class mcp_queue
$sql = 'SELECT p.post_id
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . '
WHERE ' . $db->sql_in_set('p.forum_id', $forum_list) . '
- AND p.post_visibility = ' . $visibility_const . '
+ AND ' . $db->sql_in_set('p.post_visibility', $visibility_const) . '
' . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . '
' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . "
AND t.topic_id = p.topic_id
@@ -471,7 +471,7 @@ class mcp_queue
$sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, t.topic_title AS post_subject, t.topic_time AS post_time, t.topic_poster AS poster_id, t.topic_first_post_id AS post_id, t.topic_attachment AS post_attachment, t.topic_first_poster_name AS username, t.topic_first_poster_colour AS user_colour
FROM ' . TOPICS_TABLE . ' t
WHERE ' . $db->sql_in_set('forum_id', $forum_list) . '
- AND topic_visibility = ' . $visibility_const . "
+ AND ' . $db->sql_in_set('topic_visibility', $visibility_const) . "
AND topic_delete_user <> 0
$limit_time_sql
ORDER BY $sort_order_sql";
@@ -659,11 +659,18 @@ class mcp_queue
}
$phpbb_notifications->delete_notifications('post_in_queue', $post_id);
- $phpbb_notifications->add_notifications(array(
- 'quote',
- 'bookmark',
- 'post',
- ), $post_data);
+ // Only add notifications, if we are not reapproving post
+ // When the topic was already approved, but was edited and
+ // now needs re-approval, we don't want to notify the users
+ // again.
+ if ($post_data['post_visibility'] == ITEM_UNAPPROVED)
+ {
+ $phpbb_notifications->add_notifications(array(
+ 'quote',
+ 'bookmark',
+ 'post',
+ ), $post_data);
+ }
$phpbb_notifications->mark_notifications_read(array(
'quote',
@@ -831,10 +838,18 @@ class mcp_queue
));
$phpbb_notifications->delete_notifications('topic_in_queue', $topic_id);
- $phpbb_notifications->add_notifications(array(
- 'quote',
- 'topic',
- ), $topic_data);
+
+ // Only add notifications, if we are not reapproving post
+ // When the topic was already approved, but was edited and
+ // now needs re-approval, we don't want to notify the users
+ // again.
+ if ($topic_data['topic_visibility'] == ITEM_UNAPPROVED)
+ {
+ $phpbb_notifications->add_notifications(array(
+ 'quote',
+ 'topic',
+ ), $topic_data);
+ }
$phpbb_notifications->mark_notifications_read('quote', $topic_data['post_id'], $user->data['user_id']);
$phpbb_notifications->mark_notifications_read('topic', $topic_id, $user->data['user_id']);