mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-13 12:14:06 +02:00
Merge pull request #2357 from Nicofuma/ticket/11942
[ticket/11942] Delete post/topic reason should be added to logs * Nicofuma/ticket/11942: [ticket/11942] Don't change the reason to '' when hard deleting [ticket/11942] Don't show the checkbox if the post is already soft-deleted [ticket/11942] Remove useless IF in templates [ticket/11942] Apply the modifications to subsilver [ticket/11942] Always display delete reason [ticket/11942] Edits messages [ticket/11942] Change the formulation [ticket/11942] Adding the reason to hard deleted topic/post [ticket/11942] Delete post/topic reason should be added to logs
This commit is contained in:
@@ -1571,7 +1571,6 @@ $page_data = array(
|
||||
'S_LOCK_POST_ALLOWED' => ($mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? true : false,
|
||||
'S_LOCK_POST_CHECKED' => ($lock_post_checked) ? ' checked="checked"' : '',
|
||||
'S_SOFTDELETE_CHECKED' => ($mode == 'edit' && $post_data['post_visibility'] == ITEM_DELETED) ? ' checked="checked"' : '',
|
||||
'S_DELETE_REASON' => ($mode == 'edit' && $auth->acl_get('m_softdelete', $forum_id)) ? true : false,
|
||||
'S_SOFTDELETE_ALLOWED' => ($mode == 'edit' && $phpbb_content_visibility->can_soft_delete($forum_id, $post_data['poster_id'], $lock_post_checked)) ? true : false,
|
||||
'S_RESTORE_ALLOWED' => $auth->acl_get('m_approve', $forum_id),
|
||||
'S_IS_DELETED' => ($mode == 'edit' && $post_data['post_visibility'] == ITEM_DELETED) ? true : false,
|
||||
@@ -1781,14 +1780,14 @@ function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $is_sof
|
||||
|
||||
if ($next_post_id === false)
|
||||
{
|
||||
add_log('mod', $forum_id, $topic_id, (($is_soft) ? 'LOG_SOFTDELETE_TOPIC' : 'LOG_DELETE_TOPIC'), $post_data['topic_title'], $post_username);
|
||||
add_log('mod', $forum_id, $topic_id, (($is_soft) ? 'LOG_SOFTDELETE_TOPIC' : 'LOG_DELETE_TOPIC'), $post_data['topic_title'], $post_username, $soft_delete_reason);
|
||||
|
||||
$meta_info = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id");
|
||||
$message = $user->lang['POST_DELETED'];
|
||||
}
|
||||
else
|
||||
{
|
||||
add_log('mod', $forum_id, $topic_id, (($is_soft) ? 'LOG_SOFTDELETE_POST' : 'LOG_DELETE_POST'), $post_data['post_subject'], $post_username);
|
||||
add_log('mod', $forum_id, $topic_id, (($is_soft) ? 'LOG_SOFTDELETE_POST' : 'LOG_DELETE_POST'), $post_data['post_subject'], $post_username, $soft_delete_reason);
|
||||
|
||||
$meta_info = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&p=$next_post_id") . "#p$next_post_id";
|
||||
$message = $user->lang['POST_DELETED'];
|
||||
@@ -1812,14 +1811,12 @@ function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $is_sof
|
||||
|
||||
$can_delete = $auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_delete', $forum_id));
|
||||
$can_softdelete = $auth->acl_get('m_softdelete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_softdelete', $forum_id));
|
||||
$display_reason = $auth->acl_get('m_softdelete', $forum_id) || ($can_delete && $can_softdelete);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_SOFTDELETED' => $post_data['post_visibility'] == ITEM_DELETED,
|
||||
'S_CHECKED_PERMANENT' => $request->is_set_post('delete_permanent') ? ' checked="checked"' : '',
|
||||
'S_ALLOWED_DELETE' => $can_delete,
|
||||
'S_ALLOWED_SOFTDELETE' => $can_softdelete,
|
||||
'S_DELETE_REASON' => $display_reason,
|
||||
));
|
||||
|
||||
$l_confirm = 'DELETE_POST';
|
||||
|
Reference in New Issue
Block a user