示例#1
0
 foreach ($userLessons as $key => $lesson) {
     if (!$lesson->lesson['active']) {
         unset($userLessons[$key]);
     }
 }
 /*
 $userLessonProgress = EfrontStats :: getUsersLessonStatus($userLessons, $currentUser -> user['login'], $options);
 $userLessons        = array_intersect_key($userLessons, $userLessonProgress); //Needed because EfrontStats :: getUsersLessonStatus might remove automatically lessons, based on time constraints
 */
 if (G_VERSIONTYPE == 'enterprise') {
     #cpp#ifdef ENTERPRISE
     $currentEmployee = $currentUser->aspects['hcd'];
     $_SESSION['employee_type'] = $currentEmployee->getType();
     if ($currentEmployee->isSupervisor()) {
         $constraints = array('archive' => false, 'active' => true);
         $pendingCourses = EfrontCourse::getCoursesWithPendingUsersForSupervisor($constraints, $currentUser->user['login']);
         if ($pendingCourses) {
             $myCoursesOptions[] = array('text' => _SUPERVISORAPPROVAL, 'image' => "32x32/success.png", 'href' => "javascript:void(0)", 'onclick' => "eF_js_showDivPopup(event, '" . _SUPERVISORAPPROVAL . "', 2, 'supervisor_approvals_list')");
             $smarty->assign("T_SUPERVISOR_APPROVALS", $pendingCourses);
         }
         if (isset($_GET['ajax']) && $_GET['ajax'] == 'approval') {
             try {
                 $course = new EfrontCourse($_GET['course_id']);
                 $course->confirm($_GET['users_login']);
                 echo json_encode(array('status' => 1));
                 exit;
             } catch (Exception $e) {
                 handleAjaxExceptions($e);
             }
         } elseif (isset($_GET['ajax']) && $_GET['ajax'] == 'cancel') {
             try {