From 7c993b1ba5a52339cf64abb875df44c540706e04 Mon Sep 17 00:00:00 2001 From: David Nos Date: Thu, 7 Jul 2016 16:32:47 +0200 Subject: [PATCH] Apply small format corrections following Chamilo code style. --- app/Migrations/Schema/V111/Version20160706182000.php | 2 +- main/inc/lib/auth.lib.php | 2 +- main/inc/lib/course.lib.php | 9 ++++----- main/inc/lib/course_category.lib.php | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/Migrations/Schema/V111/Version20160706182000.php b/app/Migrations/Schema/V111/Version20160706182000.php index 758c4a5e7c..5c1db18a88 100644 --- a/app/Migrations/Schema/V111/Version20160706182000.php +++ b/app/Migrations/Schema/V111/Version20160706182000.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' ); } diff --git a/main/inc/lib/auth.lib.php b/main/inc/lib/auth.lib.php index a963e6f13a..484d1531e9 100755 --- a/main/inc/lib/auth.lib.php +++ b/main/inc/lib/auth.lib.php @@ -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 diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index 13d9355e93..b48c1064d4 100755 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -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 diff --git a/main/inc/lib/course_category.lib.php b/main/inc/lib/course_category.lib.php index 01edb4b297..e766199a92 100755 --- a/main/inc/lib/course_category.lib.php +++ b/main/inc/lib/course_category.lib.php @@ -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