Version 15.241.4

This commit is contained in:
Antonio Cañas Vargas 2016-07-04 17:52:09 +02:00
parent 3b2d73711c
commit 6f1b939c47
2 changed files with 29 additions and 37 deletions

View File

@ -136,13 +136,14 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.241.3 (2016-07-04)" #define Log_PLATFORM_VERSION "SWAD 15.241.4 (2016-07-04)"
#define CSS_FILE "swad15.229.css" #define CSS_FILE "swad15.229.css"
#define JS_FILE "swad15.238.1.js" #define JS_FILE "swad15.238.1.js"
// Number of lines (includes comments but not blank lines) has been got with the following command: // 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 // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/* /*
Version 15.241.4: Jul 04, 2015 Changes in form to compose message. (203624 lines)
Version 15.241.3: Jul 04, 2015 Changes in layout of form to compose message. Version 15.241.3: Jul 04, 2015 Changes in layout of form to compose message.
Code optimization in list of selected users. (203628 lines) Code optimization in list of selected users. (203628 lines)
Version 15.241.2: Jul 04, 2015 Changes in layout of form to compose message. (203619 lines) Version 15.241.2: Jul 04, 2015 Changes in layout of form to compose message. (203619 lines)

View File

@ -169,8 +169,8 @@ static void Msg_PutFormMsgUsrs (char *Content)
extern const char *Txt_MSG_To; extern const char *Txt_MSG_To;
extern const char *Txt_Send_message; extern const char *Txt_Send_message;
char YN[1+1]; char YN[1+1];
unsigned NumTotalUsrs = 0; unsigned NumUsrsInCrs;
bool ShowUsers = true; bool ShowUsrsInCrs = false;
bool GetListUsrs = !Gbl.Msg.ShowOnlyOneRecipient && // Show list of potential recipients bool GetListUsrs = !Gbl.Msg.ShowOnlyOneRecipient && // Show list of potential recipients
(Gbl.Usrs.Me.IBelongToCurrentCrs || // If there is a course selected and I belong to it (Gbl.Usrs.Me.IBelongToCurrentCrs || // If there is a course selected and I belong to it
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM); Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM);
@ -222,24 +222,24 @@ static void Msg_PutFormMsgUsrs (char *Content)
/***** Get and order lists of users from this course *****/ /***** Get and order lists of users from this course *****/
Usr_GetListUsrs (Rol_TEACHER,Sco_SCOPE_CRS); Usr_GetListUsrs (Rol_TEACHER,Sco_SCOPE_CRS);
Usr_GetListUsrs (Rol_STUDENT,Sco_SCOPE_CRS); Usr_GetListUsrs (Rol_STUDENT,Sco_SCOPE_CRS);
NumTotalUsrs = Gbl.Usrs.LstUsrs[Rol_TEACHER].NumUsrs + NumUsrsInCrs = Gbl.Usrs.LstUsrs[Rol_TEACHER].NumUsrs +
Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs; Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs;
if (NumTotalUsrs) if (NumUsrsInCrs)
{ {
/***** Form to select type of list used for select several users *****/ /***** Form to select type of list used for select several users *****/
Usr_ShowFormsToSelectUsrListType (ActReqMsgUsr); Usr_ShowFormsToSelectUsrListType (ActReqMsgUsr);
/***** Check if it's a big list *****/ /***** Check if it's a big list *****/
ShowUsers = Usr_GetIfShowBigList (NumTotalUsrs,"CopyMessageToHiddenFields()"); ShowUsrsInCrs = Usr_GetIfShowBigList (NumUsrsInCrs,"CopyMessageToHiddenFields()");
if (ShowUsers) if (ShowUsrsInCrs)
/***** Get lists of selected users *****/ /***** Get lists of selected users *****/
Usr_GetListsSelectedUsrsCods (); Usr_GetListsSelectedUsrsCods ();
} }
/***** Get list of users' IDs or nicknames written explicitely *****/ /***** Get list of users' IDs or nicknames written explicitely *****/
Usr_GetListMsgRecipientsWrittenExplicitelyBySender (false); Usr_GetListMsgRecipientsWrittenExplicitelyBySender (false);
} }
} }
/***** Start form to select recipients and write the message *****/ /***** Start form to select recipients and write the message *****/
@ -260,40 +260,31 @@ static void Msg_PutFormMsgUsrs (char *Content)
fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_2\">"); fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_2\">");
/***** "To:" section (recipients) *****/ /***** "To:" section (recipients) *****/
if (Gbl.Msg.ShowOnlyOneRecipient || ShowUsers) fprintf (Gbl.F.Out,"<tr>"
"<td class=\"%s RIGHT_TOP\">"
"%s:"
"</td>"
"<td class=\"LEFT_TOP\">",
The_ClassForm[Gbl.Prefs.Theme],Txt_MSG_To);
if (Gbl.Msg.ShowOnlyOneRecipient)
/***** Show only one user as recipient *****/
Msg_ShowOneUniqueRecipient ();
else
{ {
fprintf (Gbl.F.Out,"<tr>" /***** Show potential recipients *****/
"<td class=\"%s RIGHT_TOP\">" fprintf (Gbl.F.Out,"<table style=\"width:100%%;\">");
"%s:" if (ShowUsrsInCrs)
"</td>"
"<td class=\"LEFT_TOP\">",
The_ClassForm[Gbl.Prefs.Theme],Txt_MSG_To);
if (Gbl.Msg.ShowOnlyOneRecipient)
/***** Show only one user as recipient *****/
Msg_ShowOneUniqueRecipient ();
else
{ {
/***** Show potential recipients *****/ Usr_ListUsersToSelect (Rol_TEACHER); // All teachers in course
/* Start table */ Usr_ListUsersToSelect (Rol_STUDENT); // All students in selected groups
fprintf (Gbl.F.Out,"<table style=\"width:100%%;\">");
/* Teachers */
Usr_ListUsersToSelect (Rol_TEACHER);
/* Students */
Usr_ListUsersToSelect (Rol_STUDENT);
/* Other users (nicknames) */
Msg_WriteFormUsrsIDsOrNicksOtherRecipients ();
/* End table */
fprintf (Gbl.F.Out,"</table>");
} }
Msg_WriteFormUsrsIDsOrNicksOtherRecipients (); // Other users (nicknames)
fprintf (Gbl.F.Out,"</td>" fprintf (Gbl.F.Out,"</table>");
"</tr>");
} }
fprintf (Gbl.F.Out,"</td>"
"</tr>");
/***** Subject and content sections *****/ /***** Subject and content sections *****/
Msg_WriteFormSubjectAndContentMsgToUsrs (Content); Msg_WriteFormSubjectAndContentMsgToUsrs (Content);