Version 14.76.3

This commit is contained in:
Antonio Cañas Vargas 2015-03-03 19:21:59 +01:00
parent c7b7f13b4c
commit c93cff6945
6 changed files with 48 additions and 12 deletions

View File

@ -103,11 +103,12 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 14.76.2 (2015/03/02)"
#define Log_PLATFORM_VERSION "SWAD 14.76.3 (2015/03/03)"
// 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 | tail -1
/*
Version 14.76.3: Mar 03, 2015 Fixed bug while sending a message to a guest. (178274 lines)
Version 14.76.2: Mar 02, 2015 Button in student record to view student's attendance. (178242 lines)
Version 14.76.1: Mar 02, 2015 Button in student record to view student's test exams. (178225 lines)
Version 14.76: Mar 02, 2015 Button in student record to view student's works. (178197 lines)

View File

@ -196,7 +196,10 @@ void Gbl_InitializeGlobals (void)
Gbl.LstExamAnnouncements.NumExamAnnounc = 0;
Gbl.LstExamAnnouncements.Lst = NULL;
Gbl.Usrs.Select.All = Gbl.Usrs.Select.Std = Gbl.Usrs.Select.Tch = Gbl.Usrs.ListOtherRecipients = NULL;
Gbl.Usrs.Select.All =
Gbl.Usrs.Select.Std =
Gbl.Usrs.Select.Tch =
Gbl.Usrs.ListOtherRecipients = NULL;
Gbl.Msg.Subject[0] = '\0';
Gbl.Msg.ShowOnlyUnreadMsgs = false;

View File

@ -257,7 +257,8 @@ static void Msg_PutFormMsgUsrs (const char *Content)
extern const char *Txt_Send_message;
char YN[1+1];
Gbl.Usrs.LstTchs.NumUsrs = Gbl.Usrs.LstStds.NumUsrs = 0;
Gbl.Usrs.LstTchs.NumUsrs =
Gbl.Usrs.LstStds.NumUsrs = 0;
/***** Get parameter that indicates if the message is a reply to another message *****/
Par_GetParToText ("IsReply",YN,1);
@ -268,6 +269,9 @@ static void Msg_PutFormMsgUsrs (const char *Content)
/***** Get user's code of possible preselected recipient *****/
Usr_GetParamOtherUsrCodEncrypted ();
/***** Get list of users' IDs or nicknames written explicitely *****/
Usr_GetListMsgRecipientsWrittenExplicitelyBySender (false);
/***** Get list of users belonging to the current course *****/
if (Gbl.Usrs.Me.IBelongToCurrentCrs || // If there is a course selected and I belong to it
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
@ -290,13 +294,8 @@ static void Msg_PutFormMsgUsrs (const char *Content)
Gbl.Usrs.LstStds.NumUsrs)
/***** Get list of selected users *****/
Usr_GetListSelectedUsrs ();
else
Usr_ShowWarningNoUsersFound (Rol_ROLE_UNKNOWN);
}
/***** Get list of users' IDs or nicknames written explicitely *****/
Usr_GetListMsgRecipientsWrittenExplicitelyBySender (false);
if (Usr_GetIfShowBigList (Gbl.Usrs.LstTchs.NumUsrs +
Gbl.Usrs.LstStds.NumUsrs))
{
@ -497,6 +496,29 @@ static void Msg_WriteFormSubjectAndContentMsgToUsrs (const char *Content)
"</tr>");
}
/*****************************************************************************/
/********* Put hidden parameter for another recipient (one nickname) *********/
/*****************************************************************************/
void Msg_PutHiddenParamAnotherRecipient (const struct UsrData *UsrDat)
{
char NicknameWithArroba[Nck_MAX_BYTES_NICKNAME_WITH_ARROBA+1];
sprintf (NicknameWithArroba,"@%s",UsrDat->Nickname);
Par_PutHiddenParamString ("OtherRecipients",NicknameWithArroba);
}
/*****************************************************************************/
/********* Put hidden parameter for another recipient (one nickname) *********/
/*****************************************************************************/
void Msg_PutHiddenParamOtherRecipients (void)
{
if (Gbl.Usrs.ListOtherRecipients)
if (Gbl.Usrs.ListOtherRecipients[0])
Par_PutHiddenParamString ("OtherRecipients",Gbl.Usrs.ListOtherRecipients);
}
/*****************************************************************************/
/********************** Receive a new message from a user ********************/
/*****************************************************************************/

View File

@ -60,6 +60,8 @@ void Msg_ListEMails (void); // Creates an e-mail message to students
void Msg_FormMsgUsrs (void);
void Msg_WriteFormUsrsIDsOrNicksOtherRecipients (bool IsReply);
void Msg_PutHiddenParamAnotherRecipient (const struct UsrData *UsrDat);
void Msg_PutHiddenParamOtherRecipients (void);
void Msg_RecMsgFromUsr (void);
void Msg_ReqDelAllRecMsgs (void);

View File

@ -2030,6 +2030,8 @@ void Rec_ShowCommonRecord (Rec_RecordViewType_t TypeOfView,
bool IAmDegAdmin = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM); // My current role is degree administrator
bool IAmSuperuser = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM); // My current role is superuser
bool HeIsTeacher = (UsrDat->Roles & (1 << Rol_ROLE_TEACHER)); // He/she already is a teacher in any course
bool HeBelongsToCurrentCrs = (UsrDat->RoleInCurrentCrsDB == Rol_ROLE_STUDENT ||
UsrDat->RoleInCurrentCrsDB == Rol_ROLE_TEACHER);
bool RoleForm = (TypeOfView == Rec_FORM_SIGN_UP ||
TypeOfView == Rec_FORM_MY_SHARE_RECORD ||
TypeOfView == Rec_FORM_NEW_RECORD_OTHER_NEW_USR ||
@ -2251,7 +2253,10 @@ void Rec_ShowCommonRecord (Rec_RecordViewType_t TypeOfView,
/***** Button to send a message *****/
Act_FormStart (ActReqMsgUsr);
Grp_PutParamAllGroups ();
Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod);
if (HeBelongsToCurrentCrs)
Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod);
else
Msg_PutHiddenParamAnotherRecipient (UsrDat);
sprintf (Gbl.Title,Txt_Write_a_message_to_X,UsrDat->FullName);
Act_LinkFormSubmit (Gbl.Title,ClassData);
fprintf (Gbl.F.Out,"<div class=\"ICON_HIGHLIGHT\" style=\"display:inline;\" >"
@ -2331,9 +2336,11 @@ void Rec_ShowCommonRecord (Rec_RecordViewType_t TypeOfView,
/* Put form to send a message */
Act_FormStart (ActReqMsgUsr);
Grp_PutParamAllGroups ();
Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod);
// Par_PutHiddenParamString ("UsrCodAll",UsrDat->EncryptedUsrCod);
sprintf (Gbl.Title,Txt_Write_a_message_to_X,UsrDat->FullName);
if (HeBelongsToCurrentCrs)
Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod);
else
Msg_PutHiddenParamAnotherRecipient (UsrDat);
sprintf (Gbl.Title,Txt_Write_a_message_to_X,UsrDat->FullName);
Act_LinkFormSubmit (Gbl.Title,"HEAD_REC_BIG");
}
fprintf (Gbl.F.Out,"@%s",UsrDat->Nickname);

View File

@ -4728,6 +4728,7 @@ void Usr_PutExtraParamsUsrList (Act_Action_t NextAction)
break;
case ActReqMsgUsr:
Usr_PutHiddenParUsrCodAll (NextAction,Gbl.Usrs.Select.All);
Msg_PutHiddenParamOtherRecipients ();
if (Gbl.Msg.IsReply)
{
Par_PutHiddenParamChar ("IsReply",'Y');