Code Duplication    Length = 7-8 lines in 2 locations

main/work/work.lib.php 2 locations

@@ 370-377 (lines=8) @@
367
                    post_group_id = '".$group_id."'
368
                ORDER BY sent_date DESC";
369
    } else {
370
        if (!empty($group_id)) {
371
            // set to select only messages posted by the user's group
372
            $group_query = " WHERE c_id = $course_id AND post_group_id = '".$group_id."' ";
373
            $subdirs_query = "AND parent_id = 0";
374
        } else {
375
            $group_query = " WHERE c_id = $course_id AND  post_group_id = '0' ";
376
            $subdirs_query = "AND parent_id = 0";
377
        }
378
        //@todo how we can active or not an assignment?
379
        $active_condition = ' AND active IN (1, 0)';
380
        $sql = "SELECT * FROM  $work_table
@@ 1339-1345 (lines=7) @@
1336
1337
    // Get list from database
1338
1339
    if (!empty($group_id)) {
1340
        $group_query = " WHERE w.c_id = $course_id AND post_group_id = '".$group_id."' ";
1341
        $subdirs_query = "AND parent_id = 0";
1342
    } else {
1343
        $group_query = " WHERE w.c_id = $course_id AND post_group_id = '0' ";
1344
        $subdirs_query = "AND parent_id = 0";
1345
    }
1346
1347
    $active_condition = ' AND active IN (1, 0)';
1348