[ticket/11942] Always display delete reason

PHPBB3-11942
This commit is contained in:
Tristan Darricau 2014-05-11 19:28:26 +02:00
parent cc1a304da6
commit 237619792d
3 changed files with 8 additions and 16 deletions

View file

@ -823,7 +823,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';
@ -1060,7 +1059,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';

View file

@ -1740,14 +1740,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';

View file

@ -11,12 +11,10 @@
</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 -->
<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 -->
<fieldset class="submit-buttons">
@ -51,12 +49,10 @@
</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 -->