Version 22.70: Mar 07, 2023 Code refactoring in parameters. Not finished.

This commit is contained in:
acanas 2023-03-07 23:49:32 +01:00
parent 87fcfd1ab8
commit 4c998fc1b0
12 changed files with 62 additions and 110 deletions

View File

@ -411,8 +411,7 @@ static void ID_PutLinkToConfirmID (struct Usr_Data *UsrDat,unsigned NumID,
Frm_BeginFormAnchor (NextAction[UsrDat->Roles.InCurrentCrs],Anchor); Frm_BeginFormAnchor (NextAction[UsrDat->Roles.InCurrentCrs],Anchor);
if (Gbl.Action.Original != ActUnk) if (Gbl.Action.Original != ActUnk)
{ {
Par_PutParLong (NULL,"OriginalActCod", Par_PutParCode (Par_OrgActCod,Act_GetActCod (Gbl.Action.Original)); // Original action, used to know where we came from
Act_GetActCod (Gbl.Action.Original)); // Original action, used to know where we came from
switch (Gbl.Action.Original) switch (Gbl.Action.Original)
{ {
case ActSeeRecSevGst: case ActSeeRecSevGst:
@ -884,7 +883,6 @@ void ID_ConfirmOtherUsrID (void)
{ {
extern const char *Txt_ID_X_had_already_been_confirmed; extern const char *Txt_ID_X_had_already_been_confirmed;
extern const char *Txt_The_ID_X_has_been_confirmed; extern const char *Txt_The_ID_X_has_been_confirmed;
long OriginalActCod;
char UsrID[ID_MAX_BYTES_USR_ID + 1]; char UsrID[ID_MAX_BYTES_USR_ID + 1];
bool ICanConfirm; bool ICanConfirm;
bool Found; bool Found;
@ -892,8 +890,7 @@ void ID_ConfirmOtherUsrID (void)
unsigned NumIDFound = 0; // Initialized to avoid warning unsigned NumIDFound = 0; // Initialized to avoid warning
/***** Get where we came from *****/ /***** Get where we came from *****/
OriginalActCod = Par_GetParLong ("OriginalActCod"); Gbl.Action.Original = Act_GetActionFromActCod (Par_GetParCode (Par_OrgActCod));
Gbl.Action.Original = Act_GetActionFromActCod (OriginalActCod);
/***** Get other user's code from form and get user's data *****/ /***** Get other user's code from form and get user's data *****/
ICanConfirm = false; ICanConfirm = false;

View File

@ -629,10 +629,11 @@ TODO: Emilce Barrera Mesa: Podr
TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la hora de poner la foto porque la plataforma es muy exigente respecto al fondo de la imagen. TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la hora de poner la foto porque la plataforma es muy exigente respecto al fondo de la imagen.
*/ */
#define Log_PLATFORM_VERSION "SWAD 22.69 (2023-03-07)" #define Log_PLATFORM_VERSION "SWAD 22.70 (2023-03-07)"
#define CSS_FILE "swad22.57.1.css" #define CSS_FILE "swad22.57.1.css"
#define JS_FILE "swad22.49.js" #define JS_FILE "swad22.49.js"
/* /*
Version 22.70: Mar 07, 2023 Code refactoring in parameters. Not finished. (336824 lines)
Version 22.69: Mar 07, 2023 Code refactoring in parameters. Not finished. (336866 lines) Version 22.69: Mar 07, 2023 Code refactoring in parameters. Not finished. (336866 lines)
Version 22.68: Mar 06, 2023 Code refactoring in parameters. Not finished. (336887 lines) Version 22.68: Mar 06, 2023 Code refactoring in parameters. Not finished. (336887 lines)
Version 22.67.1: Mar 06, 2023 Code refactoring in dates. (337124 lines) Version 22.67.1: Mar 06, 2023 Code refactoring in dates. (337124 lines)

View File

@ -433,7 +433,7 @@ static void Lnk_ListLinksForEdition (const struct Lnk_Links *Links)
/* Link short name */ /* Link short name */
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
Frm_BeginForm (ActRenLnkSho); Frm_BeginForm (ActRenLnkSho);
Lnk_PutParamLnkCod (&Lnk->LnkCod); Par_PutParCode (Par_LnkCod,Lnk->LnkCod);
HTM_INPUT_TEXT ("ShortName",Lnk_MAX_CHARS_LINK_SHRT_NAME,Lnk->ShrtName, HTM_INPUT_TEXT ("ShortName",Lnk_MAX_CHARS_LINK_SHRT_NAME,Lnk->ShrtName,
HTM_SUBMIT_ON_CHANGE, HTM_SUBMIT_ON_CHANGE,
"class=\"INPUT_SHORT_NAME INPUT_%s\"" "class=\"INPUT_SHORT_NAME INPUT_%s\""
@ -445,7 +445,7 @@ static void Lnk_ListLinksForEdition (const struct Lnk_Links *Links)
/* Link full name */ /* Link full name */
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
Frm_BeginForm (ActRenLnkFul); Frm_BeginForm (ActRenLnkFul);
Lnk_PutParamLnkCod (&Lnk->LnkCod); Par_PutParCode (Par_LnkCod,Lnk->LnkCod);
HTM_INPUT_TEXT ("FullName",Lnk_MAX_CHARS_LINK_FULL_NAME,Lnk->FullName, HTM_INPUT_TEXT ("FullName",Lnk_MAX_CHARS_LINK_FULL_NAME,Lnk->FullName,
HTM_SUBMIT_ON_CHANGE, HTM_SUBMIT_ON_CHANGE,
"class=\"INPUT_FULL_NAME INPUT_%s\"" "class=\"INPUT_FULL_NAME INPUT_%s\""
@ -457,7 +457,7 @@ static void Lnk_ListLinksForEdition (const struct Lnk_Links *Links)
/* Link WWW */ /* Link WWW */
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
Frm_BeginForm (ActChgLnkWWW); Frm_BeginForm (ActChgLnkWWW);
Lnk_PutParamLnkCod (&Lnk->LnkCod); Par_PutParCode (Par_LnkCod,Lnk->LnkCod);
HTM_INPUT_URL ("WWW",Lnk->WWW,HTM_SUBMIT_ON_CHANGE, HTM_INPUT_URL ("WWW",Lnk->WWW,HTM_SUBMIT_ON_CHANGE,
"class=\"INPUT_WWW_NARROW INPUT_%s\"" "class=\"INPUT_WWW_NARROW INPUT_%s\""
" required=\"required\"", " required=\"required\"",
@ -479,17 +479,7 @@ static void Lnk_ListLinksForEdition (const struct Lnk_Links *Links)
static void Lnk_PutParamLnkCod (void *LnkCod) static void Lnk_PutParamLnkCod (void *LnkCod)
{ {
if (LnkCod) if (LnkCod)
Par_PutParLong (NULL,"LnkCod",*((long *) LnkCod)); Par_PutParCode (Par_LnkCod,*((long *) LnkCod));
}
/*****************************************************************************/
/********************* Get parameter with code of link ***********************/
/*****************************************************************************/
long Lnk_GetParamLnkCod (void)
{
/***** Get code of link *****/
return Par_GetParLong ("LnkCod");
} }
/*****************************************************************************/ /*****************************************************************************/
@ -504,8 +494,7 @@ void Lnk_RemoveLink (void)
Lnk_EditingLinkConstructor (); Lnk_EditingLinkConstructor ();
/***** Get link code *****/ /***** Get link code *****/
if ((Lnk_EditingLnk->LnkCod = Lnk_GetParamLnkCod ()) <= 0) Lnk_EditingLnk->LnkCod = Par_GetAndCheckParCode (Par_LnkCod);
Err_WrongLinkExit ();
/***** Get data of the link from database *****/ /***** Get data of the link from database *****/
Lnk_GetDataOfLinkByCod (Lnk_EditingLnk); Lnk_GetDataOfLinkByCod (Lnk_EditingLnk);
@ -578,8 +567,7 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Get the code of the link */ /* Get the code of the link */
if ((Lnk_EditingLnk->LnkCod = Lnk_GetParamLnkCod ()) <= 0) Lnk_EditingLnk->LnkCod = Par_GetAndCheckParCode (Par_LnkCod);
Err_WrongLinkExit ();
/* Get the new name for the link */ /* Get the new name for the link */
Par_GetParText (ParamName,NewLnkName,MaxBytes); Par_GetParText (ParamName,NewLnkName,MaxBytes);
@ -635,8 +623,7 @@ void Lnk_ChangeLinkWWW (void)
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Get the code of the link */ /* Get the code of the link */
if ((Lnk_EditingLnk->LnkCod = Lnk_GetParamLnkCod ()) <= 0) Lnk_EditingLnk->LnkCod = Par_GetAndCheckParCode (Par_LnkCod);
Err_WrongLinkExit ();
/* Get the new WWW for the link */ /* Get the new WWW for the link */
Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW); Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);

View File

@ -53,7 +53,6 @@ void Lnk_EditLinks (void);
void Lnk_PutIconToViewLinks (void); void Lnk_PutIconToViewLinks (void);
void Lnk_GetDataOfLinkByCod (struct Lnk_Link *Lnk); void Lnk_GetDataOfLinkByCod (struct Lnk_Link *Lnk);
long Lnk_GetParamLnkCod (void);
void Lnk_RemoveLink (void); void Lnk_RemoveLink (void);
void Lnk_RenameLinkShort (void); void Lnk_RenameLinkShort (void);
void Lnk_RenameLinkFull (void); void Lnk_RenameLinkFull (void);

View File

@ -471,7 +471,7 @@ static void Mai_ListMailDomainsForEdition (const struct Mai_Mails *Mails)
/* Mail domain */ /* Mail domain */
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
Frm_BeginForm (ActRenMaiSho); Frm_BeginForm (ActRenMaiSho);
Mai_PutParamMaiCod (&Mai->MaiCod); Par_PutParCode (Par_MaiCod,Mai->MaiCod);
HTM_INPUT_TEXT ("Domain",Cns_MAX_CHARS_EMAIL_ADDRESS,Mai->Domain, HTM_INPUT_TEXT ("Domain",Cns_MAX_CHARS_EMAIL_ADDRESS,Mai->Domain,
HTM_SUBMIT_ON_CHANGE, HTM_SUBMIT_ON_CHANGE,
"size=\"15\" class=\"INPUT_%s\"", "size=\"15\" class=\"INPUT_%s\"",
@ -482,7 +482,7 @@ static void Mai_ListMailDomainsForEdition (const struct Mai_Mails *Mails)
/* Mail domain info */ /* Mail domain info */
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
Frm_BeginForm (ActRenMaiFul); Frm_BeginForm (ActRenMaiFul);
Mai_PutParamMaiCod (&Mai->MaiCod); Par_PutParCode (Par_MaiCod,Mai->MaiCod);
HTM_INPUT_TEXT ("Info",Mai_MAX_CHARS_MAIL_INFO,Mai->Info, HTM_INPUT_TEXT ("Info",Mai_MAX_CHARS_MAIL_INFO,Mai->Info,
HTM_SUBMIT_ON_CHANGE, HTM_SUBMIT_ON_CHANGE,
"size=\"40\" class=\"INPUT_%s\"", "size=\"40\" class=\"INPUT_%s\"",
@ -509,17 +509,7 @@ static void Mai_ListMailDomainsForEdition (const struct Mai_Mails *Mails)
static void Mai_PutParamMaiCod (void *MaiCod) static void Mai_PutParamMaiCod (void *MaiCod)
{ {
if (MaiCod) if (MaiCod)
Par_PutParLong (NULL,"MaiCod",*((long *) MaiCod)); Par_PutParCode (Par_MaiCod,*((long *) MaiCod));
}
/*****************************************************************************/
/*********************** Get parameter with code of mail *********************/
/*****************************************************************************/
long Mai_GetParamMaiCod (void)
{
/***** Get code of mail *****/
return Par_GetParLong ("MaiCod");
} }
/*****************************************************************************/ /*****************************************************************************/
@ -534,8 +524,7 @@ void Mai_RemoveMailDomain (void)
Mai_EditingMailDomainConstructor (); Mai_EditingMailDomainConstructor ();
/***** Get mail domain code *****/ /***** Get mail domain code *****/
if ((Mai_EditingMai->MaiCod = Mai_GetParamMaiCod ()) <= 0) Mai_EditingMai->MaiCod = Par_GetAndCheckParCode (Par_MaiCod);
Err_WrongMailDomainExit ();
/***** Get data of the mail domain rom database *****/ /***** Get data of the mail domain rom database *****/
Mai_GetDataOfMailDomainByCod (Mai_EditingMai); Mai_GetDataOfMailDomainByCod (Mai_EditingMai);
@ -608,8 +597,7 @@ static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Get the code of the mail */ /* Get the code of the mail */
if ((Mai_EditingMai->MaiCod = Mai_GetParamMaiCod ()) <= 0) Mai_EditingMai->MaiCod = Par_GetAndCheckParCode (Par_MaiCod);
Err_WrongMailDomainExit ();
/* Get the new name for the mail */ /* Get the new name for the mail */
Par_GetParText (ParamName,NewMaiName,MaxBytes); Par_GetParText (ParamName,NewMaiName,MaxBytes);

View File

@ -67,7 +67,6 @@ bool Mai_CheckIfUsrCanReceiveEmailNotif (const struct Usr_Data *UsrDat);
void Mai_WriteWarningEmailNotifications (void); void Mai_WriteWarningEmailNotifications (void);
void Mai_GetDataOfMailDomainByCod (struct Mail *Plc); void Mai_GetDataOfMailDomainByCod (struct Mail *Plc);
long Mai_GetParamMaiCod (void);
void Mai_RemoveMailDomain (void); void Mai_RemoveMailDomain (void);
void Mai_RenameMailDomainShort (void); void Mai_RenameMailDomainShort (void);
void Mai_RenameMailDomainFull (void); void Mai_RenameMailDomainFull (void);

View File

@ -115,7 +115,6 @@ static void Msg_ShowFormToShowOnlyUnreadMessages (const struct Msg_Messages *Mes
static bool Msg_GetParamOnlyUnreadMsgs (void); static bool Msg_GetParamOnlyUnreadMsgs (void);
static void Msg_ShowASentOrReceivedMessage (struct Msg_Messages *Messages, static void Msg_ShowASentOrReceivedMessage (struct Msg_Messages *Messages,
long MsgNum,long MsgCod); long MsgNum,long MsgCod);
static long Msg_GetParamMsgCod (void);
static void Msg_PutLinkToShowMorePotentialRecipients (struct Msg_Messages *Messages); static void Msg_PutLinkToShowMorePotentialRecipients (struct Msg_Messages *Messages);
static void Msg_PutParamsShowMorePotentialRecipients (void *Messages); static void Msg_PutParamsShowMorePotentialRecipients (void *Messages);
static void Msg_PutParamsWriteMsg (void *Messages); static void Msg_PutParamsWriteMsg (void *Messages);
@ -235,8 +234,7 @@ static void Msg_PutFormMsgUsrs (struct Msg_Messages *Messages,
/***** Get parameter that indicates if the message is a reply to another message *****/ /***** Get parameter that indicates if the message is a reply to another message *****/
if ((Messages->Reply.IsReply = Par_GetParBool ("IsReply"))) if ((Messages->Reply.IsReply = Par_GetParBool ("IsReply")))
/* Get original message code */ /* Get original message code */
if ((Messages->Reply.OriginalMsgCod = Msg_GetParamMsgCod ()) <= 0) Messages->Reply.OriginalMsgCod = Par_GetAndCheckParCode (Par_MsgCod);
Err_WrongMessageExit ();
/***** Get user's code of possible preselected recipient *****/ /***** Get user's code of possible preselected recipient *****/
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ()) // There is a preselected recipient if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ()) // There is a preselected recipient
@ -321,7 +319,7 @@ static void Msg_PutFormMsgUsrs (struct Msg_Messages *Messages,
if (Messages->Reply.IsReply) if (Messages->Reply.IsReply)
{ {
Par_PutParChar ("IsReply",'Y'); Par_PutParChar ("IsReply",'Y');
Msg_PutHiddenParamMsgCod (Messages->Reply.OriginalMsgCod); Par_PutParCode (Par_MsgCod,Messages->Reply.OriginalMsgCod);
} }
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
{ {
@ -428,16 +426,19 @@ static void Msg_PutLinkToShowMorePotentialRecipients (struct Msg_Messages *Messa
static void Msg_PutParamsShowMorePotentialRecipients (void *Messages) static void Msg_PutParamsShowMorePotentialRecipients (void *Messages)
{ {
if (((struct Msg_Messages *) Messages)->Reply.IsReply) if (Messages)
{ {
Par_PutParChar ("IsReply",'Y'); if (((struct Msg_Messages *) Messages)->Reply.IsReply)
Msg_PutHiddenParamMsgCod (((struct Msg_Messages *) Messages)->Reply.OriginalMsgCod); {
} Par_PutParChar ("IsReply",'Y');
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) Par_PutParCode (Par_MsgCod,((struct Msg_Messages *) Messages)->Reply.OriginalMsgCod);
Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod); }
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod);
/***** Hidden params to send subject and content *****/ /***** Hidden params to send subject and content *****/
Msg_PutHiddenParamsSubjectAndContent (); Msg_PutHiddenParamsSubjectAndContent ();
}
} }
/*****************************************************************************/ /*****************************************************************************/
@ -454,7 +455,7 @@ static void Msg_PutParamsWriteMsg (void *Messages)
if (((struct Msg_Messages *) Messages)->Reply.IsReply) if (((struct Msg_Messages *) Messages)->Reply.IsReply)
{ {
Par_PutParChar ("IsReply",'Y'); Par_PutParChar ("IsReply",'Y');
Msg_PutHiddenParamMsgCod (((struct Msg_Messages *) Messages)->Reply.OriginalMsgCod); Par_PutParCode (Par_MsgCod,((struct Msg_Messages *) Messages)->Reply.OriginalMsgCod);
} }
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
{ {
@ -586,7 +587,7 @@ static void Msg_WriteFormSubjectAndContentMsgToUsrs (struct Msg_Messages *Messag
bool SubjectAndContentComeFromForm = (Messages->Subject[0] || Content[0]); bool SubjectAndContentComeFromForm = (Messages->Subject[0] || Content[0]);
/***** Get possible code (of original message if it's a reply) *****/ /***** Get possible code (of original message if it's a reply) *****/
MsgCod = Msg_GetParamMsgCod (); MsgCod = Par_GetParCode (Par_MsgCod);
/***** Message subject *****/ /***** Message subject *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -758,8 +759,7 @@ void Msg_RecMsgFromUsr (void)
/* Get parameter that indicates if the message is a reply to a previous message */ /* Get parameter that indicates if the message is a reply to a previous message */
if ((IsReply = Par_GetParBool ("IsReply"))) if ((IsReply = Par_GetParBool ("IsReply")))
/* Get original message code */ /* Get original message code */
if ((OriginalMsgCod = Msg_GetParamMsgCod ()) <= 0) OriginalMsgCod = Par_GetAndCheckParCode (Par_MsgCod);
Err_WrongMessageExit ();
/* Get user's code of possible preselected recipient */ /* Get user's code of possible preselected recipient */
Usr_GetParamOtherUsrCodEncryptedAndGetListIDs (); Usr_GetParamOtherUsrCodEncryptedAndGetListIDs ();
@ -1107,18 +1107,16 @@ static void Msg_GetParamMsgsCrsCod (struct Msg_Messages *Messages)
extern const char *Txt_any_course; extern const char *Txt_any_course;
struct Crs_Course Crs; struct Crs_Course Crs;
if ((Messages->FilterCrsCod = Par_GetParLong ("FilterCrsCod")) > 0) // If origin course specified if ((Messages->FilterCrsCod = Par_GetParCode (Par_FilterCrsCod)) > 0) // If origin course specified
{ {
/* Get data of course */ /* Get data of course */
Crs.CrsCod = Messages->FilterCrsCod; Crs.CrsCod = Messages->FilterCrsCod;
Crs_GetDataOfCourseByCod (&Crs); Crs_GetDataOfCourseByCod (&Crs);
Str_Copy (Messages->FilterCrsShrtName,Crs.ShrtName,
sizeof (Messages->FilterCrsShrtName) - 1);
} }
else
Str_Copy (Messages->FilterCrsShrtName,Txt_any_course, Str_Copy (Messages->FilterCrsShrtName,Messages->FilterCrsCod > 0 ? Crs.ShrtName :
sizeof (Messages->FilterCrsShrtName) - 1); Txt_any_course,
sizeof (Messages->FilterCrsShrtName) - 1);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1153,8 +1151,7 @@ void Msg_DelSntMsg (void)
long MsgCod; long MsgCod;
/***** Get the code of the message to delete *****/ /***** Get the code of the message to delete *****/
if ((MsgCod = Msg_GetParamMsgCod ()) <= 0) MsgCod = Par_GetAndCheckParCode (Par_MsgCod);
Err_WrongMessageExit ();
/***** Delete the message *****/ /***** Delete the message *****/
/* Delete the sent message */ /* Delete the sent message */
@ -1175,8 +1172,7 @@ void Msg_DelRecMsg (void)
long MsgCod; long MsgCod;
/***** Get the code of the message to delete *****/ /***** Get the code of the message to delete *****/
if ((MsgCod = Msg_GetParamMsgCod ()) <= 0) MsgCod = Par_GetAndCheckParCode (Par_MsgCod);
Err_WrongMessageExit ();
/***** Delete the message *****/ /***** Delete the message *****/
/* Delete the received message */ /* Delete the received message */
@ -1199,8 +1195,7 @@ void Msg_ExpSntMsg (void)
Msg_ResetMessages (&Messages); Msg_ResetMessages (&Messages);
/***** Get the code of the message to expand *****/ /***** Get the code of the message to expand *****/
if ((Messages.ExpandedMsgCod = Msg_GetParamMsgCod ()) <= 0) Messages.ExpandedMsgCod = Par_GetAndCheckParCode (Par_MsgCod);
Err_WrongMessageExit ();
/***** Expand the message *****/ /***** Expand the message *****/
Msg_DB_ExpandSntMsg (Messages.ExpandedMsgCod); Msg_DB_ExpandSntMsg (Messages.ExpandedMsgCod);
@ -1221,8 +1216,7 @@ void Msg_ExpRecMsg (void)
Msg_ResetMessages (&Messages); Msg_ResetMessages (&Messages);
/***** Get the code of the message to expand *****/ /***** Get the code of the message to expand *****/
if ((Messages.ExpandedMsgCod = Msg_GetParamMsgCod ()) <= 0) Messages.ExpandedMsgCod = Par_GetAndCheckParCode (Par_MsgCod);
Err_WrongMessageExit ();
/***** Expand the message *****/ /***** Expand the message *****/
Msg_DB_ExpandRcvMsg (Messages.ExpandedMsgCod); Msg_DB_ExpandRcvMsg (Messages.ExpandedMsgCod);
@ -1243,8 +1237,7 @@ void Msg_ConSntMsg (void)
long MsgCod; long MsgCod;
/***** Get the code of the message to contract *****/ /***** Get the code of the message to contract *****/
if ((MsgCod = Msg_GetParamMsgCod ()) <= 0) MsgCod = Par_GetAndCheckParCode (Par_MsgCod);
Err_WrongMessageExit ();
/***** Contract the message *****/ /***** Contract the message *****/
Msg_DB_ContractSntMsg (MsgCod); Msg_DB_ContractSntMsg (MsgCod);
@ -1262,8 +1255,7 @@ void Msg_ConRecMsg (void)
long MsgCod; long MsgCod;
/***** Get the code of the message to contract *****/ /***** Get the code of the message to contract *****/
if ((MsgCod = Msg_GetParamMsgCod ()) <= 0) MsgCod = Par_GetAndCheckParCode (Par_MsgCod);
Err_WrongMessageExit ();
/***** Contract the message *****/ /***** Contract the message *****/
Msg_DB_ContractRcvMsg (MsgCod); Msg_DB_ContractRcvMsg (MsgCod);
@ -1768,7 +1760,7 @@ static void Msg_PutHiddenParamsOneMsg (void *Messages)
{ {
Pag_PutHiddenParamPagNum (Msg_WhatPaginate[((struct Msg_Messages *) Messages)->TypeOfMessages], Pag_PutHiddenParamPagNum (Msg_WhatPaginate[((struct Msg_Messages *) Messages)->TypeOfMessages],
((struct Msg_Messages *) Messages)->CurrentPage); ((struct Msg_Messages *) Messages)->CurrentPage);
Msg_PutHiddenParamMsgCod (((struct Msg_Messages *) Messages)->MsgCod); Par_PutParCode (Par_MsgCod,((struct Msg_Messages *) Messages)->MsgCod);
Msg_PutHiddenParamsMsgsFilters (Messages); Msg_PutHiddenParamsMsgsFilters (Messages);
} }
} }
@ -1782,11 +1774,14 @@ void Msg_PutHiddenParamsMsgsFilters (void *Messages)
if (Messages) if (Messages)
{ {
if (((struct Msg_Messages *) Messages)->FilterCrsCod >= 0) if (((struct Msg_Messages *) Messages)->FilterCrsCod >= 0)
Par_PutParLong (NULL,"FilterCrsCod",((struct Msg_Messages *) Messages)->FilterCrsCod); Par_PutParCode (Par_FilterCrsCod,((struct Msg_Messages *) Messages)->FilterCrsCod);
if (((struct Msg_Messages *) Messages)->FilterFromTo[0]) if (((struct Msg_Messages *) Messages)->FilterFromTo[0])
Par_PutParString (NULL,"FilterFromTo",((struct Msg_Messages *) Messages)->FilterFromTo); Par_PutParString (NULL,"FilterFromTo",((struct Msg_Messages *) Messages)->FilterFromTo);
if (((struct Msg_Messages *) Messages)->FilterContent[0]) if (((struct Msg_Messages *) Messages)->FilterContent[0])
Par_PutParString (NULL,"FilterContent",((struct Msg_Messages *) Messages)->FilterContent); Par_PutParString (NULL,"FilterContent",((struct Msg_Messages *) Messages)->FilterContent);
if (((struct Msg_Messages *) Messages)->ShowOnlyUnreadMsgs) if (((struct Msg_Messages *) Messages)->ShowOnlyUnreadMsgs)
Par_PutParChar ("OnlyUnreadMsgs",'Y'); Par_PutParChar ("OnlyUnreadMsgs",'Y');
} }
@ -2431,7 +2426,7 @@ static void Msg_WriteFormToReply (long MsgCod,long CrsCod,bool FromThisCrs,
} }
Grp_PutParamAllGroups (); Grp_PutParamAllGroups ();
Par_PutParChar ("IsReply",'Y'); Par_PutParChar ("IsReply",'Y');
Msg_PutHiddenParamMsgCod (MsgCod); Par_PutParCode (Par_MsgCod,MsgCod);
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
Par_PutParChar ("ShowOnlyOneRecipient",'Y'); Par_PutParChar ("ShowOnlyOneRecipient",'Y');
@ -2734,25 +2729,6 @@ void Msg_WriteMsgContent (char Content[Cns_MAX_BYTES_LONG_TEXT + 1],
HTM_Txt (Content); HTM_Txt (Content);
} }
/*****************************************************************************/
/*************** Get parameter with the code of a message ********************/
/*****************************************************************************/
void Msg_PutHiddenParamMsgCod (long MsgCod)
{
Par_PutParLong (NULL,"MsgCod",MsgCod);
}
/*****************************************************************************/
/*************** Get parameter with the code of a message ********************/
/*****************************************************************************/
static long Msg_GetParamMsgCod (void)
{
/***** Get code of message *****/
return Par_GetParLong ("MsgCod");
}
/*****************************************************************************/ /*****************************************************************************/
/***************** Put a form to ban the sender of a message *****************/ /***************** Put a form to ban the sender of a message *****************/
/*****************************************************************************/ /*****************************************************************************/

View File

@ -118,8 +118,6 @@ void Msg_WriteMsgDate (time_t TimeUTC,const char *ClassTxt,const char *ClassBg);
void Msg_WriteMsgContent (char Content[Cns_MAX_BYTES_LONG_TEXT + 1], void Msg_WriteMsgContent (char Content[Cns_MAX_BYTES_LONG_TEXT + 1],
bool InsertLinks,bool ChangeBRToRet); bool InsertLinks,bool ChangeBRToRet);
void Msg_PutHiddenParamMsgCod (long MsgCod);
void Msg_BanSenderWhenShowingMsgs (void); void Msg_BanSenderWhenShowingMsgs (void);
void Msg_UnbanSenderWhenShowingMsgs (void); void Msg_UnbanSenderWhenShowingMsgs (void);
void Msg_UnbanSenderWhenListingUsrs (void); void Msg_UnbanSenderWhenListingUsrs (void);

View File

@ -808,7 +808,7 @@ static Act_Action_t Ntf_StartFormGoToAction (Ntf_NotifyEvent_t NotifyEvent,
case Ntf_EVENT_MESSAGE: case Ntf_EVENT_MESSAGE:
Action = ActExpRcvMsg; Action = ActExpRcvMsg;
Frm_BeginForm (Action); Frm_BeginForm (Action);
Msg_PutHiddenParamMsgCod (Cod); Par_PutParCode (Par_MsgCod,Cod);
break; break;
default: default:
Action = Ntf_DefaultActions[NotifyEvent]; Action = Ntf_DefaultActions[NotifyEvent];

View File

@ -66,12 +66,17 @@ const char *Par_CodeStr[] =
[Par_DptCod ] = "DptCod", [Par_DptCod ] = "DptCod",
[Par_ExaCod ] = "ExaCod", [Par_ExaCod ] = "ExaCod",
[Par_FilCod ] = "FilCod", [Par_FilCod ] = "FilCod",
[Par_FilterCrsCod] = "FilterCrsCod",
[Par_GamCod ] = "GamCod", [Par_GamCod ] = "GamCod",
[Par_GrpCod ] = "GrpCod", [Par_GrpCod ] = "GrpCod",
[Par_GrpTypCod ] = "GrpTypCod", [Par_GrpTypCod ] = "GrpTypCod",
[Par_HldCod ] = "HldCod", [Par_HldCod ] = "HldCod",
[Par_LnkCod ] = "LnkCod",
[Par_MaiCod ] = "MaiCod",
[Par_MchCod ] = "MchCod", [Par_MchCod ] = "MchCod",
[Par_MsgCod ] = "MsgCod",
[Par_NotCod ] = "NotCod", [Par_NotCod ] = "NotCod",
[Par_OrgActCod ] = "OrgActCod",
[Par_OthCtrCod ] = "OthCtrCod", [Par_OthCtrCod ] = "OthCtrCod",
[Par_OthCtyCod ] = "OthCtyCod", [Par_OthCtyCod ] = "OthCtyCod",
[Par_OthDegCod ] = "OthDegCod", [Par_OthDegCod ] = "OthDegCod",

View File

@ -74,12 +74,17 @@ typedef enum
Par_DptCod, Par_DptCod,
Par_ExaCod, Par_ExaCod,
Par_FilCod, Par_FilCod,
Par_FilterCrsCod,
Par_GamCod, Par_GamCod,
Par_GrpCod, Par_GrpCod,
Par_GrpTypCod, Par_GrpTypCod,
Par_HldCod, Par_HldCod,
Par_LnkCod,
Par_MaiCod,
Par_MchCod, Par_MchCod,
Par_MsgCod,
Par_NotCod, Par_NotCod,
Par_OrgActCod,
Par_OthCtrCod, Par_OthCtrCod,
Par_OthCtyCod, Par_OthCtyCod,
Par_OthDegCod, Par_OthDegCod,

View File

@ -1531,11 +1531,9 @@ void Rec_UpdateAndShowMyCrsRecord (void)
void Rec_UpdateAndShowOtherCrsRecord (void) void Rec_UpdateAndShowOtherCrsRecord (void)
{ {
extern const char *Txt_Student_record_card_in_this_course_has_been_updated; extern const char *Txt_Student_record_card_in_this_course_has_been_updated;
long OriginalActCod;
/***** Get where we came from *****/ /***** Get where we came from *****/
OriginalActCod = Par_GetParLong ("OriginalActCod"); Gbl.Action.Original = Act_GetActionFromActCod (Par_GetParCode (Par_OrgActCod));
Gbl.Action.Original = Act_GetActionFromActCod (OriginalActCod);
/***** Get the user whose record we want to modify *****/ /***** Get the user whose record we want to modify *****/
Usr_GetParamOtherUsrCodEncryptedAndGetListIDs (); Usr_GetParamOtherUsrCodEncryptedAndGetListIDs ();
@ -1650,8 +1648,7 @@ static void Rec_ShowCrsRecord (Rec_CourseRecordViewType_t TypeOfView,
{ {
ICanEdit = true; ICanEdit = true;
Frm_BeginFormAnchor (ActRcvRecOthUsr,Anchor); Frm_BeginFormAnchor (ActRcvRecOthUsr,Anchor);
Par_PutParLong (NULL,"OriginalActCod", Par_PutParCode (Par_OrgActCod,Act_GetActCod (ActSeeRecSevStd)); // Original action, used to know where we came from
Act_GetActCod (ActSeeRecSevStd)); // Original action, used to know where we came from
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
if (TypeOfView == Rec_CRS_LIST_SEVERAL_RECORDS) if (TypeOfView == Rec_CRS_LIST_SEVERAL_RECORDS)
Usr_PutHiddenParSelectedUsrsCods (&Gbl.Usrs.Selected); Usr_PutHiddenParSelectedUsrsCods (&Gbl.Usrs.Selected);