mirror of
https://github.com/phpbb/phpbb.git
synced 2025-04-21 16:22:22 +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:
commit
be52ea882a
@ -1657,7 +1657,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
if ($user->data['user_id'] != $poster_id)
|
||||
{
|
||||
$log_subject = ($subject) ? $subject : $data['topic_title'];
|
||||
add_log('mod', $data['forum_id'], $data['topic_id'], 'LOG_POST_EDITED', $log_subject, (!empty($username)) ? $username : $user->lang['GUEST']);
|
||||
add_log('mod', $data['forum_id'], $data['topic_id'], 'LOG_POST_EDITED', $log_subject, (!empty($username)) ? $username : $user->lang['GUEST'], $data['post_edit_reason']);
|
||||
}
|
||||
|
||||
if (!isset($sql_data[POSTS_TABLE]['sql']))
|
||||
|
@ -123,7 +123,7 @@ class mcp_main
|
||||
trigger_error('NO_TOPIC_SELECTED');
|
||||
}
|
||||
|
||||
mcp_delete_topic($topic_ids, $soft_delete, ($soft_delete) ? $request->variable('delete_reason', '', true) : '');
|
||||
mcp_delete_topic($topic_ids, $soft_delete, $request->variable('delete_reason', '', true));
|
||||
break;
|
||||
|
||||
case 'delete_post':
|
||||
@ -140,7 +140,7 @@ class mcp_main
|
||||
trigger_error('NO_POST_SELECTED');
|
||||
}
|
||||
|
||||
mcp_delete_post($post_ids, $soft_delete, ($soft_delete) ? $request->variable('delete_reason', '', true) : '');
|
||||
mcp_delete_post($post_ids, $soft_delete, $request->variable('delete_reason', '', true));
|
||||
break;
|
||||
|
||||
case 'restore_topic':
|
||||
@ -787,12 +787,12 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
|
||||
$return = $phpbb_content_visibility->set_topic_visibility(ITEM_DELETED, $topic_id, $row['forum_id'], $user->data['user_id'], time(), $soft_delete_reason);
|
||||
if (!empty($return))
|
||||
{
|
||||
add_log('mod', $row['forum_id'], $topic_id, 'LOG_SOFTDELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name']);
|
||||
add_log('mod', $row['forum_id'], $topic_id, 'LOG_SOFTDELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name'], $soft_delete_reason);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name']);
|
||||
add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name'], $soft_delete_reason);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -826,7 +826,6 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
|
||||
'S_TOPIC_MODE' => true,
|
||||
'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id),
|
||||
'S_ALLOWED_SOFTDELETE' => $auth->acl_get('m_softdelete', $forum_id),
|
||||
'S_DELETE_REASON' => $auth->acl_get('m_softdelete', $forum_id),
|
||||
));
|
||||
|
||||
$l_confirm = (sizeof($topic_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS';
|
||||
@ -947,7 +946,7 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
|
||||
foreach ($approve_log as $row)
|
||||
{
|
||||
$post_username = ($row['poster_id'] == ANONYMOUS && !empty($row['post_username'])) ? $row['post_username'] : $row['username'];
|
||||
add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_SOFTDELETE_POST', $row['post_subject'], $post_username);
|
||||
add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_SOFTDELETE_POST', $row['post_subject'], $post_username, $soft_delete_reason);
|
||||
}
|
||||
|
||||
$topic_id = $request->variable('t', 0);
|
||||
@ -990,7 +989,7 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
|
||||
foreach ($post_data as $id => $row)
|
||||
{
|
||||
$post_username = ($row['poster_id'] == ANONYMOUS && !empty($row['post_username'])) ? $row['post_username'] : $row['username'];
|
||||
add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject'], $post_username);
|
||||
add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject'], $post_username, $soft_delete_reason);
|
||||
}
|
||||
|
||||
// Now delete the posts, topics and forums are automatically resync'ed
|
||||
@ -1063,7 +1062,6 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
|
||||
'S_SOFTDELETED' => $only_softdeleted,
|
||||
'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id),
|
||||
'S_ALLOWED_SOFTDELETE' => $auth->acl_get('m_softdelete', $forum_id),
|
||||
'S_DELETE_REASON' => $auth->acl_get('m_softdelete', $forum_id),
|
||||
));
|
||||
|
||||
$l_confirm = (sizeof($post_ids) == 1) ? 'DELETE_POST' : 'DELETE_POSTS';
|
||||
|
@ -548,9 +548,9 @@ $lang = array_merge($lang, array(
|
||||
|
||||
'LOG_APPROVE_TOPIC' => '<strong>Approved topic</strong><br />» %s',
|
||||
'LOG_BUMP_TOPIC' => '<strong>User bumped topic</strong><br />» %s',
|
||||
'LOG_DELETE_POST' => '<strong>Deleted post “%1$s” written by</strong><br />» %2$s',
|
||||
'LOG_DELETE_POST' => '<strong>Deleted post “%1$s” written by “%2$s” for the following reason</strong><br />» %3$s',
|
||||
'LOG_DELETE_SHADOW_TOPIC' => '<strong>Deleted shadow topic</strong><br />» %s',
|
||||
'LOG_DELETE_TOPIC' => '<strong>Deleted topic “%1$s” written by</strong><br />» %2$s',
|
||||
'LOG_DELETE_TOPIC' => '<strong>Deleted topic “%1$s” written by “%2$s” for the following reason</strong><br />» %3$s',
|
||||
'LOG_FORK' => '<strong>Copied topic</strong><br />» from %s',
|
||||
'LOG_LOCK' => '<strong>Locked topic</strong><br />» %s',
|
||||
'LOG_LOCK_POST' => '<strong>Locked post</strong><br />» %s',
|
||||
@ -560,13 +560,13 @@ $lang = array_merge($lang, array(
|
||||
'LOG_PM_REPORT_DELETED' => '<strong>Deleted PM report</strong><br />» %s',
|
||||
'LOG_POST_APPROVED' => '<strong>Approved post</strong><br />» %s',
|
||||
'LOG_POST_DISAPPROVED' => '<strong>Disapproved post “%1$s” written by “%3$s” for the following reason</strong><br />» %2$s',
|
||||
'LOG_POST_EDITED' => '<strong>Edited post “%1$s” written by</strong><br />» %2$s',
|
||||
'LOG_POST_EDITED' => '<strong>Edited post “%1$s” written by “%2$s” for the following reason</strong><br />» %3$s',
|
||||
'LOG_POST_RESTORED' => '<strong>Restored post</strong><br />» %s',
|
||||
'LOG_REPORT_CLOSED' => '<strong>Closed report</strong><br />» %s',
|
||||
'LOG_REPORT_DELETED' => '<strong>Deleted report</strong><br />» %s',
|
||||
'LOG_RESTORE_TOPIC' => '<strong>Restored topic “%1$s” written by</strong><br />» %2$s',
|
||||
'LOG_SOFTDELETE_POST' => '<strong>Soft deleted post “%1$s” written by</strong><br />» %2$s',
|
||||
'LOG_SOFTDELETE_TOPIC' => '<strong>Soft deleted topic “%1$s” written by</strong><br />» %2$s',
|
||||
'LOG_SOFTDELETE_POST' => '<strong>Soft deleted post “%1$s” written by “%2$s” for the following reason</strong><br />» %3$s',
|
||||
'LOG_SOFTDELETE_TOPIC' => '<strong>Soft deleted topic “%1$s” written by “%2$s” for the following reason</strong><br />» %3$s',
|
||||
'LOG_SPLIT_DESTINATION' => '<strong>Moved split posts</strong><br />» to %s',
|
||||
'LOG_SPLIT_SOURCE' => '<strong>Split posts</strong><br />» from %s',
|
||||
|
||||
|
@ -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';
|
||||
|
@ -2,23 +2,19 @@
|
||||
<form action="{S_CONFIRM_ACTION}" method="post">
|
||||
<p>{MESSAGE_TEXT}</p>
|
||||
|
||||
<!-- IF not S_SOFTDELETED and (S_DELETE_REASON or (S_ALLOWED_DELETE and S_ALLOWED_SOFTDELETE)) -->
|
||||
<!-- IF S_ALLOWED_DELETE and S_ALLOWED_SOFTDELETE -->
|
||||
<label>
|
||||
<strong>{L_DELETE_PERMANENTLY}{L_COLON}</strong>
|
||||
<input id="delete_permanent" name="delete_permanent" type="checkbox" value="1" {S_CHECKED_PERMANENT} />
|
||||
<!-- IF S_TOPIC_MODE -->{L_DELETE_TOPIC_PERMANENTLY}<!-- ELSE -->{L_DELETE_POST_PERMANENTLY}<!-- ENDIF -->
|
||||
</label>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DELETE_REASON -->
|
||||
<label for="delete_reason">
|
||||
<strong>{L_DELETE_REASON}{L_COLON}</strong><br /><span>{L_DELETE_REASON_EXPLAIN}</span><br />
|
||||
<input type="text" name="delete_reason" value="" class="inputbox autowidth" maxlength="120" size="45" />
|
||||
</label>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF not S_SOFTDELETED and S_ALLOWED_DELETE and S_ALLOWED_SOFTDELETE -->
|
||||
<label>
|
||||
<strong>{L_DELETE_PERMANENTLY}{L_COLON}</strong>
|
||||
<input id="delete_permanent" name="delete_permanent" type="checkbox" value="1" {S_CHECKED_PERMANENT} />
|
||||
<!-- IF S_TOPIC_MODE -->{L_DELETE_TOPIC_PERMANENTLY}<!-- ELSE -->{L_DELETE_POST_PERMANENTLY}<!-- ENDIF -->
|
||||
</label>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<label for="delete_reason">
|
||||
<strong>{L_DELETE_REASON}{L_COLON}</strong><br /><span>{L_DELETE_REASON_EXPLAIN}</span><br />
|
||||
<input type="text" name="delete_reason" value="" class="inputbox autowidth" maxlength="120" size="45" />
|
||||
</label>
|
||||
|
||||
<fieldset class="submit-buttons">
|
||||
<input type="button" name="confirm" value="{L_YES}" class="button1" />
|
||||
<input type="button" name="cancel" value="{L_NO}" class="button2" />
|
||||
@ -37,9 +33,8 @@
|
||||
|
||||
<p>{MESSAGE_TEXT}</p>
|
||||
|
||||
<!-- IF not S_SOFTDELETED and (S_DELETE_REASON or (S_ALLOWED_DELETE and S_ALLOWED_SOFTDELETE)) -->
|
||||
<fieldset class="fields1">
|
||||
<!-- IF S_ALLOWED_DELETE and S_ALLOWED_SOFTDELETE -->
|
||||
<!-- IF not S_SOFTDELETED and S_ALLOWED_DELETE and S_ALLOWED_SOFTDELETE -->
|
||||
<dl>
|
||||
<dt><label for="delete_permanent">{L_DELETE_PERMANENTLY}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
@ -51,14 +46,11 @@
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DELETE_REASON -->
|
||||
<dl>
|
||||
<dt><label for="delete_reason">{L_DELETE_REASON}{L_COLON}</label><br /><span>{L_DELETE_REASON_EXPLAIN}</span></dt>
|
||||
<dd><input type="text" name="delete_reason" id="delete_reason" value="" class="inputbox autowidth" maxlength="120" size="45" /></dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<dl>
|
||||
<dt><label for="delete_reason">{L_DELETE_REASON}{L_COLON}</label><br /><span>{L_DELETE_REASON_EXPLAIN}</span></dt>
|
||||
<dd><input type="text" name="delete_reason" id="delete_reason" value="" class="inputbox autowidth" maxlength="120" size="45" /></dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<fieldset class="submit-buttons">
|
||||
{S_HIDDEN_FIELDS}
|
||||
|
@ -14,26 +14,23 @@
|
||||
<p class="gen">{MESSAGE_TEXT}</p>
|
||||
<br />
|
||||
|
||||
<!-- IF not S_SOFTDELETED and (S_DELETE_REASON or (S_ALLOWED_DELETE and S_ALLOWED_SOFTDELETE)) -->
|
||||
<table border="0" width="90%" cellspacing="2" cellpadding="1">
|
||||
<!-- IF S_ALLOWED_DELETE and S_ALLOWED_SOFTDELETE -->
|
||||
<tr>
|
||||
<td class="row1" width="22%"><b class="gen">{L_DELETE_PERMANENTLY}{L_COLON}</b></td>
|
||||
<td class="row1" width="78%">
|
||||
<input id="delete_permanent" name="delete_permanent" type="checkbox" value="1" {S_CHECKED_PERMANENT} />
|
||||
<!-- IF S_TOPIC_MODE -->{L_DELETE_TOPIC_PERMANENTLY}<!-- ELSE -->{L_DELETE_POST_PERMANENTLY}<!-- ENDIF -->
|
||||
</td>
|
||||
</tr>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF S_DELETE_REASON -->
|
||||
<tr>
|
||||
<td class="row1" valign="top"><span class="gen"><b>{L_DELETE_REASON}{L_COLON}</b></span><br /><span class="gensmall">{L_DELETE_REASON_EXPLAIN}</span></td>
|
||||
<td class="row1"><input type="text" name="delete_reason" value="" class="inputbox autowidth" maxlength="120" size="45" /></td>
|
||||
</tr>
|
||||
<!-- ENDIF -->
|
||||
</table>
|
||||
<br />
|
||||
<table border="0" width="90%" cellspacing="2" cellpadding="1">
|
||||
<!-- IF not S_SOFTDELETED and S_ALLOWED_DELETE and S_ALLOWED_SOFTDELETE -->
|
||||
<tr>
|
||||
<td class="row1" width="22%"><b class="gen">{L_DELETE_PERMANENTLY}{L_COLON}</b></td>
|
||||
<td class="row1" width="78%">
|
||||
<input id="delete_permanent" name="delete_permanent" type="checkbox" value="1" {S_CHECKED_PERMANENT} />
|
||||
<!-- IF S_TOPIC_MODE -->{L_DELETE_TOPIC_PERMANENTLY}<!-- ELSE -->{L_DELETE_POST_PERMANENTLY}<!-- ENDIF -->
|
||||
</td>
|
||||
</tr>
|
||||
<!-- ENDIF -->
|
||||
<tr>
|
||||
<td class="row1" valign="top"><span class="gen"><b>{L_DELETE_REASON}{L_COLON}</b></span><br /><span class="gensmall">{L_DELETE_REASON_EXPLAIN}</span></td>
|
||||
<td class="row1"><input type="text" name="delete_reason" value="" class="inputbox autowidth" maxlength="120" size="45" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
|
||||
{S_HIDDEN_FIELDS}
|
||||
<input type="submit" name="confirm" value="{L_YES}" class="btnmain" />
|
||||
<input type="submit" name="cancel" value="{L_NO}" class="btnlite" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user