Code Duplication    Length = 10-11 lines in 2 locations

main/work/work.lib.php 2 locations

@@ 1258-1267 (lines=10) @@
1255
        $extra_conditions = " (work.post_group_id = '0' or work.post_group_id IS NULL) ";
1256
    }
1257
1258
    if ($is_allowed_to_edit) {
1259
        $extra_conditions .= ' AND work.active IN (0, 1) ';
1260
    } else {
1261
        $extra_conditions .= ' AND work.active IN (0, 1) AND accepted = 1';
1262
        if (isset($course_info['show_score']) && $course_info['show_score'] == 1) {
1263
            $extra_conditions .= " AND work.user_id = ".api_get_user_id()." ";
1264
        } else {
1265
            $extra_conditions .= '';
1266
        }
1267
    }
1268
1269
    $extra_conditions .= " AND parent_id  = ".$work_id."  ";
1270
@@ 1903-1913 (lines=11) @@
1900
            $extra_conditions = " (work.post_group_id = '0' OR work.post_group_id is NULL) ";
1901
        }
1902
1903
        if ($is_allowed_to_edit || $isDrhOfCourse) {
1904
            $extra_conditions .= ' AND work.active IN (0, 1) ';
1905
        } else {
1906
            if (isset($course_info['show_score']) &&
1907
                $course_info['show_score'] == 1
1908
            ) {
1909
                $extra_conditions .= " AND (u.user_id = ".api_get_user_id()." AND work.active IN (0, 1)) ";
1910
            } else {
1911
                $extra_conditions .= ' AND work.active IN (0, 1) ';
1912
            }
1913
        }
1914
1915
        $extra_conditions .= " AND parent_id  = ".$work_id." ";
1916