Code Duplication    Length = 13-13 lines in 2 locations

main/inc/lib/userportal.lib.php 1 location

@@ 503-515 (lines=13) @@
500
        }
501
502
        // $setting_show_also_closed_courses
503
        if ($user_identified) {
504
            if ($setting_show_also_closed_courses) {
505
                $platform_visible_courses = '';
506
            } else {
507
                $platform_visible_courses = "  AND (t3.visibility='".COURSE_VISIBILITY_OPEN_WORLD."' OR t3.visibility='".COURSE_VISIBILITY_OPEN_PLATFORM."' )";
508
            }
509
        } else {
510
            if ($setting_show_also_closed_courses) {
511
                $platform_visible_courses = '';
512
            } else {
513
                $platform_visible_courses = "  AND (t3.visibility='".COURSE_VISIBILITY_OPEN_WORLD."' )";
514
            }
515
        }
516
        $sqlGetSubCatList = "
517
                    SELECT  t1.name,
518
                            t1.code,

src/Chamilo/CoreBundle/Framework/PageController.php 1 location

@@ 634-646 (lines=13) @@
631
632
        $platform_visible_courses = '';
633
        // $setting_show_also_closed_courses
634
        if ($user_identified) {
635
            if ($setting_show_also_closed_courses) {
636
                $platform_visible_courses = '';
637
            } else {
638
                $platform_visible_courses = "  AND (t3.visibility='".COURSE_VISIBILITY_OPEN_WORLD."' OR t3.visibility='".COURSE_VISIBILITY_OPEN_PLATFORM."' )";
639
            }
640
        } else {
641
            if ($setting_show_also_closed_courses) {
642
                $platform_visible_courses = '';
643
            } else {
644
                $platform_visible_courses = "  AND (t3.visibility='".COURSE_VISIBILITY_OPEN_WORLD."' )";
645
            }
646
        }
647
        $sqlGetSubCatList = "
648
                    SELECT t1.name,t1.code,t1.parent_id,t1.children_count,COUNT(DISTINCT t3.code) AS nbCourse
649
                    FROM $main_category_table t1