skala
Julio Montoya 12 years ago
commit d2c535cbf9
  1. 7
      main/admin/filler.php
  2. 10
      main/exercice/exercice.php
  3. 60
      main/exercice/exercise.class.php
  4. 24
      main/exercice/question.class.php
  5. 22
      main/exercice/unique_answer.class.php
  6. 8
      main/inc/lib/course.lib.php
  7. 23
      main/inc/lib/main_api.lib.php
  8. 54
      main/inc/lib/usermanager.lib.php
  9. 3
      main/install/install.lib.php
  10. 5
      main/install/migrate-db-1.9.0-1.10.0-pre.sql
  11. 62
      tests/datafiller/data_exe.php
  12. 83
      tests/datafiller/fill_exe.php
  13. 3
      tests/migrate/migrate.php
  14. 32
      tests/migrate/migration.class.php
  15. 854
      tests/migrate/migration.custom.class.php
  16. 9
      tests/migrate/migration.mssql.class.php

@ -39,6 +39,10 @@ if (!empty($_GET['fill'])) {
require api_get_path(SYS_TEST_PATH).'datafiller/fill_courses.php';
$output = fill_courses();
break;
case 'exe':
require api_get_path(SYS_TEST_PATH).'datafiller/fill_exe.php';
$output = fill_exe();
break;
default:
break;
}
@ -68,8 +72,9 @@ if (count($output)>0) {
<ul>
<li><a href="filler.php?fill=users"><?php echo get_lang('FillUsers');?></a></li>
<li><a href="filler.php?fill=courses"><?php echo get_lang('FillCourses');?></a></li>
<li><a href="filler.php?fill=exe"><?php echo get_lang('FillExercises');?></a></li>
</ul>
</div>
<?php
/* FOOTER */
Display::display_footer();
Display::display_footer();

@ -568,7 +568,7 @@ if (!empty($exercise_list)) {
if ($session_id == $row['session_id']) {
//Settings
$actions = Display::url(Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL), 'admin.php?'.api_get_cidreq().'&exerciseId='.$row['id']);
$actions = Display::url(Display::return_icon('edit.png',get_lang('EditQuestions'),'',ICON_SIZE_SMALL), 'admin.php?'.api_get_cidreq().'&exerciseId='.$row['id']);
//Exercise results
$actions .='<a href="exercise_report.php?' . api_get_cidreq() . '&exerciseId='.$row['id'].'">'.Display :: return_icon('test_results.png', get_lang('Results'),'',ICON_SIZE_SMALL).'</a>';
@ -610,6 +610,12 @@ if (!empty($exercise_list)) {
} else {
$actions .= Display::return_icon('delete_na.png', get_lang('ResourceLockedByGradebook'),'',ICON_SIZE_SMALL);
}
if ($rowi > 50) {
// Showing the direct link to exercise settings only
// if there are more than 50 questions, so the list of
// questions does not slow down everything
$actions .= Display::url(Display::return_icon('settings.png',get_lang('EditSettings'),'',ICON_SIZE_SMALL), 'exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$row['id']);
}
}
// Number of questions
@ -882,4 +888,4 @@ if (empty($exercise_list) && $hotpotatoes_exist == false) {
}
if ($origin != 'learnpath') { //so we are not in learnpath tool
Display :: display_footer();
}
}

@ -636,7 +636,8 @@ class Exercise {
/**
* updates the exercise in the data base
*
* @param string If "simple", then only updates title, description and visibility. Otherwise updates all fields
* @return mixed False on error, void otherwise
* @author - Olivier Brouckaert
*/
function save($type_e = '') {
@ -681,7 +682,6 @@ class Exercise {
} else {
$end_time = '0000-00-00 00:00:00';
}
// Exercise already exists
if ($id) {
$sql="UPDATE $TBL_EXERCICES SET
@ -708,7 +708,8 @@ class Exercise {
results_disabled='".Database::escape_string($results_disabled)."'";
}
$sql .= " WHERE c_id = ".$this->course_id." AND id='".Database::escape_string($id)."'";
Database::query($sql);
$r = Database::query($sql);
if ($r === false) { return false; }
// update into the item_property table
api_item_property_update($_course, TOOL_QUIZ, $id,'QuizUpdated',api_get_user_id());
@ -718,36 +719,37 @@ class Exercise {
}
} else {
// creates a new exercise
$sql = "INSERT INTO $TBL_EXERCICES (c_id, start_time, end_time, title, description, sound, type, random, random_answers, active,
results_disabled, max_attempt, feedback_type, expired_time, session_id, review_answers, random_by_category,
text_when_finished, display_category_name, pass_percentage)
VALUES(
".$this->course_id.",
'$start_time','$end_time',
'".Database::escape_string($exercise)."',
'".Database::escape_string($description)."',
'".Database::escape_string($sound)."',
'".Database::escape_string($type)."',
'".Database::escape_string($random)."',
'".Database::escape_string($random_answers)."',
'".Database::escape_string($active)."',
'".Database::escape_string($results_disabled)."',
'".Database::escape_string($attempts)."',
'".Database::escape_string($feedback_type)."',
'".Database::escape_string($expired_time)."',
'".Database::escape_string($session_id)."',
'".Database::escape_string($review_answers)."',
'".Database::escape_string($randomByCat)."',
'".Database::escape_string($text_when_finished)."',
'".Database::escape_string($display_category_name)."',
'".Database::escape_string($pass_percentage)."'
)";
Database::query($sql);
$sql = "INSERT INTO $TBL_EXERCICES (c_id, start_time, end_time, title, description, sound, type, random, random_answers, active, ".
" results_disabled, max_attempt, feedback_type, expired_time, session_id, review_answers, random_by_category, ".
" text_when_finished, display_category_name, pass_percentage) ".
" VALUES( ".
$this->course_id.", ".
" '$start_time','$end_time', ".
" '".Database::escape_string($exercise)."', ".
" '".Database::escape_string($description)."', ".
" '".Database::escape_string($sound)."', ".
" '".Database::escape_string($type)."', ".
" '".Database::escape_string($random)."', ".
" '".Database::escape_string($random_answers)."', ".
" '".Database::escape_string($active)."', ".
" '".Database::escape_string($results_disabled)."', ".
" '".Database::escape_string($attempts)."', ".
" '".Database::escape_string($feedback_type)."', ".
" '".Database::escape_string($expired_time)."', ".
" '".Database::escape_string($session_id)."', ".
" '".Database::escape_string($review_answers)."', ".
" '".Database::escape_string($randomByCat)."', ".
" '".Database::escape_string($text_when_finished)."', ".
" '".Database::escape_string($display_category_name)."', ".
" '".Database::escape_string($pass_percentage)."' ".
" )";
$r = Database::query($sql);
if ($r === false) { return false; }
$this->id = Database::insert_id();
// insert into the item_property table
api_item_property_update($this->course, TOOL_QUIZ, $this->id, 'QuizAdded', api_get_user_id());
api_set_default_visibility($this->id, TOOL_QUIZ);
api_set_default_visibility($this->id, TOOL_QUIZ);
if (api_get_setting('search_enabled')=='true' && extension_loaded('xapian')) {
$this->search_engine_save();

@ -744,18 +744,18 @@ abstract class Question
$current_position = Database::result($result,0,0);
$this->updatePosition($current_position+1);
$position = $this->position;
$sql = "INSERT INTO $TBL_QUESTIONS (c_id, question, description, ponderation, position, type, picture, extra, level, parent_id) VALUES (
$c_id,
'".Database::escape_string($question)."',
'".Database::escape_string($description)."',
'".Database::escape_string($weighting)."',
'".Database::escape_string($position)."',
'".Database::escape_string($type)."',
'".Database::escape_string($picture)."',
'".Database::escape_string($extra)."',
'".Database::escape_string($level)."',
'".$this->parent_id."'
)";
$sql = "INSERT INTO $TBL_QUESTIONS (c_id, question, description, ponderation, position, type, picture, extra, level, parent_id) VALUES ( ".
" $c_id, ".
" '".Database::escape_string($question)."', ".
" '".Database::escape_string($description)."', ".
" '".Database::escape_string($weighting)."', ".
" '".Database::escape_string($position)."', ".
" '".Database::escape_string($type)."', ".
" '".Database::escape_string($picture)."', ".
" '".Database::escape_string($extra)."', ".
" '".Database::escape_string($level)."', ".
" '".$this->parent_id."' ".
" )";
Database::query($sql);
$this->id = Database::insert_id();

@ -365,11 +365,26 @@ class UniqueAnswer extends Question {
$header .= '</tr>';
return $header;
}
function create_answer($id, $question_id, $answer_title, $comment, $score = 0, $correct = 0) {
/**
* Create database record for the given answer
* @param int The answer ID (technically 1 is OK if you don't know)
* @param int The question this answer is attached to
* @param string The answer itself
* @param string The answer comment (shown as feedback if enabled)
* @param float Score given by this answer if selected (can be negative)
* @param int Whether this answer is considered correct (1) or not (0)
* @param int The course ID - if not provided, will be guessed from the context
* @return void
* @assert (1,null,'a','',1,1,null) === false
* @assert (1,1,'','',1,1,null) === false
*/
function create_answer($id=1, $question_id, $answer_title, $comment = '', $score = 0, $correct = 0, $course_id = null) {
if (empty($question_id) or empty($answer_title)) { return false; }
$tbl_quiz_answer = Database::get_course_table(TABLE_QUIZ_ANSWER);
$tbl_quiz_question = Database::get_course_table(TABLE_QUIZ_QUESTION);
$course_id = api_get_course_int_id();
if (empty($course_id)) {
$course_id = api_get_course_int_id();
}
$position = 1;
$question_id = filter_var($question_id,FILTER_SANITIZE_NUMBER_INT);
$score = filter_var($score,FILTER_SANITIZE_NUMBER_FLOAT);
@ -391,6 +406,7 @@ class UniqueAnswer extends Question {
$sql = "UPDATE $tbl_quiz_question "
." SET ponderation = (ponderation + $score) WHERE c_id = $course_id AND id = ".$question_id;
$rs = Database::query($sql);
return $rs;
}
}
}

@ -80,6 +80,8 @@ class CourseManager {
* Creates a course
* @param array with the columns in the main.course table
* @param mixed false if the course was not created, array with the course info
* @return mixed Array with course details, or false on error
* @assert (null) === false
*/
static function create_course($params) {
global $_configuration;
@ -4514,9 +4516,9 @@ class CourseManager {
$default_document_array = array();
foreach ($folders_to_copy_from_default_course as $folder) {
$default_course_folder_path = $default_course_path.$folder.'/';
$files = browse_folders($default_course_folder_path, array(), $folder);
$sorted_array = sort_pictures($files, 'dir');
$sorted_array = array_merge($sorted_array, sort_pictures($files, 'file'));
$files = self::browse_folders($default_course_folder_path, array(), $folder);
$sorted_array = self::sort_pictures($files, 'dir');
$sorted_array = array_merge($sorted_array, self::sort_pictures($files, 'file'));
$default_document_array[$folder] = $sorted_array;
}

@ -1942,17 +1942,17 @@ function api_get_session_visibility($session_id, $course_code = null, $ignore_vi
$row = Database::fetch_array($result, 'ASSOC');
$visibility = $original_visibility = $row['visibility'];
//I don't care the field visibility
// If there are no start/end date, we don't care about the field visibility
if ($row['access_start_date'] == '0000-00-00 00:00:00' && $row['access_end_date'] == '0000-00-00 00:00:00') {
return SessionManager::DEFAULT_VISIBILITY;
} else {
//If access_start_date is set
} else {
// If access_start_date is set
if (!empty($row['access_start_date']) && $row['access_start_date'] != '0000-00-00 00:00:00') {
if ($now > api_strtotime($row['access_start_date'], 'UTC')) {
$visibility = SESSION_AVAILABLE;
} else {
$visibility = SESSION_INVISIBLE;
//$visibility = SESSION_INVISIBLE;
$visibility = $original_visibility;
}
}
@ -1960,14 +1960,14 @@ function api_get_session_visibility($session_id, $course_code = null, $ignore_vi
if (!empty($row['access_end_date']) && $row['access_end_date'] != '0000-00-00 00:00:00') {
//only if access_end_date said that it was ok
if ($visibility == SESSION_AVAILABLE) {
$visibility = $row['visibility'];
$visibility = $original_visibility;
if ($now <= api_strtotime($row['access_end_date'], 'UTC')) {
//date still available
$visibility = SESSION_AVAILABLE;
} else {
//session ends
$visibility = $row['visibility'];
$visibility = $original_visibility;
}
}
}
@ -1976,7 +1976,8 @@ function api_get_session_visibility($session_id, $course_code = null, $ignore_vi
//If I'm a coach the visibility can change in my favor depending in the coach_access_start_date and coach_access_end_date values
$is_coach = api_is_coach($session_id, $course_code);
if ($is_coach) {
// if the user is coach and the session is not visible to normal users, check for special dates
if ($is_coach && in_array($visibility,array(SESSION_VISIBLE_READ_ONLY, SESSION_INVISIBLE))) {
//Test end date
if (isset($row['access_end_date']) && !empty($row['access_end_date']) && $row['access_end_date'] != '0000-00-00 00:00:00' &&
@ -1986,7 +1987,8 @@ function api_get_session_visibility($session_id, $course_code = null, $ignore_vi
if ($now <= $end_date_extra_for_coach) {
$visibility = SESSION_AVAILABLE;
} else {
$visibility = SESSION_INVISIBLE;
//$visibility = SESSION_INVISIBLE;
$visibility = $original_visibility;
}
}
@ -1997,7 +1999,8 @@ function api_get_session_visibility($session_id, $course_code = null, $ignore_vi
if ($now > $start_date_for_coach) {
$visibility = SESSION_AVAILABLE;
} else {
$visibility = SESSION_INVISIBLE;
//$visibility = SESSION_INVISIBLE;
$visibility = $original_visibility;
}
}
} else {

@ -2208,36 +2208,35 @@ class UserManager {
}
}
$select = "SELECT DISTINCT session.id,
session.name,
$select = "SELECT DISTINCT session.id, ".
" session.name, ".
access_start_date,
access_end_date,
coach_access_start_date,
coach_access_end_date,
" access_start_date, ".
" access_end_date, ".
" coach_access_start_date, ".
" coach_access_end_date, ".
session_category_id,
session_category.name as session_category_name,
session_category.date_start session_category_date_start,
session_category.date_end session_category_date_end,
" session_category_id, ".
" session_category.name as session_category_name, ".
" session_category.date_start session_category_date_start, ".
" session_category.date_end session_category_date_end, ".
moved_to,
moved_status,
id_coach,
scu.id_user";
" moved_to, ".
" moved_status, ".
" id_coach, ".
" scu.id_user";
if ($get_count) {
$select = "SELECT count(session.id) as total_rows ";
}
$sql = " $select FROM $tbl_session as session LEFT JOIN $tbl_session_category session_category ON (session_category_id = session_category.id)
INNER JOIN $tbl_session_course_user as scu ON (scu.id_session = session.id)
LEFT JOIN $tbl_session_user su ON su.id_session = session.id AND su.id_user = scu.id_user
WHERE (
scu.id_user = $user_id OR session.id_coach = $user_id
) $condition_date_end
ORDER BY session_category_name, name";
$sql = " $select FROM $tbl_session as session LEFT JOIN $tbl_session_category session_category ON (session_category_id = session_category.id) ".
" INNER JOIN $tbl_session_course_user as scu ON (scu.id_session = session.id) ".
" LEFT JOIN $tbl_session_user su ON su.id_session = session.id AND su.id_user = scu.id_user ".
" WHERE ( ".
" scu.id_user = $user_id OR session.id_coach = $user_id ".
" ) $condition_date_end ".
" ORDER BY session_category_name, name";
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
@ -2254,13 +2253,18 @@ class UserManager {
//Checking session visibility
$visibility = api_get_session_visibility($session_id, null, false);
//var_dump($visibility);
switch ($visibility) {
// full access (we are inside normal dates range)
case SESSION_AVAILABLE:
break;
// access restricted by dates - only show in history view
case SESSION_VISIBLE_READ_ONLY:
case SESSION_VISIBLE:
case SESSION_AVAILABLE:
if (!$is_time_over) {
continue(2);
}
break;
// access totally blocked - do not show
case SESSION_INVISIBLE:
continue(2);
}

@ -2626,6 +2626,9 @@ function create_course_tables($course_db_name = null) {
)" . $charset_clause;
Database::query($sql);
$sql = "ALTER TABLE `".$TABLEQUIZANSWERSLIST . "` ADD INDEX idx_quiz_answer_c_q (c_id, question_id)";
Database::query($sql);
// Exercise tool - answer options
$sql = "
CREATE TABLE `".$TABLEQUIZQUESTIONOPTION . "` (

@ -101,5 +101,8 @@ INSERT INTO branch_transaction_status VALUES (1, 'To be executed'), (2, 'Execute
CREATE TABLE branch_transaction (id bigint unsigned not null AUTO_INCREMENT, transaction_id bigint unsigned, branch_id inti unsigned not null default 0, action char(20), item_id char(36), orig_id char(36), dest_id char(36), status_id tinyint not null default 0, time_insert datetime NOT NULL DEFAULT '0000-00-00 00:00:00', time_update datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (id, transaction_id, branch_id));
ALTER TABLE c_quiz_answer ADD INDEX idx_quiz_answer_c_q (c_id, question_id);
ALTER TABLE settings_current ADD INDEX idx_settings_current_au_cat (access_url, category(5));
-- Do not move this
UPDATE settings_current SET selected_value = '1.10.0.20655' WHERE variable = 'chamilo_database_version';
UPDATE settings_current SET selected_value = '1.10.0.20672' WHERE variable = 'chamilo_database_version';

@ -0,0 +1,62 @@
<?php //$id$
/**
* This script contains the data to fill (or empty) the database with using
* the fillers in this directory.
* @author Yannick Warnier <yannick.warnier@dokeos.com>
*
*/
/**
* Initialisation section
*/
$courses = array();
$courses[] = array(
'code' => 'ENGLISH101',
'title' => 'English for beginners',
'description' => 'English course',
'category_code' => 'PROJ',
'course_language' => 'english',
'user_id' => 1,
'expiration_date' => '2020-09-01 00:00:00',
'exemplary_content' => true,
'exes' => array(
'exe' => array(
'title' => 'Demo',
'time' => 180,
'attempts' => 1,
'random' => 100,
'pass_percentage' => 70,
'review_answers' => 1,
),
),
);
$qst = array(
0 => array(
'title' => 'Demo question',
'desc' => 'What do you think about XYZ?',
'type' => 1, //1=Unique answer, see question.class.php
'answers' => array(
0 => array (
'title' => 'A',
'correct' => 1,
'score' => 1,
),
1 => array (
'title' => 'B',
'correct' => 0,
'score' => 0,
),
2 => array (
'title' => 'C',
'correct' => 0,
'score' => 0,
),
3 => array (
'title' => 'D',
'correct' => 0,
'score' => 0,
),
),
),
);

@ -0,0 +1,83 @@
<?php
/**
* This script contains a data filling procedure for an exercise
* @author Yannick Warnier <yannick.warnier@beeznest.com>
*
*/
/**
* Initialisation section
*/
/**
* Loads the data and injects it into the Chamilo database, using the Chamilo
* internal functions.
* @return array List of user IDs for the users that have just been inserted
*/
function fill_exe() {
$qc = 5000; //how many questions to create per exercise
$eol = PHP_EOL;
$courses = array(); //declare only to avoid parsing notice
$qst = array();
require_once 'data_exe.php'; //fill the $users array
$output = array();
$output[] = array('title'=>'Exe Filling Report: ');
$i = 1;
$lib = api_get_path(SYS_CODE_PATH);
require_once $lib.'exercice/exercise.class.php';
require_once $lib.'exercice/question.class.php';
require_once $lib.'exercice/answer.class.php';
require_once $lib.'exercice/exercise.lib.php';
foreach ($courses as $i => $course) {
$res = 0;
//first check that the first item doesn't exist already
$output[$i]['line-init'] = $course['title'];
$res = CourseManager::create_course($course);
$output[$i]['line-info'] = ($res ? $res : get_lang('NotInserted'));
$i++;
if (is_array($res)) {
//now insert an exercise
foreach ($course['exes'] as $exe) {
$objExercise = new Exercise();
$objExercise->id = 0;
$objExercise->course_id = $res['real_id'];
$objExercise->exercise = $exe['title'];
$objExercise->type = 1;
$objExercise->attempts = $exe['attempts'];
$objExercise->random = $exe['random'];
$objExercise->active = 1;
$objExercise->propagate_neg = 0;
$objExercise->pass_percentage = $exe['pass_percentage'];
$objExercise->session_id = 0;
$objExercise->results_disabled = 0;
$objExercise->expired_time = $exe['time'];
$objExercise->review_answers = $exe['review_answers'];
$objExercise->save();
$id = $objExercise->id;
if (!empty($id)) {
$qi = 0;
while ($qi < $qc) {
foreach ($qst as $q) {
error_log('Created '.$qi.' questions');
$question = Question::getInstance($q['type']);
$question->id = 0;
$question->question = $q['title'].' '.$qi;
$question->description = $q['desc'];
$question->type = $q['type'];
$question->course = $res;
$r = $question->save($id);
if ($r === false) { continue; }
$qid = $question->id;
$aid = 1;
foreach ($q['answers'] as $asw) {
$answer = new UniqueAnswer($qid);
$answer->create_answer($aid,$qid,$asw['title'],'',$asw['score'],$asw['correct'], $res['real_id']);
$aid++;
}
$qi++;
}
}
}
}
}
}
return $output;
}

@ -27,6 +27,8 @@ if (empty($servers)) {
die("This script requires a servers array with the connection settings and the file to parse\n");
}
$data_list = array('users'=>array(),'courses'=>array(),'sessions'=>array());
$start = time();
echo "\n-- Starting at ".date('h:i:s')." local server time\n";
if (!empty($servers)) {
@ -34,6 +36,7 @@ if (!empty($servers)) {
if ($server_info['active']) {
echo "\n---- Start loading server----- \n";
echo $server_info['name']."\n\n";
error_log('Treating server '.$server_info['name']);
//echo "---- ----------------------- \n";
$config_info = $server_info['connection'];

@ -50,20 +50,6 @@ class Migration {
*/
public $odbrows = null;
/**
* Temporary holder for the list of users, courses and sessions and their
* data. Store values here (preferably using the same indexes as the
* destination database field names) until ready to insert into Chamilo.
*/
public $data_list = array(
'boost_users' => false,
'users' => array(),
'boost_courses' => false,
'courses' => array(),
'boost_sessions' => false,
'sessions' => array(),
);
public $web_service_connection_info = array();
/**
@ -90,9 +76,10 @@ class Migration {
// Set the boost level if set in config.php
if (!empty($boost) && is_array($boost)) {
global $data_list;
foreach ($boost as $item => $val) {
if ($val == true) {
$this->data_list[$item] = true;
$data_list[$item] = true;
}
}
}
@ -1014,6 +1001,7 @@ class Migration {
$extra_field_value_obj = new ExtraFieldValue($table['dest_table']);
}
$extra_fields_to_insert = array();
global $data_list;
foreach ($table['fields_match'] as $id_field => $details) {
//if ($table['dest_table'] == 'session') {error_log('Processing field '.$details['orig']);}
@ -1033,7 +1021,7 @@ class Migration {
} else {
// if an alteration function is defined, run it on the field
//error_log(__FILE__.' '.__LINE__.' Preparing to treat field with '.$details['func']);
$dest_data = MigrationCustom::$details['func']($row[$details['orig']], $this->data_list, $row);
$dest_data = MigrationCustom::$details['func']($row[$details['orig']], $data_list, $row);
}
if (isset($dest_row[$details['dest']])) {
@ -1098,7 +1086,7 @@ class Migration {
//error_log('Calling '.$table['dest_func'].' on data recovered: '.print_r($dest_row, 1));
$dest_row['return_item_if_already_exists'] = true;
$item_result = call_user_func_array($table['dest_func'], array($dest_row, $this->data_list));
$item_result = call_user_func_array($table['dest_func'], array($dest_row, $data_list));
/* if (isset($table['show_in_error_log']) && $table['show_in_error_log'] == false) {
@ -1107,12 +1095,12 @@ class Migration {
}
*/
//error_log('Result of calling ' . $table['dest_func'] . ': ' . print_r($item_result, 1));
//After the function was executed fill the $this->data_list array
//After the function was executed fill the $data_list array
switch ($table['dest_table']) {
case 'course':
//Saving courses in array
if ($item_result) {
//$this->data_list['courses'][$dest_row['uidIdCurso']] = $item_result;
//$data_list['courses'][$dest_row['uidIdCurso']] = $item_result;
} else {
error_log('Course Not FOUND');
error_log(print_r($item_result, 1));
@ -1125,11 +1113,11 @@ class Migration {
$handler_id = $item_result['user_id'];
//error_log($dest_row['email'].' '.$dest_row['uidIdPersona']);
if (isset($dest_row['uidIdAlumno'])) {
//$this->data_list['users_alumno'][$dest_row['uidIdAlumno']]['extra'] = $item_result;
//$data_list['users_alumno'][$dest_row['uidIdAlumno']]['extra'] = $item_result;
}
if (isset($dest_row['uidIdEmpleado'])) {
//print_r($dest_row['uidIdEmpleado']);exit;
//$this->data_list['users_empleado'][$dest_row['uidIdEmpleado']]['extra'] = $item_result;
//$data_list['users_empleado'][$dest_row['uidIdEmpleado']]['extra'] = $item_result;
}
} else {
global $api_failureList;
@ -1138,7 +1126,7 @@ class Migration {
}
break;
case 'session':
//$this->data_list['sessions'][$dest_row['uidIdPrograma']] = $item_result;
//$data_list['sessions'][$dest_row['uidIdPrograma']] = $item_result;
$handler_id = $item_result; //session_id
break;
}

File diff suppressed because it is too large Load Diff

@ -35,10 +35,13 @@ class MigrationMSSQL extends Migration {
$top = null;
// $top = " TOP 100000 ";
if (in_array($table, array('Empleado', 'Alumno'))) {
// $top = " TOP 2000 ";
//$top = " TOP 2000 ";
}
if (in_array($table, array('ProgramaAcademico', 'Matricula'))) {
if ($table == 'ProgramaAcademico') {
//$top = ' TOP 1000 ';
}
if ($table == 'Matricula') {
//$top = " TOP 1000 ";
}

Loading…
Cancel
Save