diff --git a/swad_ID.c b/swad_ID.c index 8d2dc4fb8..b2f3e52d2 100644 --- a/swad_ID.c +++ b/swad_ID.c @@ -819,15 +819,18 @@ void ID_ConfirmUsrID (long UsrCod,const char *UsrID) } /*****************************************************************************/ -/*************** Check if I can see the user's ID of a teacher ***************/ +/***************** Check if I can see another user's ID **********************/ /*****************************************************************************/ -bool ID_ICanSeeTeacherID (struct UsrData *UsrDat) +bool ID_ICanSeeUsrID (struct UsrData *UsrDat) { - /* Check if I have permission to see the user's ID of a teacher - Only teachers who have accepted registration in courses are counted */ + /* Check if I have permission to see another user's ID */ switch (Gbl.Usrs.Me.LoggedRole) { + case Rol_TEACHER: + /* If I am a teacher of current course, + I only can see the user's ID of students from current course */ + return (UsrDat->RoleInCurrentCrsDB == Rol_STUDENT); case Rol_DEG_ADM: /* If I am an administrator of current degree, I only can see the user's ID of users from current degree */ diff --git a/swad_ID.h b/swad_ID.h index 6d233c72c..7c932f3f8 100644 --- a/swad_ID.h +++ b/swad_ID.h @@ -75,6 +75,6 @@ void ID_NewMyUsrID (void); void ID_NewOtherUsrID (void); void ID_ConfirmUsrID (long UsrCod,const char *UsrID); -bool ID_ICanSeeTeacherID (struct UsrData *UsrDat); +bool ID_ICanSeeUsrID (struct UsrData *UsrDat); #endif diff --git a/swad_changelog.h b/swad_changelog.h index 0611f55e1..7058e4575 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -118,13 +118,13 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.72.3 (2015-12-23)" -#define CSS_FILE "swad15.65.1.css" +#define Log_PLATFORM_VERSION "SWAD 15.72.4 (2015-12-23)" +#define CSS_FILE "swad15.72.4.css" // 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.72.4: Dec 23, 2015 Show recipient when writing message to only one recipient. (? lines) + Version 15.72.4: Dec 23, 2015 Show recipient when writing message to only one recipient. (187775 lines) Version 15.72.3: Dec 23, 2015 Message translated. (187733 lines) Version 15.72.2: Dec 23, 2015 Write message only to one recipient. Not finished. Some small icons changed. (187750 lines) diff --git a/swad_file_browser.c b/swad_file_browser.c index 4f2893668..95fcd5330 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -3201,7 +3201,7 @@ static void Brw_ShowDataOwnerAsgWrk (struct UsrData *UsrDat) /***** Show user's ID *****/ ID_WriteUsrIDs (UsrDat, - UsrDat->RoleInCurrentCrsDB == Rol_TEACHER ? ID_ICanSeeTeacherID (UsrDat) : + UsrDat->RoleInCurrentCrsDB == Rol_TEACHER ? ID_ICanSeeUsrID (UsrDat) : (Gbl.Usrs.Me.LoggedRole >= Rol_TEACHER)); /***** Show user's name *****/ diff --git a/swad_message.c b/swad_message.c index ccbdc93b6..e94e8fbb3 100644 --- a/swad_message.c +++ b/swad_message.c @@ -38,6 +38,7 @@ #include "swad_forum.h" #include "swad_global.h" #include "swad_group.h" +#include "swad_ID.h" #include "swad_message.h" #include "swad_notification.h" #include "swad_parameter.h" @@ -80,7 +81,9 @@ static void Msg_ShowASentOrReceivedMessage (Msg_TypeOfMessages_t TypeOfMessages, static void Msg_GetStatusOfSentMsg (long MsgCod,bool *Expanded); static void Msg_GetStatusOfReceivedMsg (long MsgCod,bool *Open,bool *Replied,bool *Expanded); static long Msg_GetParamMsgCod (void); +static void Msg_PutLinkToShowMorePotentialRecipients (void); static void Msg_PutParamsShowMorePotentialRecipients (void); +static void Msg_ShowOneUniqueRecipient (void); static void Msg_WriteFormUsrsIDsOrNicksOtherRecipients (void); static void Msg_WriteFormSubjectAndContentMsgToUsrs (const char *Content); static void Msg_ShowNumMsgsDeleted (unsigned NumMsgs); @@ -263,7 +266,6 @@ static void Msg_PutFormMsgUsrs (const char *Content) extern const char *The_ClassForm[The_NUM_THEMES]; extern const char *Txt_Reply_message; extern const char *Txt_New_message; - extern const char *Txt_Show_more_recipients; extern const char *Txt_MSG_To; extern const char *Txt_Send_message; char YN[1+1]; @@ -278,8 +280,7 @@ static void Msg_PutFormMsgUsrs (const char *Content) Gbl.Msg.Reply.OriginalMsgCod = Msg_GetParamMsgCod (); /***** Get user's code of possible preselected recipient *****/ - Usr_GetParamOtherUsrCodEncrypted (); - if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) // There is a preselected recipient + if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ()) // There is a preselected recipient { /* Get who to show as potential recipients: - only the selected recipient @@ -328,13 +329,7 @@ static void Msg_PutFormMsgUsrs (const char *Content) /***** Form to show several potential recipients *****/ if (Gbl.Msg.ShowOnlyOneRecipient) - { - fprintf (Gbl.F.Out,"
" "%s:" @@ -359,13 +354,10 @@ static void Msg_PutFormMsgUsrs (const char *Content) The_ClassForm[Gbl.Prefs.Theme],Txt_MSG_To); if (Gbl.Msg.ShowOnlyOneRecipient) { - fprintf (Gbl.F.Out," |
"); - /***** Show only one user as recipient *****/ - sprintf (Gbl.Message,"Gbl.Usrs.Other.UsrDat.UsrCod = %ld",Gbl.Usrs.Other.UsrDat.UsrCod); - Lay_ShowAlert (Lay_INFO,Gbl.Message); - + fprintf (Gbl.F.Out," |
"); + Msg_ShowOneUniqueRecipient (); fprintf (Gbl.F.Out," | " "