1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 12:03:21 +01:00

14141 Commits

Author SHA1 Message Date
Joas Schilling
3773cbdf85 [feature/soft-delete] Fix displaying of details module
PHPBB3-9567
2012-10-15 20:51:31 +02:00
Joas Schilling
33073fafbe [feature/soft-delete] Add module for soft deleted topics
Unapproved/soft deleted posts are posts, that have a different visibility than
the topic. All others will be hidden from the posts list and can be managed
with the topic modules.

PHPBB3-9567
2012-10-15 15:53:32 +02:00
Joas Schilling
b1ce8a8c13 [feature/soft-delete] Add checkbox to restoring posts like on approve
PHPBB3-9567
2012-10-15 15:19:32 +02:00
Joas Schilling
a92927d24c [feature/soft-delete] Turn other functions into methods as well
PHPBB3-9567
2012-10-15 15:05:02 +02:00
Joas Schilling
7c2cc9cfef [feature/soft-delete] Turn restore_post() into a method and add the docs
PHPBB3-9567
2012-10-15 14:02:16 +02:00
Joas Schilling
a58a76ef5f [feature/soft-delete] Fix permission check in viewtopic.php
PHPBB3-9567
2012-10-15 13:17:05 +02:00
Joas Schilling
4bf922fa03 [feature/soft-delete] Fix restoring posts via MCP
PHPBB3-9567
2012-10-13 19:00:08 +02:00
Joas Schilling
18f77020e5 [feature/soft-delete] Fix several problems in the forum mcp
PHPBB3-9567
2012-10-10 23:10:46 +02:00
Joas Schilling
e4c9e55b53 [feature/soft-delete] Fix several issues within submit_post()
- $post_visibility is not boolean, so we need to check for == ITEM_APPROVED
- sync() already updates the topic/forum info, so we don't need to do that again
- use set_post_visibility() when changing the posts visibility

Should be ready for testing.

PHPBB3-9567
2012-10-09 22:24:06 +02:00
Joas Schilling
70fa983fa8 [feature/soft-delete] Do not allow users to reply to soft deleted topics
We should discuss this in an RFC again, but for now, we just fix the old state.
So moderators can only reply, when the topic is approved.
Also fixes a bug in the visibility check. We need to check the posts visibility
rather then the visibility of the topic. Because when the post is visible, the
topic is as well, but not the other way round.

PHPBB3-9567
2012-10-09 17:38:08 +02:00
Joas Schilling
fbf85b76c1 [feature/soft-delete] Correctly synchronize the topic_visibility in sync()
This also makes sync('topic_visibility') obsolete, but we keep it for now.
Also fix a unit test, because ITEM_DELETED overpowers ITEM_UNAPPROVED

PHPBB3-9567
2012-10-09 15:38:50 +02:00
Joas Schilling
224be5bc4f [feature/soft-delete] Fix sync('topic_visibility')
The function can not rely on the first post anymore, as that one could be soft
deleted but the topic still has approved replies which are still visible.

PHPBB3-9567
2012-10-09 14:02:42 +02:00
Joas Schilling
8267cbbd03 [feature/soft-delete] Forgot that file when removing the old tests
PHPBB3-9567
2012-10-09 13:27:09 +02:00
Joas Schilling
4a3cac0ccb [feature/soft-delete] Fix column name in mcp_sorting()
PHPBB3-9567
2012-10-09 13:20:32 +02:00
Joas Schilling
7cc8b3eef8 [feature/soft-delete] Correctly update user_posts count
Before soft delete this was much easier, as an unapproved topic could only
have one post, because no one could reply to unapproved topics. Now we need
to run multiple queries to correctly reduce the post counts.

PHPBB3-9567
2012-10-09 12:23:15 +02:00
Joas Schilling
2841ecc44f [feature/soft-delete] Fix display_user_activity()
The Logic of $forum_ary was inverted, so if the array is empty, we can skip
the queries. We also should not merge passworded forums into the $forum_ary
as we removed them from that array right before that.

PHPBB3-9567
2012-10-09 12:08:17 +02:00
Joas Schilling
9441774288 [feature/soft-delete] Topic visibility is already synced by sync('topic')
PHPBB3-9567
2012-10-09 11:55:31 +02:00
Joas Schilling
e447a0fa07 [feature/soft-delete] Fix restoring a post via editing
PHPBB3-9567
2012-10-08 23:09:31 +02:00
Joas Schilling
53e01bba19 [feature/soft-delete] Update post counts within set_post_visibility
This is an additional query in some rare cases,
but it makes it much easier to use and understand.
This is mostly a preparation for the restore case.

PHPBB3-9567
2012-10-08 22:47:50 +02:00
Joas Schilling
91398c9e48 [feature/soft-delete] Change order of functions
PHPBB3-9567
2012-10-08 15:03:54 +02:00
Joas Schilling
c525e900d3 [feature/soft-delete] Allow to update multiple posts with set_post_visibility
PHPBB3-9567
2012-10-08 15:01:20 +02:00
Joas Schilling
25804eb8e8 [feature/soft-delete] Add test case for (soft)deleting the only post + fix
PHPBB3-9567
2012-10-06 19:56:52 +02:00
Joas Schilling
44005f338e [feature/soft-delete] Fix delete_post() function
PHPBB3-9567
2012-10-06 16:36:38 +02:00
Joas Schilling
7c09b5b89c [feature/soft-delete] Add some unit tests for delete_post()
PHPBB3-9567
2012-10-06 16:31:05 +02:00
Joas Schilling
009bd698fb [feature/soft-delete] Update and simplify the logic on delete_post()
Todo: delete_topic case

PHPBB3-9567
2012-10-06 03:59:49 +02:00
Joas Schilling
3088855aa6 [feature/soft-delete] Fix SQL error in search
PHPBB3-9567
2012-10-05 17:46:29 +02:00
Joas Schilling
c22d5bd37c [feature/soft-delete] Clean the code of hide_post() and rely on postcount
PHPBB3-9567
2012-10-05 17:00:14 +02:00
Joas Schilling
05f2366755 [feature/soft-delete] Update docs of can_soft_delete and remove can_restore
PHPBB3-9567
2012-10-05 14:42:11 +02:00
Joas Schilling
526721c7db [feature/soft-delete] Fix set_topic_visibility() so it passes the tests
PHPBB3-9567
2012-10-05 14:26:52 +02:00
Joas Schilling
b9d363f6cc [feature/soft-delete] Add unit tests for set_topic_visibility()
PHPBB3-9567
2012-10-05 14:26:09 +02:00
Joas Schilling
7969cc7319 [feature/soft-delete] Fix docs of set_post_visibility()
PHPBB3-9567
2012-10-05 13:31:47 +02:00
Joas Schilling
01a78907bd [feature/soft-delete] Update set_topic_visibility() with some more logic
By default, when a soft deleted topic is restored. Only posts that were
approved at the time of soft deleting, are being restored. Same applies to
soft deleting. Only approved posts will be marked as soft deleted.

If you want to update all posts, use the force option.

PHPBB3-9567
2012-10-05 13:30:59 +02:00
Joas Schilling
92c5039af9 [feature/soft-delete] Allow forcing the set_visibility for all posts
PHPBB3-9567
2012-10-05 13:18:06 +02:00
Joas Schilling
42bb97a95c [feature/soft-delete] Make use of set_post_visibility() limits when applicable
PHPBB3-9567
2012-10-05 13:15:55 +02:00
Joas Schilling
bfa6a50a4f [feature/soft-delete] Extend functionality for updating a hole topic
Limit the posts to a certain visibility and deletion time
This allows us to only restore posts, that were approved
when the topic got soft deleted. So previous soft deleted
and unapproved posts are still soft deleted/unapproved

PHPBB3-9567
2012-10-05 13:12:36 +02:00
Joas Schilling
63d11c976b [feature/soft-delete] Fix sync('topic') to match the new logic
This also fixes set_post_visibility()

PHPBB3-9567
2012-10-05 12:39:05 +02:00
Joas Schilling
2a81e4b48e [feature/soft-delete] Fix the get functions to match the new logic
PHPBB3-9567
2012-10-05 12:06:36 +02:00
Joas Schilling
959525cebe [feature/soft-delete] Merge functionality of m_approve and m_restore
The problems with having two different permissions are just too big and cause
huge queries, if they are granted differently. Also it's quite hard to decide
what should happen when a moderator has only one permission and the topic has
only posts of the two hidden types. To avoid all this, we merge them so it's a
simple switch: either the user is a moderator, then he can see all posts,
or he is not, then he can only see approved ones.

PHPBB3-9567
2012-10-05 12:05:22 +02:00
Joas Schilling
b8642d7c8a [feature/soft-delete] Test topic visibility as well
PHPBB3-9657
2012-10-05 11:04:56 +02:00
Joas Schilling
5b64ebc11d [feature/soft-delete] Fix a bug in sync() and set_post_visibility()
PHPBB3-9657
2012-10-02 15:34:18 +02:00
Joas Schilling
1f8f07b998 [feature/soft-delete] Add unit tests for simple cases of set_post_visibility
These tests require at least one remaining post.

PHPBB3-9657
2012-10-02 15:32:12 +02:00
Joas Schilling
c36c69c1d4 [feature/soft-delete] Remove unneeded require_once()
PHPBB3-9657
2012-10-02 12:54:47 +02:00
Joas Schilling
a84e4029e4 [feature/soft-delete] Update doc blocks to proper format
PHPBB3-9657
2012-10-02 12:51:59 +02:00
Joas Schilling
b629b2cd95 [feature/soft-delete] Add unit tests for get_global_visibility_sql()
PHPBB3-9657
2012-10-01 22:44:39 +02:00
Joas Schilling
4a65940e62 [feature/soft-delete] Add unit tests for get_forums_visibility_sql()
PHPBB3-9657
2012-10-01 22:14:04 +02:00
Joas Schilling
280619eea9 [feature/soft-delete] Add unit tests for get_visibility_sql()
PHPBB3-9657
2012-10-01 17:13:15 +02:00
Joas Schilling
38d83da69e [feature/soft-delete] Remove old unit tests
PHPBB3-9657
2012-10-01 16:38:28 +02:00
Joas Schilling
1943de36f3 [feature/soft-delete] Comment out user_posts update for the moment
It should rely on the permissions of the post not the current user.

PHPBB3-9657
2012-10-01 16:25:05 +02:00
Joas Schilling
e5377e98c7 [feature/soft-delete] Allow setting the visibility change reason
PHPBB3-9657
2012-09-28 16:53:38 +02:00
Joas Schilling
dc2835af78 [feature/soft-delete] Add columns for soft delete details
PHPBB3-9657
2012-09-28 16:17:21 +02:00