Version 15.240.2

This commit is contained in:
Antonio Cañas Vargas 2016-07-02 11:26:08 +02:00
parent a604fc9d11
commit c67fcc1cd9
2 changed files with 16 additions and 7 deletions

View File

@ -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)

View File

@ -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;
}