Fixing some fatal error due some changes of CHamilo 1.10 + updating composer and autoload classes "Attendance" class conflict resolved

skala
Julio Montoya 13 years ago
parent 6f9605dc2d
commit 3a4825ac63
  1. 1
      main/course_progress/thematic_controller.php
  2. 2
      main/coursecopy/classes/Attendance.class.php
  3. 2
      main/coursecopy/classes/CourseBuilder.class.php
  4. 16
      main/inc/lib/thematic.lib.php
  5. 10
      vendor/composer/ClassLoader.php
  6. 3026
      vendor/composer/autoload_classmap.php
  7. 7
      vendor/composer/autoload_namespaces.php

@ -353,6 +353,7 @@ class ThematicController {
* render to thematic_advance.php
*/
public function thematic_advance($action) {
require_once api_get_path(LIBRARY_PATH).'thematic.lib.php';
$thematic = new Thematic();
$attendance = new Attendance();

@ -6,7 +6,7 @@ require_once 'Resource.class.php';
* @package chamilo.backup
*/
class Attendance extends Resource {
class CourseCopyAttendance extends Resource {
var $params = array();
var $attendance_calendar = array();

@ -949,7 +949,7 @@ class CourseBuilder {
$sql = 'SELECT * FROM '.$table_attendance.' WHERE c_id = '.$course_id.' AND session_id = 0 ';
$db_result = Database::query($sql);
while ($row = Database::fetch_array($db_result,'ASSOC')) {
$obj = new Attendance($row);
$obj = new CourseCopyAttendance($row);
$sql = 'SELECT * FROM '.$table_attendance_calendar.' WHERE c_id = '.$course_id.' AND attendance_id = '.$row['id'];
$result = Database::query($sql);

@ -310,7 +310,7 @@ class Thematic
}
} else {
// update
$sql = "UPDATE $tbl_thematic SET title = '$title', content = '$content', session_id = $session_id WHERE id = $id AND c_id = {$this->course_int_id}";
$sql = "UPDATE $tbl_thematic SET title = '$title', content = '$content', session_id = $session_id WHERE id = $id AND c_id = $course_id";
Database::query($sql);
$last_id = $id;
if (Database::affected_rows()) {
@ -389,10 +389,10 @@ class Thematic
* Get the total number of thematic advance inside current course
* @see SortableTable#get_total_number_of_items()
*/
public function get_number_of_thematic_advances() {
public static function get_number_of_thematic_advances() {
global $thematic_id;
$tbl_thematic_advance = Database :: get_course_table(TABLE_THEMATIC_ADVANCE);
$course_id = $this->get_course_int_id();
$course_id = api_get_course_int_id();
$sql = "SELECT COUNT(id) AS total_number_of_items
FROM $tbl_thematic_advance
@ -411,7 +411,7 @@ class Thematic
* @param string Order (ASC,DESC)
* @see SortableTable#get_table_data($from)
*/
public function get_thematic_advance_data($from, $number_of_items, $column, $direction) {
public static function get_thematic_advance_data($from, $number_of_items, $column, $direction) {
global $thematic_id;
$tbl_thematic_advance = Database :: get_course_table(TABLE_THEMATIC_ADVANCE);
$thematic_data = self::get_thematic_list($thematic_id);
@ -423,7 +423,7 @@ class Thematic
}
$data = array();
$course_id = $this->get_course_int_id();
$course_id = api_get_course_int_id();
if (api_is_allowed_to_edit(null, true)) {
@ -799,7 +799,7 @@ class Thematic
// check thematic plan type already exists
$sql = "SELECT id FROM $tbl_thematic_plan
WHERE c_id = $course_id AND thematic_id = $thematic_id AND description_type = '$description_type'";
$rs = Database::query($sql);
$rs = Database::query($sql);
$affected_rows = 0;
if (Database::num_rows($rs) > 0) {
@ -827,7 +827,7 @@ class Thematic
} else {
// insert
$ins = "INSERT INTO $tbl_thematic_plan (c_id, thematic_id, title, description, description_type)
VALUES ($this->course_int_id, $thematic_id, '$title', '$description', $description_type) ";
VALUES ($course_id, $thematic_id, '$title', '$description', $description_type) ";
Database::query($ins);
$last_id = Database::insert_id();
$affected_rows = Database::affected_rows();
@ -838,7 +838,7 @@ class Thematic
} else {
// insert
$ins = "INSERT INTO $tbl_thematic_plan (c_id, thematic_id, title, description, description_type)
VALUES($this->course_int_id, $thematic_id, '$title', '$description', $description_type) ";
VALUES($course_id, $thematic_id, '$title', '$description', $description_type) ";
Database::query($ins);
$last_id = Database::insert_id();
$affected_rows = Database::affected_rows();

@ -162,14 +162,14 @@ class ClassLoader
*/
public function findFile($class)
{
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ('\\' == $class[0]) {
$class = substr($class, 1);
}
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)) . DIRECTORY_SEPARATOR;
@ -202,6 +202,6 @@ class ClassLoader
return $file;
}
$this->classMap[$class] = false;
return $this->classMap[$class] = false;
}
}

File diff suppressed because it is too large Load Diff

@ -6,12 +6,5 @@ $vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'Symfony\\Component\\Routing' => $vendorDir . '/symfony/routing/',
'Symfony\\Component\\HttpKernel' => $vendorDir . '/symfony/http-kernel/',
'Symfony\\Component\\HttpFoundation' => $vendorDir . '/symfony/http-foundation/',
'Symfony\\Component\\EventDispatcher' => $vendorDir . '/symfony/event-dispatcher/',
'Silex' => $vendorDir . '/silex/silex/src/',
'SessionHandlerInterface' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs',
'Pimple' => $vendorDir . '/pimple/pimple/lib/',
'Chamilo' => $baseDir . '/src/',
);

Loading…
Cancel
Save