From a52373a117d56ec012baed6dd7912132760788ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Fri, 20 Nov 2015 14:44:54 +0100 Subject: [PATCH] Version 15.40.6 --- swad_action.c | 12 ++++++------ swad_centre.c | 6 +++--- swad_changelog.h | 4 +++- swad_course.c | 6 +++--- swad_degree.c | 6 +++--- swad_enrollment.c | 26 +++++++++++++++++++++----- swad_enrollment.h | 3 ++- swad_institution.c | 6 +++--- swad_mark.c | 2 +- swad_password.c | 4 ++-- swad_text.c | 29 ++++++++++------------------- swad_user.c | 9 ++++++++- 12 files changed, 65 insertions(+), 48 deletions(-) diff --git a/swad_action.c b/swad_action.c index cef4d266d..1c2953247 100644 --- a/swad_action.c +++ b/swad_action.c @@ -2390,12 +2390,12 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActUpdStd */{1423,-1,TabUsr,ActLstStd ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_ModifyUsr ,NULL}, /* ActUpdTch */{1424,-1,TabUsr,ActLstTch ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_ModifyUsr ,NULL}, - /* ActReqAccEnrStd */{1456,-1,TabUsr,ActLstStd ,0x008,0x000,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_ReqAcceptRegisterInCrs ,NULL}, - /* ActReqAccEnrTch */{1457,-1,TabUsr,ActLstTch ,0x010,0x000,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_ReqAcceptRegisterInCrs ,NULL}, - /* ActAccEnrStd */{1458,-1,TabUsr,ActLstStd ,0x008,0x000,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_AcceptRegisterMeInCrs ,NULL}, - /* ActAccEnrTch */{1459,-1,TabUsr,ActLstTch ,0x010,0x000,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_AcceptRegisterMeInCrs ,NULL}, - /* ActRemMe_Std */{1460,-1,TabUsr,ActLstStd ,0x008,0x000,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_ReqRemMeFromCrs ,NULL}, - /* ActRemMe_Tch */{1461,-1,TabUsr,ActLstTch ,0x010,0x000,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_ReqRemMeFromCrs ,NULL}, + /* ActReqAccEnrStd */{1456,-1,TabUsr,ActLstStd ,0x1E8,0x000,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_ReqAcceptRegisterInCrs ,NULL}, + /* ActReqAccEnrTch */{1457,-1,TabUsr,ActLstTch ,0x1F0,0x000,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_ReqAcceptRegisterInCrs ,NULL}, + /* ActAccEnrStd */{1458,-1,TabUsr,ActLstStd ,0x1E8,0x000,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_AcceptRegisterMeInCrs ,NULL}, + /* ActAccEnrTch */{1459,-1,TabUsr,ActLstTch ,0x1F0,0x000,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_AcceptRegisterMeInCrs ,NULL}, + /* ActRemMe_Std */{1460,-1,TabUsr,ActLstStd ,0x1E8,0x000,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_ReqRemMeFromCrs ,NULL}, + /* ActRemMe_Tch */{1461,-1,TabUsr,ActLstTch ,0x1F0,0x000,0x000,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_ReqRemMeFromCrs ,NULL}, /* ActNewAdmIns */{1337,-1,TabUsr,ActLstOth ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_AddAdmToIns ,NULL}, /* ActRemAdmIns */{1338,-1,TabUsr,ActLstOth ,0x180,0x180,0x180,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_RemAdmIns ,NULL}, diff --git a/swad_centre.c b/swad_centre.c index f90608e7a..6aad92b1e 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -554,9 +554,9 @@ static void Ctr_ListCentres (void) Lay_ShowAlert (Lay_INFO,Txt_No_centres_have_been_created_in_this_institution); if (ICanEdit) { - fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActEdiCtr,NULL,"edit",Txt_Create_centre); - fprintf (Gbl.F.Out,"
"); + Act_FormStart (ActEdiCtr); + Lay_PutConfirmButton (Txt_Create_centre); + Act_FormEnd (); } } } diff --git a/swad_changelog.h b/swad_changelog.h index 96e424b66..660835392 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -111,11 +111,13 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.40.5 (2015/11/19)" +#define Log_PLATFORM_VERSION "SWAD 15.40.6 (2015/11/19)" // 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.40.6: Nov 20, 2015 New button to register students in courses without them. + New buttons to create institution, centre, degree and course. (187285 lines) Version 15.40.5: Nov 19, 2015 Code refactoring in degrees. (187274 lines) Version 15.40.4: Nov 19, 2015 Code refactoring in centres. (187279 lines) Version 15.40.3: Nov 19, 2015 Code refactoring in institutions. (187281 lines) diff --git a/swad_course.c b/swad_course.c index 146133f90..554368898 100644 --- a/swad_course.c +++ b/swad_course.c @@ -1231,9 +1231,9 @@ static void Crs_ListCourses (void) Lay_ShowAlert (Lay_INFO,Txt_No_courses_have_been_created_in_this_degree); if (ICanEdit) { - fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActEdiCrs,NULL,"edit",Txt_Create_course); - fprintf (Gbl.F.Out,"
"); + Act_FormStart (ActEdiCrs); + Lay_PutConfirmButton (Txt_Create_course); + Act_FormEnd (); } } } diff --git a/swad_degree.c b/swad_degree.c index e37ec13fa..78a256e53 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -2210,9 +2210,9 @@ static void Deg_ListDegrees (void) Lay_ShowAlert (Lay_INFO,Txt_No_degrees_have_been_created_in_this_centre); if (ICanEdit) { - fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActEdiDeg,NULL,"edit",Txt_Create_degree); - fprintf (Gbl.F.Out,"
"); + Act_FormStart (ActEdiDeg); + Lay_PutConfirmButton (Txt_Create_degree); + Act_FormEnd (); } } } diff --git a/swad_enrollment.c b/swad_enrollment.c index ba42d066f..95b8640f8 100644 --- a/swad_enrollment.c +++ b/swad_enrollment.c @@ -100,6 +100,8 @@ static void Enr_RegisterUsr (struct UsrData *UsrDat,Rol_Role_t RegRemRole, struct ListCodGrps *LstGrps,unsigned *NumUsrsRegistered); static void Enr_MarkOfficialStdsAsRemovable (long ImpGrpCod,bool RemoveSpecifiedUsrs); +static void Enr_PutLinkToRemAllStdsThisCrs (void); + static void Enr_RemoveEnrollmentRequest (long CrsCod,long UsrCod); static void Enr_ReqRegRemUsr (Rol_Role_t Role); @@ -128,6 +130,19 @@ static void Enr_AskIfRemAdm (bool ItsMe,Sco_Scope_t Scope,const char *InsCtrDegN static void Enr_EffectivelyRemAdm (struct UsrData *UsrDat,Sco_Scope_t Scope, long Cod,const char *InsCtrDegName); +/*****************************************************************************/ +/**************** Show form with button to enroll students *******************/ +/*****************************************************************************/ + +void Enr_PutButtonToEnrollStudents (void) + { + extern const char *Txt_Register_students; + + Act_FormStart (ActReqEnrSevStd); + Lay_PutConfirmButton (Txt_Register_students); + Act_FormEnd (); + } + /*****************************************************************************/ /************ Show form to request sign up in the current course *************/ /*****************************************************************************/ @@ -559,8 +574,9 @@ static void Enr_ShowFormRegRemSeveralUsrs (Rol_Role_t Role) bool ExternalUsrsServiceAvailable = (Cfg_EXTERNAL_LOGIN_CLIENT_COMMAND[0] != '\0'); /***** Put contextual links *****/ - if (Role == Rol_STUDENT && - Gbl.CurrentCrs.Crs.CrsCod > 0) // Course selected + if (Role == Rol_STUDENT && // Users to admin: students + Gbl.CurrentCrs.Crs.CrsCod > 0 && // Course selected + Gbl.CurrentCrs.Crs.NumStds) // This course has students { fprintf (Gbl.F.Out,"
"); @@ -1746,7 +1762,7 @@ static void Enr_MarkOfficialStdsAsRemovable (long ImpGrpCod,bool RemoveSpecified /**** Put a link (form) to remove all the students in the current course *****/ /*****************************************************************************/ -void Enr_PutLinkToRemAllStdsThisCrs (void) +static void Enr_PutLinkToRemAllStdsThisCrs (void) { extern const char *Txt_Remove_all_students; @@ -1784,7 +1800,7 @@ void Enr_AskRemAllStdsThisCrs (void) { sprintf (Gbl.Message,Txt_No_users_found[Rol_STUDENT], Gbl.CurrentCrs.Crs.FullName); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); + Lay_ShowAlert (Lay_INFO,Gbl.Message); } } @@ -1810,7 +1826,7 @@ void Enr_RemAllStdsThisCrs (void) { sprintf (Gbl.Message,Txt_No_users_found[Rol_STUDENT], Gbl.CurrentCrs.Crs.FullName); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); + Lay_ShowAlert (Lay_INFO,Gbl.Message); } } } diff --git a/swad_enrollment.h b/swad_enrollment.h index a6e58b8d0..eec19fbcd 100644 --- a/swad_enrollment.h +++ b/swad_enrollment.h @@ -67,6 +67,8 @@ typedef enum /****************************** Public prototypes ****************************/ /*****************************************************************************/ +void Enr_PutButtonToEnrollStudents (void); + void Enr_PutLinkToRequestSignUp (void); void Enr_ModifyRoleInCurrentCrs (struct UsrData *UsrDat, @@ -98,7 +100,6 @@ bool Enr_PutActionsRegRemOneUsr (bool ItsMe); void Enr_ReceiveFormAdminStds (void); void Enr_ReceiveFormAdminTchs (void); -void Enr_PutLinkToRemAllStdsThisCrs (void); void Enr_PutLinkToAdminSeveralUsrs (Rol_Role_t Role); void Enr_AskRemAllStdsThisCrs (void); void Enr_RemAllStdsThisCrs (void); diff --git a/swad_institution.c b/swad_institution.c index 052fb7407..9cb66e126 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -505,9 +505,9 @@ static void Ins_ListInstitutions (void) Lay_ShowAlert (Lay_INFO,Txt_No_institutions_have_been_created_in_this_country); if (ICanEdit) { - fprintf (Gbl.F.Out,"
"); - Act_PutContextualLink (ActEdiIns,NULL,"edit",Txt_Create_institution); - fprintf (Gbl.F.Out,"
"); + Act_FormStart (ActEdiIns); + Lay_PutConfirmButton (Txt_Create_institution); + Act_FormEnd (); } } } diff --git a/swad_mark.c b/swad_mark.c index 40355d2d4..04816d04e 100644 --- a/swad_mark.c +++ b/swad_mark.c @@ -640,7 +640,7 @@ void Mrk_ShowMyMarks (void) } else // Course zone { - if (Gbl.CurrentCrs.Crs.NumStds) // If there are student in this course + if (Gbl.CurrentCrs.Crs.NumStds) // If there are students in this course { Gbl.Usrs.Other.UsrDat.UsrCod = Usr_GetRamdomStdFromCrs (Gbl.CurrentCrs.Crs.CrsCod); UsrDat = &Gbl.Usrs.Other.UsrDat; diff --git a/swad_password.c b/swad_password.c index 74bd9caaa..26e9dbd26 100644 --- a/swad_password.c +++ b/swad_password.c @@ -881,7 +881,7 @@ bool Pwd_CheckIfICanChangeOtherUsrPassword (long UsrCod) void Pwd_AskForConfirmationOnDangerousAction (void) { extern const char *The_ClassForm[The_NUM_THEMES]; - extern const char *Txt_I_understand_that_this_action_may_have_serious_consequences_and_can_not_be_undone; + extern const char *Txt_I_understand_that_this_action_can_not_be_undone; extern const char *Txt_For_security_enter_your_password; fprintf (Gbl.F.Out,"
" @@ -892,7 +892,7 @@ void Pwd_AskForConfirmationOnDangerousAction (void) " size=\"16\" maxlength=\"%u\" autocomplete=\"off\" />" "
", The_ClassForm[Gbl.Prefs.Theme], - Txt_I_understand_that_this_action_may_have_serious_consequences_and_can_not_be_undone, + Txt_I_understand_that_this_action_can_not_be_undone, The_ClassForm[Gbl.Prefs.Theme], Txt_For_security_enter_your_password, Pwd_MAX_LENGTH_PLAIN_PASSWORD); diff --git a/swad_text.c b/swad_text.c index ea50c6d5b..dd97d5734 100644 --- a/swad_text.c +++ b/swad_text.c @@ -13439,34 +13439,25 @@ const char *Txt_I_have_read_this_information = "Eu li esta informação"; #endif -const char *Txt_I_understand_that_this_action_may_have_serious_consequences_and_can_not_be_undone = +const char *Txt_I_understand_that_this_action_can_not_be_undone = #if L==0 - "Entenc que aquesta acció pot tenir conseqüències greus" - " i que no es pot desfer."; + "Entenc que aquesta acció no es pot desfer."; #elif L==1 - "Ich verstehe, dass diese Aktion kann schwerwiegende Folgen haben" - " und kann nicht rückgängig gemacht werden."; + "Ich verstehe, dass diese Aktion kann nicht rückgängig gemacht werden."; #elif L==2 - "I understand that this action may have serious consequences" - " and can not be undone."; + "I understand that this action can not be undone."; #elif L==3 - "Entiendo que esta acción puede tener consecuencias graves" - " y que no se puede deshacer."; + "Entiendo que esta acción no se puede deshacer."; #elif L==4 - "Je comprends que cette action peut avoir des conséquences graves" - " et ne peut être annulée."; + "Je comprends que cette action ne peut être annulée."; #elif L==5 - "Entiendo que esta acción puede tener consecuencias graves" - " y que no se puede deshacer."; // Okoteve traducción + "Entiendo que esta acción no se puede deshacer."; // Okoteve traducción #elif L==6 - "Mi rendo conto che questa azione può avere gravi conseguenze" - " e non può essere annullata."; + "Mi rendo conto che questa azione non può essere annullata."; #elif L==7 - "Rozumiem, że działanie to może mieć poważne konsekwencje" - " i nie można cofnąć."; + "Rozumiem, że działanie nie można cofnąć."; #elif L==8 - "Eu entendo que esta ação pode ter consequências graves" - " e não pode ser desfeita."; + "Eu entendo que esta ação não pode ser desfeita."; #endif const char *Txt_Icons = diff --git a/swad_user.c b/swad_user.c index 188514bd7..bd087aa42 100644 --- a/swad_user.c +++ b/swad_user.c @@ -6700,8 +6700,15 @@ void Usr_SeeStudents (void) } } else + { Usr_ShowWarningNoUsersFound (Rol_STUDENT); + /***** Form to enroll several students *****/ + if (Gbl.CurrentCrs.Crs.CrsCod > 0 && // Course selected + Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_TEACHER) // I am a teacher in current course + Enr_PutButtonToEnrollStudents (); + } + /***** Free memory for students list *****/ Usr_FreeUsrsList (&Gbl.Usrs.LstStds); @@ -7265,7 +7272,7 @@ void Usr_ShowWarningNoUsersFound (Rol_Role_t Role) { extern const char *Txt_No_users_found[Rol_NUM_ROLES]; - Lay_ShowAlert (Lay_WARNING,Txt_No_users_found[Role]); + Lay_ShowAlert (Lay_INFO,Txt_No_users_found[Role]); } /*****************************************************************************/