Version 16.41.2

This commit is contained in:
Antonio Cañas Vargas 2016-10-23 18:39:04 +02:00
parent 9d11e9bff3
commit 09beccd9c6
5 changed files with 16 additions and 30 deletions

View File

@ -150,13 +150,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.41.1 (2016-10-23)"
#define Log_PLATFORM_VERSION "SWAD 16.41.2 (2016-10-23)"
#define CSS_FILE "swad16.32.1.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 16.41.2: Oct 23, 2016 Code refactoring in degrees. (205430 lines)
Version 16.41.1: Oct 23, 2016 Code refactoring in courses. (205443 lines)
Version 16.41: Oct 23, 2016 New form in degree configuration to change short name. (205453 lines)
1 change necessary in database:

View File

@ -2411,10 +2411,8 @@ void Crs_ChangeCrsDegInConfig (void)
extern const char *Txt_The_course_X_has_been_moved_to_the_degree_Y;
struct Degree NewDeg;
/***** Get parameters from form *****/
/* Get parameter with degree code */
if ((NewDeg.DegCod = Deg_GetParamOtherDegCod ()) == -1L)
Lay_ShowErrorAndExit ("Code of degree is missing.");
/***** Get parameter with degree code *****/
NewDeg.DegCod = Deg_GetParamOtherDegCod ();
/***** Check if degree has changed *****/
if (NewDeg.DegCod != Gbl.CurrentCrs.Crs.DegCod)

View File

@ -106,7 +106,6 @@ static void Deg_RecFormRequestOrCreateDeg (unsigned Status);
static void Deg_PutParamOtherDegCod (long DegCod);
static void Deg_GetDataOfDegreeFromRow (struct Degree *Deg,MYSQL_ROW row);
static void Deg_GetDegCodFromForm (void);
static void Deg_RenameDegree (struct Degree *Deg,Cns_ShortOrFullName_t ShortOrFullName);
static bool Deg_CheckIfDegNameExistsInCtr (const char *FieldName,const char *Name,long DegCod,long CtrCod);
static void Deg_UpdateDegCtrDB (long DegCod,long CtrCod);
@ -1987,8 +1986,7 @@ void Deg_RemoveDegree (void)
struct Degree Deg;
/***** Get degree code *****/
if ((Deg.DegCod = Deg_GetParamOtherDegCod ()) == -1L)
Lay_ShowErrorAndExit ("Code of degree is missing.");
Deg.DegCod = Deg_GetParamOtherDegCod ();
/***** Get data of degree *****/
Deg_GetDataOfDegreeByCod (&Deg);
@ -2036,10 +2034,14 @@ static void Deg_PutParamOtherDegCod (long DegCod)
long Deg_GetParamOtherDegCod (void)
{
char LongStr[1+10+1];
long DegCod;
/***** Get parameter with code of degree *****/
Par_GetParToText ("OthDegCod",LongStr,1+10);
return Str_ConvertStrCodToLongCod (LongStr);
if ((DegCod = Str_ConvertStrCodToLongCod (LongStr)) < 0)
Lay_ShowErrorAndExit ("Code of degree is missing.");
return DegCod;
}
/*****************************************************************************/
@ -2331,7 +2333,7 @@ void Deg_RemoveDegreeCompletely (long DegCod)
void Deg_RenameDegreeShort (void)
{
Deg_GetDegCodFromForm ();
Gbl.Degs.EditingDeg.DegCod = Deg_GetParamOtherDegCod ();
Deg_RenameDegree (&Gbl.Degs.EditingDeg,Cns_SHORT_NAME);
}
@ -2346,7 +2348,7 @@ void Deg_RenameDegreeShortInConfig (void)
void Deg_RenameDegreeFull (void)
{
Deg_GetDegCodFromForm ();
Gbl.Degs.EditingDeg.DegCod = Deg_GetParamOtherDegCod ();
Deg_RenameDegree (&Gbl.Degs.EditingDeg,Cns_FULL_NAME);
}
@ -2355,17 +2357,6 @@ void Deg_RenameDegreeFullInConfig (void)
Deg_RenameDegree (&Gbl.CurrentDeg.Deg,Cns_FULL_NAME);
}
/*****************************************************************************/
/************************ Get the code of the degree *************************/
/*****************************************************************************/
static void Deg_GetDegCodFromForm (void)
{
/***** Get the code of the degree *****/
if ((Gbl.Degs.EditingDeg.DegCod = Deg_GetParamOtherDegCod ()) < 0)
Lay_ShowErrorAndExit ("Code of degree is missing.");
}
/*****************************************************************************/
/************************ Change the name of a degree ************************/
/*****************************************************************************/
@ -2557,8 +2548,7 @@ void Deg_ChangeDegWWW (void)
/***** Get parameters from form *****/
/* Get the code of the degree */
if ((Deg->DegCod = Deg_GetParamOtherDegCod ()) == -1L)
Lay_ShowErrorAndExit ("Code of degree is missing.");
Deg->DegCod = Deg_GetParamOtherDegCod ();
/* Get the new WWW for the degree */
Par_GetParToText ("WWW",NewWWW,Cns_MAX_LENGTH_WWW);
@ -2646,8 +2636,7 @@ void Deg_ChangeDegStatus (void)
/***** Get parameters from form *****/
/* Get degree code */
if ((Deg->DegCod = Deg_GetParamOtherDegCod ()) == -1L)
Lay_ShowErrorAndExit ("Code of degree is missing.");
Deg->DegCod = Deg_GetParamOtherDegCod ();
/* Get parameter with status */
Par_GetParToText ("Status",UnsignedNum,1);

View File

@ -813,8 +813,7 @@ void DT_ChangeDegreeType (void)
/***** Get parameters from form *****/
/* Get degree code */
if ((Deg->DegCod = Deg_GetParamOtherDegCod ()) == -1L)
Lay_ShowErrorAndExit ("Code of degree is missing.");
Deg->DegCod = Deg_GetParamOtherDegCod ();
/* Get the new degree type */
NewDegTypCod = DT_GetParamOtherDegTypCod ();

View File

@ -1274,8 +1274,7 @@ void Pho_CalcPhotoDegree (void)
Fil_RemoveOldTmpFiles (PathPhotosTmpPriv,Cfg_TIME_TO_DELETE_PHOTOS_TMP_FILES,false);
/***** Get the degree which photo will be computed *****/
if ((DegCod = Deg_GetParamOtherDegCod ()) == -1L)
Lay_ShowErrorAndExit ("Code of degree is missing.");
DegCod = Deg_GetParamOtherDegCod ();
/***** Prevent the computing of an average photo too recently updated *****/
if (Pho_GetTimeAvgPhotoWasComputed (DegCod) >=