Version 22.73: Mar 10, 2023 Code refactoring in parameters.

This commit is contained in:
acanas 2023-03-10 00:13:55 +01:00
parent 95b6707b9e
commit 24e2901a61
222 changed files with 3732 additions and 3835 deletions

View File

@ -245,11 +245,11 @@ static int API_GenerateNewAPIKey (struct soap *soap,
char APIKey[API_BYTES_KEY + 1]);
static bool API_GetSomeUsrDataFromUsrCod (struct Usr_Data *UsrDat,long CrsCod);
static int API_CheckParamsNewAccount (char *NewNickWithArr, // Input
char NewNickWithoutArr[Nck_MAX_BYTES_NICK_WITHOUT_ARROBA + 1], // Output
char *NewEmail, // Input-output
char *NewPlainPassword, // Input
char NewEncryptedPassword[Pwd_BYTES_ENCRYPTED_PASSWORD + 1]); // Output
static int API_CheckParsNewAccount (char *NewNickWithArr, // Input
char NewNickWithoutArr[Nck_MAX_BYTES_NICK_WITHOUT_ARROBA + 1], // Output
char *NewEmail, // Input-output
char *NewPlainPassword, // Input
char NewEncryptedPassword[Pwd_BYTES_ENCRYPTED_PASSWORD + 1]); // Output
static int API_WriteSyllabusIntoHTMLBuffer (struct soap *soap,
struct Syl_Syllabus *Syllabus,
@ -619,7 +619,7 @@ int swad__createAccount (struct soap *soap,
return ReturnCode;
/***** Check parameters used to create the new account *****/
Result = API_CheckParamsNewAccount (userNickname, // Input
Result = API_CheckParsNewAccount (userNickname, // Input
NewNickWithoutArr, // Output
userEmail, // Input-output
userPassword, // Input
@ -670,11 +670,11 @@ int swad__createAccount (struct soap *soap,
/*****************************************************************************/
// Return false on error
//char *userNickname,char *userEmail,char *userID,char *userPassword
static int API_CheckParamsNewAccount (char *NewNickWithArr, // Input
char NewNickWithoutArr[Nck_MAX_BYTES_NICK_WITHOUT_ARROBA + 1], // Output
char *NewEmail, // Input-output
char *NewPlainPassword, // Input
char NewEncryptedPassword[Pwd_BYTES_ENCRYPTED_PASSWORD + 1]) // Output
static int API_CheckParsNewAccount (char *NewNickWithArr, // Input
char NewNickWithoutArr[Nck_MAX_BYTES_NICK_WITHOUT_ARROBA + 1], // Output
char *NewEmail, // Input-output
char *NewPlainPassword, // Input
char NewEncryptedPassword[Pwd_BYTES_ENCRYPTED_PASSWORD + 1]) // Output
{
char CopyOfNewNick[Nck_MAX_BYTES_NICK_WITH_ARROBA + 1];

View File

@ -77,8 +77,8 @@ static void ID_PutLinkToConfirmID (struct Usr_Data *UsrDat,unsigned NumID,
static void ID_ShowFormChangeUsrID (bool ItsMe,bool IShouldFillInID);
static void ID_PutParamsRemoveMyID (void *ID);
static void ID_PutParamsRemoveOtherID (void *ID);
static void ID_PutParsRemoveMyID (void *ID);
static void ID_PutParsRemoveOtherID (void *ID);
static void ID_RemoveUsrID (const struct Usr_Data *UsrDat,bool ItsMe);
static void ID_NewUsrID (const struct Usr_Data *UsrDat,bool ItsMe);
@ -216,19 +216,19 @@ unsigned ID_GetListUsrCodsFromUsrID (struct Usr_Data *UsrDat,
/******* Put hidden parameter with the plain user's ID of other user *********/
/*****************************************************************************/
void ID_PutParamOtherUsrIDPlain (void)
void ID_PutParOtherUsrIDPlain (void)
{
Par_PutParString (NULL,"OtherUsrID",
(Gbl.Usrs.Other.UsrDat.IDs.Num &&
Gbl.Usrs.Other.UsrDat.IDs.List) ? Gbl.Usrs.Other.UsrDat.IDs.List[0].ID :
"");
(Gbl.Usrs.Other.UsrDat.IDs.Num &&
Gbl.Usrs.Other.UsrDat.IDs.List) ? Gbl.Usrs.Other.UsrDat.IDs.List[0].ID :
"");
}
/*****************************************************************************/
/********* Get parameter plain user's ID of other user from a form ***********/
/*****************************************************************************/
void ID_GetParamOtherUsrIDPlain (void)
void ID_GetParOtherUsrIDPlain (void)
{
/***** Allocate space for the list *****/
ID_ReallocateListIDs (&Gbl.Usrs.Other.UsrDat,1);
@ -417,13 +417,13 @@ static void ID_PutLinkToConfirmID (struct Usr_Data *UsrDat,unsigned NumID,
case ActSeeRecSevGst:
case ActSeeRecSevStd:
case ActSeeRecSevTch:
Usr_PutHiddenParSelectedUsrsCods (&Gbl.Usrs.Selected);
Usr_PutParSelectedUsrsCods (&Gbl.Usrs.Selected);
break;
default:
break;
}
}
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
Par_PutParString (NULL,"UsrID",UsrDat->IDs.List[NumID].ID);
/***** Put link *****/
@ -571,10 +571,10 @@ static void ID_ShowFormChangeUsrID (bool ItsMe,bool IShouldFillInID)
/* Form to remove user's ID */
if (ItsMe)
Ico_PutContextualIconToRemove (ActRemMyID,ID_ID_SECTION_ID,
ID_PutParamsRemoveMyID,UsrDat->IDs.List[NumID].ID);
ID_PutParsRemoveMyID,UsrDat->IDs.List[NumID].ID);
else
Ico_PutContextualIconToRemove (NextAction[UsrDat->Roles.InCurrentCrs].Remove,ID_ID_SECTION_ID,
ID_PutParamsRemoveOtherID,UsrDat->IDs.List[NumID].ID);
ID_PutParsRemoveOtherID,UsrDat->IDs.List[NumID].ID);
}
}
@ -628,7 +628,7 @@ static void ID_ShowFormChangeUsrID (bool ItsMe,bool IShouldFillInID)
else
{
Frm_BeginFormAnchor (NextAction[UsrDat->Roles.InCurrentCrs].New,ID_ID_SECTION_ID);
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
}
HTM_INPUT_TEXT ("NewID",ID_MAX_BYTES_USR_ID,
UsrDat->IDs.Num ? UsrDat->IDs.List[UsrDat->IDs.Num - 1].ID :
@ -648,17 +648,17 @@ static void ID_ShowFormChangeUsrID (bool ItsMe,bool IShouldFillInID)
HTM_TABLE_End ();
}
static void ID_PutParamsRemoveMyID (void *ID)
static void ID_PutParsRemoveMyID (void *ID)
{
if (ID)
Par_PutParString (NULL,"UsrID",(char *) ID);
}
static void ID_PutParamsRemoveOtherID (void *ID)
static void ID_PutParsRemoveOtherID (void *ID)
{
if (ID)
{
Usr_PutParamUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod);
Usr_PutParUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod);
Par_PutParString (NULL,"UsrID",(char *) ID);
}
}
@ -687,7 +687,7 @@ void ID_RemoveMyUsrID (void)
void ID_RemoveOtherUsrID (void)
{
/***** Get other user's code from form and get user's data *****/
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
{
if (Usr_ICanEditOtherUsr (&Gbl.Usrs.Other.UsrDat))
{
@ -777,7 +777,7 @@ void ID_NewMyUsrID (void)
void ID_NewOtherUsrID (void)
{
/***** Get other user's code from form and get user's data *****/
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
{
if (Usr_ICanEditOtherUsr (&Gbl.Usrs.Other.UsrDat))
{
@ -894,7 +894,7 @@ void ID_ConfirmOtherUsrID (void)
/***** Get other user's code from form and get user's data *****/
ICanConfirm = false;
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
if (!Usr_ItsMe (Gbl.Usrs.Other.UsrDat.UsrCod)) // Not me
{
/* If user is a student in current course,

View File

@ -63,8 +63,8 @@ unsigned ID_GetListUsrCodsFromUsrID (struct Usr_Data *UsrDat,
struct Usr_ListUsrCods *ListUsrCods,
bool OnlyConfirmedIDs);
void ID_PutParamOtherUsrIDPlain (void);
void ID_GetParamOtherUsrIDPlain (void);
void ID_PutParOtherUsrIDPlain (void);
void ID_GetParOtherUsrIDPlain (void);
bool ID_CheckIfUsrIDIsValid (const char *UsrID);
bool ID_CheckIfUsrIDSeemsAValidID (const char *UsrID);

View File

@ -41,7 +41,7 @@
/*****************************************************************************/
/* Parameters used in forms to edit MAC address */
struct MAC_Params
struct MAC_Pars
{
long RooCod; // Room code
char MACstr[MAC_LENGTH_MAC_ADDRESS + 1]; // MAC address
@ -51,20 +51,20 @@ struct MAC_Params
/***************************** Private prototypes ****************************/
/*****************************************************************************/
static void MAC_PutParams (void *Args);
static void MAC_PutPars (void *Args);
static void MAC_PutFormToEditMACAddress (Act_Action_t NextAction,const char *Anchor,
void (*FuncParams) (void *Args),void *Args);
void (*FuncPars) (void *Args),void *Args);
/*****************************************************************************/
/**************** Put hidden parameters to edit a MAC address ****************/
/*****************************************************************************/
static void MAC_PutParams (void *Args)
static void MAC_PutPars (void *Args)
{
if (Args)
{
Par_PutParCode (Par_RooCod,((struct MAC_Params *) Args)->RooCod);
Par_PutParString (NULL,"MAC" ,((struct MAC_Params *) Args)->MACstr);
Par_PutParCode (Par_RooCod,((struct MAC_Pars *) Args)->RooCod);
Par_PutParString (NULL,"MAC",((struct MAC_Pars *) Args)->MACstr);
}
}
@ -73,12 +73,12 @@ static void MAC_PutParams (void *Args)
/*****************************************************************************/
static void MAC_PutFormToEditMACAddress (Act_Action_t NextAction,const char *Anchor,
void (*FuncParams) (void *Args),void *Args)
void (*FuncPars) (void *Args),void *Args)
{
/***** Form to enter a new MAC address *****/
Frm_BeginFormAnchor (NextAction,Anchor);
FuncParams (Args);
HTM_INPUT_TEXT ("NewMAC",MAC_LENGTH_MAC_ADDRESS,((struct MAC_Params *) Args)->MACstr,
FuncPars (Args);
HTM_INPUT_TEXT ("NewMAC",MAC_LENGTH_MAC_ADDRESS,((struct MAC_Pars *) Args)->MACstr,
HTM_SUBMIT_ON_CHANGE,
"size=\"8\" class=\"INPUT_%s\"",
The_GetSuffix ());
@ -130,7 +130,7 @@ void MAC_EditMACAddresses (long RooCod,const char *Anchor,
MYSQL_ROW row;
unsigned NumMAC;
unsigned long long MACnum;
struct MAC_Params Params;
struct MAC_Pars Pars;
/***** Write the forms to enter the MAC addresses *****/
for (NumMAC = 0;
@ -143,10 +143,10 @@ void MAC_EditMACAddresses (long RooCod,const char *Anchor,
/* Write MAC address (row[0]) */
if (sscanf (row[0],"%llu",&MACnum) == 1)
{
Params.RooCod = RooCod; // Code (i.e. room code)
MAC_MACnumToMACstr (MACnum,Params.MACstr); // Current MAC address in xx:xx:xx:xx:xx:xx format
Pars.RooCod = RooCod; // Code (i.e. room code)
MAC_MACnumToMACstr (MACnum,Pars.MACstr); // Current MAC address in xx:xx:xx:xx:xx:xx format
MAC_PutFormToEditMACAddress (ActChgRooMAC,Anchor,
MAC_PutParams,&Params);
MAC_PutPars,&Pars);
/* Write break line */
HTM_BR ();
@ -154,10 +154,10 @@ void MAC_EditMACAddresses (long RooCod,const char *Anchor,
}
/* Form to enter a new MAC address */
Params.RooCod = RooCod; // Room code
Params.MACstr[0] = '\0'; // Current MAC address in xx:xx:xx:xx:xx:xx format
Pars.RooCod = RooCod; // Room code
Pars.MACstr[0] = '\0'; // Current MAC address in xx:xx:xx:xx:xx:xx format
MAC_PutFormToEditMACAddress (ActChgRooMAC,Anchor,
MAC_PutParams,&Params);
MAC_PutPars,&Pars);
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (mysql_res);
@ -167,14 +167,14 @@ void MAC_EditMACAddresses (long RooCod,const char *Anchor,
/****************** Get MAC address as a number from a form ******************/
/*****************************************************************************/
unsigned long long MAC_GetMACnumFromForm (const char *ParamName)
unsigned long long MAC_GetMACnumFromForm (const char *ParName)
{
char MACstr[MAC_LENGTH_MAC_ADDRESS * Str_MAX_BYTES_PER_CHAR + 1];
unsigned long long MAC[MAC_NUM_BYTES];
unsigned long long MACnum;
/***** Get parameter *****/
Par_GetParText (ParamName,MACstr,MAC_LENGTH_MAC_ADDRESS * Str_MAX_BYTES_PER_CHAR);
Par_GetParText (ParName,MACstr,MAC_LENGTH_MAC_ADDRESS * Str_MAX_BYTES_PER_CHAR);
if (MACstr[0]) // Not empty
{

View File

@ -38,7 +38,7 @@ void MAC_ListMACAddresses (unsigned NumMACs,MYSQL_RES **mysql_res);
void MAC_EditMACAddresses (long RooCod,const char *Anchor,
unsigned NumMACs,MYSQL_RES **mysql_res);
unsigned long long MAC_GetMACnumFromForm (const char *ParamName);
unsigned long long MAC_GetMACnumFromForm (const char *ParName);
void MAC_MACnumToMACstr (unsigned long long MACnum,char MACstr[MAC_LENGTH_MAC_ADDRESS + 1]);
#endif

View File

@ -58,10 +58,10 @@ extern struct Globals Gbl;
/*****************************************************************************/
void QR_PutLinkToPrintQRCode (Act_Action_t Action,
void (*FuncParams) (void *Args),void *Args)
void (*FuncPars) (void *Args),void *Args)
{
Lay_PutContextualLinkOnlyIcon (Action,NULL,
FuncParams,Args,
FuncPars,Args,
"qrcode.svg",Ico_BLACK);
}
@ -69,7 +69,7 @@ void QR_PutLinkToPrintQRCode (Act_Action_t Action,
/************************* Put parameter QR string ***************************/
/*****************************************************************************/
void QR_PutParamQRString (void *QRString)
void QR_PutParQRString (void *QRString)
{
Par_PutParString (NULL,"QRString",QRString);
}
@ -97,7 +97,7 @@ void QR_PrintUsrQRCode (void)
{
char NewNickWithArr[Nck_MAX_BYTES_NICK_WITH_ARROBA + 1];
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
{
/***** Begin box *****/
Box_BoxBegin (NULL,Gbl.Usrs.Other.UsrDat.FullName,
@ -145,26 +145,29 @@ void QR_ImageQRCode (const char *QRString)
/*************** Show QR code with direct link (shortcut URL) ****************/
/*****************************************************************************/
void QR_LinkTo (unsigned Size,const char *ParamName,long Cod)
void QR_LinkTo (unsigned Size,Par_Code_t ParCode,long Cod)
{
extern const char *Par_CodeStr[];
extern const char *Txt_Shortcut;
char *URL;
/***** Show QR code with link *****/
if (ParamName)
if (ParCode == Par_None)
{
if (asprintf (&URL,"https://chart.googleapis.com/chart?cht=qr&chs=%ux%u&chl=%s/?%s=%ld",
Size,Size,Cfg_URL_SWAD_CGI,ParamName,Cod) < 0)
if (asprintf (&URL,"https://chart.googleapis.com/"
"chart?cht=qr&amp;chs=%ux%u&amp;chl=%s/",
Size,Size,Cfg_URL_SWAD_CGI) < 0)
Err_NotEnoughMemoryExit ();
}
else
{
if (asprintf (&URL,"https://chart.googleapis.com/chart?cht=qr&amp;chs=%ux%u&amp;chl=%s/",
Size,Size,Cfg_URL_SWAD_CGI) < 0)
if (asprintf (&URL,"https://chart.googleapis.com/"
"chart?cht=qr&amp;chs=%ux%u&amp;chl=%s/?%s=%ld",
Size,Size,Cfg_URL_SWAD_CGI,Par_CodeStr[ParCode],Cod) < 0)
Err_NotEnoughMemoryExit ();
}
HTM_IMG (URL,NULL,Txt_Shortcut,
"style=\"width:%upx;height:%upx;\"",Size,Size);
HTM_IMG (URL,NULL,Txt_Shortcut,"style=\"width:%upx;height:%upx;\"",Size,Size);
free (URL);
}

View File

@ -23,19 +23,25 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*****************************************************************************/
/********************************* Headers ***********************************/
/*****************************************************************************/
#include "swad_parameter.h"
/*****************************************************************************/
/***************************** Public prototypes *****************************/
/*****************************************************************************/
void QR_PutLinkToPrintQRCode (Act_Action_t Action,
void (*FuncParams) (void *Args),void *Args);
void QR_PutParamQRString (void *QRString);
void (*FuncPars) (void *Args),void *Args);
void QR_PutParQRString (void *QRString);
void QR_PrintQRCode (void);
void QR_PrintUsrQRCode (void);
void QR_ImageQRCode (const char *QRString);
void QR_LinkTo (unsigned Size,const char *ParamName,long Cod);
void QR_LinkTo (unsigned Size,Par_Code_t ParCode,long Cod);
void QR_ExamAnnnouncement (void);
#endif

View File

@ -89,14 +89,14 @@ extern struct Globals Gbl;
static void Acc_ShowFormCheckIfIHaveAccount (const char *Title);
static void Acc_WriteRowEmptyAccount (unsigned NumUsr,const char *ID,struct Usr_Data *UsrDat);
static void Acc_ShowFormRequestNewAccountWithParams (const char *NewNickWithoutArr,
const char *NewEmail);
static bool Acc_GetParamsNewAccount (char NewNickWithoutArr[Nck_MAX_BYTES_NICK_WITHOUT_ARROBA + 1],
char NewEmail[Cns_MAX_BYTES_EMAIL_ADDRESS + 1],
char NewEncryptedPassword[Pwd_BYTES_ENCRYPTED_PASSWORD + 1]);
static void Acc_ShowFormRequestNewAccountWithPars (const char *NewNickWithoutArr,
const char *NewEmail);
static bool Acc_GetParsNewAccount (char NewNickWithoutArr[Nck_MAX_BYTES_NICK_WITHOUT_ARROBA + 1],
char NewEmail[Cns_MAX_BYTES_EMAIL_ADDRESS + 1],
char NewEncryptedPassword[Pwd_BYTES_ENCRYPTED_PASSWORD + 1]);
static void Acc_CreateNewEncryptedUsrCod (struct Usr_Data *UsrDat);
static void Acc_PutParamsToRemoveMyAccount (void *EncryptedUsrCod);
static void Acc_PutParsToRemoveMyAccount (void *EncryptedUsrCod);
static void Acc_AskIfRemoveUsrAccount (bool ItsMe);
static void Acc_AskIfRemoveOtherUsrAccount (void);
@ -316,7 +316,7 @@ static void Acc_WriteRowEmptyAccount (unsigned NumUsr,const char *ID,struct Usr_
/***** Button to login with this account *****/
HTM_TD_Begin ("class=\"RT %s\"",The_GetColorRows ());
Frm_BeginForm (ActLogInNew);
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
Btn_PutCreateButtonInline (Txt_Its_me);
Frm_EndForm ();
HTM_TD_End ();
@ -353,15 +353,15 @@ void Acc_ShowFormCreateMyAccount (void)
Mnu_ContextMenuEnd ();
/**** Show form to create a new account *****/
Acc_ShowFormRequestNewAccountWithParams ("","");
Acc_ShowFormRequestNewAccountWithPars ("","");
}
/*****************************************************************************/
/************ Show form to create a new account using parameters *************/
/*****************************************************************************/
static void Acc_ShowFormRequestNewAccountWithParams (const char *NewNickWithoutArr,
const char *NewEmail)
static void Acc_ShowFormRequestNewAccountWithPars (const char *NewNickWithoutArr,
const char *NewEmail)
{
extern const char *Hlp_PROFILE_SignUp;
extern const char *Txt_Create_account;
@ -528,7 +528,7 @@ void Acc_ShowFormChgMyAccount (void)
void Acc_ShowFormChgOtherUsrAccount (void)
{
/***** Get user whose account must be changed *****/
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
{
if (Usr_ICanEditOtherUsr (&Gbl.Usrs.Other.UsrDat))
{
@ -574,15 +574,15 @@ void Acc_PutLinkToRemoveMyAccount (__attribute__((unused)) void *Args)
{
if (Acc_CheckIfICanEliminateAccount (Gbl.Usrs.Me.UsrDat.UsrCod))
Lay_PutContextualLinkOnlyIcon (ActReqRemMyAcc,NULL,
Acc_PutParamsToRemoveMyAccount,Gbl.Usrs.Me.UsrDat.EnUsrCod,
Acc_PutParsToRemoveMyAccount,Gbl.Usrs.Me.UsrDat.EnUsrCod,
"trash.svg",Ico_RED);
}
static void Acc_PutParamsToRemoveMyAccount (void *EncryptedUsrCod)
static void Acc_PutParsToRemoveMyAccount (void *EncryptedUsrCod)
{
Usr_PutParamMyUsrCodEncrypted (EncryptedUsrCod);
Usr_PutParMyUsrCodEncrypted (EncryptedUsrCod);
Par_PutParUnsigned (NULL,"RegRemAction",
(unsigned) Enr_ELIMINATE_ONE_USR_FROM_PLATFORM);
(unsigned) Enr_ELIMINATE_ONE_USR_FROM_PLATFORM);
}
/*****************************************************************************/
@ -597,7 +597,7 @@ bool Acc_CreateMyNewAccountAndLogIn (void)
char NewEmail[Cns_MAX_BYTES_EMAIL_ADDRESS + 1];
char NewEncryptedPassword[Pwd_BYTES_ENCRYPTED_PASSWORD + 1];
if (Acc_GetParamsNewAccount (NewNickWithoutArr,NewEmail,NewEncryptedPassword))
if (Acc_GetParsNewAccount (NewNickWithoutArr,NewEmail,NewEncryptedPassword))
{
/***** User's has no ID *****/
Gbl.Usrs.Me.UsrDat.IDs.Num = 0;
@ -631,7 +631,7 @@ bool Acc_CreateMyNewAccountAndLogIn (void)
else
{
/***** Show form again ******/
Acc_ShowFormRequestNewAccountWithParams (NewNickWithoutArr,NewEmail);
Acc_ShowFormRequestNewAccountWithPars (NewNickWithoutArr,NewEmail);
return false;
}
}
@ -641,9 +641,9 @@ bool Acc_CreateMyNewAccountAndLogIn (void)
/*****************************************************************************/
// Return false on error
static bool Acc_GetParamsNewAccount (char NewNickWithoutArr[Nck_MAX_BYTES_NICK_WITHOUT_ARROBA + 1],
char NewEmail[Cns_MAX_BYTES_EMAIL_ADDRESS + 1],
char NewEncryptedPassword[Pwd_BYTES_ENCRYPTED_PASSWORD + 1])
static bool Acc_GetParsNewAccount (char NewNickWithoutArr[Nck_MAX_BYTES_NICK_WITHOUT_ARROBA + 1],
char NewEmail[Cns_MAX_BYTES_EMAIL_ADDRESS + 1],
char NewEncryptedPassword[Pwd_BYTES_ENCRYPTED_PASSWORD + 1])
{
extern const char *Txt_The_nickname_had_been_registered_by_another_user;
extern const char *Txt_The_nickname_is_not_valid_;
@ -812,7 +812,7 @@ void Acc_GetUsrCodAndRemUsrGbl (void)
{
bool Error = false;
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
{
if (Acc_CheckIfICanEliminateAccount (Gbl.Usrs.Other.UsrDat.UsrCod))
Acc_ReqRemAccountOrRemAccount (Acc_REMOVE_USR);
@ -925,7 +925,7 @@ static void Acc_AskIfRemoveOtherUsrAccount (void)
/* Show form to request confirmation */
Frm_BeginForm (ActRemUsrGbl);
Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod);
Usr_PutParOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod);
Pwd_AskForConfirmationOnDangerousAction ();
Btn_PutRemoveButton (Txt_Eliminate_user_account);
Frm_EndForm ();
@ -1135,6 +1135,6 @@ void Acc_PutIconToChangeUsrAccount (struct Usr_Data *UsrDat)
else // Not me
if (Usr_ICanEditOtherUsr (UsrDat))
Lay_PutContextualLinkOnlyIcon (NextAction[UsrDat->Roles.InCurrentCrs],NULL,
Rec_PutParamUsrCodEncrypted,NULL,
Rec_PutParUsrCodEncrypted,NULL,
"at.svg",Ico_BLACK);
}

View File

@ -134,7 +134,7 @@ const struct Act_Actions ActLst_Actions[ActLst_NUM_ACTIONS] =
// TabStr ******************************************************************
[ActFrmLogIn ] = {1521, 0,TabStr,ActFrmLogIn , 0,0x001,0x001,0x001,0x001,0x001,0x001,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Usr_WriteLandingPage ,"power-off" },
[ActReqSch ] = { 627, 1,TabStr,ActReqSch ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Sch_ReqSysSearch ,"search" },
[ActSeeGblTL ] = {1490, 2,TabStr,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TmlWho_GetParamWho ,Tml_ShowTimelineGbl ,"comment-dots" },
[ActSeeGblTL ] = {1490, 2,TabStr,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TmlWho_GetParWho ,Tml_ShowTimelineGbl ,"comment-dots" },
[ActSeeSocPrf ] = {1520, 3,TabStr,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_SeeSocialProfiles ,"user-circle" },
[ActSeeCal ] = {1622, 4,TabStr,ActSeeCal ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Cal_ShowCalendar ,"calendar" },
[ActSeeNtf ] = { 990, 5,TabStr,ActSeeNtf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Ntf_ShowMyNotifications ,"bell" },
@ -147,12 +147,12 @@ const struct Act_Actions ActLst_Actions[ActLst_NUM_ACTIONS] =
[ActSndNewPwd ] = { 633,-1,TabUnk,ActFrmLogIn , 0,0x001,0x001,0x001,0x001,0x001,0x001,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Pwd_ChkIdLoginAndSendNewPwd ,NULL},
[ActLogOut ] = { 10,-1,TabUnk,ActFrmLogIn ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,Ses_CloseSession ,Usr_Logout ,NULL},
[ActSch ] = { 628,-1,TabUnk,ActReqSch ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,Sch_GetParamsSearch ,Sch_SysSearch ,NULL},
[ActSch ] = { 628,-1,TabUnk,ActReqSch ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,Sch_GetParsSearch ,Sch_SysSearch ,NULL},
[ActRefNewPubGblTL ] = {1509,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_AJAX_RFRESH,TmlWho_GetParamWho ,Tml_RefreshNewTimelineGbl ,NULL},
[ActRefOldPubGblTL ] = {1510,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,TmlWho_GetParamWho ,Tml_RefreshOldTimelineGbl ,NULL},
[ActRcvPstGblTL ] = {1492,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,TmlWho_GetParamWho ,TmlPst_ReceivePostGbl ,NULL},
[ActRcvComGblTL ] = {1503,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,TmlWho_GetParamWho ,TmlCom_ReceiveCommGbl ,NULL},
[ActRefNewPubGblTL ] = {1509,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_AJAX_RFRESH,TmlWho_GetParWho ,Tml_RefreshNewTimelineGbl ,NULL},
[ActRefOldPubGblTL ] = {1510,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,TmlWho_GetParWho ,Tml_RefreshOldTimelineGbl ,NULL},
[ActRcvPstGblTL ] = {1492,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,TmlWho_GetParWho ,TmlPst_ReceivePostGbl ,NULL},
[ActRcvComGblTL ] = {1503,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,TmlWho_GetParWho ,TmlCom_ReceiveCommGbl ,NULL},
[ActShoHidComGblTL ] = {1806,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TmlCom_ShowHiddenCommsGbl ,NULL},
[ActAllShaNotGblTL ] = {1766,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TmlSha_ShowAllSharersNoteGbl ,NULL},
[ActAllFavNotGblTL ] = {1767,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TmlFav_ShowAllFaversNoteGbl ,NULL},
@ -163,10 +163,10 @@ const struct Act_Actions ActLst_Actions[ActLst_NUM_ACTIONS] =
[ActUnfNotGblTL ] = {1513,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TmlFav_UnfNoteGbl ,NULL},
[ActFavComGblTL ] = {1516,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TmlFav_FavCommGbl ,NULL},
[ActUnfComGblTL ] = {1517,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_AJAX_NORMAL,NULL ,TmlFav_UnfCommGbl ,NULL},
[ActReqRemPubGblTL ] = {1494,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TmlWho_GetParamWho ,TmlNot_RequestRemNoteGbl ,NULL},
[ActRemPubGblTL ] = {1493,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TmlWho_GetParamWho ,TmlNot_RemoveNoteGbl ,NULL},
[ActReqRemComGblTL ] = {1505,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TmlWho_GetParamWho ,TmlCom_RequestRemComGbl ,NULL},
[ActRemComGblTL ] = {1507,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TmlWho_GetParamWho ,TmlCom_RemoveComGbl ,NULL},
[ActReqRemPubGblTL ] = {1494,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TmlWho_GetParWho ,TmlNot_RequestRemNoteGbl ,NULL},
[ActRemPubGblTL ] = {1493,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TmlWho_GetParWho ,TmlNot_RemoveNoteGbl ,NULL},
[ActReqRemComGblTL ] = {1505,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TmlWho_GetParWho ,TmlCom_RequestRemComGbl ,NULL},
[ActRemComGblTL ] = {1507,-1,TabUnk,ActSeeGblTL ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,TmlWho_GetParWho ,TmlCom_RemoveComGbl ,NULL},
[ActReqOthPubPrf ] = {1401,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_RequestUserProfile ,NULL},
@ -1793,7 +1793,7 @@ const struct Act_Actions ActLst_Actions[ActLst_NUM_ACTIONS] =
[ActFrmRolSes ] = { 843, 0,TabPrf,ActFrmRolSes ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Usr_WriteFormLogout ,"power-off" },
[ActMyCrs ] = { 987, 1,TabPrf,ActMyCrs ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Crs_ReqSelectOneOfMyCourses ,"sitemap" },
[ActSeeMyTT ] = { 408, 2,TabPrf,ActSeeMyTT ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tmt_ShowClassTimeTable ,"clock" },
[ActSeeMyAgd ] = {1602, 3,TabPrf,ActSeeMyAgd ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Agd_GetParamsAndShowMyAgenda ,"calendar" },
[ActSeeMyAgd ] = {1602, 3,TabPrf,ActSeeMyAgd ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Agd_GetParsAndShowMyAgenda ,"calendar" },
[ActFrmMyAcc ] = { 36, 4,TabPrf,ActFrmMyAcc ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Acc_ShowFormMyAccount ,"at" },
[ActReqEdiRecSha ] = { 285, 5,TabPrf,ActReqEdiRecSha ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Rec_ShowMySharedRecordAndMore ,"address-card" },
[ActReqEdiSet ] = { 673, 6,TabPrf,ActReqEdiSet ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Set_EditSettings ,"cog" },

View File

@ -133,7 +133,7 @@ static void Adm_ReqAddAdm (HieLvl_Level_t Scope,long Cod,
if (Cod > 0)
{
/***** Get user's identificator of the user to register as admin *****/
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
{
/* Check if I am allowed to register user as administrator in institution/center/degree */
ICanRegister = ((Scope == HieLvl_DEG && Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM) ||
@ -159,7 +159,7 @@ static void Adm_ReqAddAdm (HieLvl_Level_t Scope,long Cod,
/* End alert */
Ale_ShowAlertAndButton2 (Enr_ActNewAdm[Scope],NULL,NULL,
Usr_PutParamOtherUsrCodEncrypted,Gbl.Usrs.Other.UsrDat.EnUsrCod,
Usr_PutParOtherUsrCodEncrypted,Gbl.Usrs.Other.UsrDat.EnUsrCod,
Btn_CREATE_BUTTON,Txt_Register_user_IN_A_COURSE_OR_DEGREE);
}
}
@ -228,7 +228,7 @@ static void Enr_AddAdm (HieLvl_Level_t Scope,long Cod,
if (Cod > 0)
{
/***** Get plain user's ID of the user to add/modify *****/
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
{
/* Check if I am allowed to register user as administrator in institution/center/degree */
ICanRegister = ((Scope == HieLvl_DEG && Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM) ||
@ -351,7 +351,7 @@ static void Adm_ReqRemOrRemAdm (Enr_ReqDelOrDelUsr_t ReqDelOrDelUsr,
if (Cod > 0)
{
/***** Get user to be removed *****/
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
{
/* Check if it's forbidden to remove an administrator */
ItsMe = Usr_ItsMe (Gbl.Usrs.Other.UsrDat.UsrCod);
@ -422,7 +422,7 @@ static void Adm_AskIfRemAdm (bool ItsMe,HieLvl_Level_t Scope,
/* End alert */
Ale_ShowAlertAndButton2 (Enr_ActRemAdm[Scope],NULL,NULL,
Usr_PutParamOtherUsrCodEncrypted,Gbl.Usrs.Other.UsrDat.EnUsrCod,
Usr_PutParOtherUsrCodEncrypted,Gbl.Usrs.Other.UsrDat.EnUsrCod,
Btn_REMOVE_BUTTON,
ItsMe ? Txt_Remove_me_as_an_administrator :
Txt_Remove_USER_as_an_administrator);

View File

@ -64,9 +64,9 @@ extern struct Globals Gbl;
/***************************** Private constants *****************************/
/*****************************************************************************/
static const char *ParamPast__FutureName = "Past__Future";
static const char *ParamPrivatPublicName = "PrivatPublic";
static const char *ParamHiddenVisiblName = "HiddenVisibl";
static const char *ParPast__FutureName = "Past__Future";
static const char *ParPrivatPublicName = "PrivatPublic";
static const char *ParHiddenVisiblName = "HiddenVisibl";
/*****************************************************************************/
/***************************** Private prototypes ****************************/
@ -80,12 +80,12 @@ static void Agd_ShowFormToSelPast__FutureEvents (const struct Agd_Agenda *Agenda
static void Agd_ShowFormToSelPrivatPublicEvents (const struct Agd_Agenda *Agenda);
static void Agd_ShowFormToSelHiddenVisiblEvents (const struct Agd_Agenda *Agenda);
static void Agd_PutHiddenParamPast__FutureEvents (unsigned Past__FutureEvents);
static void Agd_PutHiddenParamPrivatPublicEvents (unsigned PrivatPublicEvents);
static void Agd_PutHiddenParamHiddenVisiblEvents (unsigned HiddenVisiblEvents);
static unsigned Agd_GetParamsPast__FutureEvents (void);
static unsigned Agd_GetParamsPrivatPublicEvents (void);
static unsigned Agd_GetParamsHiddenVisiblEvents (void);
static void Agd_PutParPast__FutureEvents (unsigned Past__FutureEvents);
static void Agd_PutParPrivatPublicEvents (unsigned PrivatPublicEvents);
static void Agd_PutParHiddenVisiblEvents (unsigned HiddenVisiblEvents);
static unsigned Agd_GetParsPast__FutureEvents (void);
static unsigned Agd_GetParsPrivatPublicEvents (void);
static unsigned Agd_GetParsHiddenVisiblEvents (void);
static void Agd_ShowEvents (struct Agd_Agenda *Agenda,
Agd_AgendaType_t AgendaType);
@ -104,13 +104,13 @@ static void Agd_PutIconsOtherPublicAgenda (void *EncryptedUsrCod);
static void Agd_PutButtonToCreateNewEvent (const struct Agd_Agenda *Agenda);
static void Agd_ShowOneEvent (struct Agd_Agenda *Agenda,
Agd_AgendaType_t AgendaType,long AgdCod);
static void Agd_GetParamEventOrder (struct Agd_Agenda *Agenda);
static void Agd_GetParEventOrder (struct Agd_Agenda *Agenda);
static void Agd_PutFormsToRemEditOneEvent (struct Agd_Agenda *Agenda,
struct Agd_Event *AgdEvent,
const char *Anchor);
static void Agd_PutCurrentParamsMyAgenda (void *Agenda);
static void Agd_GetParams (struct Agd_Agenda *Agenda,
static void Agd_PutCurrentParsMyAgenda (void *Agenda);
static void Agd_GetPars (struct Agd_Agenda *Agenda,
Agd_AgendaType_t AgendaType);
static void Agd_GetListEvents (struct Agd_Agenda *Agenda,
@ -145,11 +145,10 @@ static void Agd_ResetAgenda (struct Agd_Agenda *Agenda)
void Agd_PutFormLogInToShowUsrAgenda (void)
{
/***** Form to log in *****/
Usr_WriteFormLogin (ActLogInUsrAgd,Agd_PutParamAgd);
Usr_WriteFormLogin (ActLogInUsrAgd,Agd_PutParAgd);
}
void Agd_PutParamAgd (void)
void Agd_PutParAgd (void)
{
char NickWithArr[Nck_MAX_BYTES_NICK_WITH_ARROBA + 1];
@ -161,7 +160,7 @@ void Agd_PutParamAgd (void)
/******************************* Show my agenda ******************************/
/*****************************************************************************/
void Agd_GetParamsAndShowMyAgenda (void)
void Agd_GetParsAndShowMyAgenda (void)
{
struct Agd_Agenda Agenda;
@ -169,7 +168,7 @@ void Agd_GetParamsAndShowMyAgenda (void)
Agd_ResetAgenda (&Agenda);
/***** Get parameters *****/
Agd_GetParams (&Agenda,Agd_MY_AGENDA);
Agd_GetPars (&Agenda,Agd_MY_AGENDA);
/***** Show my agenda *****/
Agd_ShowMyAgenda (&Agenda);
@ -223,12 +222,12 @@ static void Agd_ShowFormToSelPast__FutureEvents (const struct Agd_Agenda *Agenda
{
Set_BeginPref ((Agenda->Past__FutureEvents & (1 << PstFut)));
Frm_BeginForm (ActSeeMyAgd);
Agd_PutParamsMyAgenda (Agenda->Past__FutureEvents ^ (1 << PstFut), // Toggle
Agenda->PrivatPublicEvents,
Agenda->HiddenVisiblEvents,
Agenda->SelectedOrder,
Agenda->CurrentPage,
-1L);
Agd_PutParsMyAgenda (Agenda->Past__FutureEvents ^ (1 << PstFut), // Toggle
Agenda->PrivatPublicEvents,
Agenda->HiddenVisiblEvents,
Agenda->SelectedOrder,
Agenda->CurrentPage,
-1L);
Ico_PutSettingIconLink (Icon[PstFut],Ico_BLACK,
Txt_AGENDA_PAST___FUTURE_EVENTS[PstFut]);
Frm_EndForm ();
@ -262,12 +261,12 @@ static void Agd_ShowFormToSelPrivatPublicEvents (const struct Agd_Agenda *Agenda
{
Set_BeginPref ((Agenda->PrivatPublicEvents & (1 << PrvPub)));
Frm_BeginForm (ActSeeMyAgd);
Agd_PutParamsMyAgenda (Agenda->Past__FutureEvents,
Agenda->PrivatPublicEvents ^ (1 << PrvPub), // Toggle
Agenda->HiddenVisiblEvents,
Agenda->SelectedOrder,
Agenda->CurrentPage,
-1L);
Agd_PutParsMyAgenda (Agenda->Past__FutureEvents,
Agenda->PrivatPublicEvents ^ (1 << PrvPub), // Toggle
Agenda->HiddenVisiblEvents,
Agenda->SelectedOrder,
Agenda->CurrentPage,
-1L);
Ico_PutSettingIconLink (Icon[PrvPub].Icon,Icon[PrvPub].Color,
Txt_AGENDA_PRIVAT_PUBLIC_EVENTS[PrvPub]);
Frm_EndForm ();
@ -301,12 +300,12 @@ static void Agd_ShowFormToSelHiddenVisiblEvents (const struct Agd_Agenda *Agenda
{
Set_BeginPref ((Agenda->HiddenVisiblEvents & (1 << HidVis)));
Frm_BeginForm (ActSeeMyAgd);
Agd_PutParamsMyAgenda (Agenda->Past__FutureEvents,
Agenda->PrivatPublicEvents,
Agenda->HiddenVisiblEvents ^ (1 << HidVis), // Toggle
Agenda->SelectedOrder,
Agenda->CurrentPage,
-1L);
Agd_PutParsMyAgenda (Agenda->Past__FutureEvents,
Agenda->PrivatPublicEvents,
Agenda->HiddenVisiblEvents ^ (1 << HidVis), // Toggle
Agenda->SelectedOrder,
Agenda->CurrentPage,
-1L);
Ico_PutSettingIconLink (Icon[HidVis].Icon,Icon[HidVis].Color,
Txt_AGENDA_HIDDEN_VISIBL_EVENTS[HidVis]);
Frm_EndForm ();
@ -319,53 +318,53 @@ static void Agd_ShowFormToSelHiddenVisiblEvents (const struct Agd_Agenda *Agenda
/************************ Put hidden params for events ***********************/
/*****************************************************************************/
static void Agd_PutHiddenParamPast__FutureEvents (unsigned Past__FutureEvents)
static void Agd_PutParPast__FutureEvents (unsigned Past__FutureEvents)
{
Par_PutParUnsigned (NULL,ParamPast__FutureName,Past__FutureEvents);
Par_PutParUnsigned (NULL,ParPast__FutureName,Past__FutureEvents);
}
static void Agd_PutHiddenParamPrivatPublicEvents (unsigned PrivatPublicEvents)
static void Agd_PutParPrivatPublicEvents (unsigned PrivatPublicEvents)
{
Par_PutParUnsigned (NULL,ParamPrivatPublicName,PrivatPublicEvents);
Par_PutParUnsigned (NULL,ParPrivatPublicName,PrivatPublicEvents);
}
static void Agd_PutHiddenParamHiddenVisiblEvents (unsigned HiddenVisiblEvents)
static void Agd_PutParHiddenVisiblEvents (unsigned HiddenVisiblEvents)
{
Par_PutParUnsigned (NULL,ParamHiddenVisiblName,HiddenVisiblEvents);
Par_PutParUnsigned (NULL,ParHiddenVisiblName,HiddenVisiblEvents);
}
/*****************************************************************************/
/************************ Get hidden params for events ***********************/
/*****************************************************************************/
static unsigned Agd_GetParamsPast__FutureEvents (void)
static unsigned Agd_GetParsPast__FutureEvents (void)
{
return (unsigned) Par_GetParUnsignedLong (ParamPast__FutureName,
0,
(1 << Agd_PAST___EVENTS) |
(1 << Agd_FUTURE_EVENTS),
Agd_DEFAULT_PAST___EVENTS |
Agd_DEFAULT_FUTURE_EVENTS);
return (unsigned) Par_GetParUnsignedLong (ParPast__FutureName,
0,
(1 << Agd_PAST___EVENTS) |
(1 << Agd_FUTURE_EVENTS),
Agd_DEFAULT_PAST___EVENTS |
Agd_DEFAULT_FUTURE_EVENTS);
}
static unsigned Agd_GetParamsPrivatPublicEvents (void)
static unsigned Agd_GetParsPrivatPublicEvents (void)
{
return (unsigned) Par_GetParUnsignedLong (ParamPrivatPublicName,
0,
(1 << Agd_PRIVAT_EVENTS) |
(1 << Agd_PUBLIC_EVENTS),
Agd_DEFAULT_PRIVAT_EVENTS |
Agd_DEFAULT_PUBLIC_EVENTS);
return (unsigned) Par_GetParUnsignedLong (ParPrivatPublicName,
0,
(1 << Agd_PRIVAT_EVENTS) |
(1 << Agd_PUBLIC_EVENTS),
Agd_DEFAULT_PRIVAT_EVENTS |
Agd_DEFAULT_PUBLIC_EVENTS);
}
static unsigned Agd_GetParamsHiddenVisiblEvents (void)
static unsigned Agd_GetParsHiddenVisiblEvents (void)
{
return (unsigned) Par_GetParUnsignedLong (ParamHiddenVisiblName,
0,
(1 << Agd_HIDDEN_EVENTS) |
(1 << Agd_VISIBL_EVENTS),
Agd_DEFAULT_HIDDEN_EVENTS |
Agd_DEFAULT_VISIBL_EVENTS);
return (unsigned) Par_GetParUnsignedLong (ParHiddenVisiblName,
0,
(1 << Agd_HIDDEN_EVENTS) |
(1 << Agd_VISIBL_EVENTS),
Agd_DEFAULT_HIDDEN_EVENTS |
Agd_DEFAULT_VISIBL_EVENTS);
}
/*****************************************************************************/
@ -382,7 +381,7 @@ void Agd_ShowUsrAgenda (void)
char *Title;
/***** Get user *****/
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
if (Usr_CheckIfICanViewUsrAgenda (&Gbl.Usrs.Other.UsrDat))
{
Error = false;
@ -500,7 +499,7 @@ static void Agd_ShowEvents (struct Agd_Agenda *Agenda,
};
/***** Get parameters *****/
Agd_GetParams (Agenda,AgendaType);
Agd_GetPars (Agenda,AgendaType);
/***** Get list of events *****/
Agd_GetListEvents (Agenda,AgendaType);
@ -563,7 +562,7 @@ static void Agd_ShowEventsToday (struct Agd_Agenda *Agenda,
unsigned NumEvent;
/***** Get parameters *****/
Agd_GetParams (Agenda,AgendaType);
Agd_GetPars (Agenda,AgendaType);
/***** Get list of events *****/
Agd_GetListEvents (Agenda,AgendaType);
@ -632,21 +631,21 @@ static void Agd_WriteHeaderListEvents (const struct Agd_Agenda *Agenda,
case Agd_MY_AGENDA_TODAY:
case Agd_MY_AGENDA:
Frm_BeginForm (ActSeeMyAgd);
Pag_PutHiddenParamPagNum (Pag_MY_AGENDA,Agenda->CurrentPage);
Pag_PutParPagNum (Pag_MY_AGENDA,Agenda->CurrentPage);
break;
case Agd_ANOTHER_AGENDA_TODAY:
case Agd_ANOTHER_AGENDA:
Frm_BeginForm (ActSeeUsrAgd);
Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod);
Pag_PutHiddenParamPagNum (Pag_ANOTHER_AGENDA,Agenda->CurrentPage);
Usr_PutParOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod);
Pag_PutParPagNum (Pag_ANOTHER_AGENDA,Agenda->CurrentPage);
break;
}
Agd_PutParamsMyAgenda (Agenda->Past__FutureEvents,
Agenda->PrivatPublicEvents,
Agenda->HiddenVisiblEvents,
Order,
Agenda->CurrentPage,
-1L);
Agd_PutParsMyAgenda (Agenda->Past__FutureEvents,
Agenda->PrivatPublicEvents,
Agenda->HiddenVisiblEvents,
Order,
Agenda->CurrentPage,
-1L);
HTM_BUTTON_Submit_Begin (Txt_START_END_TIME_HELP[Order],
"class=\"BT_LINK\"");
@ -695,7 +694,7 @@ static void Agd_PutIconToCreateNewEvent (void *Agenda)
{
((struct Agd_Agenda *) Agenda)->AgdCodToEdit = -1L;
Ico_PutContextualIconToAdd (ActFrmNewEvtMyAgd,NULL,
Agd_PutCurrentParamsMyAgenda,Agenda);
Agd_PutCurrentParsMyAgenda,Agenda);
}
static void Agd_PutIconToViewEditMyFullAgenda (void *EncryptedUsrCod)
@ -713,7 +712,7 @@ static void Agd_PutIconToShowQR (void)
Cfg_URL_SWAD_CGI,Lan_STR_LANG_ID[Gbl.Prefs.Language],
Gbl.Usrs.Me.UsrDat.Nickname);
QR_PutLinkToPrintQRCode (ActPrnAgdQR,
QR_PutParamQRString,URL);
QR_PutParQRString,URL);
}
static void Agd_PutIconsOtherPublicAgenda (void *EncryptedUsrCod)
@ -722,18 +721,18 @@ static void Agd_PutIconsOtherPublicAgenda (void *EncryptedUsrCod)
if (Pri_ShowingIsAllowed (Gbl.Usrs.Other.UsrDat.BaPrfVisibility,
&Gbl.Usrs.Other.UsrDat))
Lay_PutContextualLinkOnlyIcon (ActSeeOthPubPrf,NULL,
Usr_PutParamOtherUsrCodEncrypted,EncryptedUsrCod,
Usr_PutParOtherUsrCodEncrypted,EncryptedUsrCod,
"user.svg",Ico_BLACK);
/***** Button to view user's record card *****/
if (Usr_CheckIfICanViewRecordStd (&Gbl.Usrs.Other.UsrDat))
/* View student's records: common record card and course record card */
Lay_PutContextualLinkOnlyIcon (ActSeeRecOneStd,NULL,
Usr_PutParamOtherUsrCodEncrypted,EncryptedUsrCod,
Usr_PutParOtherUsrCodEncrypted,EncryptedUsrCod,
"address-card.svg",Ico_BLACK);
else if (Usr_CheckIfICanViewRecordTch (&Gbl.Usrs.Other.UsrDat))
Lay_PutContextualLinkOnlyIcon (ActSeeRecOneTch,NULL,
Usr_PutParamOtherUsrCodEncrypted,EncryptedUsrCod,
Usr_PutParOtherUsrCodEncrypted,EncryptedUsrCod,
"address-card.svg",Ico_BLACK);
}
@ -747,12 +746,12 @@ static void Agd_PutButtonToCreateNewEvent (const struct Agd_Agenda *Agenda)
/***** Begin form *****/
Frm_BeginForm (ActFrmNewEvtMyAgd);
Agd_PutParamsMyAgenda (Agenda->Past__FutureEvents,
Agenda->PrivatPublicEvents,
Agenda->HiddenVisiblEvents,
Agenda->SelectedOrder,
Agenda->CurrentPage,
-1L);
Agd_PutParsMyAgenda (Agenda->Past__FutureEvents,
Agenda->PrivatPublicEvents,
Agenda->HiddenVisiblEvents,
Agenda->SelectedOrder,
Agenda->CurrentPage,
-1L);
/***** Confirm button *****/
Btn_PutConfirmButton (Txt_New_event);
@ -897,25 +896,25 @@ static void Agd_PutFormsToRemEditOneEvent (struct Agd_Agenda *Agenda,
/***** Icon to remove event *****/
Ico_PutContextualIconToRemove (ActReqRemEvtMyAgd,NULL,
Agd_PutCurrentParamsMyAgenda,Agenda);
Agd_PutCurrentParsMyAgenda,Agenda);
/***** Icon to hide/unhide event *****/
Ico_PutContextualIconToHideUnhide (ActionHideUnhide,Anchor,
Agd_PutCurrentParamsMyAgenda,Agenda,
Agd_PutCurrentParsMyAgenda,Agenda,
AgdEvent->Hidden);
/***** Icon to edit event *****/
Ico_PutContextualIconToEdit (ActEdiOneEvtMyAgd,NULL,
Agd_PutCurrentParamsMyAgenda,Agenda);
Agd_PutCurrentParsMyAgenda,Agenda);
/***** Icon to make event public/private *****/
if (AgdEvent->Public)
Lay_PutContextualLinkOnlyIcon (ActPrvEvtMyAgd,NULL,
Agd_PutCurrentParamsMyAgenda,Agenda,
Agd_PutCurrentParsMyAgenda,Agenda,
"unlock.svg",Ico_GREEN);
else
Lay_PutContextualLinkOnlyIcon (ActPubEvtMyAgd,NULL,
Agd_PutCurrentParamsMyAgenda,Agenda,
Agd_PutCurrentParsMyAgenda,Agenda,
"lock.svg",Ico_RED);
}
@ -923,22 +922,22 @@ static void Agd_PutFormsToRemEditOneEvent (struct Agd_Agenda *Agenda,
/****************** Parameters passed in my agenda forms *********************/
/*****************************************************************************/
static void Agd_PutCurrentParamsMyAgenda (void *Agenda)
static void Agd_PutCurrentParsMyAgenda (void *Agenda)
{
if (Agenda)
Agd_PutParamsMyAgenda (((struct Agd_Agenda *) Agenda)->Past__FutureEvents,
((struct Agd_Agenda *) Agenda)->PrivatPublicEvents,
((struct Agd_Agenda *) Agenda)->HiddenVisiblEvents,
((struct Agd_Agenda *) Agenda)->SelectedOrder,
((struct Agd_Agenda *) Agenda)->CurrentPage,
((struct Agd_Agenda *) Agenda)->AgdCodToEdit);
Agd_PutParsMyAgenda (((struct Agd_Agenda *) Agenda)->Past__FutureEvents,
((struct Agd_Agenda *) Agenda)->PrivatPublicEvents,
((struct Agd_Agenda *) Agenda)->HiddenVisiblEvents,
((struct Agd_Agenda *) Agenda)->SelectedOrder,
((struct Agd_Agenda *) Agenda)->CurrentPage,
((struct Agd_Agenda *) Agenda)->AgdCodToEdit);
}
/* The following function is called
when one or more parameters must be passed explicitely.
Each parameter is passed only if its value is distinct to default. */
void Agd_PutParamsMyAgenda (unsigned Past__FutureEvents,
void Agd_PutParsMyAgenda (unsigned Past__FutureEvents,
unsigned PrivatPublicEvents,
unsigned HiddenVisiblEvents,
Dat_StartEndTime_t Order,
@ -947,21 +946,21 @@ void Agd_PutParamsMyAgenda (unsigned Past__FutureEvents,
{
if (Past__FutureEvents != (Agd_DEFAULT_PAST___EVENTS |
Agd_DEFAULT_FUTURE_EVENTS))
Agd_PutHiddenParamPast__FutureEvents (Past__FutureEvents);
Agd_PutParPast__FutureEvents (Past__FutureEvents);
if (PrivatPublicEvents != (Agd_DEFAULT_PRIVAT_EVENTS |
Agd_DEFAULT_PUBLIC_EVENTS))
Agd_PutHiddenParamPrivatPublicEvents (PrivatPublicEvents);
Agd_PutParPrivatPublicEvents (PrivatPublicEvents);
if (HiddenVisiblEvents != (Agd_DEFAULT_HIDDEN_EVENTS |
Agd_DEFAULT_VISIBL_EVENTS))
Agd_PutHiddenParamHiddenVisiblEvents (HiddenVisiblEvents);
Agd_PutParHiddenVisiblEvents (HiddenVisiblEvents);
if (Order != Agd_ORDER_DEFAULT)
Par_PutParOrder ((unsigned) Order);
if (NumPage > 1)
Pag_PutHiddenParamPagNum (Pag_MY_AGENDA,NumPage);
Pag_PutParPagNum (Pag_MY_AGENDA,NumPage);
Par_PutParCode (Par_AgdCod,AgdCodToEdit);
}
@ -970,7 +969,7 @@ void Agd_PutParamsMyAgenda (unsigned Past__FutureEvents,
/********** Get parameter with the type or order in list of events ***********/
/*****************************************************************************/
static void Agd_GetParams (struct Agd_Agenda *Agenda,
static void Agd_GetPars (struct Agd_Agenda *Agenda,
Agd_AgendaType_t AgendaType)
{
static const Pag_WhatPaginate_t WhatPaginate[Agd_NUM_AGENDA_TYPES] =
@ -983,19 +982,19 @@ static void Agd_GetParams (struct Agd_Agenda *Agenda,
if (AgendaType == Agd_MY_AGENDA)
{
Agenda->Past__FutureEvents = Agd_GetParamsPast__FutureEvents ();
Agenda->PrivatPublicEvents = Agd_GetParamsPrivatPublicEvents ();
Agenda->HiddenVisiblEvents = Agd_GetParamsHiddenVisiblEvents ();
Agenda->Past__FutureEvents = Agd_GetParsPast__FutureEvents ();
Agenda->PrivatPublicEvents = Agd_GetParsPrivatPublicEvents ();
Agenda->HiddenVisiblEvents = Agd_GetParsHiddenVisiblEvents ();
}
Agd_GetParamEventOrder (Agenda);
Agenda->CurrentPage = Pag_GetParamPagNum (WhatPaginate[AgendaType]);
Agd_GetParEventOrder (Agenda);
Agenda->CurrentPage = Pag_GetParPagNum (WhatPaginate[AgendaType]);
}
/*****************************************************************************/
/****** Put a hidden parameter with the type of order in list of events ******/
/*****************************************************************************/
void Agd_PutHiddenParamEventsOrder (Dat_StartEndTime_t SelectedOrder)
void Agd_PutParEventsOrder (Dat_StartEndTime_t SelectedOrder)
{
if (SelectedOrder != Agd_ORDER_DEFAULT)
Par_PutParOrder ((unsigned) SelectedOrder);
@ -1005,7 +1004,7 @@ void Agd_PutHiddenParamEventsOrder (Dat_StartEndTime_t SelectedOrder)
/********** Get parameter with the type or order in list of events ***********/
/*****************************************************************************/
static void Agd_GetParamEventOrder (struct Agd_Agenda *Agenda)
static void Agd_GetParEventOrder (struct Agd_Agenda *Agenda)
{
static bool AlreadyGot = false;
@ -1013,9 +1012,9 @@ static void Agd_GetParamEventOrder (struct Agd_Agenda *Agenda)
{
Agenda->SelectedOrder = (Dat_StartEndTime_t)
Par_GetParUnsignedLong ("Order",
0,
Dat_NUM_START_END_TIME - 1,
(unsigned long) Agd_ORDER_DEFAULT);
0,
Dat_NUM_START_END_TIME - 1,
(unsigned long) Agd_ORDER_DEFAULT);
AlreadyGot = true;
}
}
@ -1170,7 +1169,7 @@ void Agd_AskRemEvent (void)
Agd_ResetAgenda (&Agenda);
/***** Get parameters *****/
Agd_GetParams (&Agenda,Agd_MY_AGENDA);
Agd_GetPars (&Agenda,Agd_MY_AGENDA);
/***** Get event code *****/
AgdEvent.AgdCod = Par_GetAndCheckParCode (Par_AgdCod);
@ -1182,7 +1181,7 @@ void Agd_AskRemEvent (void)
/***** Show question and button to remove event *****/
Agenda.AgdCodToEdit = AgdEvent.AgdCod;
Ale_ShowAlertAndButton (ActRemEvtMyAgd,NULL,NULL,
Agd_PutCurrentParamsMyAgenda,&Agenda,
Agd_PutCurrentParsMyAgenda,&Agenda,
Btn_REMOVE_BUTTON,Txt_Remove_event,
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_event_X,
AgdEvent.Event);
@ -1205,7 +1204,7 @@ void Agd_RemoveEvent (void)
Agd_ResetAgenda (&Agenda);
/***** Get parameters *****/
Agd_GetParams (&Agenda,Agd_MY_AGENDA);
Agd_GetPars (&Agenda,Agd_MY_AGENDA);
/***** Get event code *****/
AgdEvent.AgdCod = Par_GetAndCheckParCode (Par_AgdCod);
@ -1238,7 +1237,7 @@ void Agd_HideEvent (void)
Agd_ResetAgenda (&Agenda);
/***** Get parameters *****/
Agd_GetParams (&Agenda,Agd_MY_AGENDA);
Agd_GetPars (&Agenda,Agd_MY_AGENDA);
/***** Get event code *****/
AgdEvent.AgdCod = Par_GetAndCheckParCode (Par_AgdCod);
@ -1267,7 +1266,7 @@ void Agd_UnhideEvent (void)
Agd_ResetAgenda (&Agenda);
/***** Get parameters *****/
Agd_GetParams (&Agenda,Agd_MY_AGENDA);
Agd_GetPars (&Agenda,Agd_MY_AGENDA);
/***** Get event code *****/
AgdEvent.AgdCod = Par_GetAndCheckParCode (Par_AgdCod);
@ -1297,7 +1296,7 @@ void Agd_MakeEventPrivate (void)
Agd_ResetAgenda (&Agenda);
/***** Get parameters *****/
Agd_GetParams (&Agenda,Agd_MY_AGENDA);
Agd_GetPars (&Agenda,Agd_MY_AGENDA);
/***** Get event code *****/
AgdEvent.AgdCod = Par_GetAndCheckParCode (Par_AgdCod);
@ -1331,7 +1330,7 @@ void Agd_MakeEventPublic (void)
Agd_ResetAgenda (&Agenda);
/***** Get parameters *****/
Agd_GetParams (&Agenda,Agd_MY_AGENDA);
Agd_GetPars (&Agenda,Agd_MY_AGENDA);
/***** Get event code *****/
AgdEvent.AgdCod = Par_GetAndCheckParCode (Par_AgdCod);