Commit 6ed03685 by Félicie

delete the question with answer and comment

parent ddbb232a
...@@ -338,8 +338,8 @@ function qa_post_delete($postid) ...@@ -338,8 +338,8 @@ function qa_post_delete($postid)
$commentsfollows = qa_post_get_question_commentsfollows($postid); $commentsfollows = qa_post_get_question_commentsfollows($postid);
$closepost = qa_post_get_question_closepost($postid); $closepost = qa_post_get_question_closepost($postid);
if (count($answers) || count($commentsfollows)) // if (count($answers) || count($commentsfollows))
qa_fatal_error('Could not delete question ID due to dependents: ' . $postid); // qa_fatal_error('Could not delete question ID due to dependents: ' . $postid);
qa_question_delete($oldpost, null, null, null, $closepost); qa_question_delete($oldpost, null, null, null, $closepost);
break; break;
...@@ -348,8 +348,8 @@ function qa_post_delete($postid) ...@@ -348,8 +348,8 @@ function qa_post_delete($postid)
$question = qa_post_get_full($oldpost['parentid'], 'Q'); $question = qa_post_get_full($oldpost['parentid'], 'Q');
$commentsfollows = qa_post_get_answer_commentsfollows($postid); $commentsfollows = qa_post_get_answer_commentsfollows($postid);
if (count($commentsfollows)) // if (count($commentsfollows))
qa_fatal_error('Could not delete answer ID due to dependents: ' . $postid); // qa_fatal_error('Could not delete answer ID due to dependents: ' . $postid);
qa_answer_delete($oldpost, $question, null, null, null); qa_answer_delete($oldpost, $question, null, null, null);
break; break;
......
...@@ -217,32 +217,32 @@ function qa_page_q_post_rules($post, $parentpost = null, $siblingposts = null, $ ...@@ -217,32 +217,32 @@ function qa_page_q_post_rules($post, $parentpost = null, $siblingposts = null, $
// Now make any changes based on the child posts // Now make any changes based on the child posts
if (isset($childposts)) { // if (isset($childposts)) {
foreach ($childposts as $childpost) { // foreach ($childposts as $childpost) {
// Skip the child post if it is a note // // Skip the child post if it is a note
if ($childpost['basetype'] === 'N') { // if ($childpost['basetype'] === 'N') {
continue; // continue;
} // }
if ($childpost['parentid'] == $post['postid']) { // if ($childpost['parentid'] == $post['postid']) {
// this post has comments // // this post has comments
$rules['deleteable'] = false; // $rules['deleteable'] = false;
if ($childpost['basetype'] == 'A' && qa_post_is_by_user($childpost, $userid, $cookieid)) { // if ($childpost['basetype'] == 'A' && qa_post_is_by_user($childpost, $userid, $cookieid)) {
if (!qa_opt('allow_multi_answers')) // if (!qa_opt('allow_multi_answers'))
$rules['answerbutton'] = false; // $rules['answerbutton'] = false;
if (!qa_opt('allow_self_answer')) // if (!qa_opt('allow_self_answer'))
$rules['claimable'] = false; // $rules['claimable'] = false;
} // }
} // }
if ($childpost['closedbyid'] == $post['postid']) { // if ($childpost['closedbyid'] == $post['postid']) {
// other questions are closed as duplicates of this one // // other questions are closed as duplicates of this one
$rules['deleteable'] = false; // $rules['deleteable'] = false;
} // }
} // }
} // }
// Return the resulting rules // Return the resulting rules
...@@ -611,13 +611,13 @@ function qa_page_q_answer_view($question, $answer, $isselected, $usershtml, $for ...@@ -611,13 +611,13 @@ function qa_page_q_answer_view($question, $answer, $isselected, $usershtml, $for
); );
} }
if ($answer['followable']) { // if ($answer['followable']) {
$buttons['follow'] = array( // $buttons['follow'] = array(
'tags' => 'name="' . $prefix . 'dofollow"', // 'tags' => 'name="' . $prefix . 'dofollow"',
'label' => qa_lang_html('question/follow_button'), // 'label' => qa_lang_html('question/follow_button'),
'popup' => qa_lang_html('question/follow_a_popup'), // 'popup' => qa_lang_html('question/follow_a_popup'),
); // );
} // }
if ($answer['commentbutton']) { if ($answer['commentbutton']) {
$buttons['comment'] = array( $buttons['comment'] = array(
......
...@@ -38,7 +38,7 @@ ...@@ -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_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_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.', '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_comment_button' => 'Ajouter un commentaire',
'add_q_favorites' => 'Ajouter cette question à mes favoris', 'add_q_favorites' => 'Ajouter cette question à mes favoris',
'anon_name_label' => 'Votre nom à afficher (en option)', 'anon_name_label' => 'Votre nom à afficher (en option)',
......
...@@ -150,7 +150,7 @@ class Hidden extends BaseController ...@@ -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 // Possible values for popup: delete_q_popup, delete_a_popup, delete_c_popup
$buttons['delete'] = array( $buttons['delete'] = array(
'tags' => 'name="admin_' . qa_html($qhiddenpostid[$key]) . '_delete" onclick="return qa_admin_click(this);"', '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