Apply small format corrections following Chamilo code style.

remotes/angel/1.11.x
David Nos 9 years ago
parent 0106766c70
commit 7c993b1ba5
  1. 2
      app/Migrations/Schema/V111/Version20160706182000.php
  2. 2
      main/inc/lib/auth.lib.php
  3. 9
      main/inc/lib/course.lib.php
  4. 2
      main/inc/lib/course_category.lib.php

@ -23,7 +23,7 @@ class Version20160706182000 extends AbstractMigrationChamilo
public function up(Schema $schema)
{
$this->addSql(
'CREATE TABLE course_rel_user_catalogue (id int(11) NOT NULL AUTO_INCREMENT, user_id int(11) DEFAULT NULL, c_id int(11) DEFAULT NULL, visible int(11) NOT NULL, PRIMARY KEY (id), KEY (user_id), KEY (c_id), CONSTRAINT FOREIGN KEY (c_id) REFERENCES course (id) ON DELETE CASCADE, CONSTRAINT FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci'
'CREATE TABLE course_rel_user_catalogue (id int NOT NULL AUTO_INCREMENT, user_id int DEFAULT NULL, c_id int DEFAULT NULL, visible int NOT NULL, PRIMARY KEY (id), KEY (user_id), KEY (c_id), CONSTRAINT FOREIGN KEY (c_id) REFERENCES course (id) ON DELETE CASCADE, CONSTRAINT FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci'
);
}

@ -434,7 +434,7 @@ class Auth
$without_special_courses = ' AND course.code NOT IN (' . implode(',', $special_course_list) . ')';
}
$visibilityCondition = ($justVisible?CourseManager::getCourseVisibilitySQLCondition("course"):'');
$visibilityCondition = ($justVisible?CourseManager::getCourseVisibilitySQLCondition('course'):'');
$search_term_safe = Database::escape_string($search_term);
$sql_find = "SELECT * FROM $courseTable

@ -779,7 +779,7 @@ class CourseManager
/**
* Add the user $userId visibility to the course $courseCode in the catalogue.
* @author David Nos
* @author David Nos (https://github.com/dnos)
*
* @param int $userId the id of the user
* @param string $courseCode the course code
@ -837,7 +837,7 @@ class CourseManager
/**
* Remove the user $userId visibility to the course $courseCode in the catalogue.
* @author David Nos
* @author David Nos (https://github.com/dnos)
*
* @param int $userId the id of the user
* @param string $courseCode the course code
@ -872,8 +872,7 @@ class CourseManager
)
);
return Database::delete($courseUserTable, $cond);
}
else {
} else {
return true; // Register does not exist
}
}
@ -5026,7 +5025,7 @@ class CourseManager
$withoutSpecialCourses = ' AND c.code NOT IN ("' . implode('","', $specialCourseList) . '")';
}
$visibilityCondition = self::getCourseVisibilitySQLCondition("c");
$visibilityCondition = self::getCourseVisibilitySQLCondition('c');
if (!empty($accessUrlId) && $accessUrlId == intval($accessUrlId)) {
$sql = "SELECT count(c.id) FROM $tableCourse c, $tableCourseRelAccessUrl u

@ -592,7 +592,7 @@ class CourseCategory
$without_special_courses = ' AND course.code NOT IN ("'.implode('","', $specialCourseList).'")';
}
$visibilityCondition = CourseManager::getCourseVisibilitySQLCondition("course");
$visibilityCondition = CourseManager::getCourseVisibilitySQLCondition('course');
if ($categoryCode == 'ALL') {
// Nothing to do

Loading…
Cancel
Save