Просмотр исходного кода

Merge branch '1.10.x' of https://github.com/chamilo/chamilo-lms into 1.10.x

Angel Fernando Quiroz Campos 9 лет назад
Родитель
Сommit
76add8fdd4

+ 2 - 2
app/Migrations/Schema/V110/Version110.php

@@ -29,8 +29,8 @@ class Version110 extends AbstractMigrationChamilo
         $this->addSql("CREATE TABLE IF NOT EXISTS hook_observer( id int UNSIGNED NOT NULL AUTO_INCREMENT, class_name varchar(255) UNIQUE, path varchar(255) NOT NULL, plugin_name varchar(255) NULL, PRIMARY KEY PK_hook_management_hook_observer(id))");
         $this->addSql("CREATE TABLE IF NOT EXISTS hook_event( id int UNSIGNED NOT NULL AUTO_INCREMENT, class_name varchar(255) UNIQUE, description varchar(255), PRIMARY KEY PK_hook_management_hook_event(id))");
         $this->addSql("CREATE TABLE IF NOT EXISTS hook_call( id int UNSIGNED NOT NULL AUTO_INCREMENT, hook_event_id int UNSIGNED NOT NULL, hook_observer_id int UNSIGNED NOT NULL, type tinyint NOT NULL, hook_order int UNSIGNED NOT NULL, enabled tinyint NOT NULL, PRIMARY KEY PK_hook_management_hook_call(id))");
-        $this->addSql("CREATE TABLE IF NOT EXISTS c_student_publication_rel_document (iid INT PRIMARY KEY NOT NULL AUTO_INCREMENT, id INT, work_id INT NOT NULL, document_id INT NOT NULL, c_id INT NOT NULL)");
-        $this->addSql("CREATE TABLE IF NOT EXISTS c_student_publication_rel_user (iid INT PRIMARY KEY NOT NULL AUTO_INCREMENT, id INT, work_id INT NOT NULL, user_id INT NOT NULL, c_id INT NOT NULL)");
+        $this->addSql("CREATE TABLE IF NOT EXISTS c_student_publication_rel_document (id INT, work_id INT NOT NULL, document_id INT NOT NULL, c_id INT NOT NULL)");
+        $this->addSql("CREATE TABLE IF NOT EXISTS c_student_publication_rel_user (id INT, work_id INT NOT NULL, user_id INT NOT NULL, c_id INT NOT NULL)");
         $this->addSql("CREATE TABLE IF NOT EXISTS c_student_publication_comment (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, work_id INT NOT NULL, c_id INT NOT NULL, comment text, file VARCHAR(255), user_id int NOT NULL, sent_at datetime NOT NULL)");
         $this->addSql("CREATE TABLE IF NOT EXISTS c_attendance_calendar_rel_group (iid int NOT NULL auto_increment PRIMARY KEY, id INT, c_id INT NOT NULL, group_id INT NOT NULL, calendar_id INT NOT NULL)");
 

+ 29 - 31
main/exercice/hotspot_actionscript_admin.as.php

@@ -2,16 +2,14 @@
 /* For licensing terms, see /license.txt */
 
 /**
-*	This file generates the ActionScript variables code used by the HotSpot .swf
-*	@package chamilo.exercise
-* 	@author Toon Keppens
-* 	@version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $
+* This file generates the ActionScript variables code used by the HotSpot .swf
+* @package chamilo.exercise
+* @author Toon Keppens
 */
 require_once '../inc/global.inc.php';
 
 // set vars
 $questionId = intval($_GET['modifyAnswers']);
-error_log($questionId);
 $objQuestion = Question::read($questionId);
 $_course = api_get_course_info();
 
@@ -37,35 +35,35 @@ $answers = $_SESSION['tmp_answers'];
 $nbrAnswers = count($answers['answer']);
 
 for ($i=1;$i <= $nbrAnswers; $i++) {
-   	$output .= "&hotspot_".$i."=true";
-	$output .= "&hotspot_".$i."_answer=".$answers['answer'][$i];
+    $output .= "&hotspot_".$i."=true";
+    $output .= "&hotspot_".$i."_answer=".$answers['answer'][$i];
 
-	if ($answer_type == HOT_SPOT_DELINEATION) {
-		if ($i==1) {
-		    $output .= "&hotspot_".$i."_type=delineation";
-		} else
-			{$output .= "&hotspot_".$i."_type=oar";}
-	} else {
-		// Square or rectancle
-		if ($answers['hotspot_type'][$i] == 'square') {
-			$output .= "&hotspot_".$i."_type=square";
-		}
+    if ($answer_type == HOT_SPOT_DELINEATION) {
+        if ($i==1) {
+            $output .= "&hotspot_".$i."_type=delineation";
+        } else
+            {$output .= "&hotspot_".$i."_type=oar";}
+    } else {
+        // Square or rectancle
+        if ($answers['hotspot_type'][$i] == 'square') {
+            $output .= "&hotspot_".$i."_type=square";
+        }
 
-		// Circle or ovale
-		if ($answers['hotspot_type'][$i] == 'circle') {
-			$output .= "&hotspot_".$i."_type=circle";
-		}
+        // Circle or ovale
+        if ($answers['hotspot_type'][$i] == 'circle') {
+            $output .= "&hotspot_".$i."_type=circle";
+        }
 
-		// Polygon
-		if ($answers['hotspot_type'][$i] == 'poly') {
-			$output .= "&hotspot_".$i."_type=poly";
-		}
-		/*// Delineation
-		if ($answers['hotspot_type'][$i] == 'delineation')
-		{
-			$output .= "&hotspot_".$i."_type=delineation";
-		}*/
-	}
+        // Polygon
+        if ($answers['hotspot_type'][$i] == 'poly') {
+            $output .= "&hotspot_".$i."_type=poly";
+        }
+        /*// Delineation
+        if ($answers['hotspot_type'][$i] == 'delineation')
+        {
+            $output .= "&hotspot_".$i."_type=delineation";
+        }*/
+    }
 
 	// This is a good answer, count + 1 for nmbr of clicks
 	if ($answers['weighting'][$i] > 0) {

+ 29 - 24
main/install/index.php

@@ -725,38 +725,43 @@ if (@$_POST['step2']) {
                 echo '<div id="details" style="display:none">';
                 // Migrate using the migration files located in:
                 // src/Chamilo/CoreBundle/Migrations/Schema/V110
-                migrate(
+                $result = migrate(
                     110,
                     $manager
                 );
 
                 echo '</div>';
 
-                fixIds($manager);
-
-                include 'update-files-1.9.0-1.10.0.inc.php';
-                // Only updates the configuration.inc.php with the new version
-                include 'update-configuration.inc.php';
-
-                $configurationFiles = array(
-                    'mail.conf.php',
-                    'profile.conf.php',
-                    'course_info.conf.php',
-                    'add_course.conf.php',
-                    'events.conf.php',
-                    'auth.conf.php',
-                    'portfolio.conf.php'
-                );
-
-                foreach ($configurationFiles as $file) {
-                    if (file_exists(api_get_path(SYS_CODE_PATH) . 'inc/conf/'.$file)) {
-                        copy(
-                            api_get_path(SYS_CODE_PATH).'inc/conf/'.$file,
-                            api_get_path(CONFIGURATION_PATH).$file
-                        );
+                if ($result) {
+                    error_log('Migrations files were executed.');
+
+                    fixIds($manager);
+
+                    include 'update-files-1.9.0-1.10.0.inc.php';
+                    // Only updates the configuration.inc.php with the new version
+                    include 'update-configuration.inc.php';
+
+                    $configurationFiles = array(
+                        'mail.conf.php',
+                        'profile.conf.php',
+                        'course_info.conf.php',
+                        'add_course.conf.php',
+                        'events.conf.php',
+                        'auth.conf.php',
+                        'portfolio.conf.php'
+                    );
+
+                    foreach ($configurationFiles as $file) {
+                        if (file_exists(api_get_path(SYS_CODE_PATH) . 'inc/conf/'.$file)) {
+                            copy(
+                                api_get_path(SYS_CODE_PATH).'inc/conf/'.$file,
+                                api_get_path(CONFIGURATION_PATH).$file
+                            );
+                        }
                     }
+                } else {
+                    error_log('There was an error during running migrations. Check error.log');
                 }
-
                 break;
             default:
                 break;

+ 3 - 0
main/install/install.lib.php

@@ -2021,11 +2021,14 @@ function migrate($chamiloVersion, EntityManager $manager)
         if ($debug) {
             echo 'DONE'.$nl;
         }
+        return true;
     } catch (Exception $ex) {
         if ($debug) {
             echo 'ERROR: '.$ex->getMessage().$nl;
         }
     }
+
+    return false;
 }
 
 /**