Explorar el Código

[svn r15885] FS#2720

Fix a bug when try to adding the same course more than one time on a session
Julian Prud'homme hace 16 años
padre
commit
9ac385a485
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      main/admin/add_courses_to_session.php

+ 3 - 1
main/admin/add_courses_to_session.php

@@ -181,7 +181,9 @@ if($_POST['formSent'])
 		if(!$exists)
 		{
 			api_sql_query("INSERT INTO $tbl_session_rel_course(id_session,course_code, id_coach) VALUES('$id_session','$enreg_course','$id_coach')",__FILE__,__LINE__);
-
+			
+			//We add in the existing courses table the current course, to not try to add another time the current course
+			$existingCourses[]=array('course_code'=>$enreg_course);
 
 			$nbr_users=0;
 			foreach($UserList as $enreg_user)