Prechádzať zdrojové kódy

[svn r15885] FS#2720

Fix a bug when try to adding the same course more than one time on a session
Julian Prud'homme 16 rokov pred
rodič
commit
9ac385a485
1 zmenil súbory, kde vykonal 3 pridanie a 1 odobranie
  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)