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
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
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
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
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
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
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
Joas Schilling
8b2181eb85
[feature/soft-delete] Comment out stuff about f_restore for performance reason
...
PHPBB3-9657
2012-09-28 16:14:44 +02:00
Joas Schilling
3bc3cf6e00
[feature/soft-delete] Update column names in update script and add permissions
...
PHPBB3-9657
2012-08-30 23:05:28 +02:00
Joas Schilling
c03d692a98
[feature/soft-delete] Fix some more usages of _approved column names
...
PHPBB3-9657
2012-08-30 22:57:00 +02:00
Joas Schilling
625e7ef58a
[feature/soft-delete] Update development scripts with new column names
...
PHPBB3-9657
2012-08-30 22:54:24 +02:00
Joas Schilling
a6d3432f8b
[feature/soft-delete] Update search to use $post_visibility
...
Todo: Sphinx currently does not respect this setting at all.
PHPBB3-9657
2012-08-30 22:20:52 +02:00
Joas Schilling
5b54ec2d64
[feature/soft-delete] Try to fix search.php
...
at least it's running now, but the performance is not very good.
PHPBB3-9657
2012-08-30 19:47:16 +02:00
Joas Schilling
1c043254c0
[feature/soft-delete] Add get_visibility_sql_forums based on global
...
The resulting query is 4-times faster, as the forum_id IN () arrays are
smaller and we need less AND/OR to build the hole query. The main difference
between those two functions is, that this one takes an array of included ids and
the _global one takes an array of excluded ids.
PHPBB3-9657
2012-08-30 18:07:00 +02:00
Joas Schilling
df83f22b71
[feature/soft-delete] Fix copy-paste fail for database update on the index
...
PHPBB3-9657
2012-08-30 16:21:27 +02:00
Joas Schilling
a1e0690b6b
[feature/soft-delete] Simplification part2: user can see all item visibilities
...
If the user can see all visibilities, we can simply leave out the query part,
instead of adding a bunch of ANDs.
PHPBB3-9657
2012-08-29 22:12:33 +02:00
Joas Schilling
44ed05f567
[feature/soft-delete] Simplify the query output if the user has m_restore
...
PHPBB3-9657
2012-08-29 19:30:33 +02:00
Joas Schilling
36c9f6aa87
[feature/soft-delete] Update posts and topics table with database_update.php
...
PHPBB3-9657
2012-08-29 19:11:33 +02:00
Joas Schilling
8a036fa3e4
[feature/soft-delete] Update restoring feature to use ajax if requested.
...
Also fixes the mcp as a hole:
- displayes a success message
- gives a link to the post, if only one was restored
PHPBB3-9657
2012-08-29 18:42:14 +02:00
Joas Schilling
b774c09c7f
[feature/soft-delete] Use the variable which holds the correct item status
...
PHPBB3-9657
2012-08-29 17:50:14 +02:00
Joas Schilling
d9a93a9cdc
[feature/soft-delete] Fix missing AND in query
...
PHPBB3-9657
2012-08-29 17:50:14 +02:00
Joas Schilling
910f1602cd
[feature/soft-delete] Fix displaying of "deleted post" note in viewtopic
...
PHPBB3-9657
2012-08-29 17:50:14 +02:00
Joas Schilling
9300ff4c6e
[feature/soft-delete] Remove imageset/ which was created by merge conflict
...
We don't have imagesets in 3.1 anymore.
PHPBB3-9657
2012-08-29 17:50:13 +02:00
Joas Schilling
9abfba5191
[feature/soft-delete] Fix the schema files to the correct line ends again
...
PHPBB3-9657
2012-08-29 17:50:13 +02:00
Joas Schilling
1935568c3e
[feature/soft-delete] Fix typo in column name topic_visibility
...
PHPBB3-9657
2012-08-29 17:50:13 +02:00
Joas Schilling
5ff35ccf72
[feature/soft-delete] Use autoloading for content_visibility class
...
PHPBB3-9657
2012-08-29 17:50:12 +02:00