Exemplo n.º 1
0
function organization_itemdone(&$treeView, $idItem, $idUser)
{
    $lang =& DoceboLanguage::createInstance('organization', 'lms');
    require_once $GLOBALS['where_lms'] . '/class.module/track.object.php';
    require_once $GLOBALS['where_lms'] . '/lib/lib.stats.php';
    $tdb = $treeView->getTreeDb();
    $item = $tdb->getFolderById($idItem);
    $values = $item->otherValues;
    $objectType = $values[REPOFIELDOBJECTTYPE];
    $idResource = $values[REPOFIELDIDRESOURCE];
    $idParams = $values[ORGFIELDIDPARAM];
    $isTerminator = $values[ORGFIELDISTERMINATOR];
    $idCourse = $tdb->idCourse;
    if ($isTerminator) {
        require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
        $idTrack = Track_Object::getIdTrackFromCommon($idItem, $idUser);
        $track = createLOTrack($idTrack, $objectType, $idResource, $idParams, "");
        if ($track->getStatus() == 'completed' || $track->getStatus() == 'passed') {
            if (!saveTrackStatusChange((int) $idUser, (int) $idCourse, _CUS_END)) {
                errorCommunication($lang->def('_OPERATION_FAILURE'));
                return;
            }
        }
    }
}
Exemplo n.º 2
0
 function _setCourseCompleted()
 {
     if ($this->environment != 'course_lo') {
         return;
     }
     if ($this->status == 'completed' || $this->status == 'passed') {
         //update complete dates in DB
         $query = "SELECT first_complete, last_complete FROM %lms_commontrack WHERE idTrack=" . (int) $this->idTrack;
         $res = sql_query($query);
         if ($res && sql_num_rows($res) > 0) {
             $now = date("Y-m-d H:i:s");
             list($first_complete, $last_complete) = sql_fetch_row($res);
             $query = "UPDATE %lms_commontrack SET last_complete='" . $now . "'";
             if (!$first_complete || $first_complete > $now) {
                 $query .= ", first_complete='" . $now . "'";
             }
             $query .= " WHERE idTrack=" . (int) $this->idTrack;
             $res = sql_query($query);
         }
         //---
         /*
         			if(isset($_SESSION['idCourse'])) {
         
         $idCourse = $_SESSION['idCourse'];
         			} else {
         */
         // the only way is a direct query :(, or else if more than one course is open only the last one will complete
         $query = "SELECT idCourse " . "FROM %lms_organization " . "WHERE idOrg = '" . (int) $this->idReference . "' ";
         list($idCourse) = sql_fetch_row(sql_query($query));
         //}
         $useridst = $this->idUser;
         require_once Docebo::inc(_lms_ . '/modules/organization/orglib.php');
         $repoDb = new OrgDirDb($idCourse);
         $item = $repoDb->getFolderById($this->idReference);
         $values = $item->otherValues;
         $isTerminator = isset($values[ORGFIELDISTERMINATOR]) && $values[ORGFIELDISTERMINATOR];
         if ($isTerminator) {
             require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
             require_once $GLOBALS['where_lms'] . '/lib/lib.stats.php';
             saveTrackStatusChange((int) $useridst, (int) $idCourse, _CUS_END);
         }
     }
 }
Exemplo n.º 3
0
function upstatus()
{
    funAccess('statuser', 'OP');
    if (!saveTrackStatusChange($_POST['idUser'], $_SESSION['idCourse'], $_POST['status'])) {
        UiFeedback::error(_OPERATION_FAILURE);
        return;
    }
    Util::jump_to('index.php?modname=stats&op=statuser');
}
Exemplo n.º 4
0
function subscribeupdate()
{
    checkPerm('subscribe', false, 'course');
    require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
    require_once $GLOBALS['where_lms'] . '/lib/lib.stats.php';
    $id_course = importVar('id_course', true, 0);
    $edition_id = getCourseEditionId();
    $course_info = Man_Course::getCourseInfo($id_course);
    $lang =& DoceboLanguage::CreateInstance('subscribe', 'lms');
    $out =& $GLOBALS['page'];
    $acl_man =& Docebo::user()->getAclManager();
    if (!isset($_POST['user_level_sel'])) {
        //the user selection is empty, return to course selection
        backcourse('err_selempty');
    }
    //retrive id of group of the course for the various level ---------------------------
    $level_idst =& getCourseLevel($id_course);
    $actual_user_level = getSubscribedLevel($id_course, false, false, $edition_id);
    if (count($level_idst) == 0) {
        //if the group doesn't exists create it
        $level_idst =& DoceboCourse::createCourseLevel($id_course);
    }
    // Subscirbing user -----------------------------------------------------------------
    $re = true;
    $user_subs = array();
    while (list($id_user, $lv_sel) = each($_POST['user_level_sel'])) {
        $lv_old = $actual_user_level[$id_user];
        if ($lv_sel != $lv_old) {
            // Add in group for permission
            $acl_man->removeFromGroup($level_idst[$lv_old], $id_user);
            $acl_man->addToGroup($level_idst[$lv_sel], $id_user);
        }
        $new_status = $_POST['user_status_sel'][$id_user];
        $upd_query = "\r\n\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_courseuser\r\n\t\tSET level = '" . $lv_sel . "',\r\n\t\t\tstatus = '" . $new_status . "',\r\n\t\t\tabsent = '" . (isset($_POST['user_absent'][$id_user]) ? $_POST['user_absent'][$id_user] : '0') . "'\r\n\t\t" . ($new_status == _CUS_RESERVED || $new_status == _CUS_WAITING_LIST || $new_status == _CUS_CONFIRMED ? ", waiting = '1'" : "") . "\r\n\t\t\r\n\t\t" . ($_POST['user_status_sel'][$id_user] == _CUS_CANCELLED ? ", cancelled_by = '" . getLogUserId() . "'" : ", cancelled_by = '0'") . "\r\n\t\t\r\n\t\tWHERE idUser = '******' \r\n\t\t\t AND idCourse = '" . $id_course . "'\r\n\t\t\t AND edition_id='" . $edition_id . "'";
        if ($new_status == _CUS_END) {
            saveTrackStatusChange((int) $id_user, (int) $id_course, _CUS_END);
        }
        //update user's competence score
        require_once $GLOBALS['where_lms'] . '/lib/lib.competences.php';
        $cman = new Competences_Manager();
        switch ($new_status) {
            case _CUS_END:
                $cman->AssignCourseCompetencesToUser($id_course, $id_user);
                break;
                //...
        }
        // Add in table
        $re_sing = sql_query($upd_query);
        if ($re_sing) {
            $user_subs[] = $id_user;
            addUserToTimeTable($id_user, $id_course, $edition_id);
        }
        $re &= $re_sing;
        /*".( $_POST['user_status_sel'][$id_user] == _CUS_CANCELLED 
        		? ", cancelled_by = '".getLogUserId()."'" 
        		: ", cancelled_by = '0'"  )."*/
    }
    Docebo::user()->loadUserSectionST('/lms/course/private/');
    Docebo::user()->SaveInSession();
    require_once _base_ . '/lib/lib.eventmanager.php';
    $array_subst = array('[url]' => Get::sett('url'), '[course]' => $course_info['name']);
    if (!empty($user_subs)) {
        // message to user that is waiting
        $msg_composer = new EventMessageComposer();
        $msg_composer->setSubjectLangText('email', '_MOD_USER_SUBSCRIPTION_SUBJECT', false);
        $msg_composer->setBodyLangText('email', '_MOD_USER_SUBSCRIPTION_TEXT', $array_subst);
        $msg_composer->setBodyLangText('sms', '_MOD_USER_SUBSCRIPTION_TEXT_SMS', $array_subst);
        // send message to the user subscribed
        createNewAlert('UserCourseLevelChanged', 'subscribe', 'modify', '1', 'User subscribed', $user_subs, $msg_composer);
    }
    backcourse($re ? 'ok_subs' : 'err_subs');
}
Exemplo n.º 5
0
function logIntoCourse($id_course, $gotofirst_page = true)
{
    // Reset previous opened track session if any
    if (!Docebo::user()->isAnonymous() && isset($_SESSION['idCourse'])) {
        require_once _lms_ . '/lib/lib.track_user.php';
        TrackUser::setActionTrack(getLogUserId(), $_SESSION['idCourse'], '', '');
    }
    // Unset possibile previous session setting
    if (isset($_SESSION['direct_play'])) {
        unset($_SESSION['direct_play']);
    }
    $re_course = sql_query("\r\n\tSELECT level, status, waiting\r\n\tFROM %lms_courseuser\r\n\tWHERE idCourse = " . (int) $id_course . " AND idUser = "******"");
    list($level_c, $status_user, $waiting_user) = sql_fetch_row($re_course);
    Docebo::setCourse($id_course);
    $course_info = Docebo::course()->getAllInfo();
    $course_info['course_status'] = $course_info['status'];
    $course_info['user_status'] = $status_user;
    $course_info['waiting'] = $waiting_user;
    $course_info['level'] = $level_c;
    // Can the user enter into the course ?
    if (!Man_Course::canEnterCourse($course_info)) {
        return false;
    }
    // Disable tracking for ghost level
    $_SESSION['is_ghost'] = $course_info['level'] == 2 ? true : false;
    // If it's the first time we need to change the course status
    if ($course_info['user_status'] == _CUS_SUBSCRIBED) {
        require_once _lms_ . '/lib/lib.stats.php';
        saveTrackStatusChange(getLogUserId(), $id_course, _CUS_BEGIN);
    }
    // Setup some session data
    $_SESSION['timeEnter'] = date("Y-m-d H:i:s");
    $_SESSION['idCourse'] = $id_course;
    $_SESSION['levelCourse'] = $course_info['level'];
    //we need to redo this
    //$_SESSION['idEdition'] 		= $id_e;
    Docebo::user()->loadUserSectionST('/lms/course/private/' . $course_info['level'] . '/');
    Docebo::user()->SaveInSession();
    // Initialize the session into the course
    TrackUser::createSessionCourseTrack();
    $first_page = firstPage();
    $_SESSION['current_main_menu'] = $first_page['idMain'];
    $_SESSION['sel_module_id'] = $first_page['idModule'];
    $jumpurl = 'index.php?modname=' . $first_page['modulename'] . '&op=' . $first_page['op'] . '&id_module_sel=' . $first_page['idModule'];
    // course in direct play or assessment
    if ($course_info['direct_play'] == 1 || $course_info['course_type'] == 'assessment') {
        if ($_SESSION['levelCourse'] >= 4) {
            // direct play with a teacher, basically it's not ok
            // check if we are managing the LOs from admin: if yes, jump into the test management
            if ($course_info['course_type'] == 'assessment' && Get::req('from_admin', DOTY_INT, 0) > 0) {
                // enter the assessment course and go to test editing if there is a test with no question in it
                $query = "SELECT idOrg, idResource " . " FROM %lms_organization " . " WHERE idCourse = " . (int) $_SESSION['idCourse'] . " AND objectType = 'test' " . " ORDER BY path ASC, title ASC " . " LIMIT 0,1";
                $res = sql_query($query);
                if ($res && sql_num_rows($res) > 0) {
                    list($id_org, $id_test) = sql_fetch_row($res);
                    if ($id_test > 0) {
                        require_once _lms_ . '/lib/lib.test.php';
                        $tman = new TestManagement($id_test);
                        if ($tman->getNumberOfQuestion() <= 0) {
                            Util::jump_to('index.php?modname=test&op=modtestgui&idTest=' . $id_test . '&back_url=' . urlencode($jumpurl));
                        }
                    }
                }
            }
        } else {
            // direct play with a student
            // i need to play directly the course if it's not completed and is the only object of the course
            require_once _lms_ . '/lib/lib.orgchart.php';
            $orgman = new OrganizationManagement($_SESSION['idCourse']);
            $first_lo =& $orgman->getInfoWhereType(false, $_SESSION['idCourse']);
            if (count($first_lo) == 1) {
                $_SESSION['direct_play'] = 1;
                $obj = array_shift($first_lo);
                Util::jump_to('index.php?modname=organization&op=custom_playitem&id_item=' . $obj['id_org'] . '');
            } elseif (count($first_lo) >= 2) {
                $obj = array_shift($first_lo);
                // if we have more than an object we need to play the first one until it's completed
                $query = "SELECT status FROM %lms_commontrack WHERE idReference = " . (int) $obj['id_org'] . " AND idUser = "******"assessment") {
    		//check if we are managing the LOs from admin: if yes, jump into the test management
    		if (Get::req('from_admin', DOTY_INT, 0) > 0) {
    			//enter the assessment course and go to test editing
    			$query = "SELECT idOrg, idResource FROM %lms_organization WHERE idCourse=".(int)$_SESSION['idCourse']." AND objectType='test' "
    				." ORDER BY path ASC, title ASC LIMIT 0,1";
    			$res = sql_query($query);
    			if ($res && sql_num_rows($res)>0) {
    
    				list($id_org, $id_test) = sql_fetch_row($res);
    
    				if ($id_test > 0) {
    					require_once(_lms_.'/lib/lib.test.php');
    					$tman = new TestManagement($id_test);
    
    					if ($tman->getNumberOfQuestion() <= 0) {
    						Util::jump_to('index.php?modname=test&op=modtestgui&idTest='.$id_test.'&back_url='.urlencode($jumpurl));
    					}
    				}
    			}
    		}
    	}
    	if($gotofirst_page) Util::jump_to($jumpurl);
    	else return true;
    }
    
    
    switch($course_info['course_type']) {
    	case "assessment" : {
    
    		if($_SESSION['levelCourse'] <= 3) {
    
    			// i need to play directly the test
    			require_once($GLOBALS['where_lms'].'/lib/lib.orgchart.php');
    			$orgman = new OrganizationManagement($_SESSION['idCourse']);
    			$test =& $orgman->getInfoWhereType('test', $_SESSION['idCourse']);
    
    			if(count($test) == 1) {
    				$obj = array_shift($test);
    				$_SESSION['test_assessment'] = 1;
    				Util::jump_to('index.php?modname=organization&op=custom_playitem&id_item='.$obj['id_org'].'');
    			}
    			if($gotofirst_page) Util::jump_to($jumpurl);
    			else return true;
    		} else {
    			if($gotofirst_page) {
    				//...
    				Util::jump_to($jumpurl);
    			}
    			else return true;
    		}
    	};break;
    	default: {
    		if($gotofirst_page) Util::jump_to($jumpurl);
    		else return true;
    	}
    }
    /* not used in
    // now analyze the course type and select the acton to perform
    if(isset($_GET['showresult'])) {
    
    	require_once(_lms_.'/lib/lib.orgchart.php');
    	$orgman = new OrganizationManagement($_SESSION['idCourse']);
    	$scorm =& $orgman->getInfoWhereType('scormorg', $_SESSION['idCourse']);
    
    	if(count($scorm) == '1') {
    		$obj = array_shift($scorm);
    		Util::jump_to('index.php?modname=organization&op=scorm_track&id_user='******'&id_org='.$obj['id_resource'].'&amp;back='.$GLOBALS['course_descriptor']->getValue('direct_play'));
    	}
    	Util::jump_to('index.php?modname=course&op=showresults&id_course='.$_SESSION['idCourse']);
    }
    */
}
Exemplo n.º 6
0
 public function insDatePresence($id_course, $id_date, $user, $day, $score_min = 0)
 {
     $clear = $this->clearDatePresence($id_date);
     if ($clear) {
         require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
         require_once $GLOBALS['where_lms'] . '/lib/lib.stats.php';
         //require_once($GLOBALS['where_lms'].'/lib/lib.competences.php');
         //$cman = new Competences_Manager();
         $cmodel = new CompetencesAdm();
         $first = true;
         $test_type = $this->getTestType($id_date);
         $query = "INSERT INTO " . $this->presence_date_table . " (`day`, `id_date`, `id_user`, `id_day`, `presence`, `score`, `note`)" . " VALUES";
         foreach ($user as $id_user => $user_info) {
             $num_day = 0;
             $num_day_finished = 0;
             foreach ($user_info['day_presence'] as $id_day => $presence) {
                 $day_tmp = substr($day[$id_day]['date_begin'], 0, 10);
                 $num_day++;
                 if ($presence == 1) {
                     $num_day_finished++;
                 }
                 if ($first) {
                     $first = false;
                     $query .= " ('" . $day_tmp . "', " . $id_date . ", " . $id_user . ", " . $id_day . ", " . $presence . ", NULL, NULL)";
                 } else {
                     $query .= ", ('" . $day_tmp . "', " . $id_date . ", " . $id_user . ", " . $id_day . ", " . $presence . ", NULL, NULL)";
                 }
             }
             if ($test_type == _DATE_TEST_TYPE_PAPER) {
                 $num_day++;
                 if ($user_info['score'] >= $score_min) {
                     $num_day_finished++;
                 }
                 if ($first) {
                     $first = false;
                     $query .= " ('0000-00-00', " . $id_date . ", " . $id_user . ", 0, " . ($user_info['score'] >= $score_min ? 1 : 0) . ", '" . $user_info['score'] . "', '" . $user_info['note'] . "')";
                 } else {
                     $query .= ", ('0000-00-00', " . $id_date . ", " . $id_user . ", 0, " . ($user_info['score'] >= $score_min ? 1 : 0) . ", '" . $user_info['score'] . "', '" . $user_info['note'] . "')";
                 }
             } else {
                 if ($first) {
                     $first = false;
                     $query .= " ('0000-00-00', " . $id_date . ", " . $id_user . ", 0, 0, NULL, '" . $user_info['note'] . "')";
                 } else {
                     $query .= ", ('0000-00-00', " . $id_date . ", " . $id_user . ", 0, 0, NULL, '" . $user_info['note'] . "')";
                 }
             }
             if ($num_day == $num_day_finished && ($test_type == _DATE_TEST_TYPE_NONE || $test_type == _DATE_TEST_TYPE_PAPER)) {
                 saveTrackStatusChange($id_user, $id_course, _CUS_END);
                 //$cman->AssignCourseCompetencesToUser($id_course, $id_user);
                 $cmodel->assignCourseCompetencesToUser($id_course, $id_user);
                 $this->setDateFinished($id_date, $id_user);
             } elseif ($test_type == _DATE_TEST_TYPE_NONE || $test_type == _DATE_TEST_TYPE_PAPER) {
                 $query_itinere = "UPDATE " . $this->courseuser_table . " SET `status` = " . _CUS_BEGIN . "," . " date_complete = NULL" . " WHERE idUser = "******" AND idCourse = " . $id_course;
                 sql_query($query_itinere);
                 //TODO: funzione per togliere la competenza ad un utente se gli era stata precedentemente assegnata (forse)
             }
         }
         return sql_query($query);
     }
     return false;
 }
Exemplo n.º 7
0
 function loadBody()
 {
     global $op, $modname;
     if ($this->treeView === NULL) {
         $this->initialize();
     }
     // tree indipendent play lo -----------------------------------------------
     if ($GLOBALS['op'] == 'scorm_track') {
         require_once $GLOBALS['where_lms'] . '/modules/organization/orgresults.php';
         $user = Get::req('id_user', DOTY_INT, false);
         $org = Get::req('id_org', DOTY_INT, false);
         getTrackingTable($user, $org);
         return;
     }
     if ($GLOBALS['op'] == 'scorm_history') {
         require_once _lms_ . '/modules/organization/orgresults.php';
         $user = Get::req('id_user', DOTY_INT, false);
         $obj = Get::req('id_obj', DOTY_INT, false);
         getHistoryTable($user, $obj);
         return;
     }
     if ($GLOBALS['op'] == 'scorm_interactions') {
         require_once _lms_ . '/modules/organization/orgresults.php';
         //__FILE__.'/appLms/modules/organization/orgresults.php');
         $user = Get::req('id_user', DOTY_INT, false);
         $track = Get::req('id_track', DOTY_INT, false);
         getInteractionsTable($user, $track);
         return;
     }
     if ($GLOBALS['op'] === 'test_track') {
         require_once _lms_ . '/modules/organization/orgresults.php';
         $user = Get::req('id_user', DOTY_INT, false);
         $org = Get::req('id_org', DOTY_INT, false);
         getCompilationTable($user, $org);
         return;
     }
     if ($GLOBALS['op'] == 'custom_playitem') {
         require_once $GLOBALS['where_framework'] . '/lib/lib.sessionsave.php';
         $saveObj = new Session_Save();
         $saveName = $saveObj->getName('organization' . $_SESSION['idCourse'], true);
         $saveObj->save($saveName, $this->treeView->getState());
         $id_item = importVar('id_item');
         $folder = $this->repoDb->getFolderById($id_item);
         $lo = createLO($folder->otherValues[REPOFIELDOBJECTTYPE]);
         $idItem = $folder->otherValues[REPOFIELDIDRESOURCE];
         if (isset($_GET['edit']) && $_GET['edit']) {
             $back_url = 'index.php?modname=' . $modname . '&op=custom_enditem&edit=1&id_item=' . $id_item;
         } else {
             $back_url = 'index.php?modname=' . $modname . '&op=custom_enditem&id_item=' . $id_item;
         }
         $lo->play($idItem, $folder->otherValues[ORGFIELDIDPARAM], $back_url);
         return;
     }
     // tree indipendent play end --------------------------------------------
     if ($GLOBALS['op'] == 'custom_enditem') {
         $lang =& DoceboLanguage::createInstance('organization', 'lms');
         require_once $GLOBALS['where_lms'] . '/class.module/track.object.php';
         require_once $GLOBALS['where_lms'] . '/lib/lib.stats.php';
         $id_item = importVar('id_item');
         $folder = $this->repoDb->getFolderById($id_item);
         $objectType = $folder->otherValues[REPOFIELDOBJECTTYPE];
         $idResource = $folder->otherValues[REPOFIELDIDRESOURCE];
         $idParams = $folder->otherValues[ORGFIELDIDPARAM];
         $isTerminator = $folder->otherValues[ORGFIELDISTERMINATOR];
         /*With this direct_play courses was set as finished if is passed the object automatically without needing to set it as finish course object
         		$isTerminator = ( isset($_SESSION['direct_play']) ? true : $folder->otherValues[ORGFIELDISTERMINATOR] );*/
         $idCourse = $_SESSION['idCourse'];
         if ($isTerminator) {
             require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
             $idTrack = Track_Object::getIdTrackFromCommon($id_item, getLogUserId());
             $track = createLOTrack($idTrack, $objectType, $idResource, $idParams, "");
             if ($track->getStatus() == 'completed' || $track->getStatus() == 'passed') {
                 if (!saveTrackStatusChange((int) getLogUserId(), (int) $idCourse, _CUS_END)) {
                     errorCommunication($lang->def('_OPERATION_FAILURE'));
                     return;
                 }
             }
         }
         if (Get::req('edit', DOTY_INT, 0) > 0) {
             Util::jump_to('index.php?modname=storage&op=display');
         }
         if (isset($_SESSION['direct_play'])) {
             $from = Get::req('from', DOTY_ALPHANUM, '');
             //reset cache for the notication
             UpdatesLms::resetCache();
             // autoplay with more than an object and the first one is completed
             require_once _lms_ . '/lib/lib.orgchart.php';
             $orgman = new OrganizationManagement($_SESSION['idCourse']);
             $first_lo =& $orgman->getInfoWhereType(false, $_SESSION['idCourse']);
             if (count($first_lo) >= 2) {
                 // if we have more than an object we need to play the first one until it's completed
                 $obj = array_shift($first_lo);
                 $query = "SELECT status FROM %lms_commontrack WHERE idReference = " . (int) $obj['id_org'] . " AND idUser = "******"catalogue":
                     Util::jump_to('index.php?r=lms/catalog/show&sop=unregistercourse');
                     break;
                 case "lo_plan":
                     Util::jump_to('index.php?r=' . _after_login_ . '&sop=unregistercourse');
                     break;
                 case "lo_history":
                     Util::jump_to('index.php?r=' . _after_login_ . '&current_tab=lo_history&sop=unregistercourse');
                     break;
                 default:
                     Util::jump_to('index.php?r=' . _after_login_ . '&sop=unregistercourse');
                     break;
             }
         }
     }
     //--- direct edit item -----------------------------------------------------
     if ($GLOBALS['op'] == 'direct_edit_item') {
         $id_item = Get::req('id_item', DOTY_INT, 0);
         $this->treeView->op = 'editLO';
     }
     // normal tree function --------------------------------------------
     $this->treeView->playOnly = $modname == 'organization';
     switch ($this->treeView->op) {
         case 'import':
             import($this->treeView);
             break;
         case 'createLO':
             global $modname;
             // save state
             require_once $GLOBALS['where_framework'] . '/lib/lib.sessionsave.php';
             $saveObj = new Session_Save();
             $saveName = $saveObj->getName('organization' . $_SESSION['idCourse'], true);
             $saveObj->save($saveName, $this->treeView->getState());
             $GLOBALS['page']->add($this->treeView->LOSelector($modname, 'index.php?modname=' . $modname . '&op=display&sor=' . $saveName . '&' . $this->treeView->_getOpCreateLOEnd() . '=1'), 'content');
             break;
         case 'createLOSel':
             global $modname;
             // save state
             require_once $GLOBALS['where_framework'] . '/lib/lib.sessionsave.php';
             $saveObj = new Session_Save();
             $saveName = $saveObj->getName('organization' . $_SESSION['idCourse'], true);
             $saveObj->save($saveName, $this->treeView->getState());
             // start learning object creation
             $lo = createLO($_POST['radiolo']);
             if ($lo !== false) {
                 $lo->create('index.php?modname=' . $modname . '&op=display&sor=' . $saveName . '&' . $this->treeView->_getOpCreateLOEnd() . '=1');
             } else {
                 $GLOBALS['page']->addStart(getTitleArea(def('_ORGANIZATION', 'organization', 'lms'), 'organization') . '<div class="std_block">', 'content');
                 $GLOBALS['page']->addEnd('</div>', 'content');
                 if (isset($_SESSION['last_error'])) {
                     if ($_SESSION['last_error'] != "") {
                         //$GLOBALS['page']->add( $_SESSION['last_error'], 'content' );
                         UIFeedback::error($_SESSION['last_error']);
                         unset($_SESSION['last_error']);
                     }
                 }
                 organization($this->treeView);
             }
             break;
         case 'editLO':
             global $modname;
             // save state
             require_once $GLOBALS['where_framework'] . '/lib/lib.sessionsave.php';
             $saveObj = new Session_Save();
             $saveName = $saveObj->getName('organization' . $_SESSION['idCourse'], true);
             $saveObj->save($saveName, $this->treeView->getState());
             $folder = $this->repoDb->getFolderById($this->treeView->getSelectedFolderId());
             $lo = createLO($folder->otherValues[REPOFIELDOBJECTTYPE]);
             $lo->edit($folder->otherValues[REPOFIELDIDRESOURCE], 'index.php?modname=' . $modname . '&op=display&sor=' . $saveName . '&' . $this->treeView->_getOpEditLOEnd() . '=1');
             break;
         case 'playitem':
             global $modname;
             // save state
             require_once $GLOBALS['where_framework'] . '/lib/lib.sessionsave.php';
             $saveObj = new Session_Save();
             $saveName = $saveObj->getName('organization' . $_SESSION['idCourse'], true);
             $saveObj->save($saveName, $this->treeView->getState());
             $folder = $this->repoDb->getFolderById($this->treeView->getItemToPlay());
             $lo = createLO($folder->otherValues[REPOFIELDOBJECTTYPE]);
             $idItem = $folder->otherValues[REPOFIELDIDRESOURCE];
             $back_url = 'index.php?modname=' . $modname . '&op=organization&sor=' . $saveName . '&' . $this->treeView->_getOpPlayEnd() . '=' . $folder->id;
             $lo->play($idItem, $folder->otherValues[ORGFIELDIDPARAM], $back_url);
             break;
         case 'copyLOSel':
             $GLOBALS['page']->add($this->treeView->load());
             break;
         case 'copyLOEndOk':
         case 'copyLOEndCancel':
             global $modname;
             require_once $GLOBALS['where_framework'] . '/lib/lib.sessionsave.php';
             $saveObj = new Session_Save();
             $saveName = $_GET['crepo'];
             if ($saveObj->nameExists($saveName)) {
                 $saveData =& $saveObj->load($saveName);
                 $saveObj->delete($saveName);
                 Util::jump_to(' index.php?modname=' . $modname . '&op=' . $saveData['repo']);
             }
             Util::jump_to(' index.php?modname=' . $modname . '&op=display');
             break;
         case 'copyLO':
             global $modname;
             // save state
             require_once $GLOBALS['where_framework'] . '/lib/lib.sessionsave.php';
             $saveObj = new Session_Save();
             $saveName = $saveObj->getName('crepo', true);
             $folder = $this->treeView->tdb->getFolderById($this->treeView->selectedFolder);
             $saveData = array('repo' => 'organization', 'id' => $this->treeView->getSelectedFolderId(), 'objectType' => $folder->otherValues[REPOFIELDOBJECTTYPE], 'name' => $folder->otherValues[REPOFIELDTITLE], 'idResource' => $folder->otherValues[REPOFIELDIDRESOURCE]);
             $saveObj->save($saveName, $saveData);
             Util::jump_to(' index.php?modname=' . $modname . '&op=display&crepo=' . $saveName . '&' . $this->treeView->_getOpCopyLOSel() . '=1');
         case 'createLOEnd':
             // insertion managed by extendParsing
         // insertion managed by extendParsing
         case "display":
         case "organization":
         default:
             /*$GLOBALS['page']->addStart(
             			getTitleArea(def('_ORGANIZATION', 'organization', 'lms'), 'organization')
             			.'<div class="std_block">', 'content');
             		$GLOBALS['page']->addEnd('</div>', 'content');*/
             if (isset($_SESSION['last_error'])) {
                 if ($_SESSION['last_error'] != "") {
                     //$GLOBALS['page']->add( $_SESSION['last_error'], 'content' );
                     UIFeedback::error($_SESSION['last_error']);
                     unset($_SESSION['last_error']);
                 }
             }
             organization($this->treeView);
             break;
     }
 }