Replace api_get_real_course_id with api_get_course_int_id, Rename $VCHAMILO with $virtualChamilo

pull/2487/head
jmontoyaa 9 years ago
parent c81ef9b2ea
commit 12732880b7
  1. 2
      main/group/group_creation.php
  2. 27
      main/inc/lib/api.lib.php
  3. 2
      main/inc/lib/certificate.lib.php
  4. 2
      main/inc/lib/course_description.lib.php
  5. 2
      main/inc/lib/groupmanager.lib.php
  6. 2
      plugin/openmeetings/lib/room.class.php

@ -264,7 +264,7 @@ EOT;
/*
* Show form to generate groups from classes subscribed to the course
*/
$options['where'] = array(" usergroup.course_id = ? " => api_get_real_course_id());
$options['where'] = array(" usergroup.course_id = ? " => api_get_course_int_id());
$obj = new UserGroup();
$classes = $obj->getUserGroupInCourse($options);
if (count($classes) > 0) {

@ -734,7 +734,6 @@ function api_get_path($path = '', $configuration = [])
$course_folder = api_add_trailing_slash($course_folder);
// Initialization of a table that contains common-purpose paths.
$paths[$root_web][REL_PATH] = $root_rel;
$paths[$root_web][REL_COURSE_PATH] = $root_rel.$course_folder;
$paths[$root_web][REL_DEFAULT_COURSE_DOCUMENT_PATH] = $paths[$root_web][REL_PATH].'main/default_course_document/';
@ -777,11 +776,11 @@ function api_get_path($path = '', $configuration = [])
$paths[$root_web][LIBRARY_PATH] = $paths[$root_web][SYS_CODE_PATH].$paths[$root_web][LIBRARY_PATH];
$paths[$root_web][CONFIGURATION_PATH] = $paths[$root_web][SYS_PATH].$paths[$root_web][CONFIGURATION_PATH];
global $VCHAMILO;
if (!empty($VCHAMILO)) {
$paths[$root_web][SYS_ARCHIVE_PATH] = $VCHAMILO[SYS_ARCHIVE_PATH];
$paths[$root_web][SYS_HOME_PATH] = $VCHAMILO[SYS_HOME_PATH];
$paths[$root_web][SYS_COURSE_PATH] = $VCHAMILO[SYS_COURSE_PATH];
global $virtualChamilo;
if (!empty($virtualChamilo)) {
$paths[$root_web][SYS_ARCHIVE_PATH] = $virtualChamilo[SYS_ARCHIVE_PATH];
$paths[$root_web][SYS_HOME_PATH] = $virtualChamilo[SYS_HOME_PATH];
$paths[$root_web][SYS_COURSE_PATH] = $virtualChamilo[SYS_COURSE_PATH];
}
$isInitialized[$root_web] = true;
@ -1477,16 +1476,7 @@ function api_get_user_info_from_email($email = '')
*/
function api_get_course_id()
{
return isset($GLOBALS['_cid']) ? $GLOBALS['_cid'] : null;
}
/**
* Returns the current course id
* @return int
*/
function api_get_real_course_id()
{
return api_get_course_int_id();
return Session::read('_cid', null);
}
/**
@ -3941,7 +3931,7 @@ function api_get_item_property_id($course_code, $tool, $ref, $sessionId = 0)
function api_track_item_property_update($tool, $ref, $title, $content, $progress)
{
$tbl_stats_item_property = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY);
$course_id = api_get_real_course_id(); //numeric
$course_id = api_get_course_int_id(); //numeric
$course_code = api_get_course_id(); //alphanumeric
$item_property_id = api_get_item_property_id($course_code, $tool, $ref);
if (!empty($item_property_id)) {
@ -3971,7 +3961,7 @@ function api_track_item_property_update($tool, $ref, $title, $content, $progress
function api_get_track_item_property_history($tool, $ref)
{
$tbl_stats_item_property = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY);
$course_id = api_get_real_course_id(); //numeric
$course_id = api_get_course_int_id(); //numeric
$course_code = api_get_course_id(); //alphanumeric
$item_property_id = api_get_item_property_id($course_code, $tool, $ref);
$sql = "SELECT * FROM $tbl_stats_item_property
@ -3979,6 +3969,7 @@ function api_get_track_item_property_history($tool, $ref)
ORDER BY lastedit_date DESC";
$result = Database::query($sql);
$result = Database::store_result($result,'ASSOC');
return $result;
}

@ -184,7 +184,7 @@ class Certificate extends Model
//If the gradebook is related to skills we added the skills to the user
$courseId = api_get_real_course_id();
$courseId = api_get_course_int_id();
$sessionId = api_get_session_id();
$skill = new Skill();

@ -241,7 +241,7 @@ class CourseDescription
{
$tbl_stats_item_property = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY);
$description_id = $this->get_id_by_description_type($description_type);
$course_id = api_get_real_course_id();
$course_id = api_get_course_int_id();
$course_code = api_get_course_id();
$item_property_id = api_get_item_property_id(
$course_code,

@ -344,7 +344,7 @@ class GroupManager
*/
public static function create_class_groups($category_id)
{
$options['where'] = array(" usergroup.course_id = ? " => api_get_real_course_id());
$options['where'] = array(" usergroup.course_id = ? " => api_get_course_int_id());
$obj = new UserGroup();
$classes = $obj->getUserGroupInCourse($options);
$group_ids = array();

@ -47,7 +47,7 @@ class Room
{
$this->table = \Database::get_main_table('plugin_openmeetings');
global $_configuration;
$this->name = 'C'.api_get_real_course_id().'-'.api_get_session_id();
$this->name = 'C'.api_get_course_int_id().'-'.api_get_session_id();
$accessUrl = api_get_access_url($_configuration['access_url']);
$this->externalRoomType = substr($accessUrl['url'], strpos($accessUrl['url'],'://')+3,-1);
if (strcmp($this->externalRoomType, 'localhost') == 0) {

Loading…
Cancel
Save