Code Duplication    Length = 3-6 lines in 6 locations

main/inc/lib/course.lib.php 2 locations

@@ 4009-4012 (lines=4) @@
4006
                if ($course_info['access_start_date'] == '0000-00-00') {
4007
                    //$session['dates'] = get_lang('WithoutTimeLimits');
4008
                    $session['dates'] = '';
4009
                    if (api_get_setting('show_session_coach') === 'true') {
4010
                        $session['coach'] = get_lang('GeneralCoach') . ': ' . api_get_person_name($sessioncoach['firstname'],
4011
                                $sessioncoach['lastname']);
4012
                    }
4013
                    $active = true;
4014
                } else {
4015
                    $session ['dates'] = ' - ' . get_lang('From') . ' ' . $course_info['access_start_date'] . ' ' . get_lang('To') . ' ' . $course_info['access_end_date'];
@@ 4016-4019 (lines=4) @@
4013
                    $active = true;
4014
                } else {
4015
                    $session ['dates'] = ' - ' . get_lang('From') . ' ' . $course_info['access_start_date'] . ' ' . get_lang('To') . ' ' . $course_info['access_end_date'];
4016
                    if (api_get_setting('show_session_coach') === 'true') {
4017
                        $session['coach'] = get_lang('GeneralCoach') . ': ' . api_get_person_name($sessioncoach['firstname'],
4018
                                $sessioncoach['lastname']);
4019
                    }
4020
                    $active = ($date_start <= $now && $date_end >= $now);
4021
                }
4022
            }

main/inc/lib/social.lib.php 2 locations

@@ 538-540 (lines=3) @@
535
            $session['title'] = $my_course['session_name'];
536
            if ($my_course['access_start_date'] == '0000-00-00') {
537
                $session['dates'] = get_lang('WithoutTimeLimits');
538
                if (api_get_setting('show_session_coach') === 'true') {
539
                    $session['coach'] = get_lang('GeneralCoach').': '.api_get_person_name($sessioncoach['firstname'], $sessioncoach['lastname']);
540
                }
541
            } else {
542
                $session ['dates'] = ' - '.get_lang('From').' '.$my_course['access_start_date'].' '.get_lang('To').' '.$my_course['access_end_date'];
543
                if (api_get_setting('show_session_coach') === 'true') {
@@ 543-545 (lines=3) @@
540
                }
541
            } else {
542
                $session ['dates'] = ' - '.get_lang('From').' '.$my_course['access_start_date'].' '.get_lang('To').' '.$my_course['access_end_date'];
543
                if (api_get_setting('show_session_coach') === 'true') {
544
                    $session['coach'] = get_lang('GeneralCoach').': '.api_get_person_name($sessioncoach['firstname'], $sessioncoach['lastname']);
545
                }
546
            }
547
        }
548
        $my_course['id_session'] = isset($my_course['id_session']) ? $my_course['id_session'] : 0;

main/inc/lib/display.lib.php 2 locations

@@ 1536-1538 (lines=3) @@
1533
                    empty($session_info['access_end_date']) && empty($session_info['access_start_date'])
1534
                )
1535
            ) {
1536
                if (api_get_setting('show_session_coach') === 'true') {
1537
                    $session['coach'] = get_lang('GeneralCoach').': '.api_get_person_name($session_info['firstname'], $session_info['lastname']);
1538
                }
1539
                if (isset($session_info['duration']) && !empty($session_info['duration'])) {
1540
                    $userDurationData = SessionManager::getUserSession(
1541
                            api_get_user_id(),
@@ 1607-1612 (lines=6) @@
1604
                    );
1605
                }
1606
1607
                if ( api_get_setting('show_session_coach') === 'true' ) {
1608
                    $session['coach'] = get_lang('GeneralCoach') . ': ' . api_get_person_name(
1609
                        $session_info['firstname'],
1610
                        $session_info['lastname']
1611
                    );
1612
                }
1613
                $active = ($date_start <= $now && $date_end >= $now);
1614
            }
1615
            $session['active'] = $active;