1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-21 16:22:22 +02:00

Merge pull request #3044 from Elsensee/ticket/13100

[ticket/13100] Display only confirmation buttons when deleting shadow topic
This commit is contained in:
Joas Schilling 2014-11-21 20:59:22 +01:00
commit d56da0d68f
3 changed files with 18 additions and 2 deletions

View File

@ -813,8 +813,17 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
$user->add_lang('posting');
// If there are only shadow topics, we neither need a reason nor softdelete
$sql = 'SELECT topic_id
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . '
AND topic_moved_id = 0';
$result = $db->sql_query_limit($sql, 1);
$only_shadow = !$db->sql_fetchfield('topic_id');
$db->sql_freeresult($result);
$only_softdeleted = false;
if ($auth->acl_get('m_delete', $forum_id) && $auth->acl_get('m_softdelete', $forum_id))
if (!$only_shadow && $auth->acl_get('m_delete', $forum_id) && $auth->acl_get('m_softdelete', $forum_id))
{
// If there are only soft deleted topics, we display a message why the option is not available
$sql = 'SELECT topic_id
@ -827,6 +836,7 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
}
$template->assign_vars(array(
'S_SHADOW_TOPICS' => $only_shadow,
'S_SOFTDELETED' => $only_softdeleted,
'S_TOPIC_MODE' => true,
'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id),
@ -839,7 +849,7 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
$l_confirm .= '_PERMANENTLY';
$s_hidden_fields['delete_permanent'] = '1';
}
else if (!$auth->acl_get('m_softdelete', $forum_id))
else if ($only_shadow || !$auth->acl_get('m_softdelete', $forum_id))
{
$s_hidden_fields['delete_permanent'] = '1';
}

View File

@ -2,6 +2,7 @@
<form action="{S_CONFIRM_ACTION}" method="post">
<p>{MESSAGE_TEXT}</p>
<!-- IF not S_SHADOW_TOPICS -->
<!-- IF not S_SOFTDELETED and S_ALLOWED_DELETE and S_ALLOWED_SOFTDELETE -->
<label>
<strong>{L_DELETE_PERMANENTLY}{L_COLON}</strong>
@ -14,6 +15,7 @@
<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">
<input type="button" name="confirm" value="{L_YES}" class="button1" />&nbsp;
@ -33,6 +35,7 @@
<p>{MESSAGE_TEXT}</p>
<!-- IF not S_SHADOW_TOPICS -->
<fieldset class="fields1">
<!-- IF not S_SOFTDELETED and S_ALLOWED_DELETE and S_ALLOWED_SOFTDELETE -->
<dl>
@ -51,6 +54,7 @@
<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}

View File

@ -14,6 +14,7 @@
<p class="gen">{MESSAGE_TEXT}</p>
<br />
<!-- IF not S_SHADOW_TOPICS -->
<table border="0" width="90%" cellspacing="2" cellpadding="1">
<!-- IF not S_SOFTDELETED and S_ALLOWED_DELETE and S_ALLOWED_SOFTDELETE -->
<tr>
@ -30,6 +31,7 @@
</tr>
</table>
<br />
<!-- ENDIF -->
{S_HIDDEN_FIELDS}
<input type="submit" name="confirm" value="{L_YES}" class="btnmain" />&nbsp;&nbsp;