Commit 6ed03685 by Félicie

delete the question with answer and comment

parent ddbb232a
......@@ -338,8 +338,8 @@ function qa_post_delete($postid)
$commentsfollows = qa_post_get_question_commentsfollows($postid);
$closepost = qa_post_get_question_closepost($postid);
if (count($answers) || count($commentsfollows))
qa_fatal_error('Could not delete question ID due to dependents: ' . $postid);
// if (count($answers) || count($commentsfollows))
// qa_fatal_error('Could not delete question ID due to dependents: ' . $postid);
qa_question_delete($oldpost, null, null, null, $closepost);
break;
......@@ -348,8 +348,8 @@ function qa_post_delete($postid)
$question = qa_post_get_full($oldpost['parentid'], 'Q');
$commentsfollows = qa_post_get_answer_commentsfollows($postid);
if (count($commentsfollows))
qa_fatal_error('Could not delete answer ID due to dependents: ' . $postid);
// if (count($commentsfollows))
// qa_fatal_error('Could not delete answer ID due to dependents: ' . $postid);
qa_answer_delete($oldpost, $question, null, null, null);
break;
......
......@@ -217,32 +217,32 @@ function qa_page_q_post_rules($post, $parentpost = null, $siblingposts = null, $
// Now make any changes based on the child posts
if (isset($childposts)) {
foreach ($childposts as $childpost) {
// Skip the child post if it is a note
if ($childpost['basetype'] === 'N') {
continue;
}
if ($childpost['parentid'] == $post['postid']) {
// this post has comments
$rules['deleteable'] = false;
if ($childpost['basetype'] == 'A' && qa_post_is_by_user($childpost, $userid, $cookieid)) {
if (!qa_opt('allow_multi_answers'))
$rules['answerbutton'] = false;
if (!qa_opt('allow_self_answer'))
$rules['claimable'] = false;
}
}
if ($childpost['closedbyid'] == $post['postid']) {
// other questions are closed as duplicates of this one
$rules['deleteable'] = false;
}
}
}
// if (isset($childposts)) {
// foreach ($childposts as $childpost) {
// // Skip the child post if it is a note
// if ($childpost['basetype'] === 'N') {
// continue;
// }
// if ($childpost['parentid'] == $post['postid']) {
// // this post has comments
// $rules['deleteable'] = false;
// if ($childpost['basetype'] == 'A' && qa_post_is_by_user($childpost, $userid, $cookieid)) {
// if (!qa_opt('allow_multi_answers'))
// $rules['answerbutton'] = false;
// if (!qa_opt('allow_self_answer'))
// $rules['claimable'] = false;
// }
// }
// if ($childpost['closedbyid'] == $post['postid']) {
// // other questions are closed as duplicates of this one
// $rules['deleteable'] = false;
// }
// }
// }
// Return the resulting rules
......@@ -611,13 +611,13 @@ function qa_page_q_answer_view($question, $answer, $isselected, $usershtml, $for
);
}
if ($answer['followable']) {
$buttons['follow'] = array(
'tags' => 'name="' . $prefix . 'dofollow"',
'label' => qa_lang_html('question/follow_button'),
'popup' => qa_lang_html('question/follow_a_popup'),
);
}
// if ($answer['followable']) {
// $buttons['follow'] = array(
// 'tags' => 'name="' . $prefix . 'dofollow"',
// 'label' => qa_lang_html('question/follow_button'),
// 'popup' => qa_lang_html('question/follow_a_popup'),
// );
// }
if ($answer['commentbutton']) {
$buttons['comment'] = array(
......
......@@ -38,7 +38,7 @@
'a_notify_x_label' => 'Envoyez-moi un e-mail (^) si ma réponse est sélectionnée ou commentée',
'a_waiting_your_approval' => 'Cette réponse est en attente de votre approbation',
'a_your_waiting_approval' => 'Votre réponse sera vérifiée et approuvée prochainement.',
'add_answer_button' => 'Ajouter réponse',
'add_answer_button' => 'Ajouter une réponse',
'add_comment_button' => 'Ajouter un commentaire',
'add_q_favorites' => 'Ajouter cette question à mes favoris',
'anon_name_label' => 'Votre nom à afficher (en option)',
......
......@@ -150,7 +150,7 @@ class Hidden extends BaseController
);
}
if (!qa_user_post_permit_error('permit_delete_hidden', $question) && !$dependcounts[$qhiddenpostid[$key]]) {
if (!qa_user_post_permit_error('permit_delete_hidden', $question)) {
// Possible values for popup: delete_q_popup, delete_a_popup, delete_c_popup
$buttons['delete'] = array(
'tags' => 'name="admin_' . qa_html($qhiddenpostid[$key]) . '_delete" onclick="return qa_admin_click(this);"',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment