Code Duplication    Length = 7-8 lines in 2 locations

main/work/work.lib.php 2 locations

@@ 326-333 (lines=8) @@
323
                    post_group_id = $groupIid
324
                ORDER BY sent_date DESC";
325
    } else {
326
        if (!empty($group_id)) {
327
            // set to select only messages posted by the user's group
328
            $group_query = " WHERE c_id = $course_id AND post_group_id = $groupIid";
329
            $subdirs_query = " AND parent_id = 0";
330
        } else {
331
            $group_query = " WHERE c_id = $course_id AND (post_group_id = '0' OR post_group_id is NULL) ";
332
            $subdirs_query = " AND parent_id = 0";
333
        }
334
        //@todo how we can active or not an assignment?
335
        $active_condition = ' AND active IN (1, 0)';
336
        $sql = "SELECT * FROM  $work_table
@@ 1348-1354 (lines=7) @@
1345
    $groupIid = (int) $groupIid;
1346
1347
    // Get list from database
1348
    if (!empty($groupIid)) {
1349
        $group_query = " WHERE w.c_id = $course_id AND post_group_id = $groupIid";
1350
        $subdirs_query = "AND parent_id = 0";
1351
    } else {
1352
        $group_query = " WHERE w.c_id = $course_id AND (post_group_id = '0' or post_group_id is NULL)  ";
1353
        $subdirs_query = "AND parent_id = 0";
1354
    }
1355
1356
    $active_condition = ' AND active IN (1, 0)';
1357