Fixing function "generate_couser_code" callings

skala
Julio Montoya 12 years ago
parent aa87258f30
commit d76fbf3fe6
  1. 4
      main/admin/course_category.php
  2. 2
      main/survey/survey.lib.php

@ -265,7 +265,7 @@ function addNode($code, $name, $canHaveCourses, $parent_id) {
$tree_pos = $row['maxTreePos'] + 1;
$code = generate_course_code($code);
$code = CourseManager::generate_course_code($code);
Database::query("INSERT INTO $tbl_category(name,code,parent_id,tree_pos,children_count,auth_course_child) VALUES('$name','$code'," . (empty($parent_id) ? "NULL" : "'$parent_id'") . ",'$tree_pos','0','$canHaveCourses')");
updateFils($parent_id);
@ -287,7 +287,7 @@ function editNode($code, $name, $canHaveCourses, $old_code) {
return false;
}
}
$code = generate_course_code($code);
$code = CourseManager::generate_course_code($code);
Database::query("UPDATE $tbl_category SET name='$name', code='$code',auth_course_child='$canHaveCourses' WHERE code='$old_code'");
$sql = "UPDATE $tbl_course SET category_code = '$code' WHERE category_code = '$old_code' ";
Database::query($sql);

@ -224,7 +224,7 @@ class survey_manager {
$course_id = api_get_course_int_id();
$sql = "INSERT INTO $table_survey (c_id, code, title, subtitle, author, lang, avail_from, avail_till, is_shared, template, intro, surveythanks, creation_date, anonymous".$additional['columns'].", session_id) VALUES (
$course_id,
'".Database::escape_string(strtolower(generate_course_code(api_substr($values['survey_code'],0))))."',
'".Database::escape_string(strtolower(CourseManager::generate_course_code(api_substr($values['survey_code'],0))))."',
'".Database::escape_string($values['survey_title'])."',
'".Database::escape_string($values['survey_subtitle'])."',
'".Database::escape_string($_user['user_id'])."',

Loading…
Cancel
Save