Browse Source

Merge branch '1.10.x' into bootstrap

aragonc 10 years ago
parent
commit
8c28192410

+ 1 - 1
main/inc/lib/javascript/ckeditor/plugins/asciisvg/dialogs/mathjax.js

@@ -564,7 +564,7 @@ CKEDITOR.dialog.add( 'asciisvg', function( editor ) {
                         type: 'html',
                         html: '<embed ' +
                             'type="image/svg+xml" ' +
-                            'src="' + CKEDITOR.basePath + 'plugins/asciisvg/d.svg" ' +
+                            'src="' + CKEDITOR.plugins.getPath('asciisvg') + 'd.svg" ' +
                             'style="width:300px; height:200px; ' +
                             'vertical-align:middle; float:none;" sscr="-7.5,7.5,-5,5,1,1,1,1,1,'+defaultwidth+','+defaultheight+'" />',
                         onShow: function( widget ) {

+ 2 - 0
main/inc/local.inc.php

@@ -379,6 +379,7 @@ if (!empty($_SESSION['_user']['user_id']) && !($login || $logout)) {
                                         $_user['status']  = $uData['status'];
                                         Session::write('_user', $_user);
                                         Event::event_login();
+                                        $logging_in = true;
                                     } else {
                                         //This means a secondary admin wants to login so we check as he's a normal user
                                         if (in_array($current_access_url_id, $my_url_list)) {
@@ -386,6 +387,7 @@ if (!empty($_SESSION['_user']['user_id']) && !($login || $logout)) {
                                             $_user['status']  = $uData['status'];
                                             Session::write('_user', $_user);
                                             Event::event_login();
+                                            $logging_in = true;
                                         } else {
                                             $loginFailed = true;
                                             Session::erase('_uid');

+ 1 - 1
main/install/db_main.sql

@@ -884,7 +884,7 @@ VALUES
 ('tool_visible_by_default_at_creation','quiz','checkbox','Tools','true','ToolVisibleByDefaultAtCreationTitle','ToolVisibleByDefaultAtCreationComment',NULL,'Quiz', 1),
 ('tool_visible_by_default_at_creation','gradebook','checkbox','Tools','true','ToolVisibleByDefaultAtCreationTitle','ToolVisibleByDefaultAtCreationComment',NULL,'Gradebook', 1),
 ('prevent_session_admins_to_manage_all_users', NULL, 'radio', 'Session', 'false', 'PreventSessionAdminsToManageAllUsersTitle', 'PreventSessionAdminsToManageAllUsersComment', NULL, NULL, 1),
-('chamilo_database_version', NULL, 'textfield',NULL, '1.10.0.16','DatabaseVersion','', NULL, NULL, 0);
+('chamilo_database_version', NULL, 'textfield',NULL, '1.10.0.17','DatabaseVersion','', NULL, NULL, 0);
 UNLOCK TABLES;
 /*!40000 ALTER TABLE settings_current ENABLE KEYS */;
 

+ 3 - 0
main/install/migrate-db-1.9.0-1.10.0-post.sql

@@ -25,6 +25,9 @@ ALTER TABLE track_e_course_access DROP COLUMN course_code;
 ALTER TABLE track_e_online DROP COLUMN course;
 ALTER TABLE track_e_attempt DROP COLUMN course_code;
 
+-- not yet ready, uncomment when all user_id have been replaced by id
+-- ALTER TABLE user DROP COLUMN user_id;
+
 -- xxCOURSExx
 
 

+ 4 - 1
main/install/migrate-db-1.9.0-1.10.0-pre.sql

@@ -66,6 +66,9 @@ ALTER TABLE track_e_login CHANGE COLUMN login_ip user_ip varchar(39) NOT NULL DE
 ALTER TABLE user MODIFY COLUMN user_id int unsigned DEFAULT null;
 ALTER TABLE user DROP PRIMARY KEY;
 ALTER TABLE user ADD COLUMN id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT AFTER user_id;
+UPDATE user SET id = user_id;
+UPDATE user SET registration_date = NULL WHERE registration_date = '0000-00-00 00:00:00';
+UPDATE user SET expiration_date = NULL WHERE expiration_date = '0000-00-00 00:00:00';
 
 ALTER TABLE user MODIFY COLUMN chatcall_date datetime default NULL;
 ALTER TABLE user MODIFY COLUMN chatcall_text varchar(50) default NULL;
@@ -82,7 +85,7 @@ INSERT INTO settings_options (variable, value, display_text) VALUES ('show_gloss
 INSERT INTO settings_options (variable, value, display_text) VALUES ('show_glossary_in_extra_tools', 'exercise_and_lp', 'ExerciseAndLearningPath');
 
 -- Do not move this query
-UPDATE settings_current SET selected_value = '1.10.0.16' WHERE variable = 'chamilo_database_version';
+UPDATE settings_current SET selected_value = '1.10.0.17' WHERE variable = 'chamilo_database_version';
 
 -- xxCOURSExx
 

+ 0 - 16
main/install/update-db-1.9.0-1.10.0.inc.php

@@ -121,22 +121,6 @@ if (defined('SYSTEM_INSTALLATION')) {
                     iDatabase::query($sql);
                 }
             }
-
-            // Updating user.id field
-            $res = iDatabase::query("SELECT user_id FROM $dbNameForm.user");
-            $result = iDatabase::query($sql);
-            $users = Database::store_result($result);
-            foreach ($users as $user) {
-                $userId = $user['user_id'];
-                $sql = "UPDATE $dbNameForm.user SET id = $userId WHERE user_id = $userId";
-                iDatabase::query($sql);
-            }
-
-            // Set null registration_date = 0000-00-00 00:00:00
-            $sql = "UPDATE $dbNameForm.user SET registration_date = NULL WHERE registration_date = '0000-00-00 00:00:00'";
-            iDatabase::query($sql);
-            $sql = "UPDATE $dbNameForm.user SET expiration_date = NULL WHERE expiration_date = '0000-00-00 00:00:00'";
-            iDatabase::query($sql);
         }
     }
 

+ 1 - 2
src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Basic.php

@@ -57,7 +57,6 @@ class Basic extends Toolbar
 
         if (api_get_setting('enabled_googlemaps') == 'true') {
             $plugins[] = 'leaflet';
-            $plugins[] = 'mapping';
         }
 
         if (api_get_setting('math_asciimathML') == 'true') {
@@ -75,7 +74,7 @@ class Basic extends Toolbar
         }
 
         if (api_get_setting('enabled_imgmap') == 'true') {
-            // Commercial plugin
+            $plugins[] = 'mapping';
         }
 
         if (api_get_setting('block_copy_paste_for_students') == 'true') {