From c67fcc1cd93d2724b8fa37b4155138878fb6e10e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sat, 2 Jul 2016 11:26:08 +0200 Subject: [PATCH] Version 15.240.2 --- swad_changelog.h | 3 ++- swad_course.c | 20 ++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 159ced991..24e349820 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -136,13 +136,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.240.1 (2016-07-02)" +#define Log_PLATFORM_VERSION "SWAD 15.240.2 (2016-07-02)" #define CSS_FILE "swad15.229.css" #define JS_FILE "swad15.238.1.js" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1 /* + Version 15.240.2: Jul 02, 2015 Fixed bug in edition of courses. (203548 lines) Version 15.240.1: Jul 02, 2015 Fixed bug in web service. (203539 lines) Version 15.240: Jul 01, 2015 Copy subject and content of message to hidden param when clicking on link. (203534 lines) Version 15.239: Jul 01, 2015 Code refactoring related to contextual menus. (203531 lines) diff --git a/swad_course.c b/swad_course.c index 6af8876a9..df7561a44 100644 --- a/swad_course.c +++ b/swad_course.c @@ -2457,13 +2457,17 @@ void Crs_ChangeCrsYearInConfig (void) if (NewYear <= Deg_MAX_YEARS_PER_DEGREE) // If year is valid { /***** If name of course was in database in the new year... *****/ - if (Crs_CheckIfCourseNameExistsInCourses (Gbl.CurrentCrs.Crs.DegCod,NewYear,"ShortName",Gbl.CurrentCrs.Crs.ShortName,-1L)) + if (Crs_CheckIfCourseNameExistsInCourses (Gbl.CurrentCrs.Crs.DegCod, + NewYear,"ShortName", + Gbl.CurrentCrs.Crs.ShortName,-1L)) { sprintf (Gbl.Message,Txt_The_course_X_already_exists_in_year_Y, Gbl.CurrentCrs.Crs.ShortName,Txt_YEAR_OF_DEGREE[NewYear]); Gbl.Error = true; } - else if (Crs_CheckIfCourseNameExistsInCourses (Gbl.CurrentCrs.Crs.DegCod,NewYear,"FullName",Gbl.CurrentCrs.Crs.FullName,-1L)) + else if (Crs_CheckIfCourseNameExistsInCourses (Gbl.CurrentCrs.Crs.DegCod, + NewYear,"FullName", + Gbl.CurrentCrs.Crs.FullName,-1L)) { sprintf (Gbl.Message,Txt_The_course_X_already_exists_in_year_Y, Gbl.CurrentCrs.Crs.FullName,Txt_YEAR_OF_DEGREE[NewYear]); @@ -2523,13 +2527,17 @@ void Crs_ChangeCrsYear (void) if (NewYear <= Deg_MAX_YEARS_PER_DEGREE) // If year is valid { /***** If name of course was in database in the new year... *****/ - if (Crs_CheckIfCourseNameExistsInCourses (Crs->DegCod,NewYear,"ShortName",Crs->ShortName,-1L)) + if (Crs_CheckIfCourseNameExistsInCourses (Crs->DegCod, + NewYear,"ShortName", + Crs->ShortName,-1L)) { sprintf (Gbl.Message,Txt_The_course_X_already_exists_in_year_Y, Crs->ShortName,Txt_YEAR_OF_DEGREE[NewYear]); Gbl.Error = true; } - else if (Crs_CheckIfCourseNameExistsInCourses (Crs->DegCod,NewYear,"FullName",Crs->FullName,-1L)) + else if (Crs_CheckIfCourseNameExistsInCourses (Crs->DegCod, + NewYear,"FullName", + Crs->FullName,-1L)) { sprintf (Gbl.Message,Txt_The_course_X_already_exists_in_year_Y, Crs->FullName,Txt_YEAR_OF_DEGREE[NewYear]); @@ -2568,10 +2576,10 @@ static void Crs_UpdateCrsYear (struct Course *Crs,unsigned NewYear) /***** Update year/semester in table of courses *****/ sprintf (Query,"UPDATE courses SET Year='%u' WHERE CrsCod='%ld'", - NewYear,Gbl.CurrentCrs.Crs.CrsCod); + NewYear,Crs->CrsCod); DB_QueryUPDATE (Query,"can not update the year of a course"); - /***** Copy couese year/semester *****/ + /***** Copy course year/semester *****/ Crs->Year = NewYear; }