diff --git a/swad_ID.c b/swad_ID.c
index 569108d11..68e3f4b0d 100644
--- a/swad_ID.c
+++ b/swad_ID.c
@@ -406,6 +406,7 @@ bool ID_ICanSeeOtherUsrIDs (const struct UsrData *UsrDat)
/***** Check if I have permission to see another user's IDs *****/
switch (Gbl.Usrs.Me.LoggedRole)
{
+ case Rol_NET:
case Rol_TCH:
/* Check 1: I can see the IDs of users who do not exist in database */
if (UsrDat->UsrCod <= 0) // User does not exist (when creating a new user)
@@ -413,7 +414,7 @@ bool ID_ICanSeeOtherUsrIDs (const struct UsrData *UsrDat)
/* Check 2: I can see the IDs of confirmed students */
if (UsrDat->RoleInCurrentCrsDB == Rol_STD && // A student
- UsrDat->Accepted) // who accepted registration
+ UsrDat->Accepted) // who accepted registration
return true;
/* Check 3: I can see the IDs of users with user's data empty */
@@ -448,12 +449,23 @@ static void ID_PutLinkToConfirmID (struct UsrData *UsrDat,unsigned NumID,
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
extern const char *The_ClassFormBold[The_NUM_THEMES];
extern const char *Txt_Confirm_ID;
+ Act_Action_t NextAction;
/***** Start form *****/
- Act_FormStartAnchor ( UsrDat->RoleInCurrentCrsDB == Rol_STD ? ActCnfID_Std :
- (UsrDat->RoleInCurrentCrsDB == Rol_TCH ? ActCnfID_Tch :
- ActCnfID_Oth),
- Anchor);
+ switch (UsrDat->RoleInCurrentCrsDB)
+ {
+ case Rol_STD:
+ NextAction = ActCnfID_Std;
+ break;
+ case Rol_NET:
+ case Rol_TCH:
+ NextAction = ActCnfID_Tch;
+ break;
+ default: // Guest, visitor or admin
+ NextAction = ActCnfID_Oth;
+ break;
+ }
+ Act_FormStartAnchor (NextAction,Anchor);
if (Gbl.Action.Original != ActUnk)
{
Par_PutHiddenParamLong ("OriginalActCod",
@@ -490,6 +502,7 @@ static void ID_PutLinkToConfirmID (struct UsrData *UsrDat,unsigned NumID,
void ID_PutLinkToChangeUsrIDs (void)
{
extern const char *Txt_Change_IDs;
+ Act_Action_t NextAction;
/***** Link for changing the password *****/
if (Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod) // It's me
@@ -498,13 +511,26 @@ void ID_PutLinkToChangeUsrIDs (void)
Txt_Change_IDs,Txt_Change_IDs,
NULL);
else // Not me
- Lay_PutContextualLink ( Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_STD ? ActFrmIDsStd :
- (Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_TCH ? ActFrmIDsTch :
- ActFrmIDsOth), // Guest, visitor or admin
- NULL,Usr_PutParamOtherUsrCodEncrypted,
+ {
+ switch (Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB)
+ {
+ case Rol_STD:
+ NextAction = ActFrmIDsStd;
+ break;
+ case Rol_NET:
+ case Rol_TCH:
+ NextAction = ActFrmIDsTch;
+ break;
+ default: // Guest, visitor or admin
+ NextAction = ActFrmIDsOth;
+ break;
+ }
+ Lay_PutContextualLink (NextAction,NULL,
+ Usr_PutParamOtherUsrCodEncrypted,
"arroba64x64.gif",
Txt_Change_IDs,Txt_Change_IDs,
NULL);
+ }
}
/*****************************************************************************/
@@ -559,6 +585,7 @@ void ID_ShowFormChangeUsrID (const struct UsrData *UsrDat,bool ItsMe)
extern const char *Txt_If_there_are_multiple_versions_of_the_ID_;
extern const char *Txt_The_ID_is_used_in_order_to_facilitate_;
unsigned NumID;
+ Act_Action_t NextAction;
/***** List existing user's IDs *****/
for (NumID = 0;
@@ -587,9 +614,20 @@ void ID_ShowFormChangeUsrID (const struct UsrData *UsrDat,bool ItsMe)
Act_FormStart (ActRemID_Me);
else
{
- Act_FormStart ( UsrDat->RoleInCurrentCrsDB == Rol_STD ? ActRemID_Std :
- (UsrDat->RoleInCurrentCrsDB == Rol_TCH ? ActRemID_Tch :
- ActRemID_Oth)); // Guest, visitor or admin
+ switch (UsrDat->RoleInCurrentCrsDB)
+ {
+ case Rol_STD:
+ NextAction = ActRemID_Std;
+ break;
+ case Rol_NET:
+ case Rol_TCH:
+ NextAction = ActRemID_Tch;
+ break;
+ default: // Guest, visitor or admin
+ NextAction = ActRemID_Oth;
+ break;
+ }
+ Act_FormStart (NextAction);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
}
fprintf (Gbl.F.Out,"",
@@ -641,9 +679,20 @@ void ID_ShowFormChangeUsrID (const struct UsrData *UsrDat,bool ItsMe)
Act_FormStart (ActNewIDMe);
else
{
- Act_FormStart ( UsrDat->RoleInCurrentCrsDB == Rol_STD ? ActNewID_Std :
- (UsrDat->RoleInCurrentCrsDB == Rol_TCH ? ActNewID_Tch :
- ActNewID_Oth)); // Guest, visitor or admin
+ switch (UsrDat->RoleInCurrentCrsDB)
+ {
+ case Rol_STD:
+ NextAction = ActNewID_Std;
+ break;
+ case Rol_NET:
+ case Rol_TCH:
+ NextAction = ActNewID_Tch;
+ break;
+ default: // Guest, visitor or admin
+ NextAction = ActNewID_Oth;
+ break;
+ }
+ Act_FormStart (NextAction);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
}
fprintf (Gbl.F.Out,"
"
diff --git a/swad_changelog.h b/swad_changelog.h
index 1fb31dba9..a713b50a0 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -233,13 +233,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 16.220.9 (2017-05-22)"
+#define Log_PLATFORM_VERSION "SWAD 16.220.10 (2017-05-22)"
#define CSS_FILE "swad16.209.3.css"
#define JS_FILE "swad16.206.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 16.220.10:May 22, 2017 Changes related with new role. Not finished. (219775 lines)
Version 16.220.9: May 22, 2017 Changes related with new role. Not finished. (219720 lines)
Version 16.220.8: May 22, 2017 Changes related with new role. Not finished. (219663 lines)
4 changes necessary in database:
diff --git a/swad_file_browser.c b/swad_file_browser.c
index d3047f9ab..42a691ffd 100644
--- a/swad_file_browser.c
+++ b/swad_file_browser.c
@@ -4709,7 +4709,8 @@ static void Brw_PutCheckboxFullTree (void)
Lay_PutContextualCheckbox (Brw_ActSeeAdm[Gbl.FileBrowser.Type],
Brw_PutParamsFullTree,
- "FullTree",Gbl.FileBrowser.FullTree,
+ "FullTree",
+ Gbl.FileBrowser.FullTree,false,
Txt_Show_all_files,Txt_Show_all_files);
}
diff --git a/swad_group.c b/swad_group.c
index 3ab2f0f96..f3d4ab586 100644
--- a/swad_group.c
+++ b/swad_group.c
@@ -1635,14 +1635,14 @@ void Grp_ListGrpsToEditAsgAttOrSvy (struct GroupType *GrpTyp,long Cod,Grp_AsgOrS
void Grp_ReqRegisterInGrps (void)
{
/***** Show list of groups to register/remove me *****/
- Grp_ShowLstGrpsToChgMyGrps ((Gbl.Usrs.Me.LoggedRole == Rol_STD));
+ Grp_ShowLstGrpsToChgMyGrps ();
}
/*****************************************************************************/
/***************** Show list of groups to register/remove me *****************/
/*****************************************************************************/
-void Grp_ShowLstGrpsToChgMyGrps (bool ShowWarningsToStudents)
+void Grp_ShowLstGrpsToChgMyGrps (void)
{
extern const char *Hlp_USERS_Groups;
extern const char *Txt_My_groups;
@@ -1664,7 +1664,7 @@ void Grp_ShowLstGrpsToChgMyGrps (bool ShowWarningsToStudents)
/***** Show warnings to students *****/
// Students are required to join groups with mandatory enrolment; teachers don't
- if (ShowWarningsToStudents)
+ if (Gbl.Usrs.Me.LoggedRole == Rol_STD)
Grp_ShowWarningToStdsToChangeGrps ();
}
diff --git a/swad_group.h b/swad_group.h
index 53eb2e5f1..e2910ffbb 100644
--- a/swad_group.h
+++ b/swad_group.h
@@ -153,7 +153,7 @@ void Grp_RemUsrFromAllGrps (struct UsrData *UsrDat,Cns_QuietOrVerbose_t QuietOrV
void Grp_ListGrpsToEditAsgAttOrSvy (struct GroupType *GrpTyp,long Cod,Grp_AsgOrSvy_t Grp_AsgOrSvy);
void Grp_ReqRegisterInGrps (void);
-void Grp_ShowLstGrpsToChgMyGrps (bool ShowWarningsToStudents);
+void Grp_ShowLstGrpsToChgMyGrps (void);
void Grp_ShowLstGrpsToChgOtherUsrsGrps (long UsrCod);
void Grp_GetListGrpTypesInThisCrs (Grp_WhichGroupTypes_t WhichGroupTypes);
diff --git a/swad_indicator.c b/swad_indicator.c
index 7410ba5ae..2036844b2 100644
--- a/swad_indicator.c
+++ b/swad_indicator.c
@@ -1116,8 +1116,9 @@ static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t Indicat
break;
case Ind_INDICATORS_FULL:
/* Get number of users */
- NumStds = Usr_GetNumUsrsInCrs (Rol_STD,CrsCod);
- NumTchs = Usr_GetNumUsrsInCrs (Rol_TCH,CrsCod);
+ NumStds = Usr_GetNumUsrsInCrs (Rol_STD,CrsCod); // Students
+ NumTchs = Usr_GetNumUsrsInCrs (Rol_NET,CrsCod) + // Non-editing teachers
+ Usr_GetNumUsrsInCrs (Rol_TCH,CrsCod); // Teachers
fprintf (Gbl.F.Out,"
"
"
"
diff --git a/swad_info.c b/swad_info.c
index 2f9b587e2..13173a539 100644
--- a/swad_info.c
+++ b/swad_info.c
@@ -299,7 +299,7 @@ extern const char *Hlp_ASSESSMENT_System_edit;
static void Inf_PutButtonToEditInfo (void);
static void Inf_PutIconToViewInfo (void);
-static void Inf_PutCheckboxForceStdsToReadInfo (bool MustBeRead);
+static void Inf_PutCheckboxForceStdsToReadInfo (bool MustBeRead,bool Disabled);
static void Inf_PutCheckboxConfirmIHaveReadInfo (void);
static bool Inf_CheckIfIHaveReadInfo (void);
static bool Inf_GetMustBeReadFromForm (void);
@@ -340,6 +340,7 @@ void Inf_ShowInfo (void)
extern const char *Txt_No_information;
Inf_InfoSrc_t InfoSrc;
bool MustBeRead;
+ bool Disabled;
bool ICanEdit = (Gbl.Usrs.Me.LoggedRole == Rol_TCH ||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM);
bool ShowWarningNoInfo = false;
@@ -384,13 +385,15 @@ void Inf_ShowInfo (void)
fprintf (Gbl.F.Out,"");
}
break;
+ case Rol_NET:
case Rol_TCH:
case Rol_SYS_ADM:
/* Put checkbox to force students to read this couse info */
if (InfoSrc != Inf_INFO_SRC_NONE)
{
fprintf (Gbl.F.Out,"
");
- Inf_PutCheckboxForceStdsToReadInfo (MustBeRead);
+ Disabled = (Gbl.Usrs.Me.LoggedRole == Rol_NET); // Non-editing teachers can not change the status of checkbox
+ Inf_PutCheckboxForceStdsToReadInfo (MustBeRead,Disabled);
fprintf (Gbl.F.Out,"
",
- The_ClassForm[Gbl.Prefs.Theme],
- Txt_ROLES_PLURAL_Abc[Rol_TCH][Usr_SEX_UNKNOWN],
- Usr_GetNumUsrsInCrssOfIns (Rol_TCH,Gbl.CurrentIns.Ins.InsCod));
-
- /***** Number of students in courses of this institution *****/
- fprintf (Gbl.F.Out,"
"
- "
"
- "%s:"
- "
"
- "
"
- "%u"
- "
"
- "
",
- The_ClassForm[Gbl.Prefs.Theme],
- Txt_ROLES_PLURAL_Abc[Rol_STD][Usr_SEX_UNKNOWN],
- Usr_GetNumUsrsInCrssOfIns (Rol_STD,Gbl.CurrentIns.Ins.InsCod));
-
/***** Number of users in courses of this institution *****/
- fprintf (Gbl.F.Out,"