Code Duplication    Length = 13-13 lines in 2 locations

answer.php 2 locations

@@ 92-104 (lines=13) @@
89
            case Constants::SF_STATUS_OPENED:
90
                if (1 == $xoopsModuleConfig['autoapprove_answer']) {
91
                    // We automatically approve submitted answer for Open Question, so the question become a Submitted Q&A
92
                    if (1 == $xoopsModuleConfig['autoapprove_submitted_faq']) {
93
                        // We automatically approve Submitted Q&A
94
                        $redirect_msg = _MD_SF_QNA_RECEIVED_AND_PUBLISHED;
95
                        $faqObj->setVar('status', Constants::SF_STATUS_PUBLISHED);
96
                        $newAnswerObj->setVar('status', Constants::SF_AN_STATUS_APPROVED);
97
                        $notifCase = 1;
98
                    } else {
99
                        // Submitted Q&A need approbation
100
                        $redirect_msg = _MD_SF_QNA_RECEIVED_NEED_APPROVAL;
101
                        $faqObj->setVar('status', Constants::SF_STATUS_SUBMITTED);
102
                        $newAnswerObj->setVar('status', Constants::SF_AN_STATUS_PROPOSED);
103
                        $notifCase = 2;
104
                    }
105
                } else {
106
                    // Submitted answer need approbation
107
                    $redirect_msg = _MD_SF_OPEN_ANSWER_NEED_APPROBATION;
@@ 118-130 (lines=13) @@
115
            // This is a published FAQ for which a user submitted a new answer
116
            case Constants::SF_STATUS_PUBLISHED:
117
            case Constants::SF_STATUS_NEW_ANSWER:
118
                if (1 == $xoopsModuleConfig['autoapprove_answer_new']) {
119
                    // We automatically approve new submitted answer for already published FAQ
120
                    $redirect_msg = '4';
121
                    $faqObj->setVar('status', Constants::SF_STATUS_SUBMITTED);
122
                    $newAnswerObj->setVar('status', Constants::SF_AN_STATUS_APPROVED);
123
                    $notifCase = 4;
124
                } else {
125
                    // New submitted answer need approbation
126
                    $redirect_msg = _MD_SF_FAQ_NEW_ANSWER_NEED_APPROBATION;
127
                    $faqObj->setVar('status', Constants::SF_STATUS_NEW_ANSWER);
128
                    $newAnswerObj->setVar('status', Constants::SF_AN_STATUS_PROPOSED);
129
                    $notifCase = 5;
130
                }
131
                break;
132
        }
133