Version 15.241

This commit is contained in:
Antonio Cañas Vargas 2016-07-04 14:03:04 +02:00
parent 7130258c0c
commit d5088e4178
17 changed files with 207 additions and 181 deletions

View File

@ -4430,7 +4430,8 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq
/**************************** Private prototypes *****************************/
/*****************************************************************************/
static void Act_FormStartInternal (Act_Action_t NextAction,bool PutParameterLocationIfNoSesion,const char *Id,const char *Anchor);
static void Act_FormStartInternal (Act_Action_t NextAction,bool PutParameterLocationIfNoSesion,
const char *Id,const char *Anchor,const char *OnSubmit);
/*****************************************************************************/
/************* Check if I have permission to execute an action ***************/
@ -4530,14 +4531,21 @@ void Act_FormGoToStart (Act_Action_t NextAction)
{
Gbl.Form.Num++; // Initialized to -1. The first time it is incremented, it will be equal to 0
sprintf (Gbl.Form.Id,"form_%d",Gbl.Form.Num);
Act_FormStartInternal (NextAction,false,Gbl.Form.Id,NULL); // Do not put now parameter location
Act_FormStartInternal (NextAction,false,Gbl.Form.Id,NULL,NULL); // Do not put now parameter location
}
void Act_FormStart (Act_Action_t NextAction)
{
Gbl.Form.Num++; // Initialized to -1. The first time it is incremented, it will be equal to 0
sprintf (Gbl.Form.Id,"form_%d",Gbl.Form.Num);
Act_FormStartInternal (NextAction,true,Gbl.Form.Id,NULL); // Do put now parameter location (if no open session)
Act_FormStartInternal (NextAction,true,Gbl.Form.Id,NULL,NULL); // Do put now parameter location (if no open session)
}
void Act_FormStartOnSubmit (Act_Action_t NextAction,const char *OnSubmit)
{
Gbl.Form.Num++; // Initialized to -1. The first time it is incremented, it will be equal to 0
sprintf (Gbl.Form.Id,"form_%d",Gbl.Form.Num);
Act_FormStartInternal (NextAction,true,Gbl.Form.Id,NULL,OnSubmit); // Do put now parameter location (if no open session)
}
void Act_FormStartUnique (Act_Action_t NextAction)
@ -4545,14 +4553,14 @@ void Act_FormStartUnique (Act_Action_t NextAction)
Gbl.Form.Num++; // Initialized to -1. The first time it is incremented, it will be equal to 0
sprintf (Gbl.Form.UniqueId,"form_%s_%d",
Gbl.UniqueNameEncrypted,Gbl.Form.Num);
Act_FormStartInternal (NextAction,true,Gbl.Form.UniqueId,NULL); // Do put now parameter location (if no open session)
Act_FormStartInternal (NextAction,true,Gbl.Form.UniqueId,NULL,NULL); // Do put now parameter location (if no open session)
}
void Act_FormStartAnchor (Act_Action_t NextAction,const char *Anchor)
{
Gbl.Form.Num++; // Initialized to -1. The first time it is incremented, it will be equal to 0
sprintf (Gbl.Form.Id,"form_%d",Gbl.Form.Num);
Act_FormStartInternal (NextAction,true,Gbl.Form.Id,Anchor); // Do put now parameter location (if no open session)
Act_FormStartInternal (NextAction,true,Gbl.Form.Id,Anchor,NULL); // Do put now parameter location (if no open session)
}
void Act_FormStartUniqueAnchor (Act_Action_t NextAction,const char *Anchor)
@ -4560,17 +4568,18 @@ void Act_FormStartUniqueAnchor (Act_Action_t NextAction,const char *Anchor)
Gbl.Form.Num++; // Initialized to -1. The first time it is incremented, it will be equal to 0
sprintf (Gbl.Form.UniqueId,"form_%s_%d",
Gbl.UniqueNameEncrypted,Gbl.Form.Num);
Act_FormStartInternal (NextAction,true,Gbl.Form.UniqueId,Anchor); // Do put now parameter location (if no open session)
Act_FormStartInternal (NextAction,true,Gbl.Form.UniqueId,Anchor,NULL); // Do put now parameter location (if no open session)
}
void Act_FormStartId (Act_Action_t NextAction,const char *Id)
{
Gbl.Form.Num++; // Initialized to -1. The first time it is incremented, it will be equal to 0
Act_FormStartInternal (NextAction,true,Id,NULL); // Do put now parameter location (if no open session)
Act_FormStartInternal (NextAction,true,Id,NULL,NULL); // Do put now parameter location (if no open session)
}
// Id can not be NULL
static void Act_FormStartInternal (Act_Action_t NextAction,bool PutParameterLocationIfNoSesion,const char *Id,const char *Anchor)
static void Act_FormStartInternal (Act_Action_t NextAction,bool PutParameterLocationIfNoSesion,
const char *Id,const char *Anchor,const char *OnSubmit)
{
extern const char *Txt_STR_LANG_ID[1+Txt_NUM_LANGUAGES];
char ParamsStr[256+256+Ses_LENGTH_SESSION_ID+256];
@ -4585,6 +4594,9 @@ static void Act_FormStartInternal (Act_Action_t NextAction,bool PutParameterLoca
if (Anchor[0])
fprintf (Gbl.F.Out,"#%s",Anchor);
fprintf (Gbl.F.Out,"\" id=\"%s\"",Id);
if (OnSubmit)
if (OnSubmit[0])
fprintf (Gbl.F.Out," onsubmit=\"%s\"",OnSubmit);
switch (Act_Actions[NextAction].BrowserWindow)
{
case Act_NEW_WINDOW:
@ -4662,9 +4674,10 @@ void Act_FormEnd (void)
/*****************************************************************************/
// Requires an extern </a>
void Act_LinkFormSubmit (const char *Title,const char *LinkStyle,const char *Function)
void Act_LinkFormSubmit (const char *Title,const char *LinkStyle,
const char *JSFunction)
{
Act_LinkFormSubmitId (Title,LinkStyle,Gbl.Form.Id,Function);
Act_LinkFormSubmitId (Title,LinkStyle,Gbl.Form.Id,JSFunction);
}
void Act_LinkFormSubmitUnique (const char *Title,const char *LinkStyle)
@ -4675,7 +4688,10 @@ void Act_LinkFormSubmitUnique (const char *Title,const char *LinkStyle)
// Title can be NULL
// LinkStyle can be NULL
// Id can not be NULL
void Act_LinkFormSubmitId (const char *Title,const char *LinkStyle,const char *Id,const char *Function)
// JSFunction can be NULL
void Act_LinkFormSubmitId (const char *Title,const char *LinkStyle,
const char *Id,const char *JSFunction)
{
fprintf (Gbl.F.Out,"<a href=\"\"");
if (Title)
@ -4685,15 +4701,16 @@ void Act_LinkFormSubmitId (const char *Title,const char *LinkStyle,const char *I
if (LinkStyle[0])
fprintf (Gbl.F.Out," class=\"%s\"",LinkStyle);
fprintf (Gbl.F.Out," onclick=\"");
if (Function)
if (Function[0])
fprintf (Gbl.F.Out,"%s;",Function);
if (JSFunction) // JavaScript function to be called before submitting the form
if (JSFunction[0])
fprintf (Gbl.F.Out,"%s;",JSFunction);
fprintf (Gbl.F.Out,"document.getElementById('%s').submit();"
"return false;\">",
Id);
}
void Act_LinkFormSubmitAnimated (const char *Title,const char *LinkStyle,const char *Function)
void Act_LinkFormSubmitAnimated (const char *Title,const char *LinkStyle,
const char *JSFunction)
{
fprintf (Gbl.F.Out,"<a href=\"\"");
if (Title)
@ -4703,9 +4720,9 @@ void Act_LinkFormSubmitAnimated (const char *Title,const char *LinkStyle,const c
if (LinkStyle[0])
fprintf (Gbl.F.Out," class=\"%s\"",LinkStyle);
fprintf (Gbl.F.Out," onclick=\"");
if (Function)
if (Function[0])
fprintf (Gbl.F.Out,"%s;",Function);
if (JSFunction) // JavaScript function to be called before submitting the form
if (JSFunction[0])
fprintf (Gbl.F.Out,"%s;",JSFunction);
fprintf (Gbl.F.Out,"AnimateIcon(%d);"
"document.getElementById('%s').submit();"
"return false;\">",

View File

@ -1498,16 +1498,20 @@ char *Act_GetActionTextFromDB (long ActCod,char *Txt);
void Act_FormGoToStart (Act_Action_t NextAction);
void Act_FormStart (Act_Action_t NextAction);
void Act_FormStartOnSubmit (Act_Action_t NextAction,const char *OnSubmit);
void Act_FormStartUnique (Act_Action_t NextAction);
void Act_FormStartAnchor (Act_Action_t NextAction,const char *Anchor);
void Act_FormStartUniqueAnchor (Act_Action_t NextAction,const char *Anchor);
void Act_FormStartId (Act_Action_t NextAction,const char *Id);
void Act_SetParamsForm (char *ParamsStr,Act_Action_t NextAction,bool PutParameterLocationIfNoSesion);
void Act_FormEnd (void);
void Act_LinkFormSubmit (const char *Title,const char *LinkStyle,const char *Function);
void Act_LinkFormSubmit (const char *Title,const char *LinkStyle,
const char *JSFunction);
void Act_LinkFormSubmitUnique (const char *Title,const char *LinkStyle);
void Act_LinkFormSubmitId (const char *Title,const char *LinkStyle,const char *Id,const char *Function);
void Act_LinkFormSubmitAnimated (const char *Title,const char *LinkStyle,const char *Function);
void Act_LinkFormSubmitId (const char *Title,const char *LinkStyle,
const char *Id,const char *JSFunction);
void Act_LinkFormSubmitAnimated (const char *Title,const char *LinkStyle,
const char *JSFunction);
void Act_SetUniqueId (char UniqueId[Act_MAX_LENGTH_ID]);

View File

@ -2213,7 +2213,7 @@ void Att_RegisterStudentsInAttEvent (void)
Gbl.Usrs.LstUsrs[Rol_STUDENT].Lst[NumStd].Remove = true;
/***** 3. Get list of students marked as present by me: Gbl.Usrs.Select.Std *****/
Usr_GetListsSelectedUsrs ();
Usr_GetListsSelectedUsrsCods ();
/***** Initialize structure with user's data *****/
Usr_UsrDataConstructor (&UsrData);
@ -2242,8 +2242,8 @@ void Att_RegisterStudentsInAttEvent (void)
Usr_UsrDataDestructor (&UsrData);
/***** Free memory *****/
/* Free memory used for list of students */
Usr_FreeListsSelectedUsrCods ();
/* Free memory used by list of selected students' codes */
Usr_FreeListsSelectedUsrsCods ();
// 5. Delete from att_usr all the students marked as Remove=true
// 6. Replace (insert without duplicated) into att_usr all the students marked as Remove=false
@ -2549,10 +2549,10 @@ void Usr_ReqListStdsAttendanceCrs (void)
if (Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs)
{
if (Usr_GetIfShowBigList (Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs))
if (Usr_GetIfShowBigList (Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs,NULL))
{
/***** Get list of selected users *****/
Usr_GetListsSelectedUsrs ();
Usr_GetListsSelectedUsrsCods ();
/***** Draw a class photo with students of the course *****/
/* Start frame */
@ -2579,8 +2579,8 @@ void Usr_ReqListStdsAttendanceCrs (void)
/* End frame */
Lay_EndRoundFrame ();
/***** Free memory used for by the list of users *****/
Usr_FreeListsSelectedUsrCods ();
/***** Free memory used by list of selected users' codes *****/
Usr_FreeListsSelectedUsrsCods ();
}
}
else
@ -2685,7 +2685,7 @@ static void Usr_ListOrPrintStdsAttendanceCrs (Att_TypeOfView_t TypeOfView)
Att_GetListAttEvents (Att_OLDEST_FIRST);
/***** Get list of selected students *****/
Usr_GetListsSelectedUsrs ();
Usr_GetListsSelectedUsrsCods ();
/* Check the number of students to list */
if ((NumStdsInList = Usr_CountNumUsrsInListOfSelectedUsrs ()))
@ -2739,8 +2739,8 @@ static void Usr_ListOrPrintStdsAttendanceCrs (Att_TypeOfView_t TypeOfView)
Usr_ReqListStdsAttendanceCrs (); // ...show again the form
}
/***** Free memory used for by the list of users *****/
Usr_FreeListsSelectedUsrCods ();
/***** Free memory used by list of selected users' codes *****/
Usr_FreeListsSelectedUsrsCods ();
/***** Free list of attendance events *****/
Att_FreeListAttEvents ();

View File

@ -132,19 +132,18 @@
// TODO: In search of users and findUsers banned users should not appear in listing!!!!!
// TODO: Send attached photos via SOAP?
// TODO: When writing a message, below Txt_Show_anyway, Subject and Content should be shown in order to keep the message that had begun to be written. Use as example https://swad.ugr.es/es?crs=2122
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.240.5 (2016-07-04)"
#define Log_PLATFORM_VERSION "SWAD 15.241 (2016-07-04)"
#define CSS_FILE "swad15.229.css"
#define JS_FILE "swad15.238.1.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 15.241: Jul 04, 2015 When composing a new message, subject and content are shown even if list of users is too big, in order to keep messages that had begun to be written. (203618 lines)
Version 15.240.5: Jul 04, 2015 Code refactoring related to big lists of users. (203595 lines)
Version 15.240.4: Jul 04, 2015 Fixed bugs in web service, reported by Rubén Martín Hidalgo. (203592 lines)
Version 15.240.3: Jul 04, 2015 N.A. year is shown at foot in edition of courses. (? lines)

View File

@ -2214,7 +2214,7 @@ void Brw_GetParAndInitFileBrowser (void)
case Brw_ADMI_ASSIG_CRS:
case Brw_ADMI_WORKS_CRS:
/* Get lists of the selected users */
Usr_GetListsSelectedUsrs ();
Usr_GetListsSelectedUsrsCods ();
/* Get user whose folder will be used to make any operation */
Usr_GetParamOtherUsrCodEncryptedAndGetListIDs ();
/* Get whether we must create the zip file or not */
@ -3103,7 +3103,7 @@ void Brw_AskEditWorksCrs (void)
Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs)
{
if (Usr_GetIfShowBigList (Gbl.Usrs.LstUsrs[Rol_TEACHER].NumUsrs +
Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs))
Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs,NULL))
{
/***** Draw class photos to select users *****/
Lay_StartRoundFrame (NULL,Txt_Users,NULL);
@ -3139,8 +3139,8 @@ void Brw_AskEditWorksCrs (void)
Usr_FreeUsrsList (Rol_TEACHER);
Usr_FreeUsrsList (Rol_STUDENT);
/***** Free the memory used by the list of users *****/
Usr_FreeListsSelectedUsrCods ();
/***** Free memory used by list of selected users' codes *****/
Usr_FreeListsSelectedUsrsCods ();
/***** Free memory for list of selected groups *****/
Grp_FreeListCodSelectedGrps ();
@ -3263,8 +3263,8 @@ static void Brw_ShowFileBrowsersAsgWrkCrs (void)
Brw_AskEditWorksCrs ();
}
/***** Free the memory used for the list of users *****/
Usr_FreeListsSelectedUsrCods ();
/***** Free memory used by list of selected users' codes *****/
Usr_FreeListsSelectedUsrsCods ();
}
/*****************************************************************************/

View File

@ -464,7 +464,7 @@ void Gbl_Cleanup (void)
Usr_FreeUsrsList (Rol_TEACHER);
Usr_FreeUsrsList (Rol_DEG_ADM);
Usr_FreeListOtherRecipients ();
Usr_FreeListsSelectedUsrCods ();
Usr_FreeListsSelectedUsrsCods ();
Syl_FreeListItemsSyllabus ();
Tst_FreeTagsList ();
Exa_FreeMemExamAnnouncement ();

View File

@ -288,7 +288,8 @@ static void Grp_ShowFormSeveralGrps (Act_Action_t NextAction)
The_ClassFormBold[Gbl.Prefs.Theme],
NextAction == ActReqMsgUsr ? "CopyMessageToHiddenFields()" :
NULL);
Lay_PutCalculateIconWithText (Txt_Update_students_according_to_selected_groups,Txt_Update_students);
Lay_PutCalculateIconWithText (Txt_Update_students_according_to_selected_groups,
Txt_Update_students);
fprintf (Gbl.F.Out,"</div>");
/***** End form *****/

View File

@ -1008,7 +1008,7 @@ void Lay_PutContextualLink (Act_Action_t NextAction,
void (*FuncParams) (),
const char *Icon,
const char *Title,const char *Text,
const char *Function)
const char *JSFunction)
{
extern const char *The_ClassFormBold[The_NUM_THEMES];
@ -1022,7 +1022,7 @@ void Lay_PutContextualLink (Act_Action_t NextAction,
Lay_PutIconLink (Icon,Title,Text,
Text ? The_ClassFormBold[Gbl.Prefs.Theme] :
NULL,
Function);
JSFunction);
Act_FormEnd ();
if (Text)
@ -1035,9 +1035,9 @@ void Lay_PutContextualLink (Act_Action_t NextAction,
/*****************************************************************************/
void Lay_PutIconLink (const char *Icon,const char *Title,const char *Text,
const char *LinkStyle,const char *Function)
const char *LinkStyle,const char *JSFunction)
{
Act_LinkFormSubmit (Title,LinkStyle,Function);
Act_LinkFormSubmit (Title,LinkStyle,JSFunction);
Lay_PutIconWithText (Icon,Title,Text);
fprintf (Gbl.F.Out,"</a>");
}

View File

@ -75,9 +75,9 @@ void Lay_PutContextualLink (Act_Action_t NextAction,
void (*FuncParams) (),
const char *Icon,
const char *Title,const char *Text,
const char *Function);
const char *JSFunction);
void Lay_PutIconLink (const char *Icon,const char *Title,const char *Text,
const char *LinkStyle,const char *Function);
const char *LinkStyle,const char *JSFunction);
void Lay_PutIconWithText (const char *Icon,const char *Alt,const char *Text);
void Lay_PutCalculateIcon (const char *Alt);
void Lay_PutCalculateIconWithText (const char *Alt,const char *Text);

View File

@ -800,7 +800,7 @@ void Mai_ListEMails (void)
if (Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs)
{
if (Usr_GetIfShowBigList (Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs))
if (Usr_GetIfShowBigList (Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs,NULL))
{
/***** Start of the frame used to list the e-mails *****/
Lay_StartRoundFrameTable (NULL,0,Txt_Students_who_have_accepted_and_who_have_e_mail);

View File

@ -170,6 +170,7 @@ static void Msg_PutFormMsgUsrs (char *Content)
extern const char *Txt_Send_message;
char YN[1+1];
unsigned NumTotalUsrs = 0;
bool ShowUsers = true;
Gbl.Usrs.LstUsrs[Rol_TEACHER].NumUsrs =
Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs = 0;
@ -220,99 +221,101 @@ static void Msg_PutFormMsgUsrs (char *Content)
Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs;
if (NumTotalUsrs)
/***** Get lists of selected users *****/
Usr_GetListsSelectedUsrs ();
{
ShowUsers = Usr_GetIfShowBigList (NumTotalUsrs,"CopyMessageToHiddenFields()");
if (ShowUsers)
/***** Get lists of selected users *****/
Usr_GetListsSelectedUsrsCods ();
}
}
if (Usr_GetIfShowBigList (NumTotalUsrs))
/***** Start frame *****/
Lay_StartRoundFrame (NULL,
Gbl.Msg.Reply.IsReply ? Txt_Reply_message :
Txt_New_message,
NULL);
/***** Form to select type of list used for select several users *****/
if (NumTotalUsrs)
Usr_ShowFormsToSelectUsrListType (ActReqMsgUsr);
/***** Form to show several potential recipients *****/
if (Gbl.Msg.ShowOnlyOneRecipient)
Msg_PutLinkToShowMorePotentialRecipients ();
/***** Start form to select recipients and write the message *****/
Act_FormStart (ActRcvMsgUsr);
if (Gbl.Msg.Reply.IsReply)
{
/***** Start frame *****/
Lay_StartRoundFrame (NULL,
Gbl.Msg.Reply.IsReply ? Txt_Reply_message :
Txt_New_message,
NULL);
/***** Form to select type of list used for select several users *****/
if (NumTotalUsrs)
Usr_ShowFormsToSelectUsrListType (ActReqMsgUsr);
/***** Form to show several potential recipients *****/
if (Gbl.Msg.ShowOnlyOneRecipient)
Msg_PutLinkToShowMorePotentialRecipients ();
/***** Start form to select recipients and write the message *****/
Act_FormStart (ActRcvMsgUsr);
if (Gbl.Msg.Reply.IsReply)
{
Par_PutHiddenParamChar ("IsReply",'Y');
Msg_PutHiddenParamMsgCod (Gbl.Msg.Reply.OriginalMsgCod);
}
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
{
Usr_PutParamOtherUsrCodEncrypted ();
if (Gbl.Msg.ShowOnlyOneRecipient)
Par_PutHiddenParamChar ("ShowOnlyOneRecipient",'Y');
}
/***** Start table *****/
fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_2\">");
/***** "To:" section (recipients) *****/
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"%s RIGHT_TOP\">"
"%s:"
"</td>"
"<td class=\"LEFT_MIDDLE\">"
"<table style=\"width:100%%;\">",
The_ClassForm[Gbl.Prefs.Theme],Txt_MSG_To);
if (Gbl.Msg.ShowOnlyOneRecipient)
{
/***** Show only one user as recipient *****/
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"LEFT_TOP\">");
Msg_ShowOneUniqueRecipient ();
fprintf (Gbl.F.Out,"</td>"
"</tr>");
}
else
{
/***** Show potential recipients *****/
/* Teachers */
Usr_ListUsersToSelect (Rol_TEACHER);
/* Students */
Usr_ListUsersToSelect (Rol_STUDENT);
/* Other users (nicknames) */
Msg_WriteFormUsrsIDsOrNicksOtherRecipients ();
}
/* End of table */
fprintf (Gbl.F.Out,"</table>"
"</td>"
"</tr>");
/***** Subject and content sections *****/
Msg_WriteFormSubjectAndContentMsgToUsrs (Content);
/***** End table *****/
fprintf (Gbl.F.Out,"</table>");
/***** Help for text editor and send button *****/
Lay_HelpPlainEditor ();
/***** Attached image (optional) *****/
Img_PutImageUploader (-1,"MSG_IMG_TIT_URL");
/***** Send button *****/
Lay_PutCreateButton (Txt_Send_message);
/***** End form *****/
Act_FormEnd ();
/***** End frame *****/
Lay_EndRoundFrame ();
Par_PutHiddenParamChar ("IsReply",'Y');
Msg_PutHiddenParamMsgCod (Gbl.Msg.Reply.OriginalMsgCod);
}
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
{
Usr_PutParamOtherUsrCodEncrypted ();
if (Gbl.Msg.ShowOnlyOneRecipient)
Par_PutHiddenParamChar ("ShowOnlyOneRecipient",'Y');
}
/***** Start table *****/
fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_2\">");
/***** "To:" section (recipients) *****/
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"%s RIGHT_TOP\">"
"%s:"
"</td>"
"<td class=\"LEFT_MIDDLE\">"
"<table style=\"width:100%%;\">",
The_ClassForm[Gbl.Prefs.Theme],Txt_MSG_To);
if (Gbl.Msg.ShowOnlyOneRecipient)
{
/***** Show only one user as recipient *****/
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"LEFT_TOP\">");
Msg_ShowOneUniqueRecipient ();
fprintf (Gbl.F.Out,"</td>"
"</tr>");
}
else if (ShowUsers)
{
/***** Show potential recipients *****/
/* Teachers */
Usr_ListUsersToSelect (Rol_TEACHER);
/* Students */
Usr_ListUsersToSelect (Rol_STUDENT);
/* Other users (nicknames) */
Msg_WriteFormUsrsIDsOrNicksOtherRecipients ();
}
/* End of table */
fprintf (Gbl.F.Out,"</table>"
"</td>"
"</tr>");
/***** Subject and content sections *****/
Msg_WriteFormSubjectAndContentMsgToUsrs (Content);
/***** End table *****/
fprintf (Gbl.F.Out,"</table>");
/***** Help for text editor and send button *****/
Lay_HelpPlainEditor ();
/***** Attached image (optional) *****/
Img_PutImageUploader (-1,"MSG_IMG_TIT_URL");
/***** Send button *****/
Lay_PutCreateButton (Txt_Send_message);
/***** End form *****/
Act_FormEnd ();
/***** End frame *****/
Lay_EndRoundFrame ();
/***** Free memory used by the list of nicknames *****/
Usr_FreeListOtherRecipients ();
@ -321,8 +324,8 @@ static void Msg_PutFormMsgUsrs (char *Content)
Usr_FreeUsrsList (Rol_TEACHER);
Usr_FreeUsrsList (Rol_STUDENT);
/***** Free memory used by list of users *****/
Usr_FreeListsSelectedUsrCods ();
/***** Free memory used by list of selected users' codes *****/
Usr_FreeListsSelectedUsrsCods ();
/***** Free memory for list of selected groups *****/
Grp_FreeListCodSelectedGrps ();
@ -656,7 +659,7 @@ void Msg_RecMsgFromUsr (void)
Usr_GetParamOtherUsrCodEncryptedAndGetListIDs ();
/* Get lists of selected users */
Usr_GetListsSelectedUsrs ();
Usr_GetListsSelectedUsrsCods ();
/* Get list of users' IDs or nicknames written explicitely */
Error = Usr_GetListMsgRecipientsWrittenExplicitelyBySender (true);
@ -791,7 +794,7 @@ void Msg_RecMsgFromUsr (void)
/* Free memory used for list of users */
Usr_FreeListOtherRecipients ();
Usr_FreeListsSelectedUsrCods ();
Usr_FreeListsSelectedUsrsCods ();
/***** Update received message setting Replied field to true *****/
if (Replied)

View File

@ -1932,7 +1932,8 @@ static void Pho_PutLinkToCalculateDegreeStats (void)
Act_LinkFormSubmitAnimated (Txt_Calculate_average_photo_of_a_degree,
The_ClassFormBold[Gbl.Prefs.Theme],
NULL);
Lay_PutCalculateIconWithText (Txt_Calculate_average_photo_of_a_degree,Txt_Calculate_average_photo_of_THE_DEGREE_X);
Lay_PutCalculateIconWithText (Txt_Calculate_average_photo_of_a_degree,
Txt_Calculate_average_photo_of_THE_DEGREE_X);
/***** Put selector with all the degrees with students *****/
fprintf (Gbl.F.Out,"<select name=\"OthDegCod\">");

View File

@ -951,7 +951,7 @@ void Rec_ListRecordsGsts (void)
Rec_GetParamRecordsPerPage ();
/***** Get list of selected users *****/
Usr_GetListsSelectedUsrs ();
Usr_GetListsSelectedUsrsCods ();
/* Check the number of students to show */
if (!Usr_CountNumUsrsInListOfSelectedUsrs ()) // If no students selected...
@ -1010,8 +1010,8 @@ void Rec_ListRecordsGsts (void)
if (Gbl.Usrs.Listing.RecsUsrs == Rec_RECORD_USERS_STUDENTS)
Rec_FreeListFields ();
/***** Free memory used for by the list of users *****/
Usr_FreeListsSelectedUsrCods ();
/***** Free memory used by list of selected users' codes *****/
Usr_FreeListsSelectedUsrsCods ();
}
/*****************************************************************************/
@ -1109,7 +1109,7 @@ static void Rec_ListRecordsStds (Rec_RecordViewType_t TypeOfView)
Rec_GetParamRecordsPerPage ();
/***** Get list of selected students *****/
Usr_GetListsSelectedUsrs ();
Usr_GetListsSelectedUsrsCods ();
/* Check the number of students to show */
if (!Usr_CountNumUsrsInListOfSelectedUsrs ()) // If no students selected...
@ -1194,8 +1194,8 @@ static void Rec_ListRecordsStds (Rec_RecordViewType_t TypeOfView)
// if (Gbl.Usrs.Listing.RecsUsrs == Rec_RECORD_USERS_STUDENTS)
Rec_FreeListFields ();
/***** Free memory used for by the list of users *****/
Usr_FreeListsSelectedUsrCods ();
/***** Free memory used by list of selected users' codes *****/
Usr_FreeListsSelectedUsrsCods ();
}
/*****************************************************************************/
@ -1296,7 +1296,7 @@ void Rec_ListRecordsTchs (void)
Rec_GetParamRecordsPerPage ();
/***** Get list of selected teachers *****/
Usr_GetListsSelectedUsrs ();
Usr_GetListsSelectedUsrsCods ();
/* Check the number of teachers to show */
if (!Usr_CountNumUsrsInListOfSelectedUsrs ()) // If no teachers selected...
@ -1373,8 +1373,8 @@ void Rec_ListRecordsTchs (void)
/***** Free memory used for user's data *****/
Usr_UsrDataDestructor (&UsrDat);
/***** Free memory used for by the list of users *****/
Usr_FreeListsSelectedUsrCods ();
/***** Free memory used by list of selected users' codes *****/
Usr_FreeListsSelectedUsrsCods ();
}
/*****************************************************************************/

View File

@ -425,10 +425,10 @@ void Sta_AskShowCrsHits (void)
if (NumTotalUsrs)
{
if (Usr_GetIfShowBigList (NumTotalUsrs))
if (Usr_GetIfShowBigList (NumTotalUsrs,NULL))
{
/***** Get lists of selected users *****/
Usr_GetListsSelectedUsrs ();
Usr_GetListsSelectedUsrsCods ();
/***** Start frame *****/
sprintf (Gbl.Title,Txt_Statistics_of_visits_to_the_course_X,
@ -547,8 +547,8 @@ void Sta_AskShowCrsHits (void)
/***** End frame *****/
Lay_EndRoundFrame ();
/* Free the memory used by the list of users */
Usr_FreeListsSelectedUsrCods ();
/* Free memory used by list of selected users' codes */
Usr_FreeListsSelectedUsrsCods ();
}
}
else // No teachers nor students found
@ -934,7 +934,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
Sta_AskShowCrsHits ();
/****** Get lists of selected users ******/
Usr_GetListsSelectedUsrs ();
Usr_GetListsSelectedUsrsCods ();
/* Check the number of users whose clicks will be shown */
if (!Usr_CountNumUsrsInListOfSelectedUsrs ()) // If there are no users selected...
@ -1433,9 +1433,9 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
/***** Free the memory used by the list of users *****/
/***** Free memory used by list of selected users' codes *****/
if (Gbl.Action.Act == ActSeeAccCrs)
Usr_FreeListsSelectedUsrCods ();
Usr_FreeListsSelectedUsrsCods ();
/***** Free memory used by the data of the user *****/
Usr_UsrDataDestructor (&UsrDat);

View File

@ -6838,7 +6838,7 @@ void Tst_SelUsrsToSeeUsrsExams (void)
if (NumTotalUsrs)
{
if (Usr_GetIfShowBigList (NumTotalUsrs))
if (Usr_GetIfShowBigList (NumTotalUsrs,NULL))
{
/***** Start frame *****/
Lay_StartRoundFrame (NULL,Txt_Exams,NULL);
@ -6889,8 +6889,8 @@ void Tst_SelUsrsToSeeUsrsExams (void)
Usr_FreeUsrsList (Rol_TEACHER);
Usr_FreeUsrsList (Rol_STUDENT);
/***** Free the memory used by the list of users *****/
Usr_FreeListsSelectedUsrCods ();
/***** Free memory used by list of selected users' codes *****/
Usr_FreeListsSelectedUsrsCods ();
/***** Free memory for list of selected groups *****/
Grp_FreeListCodSelectedGrps ();
@ -6969,7 +6969,7 @@ void Tst_ShowUsrsExams (void)
const char *Ptr;
/***** Get list of the selected users's IDs *****/
Usr_GetListsSelectedUsrs ();
Usr_GetListsSelectedUsrsCods ();
/***** Get starting and ending dates *****/
Dat_GetIniEndDatesFromForm ();
@ -7006,8 +7006,8 @@ void Tst_ShowUsrsExams (void)
Tst_SelUsrsToSeeUsrsExams ();
}
/***** Free the memory used for the list of users *****/
Usr_FreeListsSelectedUsrCods ();
/***** Free memory used by list of selected users' codes *****/
Usr_FreeListsSelectedUsrsCods ();
}
/*****************************************************************************/

View File

@ -148,7 +148,7 @@ static void Usr_GetGstsLst (Sco_Scope_t Scope);
static void Usr_GetListUsrsFromQuery (const char *Query,Rol_Role_t Role,Sco_Scope_t Scope);
static void Usr_AllocateUsrsList (Rol_Role_t Role);
static void Usr_PutButtonToConfirmIWantToSeeBigList (unsigned NumUsrs);
static void Usr_PutButtonToConfirmIWantToSeeBigList (unsigned NumUsrs,const char *OnSubmit);
static void Usr_ShowWarningListIsTooBig (unsigned NumUsrs);
static void Usr_AllocateListOtherRecipients (void);
@ -4409,7 +4409,7 @@ void Usr_FreeUsrsList (Rol_Role_t Role)
/******** Show form to confirm that I want to see a big list of users ********/
/*****************************************************************************/
bool Usr_GetIfShowBigList (unsigned NumUsrs)
bool Usr_GetIfShowBigList (unsigned NumUsrs,const char *OnSubmit)
{
bool ShowBigList;
char YN[1+1];
@ -4422,7 +4422,7 @@ bool Usr_GetIfShowBigList (unsigned NumUsrs)
Par_GetParToText ("ShowBigList",YN,1);
ShowBigList = (Str_ConvertToUpperLetter (YN[0]) == 'Y');
if (!ShowBigList)
Usr_PutButtonToConfirmIWantToSeeBigList (NumUsrs);
Usr_PutButtonToConfirmIWantToSeeBigList (NumUsrs,OnSubmit);
return ShowBigList;
}
@ -4434,7 +4434,7 @@ bool Usr_GetIfShowBigList (unsigned NumUsrs)
/******** Show form to confirm that I want to see a big list of users ********/
/*****************************************************************************/
static void Usr_PutButtonToConfirmIWantToSeeBigList (unsigned NumUsrs)
static void Usr_PutButtonToConfirmIWantToSeeBigList (unsigned NumUsrs,const char *OnSubmit)
{
extern const char *Txt_Show_anyway;
@ -4444,7 +4444,7 @@ static void Usr_PutButtonToConfirmIWantToSeeBigList (unsigned NumUsrs)
Usr_ShowWarningListIsTooBig (NumUsrs);
/***** Put form to confirm that I want to see the big list *****/
Act_FormStart (Gbl.Action.Act);
Act_FormStartOnSubmit (Gbl.Action.Act,OnSubmit);
Grp_PutParamsCodGrps ();
Usr_PutParamUsrListType (Gbl.Usrs.Me.ListType);
Usr_PutParamColsClassPhoto ();
@ -4454,6 +4454,7 @@ static void Usr_PutButtonToConfirmIWantToSeeBigList (unsigned NumUsrs)
/***** Send button *****/
Lay_PutConfirmButton (Txt_Show_anyway);
Act_FormEnd ();
fprintf (Gbl.F.Out,"</div>");
@ -4488,7 +4489,7 @@ void Usr_PutHiddenParUsrCodAll (Act_Action_t NextAction,const char *ListUsrCods)
/************************* Get list of selected users ************************/
/*****************************************************************************/
void Usr_GetListsSelectedUsrs (void)
void Usr_GetListsSelectedUsrsCods (void)
{
unsigned Length;
@ -4803,10 +4804,10 @@ void Usr_AllocateListSelectedUsrCodTch (void)
}
/*****************************************************************************/
/********************** Free memory for lists of users ***********************/
/************ Free memory used by list of selected users' codes **************/
/*****************************************************************************/
void Usr_FreeListsSelectedUsrCods (void)
void Usr_FreeListsSelectedUsrsCods (void)
{
if (Gbl.Usrs.Select.All)
{
@ -6439,10 +6440,10 @@ void Usr_SeeGuests (void)
/***** Get and order list of students in current scope *****/
Usr_GetGstsLst (Gbl.Scope.Current);
if (Usr_GetIfShowBigList (Gbl.Usrs.LstUsrs[Rol__GUEST_].NumUsrs))
if (Usr_GetIfShowBigList (Gbl.Usrs.LstUsrs[Rol__GUEST_].NumUsrs,NULL))
{
/***** Get list of selected users *****/
Usr_GetListsSelectedUsrs ();
Usr_GetListsSelectedUsrsCods ();
/***** Start frame *****/
Lay_StartRoundFrame (NULL,Txt_ROLES_PLURAL_Abc[Rol__GUEST_][Usr_SEX_UNKNOWN],
@ -6590,10 +6591,10 @@ void Usr_SeeStudents (void)
/***** Get and order list of students *****/
Usr_GetListUsrs (Rol_STUDENT,Gbl.Scope.Current);
if (Usr_GetIfShowBigList (Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs))
if (Usr_GetIfShowBigList (Gbl.Usrs.LstUsrs[Rol_STUDENT].NumUsrs,NULL))
{
/***** Get list of selected users *****/
Usr_GetListsSelectedUsrs ();
Usr_GetListsSelectedUsrsCods ();
/***** Start frame *****/
Lay_StartRoundFrame (NULL,Txt_ROLES_PLURAL_Abc[Rol_STUDENT][Usr_SEX_UNKNOWN],
@ -6750,7 +6751,7 @@ void Usr_SeeTeachers (void)
/***** Get and order list of teachers *****/
Usr_GetListUsrs (Rol_TEACHER,Gbl.Scope.Current);
if (Usr_GetIfShowBigList (Gbl.Usrs.LstUsrs[Rol_TEACHER].NumUsrs))
if (Usr_GetIfShowBigList (Gbl.Usrs.LstUsrs[Rol_TEACHER].NumUsrs,NULL))
{
/***** Start frame *****/
Lay_StartRoundFrame (NULL,Txt_ROLES_PLURAL_Abc[Rol_TEACHER][Usr_SEX_UNKNOWN],

View File

@ -311,16 +311,16 @@ void Usr_DropTmpTableWithCandidateUsrs (void);
void Usr_GetUnorderedStdsCodesInDeg (long DegCod);
void Usr_FreeUsrsList (Rol_Role_t Role);
bool Usr_GetIfShowBigList (unsigned NumUsrs);
bool Usr_GetIfShowBigList (unsigned NumUsrs,const char *OnSubmit);
void Usr_PutHiddenParUsrCodAll (Act_Action_t NextAction,const char *ListUsrCods);
void Usr_GetListsSelectedUsrs (void);
void Usr_GetListsSelectedUsrsCods (void);
bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs);
bool Usr_FindUsrCodInListOfSelectedUsrs (const char *EncryptedUsrCodToFind);
unsigned Usr_CountNumUsrsInListOfSelectedUsrs (void);
void Usr_AllocateListSelectedUsrCodAll (void);
void Usr_AllocateListSelectedUsrCodStd (void);
void Usr_AllocateListSelectedUsrCodTch (void);
void Usr_FreeListsSelectedUsrCods (void);
void Usr_FreeListsSelectedUsrsCods (void);
void Usr_FreeListOtherRecipients (void);
void Usr_ShowFormsToSelectUsrListType (Act_Action_t NextAction);