diff --git a/swad_action.c b/swad_action.c index bad24c904..cf2277f25 100644 --- a/swad_action.c +++ b/swad_action.c @@ -294,8 +294,6 @@ Centre: 185. ActRenDegFul Request change of the full name of a degree 186. ActChgDegTyp Request change of the type of a degree 187. ActChgDegCtr Request change of the centre of a degree - 188. ActChgDegFstYea Request change of the first year of a degree - 189. ActChgDegLstYea Request change of the last year of a degree 190. ActChgDegWWW Request change of the web of a degree 191. ActChgDegSta Request change of status of a degree @@ -1578,8 +1576,6 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActRenDegFul */{ 547,-1,TabCtr,ActSeeDeg ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Deg_RenameDegreeFull ,NULL}, /* ActChgDegTyp */{ 544,-1,TabCtr,ActSeeDeg ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Deg_ChangeDegreeType ,NULL}, /* ActChgDegCtr */{1049,-1,TabCtr,ActSeeDeg ,0x1C0,0x1C0,0x1C0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Deg_ChangeDegreeCtr ,NULL}, - /* ActChgDegFstYea */{ 550,-1,TabCtr,ActSeeDeg ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Deg_ChangeDegFirstYear ,NULL}, - /* ActChgDegLstYea */{ 551,-1,TabCtr,ActSeeDeg ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Deg_ChangeDegLastYear ,NULL}, /* ActChgDegWWW */{ 554,-1,TabCtr,ActSeeDeg ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Deg_ChangeDegWWW ,NULL}, /* ActChgDegSta */{1207,-1,TabCtr,ActSeeDeg ,0x1C0,0x1C0,0x1C0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Deg_ChangeDegStatus ,NULL}, @@ -3263,8 +3259,8 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq ActRenDegFul, // #547 -1, // #548 (obsolete action) -1, // #549 (obsolete action) - ActChgDegFstYea, // #550 - ActChgDegLstYea, // #551 + -1, // #550 (obsolete action) + -1, // #551 (obsolete action) -1, // #552 ActRecDegLog, // #553 ActChgDegWWW, // #554 diff --git a/swad_action.h b/swad_action.h index c8d37ff87..7e1edd384 100644 --- a/swad_action.h +++ b/swad_action.h @@ -71,7 +71,7 @@ typedef enum typedef int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action -#define Act_NUM_ACTIONS (1+9+52+15+90+72+67+205+183+143+172+36+27+82) +#define Act_NUM_ACTIONS (1+9+52+15+90+70+67+205+183+143+172+36+27+82) #define Act_MAX_ACTION_COD 1520 @@ -312,59 +312,57 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica #define ActRenDegFul (ActDowShaIns+ 19) #define ActChgDegTyp (ActDowShaIns+ 20) #define ActChgDegCtr (ActDowShaIns+ 21) -#define ActChgDegFstYea (ActDowShaIns+ 22) -#define ActChgDegLstYea (ActDowShaIns+ 23) -#define ActChgDegWWW (ActDowShaIns+ 24) -#define ActChgDegSta (ActDowShaIns+ 25) +#define ActChgDegWWW (ActDowShaIns+ 22) +#define ActChgDegSta (ActDowShaIns+ 23) -#define ActChgToSeeDocCtr (ActDowShaIns+ 26) -#define ActSeeDocCtr (ActDowShaIns+ 27) -#define ActExpSeeDocCtr (ActDowShaIns+ 28) -#define ActConSeeDocCtr (ActDowShaIns+ 29) -#define ActZIPSeeDocCtr (ActDowShaIns+ 30) -#define ActReqDatSeeDocCtr (ActDowShaIns+ 31) -#define ActDowSeeDocCtr (ActDowShaIns+ 32) -#define ActChgToAdmDocCtr (ActDowShaIns+ 33) -#define ActAdmDocCtr (ActDowShaIns+ 34) -#define ActReqRemFilDocCtr (ActDowShaIns+ 35) -#define ActRemFilDocCtr (ActDowShaIns+ 36) -#define ActRemFolDocCtr (ActDowShaIns+ 37) -#define ActCopDocCtr (ActDowShaIns+ 38) -#define ActPasDocCtr (ActDowShaIns+ 39) -#define ActRemTreDocCtr (ActDowShaIns+ 40) -#define ActFrmCreDocCtr (ActDowShaIns+ 41) -#define ActCreFolDocCtr (ActDowShaIns+ 42) -#define ActCreLnkDocCtr (ActDowShaIns+ 43) -#define ActRenFolDocCtr (ActDowShaIns+ 44) -#define ActRcvFilDocCtrDZ (ActDowShaIns+ 45) -#define ActRcvFilDocCtrCla (ActDowShaIns+ 46) -#define ActExpAdmDocCtr (ActDowShaIns+ 47) -#define ActConAdmDocCtr (ActDowShaIns+ 48) -#define ActZIPAdmDocCtr (ActDowShaIns+ 49) -#define ActShoDocCtr (ActDowShaIns+ 50) -#define ActHidDocCtr (ActDowShaIns+ 51) -#define ActReqDatAdmDocCtr (ActDowShaIns+ 52) -#define ActChgDatAdmDocCtr (ActDowShaIns+ 53) -#define ActDowAdmDocCtr (ActDowShaIns+ 54) +#define ActChgToSeeDocCtr (ActDowShaIns+ 24) +#define ActSeeDocCtr (ActDowShaIns+ 25) +#define ActExpSeeDocCtr (ActDowShaIns+ 26) +#define ActConSeeDocCtr (ActDowShaIns+ 27) +#define ActZIPSeeDocCtr (ActDowShaIns+ 28) +#define ActReqDatSeeDocCtr (ActDowShaIns+ 29) +#define ActDowSeeDocCtr (ActDowShaIns+ 30) +#define ActChgToAdmDocCtr (ActDowShaIns+ 31) +#define ActAdmDocCtr (ActDowShaIns+ 32) +#define ActReqRemFilDocCtr (ActDowShaIns+ 33) +#define ActRemFilDocCtr (ActDowShaIns+ 34) +#define ActRemFolDocCtr (ActDowShaIns+ 35) +#define ActCopDocCtr (ActDowShaIns+ 36) +#define ActPasDocCtr (ActDowShaIns+ 37) +#define ActRemTreDocCtr (ActDowShaIns+ 38) +#define ActFrmCreDocCtr (ActDowShaIns+ 39) +#define ActCreFolDocCtr (ActDowShaIns+ 40) +#define ActCreLnkDocCtr (ActDowShaIns+ 41) +#define ActRenFolDocCtr (ActDowShaIns+ 42) +#define ActRcvFilDocCtrDZ (ActDowShaIns+ 43) +#define ActRcvFilDocCtrCla (ActDowShaIns+ 44) +#define ActExpAdmDocCtr (ActDowShaIns+ 45) +#define ActConAdmDocCtr (ActDowShaIns+ 46) +#define ActZIPAdmDocCtr (ActDowShaIns+ 47) +#define ActShoDocCtr (ActDowShaIns+ 48) +#define ActHidDocCtr (ActDowShaIns+ 49) +#define ActReqDatAdmDocCtr (ActDowShaIns+ 50) +#define ActChgDatAdmDocCtr (ActDowShaIns+ 51) +#define ActDowAdmDocCtr (ActDowShaIns+ 52) -#define ActReqRemFilShaCtr (ActDowShaIns+ 55) -#define ActRemFilShaCtr (ActDowShaIns+ 56) -#define ActRemFolShaCtr (ActDowShaIns+ 57) -#define ActCopShaCtr (ActDowShaIns+ 58) -#define ActPasShaCtr (ActDowShaIns+ 59) -#define ActRemTreShaCtr (ActDowShaIns+ 60) -#define ActFrmCreShaCtr (ActDowShaIns+ 61) -#define ActCreFolShaCtr (ActDowShaIns+ 62) -#define ActCreLnkShaCtr (ActDowShaIns+ 63) -#define ActRenFolShaCtr (ActDowShaIns+ 64) -#define ActRcvFilShaCtrDZ (ActDowShaIns+ 65) -#define ActRcvFilShaCtrCla (ActDowShaIns+ 66) -#define ActExpShaCtr (ActDowShaIns+ 67) -#define ActConShaCtr (ActDowShaIns+ 68) -#define ActZIPShaCtr (ActDowShaIns+ 69) -#define ActReqDatShaCtr (ActDowShaIns+ 70) -#define ActChgDatShaCtr (ActDowShaIns+ 71) -#define ActDowShaCtr (ActDowShaIns+ 72) +#define ActReqRemFilShaCtr (ActDowShaIns+ 53) +#define ActRemFilShaCtr (ActDowShaIns+ 54) +#define ActRemFolShaCtr (ActDowShaIns+ 55) +#define ActCopShaCtr (ActDowShaIns+ 56) +#define ActPasShaCtr (ActDowShaIns+ 57) +#define ActRemTreShaCtr (ActDowShaIns+ 58) +#define ActFrmCreShaCtr (ActDowShaIns+ 59) +#define ActCreFolShaCtr (ActDowShaIns+ 60) +#define ActCreLnkShaCtr (ActDowShaIns+ 61) +#define ActRenFolShaCtr (ActDowShaIns+ 62) +#define ActRcvFilShaCtrDZ (ActDowShaIns+ 63) +#define ActRcvFilShaCtrCla (ActDowShaIns+ 64) +#define ActExpShaCtr (ActDowShaIns+ 65) +#define ActConShaCtr (ActDowShaIns+ 66) +#define ActZIPShaCtr (ActDowShaIns+ 67) +#define ActReqDatShaCtr (ActDowShaIns+ 68) +#define ActChgDatShaCtr (ActDowShaIns+ 69) +#define ActDowShaCtr (ActDowShaIns+ 70) /*****************************************************************************/ /********************************* Degree tab ********************************/ diff --git a/swad_changelog.h b/swad_changelog.h index ae4e85d4a..3a01dd51b 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -119,19 +119,25 @@ // TODO: If a follower follows a user whose profile is no longer visible ==> put icon to unfollow in list of followed // TODO: FIX BUG: In results of search of students, no mark of confirmation is shown even if the student really has confirmed his/her registration in the course -// TODO: Remove edition of years in edition of degrees. Every degree will have years from 1 to 12 (and N.A.) +// TODO: Remove fields 'FirstYear' and 'LastYear' from database table 'degrees' +// TODO: Change "Año o semestre" to "Curso o semestre" +// TODO: Change "El curso de la asignatura..." to "El curso/semestre de la asignatura..." /*****************************************************************************/ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.138 (2016-02-29)" +#define Log_PLATFORM_VERSION "SWAD 15.139 (2016-02-29)" #define CSS_FILE "swad15.137.2.css" #define JS_FILE "swad15.131.3.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.139: Feb 29, 2016 Remove edition of years in edition of degrees. Every degree now have years from 1 to 12 (and N.A.) (195734 lines) + 1 change necessary in database: +UPDATE actions SET Obsolete='Y' WHERE ActCod IN ('550','551'); + Version 15.138: Feb 29, 2016 Form to sign up is shown below login form. (196012 lines) Version 15.137.3: Feb 29, 2016 Change in button when file uploading is done. (195986 lines) Version 15.137.2: Feb 13, 2016 Fixed bug in search of my documents. (195985 lines) diff --git a/swad_course.c b/swad_course.c index 8b95548ed..3e7f064d1 100644 --- a/swad_course.c +++ b/swad_course.c @@ -241,14 +241,13 @@ static void Crs_Configuration (bool PrintView) { fprintf (Gbl.F.Out,""); } else @@ -1676,14 +1675,13 @@ static void Crs_PutFormToCreateCourse (void) fprintf (Gbl.F.Out,"" "" ""); @@ -1867,7 +1865,7 @@ static void Crs_RecFormRequestOrCreateCrs (unsigned Status) { extern const char *Txt_The_course_X_already_exists; extern const char *Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_course; - extern const char *Txt_The_year_X_is_not_enabled_on_the_degree_Y; + extern const char *Txt_The_year_X_is_not_allowed; extern const char *Txt_YEAR_OF_DEGREE[1+Deg_MAX_YEARS_PER_DEGREE]; struct Course *Crs; struct Degree Deg; @@ -1883,7 +1881,7 @@ static void Crs_RecFormRequestOrCreateCrs (unsigned Status) /***** Check if year is correct *****/ Deg_GetDataOfDegreeByCod (&Deg); - if (Deg_CheckIfYearIsValidInDeg (Crs->Year,&Deg)) // If year is valid + if (Crs->Year <= Deg_MAX_YEARS_PER_DEGREE) // If year is valid { if (Crs->ShortName[0] && Crs->FullName[0]) // If there's a course name @@ -1912,8 +1910,7 @@ static void Crs_RecFormRequestOrCreateCrs (unsigned Status) } else // Year not valid { - sprintf (Gbl.Message,Txt_The_year_X_is_not_enabled_on_the_degree_Y, - Txt_YEAR_OF_DEGREE[Crs->Year],Deg.FullName); + sprintf (Gbl.Message,Txt_The_year_X_is_not_allowed,Crs->Year); Lay_ShowAlert (Lay_WARNING,Gbl.Message); } @@ -2435,7 +2432,7 @@ void Crs_ChangeCrsDegree (void) extern const char *Txt_In_the_year_X_of_the_degree_Y_already_existed_a_course_with_the_name_Z; extern const char *Txt_YEAR_OF_DEGREE[1+Deg_MAX_YEARS_PER_DEGREE]; extern const char *Txt_The_course_X_has_been_moved_to_the_degree_Y; - extern const char *Txt_The_year_X_is_not_enabled_on_the_degree_Y; + extern const char *Txt_The_year_X_is_not_allowed; extern const char *Txt_You_dont_have_permission_to_move_courses_to_the_degree_X; struct Course *Crs; bool ICanChangeCrsToNewDeg; @@ -2471,7 +2468,7 @@ void Crs_ChangeCrsDegree (void) if (ICanChangeCrsToNewDeg) { /***** If new degree has current course year... *****/ - if (Deg_CheckIfYearIsValidInDeg (Crs->Year,&NewDeg)) + if (Crs->Year <= Deg_MAX_YEARS_PER_DEGREE) { /***** If name of course was in database in the new degree... *****/ if (Crs_CheckIfCourseNameExistsInCourses (NewDeg.DegCod,Crs->Year,"ShortName",Crs->ShortName,-1L)) @@ -2505,8 +2502,7 @@ void Crs_ChangeCrsDegree (void) } else // New degree has no current course year { - sprintf (Gbl.Message,Txt_The_year_X_is_not_enabled_on_the_degree_Y, - Txt_YEAR_OF_DEGREE[Crs->Year],NewDeg.FullName); + sprintf (Gbl.Message,Txt_The_year_X_is_not_allowed,Crs->Year); Lay_ShowAlert (Lay_WARNING,Gbl.Message); } } @@ -2530,7 +2526,7 @@ void Crs_ChangeCrsYear (void) extern const char *Txt_The_course_X_already_exists_in_year_Y; extern const char *Txt_YEAR_OF_DEGREE[1+Deg_MAX_YEARS_PER_DEGREE]; extern const char *Txt_The_year_of_the_course_X_has_changed; - extern const char *Txt_The_year_X_is_not_enabled_on_the_degree_Y; + extern const char *Txt_The_year_X_is_not_allowed; extern const char *Txt_You_dont_have_permission_to_edit_this_course; struct Course *Crs; struct Degree Deg; @@ -2556,7 +2552,7 @@ void Crs_ChangeCrsYear (void) Deg.DegCod = Crs->DegCod; Deg_GetDataOfDegreeByCod (&Deg); - if (Deg_CheckIfYearIsValidInDeg (NewYear,&Deg)) // If year is valid + 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)) @@ -2592,8 +2588,7 @@ void Crs_ChangeCrsYear (void) } else // Year not valid { - sprintf (Gbl.Message,Txt_The_year_X_is_not_enabled_on_the_degree_Y, - Txt_YEAR_OF_DEGREE[NewYear],Deg.FullName); + sprintf (Gbl.Message,Txt_The_year_X_is_not_allowed,NewYear); Lay_ShowAlert (Lay_WARNING,Gbl.Message); } } diff --git a/swad_degree.c b/swad_degree.c index 29d5113f7..5e885a3dd 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -120,7 +120,6 @@ static void Deg_RemoveDegreeCompletely (long DegCod); static void Deg_RenameDegree (struct Degree *Deg,Cns_ShortOrFullName_t ShortOrFullName); static bool Deg_CheckIfDegreeTypeNameExists (const char *DegTypName,long DegTypCod); static bool Deg_CheckIfDegreeNameExists (long CtrCod,const char *FieldName,const char *Name,long DegCod); -static void Deg_ChangeDegYear (struct Degree *Deg,Deg_FirstOrLastYear_t FirstOrLastYear); /*****************************************************************************/ /********** List pending institutions, centres, degrees and courses **********/ @@ -1384,18 +1383,6 @@ static void Deg_ListOneDegreeForSeeing (struct Degree *Deg,unsigned NumDeg) "", TxtClassNormal,BgColor,DegTyp.DegTypName); - /***** Degree first year *****/ - fprintf (Gbl.F.Out,"" - "%u" - "", - TxtClassNormal,BgColor,Deg->FirstYear); - - /***** Degree last year *****/ - fprintf (Gbl.F.Out,"" - "%u" - "", - TxtClassNormal,BgColor,Deg->LastYear); - /***** Current number of courses in this degree *****/ fprintf (Gbl.F.Out,"" "%u" @@ -1428,7 +1415,6 @@ static void Deg_ListDegreesForEdition (void) struct Degree *Deg; unsigned NumCtr; unsigned NumDegTyp; - unsigned Year; char WWW[Deg_MAX_LENGTH_WWW_ON_SCREEN+1]; struct UsrData UsrDat; bool ICanEdit; @@ -1569,54 +1555,6 @@ static void Deg_ListDegreesForEdition (void) fprintf (Gbl.F.Out,"%s",Gbl.Degs.DegTypes.Lst[NumDegTyp].DegTypName); fprintf (Gbl.F.Out,""); - /* Degree first year */ - fprintf (Gbl.F.Out,""); - if (ICanEdit) - { - Act_FormStart (ActChgDegFstYea); - Deg_PutParamOtherDegCod (Deg->DegCod); - fprintf (Gbl.F.Out,""); - Act_FormEnd (); - } - else - fprintf (Gbl.F.Out,"%u",Deg->FirstYear); - fprintf (Gbl.F.Out,""); - - /* Degree last year */ - fprintf (Gbl.F.Out,""); - if (ICanEdit) - { - Act_FormStart (ActChgDegLstYea); - Deg_PutParamOtherDegCod (Deg->DegCod); - fprintf (Gbl.F.Out,""); - Act_FormEnd (); - } - else - fprintf (Gbl.F.Out,"%u",Deg->LastYear); - fprintf (Gbl.F.Out,""); - /* Degree WWW */ fprintf (Gbl.F.Out,""); if (ICanEdit) @@ -1812,7 +1750,6 @@ static void Deg_PutFormToCreateDegree (void) struct Degree *Deg; struct DegreeType *DegTyp; unsigned NumDegTyp; - unsigned Year; /***** Start form *****/ if (Gbl.Usrs.Me.LoggedRole >= Rol_CTR_ADM) @@ -1892,34 +1829,6 @@ static void Deg_PutFormToCreateDegree (void) fprintf (Gbl.F.Out,"" ""); - /***** First year *****/ - fprintf (Gbl.F.Out,"" - "" - ""); - - /***** Last year *****/ - fprintf (Gbl.F.Out,"" - "" - ""); - /***** Degree WWW *****/ fprintf (Gbl.F.Out,"" "" "%s" "" - "" - "%s" - "" - "" - "%s" - "" - // "" - // "%s" - // "" "" "%s" "" @@ -2056,9 +1953,6 @@ static void Deg_PutHeadDegreesForSeeing (void) "", Txt_Degree, Txt_Type, - Txt_First_BR_year, - Txt_Last_BR_year, - // Txt_Opt_BR_year, Txt_Courses_ABBREVIATION, Txt_Status); } @@ -2074,9 +1968,6 @@ static void Deg_PutHeadDegreesForEdition (void) extern const char *Txt_Short_BR_Name; extern const char *Txt_Full_BR_Name; extern const char *Txt_Type; - extern const char *Txt_First_BR_year; - extern const char *Txt_Last_BR_year; - // extern const char *Txt_Opt_BR_year; extern const char *Txt_WWW; extern const char *Txt_Courses_ABBREVIATION; extern const char *Txt_Status; @@ -2100,15 +1991,6 @@ static void Deg_PutHeadDegreesForEdition (void) "" "%s" "" - "" - "%s" - "" - "" - "%s" - "" - // "" - // "%s" - // "" "" "%s" "" @@ -2127,9 +2009,6 @@ static void Deg_PutHeadDegreesForEdition (void) Txt_Short_BR_Name, Txt_Full_BR_Name, Txt_Type, - Txt_First_BR_year, - Txt_Last_BR_year, - // Txt_Opt_BR_year, Txt_WWW, Txt_Courses_ABBREVIATION, Txt_Status, @@ -2187,15 +2066,13 @@ static void Deg_CreateDegree (struct Degree *Deg,unsigned Status) /***** Create a new degree *****/ sprintf (Query,"INSERT INTO degrees (CtrCod,DegTypCod,Status,RequesterUsrCod," - "ShortName,FullName,FirstYear,LastYear,WWW)" + "ShortName,FullName,WWW)" " VALUES ('%ld','%ld','%u','%ld'," - "'%s','%s','%u','%u','%s')", + "'%s','%s','%s')", Deg->CtrCod,Deg->DegTypCod, Status, Gbl.Usrs.Me.UsrDat.UsrCod, - Deg->ShortName,Deg->FullName, - Deg->FirstYear,Deg->LastYear, - Deg->WWW); + Deg->ShortName,Deg->FullName,Deg->WWW); DB_QueryINSERT (Query,"can not create a new degree"); /***** Write success message *****/ @@ -2364,7 +2241,7 @@ void Deg_GetListAllDegs (void) /***** Get degrees admin by me from database *****/ sprintf (Query,"SELECT DegCod,CtrCod,DegTypCod,Status,RequesterUsrCod," - "ShortName,FullName,FirstYear,LastYear,WWW" + "ShortName,FullName,WWW" " FROM degrees ORDER BY FullName"); Gbl.Degs.AllDegs.Num = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get degrees admin by you"); @@ -2419,7 +2296,7 @@ static void Deg_GetListDegsOfCurrentCtr (void) /***** Get degrees of the current centre from database *****/ sprintf (Query,"SELECT DegCod,CtrCod,DegTypCod,Status,RequesterUsrCod," - "ShortName,FullName,FirstYear,LastYear,WWW" + "ShortName,FullName,WWW" " FROM degrees WHERE CtrCod='%ld' ORDER BY FullName", Gbl.CurrentCtr.Ctr.CtrCod); NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get degrees of a centre"); @@ -2493,7 +2370,7 @@ void Deg_GetListDegsAdminByMe (void) /***** Get degrees admin by me from database *****/ if (Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM) sprintf (Query,"SELECT DegCod,CtrCod,DegTypCod,Status,RequesterUsrCod," - "ShortName,FullName,FirstYear,LastYear,WWW" + "ShortName,FullName,WWW" " FROM degrees" " WHERE CtrCod='%ld'" " ORDER BY ShortName", @@ -2501,7 +2378,7 @@ void Deg_GetListDegsAdminByMe (void) // TODO: put an if to select all degrees for admins of all degrees !!!!!!!!!!!!! else // Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM sprintf (Query,"SELECT degrees.DegCod,degrees.CtrCod,degrees.DegTypCod,degrees.Status,degrees.RequesterUsrCod," - "degrees.ShortName,degrees.FullName,degrees.FirstYear,degrees.LastYear,degrees.WWW" + "degrees.ShortName,degrees.FullName,degrees.WWW" " FROM admin,degrees" " WHERE admin.UsrCod='%ld' AND admin.Scope='Deg'" " AND admin.Cod=degrees.DegCod" @@ -2618,8 +2495,6 @@ static void Deg_RecFormRequestOrCreateDeg (unsigned Status) extern const char *Txt_You_must_specify_the_web_address_of_the_new_degree; extern const char *Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_degree; struct Degree *Deg; - char YearStr[2+1]; - // char YN[1+1]; Deg = &Gbl.Degs.EditingDeg; @@ -2637,14 +2512,6 @@ static void Deg_RecFormRequestOrCreateDeg (unsigned Status) if ((Deg->DegTypCod = Deg_GetParamOtherDegTypCod ()) <= 0) Lay_ShowAlert (Lay_ERROR,"Wrong type of degree."); - /* Get first year */ - Par_GetParToText ("FirstYear",YearStr,2); - Deg->FirstYear = Deg_ConvStrToYear (YearStr); - - /* Get last year */ - Par_GetParToText ("LastYear",YearStr,2); - Deg->LastYear = Deg_ConvStrToYear (YearStr); - /* Get degree WWW */ Par_GetParToText ("WWW",Deg->WWW,Cns_MAX_LENGTH_WWW); @@ -2905,8 +2772,6 @@ bool Deg_GetDataOfDegreeByCod (struct Degree *Deg) Deg->RequesterUsrCod = -1L; Deg->ShortName[0] = '\0'; Deg->FullName[0] = '\0'; - Deg->FirstYear = 0; - Deg->LastYear = 0; Deg->WWW[0] = '\0'; Deg->NumCrss = 0; Deg->LstCrss = NULL; @@ -2915,7 +2780,7 @@ bool Deg_GetDataOfDegreeByCod (struct Degree *Deg) /***** Get data of a degree from database *****/ sprintf (Query,"SELECT DegCod,CtrCod,DegTypCod,Status,RequesterUsrCod," - "ShortName,FullName,FirstYear,LastYear,WWW" + "ShortName,FullName,WWW" " FROM degrees WHERE DegCod ='%ld'", Deg->DegCod); NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get data of a degree"); @@ -2937,8 +2802,6 @@ bool Deg_GetDataOfDegreeByCod (struct Degree *Deg) Deg->RequesterUsrCod = -1L; Deg->ShortName[0] = '\0'; Deg->FullName[0] = '\0'; - Deg->FirstYear = 0; - Deg->LastYear = 0; Deg->WWW[0] = '\0'; Deg->NumCrss = 0; Deg->LstCrss = NULL; @@ -2982,14 +2845,8 @@ static void Deg_GetDataOfDegreeFromRow (struct Degree *Deg,MYSQL_ROW row) /***** Get degree full name (row[6]) *****/ strcpy (Deg->FullName,row[6]); - /***** Get first year (row[7]) *****/ - Deg->FirstYear = Deg_ConvStrToYear (row[7]); - - /***** Get last year (row[8]) *****/ - Deg->LastYear = Deg_ConvStrToYear (row[8]); - - /***** Get WWW (row[9]) *****/ - strcpy (Deg->WWW,row[9]); + /***** Get WWW (row[7]) *****/ + strcpy (Deg->WWW,row[7]); /***** Get number of courses *****/ Deg->NumCrss = Crs_GetNumCrssInDeg (Deg->DegCod); @@ -3550,72 +3407,6 @@ void Deg_ChangeDegreeCtr (void) Deg_EditDegrees (); } -/*****************************************************************************/ -/********************** Change the first year of a degree ********************/ -/*****************************************************************************/ - -void Deg_ChangeDegFirstYear (void) - { - Deg_ChangeDegYear (&Gbl.Degs.EditingDeg,Deg_FIRST_YEAR); - } - -/*****************************************************************************/ -/*********************** Change the last year of a degree ********************/ -/*****************************************************************************/ - -void Deg_ChangeDegLastYear (void) - { - Deg_ChangeDegYear (&Gbl.Degs.EditingDeg,Deg_LAST_YEAR); - } - -/*****************************************************************************/ -/******************* Change the first/last year of a degree ******************/ -/*****************************************************************************/ - -static void Deg_ChangeDegYear (struct Degree *Deg,Deg_FirstOrLastYear_t FirstOrLastYear) - { - extern const char *Txt_The_years_of_the_degree_have_changed; - char Query[512]; - char YearStr[2+1]; - const char *ParamName = NULL; // Initialized to avoid warning - const char *FieldName = NULL; // Initialized to avoid warning - unsigned *PtrYear = NULL; // Initialized to avoid warning - - switch (FirstOrLastYear) - { - case Deg_FIRST_YEAR: - ParamName = "FirstYear"; - FieldName = "FirstYear"; - PtrYear = &(Deg->FirstYear); - break; - case Deg_LAST_YEAR: - ParamName = "LastYear"; - FieldName = "LastYear"; - PtrYear = &(Deg->LastYear); - break; - } - - /***** Get parameters from form *****/ - /* Get degree code */ - if ((Deg->DegCod = Deg_GetParamOtherDegCod ()) == -1L) - Lay_ShowErrorAndExit ("Code of degree is missing."); - - /* Get parameter with first/last year */ - Par_GetParToText (ParamName,YearStr,2); - *PtrYear = Deg_ConvStrToYear (YearStr); - - /***** Update first/last year in table of degrees *****/ - sprintf (Query,"UPDATE degrees SET %s='%u' WHERE DegCod='%ld'", - FieldName,*PtrYear,Deg->DegCod); - DB_QueryUPDATE (Query,"can not update the number of years of a degree"); - - /***** Write message to show the change made *****/ - Lay_ShowAlert (Lay_SUCCESS,Txt_The_years_of_the_degree_have_changed); - - /***** Show the form again *****/ - Deg_EditDegrees (); - } - /*****************************************************************************/ /************************* Change the WWW of a degree ************************/ /*****************************************************************************/ @@ -3834,16 +3625,6 @@ unsigned Deg_GetNumDegsWithUsrs (Rol_Role_t Role,const char *SubQuery) return (unsigned) DB_QueryCOUNT (Query,"can not get number of degrees with users"); } -/*****************************************************************************/ -/******************* Check if a year is valid in a degree ********************/ -/*****************************************************************************/ - -bool Deg_CheckIfYearIsValidInDeg (unsigned Year,struct Degree *Deg) - { - return (Year == 0) || - (Year != 0 && Year >= Deg->FirstYear && Year <= Deg->LastYear); - } - /*****************************************************************************/ /***** Write institutions, centres and degrees administrated by an admin *****/ /*****************************************************************************/ diff --git a/swad_degree.h b/swad_degree.h index e0968c4d9..716081ee9 100644 --- a/swad_degree.h +++ b/swad_degree.h @@ -76,8 +76,6 @@ struct Degree long RequesterUsrCod; // User code of the person who requested the creation of this degree char ShortName[Deg_MAX_LENGTH_DEGREE_SHORT_NAME+1]; // Short name of degree char FullName[Deg_MAX_LENGTH_DEGREE_FULL_NAME+1]; // Full name of degree - unsigned FirstYear; - unsigned LastYear; char WWW[Cns_MAX_LENGTH_WWW+1]; unsigned NumCrss; // Number of courses in the degree struct Course *LstCrss; // List of courses in this degree @@ -144,8 +142,6 @@ void Deg_RenameDegreeFull (void); void Deg_ChangeDegTypeLogIn (void); void Deg_ChangeDegreeType (void); void Deg_ChangeDegreeCtr (void); -void Deg_ChangeDegFirstYear (void); -void Deg_ChangeDegLastYear (void); void Deg_ChangeDegWWW (void); void Deg_ChangeDegStatus (void); void Deg_RequestLogo (void); @@ -159,8 +155,6 @@ unsigned Deg_GetNumDegsInCtr (long CtrCod); unsigned Deg_GetNumDegsWithCrss (const char *SubQuery); unsigned Deg_GetNumDegsWithUsrs (Rol_Role_t Role,const char *SubQuery); -bool Deg_CheckIfYearIsValidInDeg (unsigned Year,struct Degree *Deg); - void Deg_GetAndWriteInsCtrDegAdminBy (long UsrCod,unsigned ColSpan); unsigned Deg_ListDegsFound (const char *Query); diff --git a/swad_global.c b/swad_global.c index 9846963fd..f8c395d59 100644 --- a/swad_global.c +++ b/swad_global.c @@ -305,8 +305,6 @@ void Gbl_InitializeGlobals (void) Gbl.Degs.EditingDeg.DegCod = -1L; Gbl.Degs.EditingDeg.ShortName[0] = '\0'; Gbl.Degs.EditingDeg.FullName[0] = '\0'; - Gbl.Degs.EditingDeg.FirstYear = - Gbl.Degs.EditingDeg.LastYear = 0; Gbl.Degs.EditingDeg.WWW[0] = '\0'; Gbl.Degs.EditingDeg.NumCrss = 0; Gbl.Degs.EditingDeg.LstCrss = NULL; diff --git a/swad_preference.c b/swad_preference.c index 67dc3f15d..f58e66174 100644 --- a/swad_preference.c +++ b/swad_preference.c @@ -236,8 +236,6 @@ void Pre_RemoveOldPrefsFromIP (void) void Pre_PutLinkToChangeLanguage (void) { - extern const char *Txt_Log_in; - Lay_PutContextualLink (ActEdiPrf,NULL, "cty64x64.gif", "Change language","Change language"); diff --git a/swad_text.c b/swad_text.c index 5a64f28c8..268270d6e 100644 --- a/swad_text.c +++ b/swad_text.c @@ -11887,27 +11887,6 @@ const char *Txt_First_name = "Nome"; #endif -const char *Txt_First_BR_year = // "First academic year", the opposite to "Last academic year" -#if L==1 - "Primer
año/sem."; // Necessita traduccio -#elif L==2 - "First
year/sem."; // Need Übersetzung -#elif L==3 - "First
year/sem."; -#elif L==4 - "Primer
año/sem."; -#elif L==5 - "First
year/sem."; // Besoin de traduction -#elif L==6 - "Primer
año/sem."; // Okoteve traducción -#elif L==7 - "Primo
anno/sem."; -#elif L==8 - "Pierwszy
rok/sem."; -#elif L==9 - "First
year/sem."; // Necessita de tradução -#endif - const char *Txt_Folder = #if L==1 "Carpeta"; @@ -15560,27 +15539,6 @@ const char *Txt_Last_clicks_in_real_time = "Últimos cliques em tempo real"; #endif -const char *Txt_Last_BR_year = // "Last academic year", the opposite to "First academic year" -#if L==1 - "Último
año/sem."; // Necessita traduccio -#elif L==2 - "Last
year/sem."; // Need Übersetzung -#elif L==3 - "Last
year/sem."; -#elif L==4 - "Último
año/sem."; -#elif L==5 - "Last
year/sem."; // Besoin de traduction -#elif L==6 - "Último
año/sem."; // Okoteve traducción -#elif L==7 - "Last
anno/sem."; -#elif L==8 - "Ostatni
rok/sem."; -#elif L==9 - "Last
year/sem."; // Necessita de tradução -#endif - const char *Txt_LAYOUT_SIDE_COLUMNS[4] = { #if L==1 @@ -44603,34 +44561,25 @@ const char *Txt_The_works_of_X_have_been_removed_in_a_total_of_Y_of_his_her_Z_co " have been removed in a total of %u of her/his %u courses."; // Necessita de tradução #endif -const char *Txt_The_year_X_is_not_enabled_on_the_degree_Y = // Warning: it is very important to include two %s in the following sentences +const char *Txt_The_year_X_is_not_allowed = // Warning: it is very important to include %u in the following sentences #if L==1 - "El curso %s no está habilitado" - " en la titulación %s."; // Necessita traduccio + "El curso %u no está permitido."; // Necessita traduccio #elif L==2 - "The year %s is not enabled" - " on the degree %s."; // Need Übersetzung + "The year %u is not enabled."; // Need Übersetzung #elif L==3 - "The year %s is not enabled" - " on the degree %s."; + "The year %u is not enabled."; #elif L==4 - "El curso %s no está habilitado" - " en la titulación %s."; + "El curso %u no está permitido."; #elif L==5 - "The year %s is not enabled" - " on the degree %s."; // Besoin de traduction + "The year %u is not enabled."; // Besoin de traduction #elif L==6 - "El curso %s no está habilitado" - " en la titulación %s."; // Okoteve traducción + "El curso %u no está permitido."; // Okoteve traducción #elif L==7 - "L'anno %s non è abilitato" - " nella laurea %s."; + "L'anno %u non è consentito."; #elif L==8 - "The year %s is not enabled" - " on the degree %s."; // Potrzebujesz tlumaczenie + "The year %u is not allowed."; // Potrzebujesz tlumaczenie #elif L==9 - "The year %s is not enabled" - " on the degree %s."; // Necessita de tradução + "The year %u is not allowed."; // Necessita de tradução #endif const char *Txt_The_year_of_the_course_X_has_changed = // Warning: it is very important to include %s in the following sentences @@ -44654,27 +44603,6 @@ const char *Txt_The_year_of_the_course_X_has_changed = // Warning: it is very im "The year of the couse %s has changed."; // Necessita de tradução #endif -const char *Txt_The_years_of_the_degree_have_changed = -#if L==1 - "Los años de la titulación han cambiado."; // Necessita traduccio -#elif L==2 - "The years of the degree have changed."; // Need Übersetzung -#elif L==3 - "The years of the degree have changed."; -#elif L==4 - "Los años de la titulación han cambiado."; -#elif L==5 - "The years of the degree have changed."; // Besoin de traduction -#elif L==6 - "Los años de la titulación han cambiado."; // Okoteve traducción -#elif L==7 - "Gli anni della laurea sono cambiati."; -#elif L==8 - "The years of the degree have changed."; // Potrzebujesz tlumaczenie -#elif L==9 - "The years of the degree have changed."; // Necessita de tradução -#endif - const char *Txt_The_ZIP_file_has_been_received_successfully = #if L==1 "El archivo ZIP se ha recibido correctamente."; // Necessita traduccio