mirror of https://github.com/acanas/swad-core.git
Version 22.73: Mar 10, 2023 Code refactoring in parameters.
This commit is contained in:
parent
95b6707b9e
commit
24e2901a61
22
swad_API.c
22
swad_API.c
|
@ -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];
|
||||
|
||||
|
|
36
swad_ID.c
36
swad_ID.c
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
36
swad_MAC.c
36
swad_MAC.c
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
27
swad_QR.c
27
swad_QR.c
|
@ -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&chs=%ux%u&chl=%s/",
|
||||
Size,Size,Cfg_URL_SWAD_CGI) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (asprintf (&URL,"https://chart.googleapis.com/chart?cht=qr&chs=%ux%u&chl=%s/",
|
||||
Size,Size,Cfg_URL_SWAD_CGI) < 0)
|
||||
if (asprintf (&URL,"https://chart.googleapis.com/"
|
||||
"chart?cht=qr&chs=%ux%u&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);
|
||||
}
|
||||
|
||||
|
|
12
swad_QR.h
12
swad_QR.h
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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" },
|
||||
|
|
10
swad_admin.c
10
swad_admin.c
|
@ -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);
|
||||
|
|
245
swad_agenda.c
245
swad_agenda.c
|
@ -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);
|
||||
|
@ -1380,7 +1379,7 @@ void Agd_RequestCreatOrEditEvent (void)
|
|||
Agd_ResetAgenda (&Agenda);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Agd_GetParams (&Agenda,Agd_MY_AGENDA);
|
||||
Agd_GetPars (&Agenda,Agd_MY_AGENDA);
|
||||
|
||||
/***** Get the code of the event *****/
|
||||
ItsANewEvent = ((AgdEvent.AgdCod = Par_GetParCode (Par_AgdCod)) <= 0);
|
||||
|
@ -1417,7 +1416,7 @@ void Agd_RequestCreatOrEditEvent (void)
|
|||
Frm_BeginForm (ActChgEvtMyAgd);
|
||||
Agenda.AgdCodToEdit = AgdEvent.AgdCod;
|
||||
}
|
||||
Agd_PutCurrentParamsMyAgenda (&Agenda);
|
||||
Agd_PutCurrentParsMyAgenda (&Agenda);
|
||||
|
||||
/***** Begin box and table *****/
|
||||
if (ItsANewEvent)
|
||||
|
@ -1523,7 +1522,7 @@ void Agd_ReceiveFormEvent (void)
|
|||
Agd_ResetAgenda (&Agenda);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Agd_GetParams (&Agenda,Agd_MY_AGENDA);
|
||||
Agd_GetPars (&Agenda,Agd_MY_AGENDA);
|
||||
|
||||
/***** Set author of the event *****/
|
||||
AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod;
|
||||
|
|
|
@ -105,21 +105,21 @@ typedef enum
|
|||
/*****************************************************************************/
|
||||
|
||||
void Agd_PutFormLogInToShowUsrAgenda (void);
|
||||
void Agd_PutParamAgd (void);
|
||||
void Agd_PutParAgd (void);
|
||||
|
||||
void Agd_GetParamsAndShowMyAgenda (void);
|
||||
void Agd_GetParsAndShowMyAgenda (void);
|
||||
void Agd_ShowUsrAgenda (void);
|
||||
void Agd_ShowOtherAgendaAfterLogIn (void);
|
||||
|
||||
void Agd_RequestCreatOrEditEvent (void);
|
||||
|
||||
void Agd_PutParamsMyAgenda (unsigned Past__FutureEvents,
|
||||
void Agd_PutParsMyAgenda (unsigned Past__FutureEvents,
|
||||
unsigned PrivatPublicEvents,
|
||||
unsigned HiddenVisiblEvents,
|
||||
Dat_StartEndTime_t Order,
|
||||
unsigned NumPage,
|
||||
long AgdCodToEdit);
|
||||
void Agd_PutHiddenParamEventsOrder (Dat_StartEndTime_t SelectedOrder);
|
||||
void Agd_PutParEventsOrder (Dat_StartEndTime_t SelectedOrder);
|
||||
|
||||
void Agd_AskRemEvent (void);
|
||||
void Agd_RemoveEvent (void);
|
||||
|
|
14
swad_alert.c
14
swad_alert.c
|
@ -293,7 +293,7 @@ static void Ale_ShowFixAlert (Ale_AlertType_t AlertType,const char *Txt)
|
|||
/*****************************************************************************/
|
||||
|
||||
void Ale_ShowLastAlertAndButton (Act_Action_t NextAction,const char *Anchor,const char *OnSubmit,
|
||||
void (*FuncParams) (void *Args),void *Args,
|
||||
void (*FuncPars) (void *Args),void *Args,
|
||||
Btn_Button_t Button,const char *TxtButton)
|
||||
{
|
||||
/***** Show last alert and then reset it *****/
|
||||
|
@ -301,7 +301,7 @@ void Ale_ShowLastAlertAndButton (Act_Action_t NextAction,const char *Anchor,cons
|
|||
|
||||
/***** Show button *****/
|
||||
Ale_ShowAlertAndButton2 (NextAction,Anchor,OnSubmit,
|
||||
FuncParams,Args,
|
||||
FuncPars,Args,
|
||||
Button,TxtButton);
|
||||
}
|
||||
|
||||
|
@ -323,7 +323,7 @@ void Ale_ShowLastAlertAndButton1 (void)
|
|||
/*****************************************************************************/
|
||||
|
||||
void Ale_ShowAlertAndButton (Act_Action_t NextAction,const char *Anchor,const char *OnSubmit,
|
||||
void (*FuncParams) (void *Args),void *Args,
|
||||
void (*FuncPars) (void *Args),void *Args,
|
||||
Btn_Button_t Button,const char *TxtButton,
|
||||
Ale_AlertType_t AlertType,const char *fmt,...)
|
||||
{
|
||||
|
@ -341,7 +341,7 @@ void Ale_ShowAlertAndButton (Act_Action_t NextAction,const char *Anchor,const ch
|
|||
/****** Print fix alert and button ******/
|
||||
Ale_ShowFixAlertAndButton1 (AlertType,Txt);
|
||||
Ale_ShowAlertAndButton2 (NextAction,Anchor,OnSubmit,
|
||||
FuncParams,Args,
|
||||
FuncPars,Args,
|
||||
Button,TxtButton);
|
||||
|
||||
/***** Free text *****/
|
||||
|
@ -447,7 +447,7 @@ static void Ale_ShowFixAlertAndButton1 (Ale_AlertType_t AlertType,const char *Tx
|
|||
/*****************************************************************************/
|
||||
|
||||
void Ale_ShowAlertAndButton2 (Act_Action_t NextAction,const char *Anchor,const char *OnSubmit,
|
||||
void (*FuncParams) (void *Args),void *Args,
|
||||
void (*FuncPars) (void *Args),void *Args,
|
||||
Btn_Button_t Button,const char *TxtButton)
|
||||
{
|
||||
/***** Optional button *****/
|
||||
|
@ -458,8 +458,8 @@ void Ale_ShowAlertAndButton2 (Act_Action_t NextAction,const char *Anchor,const c
|
|||
{
|
||||
/* Begin form */
|
||||
Frm_BeginFormAnchorOnSubmit (NextAction,Anchor,OnSubmit);
|
||||
if (FuncParams)
|
||||
FuncParams (Args);
|
||||
if (FuncPars)
|
||||
FuncPars (Args);
|
||||
|
||||
/* Put button */
|
||||
Btn_PutButton (Button,TxtButton);
|
||||
|
|
|
@ -70,16 +70,16 @@ void Ale_ShowAlertsAndExit ();
|
|||
void Ale_ShowAlerts (const char *Section);
|
||||
void Ale_ShowAlert (Ale_AlertType_t AlertType,const char *fmt,...);
|
||||
void Ale_ShowLastAlertAndButton (Act_Action_t NextAction,const char *Anchor,const char *OnSubmit,
|
||||
void (*FuncParams) (void *Args),void *Args,
|
||||
void (*FuncPars) (void *Args),void *Args,
|
||||
Btn_Button_t Button,const char *TxtButton);
|
||||
void Ale_ShowLastAlertAndButton1 (void);
|
||||
void Ale_ShowAlertAndButton (Act_Action_t NextAction,const char *Anchor,const char *OnSubmit,
|
||||
void (*FuncParams) (void *Args),void *Args,
|
||||
void (*FuncPars) (void *Args),void *Args,
|
||||
Btn_Button_t Button,const char *TxtButton,
|
||||
Ale_AlertType_t AlertType,const char *fmt,...);
|
||||
void Ale_ShowAlertAndButton1 (Ale_AlertType_t AlertType,const char *fmt,...);
|
||||
void Ale_ShowAlertAndButton2 (Act_Action_t NextAction,const char *Anchor,const char *OnSubmit,
|
||||
void (*FuncParams) (void *Args),void *Args,
|
||||
void (*FuncPars) (void *Args),void *Args,
|
||||
Btn_Button_t Button,const char *TxtButton);
|
||||
|
||||
void Ale_CreateAlertUserNotFoundOrYouDoNotHavePermission (void);
|
||||
|
|
|
@ -56,7 +56,7 @@ static void Ann_DrawAnAnnouncement (long AnnCod,Ann_Status_t Status,
|
|||
unsigned Roles,
|
||||
bool ShowAllAnnouncements,
|
||||
bool ICanEdit);
|
||||
static void Ann_PutParams (void *AnnCod);
|
||||
static void Ann_PutParAnnCod (void *AnnCod);
|
||||
static void Ann_PutSubjectMessage (const char *Field,const char *Label,
|
||||
unsigned Rows);
|
||||
|
||||
|
@ -245,11 +245,11 @@ static void Ann_DrawAnAnnouncement (long AnnCod,Ann_Status_t Status,
|
|||
{
|
||||
/***** Icon to remove announcement *****/
|
||||
Ico_PutContextualIconToRemove (ActRemAnn,NULL,
|
||||
Ann_PutParams,&AnnCod);
|
||||
Ann_PutParAnnCod,&AnnCod);
|
||||
|
||||
/***** Icon to hide/unhide the announcement *****/
|
||||
Ico_PutContextualIconToHideUnhide (ActionHideUnhide,NULL, // TODO: Put anchor
|
||||
Ann_PutParams,&AnnCod,
|
||||
Ann_PutParAnnCod,&AnnCod,
|
||||
Status == Ann_OBSOLETE_ANNOUNCEMENT);
|
||||
}
|
||||
|
||||
|
@ -287,7 +287,7 @@ static void Ann_DrawAnAnnouncement (long AnnCod,Ann_Status_t Status,
|
|||
else
|
||||
/***** Put form to mark announcement as seen *****/
|
||||
Lay_PutContextualLinkIconText (ActAnnSee,NULL,
|
||||
Ann_PutParams,&AnnCod,
|
||||
Ann_PutParAnnCod,&AnnCod,
|
||||
"times.svg",Ico_BLACK,
|
||||
Txt_Do_not_show_again,NULL);
|
||||
|
||||
|
@ -302,9 +302,10 @@ static void Ann_DrawAnAnnouncement (long AnnCod,Ann_Status_t Status,
|
|||
/******************** Params used to edit an assignment **********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Ann_PutParams (void *AnnCod)
|
||||
static void Ann_PutParAnnCod (void *AnnCod)
|
||||
{
|
||||
Par_PutParCode (Par_AnnCod,*((long *) AnnCod));
|
||||
if (AnnCod)
|
||||
Par_PutParCode (Par_AnnCod,*((long *) AnnCod));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -72,7 +72,7 @@ static bool Asg_CheckIfICanCreateAssignments (void);
|
|||
static void Asg_PutIconsListAssignments (void *Assignments);
|
||||
static void Asg_PutIconToCreateNewAsg (void *Assignments);
|
||||
static void Asg_PutButtonToCreateNewAsg (void *Assignments);
|
||||
static void Asg_ParamsWhichGroupsToShow (void *Assignments);
|
||||
static void Asg_ParsWhichGroupsToShow (void *Assignments);
|
||||
static void Asg_PutIconsOneAsg (void *Assignments);
|
||||
static void Asg_ShowAssignmentRow (struct Asg_Assignments *Assignments,
|
||||
bool OnlyOneAssignment,
|
||||
|
@ -82,7 +82,7 @@ static void Asg_WriteAssignmentFolder (struct Asg_Assignment *Asg,bool PrintView
|
|||
|
||||
static void Asg_PutIconsToRemEditOneAsg (struct Asg_Assignments *Assignments,
|
||||
const char *Anchor);
|
||||
static void Asg_PutParams (void *Assignments);
|
||||
static void Asg_PutPars (void *Assignments);
|
||||
static void Asg_GetListAssignments (struct Asg_Assignments *Assignments);
|
||||
static void Asg_GetDataOfAssignment (struct Asg_Assignment *Asg,
|
||||
MYSQL_RES **mysql_res,
|
||||
|
@ -123,9 +123,9 @@ void Asg_SeeAssignments (void)
|
|||
Asg_ResetAssignments (&Assignments);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Assignments.SelectedOrder = Asg_GetParamAsgOrder ();
|
||||
Gbl.Crs.Grps.WhichGrps = Grp_GetParamWhichGroups ();
|
||||
Assignments.CurrentPage = Pag_GetParamPagNum (Pag_ASSIGNMENTS);
|
||||
Assignments.SelectedOrder = Asg_GetParAsgOrder ();
|
||||
Gbl.Crs.Grps.WhichGrps = Grp_GetParWhichGroups ();
|
||||
Assignments.CurrentPage = Pag_GetParPagNum (Pag_ASSIGNMENTS);
|
||||
|
||||
/***** Show all assignments *****/
|
||||
Asg_ShowAllAssignments (&Assignments);
|
||||
|
@ -162,7 +162,7 @@ void Asg_ShowAllAssignments (struct Asg_Assignments *Assignments)
|
|||
{
|
||||
Set_BeginSettingsHead ();
|
||||
Grp_ShowFormToSelWhichGrps (ActSeeAsg,
|
||||
Asg_ParamsWhichGroupsToShow,Assignments);
|
||||
Asg_ParsWhichGroupsToShow,Assignments);
|
||||
Set_EndSettingsHead ();
|
||||
}
|
||||
|
||||
|
@ -243,9 +243,9 @@ static void Asg_PutHead (struct Asg_Assignments *Assignments,
|
|||
{
|
||||
/* Begin form */
|
||||
Frm_BeginForm (ActSeeAsg);
|
||||
WhichGroups = Grp_GetParamWhichGroups ();
|
||||
Grp_PutParamWhichGroups (&WhichGroups);
|
||||
Pag_PutHiddenParamPagNum (Pag_ASSIGNMENTS,Assignments->CurrentPage);
|
||||
WhichGroups = Grp_GetParWhichGroups ();
|
||||
Grp_PutParWhichGroups (&WhichGroups);
|
||||
Pag_PutParPagNum (Pag_ASSIGNMENTS,Assignments->CurrentPage);
|
||||
Par_PutParOrder ((unsigned) Order);
|
||||
|
||||
/* Begin link to select order */
|
||||
|
@ -306,7 +306,7 @@ static void Asg_PutIconsListAssignments (void *Assignments)
|
|||
{
|
||||
((struct Asg_Assignments *) Assignments)->Asg.AsgCod = -1L;
|
||||
Ico_PutContextualIconToGetLink (ActReqLnkAsg,NULL,
|
||||
Asg_PutParams,Assignments);
|
||||
Asg_PutPars,Assignments);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -323,7 +323,7 @@ static void Asg_PutIconToCreateNewAsg (void *Assignments)
|
|||
if (Assignments)
|
||||
{
|
||||
((struct Asg_Assignments *) Assignments)->Asg.AsgCod = -1L;
|
||||
Ico_PutContextualIconToAdd (ActFrmNewAsg,NULL,Asg_PutParams,Assignments);
|
||||
Ico_PutContextualIconToAdd (ActFrmNewAsg,NULL,Asg_PutPars,Assignments);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -340,7 +340,7 @@ static void Asg_PutButtonToCreateNewAsg (void *Assignments)
|
|||
/* Begin form */
|
||||
Frm_BeginForm (ActFrmNewAsg);
|
||||
((struct Asg_Assignments *) Assignments)->Asg.AsgCod = -1L;
|
||||
Asg_PutParams (Assignments);
|
||||
Asg_PutPars (Assignments);
|
||||
|
||||
/* Button to create new assignment */
|
||||
Btn_PutConfirmButton (Txt_New_assignment);
|
||||
|
@ -354,12 +354,12 @@ static void Asg_PutButtonToCreateNewAsg (void *Assignments)
|
|||
/**************** Put params to select which groups to show ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Asg_ParamsWhichGroupsToShow (void *Assignments)
|
||||
static void Asg_ParsWhichGroupsToShow (void *Assignments)
|
||||
{
|
||||
if (Assignments)
|
||||
{
|
||||
Par_PutParOrder ((unsigned) ((struct Asg_Assignments *) Assignments)->SelectedOrder);
|
||||
Pag_PutHiddenParamPagNum (Pag_ASSIGNMENTS,
|
||||
Pag_PutParPagNum (Pag_ASSIGNMENTS,
|
||||
((struct Asg_Assignments *) Assignments)->CurrentPage);
|
||||
}
|
||||
}
|
||||
|
@ -377,9 +377,9 @@ void Asg_SeeOneAssignment (void)
|
|||
Asg_ResetAssignments (&Assignments);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Assignments.SelectedOrder = Asg_GetParamAsgOrder ();
|
||||
Grp_GetParamWhichGroups ();
|
||||
Assignments.CurrentPage = Pag_GetParamPagNum (Pag_ASSIGNMENTS);
|
||||
Assignments.SelectedOrder = Asg_GetParAsgOrder ();
|
||||
Grp_GetParWhichGroups ();
|
||||
Assignments.CurrentPage = Pag_GetParPagNum (Pag_ASSIGNMENTS);
|
||||
|
||||
/***** Get the code of the assignment *****/
|
||||
Assignments.Asg.AsgCod = Par_GetAndCheckParCode (Par_AsgCod);
|
||||
|
@ -551,7 +551,7 @@ static void Asg_ShowAssignmentRow (struct Asg_Assignments *Assignments,
|
|||
|
||||
HTM_ARTICLE_Begin (Anchor);
|
||||
Frm_BeginForm (ActSeeOneAsg);
|
||||
Asg_PutParams (Assignments);
|
||||
Asg_PutPars (Assignments);
|
||||
HTM_BUTTON_Submit_Begin (Txt_Actions[ActSeeOneAsg],
|
||||
"class=\"LT BT_LINK %s_%s\"",
|
||||
Assignments->Asg.Hidden ? "ASG_TITLE_LIGHT" :
|
||||
|
@ -674,7 +674,7 @@ static void Asg_WriteAssignmentFolder (struct Asg_Assignment *Asg,bool PrintView
|
|||
Str_Copy (Gbl.FileBrowser.FilFolLnk.Name,Asg->Folder,
|
||||
sizeof (Gbl.FileBrowser.FilFolLnk.Name) - 1);
|
||||
Gbl.FileBrowser.FilFolLnk.Type = Brw_IS_FOLDER;
|
||||
Brw_PutImplicitParamsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
Brw_PutImplicitParsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
Ico_PutIconLink ("folder-open-yellow-plus.png",Ico_UNCHANGED,NextAction);
|
||||
|
||||
Frm_EndForm ();
|
||||
|
@ -708,13 +708,13 @@ static void Asg_WriteAssignmentFolder (struct Asg_Assignment *Asg,bool PrintView
|
|||
/******* Get parameter with the type or order in list of assignments *********/
|
||||
/*****************************************************************************/
|
||||
|
||||
Dat_StartEndTime_t Asg_GetParamAsgOrder (void)
|
||||
Dat_StartEndTime_t Asg_GetParAsgOrder (void)
|
||||
{
|
||||
return (Dat_StartEndTime_t)
|
||||
Par_GetParUnsignedLong ("Order",
|
||||
0,
|
||||
Dat_NUM_START_END_TIME - 1,
|
||||
(unsigned long) Asg_ORDER_DEFAULT);
|
||||
0,
|
||||
Dat_NUM_START_END_TIME - 1,
|
||||
(unsigned long) Asg_ORDER_DEFAULT);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -736,28 +736,28 @@ static void Asg_PutIconsToRemEditOneAsg (struct Asg_Assignments *Assignments,
|
|||
case Rol_SYS_ADM:
|
||||
/***** Icon to remove assignment *****/
|
||||
Ico_PutContextualIconToRemove (ActReqRemAsg,NULL,
|
||||
Asg_PutParams,Assignments);
|
||||
Asg_PutPars,Assignments);
|
||||
|
||||
/***** Icon to hide/unhide assignment *****/
|
||||
Ico_PutContextualIconToHideUnhide (ActionHideUnhide,Anchor,
|
||||
Asg_PutParams,Assignments,
|
||||
Asg_PutPars,Assignments,
|
||||
Assignments->Asg.Hidden);
|
||||
|
||||
/***** Icon to edit assignment *****/
|
||||
Ico_PutContextualIconToEdit (ActEdiOneAsg,NULL,
|
||||
Asg_PutParams,Assignments);
|
||||
Asg_PutPars,Assignments);
|
||||
|
||||
/***** Link to get resource link *****/
|
||||
if (PrgRsc_CheckIfICanGetLink ())
|
||||
Ico_PutContextualIconToGetLink (ActReqLnkAsg,NULL,
|
||||
Asg_PutParams,Assignments);
|
||||
Asg_PutPars,Assignments);
|
||||
/* falls through */
|
||||
/* no break */
|
||||
case Rol_STD:
|
||||
case Rol_NET:
|
||||
/***** Icon to print assignment *****/
|
||||
Ico_PutContextualIconToPrint (ActPrnOneAsg,
|
||||
Asg_PutParams,Assignments);
|
||||
Asg_PutPars,Assignments);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -768,7 +768,7 @@ static void Asg_PutIconsToRemEditOneAsg (struct Asg_Assignments *Assignments,
|
|||
/******************** Params used to edit an assignment **********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Asg_PutParams (void *Assignments)
|
||||
static void Asg_PutPars (void *Assignments)
|
||||
{
|
||||
Grp_WhichGroups_t WhichGroups;
|
||||
|
||||
|
@ -776,9 +776,9 @@ static void Asg_PutParams (void *Assignments)
|
|||
{
|
||||
Par_PutParCode (Par_AsgCod,((struct Asg_Assignments *) Assignments)->Asg.AsgCod);
|
||||
Par_PutParOrder ((unsigned) ((struct Asg_Assignments *) Assignments)->SelectedOrder);
|
||||
WhichGroups = Grp_GetParamWhichGroups ();
|
||||
Grp_PutParamWhichGroups (&WhichGroups);
|
||||
Pag_PutHiddenParamPagNum (Pag_ASSIGNMENTS,((struct Asg_Assignments *) Assignments)->CurrentPage);
|
||||
WhichGroups = Grp_GetParWhichGroups ();
|
||||
Grp_PutParWhichGroups (&WhichGroups);
|
||||
Pag_PutParPagNum (Pag_ASSIGNMENTS,((struct Asg_Assignments *) Assignments)->CurrentPage);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1017,9 +1017,9 @@ void Asg_ReqRemAssignment (void)
|
|||
Asg_ResetAssignments (&Assignments);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Assignments.SelectedOrder = Asg_GetParamAsgOrder ();
|
||||
Gbl.Crs.Grps.WhichGrps = Grp_GetParamWhichGroups ();
|
||||
Assignments.CurrentPage = Pag_GetParamPagNum (Pag_ASSIGNMENTS);
|
||||
Assignments.SelectedOrder = Asg_GetParAsgOrder ();
|
||||
Gbl.Crs.Grps.WhichGrps = Grp_GetParWhichGroups ();
|
||||
Assignments.CurrentPage = Pag_GetParPagNum (Pag_ASSIGNMENTS);
|
||||
|
||||
/***** Get assignment code *****/
|
||||
Assignments.Asg.AsgCod = Par_GetAndCheckParCode (Par_AsgCod);
|
||||
|
@ -1029,7 +1029,7 @@ void Asg_ReqRemAssignment (void)
|
|||
|
||||
/***** Show question and button to remove the assignment *****/
|
||||
Ale_ShowAlertAndButton (ActRemAsg,NULL,NULL,
|
||||
Asg_PutParams,&Assignments,
|
||||
Asg_PutPars,&Assignments,
|
||||
Btn_REMOVE_BUTTON,Txt_Remove_assignment,
|
||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_assignment_X,
|
||||
Assignments.Asg.Title);
|
||||
|
@ -1051,9 +1051,9 @@ void Asg_RemoveAssignment (void)
|
|||
Asg_ResetAssignments (&Assignments);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Assignments.SelectedOrder = Asg_GetParamAsgOrder ();
|
||||
Gbl.Crs.Grps.WhichGrps = Grp_GetParamWhichGroups ();
|
||||
Assignments.CurrentPage = Pag_GetParamPagNum (Pag_ASSIGNMENTS);
|
||||
Assignments.SelectedOrder = Asg_GetParAsgOrder ();
|
||||
Gbl.Crs.Grps.WhichGrps = Grp_GetParWhichGroups ();
|
||||
Assignments.CurrentPage = Pag_GetParPagNum (Pag_ASSIGNMENTS);
|
||||
|
||||
/***** Get assignment code *****/
|
||||
Assignments.Asg.AsgCod = Par_GetAndCheckParCode (Par_AsgCod);
|
||||
|
@ -1094,9 +1094,9 @@ void Asg_HideAssignment (void)
|
|||
Asg_ResetAssignments (&Assignments);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Assignments.SelectedOrder = Asg_GetParamAsgOrder ();
|
||||
Gbl.Crs.Grps.WhichGrps = Grp_GetParamWhichGroups ();
|
||||
Assignments.CurrentPage = Pag_GetParamPagNum (Pag_ASSIGNMENTS);
|
||||
Assignments.SelectedOrder = Asg_GetParAsgOrder ();
|
||||
Gbl.Crs.Grps.WhichGrps = Grp_GetParWhichGroups ();
|
||||
Assignments.CurrentPage = Pag_GetParPagNum (Pag_ASSIGNMENTS);
|
||||
|
||||
/***** Get assignment code *****/
|
||||
Assignments.Asg.AsgCod = Par_GetAndCheckParCode (Par_AsgCod);
|
||||
|
@ -1123,9 +1123,9 @@ void Asg_UnhideAssignment (void)
|
|||
Asg_ResetAssignments (&Assignments);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Assignments.SelectedOrder = Asg_GetParamAsgOrder ();
|
||||
Gbl.Crs.Grps.WhichGrps = Grp_GetParamWhichGroups ();
|
||||
Assignments.CurrentPage = Pag_GetParamPagNum (Pag_ASSIGNMENTS);
|
||||
Assignments.SelectedOrder = Asg_GetParAsgOrder ();
|
||||
Gbl.Crs.Grps.WhichGrps = Grp_GetParWhichGroups ();
|
||||
Assignments.CurrentPage = Pag_GetParPagNum (Pag_ASSIGNMENTS);
|
||||
|
||||
/***** Get assignment code *****/
|
||||
Assignments.Asg.AsgCod = Par_GetAndCheckParCode (Par_AsgCod);
|
||||
|
@ -1174,9 +1174,9 @@ void Asg_RequestCreatOrEditAsg (void)
|
|||
Asg_ResetAssignments (&Assignments);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Assignments.SelectedOrder = Asg_GetParamAsgOrder ();
|
||||
Grp_GetParamWhichGroups ();
|
||||
Assignments.CurrentPage = Pag_GetParamPagNum (Pag_ASSIGNMENTS);
|
||||
Assignments.SelectedOrder = Asg_GetParAsgOrder ();
|
||||
Grp_GetParWhichGroups ();
|
||||
Assignments.CurrentPage = Pag_GetParPagNum (Pag_ASSIGNMENTS);
|
||||
|
||||
/***** Get the code of the assignment *****/
|
||||
ItsANewAssignment = ((Assignments.Asg.AsgCod = Par_GetParCode (Par_AsgCod)) <= 0);
|
||||
|
@ -1214,7 +1214,7 @@ void Asg_RequestCreatOrEditAsg (void)
|
|||
Frm_BeginForm (ActChgAsg);
|
||||
// Assignments.Asg.AsgCod = Asg.AsgCod;
|
||||
}
|
||||
Asg_PutParams (&Assignments);
|
||||
Asg_PutPars (&Assignments);
|
||||
|
||||
/***** Begin box and table *****/
|
||||
if (ItsANewAssignment)
|
||||
|
@ -1394,9 +1394,9 @@ void Asg_ReceiveFormAssignment (void)
|
|||
Asg_ResetAssignments (&Assignments);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Assignments.SelectedOrder = Asg_GetParamAsgOrder ();
|
||||
Grp_GetParamWhichGroups ();
|
||||
Assignments.CurrentPage = Pag_GetParamPagNum (Pag_ASSIGNMENTS);
|
||||
Assignments.SelectedOrder = Asg_GetParAsgOrder ();
|
||||
Grp_GetParWhichGroups ();
|
||||
Assignments.CurrentPage = Pag_GetParPagNum (Pag_ASSIGNMENTS);
|
||||
|
||||
/***** Get the code of the assignment *****/
|
||||
ItsANewAssignment = ((Assignments.Asg.AsgCod = Par_GetParCode (Par_AsgCod)) <= 0);
|
||||
|
|
|
@ -88,7 +88,7 @@ void Asg_PrintOneAssignment (void);
|
|||
|
||||
void Asg_ShowOneAssignmentInBox (struct Asg_Assignments *Assignments);
|
||||
|
||||
Dat_StartEndTime_t Asg_GetParamAsgOrder (void);
|
||||
Dat_StartEndTime_t Asg_GetParAsgOrder (void);
|
||||
|
||||
void Asg_RequestCreatOrEditAsg (void);
|
||||
void Asg_GetDataOfAssignmentByCod (struct Asg_Assignment *Asg);
|
||||
|
|
|
@ -50,9 +50,9 @@ void AsgRsc_GetLinkToAssignment (void)
|
|||
Asg_ResetAssignments (&Assignments);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Assignments.SelectedOrder = Asg_GetParamAsgOrder ();
|
||||
Grp_GetParamWhichGroups ();
|
||||
Assignments.CurrentPage = Pag_GetParamPagNum (Pag_ASSIGNMENTS);
|
||||
Assignments.SelectedOrder = Asg_GetParAsgOrder ();
|
||||
Grp_GetParWhichGroups ();
|
||||
Assignments.CurrentPage = Pag_GetParPagNum (Pag_ASSIGNMENTS);
|
||||
|
||||
/***** Get assignment code *****/
|
||||
Assignments.Asg.AsgCod = Par_GetAndCheckParCode (Par_AsgCod);
|
||||
|
|
|
@ -86,28 +86,28 @@ typedef enum
|
|||
static void Att_ResetEvents (struct Att_Events *Events);
|
||||
|
||||
static void Att_ShowAllAttEvents (struct Att_Events *Events);
|
||||
static void Att_ParamsWhichGroupsToShow (void *Events);
|
||||
static void Att_ParsWhichGroupsToShow (void *Events);
|
||||
static void Att_PutIconsInListOfAttEvents (void *Events);
|
||||
static void Att_PutIconToCreateNewAttEvent (struct Att_Events *Events);
|
||||
static void Att_PutButtonToCreateNewAttEvent (struct Att_Events *Events);
|
||||
static void Att_PutParamsToCreateNewAttEvent (void *Events);
|
||||
static void Att_PutParamsToListUsrsAttendance (void *Events);
|
||||
static void Att_PutParsToCreateNewAttEvent (void *Events);
|
||||
static void Att_PutParsToListUsrsAttendance (void *Events);
|
||||
|
||||
static void Att_ShowOneAttEventRow (struct Att_Events *Events,
|
||||
bool ShowOnlyThisAttEventComplete);
|
||||
static void Att_WriteAttEventAuthor (struct Att_Event *Event);
|
||||
static Dat_StartEndTime_t Att_GetParamAttOrder (void);
|
||||
static Dat_StartEndTime_t Att_GetParAttOrder (void);
|
||||
|
||||
static void Att_PutFormsToRemEditOneAttEvent (struct Att_Events *Events,
|
||||
const char *Anchor);
|
||||
static void Att_PutParams (void *Events);
|
||||
static void Att_PutPars (void *Events);
|
||||
static void Att_GetListAttEvents (struct Att_Events *Events,
|
||||
Att_OrderNewestOldest_t OrderNewestOldest);
|
||||
static void Att_GetDataOfAttEventByCodAndCheckCrs (struct Att_Event *Event);
|
||||
static void Att_ResetAttendanceEvent (struct Att_Event *Event);
|
||||
static void Att_FreeListAttEvents (struct Att_Events *Events);
|
||||
|
||||
static void Att_PutParamSelectedAttCod (void *Events);
|
||||
static void Att_PutParAttCod (void *Events);
|
||||
|
||||
static void Att_ShowLstGrpsToEditAttEvent (long AttCod);
|
||||
static void Att_CreateGroups (long AttCod);
|
||||
|
@ -139,9 +139,9 @@ static void Att_ListOrPrintUsrsAttendanceCrs (void *TypeOfView);
|
|||
static void Att_GetListSelectedAttCods (struct Att_Events *Events);
|
||||
|
||||
static void Att_PutIconsMyAttList (void *Events);
|
||||
static void Att_PutFormToPrintMyListParams (void *Events);
|
||||
static void Att_PutFormToPrintMyListPars (void *Events);
|
||||
static void Att_PutIconsStdsAttList (void *Events);
|
||||
static void Att_PutParamsToPrintStdsList (void *Events);
|
||||
static void Att_PutParsToPrintStdsList (void *Events);
|
||||
|
||||
static void Att_PutButtonToShowDetails (const struct Att_Events *Events);
|
||||
static void Att_ListEventsToSelect (struct Att_Events *Events,
|
||||
|
@ -190,9 +190,9 @@ void Att_SeeAttEvents (void)
|
|||
Att_ResetEvents (&Events);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Events.SelectedOrder = Att_GetParamAttOrder ();
|
||||
Grp_GetParamWhichGroups ();
|
||||
Events.CurrentPage = Pag_GetParamPagNum (Pag_ATT_EVENTS);
|
||||
Events.SelectedOrder = Att_GetParAttOrder ();
|
||||
Grp_GetParWhichGroups ();
|
||||
Events.CurrentPage = Pag_GetParPagNum (Pag_ATT_EVENTS);
|
||||
|
||||
/***** Get list of attendance events *****/
|
||||
Att_GetListAttEvents (&Events,Att_NEWEST_FIRST);
|
||||
|
@ -237,7 +237,7 @@ static void Att_ShowAllAttEvents (struct Att_Events *Events)
|
|||
{
|
||||
Set_BeginSettingsHead ();
|
||||
Grp_ShowFormToSelWhichGrps (ActSeeAtt,
|
||||
Att_ParamsWhichGroupsToShow,&Events);
|
||||
Att_ParsWhichGroupsToShow,&Events);
|
||||
Set_EndSettingsHead ();
|
||||
}
|
||||
|
||||
|
@ -261,9 +261,9 @@ static void Att_ShowAllAttEvents (struct Att_Events *Events)
|
|||
HTM_TH_Begin (HTM_HEAD_LEFT);
|
||||
|
||||
Frm_BeginForm (ActSeeAtt);
|
||||
WhichGroups = Grp_GetParamWhichGroups ();
|
||||
Grp_PutParamWhichGroups (&WhichGroups);
|
||||
Pag_PutHiddenParamPagNum (Pag_ATT_EVENTS,Events->CurrentPage);
|
||||
WhichGroups = Grp_GetParWhichGroups ();
|
||||
Grp_PutParWhichGroups (&WhichGroups);
|
||||
Pag_PutParPagNum (Pag_ATT_EVENTS,Events->CurrentPage);
|
||||
Par_PutParOrder ((unsigned) Order);
|
||||
|
||||
HTM_BUTTON_Submit_Begin (Txt_START_END_TIME_HELP[Order],
|
||||
|
@ -326,12 +326,12 @@ static void Att_ShowAllAttEvents (struct Att_Events *Events)
|
|||
/***************** Put params to select which groups to show *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Att_ParamsWhichGroupsToShow (void *Events)
|
||||
static void Att_ParsWhichGroupsToShow (void *Events)
|
||||
{
|
||||
if (Events)
|
||||
{
|
||||
Par_PutParOrder ((unsigned) ((struct Att_Events *) Events)->SelectedOrder);
|
||||
Pag_PutHiddenParamPagNum (Pag_ATT_EVENTS,((struct Att_Events *) Events)->CurrentPage);
|
||||
Pag_PutParPagNum (Pag_ATT_EVENTS,((struct Att_Events *) Events)->CurrentPage);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -363,7 +363,7 @@ static void Att_PutIconsInListOfAttEvents (void *Events)
|
|||
case Rol_TCH:
|
||||
case Rol_SYS_ADM:
|
||||
Ico_PutContextualIconToShowAttendanceList (ActReqLstUsrAtt,
|
||||
Att_PutParamsToListUsrsAttendance,Events);
|
||||
Att_PutParsToListUsrsAttendance,Events);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -371,12 +371,12 @@ static void Att_PutIconsInListOfAttEvents (void *Events)
|
|||
|
||||
/***** Put icon to print my QR code *****/
|
||||
QR_PutLinkToPrintQRCode (ActPrnUsrQR,
|
||||
Usr_PutParamMyUsrCodEncrypted,Gbl.Usrs.Me.UsrDat.EnUsrCod);
|
||||
Usr_PutParMyUsrCodEncrypted,Gbl.Usrs.Me.UsrDat.EnUsrCod);
|
||||
|
||||
/***** Put icon to get resource link *****/
|
||||
if (PrgRsc_CheckIfICanGetLink ())
|
||||
Ico_PutContextualIconToGetLink (ActReqLnkAtt,NULL,
|
||||
Att_PutParams,Events);
|
||||
Att_PutPars,Events);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -387,7 +387,7 @@ static void Att_PutIconsInListOfAttEvents (void *Events)
|
|||
static void Att_PutIconToCreateNewAttEvent (struct Att_Events *Events)
|
||||
{
|
||||
Ico_PutContextualIconToAdd (ActFrmNewAtt,NULL,
|
||||
Att_PutParamsToCreateNewAttEvent,Events);
|
||||
Att_PutParsToCreateNewAttEvent,Events);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -400,7 +400,7 @@ static void Att_PutButtonToCreateNewAttEvent (struct Att_Events *Events)
|
|||
|
||||
/***** Begin form *****/
|
||||
Frm_BeginForm (ActFrmNewAtt);
|
||||
Att_PutParamsToCreateNewAttEvent (Events);
|
||||
Att_PutParsToCreateNewAttEvent (Events);
|
||||
|
||||
/***** Button to create new event *****/
|
||||
Btn_PutConfirmButton (Txt_New_event);
|
||||
|
@ -413,16 +413,16 @@ static void Att_PutButtonToCreateNewAttEvent (struct Att_Events *Events)
|
|||
/************** Put parameters to create a new attendance event **************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Att_PutParamsToCreateNewAttEvent (void *Events)
|
||||
static void Att_PutParsToCreateNewAttEvent (void *Events)
|
||||
{
|
||||
Grp_WhichGroups_t WhichGroups;
|
||||
|
||||
if (Events)
|
||||
{
|
||||
Par_PutParOrder ((unsigned) ((struct Att_Events *) Events)->SelectedOrder);
|
||||
WhichGroups = Grp_GetParamWhichGroups ();
|
||||
Grp_PutParamWhichGroups (&WhichGroups);
|
||||
Pag_PutHiddenParamPagNum (Pag_ATT_EVENTS,((struct Att_Events *) Events)->CurrentPage);
|
||||
WhichGroups = Grp_GetParWhichGroups ();
|
||||
Grp_PutParWhichGroups (&WhichGroups);
|
||||
Pag_PutParPagNum (Pag_ATT_EVENTS,((struct Att_Events *) Events)->CurrentPage);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -430,16 +430,16 @@ static void Att_PutParamsToCreateNewAttEvent (void *Events)
|
|||
/***************** Put parameters to list users attendance *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Att_PutParamsToListUsrsAttendance (void *Events)
|
||||
static void Att_PutParsToListUsrsAttendance (void *Events)
|
||||
{
|
||||
Grp_WhichGroups_t WhichGroups;
|
||||
|
||||
if (Events)
|
||||
{
|
||||
Par_PutParOrder ((unsigned) ((struct Att_Events *) Events)->SelectedOrder);
|
||||
WhichGroups = Grp_GetParamWhichGroups ();
|
||||
Grp_PutParamWhichGroups (&WhichGroups);
|
||||
Pag_PutHiddenParamPagNum (Pag_ATT_EVENTS,((struct Att_Events *) Events)->CurrentPage);
|
||||
WhichGroups = Grp_GetParWhichGroups ();
|
||||
Grp_PutParWhichGroups (&WhichGroups);
|
||||
Pag_PutParPagNum (Pag_ATT_EVENTS,((struct Att_Events *) Events)->CurrentPage);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -581,13 +581,13 @@ static void Att_WriteAttEventAuthor (struct Att_Event *Event)
|
|||
/**** Get parameter with the type or order in list of attendance events ******/
|
||||
/*****************************************************************************/
|
||||
|
||||
static Dat_StartEndTime_t Att_GetParamAttOrder (void)
|
||||
static Dat_StartEndTime_t Att_GetParAttOrder (void)
|
||||
{
|
||||
return (Dat_StartEndTime_t)
|
||||
Par_GetParUnsignedLong ("Order",
|
||||
0,
|
||||
Dat_NUM_START_END_TIME - 1,
|
||||
(unsigned long) Att_ORDER_DEFAULT);
|
||||
0,
|
||||
Dat_NUM_START_END_TIME - 1,
|
||||
(unsigned long) Att_ORDER_DEFAULT);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -607,22 +607,22 @@ static void Att_PutFormsToRemEditOneAttEvent (struct Att_Events *Events,
|
|||
{
|
||||
/***** Icon to remove attendance event *****/
|
||||
Ico_PutContextualIconToRemove (ActReqRemAtt,NULL,
|
||||
Att_PutParams,Events);
|
||||
Att_PutPars,Events);
|
||||
|
||||
/***** Icon to hide/unhide attendance event *****/
|
||||
Ico_PutContextualIconToHideUnhide (ActionHideUnhide,Anchor,
|
||||
Att_PutParams,Events,
|
||||
Att_PutPars,Events,
|
||||
Events->Event.Hidden);
|
||||
|
||||
/***** Icon to edit attendance event *****/
|
||||
Ico_PutContextualIconToEdit (ActEdiOneAtt,NULL,
|
||||
Att_PutParams,Events);
|
||||
Att_PutPars,Events);
|
||||
}
|
||||
|
||||
/***** Icon to get resource link *****/
|
||||
if (PrgRsc_CheckIfICanGetLink ())
|
||||
Ico_PutContextualIconToGetLink (ActReqLnkAtt,NULL,
|
||||
Att_PutParams,Events);
|
||||
Att_PutPars,Events);
|
||||
}
|
||||
|
||||
|
||||
|
@ -645,7 +645,7 @@ bool Att_CheckIfICanEditAttEvents (void)
|
|||
/***************** Params used to edit an attendance event *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Att_PutParams (void *Events)
|
||||
static void Att_PutPars (void *Events)
|
||||
{
|
||||
Grp_WhichGroups_t WhichGroups;
|
||||
|
||||
|
@ -653,9 +653,9 @@ static void Att_PutParams (void *Events)
|
|||
{
|
||||
Par_PutParCode (Par_AttCod,((struct Att_Events *) Events)->Event.AttCod);
|
||||
Par_PutParOrder ((unsigned) ((struct Att_Events *) Events)->SelectedOrder);
|
||||
WhichGroups = Grp_GetParamWhichGroups ();
|
||||
Grp_PutParamWhichGroups (&WhichGroups);
|
||||
Pag_PutHiddenParamPagNum (Pag_ATT_EVENTS,((struct Att_Events *) Events)->CurrentPage);
|
||||
WhichGroups = Grp_GetParWhichGroups ();
|
||||
Grp_PutParWhichGroups (&WhichGroups);
|
||||
Pag_PutParPagNum (Pag_ATT_EVENTS,((struct Att_Events *) Events)->CurrentPage);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -813,16 +813,6 @@ static void Att_FreeListAttEvents (struct Att_Events *Events)
|
|||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** Write parameter with code of attendance event ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Att_PutParamSelectedAttCod (void *Events)
|
||||
{
|
||||
if (Events)
|
||||
Par_PutParCode (Par_AttCod,((struct Att_Events *) Events)->Event.AttCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********* Ask for confirmation of removing of an attendance event ***********/
|
||||
/*****************************************************************************/
|
||||
|
@ -837,9 +827,9 @@ void Att_AskRemAttEvent (void)
|
|||
Att_ResetEvents (&Events);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Events.SelectedOrder = Att_GetParamAttOrder ();
|
||||
Grp_GetParamWhichGroups ();
|
||||
Events.CurrentPage = Pag_GetParamPagNum (Pag_ATT_EVENTS);
|
||||
Events.SelectedOrder = Att_GetParAttOrder ();
|
||||
Grp_GetParWhichGroups ();
|
||||
Events.CurrentPage = Pag_GetParPagNum (Pag_ATT_EVENTS);
|
||||
|
||||
/***** Get attendance event code *****/
|
||||
Events.Event.AttCod = Par_GetAndCheckParCode (Par_AttCod);
|
||||
|
@ -849,7 +839,7 @@ void Att_AskRemAttEvent (void)
|
|||
|
||||
/***** Show question and button to remove event *****/
|
||||
Ale_ShowAlertAndButton (ActRemAtt,NULL,NULL,
|
||||
Att_PutParams,&Events,
|
||||
Att_PutPars,&Events,
|
||||
Btn_REMOVE_BUTTON,Txt_Remove_event,
|
||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_event_X,
|
||||
Events.Event.Title);
|
||||
|
@ -974,9 +964,9 @@ void Att_RequestCreatOrEditAttEvent (void)
|
|||
Att_ResetEvents (&Events);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Events.SelectedOrder = Att_GetParamAttOrder ();
|
||||
Grp_GetParamWhichGroups ();
|
||||
Events.CurrentPage = Pag_GetParamPagNum (Pag_ATT_EVENTS);
|
||||
Events.SelectedOrder = Att_GetParAttOrder ();
|
||||
Grp_GetParWhichGroups ();
|
||||
Events.CurrentPage = Pag_GetParPagNum (Pag_ATT_EVENTS);
|
||||
|
||||
/***** Get the code of the attendance event *****/
|
||||
ItsANewAttEvent = ((Events.Event.AttCod = Par_GetParCode (Par_AttCod)) <= 0);
|
||||
|
@ -1013,9 +1003,9 @@ void Att_RequestCreatOrEditAttEvent (void)
|
|||
Par_PutParCode (Par_AttCod,Events.Event.AttCod);
|
||||
}
|
||||
Par_PutParOrder ((unsigned) Events.SelectedOrder);
|
||||
WhichGroups = Grp_GetParamWhichGroups ();
|
||||
Grp_PutParamWhichGroups (&WhichGroups);
|
||||
Pag_PutHiddenParamPagNum (Pag_ATT_EVENTS,Events.CurrentPage);
|
||||
WhichGroups = Grp_GetParWhichGroups ();
|
||||
Grp_PutParWhichGroups (&WhichGroups);
|
||||
Pag_PutParPagNum (Pag_ATT_EVENTS,Events.CurrentPage);
|
||||
|
||||
/***** Begin box and table *****/
|
||||
if (ItsANewAttEvent)
|
||||
|
@ -1460,9 +1450,9 @@ static void Att_ShowEvent (struct Att_Events *Events)
|
|||
extern const char *Txt_Event;
|
||||
|
||||
/***** Get parameters *****/
|
||||
Events->SelectedOrder = Att_GetParamAttOrder ();
|
||||
Grp_GetParamWhichGroups ();
|
||||
Events->CurrentPage = Pag_GetParamPagNum (Pag_ATT_EVENTS);
|
||||
Events->SelectedOrder = Att_GetParAttOrder ();
|
||||
Grp_GetParWhichGroups ();
|
||||
Events->CurrentPage = Pag_GetParPagNum (Pag_ATT_EVENTS);
|
||||
|
||||
/***** Get data of this attendance event *****/
|
||||
Att_GetDataOfAttEventByCodAndCheckCrs (&Events->Event);
|
||||
|
@ -1601,8 +1591,7 @@ static void Att_ListAttStudents (struct Att_Events *Events)
|
|||
Hlp_USERS_Attendance,Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Form to select groups *****/
|
||||
Grp_ShowFormToSelectSeveralGroups (Att_PutParamSelectedAttCod,Events,
|
||||
Grp_MY_GROUPS);
|
||||
Grp_ShowFormToSelectSeveralGroups (Att_PutParAttCod,Events,Grp_MY_GROUPS);
|
||||
|
||||
/***** Begin section with user list *****/
|
||||
HTM_SECTION_Begin (Usr_USER_LIST_SECTION_ID);
|
||||
|
@ -1618,7 +1607,7 @@ static void Att_ListAttStudents (struct Att_Events *Events)
|
|||
/* Begin form */
|
||||
Frm_BeginForm (ActRecAttStd);
|
||||
Par_PutParCode (Par_AttCod,Events->Event.AttCod);
|
||||
Grp_PutParamsCodGrps ();
|
||||
Grp_PutParsCodGrps ();
|
||||
|
||||
/* Begin table */
|
||||
HTM_TABLE_BeginWideMarginPadding (2);
|
||||
|
@ -1678,6 +1667,16 @@ static void Att_ListAttStudents (struct Att_Events *Events)
|
|||
Grp_FreeListCodSelectedGrps ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** Write parameter with code of attendance event ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Att_PutParAttCod (void *Events)
|
||||
{
|
||||
if (Events)
|
||||
Par_PutParCode (Par_AttCod,((struct Att_Events *) Events)->Event.AttCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** Write a row of a table with the data of a user ***************/
|
||||
/*****************************************************************************/
|
||||
|
@ -1852,7 +1851,7 @@ static void Att_PutLinkAttEvent (struct Att_Event *Event,
|
|||
/***** Begin form *****/
|
||||
Frm_BeginForm (ActSeeOneAtt);
|
||||
Par_PutParCode (Par_AttCod,Event->AttCod);
|
||||
Att_PutParamsCodGrps (Event->AttCod);
|
||||
Att_PutParsCodGrps (Event->AttCod);
|
||||
|
||||
/***** Link to view attendance event *****/
|
||||
HTM_BUTTON_Submit_Begin (Title,"class=\"LT BT_LINK %s_%s\"",
|
||||
|
@ -1870,7 +1869,7 @@ static void Att_PutLinkAttEvent (struct Att_Event *Event,
|
|||
/****** Put parameters with the default groups in an attendance event ********/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Att_PutParamsCodGrps (long AttCod)
|
||||
void Att_PutParsCodGrps (long AttCod)
|
||||
{
|
||||
extern const char *Par_SEPARATOR_PARAM_MULTIPLE;
|
||||
MYSQL_RES *mysql_res;
|
||||
|
@ -1930,7 +1929,7 @@ void Att_RegisterMeAsStdInAttEvent (void)
|
|||
extern const char *Txt_Your_comment_has_been_updated;
|
||||
struct Att_Events Events;
|
||||
bool Present;
|
||||
char *ParamName;
|
||||
char *ParName;
|
||||
char CommentStd[Cns_MAX_BYTES_TEXT + 1];
|
||||
char CommentTch[Cns_MAX_BYTES_TEXT + 1];
|
||||
|
||||
|
@ -1946,10 +1945,10 @@ void Att_RegisterMeAsStdInAttEvent (void)
|
|||
/***** Get comments for this student *****/
|
||||
Present = Att_CheckIfUsrIsPresentInAttEventAndGetComments (Events.Event.AttCod,Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||
CommentStd,CommentTch);
|
||||
if (asprintf (&ParamName,"CommentStd%s",Gbl.Usrs.Me.UsrDat.EnUsrCod) < 0)
|
||||
if (asprintf (&ParName,"CommentStd%s",Gbl.Usrs.Me.UsrDat.EnUsrCod) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
Par_GetParHTML (ParamName,CommentStd,Cns_MAX_BYTES_TEXT);
|
||||
free (ParamName);
|
||||
Par_GetParHTML (ParName,CommentStd,Cns_MAX_BYTES_TEXT);
|
||||
free (ParName);
|
||||
|
||||
if (Present ||
|
||||
CommentStd[0] ||
|
||||
|
@ -1990,7 +1989,7 @@ void Att_RegisterStudentsInAttEvent (void)
|
|||
unsigned NumUsr;
|
||||
const char *Ptr;
|
||||
bool Present;
|
||||
char *ParamName;
|
||||
char *ParName;
|
||||
unsigned NumStdsPresent;
|
||||
unsigned NumStdsAbsent;
|
||||
struct Usr_Data UsrData;
|
||||
|
@ -2031,7 +2030,7 @@ void Att_RegisterStudentsInAttEvent (void)
|
|||
Ptr = Gbl.Usrs.Selected.List[Rol_STD];
|
||||
while (*Ptr)
|
||||
{
|
||||
Par_GetNextStrUntilSeparParamMult (&Ptr,UsrData.EnUsrCod,
|
||||
Par_GetNextStrUntilSeparParMult (&Ptr,UsrData.EnUsrCod,
|
||||
Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64);
|
||||
Usr_GetUsrCodFromEncryptedUsrCod (&UsrData);
|
||||
if (UsrData.UsrCod > 0) // Student exists in database
|
||||
|
@ -2064,11 +2063,11 @@ void Att_RegisterStudentsInAttEvent (void)
|
|||
Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].UsrCod,
|
||||
CommentStd,
|
||||
CommentTch);
|
||||
if (asprintf (&ParamName,"CommentTch%s",
|
||||
if (asprintf (&ParName,"CommentTch%s",
|
||||
Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].EnUsrCod) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
Par_GetParHTML (ParamName,CommentTch,Cns_MAX_BYTES_TEXT);
|
||||
free (ParamName);
|
||||
Par_GetParHTML (ParName,CommentTch,Cns_MAX_BYTES_TEXT);
|
||||
free (ParName);
|
||||
|
||||
Present = !Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].Remove;
|
||||
|
||||
|
@ -2492,7 +2491,7 @@ static void Att_GetListSelectedAttCods (struct Att_Events *Events)
|
|||
)
|
||||
{
|
||||
/* Get next attendance event selected */
|
||||
Par_GetNextStrUntilSeparParamMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
Par_GetNextStrUntilSeparParMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
AttCod = Str_ConvertStrCodToLongCod (LongStr);
|
||||
|
||||
/* Set each event in *StrAttCodsSelected as selected */
|
||||
|
@ -2568,15 +2567,15 @@ static void Att_PutIconsMyAttList (void *Events)
|
|||
{
|
||||
/***** Put icon to print my assistance (as student) to several events *****/
|
||||
Ico_PutContextualIconToPrint (ActPrnLstMyAtt,
|
||||
Att_PutFormToPrintMyListParams,Events);
|
||||
Att_PutFormToPrintMyListPars,Events);
|
||||
|
||||
/***** Put icon to print my QR code *****/
|
||||
QR_PutLinkToPrintQRCode (ActPrnUsrQR,
|
||||
Usr_PutParamMyUsrCodEncrypted,Gbl.Usrs.Me.UsrDat.EnUsrCod);
|
||||
Usr_PutParMyUsrCodEncrypted,Gbl.Usrs.Me.UsrDat.EnUsrCod);
|
||||
}
|
||||
}
|
||||
|
||||
static void Att_PutFormToPrintMyListParams (void *Events)
|
||||
static void Att_PutFormToPrintMyListPars (void *Events)
|
||||
{
|
||||
if (Events)
|
||||
{
|
||||
|
@ -2598,22 +2597,22 @@ static void Att_PutIconsStdsAttList (void *Events)
|
|||
{
|
||||
/***** Put icon to print assistance of students to several events *****/
|
||||
Ico_PutContextualIconToPrint (ActPrnLstUsrAtt,
|
||||
Att_PutParamsToPrintStdsList,Events);
|
||||
Att_PutParsToPrintStdsList,Events);
|
||||
|
||||
/***** Put icon to print my QR code *****/
|
||||
QR_PutLinkToPrintQRCode (ActPrnUsrQR,
|
||||
Usr_PutParamMyUsrCodEncrypted,Gbl.Usrs.Me.UsrDat.EnUsrCod);
|
||||
Usr_PutParMyUsrCodEncrypted,Gbl.Usrs.Me.UsrDat.EnUsrCod);
|
||||
}
|
||||
}
|
||||
|
||||
static void Att_PutParamsToPrintStdsList (void *Events)
|
||||
static void Att_PutParsToPrintStdsList (void *Events)
|
||||
{
|
||||
if (Events)
|
||||
{
|
||||
if (((struct Att_Events *) Events)->ShowDetails)
|
||||
Par_PutParChar ("ShowDetails",'Y');
|
||||
Grp_PutParamsCodGrps ();
|
||||
Usr_PutHiddenParSelectedUsrsCods (&Gbl.Usrs.Selected);
|
||||
Grp_PutParsCodGrps ();
|
||||
Usr_PutParSelectedUsrsCods (&Gbl.Usrs.Selected);
|
||||
if (((struct Att_Events *) Events)->StrAttCodsSelected)
|
||||
if (((struct Att_Events *) Events)->StrAttCodsSelected[0])
|
||||
Par_PutParString (NULL,"AttCods",((struct Att_Events *) Events)->StrAttCodsSelected);
|
||||
|
@ -2632,8 +2631,8 @@ static void Att_PutButtonToShowDetails (const struct Att_Events *Events)
|
|||
/* Begin form */
|
||||
Frm_BeginFormAnchor (Gbl.Action.Act,Att_ATTENDANCE_DETAILS_ID);
|
||||
Par_PutParChar ("ShowDetails",'Y');
|
||||
Grp_PutParamsCodGrps ();
|
||||
Usr_PutHiddenParSelectedUsrsCods (&Gbl.Usrs.Selected);
|
||||
Grp_PutParsCodGrps ();
|
||||
Usr_PutParSelectedUsrsCods (&Gbl.Usrs.Selected);
|
||||
if (Events->StrAttCodsSelected)
|
||||
if (Events->StrAttCodsSelected[0])
|
||||
Par_PutParString (NULL,"AttCods",Events->StrAttCodsSelected);
|
||||
|
@ -2688,8 +2687,8 @@ static void Att_ListEventsToSelect (struct Att_Events *Events,
|
|||
if (NormalView)
|
||||
{
|
||||
Frm_BeginFormAnchor (Gbl.Action.Act,Att_ATTENDANCE_TABLE_ID);
|
||||
Grp_PutParamsCodGrps ();
|
||||
Usr_PutHiddenParSelectedUsrsCods (&Gbl.Usrs.Selected);
|
||||
Grp_PutParsCodGrps ();
|
||||
Usr_PutParSelectedUsrsCods (&Gbl.Usrs.Selected);
|
||||
}
|
||||
|
||||
/***** Begin table *****/
|
||||
|
|
|
@ -106,7 +106,7 @@ unsigned Att_GetNumAttEvents (HieLvl_Level_t Scope,unsigned *NumNotif);
|
|||
|
||||
void Att_SeeOneAttEvent (void);
|
||||
|
||||
void Att_PutParamsCodGrps (long AttCod);
|
||||
void Att_PutParsCodGrps (long AttCod);
|
||||
|
||||
void Att_RegisterMeAsStdInAttEvent (void);
|
||||
void Att_RegisterStudentsInAttEvent (void);
|
||||
|
|
|
@ -82,7 +82,7 @@ void AttRsc_WriteAttEventInCrsProgram (long AttCod,bool PutFormToGo,
|
|||
ActSeeAtt; // All attendance events
|
||||
Frm_BeginForm (NextAction);
|
||||
Par_PutParCode (Par_AttCod,AttCod);
|
||||
Att_PutParamsCodGrps (AttCod);
|
||||
Att_PutParsCodGrps (AttCod);
|
||||
HTM_BUTTON_Submit_Begin (Txt_Actions[NextAction],
|
||||
"class=\"LM BT_LINK PRG_LNK_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
|
|
@ -476,7 +476,7 @@ static ALn_LinkType_t ALn_CheckNickname (char **PtrSrc,char PrevCh,
|
|||
};
|
||||
char Ch;
|
||||
size_t Length;
|
||||
char ParamsStr[Frm_MAX_BYTES_PARAMS_STR + 1];
|
||||
char ParsStr[Frm_MAX_BYTES_PARAMS_STR + 1];
|
||||
struct Usr_Data UsrDat;
|
||||
bool ShowPhoto = false;
|
||||
char PhotoURL[Cns_MAX_BYTES_WWW + 1];
|
||||
|
@ -540,14 +540,14 @@ static ALn_LinkType_t ALn_CheckNickname (char **PtrSrc,char PrevCh,
|
|||
(*Link)->NickAnchor[2].Str = NULL;
|
||||
|
||||
/***** Store first part of anchor *****/
|
||||
Frm_SetParamsForm (ParamsStr,ActSeeOthPubPrf,true);
|
||||
Frm_SetParsForm (ParsStr,ActSeeOthPubPrf,true);
|
||||
if (asprintf (&(*Link)->NickAnchor[0].Str,
|
||||
"<form method=\"post\" action=\"%s/%s\">"
|
||||
"%s" // Parameters
|
||||
"<input type=\"hidden\" name=\"usr\" value=\"",
|
||||
Cfg_URL_SWAD_CGI,
|
||||
Lan_STR_LANG_ID[Gbl.Prefs.Language],
|
||||
ParamsStr) < 0)
|
||||
ParsStr) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
(*Link)->NickAnchor[0].Len = strlen ((*Link)->NickAnchor[0].Str);
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ static void Ban_FreeListBanners (struct Ban_Banners *Banners);
|
|||
static void Ban_PutIconsEditingBanners (__attribute__((unused)) void *Args);
|
||||
|
||||
static void Ban_ListBannersForEdition (struct Ban_Banners *Banners);
|
||||
static void Ban_PutParamBanCodToEdit (void *BanCod);
|
||||
static void Ban_PutParBanCod (void *BanCod);
|
||||
static void Ban_ShowOrHideBanner (struct Ban_Banner *Ban,bool Hide);
|
||||
|
||||
static void Ban_RenameBanner (struct Ban_Banner *Ban,
|
||||
|
@ -425,14 +425,14 @@ static void Ban_ListBannersForEdition (struct Ban_Banners *Banners)
|
|||
/* Icon to remove banner */
|
||||
HTM_TD_Begin ("class=\"BM\"");
|
||||
Ico_PutContextualIconToRemove (ActRemBan,NULL,
|
||||
Ban_PutParamBanCodToEdit,
|
||||
Ban_PutParBanCod,
|
||||
&Banners->BanCodToEdit);
|
||||
HTM_TD_End ();
|
||||
|
||||
/* Icon to hide/unhide banner */
|
||||
HTM_TD_Begin ("class=\"BM\"");
|
||||
Ico_PutContextualIconToHideUnhide (ActionHideUnhide,Anchor,
|
||||
Ban_PutParamBanCodToEdit,
|
||||
Ban_PutParBanCod,
|
||||
&Banners->BanCodToEdit,
|
||||
Ban->Hidden);
|
||||
HTM_TD_End ();
|
||||
|
@ -450,7 +450,7 @@ static void Ban_ListBannersForEdition (struct Ban_Banners *Banners)
|
|||
/* Banner short name */
|
||||
HTM_TD_Begin ("class=\"CM\"");
|
||||
Frm_BeginForm (ActRenBanSho);
|
||||
Ban_PutParamBanCodToEdit (&Banners->BanCodToEdit);
|
||||
Par_PutParCode (Par_BanCod,Banners->BanCodToEdit);
|
||||
HTM_INPUT_TEXT ("ShortName",Ban_MAX_CHARS_SHRT_NAME,Ban->ShrtName,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"class=\"INPUT_SHORT_NAME INPUT_%s\"",
|
||||
|
@ -461,7 +461,7 @@ static void Ban_ListBannersForEdition (struct Ban_Banners *Banners)
|
|||
/* Banner full name */
|
||||
HTM_TD_Begin ("class=\"CM\"");
|
||||
Frm_BeginForm (ActRenBanFul);
|
||||
Ban_PutParamBanCodToEdit (&Banners->BanCodToEdit);
|
||||
Par_PutParCode (Par_BanCod,Banners->BanCodToEdit);
|
||||
HTM_INPUT_TEXT ("FullName",Ban_MAX_CHARS_FULL_NAME,Ban->FullName,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"class=\"INPUT_FULL_NAME INPUT_%s\"",
|
||||
|
@ -472,7 +472,7 @@ static void Ban_ListBannersForEdition (struct Ban_Banners *Banners)
|
|||
/* Banner image */
|
||||
HTM_TD_Begin ("class=\"CM\"");
|
||||
Frm_BeginForm (ActChgBanImg);
|
||||
Ban_PutParamBanCodToEdit (&Banners->BanCodToEdit);
|
||||
Par_PutParCode (Par_BanCod,Banners->BanCodToEdit);
|
||||
HTM_INPUT_TEXT ("Img",Ban_MAX_CHARS_IMAGE,Ban->Img,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"size=\"12\" class=\"INPUT_%s\"",
|
||||
|
@ -483,7 +483,7 @@ static void Ban_ListBannersForEdition (struct Ban_Banners *Banners)
|
|||
/* Banner WWW */
|
||||
HTM_TD_Begin ("class=\"CM\"");
|
||||
Frm_BeginForm (ActChgBanWWW);
|
||||
Ban_PutParamBanCodToEdit (&Banners->BanCodToEdit);
|
||||
Par_PutParCode (Par_BanCod,Banners->BanCodToEdit);
|
||||
HTM_INPUT_URL ("WWW",Ban->WWW,HTM_SUBMIT_ON_CHANGE,
|
||||
"class=\"INPUT_WWW_NARROW INPUT_%s\""
|
||||
" required=\"required\"",
|
||||
|
@ -505,7 +505,7 @@ static void Ban_ListBannersForEdition (struct Ban_Banners *Banners)
|
|||
/******************* Write parameter with code of banner *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Ban_PutParamBanCodToEdit (void *BanCod)
|
||||
static void Ban_PutParBanCod (void *BanCod)
|
||||
{
|
||||
if (BanCod)
|
||||
Par_PutParCode (Par_BanCod,*((long *) BanCod));
|
||||
|
@ -625,23 +625,23 @@ static void Ban_RenameBanner (struct Ban_Banner *Ban,
|
|||
extern const char *Txt_The_banner_X_already_exists;
|
||||
extern const char *Txt_The_banner_X_has_been_renamed_as_Y;
|
||||
extern const char *Txt_The_name_X_has_not_changed;
|
||||
const char *ParamName = NULL; // Initialized to avoid warning
|
||||
const char *FieldName = NULL; // Initialized to avoid warning
|
||||
unsigned MaxBytes = 0; // Initialized to avoid warning
|
||||
char *CurrentBanName = NULL; // Initialized to avoid warning
|
||||
const char *ParName = NULL; // Initialized to avoid warning
|
||||
const char *FldName = NULL; // Initialized to avoid warning
|
||||
unsigned MaxBytes = 0; // Initialized to avoid warning
|
||||
char *CurrentBanName = NULL; // Initialized to avoid warning
|
||||
char NewBanName[Ban_MAX_BYTES_FULL_NAME + 1];
|
||||
|
||||
switch (ShrtOrFullName)
|
||||
{
|
||||
case Cns_SHRT_NAME:
|
||||
ParamName = "ShortName";
|
||||
FieldName = "ShortName";
|
||||
ParName = "ShortName";
|
||||
FldName = "ShortName";
|
||||
MaxBytes = Ban_MAX_BYTES_SHRT_NAME;
|
||||
CurrentBanName = Ban->ShrtName;
|
||||
break;
|
||||
case Cns_FULL_NAME:
|
||||
ParamName = "FullName";
|
||||
FieldName = "FullName";
|
||||
ParName = "FullName";
|
||||
FldName = "FullName";
|
||||
MaxBytes = Ban_MAX_BYTES_FULL_NAME;
|
||||
CurrentBanName = Ban->FullName;
|
||||
break;
|
||||
|
@ -652,7 +652,7 @@ static void Ban_RenameBanner (struct Ban_Banner *Ban,
|
|||
Ban->BanCod = Par_GetAndCheckParCode (Par_BanCod);
|
||||
|
||||
/* Get the new name for the banner */
|
||||
Par_GetParText (ParamName,NewBanName,MaxBytes);
|
||||
Par_GetParText (ParName,NewBanName,MaxBytes);
|
||||
|
||||
/***** Get banner data from the database *****/
|
||||
Ban_GetDataOfBannerByCod (Ban);
|
||||
|
@ -667,14 +667,14 @@ static void Ban_RenameBanner (struct Ban_Banner *Ban,
|
|||
if (strcmp (CurrentBanName,NewBanName)) // Different names
|
||||
{
|
||||
/***** If banner was in database... *****/
|
||||
if (Ban_DB_CheckIfBannerNameExists (ParamName,NewBanName,Ban->BanCod))
|
||||
if (Ban_DB_CheckIfBannerNameExists (ParName,NewBanName,Ban->BanCod))
|
||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||
Txt_The_banner_X_already_exists,
|
||||
NewBanName);
|
||||
else
|
||||
{
|
||||
/* Update the table changing old name by new name */
|
||||
Ban_DB_UpdateBanName (Ban->BanCod,FieldName,NewBanName);
|
||||
Ban_DB_UpdateBanName (Ban->BanCod,FldName,NewBanName);
|
||||
|
||||
/* Write message to show the change made */
|
||||
Ale_CreateAlert (Ale_SUCCESS,NULL,
|
||||
|
|
|
@ -62,7 +62,6 @@ void Ban_EditBanners (void);
|
|||
void Ban_PutIconToViewBanners (void);
|
||||
|
||||
void Ban_GetDataOfBannerByCod (struct Ban_Banner *Ban);
|
||||
long Ban_GetParamLnkCod (void);
|
||||
void Ban_RemoveBanner (void);
|
||||
void Ban_ShowBanner (void);
|
||||
void Ban_HideBanner (void);
|
||||
|
|
|
@ -120,7 +120,7 @@ unsigned Ban_DB_GetDataOfBannerByCod (MYSQL_RES **mysql_res,long BanCod)
|
|||
/********************* Check if the name of banner exists ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
bool Ban_DB_CheckIfBannerNameExists (const char *FieldName,const char *Name,long BanCod)
|
||||
bool Ban_DB_CheckIfBannerNameExists (const char *FldName,const char *Name,long BanCod)
|
||||
{
|
||||
return
|
||||
DB_QueryEXISTS ("can not check if the name of a banner already existed",
|
||||
|
@ -129,7 +129,7 @@ bool Ban_DB_CheckIfBannerNameExists (const char *FieldName,const char *Name,long
|
|||
" FROM ban_banners"
|
||||
" WHERE %s='%s'"
|
||||
" AND BanCod<>%ld)",
|
||||
FieldName,Name,
|
||||
FldName,Name,
|
||||
BanCod);
|
||||
}
|
||||
|
||||
|
@ -170,14 +170,14 @@ void Ban_DB_HideOrUnhideBanner (long BanCod,bool Hide)
|
|||
/***************** Update banner name in table of banners ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Ban_DB_UpdateBanName (long BanCod,const char *FieldName,
|
||||
void Ban_DB_UpdateBanName (long BanCod,const char *FldName,
|
||||
const char *NewBanName)
|
||||
{
|
||||
DB_QueryUPDATE ("can not update the name of a banner",
|
||||
"UPDATE ban_banners"
|
||||
" SET %s='%s'"
|
||||
" WHERE BanCod=%ld",
|
||||
FieldName,NewBanName,
|
||||
FldName,NewBanName,
|
||||
BanCod);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,11 +39,11 @@ unsigned Ban_DB_GetAllBanners (MYSQL_RES **mysql_res);
|
|||
unsigned Ban_DB_GetVisibleBanners (MYSQL_RES **mysql_res);
|
||||
unsigned Ban_DB_GetRandomBanners (MYSQL_RES **mysql_res);
|
||||
unsigned Ban_DB_GetDataOfBannerByCod (MYSQL_RES **mysql_res,long BanCod);
|
||||
bool Ban_DB_CheckIfBannerNameExists (const char *FieldName,const char *Name,long BanCod);
|
||||
bool Ban_DB_CheckIfBannerNameExists (const char *FldName,const char *Name,long BanCod);
|
||||
|
||||
void Ban_DB_CreateBanner (const struct Ban_Banner *Ban);
|
||||
void Ban_DB_HideOrUnhideBanner (long BanCod,bool Hide);
|
||||
void Ban_DB_UpdateBanName (long BanCod,const char *FieldName,
|
||||
void Ban_DB_UpdateBanName (long BanCod,const char *FldName,
|
||||
const char *NewBanName);
|
||||
void Ban_DB_UpdateBanImg (long BanCod,
|
||||
const char NewImg[Ban_MAX_BYTES_IMAGE + 1]);
|
||||
|
|
202
swad_browser.c
202
swad_browser.c
|
@ -146,7 +146,7 @@ const char *Brw_RootFolderInternalNames[Brw_NUM_TYPES_FILE_BROWSER] =
|
|||
/***************************** Private constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static const char *Brw_FileTypeParamName[Brw_NUM_FILE_TYPES] =
|
||||
static const char *Brw_FileTypeParName[Brw_NUM_FILE_TYPES] =
|
||||
{
|
||||
[Brw_IS_UNKNOWN] = "BrwFFL",
|
||||
[Brw_IS_FILE ] = "BrwFil", // Do not use Fil_NAME_OF_PARAM_FILENAME_ORG
|
||||
|
@ -1060,7 +1060,7 @@ bool Brw_ICanEditFileOrFolder; // Can I modify (remove, rename, create inside, e
|
|||
static long Brw_GetGrpSettings (void);
|
||||
static void Brw_GetDataCurrentGrp (void);
|
||||
|
||||
static void Brw_GetParamsPathInTreeAndFileName (void);
|
||||
static void Brw_GetParsPathInTreeAndFileName (void);
|
||||
static void Brw_SetPathFileBrowser (void);
|
||||
static void Brw_CreateFoldersAssignmentsIfNotExist (long ZoneUsrCod);
|
||||
|
||||
|
@ -1083,7 +1083,7 @@ static void Brw_WriteSubtitleOfFileBrowser (void);
|
|||
static void Brw_InitHiddenLevels (void);
|
||||
|
||||
static void Brw_PutCheckboxFullTree (void);
|
||||
static void Brw_PutParamsFullTree (void);
|
||||
static void Brw_PutParsFullTree (void);
|
||||
static bool Brw_GetFullTreeFromForm (void);
|
||||
|
||||
static bool Brw_GetIfGroupFileBrowser (void);
|
||||
|
@ -1171,7 +1171,7 @@ static bool Brw_RcvFileInFileBrw (struct BrwSiz_BrowserSize *Size,
|
|||
static bool Brw_CheckIfUploadIsAllowed (const char *FileType);
|
||||
|
||||
static void Brw_PutIconToGetLinkToFile (void *FileMetadata);
|
||||
static void Brw_PutParamsToGetLinkToFile (void *FileMetadata);
|
||||
static void Brw_PutParsToGetLinkToFile (void *FileMetadata);
|
||||
|
||||
static bool Brw_CheckIfICanEditFileMetadata (long IAmTheOwner);
|
||||
static bool Brw_CheckIfIAmOwnerOfFile (long PublisherUsrCod);
|
||||
|
@ -1181,7 +1181,7 @@ static void Brw_WriteBigLinkToDownloadFile (const char *URL,
|
|||
static void Brw_WriteSmallLinkToDownloadFile (const char *URL,
|
||||
struct Brw_FileMetadata *FileMetadata,
|
||||
const char *FileNameToShow);
|
||||
static bool Brw_GetParamPublicFile (void);
|
||||
static bool Brw_GetParPublicFile (void);
|
||||
static Brw_License_t Brw_GetParLicense (void);
|
||||
static void Brw_GetFileViewsFromLoggedUsrs (struct Brw_FileMetadata *FileMetadata);
|
||||
static unsigned Brw_GetFileViewsFromMe (long FilCod);
|
||||
|
@ -1859,7 +1859,7 @@ void Brw_GetParAndInitFileBrowser (void)
|
|||
}
|
||||
|
||||
/***** Get the path in the file browser and the name of the file or folder *****/
|
||||
Brw_GetParamsPathInTreeAndFileName ();
|
||||
Brw_GetParsPathInTreeAndFileName ();
|
||||
Brw_SetFullPathInTree ();
|
||||
|
||||
/***** Get other parameters *****/
|
||||
|
@ -1871,7 +1871,7 @@ void Brw_GetParAndInitFileBrowser (void)
|
|||
/* Get lists of the selected users if not already got */
|
||||
Usr_GetListsSelectedEncryptedUsrsCods (&Gbl.Usrs.Selected);
|
||||
/* Get user whose folder will be used to make any operation */
|
||||
Usr_GetParamOtherUsrCodEncryptedAndGetListIDs ();
|
||||
Usr_GetParOtherUsrCodEncryptedAndGetListIDs ();
|
||||
/* Get whether we must create the zip file or not */
|
||||
Gbl.FileBrowser.ZIP.CreateZIP = ZIP_GetCreateZIPFromForm ();
|
||||
}
|
||||
|
@ -2079,39 +2079,39 @@ static void Brw_GetDataCurrentGrp (void)
|
|||
/**************** Write parameters related with file browser *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Brw_PutImplicitParamsFileBrowser (void *FilFolLnk)
|
||||
void Brw_PutImplicitParsFileBrowser (void *FilFolLnk)
|
||||
{
|
||||
if (FilFolLnk)
|
||||
Brw_PutParamsFileBrowser (((struct Brw_FilFolLnk *) FilFolLnk)->Path,
|
||||
((struct Brw_FilFolLnk *) FilFolLnk)->Name,
|
||||
((struct Brw_FilFolLnk *) FilFolLnk)->Type,
|
||||
-1L); // Not used
|
||||
Brw_PutParsFileBrowser (((struct Brw_FilFolLnk *) FilFolLnk)->Path,
|
||||
((struct Brw_FilFolLnk *) FilFolLnk)->Name,
|
||||
((struct Brw_FilFolLnk *) FilFolLnk)->Type,
|
||||
-1L); // Not used
|
||||
}
|
||||
|
||||
void Brw_PutParamsFileBrowser (const char *PathInTree,const char *FilFolLnkName,
|
||||
Brw_FileType_t FileType,long FilCod)
|
||||
void Brw_PutParsFileBrowser (const char *PathInTree,const char *FilFolLnkName,
|
||||
Brw_FileType_t FileType,long FilCod)
|
||||
{
|
||||
if (Brw_GetIfGroupFileBrowser ()) // This file browser needs specify a group
|
||||
/***** Group code *****/
|
||||
Grp_PutParamGrpCod (&Gbl.Crs.Grps.GrpCod);
|
||||
Par_PutParCode (Par_GrpCod,Gbl.Crs.Grps.GrpCod);
|
||||
else if (Brw_GetIfProjectFileBrowser ()) // This file browser needs specify a project
|
||||
/***** Project code *****/
|
||||
Prj_PutParamPrjCod (Prj_GetPrjCod ());
|
||||
Par_PutParCode (Par_PrjCod,Prj_GetPrjCod ());
|
||||
else if (Brw_GetIfCrsAssigWorksFileBrowser ())
|
||||
{
|
||||
/***** Users selected *****/
|
||||
Usr_PutHiddenParSelectedUsrsCods (&Gbl.Usrs.Selected);
|
||||
Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod);
|
||||
Usr_PutParSelectedUsrsCods (&Gbl.Usrs.Selected);
|
||||
Usr_PutParOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod);
|
||||
}
|
||||
|
||||
/***** If full tree selected? *****/
|
||||
Brw_PutHiddenParamFullTreeIfSelected (&Gbl.FileBrowser.FullTree);
|
||||
Brw_PutParFullTreeIfSelected (&Gbl.FileBrowser.FullTree);
|
||||
|
||||
/***** Path and file *****/
|
||||
if (PathInTree)
|
||||
Par_PutParString (NULL,"Path",PathInTree);
|
||||
if (FilFolLnkName)
|
||||
Par_PutParString (NULL,Brw_FileTypeParamName[FileType],FilFolLnkName);
|
||||
Par_PutParString (NULL,Brw_FileTypeParName[FileType],FilFolLnkName);
|
||||
Par_PutParCode (Par_FilCod,FilCod);
|
||||
}
|
||||
|
||||
|
@ -2119,7 +2119,7 @@ void Brw_PutParamsFileBrowser (const char *PathInTree,const char *FilFolLnkName,
|
|||
/************** Get parameters path and file in file browser *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Brw_GetParamsPathInTreeAndFileName (void)
|
||||
static void Brw_GetParsPathInTreeAndFileName (void)
|
||||
{
|
||||
const char *Ptr;
|
||||
unsigned i;
|
||||
|
@ -2141,7 +2141,7 @@ static void Brw_GetParamsPathInTreeAndFileName (void)
|
|||
FileType <= (Brw_FileType_t) (Brw_NUM_FILE_TYPES - 1);
|
||||
FileType++)
|
||||
// File names with heading and trailing spaces are allowed
|
||||
if (Par_GetParAndChangeFormat (Brw_FileTypeParamName[FileType],
|
||||
if (Par_GetParAndChangeFormat (Brw_FileTypeParName[FileType],
|
||||
Gbl.FileBrowser.FilFolLnk.Name,
|
||||
NAME_MAX,Str_TO_TEXT,false))
|
||||
{
|
||||
|
@ -2752,7 +2752,7 @@ static void Brw_ShowFileBrowsersAsgWrkCrs (void)
|
|||
Ptr = Gbl.Usrs.Selected.List[Rol_UNK];
|
||||
while (*Ptr)
|
||||
{
|
||||
Par_GetNextStrUntilSeparParamMult (&Ptr,Gbl.Usrs.Other.UsrDat.EnUsrCod,
|
||||
Par_GetNextStrUntilSeparParMult (&Ptr,Gbl.Usrs.Other.UsrDat.EnUsrCod,
|
||||
Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64);
|
||||
Usr_GetUsrCodFromEncryptedUsrCod (&Gbl.Usrs.Other.UsrDat);
|
||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,
|
||||
|
@ -2840,7 +2840,7 @@ static void Brw_FormToChangeCrsGrpZone (void)
|
|||
|
||||
/***** Begin form *****/
|
||||
Frm_BeginForm (Brw_ActChgZone[Gbl.FileBrowser.Type]);
|
||||
Brw_PutHiddenParamFullTreeIfSelected (&Gbl.FileBrowser.FullTree);
|
||||
Brw_PutParFullTreeIfSelected (&Gbl.FileBrowser.FullTree);
|
||||
|
||||
/***** List start *****/
|
||||
HTM_UL_Begin ("class=\"LIST_LEFT\"");
|
||||
|
@ -2961,7 +2961,7 @@ static void Brw_ShowDataOwnerAsgWrk (struct Usr_Data *UsrDat)
|
|||
if (!NextAction[UsrDat->Roles.InCurrentCrs])
|
||||
Err_WrongRoleExit ();
|
||||
Frm_BeginForm (NextAction[UsrDat->Roles.InCurrentCrs]);
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
|
||||
/***** Show user's ID *****/
|
||||
ID_WriteUsrIDs (UsrDat,NULL);
|
||||
|
@ -3283,11 +3283,11 @@ static void Brw_PutIconsFileBrowser (__attribute__((unused)) void *Args)
|
|||
break;
|
||||
case Brw_ICON_VIEW:
|
||||
Ico_PutContextualIconToView (Brw_ActFromAdmToSee[Gbl.FileBrowser.Type],NULL,
|
||||
Brw_PutHiddenParamFullTreeIfSelected,&Gbl.FileBrowser.FullTree);
|
||||
Brw_PutParFullTreeIfSelected,&Gbl.FileBrowser.FullTree);
|
||||
break;
|
||||
case Brw_ICON_EDIT:
|
||||
Ico_PutContextualIconToEdit (Brw_ActFromSeeToAdm[Gbl.FileBrowser.Type],NULL,
|
||||
Brw_PutHiddenParamFullTreeIfSelected,&Gbl.FileBrowser.FullTree);
|
||||
Brw_PutParFullTreeIfSelected,&Gbl.FileBrowser.FullTree);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3331,7 +3331,7 @@ static void Brw_PutButtonToShowEdit (void)
|
|||
if (Brw_ActFromAdmToSee[Gbl.FileBrowser.Type] != ActUnk)
|
||||
{
|
||||
Frm_BeginForm (Brw_ActFromAdmToSee[Gbl.FileBrowser.Type]);
|
||||
Brw_PutHiddenParamFullTreeIfSelected (&Gbl.FileBrowser.FullTree);
|
||||
Brw_PutParFullTreeIfSelected (&Gbl.FileBrowser.FullTree);
|
||||
Btn_PutConfirmButton (Act_GetActionText (Brw_ActFromAdmToSee[Gbl.FileBrowser.Type]));
|
||||
Frm_EndForm ();
|
||||
}
|
||||
|
@ -3340,7 +3340,7 @@ static void Brw_PutButtonToShowEdit (void)
|
|||
if (Brw_ActFromSeeToAdm[Gbl.FileBrowser.Type] != ActUnk)
|
||||
{
|
||||
Frm_BeginForm (Brw_ActFromSeeToAdm[Gbl.FileBrowser.Type]);
|
||||
Brw_PutHiddenParamFullTreeIfSelected (&Gbl.FileBrowser.FullTree);
|
||||
Brw_PutParFullTreeIfSelected (&Gbl.FileBrowser.FullTree);
|
||||
Btn_PutConfirmButton (Act_GetActionText (Brw_ActFromSeeToAdm[Gbl.FileBrowser.Type]));
|
||||
Frm_EndForm ();
|
||||
}
|
||||
|
@ -3647,27 +3647,27 @@ static void Brw_PutCheckboxFullTree (void)
|
|||
extern const char *Txt_Show_all_files;
|
||||
|
||||
Lay_PutContextualCheckbox (Brw_ActSeeAdm[Gbl.FileBrowser.Type],
|
||||
Brw_PutParamsFullTree,
|
||||
Brw_PutParsFullTree,
|
||||
"FullTree",
|
||||
Gbl.FileBrowser.FullTree,false,
|
||||
Txt_Show_all_files,Txt_Show_all_files);
|
||||
}
|
||||
|
||||
static void Brw_PutParamsFullTree (void)
|
||||
static void Brw_PutParsFullTree (void)
|
||||
{
|
||||
if (Brw_GetIfGroupFileBrowser ())
|
||||
Grp_PutParamGrpCod (&Gbl.Crs.Grps.GrpCod);
|
||||
Par_PutParCode (Par_GrpCod,Gbl.Crs.Grps.GrpCod);
|
||||
else if (Brw_GetIfProjectFileBrowser ()) // This file browser needs specify a project
|
||||
Prj_PutParamPrjCod (Prj_GetPrjCod ());
|
||||
Par_PutParCode (Par_PrjCod,Prj_GetPrjCod ());
|
||||
else if (Brw_GetIfCrsAssigWorksFileBrowser ())
|
||||
Usr_PutHiddenParSelectedUsrsCods (&Gbl.Usrs.Selected);
|
||||
Usr_PutParSelectedUsrsCods (&Gbl.Usrs.Selected);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********* Put hidden parameter "full tree" if full tree is selected *********/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Brw_PutHiddenParamFullTreeIfSelected (void *FullTree)
|
||||
void Brw_PutParFullTreeIfSelected (void *FullTree)
|
||||
{
|
||||
if (FullTree)
|
||||
if (*((bool *) FullTree)) // Put hidden parameter only if full tree selected
|
||||
|
@ -4334,12 +4334,12 @@ static void Brw_PutIconRemove (void)
|
|||
case Brw_IS_LINK:
|
||||
/***** Form to remove a file or link *****/
|
||||
Ico_PutContextualIconToRemove (Brw_ActAskRemoveFile[Gbl.FileBrowser.Type],NULL,
|
||||
Brw_PutImplicitParamsFileBrowser,&Gbl.FileBrowser.FilFolLnk);
|
||||
Brw_PutImplicitParsFileBrowser,&Gbl.FileBrowser.FilFolLnk);
|
||||
break;
|
||||
case Brw_IS_FOLDER:
|
||||
/***** Form to remove a folder *****/
|
||||
Ico_PutContextualIconToRemove (Brw_ActRemoveFolder[Gbl.FileBrowser.Type],NULL,
|
||||
Brw_PutImplicitParamsFileBrowser,&Gbl.FileBrowser.FilFolLnk);
|
||||
Brw_PutImplicitParsFileBrowser,&Gbl.FileBrowser.FilFolLnk);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -4360,7 +4360,7 @@ static void Brw_PutIconCopy (void)
|
|||
|
||||
/***** Form to copy into the clipboard *****/
|
||||
Ico_PutContextualIconToCopy (Brw_ActCopy[Gbl.FileBrowser.Type],
|
||||
Brw_PutImplicitParamsFileBrowser,&Gbl.FileBrowser.FilFolLnk);
|
||||
Brw_PutImplicitParsFileBrowser,&Gbl.FileBrowser.FilFolLnk);
|
||||
|
||||
HTM_TD_End ();
|
||||
}
|
||||
|
@ -4382,7 +4382,7 @@ static void Brw_PutIconPaste (unsigned Level)
|
|||
{
|
||||
/***** Form to paste the content of the clipboard *****/
|
||||
Ico_PutContextualIconToPaste (Brw_ActPaste[Gbl.FileBrowser.Type],
|
||||
Brw_PutImplicitParamsFileBrowser,&Gbl.FileBrowser.FilFolLnk);
|
||||
Brw_PutImplicitParsFileBrowser,&Gbl.FileBrowser.FilFolLnk);
|
||||
}
|
||||
else
|
||||
/* Icon to paste inactive */
|
||||
|
@ -4480,7 +4480,7 @@ static void Brw_PutIconToExpandFolder (const char *FileBrowserId,const char *Row
|
|||
Frm_BeginFormAnchorOnSubmit (Brw_ActExpandFolder[Gbl.FileBrowser.Type],
|
||||
FileBrowserId,
|
||||
JavaScriptFuncToExpandFolder); // JavaScript function to unhide rows
|
||||
Brw_PutImplicitParamsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
Brw_PutImplicitParsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
Ico_PutIconLink ("caret-right.svg",Ico_BLACK,
|
||||
Brw_ActExpandFolder[Gbl.FileBrowser.Type]);
|
||||
Frm_EndForm ();
|
||||
|
@ -4513,7 +4513,7 @@ static void Brw_PutIconToContractFolder (const char *FileBrowserId,const char *R
|
|||
Frm_BeginFormAnchorOnSubmit (Brw_ActContractFolder[Gbl.FileBrowser.Type],
|
||||
FileBrowserId,
|
||||
JavaScriptFuncToContractFolder); // JavaScript function to hide rows
|
||||
Brw_PutImplicitParamsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
Brw_PutImplicitParsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
Ico_PutIconLink ("caret-down.svg",Ico_BLACK,
|
||||
Brw_ActContractFolder[Gbl.FileBrowser.Type]);
|
||||
Frm_EndForm ();
|
||||
|
@ -4530,7 +4530,7 @@ static void Brw_PutIconHideUnhide (const char *Anchor,bool RowSetAsHidden)
|
|||
{
|
||||
HTM_TD_Begin ("class=\"BM %s\"",The_GetColorRows ());
|
||||
Ico_PutContextualIconToHideUnhide (Brw_ActHideUnhide[Gbl.FileBrowser.Type],Anchor,
|
||||
Brw_PutImplicitParamsFileBrowser,&Gbl.FileBrowser.FilFolLnk,
|
||||
Brw_PutImplicitParsFileBrowser,&Gbl.FileBrowser.FilFolLnk,
|
||||
RowSetAsHidden);
|
||||
HTM_TD_End ();
|
||||
}
|
||||
|
@ -4671,7 +4671,7 @@ static void Brw_PutIconFolderWithPlus (const char *FileBrowserId,const char *Row
|
|||
|
||||
/***** Form and icon *****/
|
||||
Ico_PutContextualIconToCreateInFolder (Brw_ActFormCreate[Gbl.FileBrowser.Type],
|
||||
Brw_PutImplicitParamsFileBrowser,&Gbl.FileBrowser.FilFolLnk,
|
||||
Brw_PutImplicitParsFileBrowser,&Gbl.FileBrowser.FilFolLnk,
|
||||
Open);
|
||||
|
||||
/***** End container *****/
|
||||
|
@ -4703,10 +4703,10 @@ static void Brw_PutIconFileWithLinkToViewMetadata (const struct Brw_FileMetadata
|
|||
|
||||
/***** Begin form *****/
|
||||
Frm_BeginForm (Brw_ActReqDatFile[Gbl.FileBrowser.Type]);
|
||||
Brw_PutParamsFileBrowser (NULL, // Not used
|
||||
NULL, // Not used
|
||||
Brw_IS_UNKNOWN, // Not used
|
||||
FileMetadata->FilCod);
|
||||
Brw_PutParsFileBrowser (NULL, // Not used
|
||||
NULL, // Not used
|
||||
Brw_IS_UNKNOWN, // Not used
|
||||
FileMetadata->FilCod);
|
||||
|
||||
/***** Icon depending on the file extension *****/
|
||||
if (FileMetadata->FilFolLnk.Type == Brw_IS_FILE)
|
||||
|
@ -4786,7 +4786,7 @@ static void Brw_PutButtonToDownloadZIPOfAFolder (void)
|
|||
{
|
||||
/***** Form to zip and download folder *****/
|
||||
Ico_PutContextualIconToZIP (Brw_ActZIPFolder[Gbl.FileBrowser.Type],
|
||||
Brw_PutImplicitParamsFileBrowser,&Gbl.FileBrowser.FilFolLnk);
|
||||
Brw_PutImplicitParsFileBrowser,&Gbl.FileBrowser.FilFolLnk);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -4824,7 +4824,7 @@ static void Brw_WriteFileName (unsigned Level,bool IsPublic)
|
|||
{
|
||||
/***** Form to rename folder *****/
|
||||
Frm_BeginForm (Brw_ActRenameFolder[Gbl.FileBrowser.Type]);
|
||||
Brw_PutImplicitParamsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
Brw_PutImplicitParsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
HTM_INPUT_TEXT ("NewFolderName",Brw_MAX_CHARS_FOLDER,Gbl.FileBrowser.FilFolLnk.Name,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"class=\"LST_EDIT %s_%s %s\"",
|
||||
|
@ -4867,7 +4867,7 @@ static void Brw_WriteFileName (unsigned Level,bool IsPublic)
|
|||
HTM_NBSP ();
|
||||
|
||||
Frm_BeginForm (Brw_ActDowFile[Gbl.FileBrowser.Type]);
|
||||
Brw_PutImplicitParamsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
Brw_PutImplicitParsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
|
||||
/* Link to the form and to the file */
|
||||
HTM_BUTTON_Submit_Begin ((Gbl.FileBrowser.Type == Brw_SHOW_MRK_CRS ||
|
||||
|
@ -5102,7 +5102,7 @@ void Brw_AskRemFileFromTree (void)
|
|||
Gbl.FileBrowser.FilFolLnk.Name,
|
||||
FileNameToShow);
|
||||
Ale_ShowAlertAndButton (Brw_ActRemoveFile[Gbl.FileBrowser.Type],NULL,NULL,
|
||||
Brw_PutImplicitParamsFileBrowser,&Gbl.FileBrowser.FilFolLnk,
|
||||
Brw_PutImplicitParsFileBrowser,&Gbl.FileBrowser.FilFolLnk,
|
||||
Btn_REMOVE_BUTTON,
|
||||
Gbl.FileBrowser.FilFolLnk.Type == Brw_IS_FILE ? Txt_Remove_file :
|
||||
Txt_Remove_link,
|
||||
|
@ -5234,7 +5234,7 @@ static void Brw_AskConfirmRemoveFolderNotEmpty (void)
|
|||
|
||||
/***** Show question and button to remove not empty folder *****/
|
||||
Ale_ShowAlertAndButton (Brw_ActRemoveFolderNotEmpty[Gbl.FileBrowser.Type],NULL,NULL,
|
||||
Brw_PutImplicitParamsFileBrowser,&Gbl.FileBrowser.FilFolLnk,
|
||||
Brw_PutImplicitParsFileBrowser,&Gbl.FileBrowser.FilFolLnk,
|
||||
Btn_REMOVE_BUTTON,Txt_Remove_folder,
|
||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_folder_X,
|
||||
Gbl.FileBrowser.FilFolLnk.Name);
|
||||
|
@ -6436,7 +6436,7 @@ static void Brw_PutFormToCreateAFolder (const char FileNameToShow[NAME_MAX + 1])
|
|||
|
||||
/***** Begin form *****/
|
||||
Frm_BeginForm (Brw_ActCreateFolder[Gbl.FileBrowser.Type]);
|
||||
Brw_PutImplicitParamsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
Brw_PutImplicitParsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
|
||||
/***** Begin box *****/
|
||||
Box_BoxBegin (NULL,Txt_Create_folder,
|
||||
|
@ -6499,7 +6499,7 @@ static void Brw_PutFormToUploadFilesUsingDropzone (const char *FileNameToShow)
|
|||
Cfg_URL_ICON_PUBLIC);
|
||||
Par_PutParLong (NULL,"act",Act_GetActCod (Brw_ActUploadFileDropzone[Gbl.FileBrowser.Type]));
|
||||
Par_PutParString (NULL,"ses",Gbl.Session.Id);
|
||||
Brw_PutImplicitParamsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
Brw_PutImplicitParsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
|
||||
HTM_DIV_Begin ("class=\"dz-message\"");
|
||||
HTM_SPAN_Begin ("class=\"DAT_LIGHT_%s\"",
|
||||
|
@ -6512,10 +6512,10 @@ static void Brw_PutFormToUploadFilesUsingDropzone (const char *FileNameToShow)
|
|||
|
||||
/***** Put button to refresh file browser after upload *****/
|
||||
Frm_BeginForm (Brw_ActRefreshAfterUploadFiles[Gbl.FileBrowser.Type]);
|
||||
Brw_PutParamsFileBrowser (NULL, // Not used
|
||||
NULL, // Not used
|
||||
Brw_IS_UNKNOWN, // Not used
|
||||
-1L); // Not used
|
||||
Brw_PutParsFileBrowser (NULL, // Not used
|
||||
NULL, // Not used
|
||||
Brw_IS_UNKNOWN, // Not used
|
||||
-1L); // Not used
|
||||
|
||||
/***** Button to send *****/
|
||||
Btn_PutConfirmButton (Txt_Done);
|
||||
|
@ -6549,7 +6549,7 @@ static void Brw_PutFormToUploadOneFileClassic (const char *FileNameToShow)
|
|||
|
||||
/***** Form to upload one files using the classic way *****/
|
||||
Frm_BeginForm (Brw_ActUploadFileClassic[Gbl.FileBrowser.Type]);
|
||||
Brw_PutImplicitParamsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
Brw_PutImplicitParsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
|
||||
/* File */
|
||||
HTM_INPUT_FILE (Fil_NAME_OF_PARAM_FILENAME_ORG,"*",
|
||||
|
@ -6577,7 +6577,7 @@ static void Brw_PutFormToPasteAFileOrFolder (const char *FileNameToShow)
|
|||
|
||||
/***** Begin form *****/
|
||||
Frm_BeginForm (Brw_ActPaste[Gbl.FileBrowser.Type]);
|
||||
Brw_PutImplicitParamsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
Brw_PutImplicitParsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
|
||||
/***** Begin box *****/
|
||||
Box_BoxBegin (NULL,Txt_Paste,
|
||||
|
@ -6610,7 +6610,7 @@ static void Brw_PutFormToCreateALink (const char *FileNameToShow)
|
|||
|
||||
/***** Begin form *****/
|
||||
Frm_BeginForm (Brw_ActCreateLink[Gbl.FileBrowser.Type]);
|
||||
Brw_PutImplicitParamsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
Brw_PutImplicitParsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
|
||||
/***** Begin box *****/
|
||||
Box_BoxBegin (NULL,Txt_Create_link,
|
||||
|
@ -6940,7 +6940,7 @@ static bool Brw_RcvFileInFileBrw (struct BrwSiz_BrowserSize *Size,
|
|||
extern const char *Txt_The_file_X_has_been_placed_inside_the_folder_Y;
|
||||
extern const char *Txt_UPLOAD_FILE_You_must_specify_the_file_NO_HTML;
|
||||
extern const char *Txt_UPLOAD_FILE_Forbidden_NO_HTML;
|
||||
struct Param *Param;
|
||||
struct Par_Param *Par;
|
||||
char SrcFileName[PATH_MAX + 1];
|
||||
char PathUntilFileName[PATH_MAX + 1];
|
||||
char Path[PATH_MAX + 1 + PATH_MAX + 1];
|
||||
|
@ -6964,8 +6964,8 @@ static bool Brw_RcvFileInFileBrw (struct BrwSiz_BrowserSize *Size,
|
|||
if (Brw_CheckIfICanCreateIntoFolder (Gbl.FileBrowser.Level))
|
||||
{
|
||||
/***** First, we save in disk the file received *****/
|
||||
Param = Fil_StartReceptionOfFile (Fil_NAME_OF_PARAM_FILENAME_ORG,
|
||||
SrcFileName,MIMEType);
|
||||
Par = Fil_StartReceptionOfFile (Fil_NAME_OF_PARAM_FILENAME_ORG,
|
||||
SrcFileName,MIMEType);
|
||||
|
||||
/***** Get filename from path *****/
|
||||
// Spaces at start or end are allowed
|
||||
|
@ -6999,7 +6999,7 @@ static bool Brw_RcvFileInFileBrw (struct BrwSiz_BrowserSize *Size,
|
|||
{
|
||||
/* End receiving the file */
|
||||
snprintf (PathTmp,sizeof (PathTmp),"%s.tmp",Path);
|
||||
FileIsValid = Fil_EndReceptionOfFile (PathTmp,Param);
|
||||
FileIsValid = Fil_EndReceptionOfFile (PathTmp,Par);
|
||||
|
||||
/* Check if the content of the file of marks is valid */
|
||||
if (FileIsValid)
|
||||
|
@ -7586,10 +7586,10 @@ void Brw_ShowFileMetadata (void)
|
|||
}
|
||||
|
||||
Frm_BeginForm (Brw_ActRecDatFile[Gbl.FileBrowser.Type]);
|
||||
Brw_PutParamsFileBrowser (NULL, // Not used
|
||||
NULL, // Not used
|
||||
Brw_IS_UNKNOWN, // Not used
|
||||
FileMetadata.FilCod);
|
||||
Brw_PutParsFileBrowser (NULL, // Not used
|
||||
NULL, // Not used
|
||||
Brw_IS_UNKNOWN, // Not used
|
||||
FileMetadata.FilCod);
|
||||
}
|
||||
|
||||
/***** Begin table *****/
|
||||
|
@ -7871,16 +7871,16 @@ void Brw_ShowFileMetadata (void)
|
|||
static void Brw_PutIconToGetLinkToFile (void *FileMetadata)
|
||||
{
|
||||
Ico_PutContextualIconToGetLink (Brw_ActReqLnk[Gbl.FileBrowser.Type],NULL,
|
||||
Brw_PutParamsToGetLinkToFile,FileMetadata);
|
||||
Brw_PutParsToGetLinkToFile,FileMetadata);
|
||||
}
|
||||
|
||||
static void Brw_PutParamsToGetLinkToFile (void *FileMetadata)
|
||||
static void Brw_PutParsToGetLinkToFile (void *FileMetadata)
|
||||
{
|
||||
if (FileMetadata)
|
||||
Brw_PutParamsFileBrowser (NULL, // Not used
|
||||
NULL, // Not used
|
||||
Brw_IS_UNKNOWN, // Not used
|
||||
((struct Brw_FileMetadata *) FileMetadata)->FilCod);
|
||||
Brw_PutParsFileBrowser (NULL, // Not used
|
||||
NULL, // Not used
|
||||
Brw_IS_UNKNOWN, // Not used
|
||||
((struct Brw_FileMetadata *) FileMetadata)->FilCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -8170,7 +8170,7 @@ static void Brw_WriteBigLinkToDownloadFile (const char *URL,
|
|||
Str_Copy (Gbl.FileBrowser.FilFolLnk.Name,FileMetadata->FilFolLnk.Name,
|
||||
sizeof (Gbl.FileBrowser.FilFolLnk.Name) - 1);
|
||||
Gbl.FileBrowser.FilFolLnk.Type = FileMetadata->FilFolLnk.Type;
|
||||
Brw_PutImplicitParamsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
Brw_PutImplicitParsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
|
||||
/* Begin link */
|
||||
HTM_BUTTON_Submit_Begin (Txt_Check_marks_in_the_file,
|
||||
|
@ -8236,7 +8236,7 @@ static void Brw_WriteSmallLinkToDownloadFile (const char *URL,
|
|||
Str_Copy (Gbl.FileBrowser.FilFolLnk.Name,FileMetadata->FilFolLnk.Name,
|
||||
sizeof (Gbl.FileBrowser.FilFolLnk.Name) - 1);
|
||||
Gbl.FileBrowser.FilFolLnk.Type = FileMetadata->FilFolLnk.Type;
|
||||
Brw_PutImplicitParamsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
Brw_PutImplicitParsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
|
||||
/* Begin link */
|
||||
HTM_BUTTON_Submit_Begin (Txt_Check_marks_in_the_file,
|
||||
|
@ -8304,7 +8304,7 @@ void Brw_ChgFileMetadata (void)
|
|||
case Brw_ADMI_SHR_DEG:
|
||||
case Brw_ADMI_DOC_CRS:
|
||||
case Brw_ADMI_SHR_CRS:
|
||||
PublicFileAfterEdition = Brw_GetParamPublicFile ();
|
||||
PublicFileAfterEdition = Brw_GetParPublicFile ();
|
||||
License = Brw_GetParLicense ();
|
||||
break;
|
||||
case Brw_ADMI_DOC_GRP:
|
||||
|
@ -8385,7 +8385,7 @@ void Brw_ChgFileMetadata (void)
|
|||
/*********** Get parameter with public / private file from form *************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static bool Brw_GetParamPublicFile (void)
|
||||
static bool Brw_GetParPublicFile (void)
|
||||
{
|
||||
return Par_GetParBool ("PublicFile");
|
||||
}
|
||||
|
@ -8398,9 +8398,9 @@ static Brw_License_t Brw_GetParLicense (void)
|
|||
{
|
||||
return (Brw_License_t)
|
||||
Par_GetParUnsignedLong ("License",
|
||||
0,
|
||||
Brw_NUM_LICENSES - 1,
|
||||
(unsigned long) Brw_LICENSE_UNKNOWN);
|
||||
0,
|
||||
Brw_NUM_LICENSES - 1,
|
||||
(unsigned long) Brw_LICENSE_UNKNOWN);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -9599,7 +9599,7 @@ static void Brw_WriteRowDocData (unsigned *NumDocsNotHidden,MYSQL_ROW row)
|
|||
if (InsCod > 0)
|
||||
{
|
||||
Frm_BeginFormGoTo (ActSeeInsInf);
|
||||
Deg_PutParamDegCod (InsCod);
|
||||
Par_PutParCode (Par_InsCod,InsCod);
|
||||
HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (InsShortName),
|
||||
"class=\"LT BT_LINK\"");
|
||||
Str_FreeGoToTitle ();
|
||||
|
@ -9616,7 +9616,7 @@ static void Brw_WriteRowDocData (unsigned *NumDocsNotHidden,MYSQL_ROW row)
|
|||
if (CtrCod > 0)
|
||||
{
|
||||
Frm_BeginFormGoTo (ActSeeCtrInf);
|
||||
Deg_PutParamDegCod (CtrCod);
|
||||
Par_PutParCode (Par_CtrCod,CtrCod);
|
||||
HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (CtrShortName),
|
||||
"class=\"LT BT_LINK\"");
|
||||
Str_FreeGoToTitle ();
|
||||
|
@ -9633,7 +9633,7 @@ static void Brw_WriteRowDocData (unsigned *NumDocsNotHidden,MYSQL_ROW row)
|
|||
if (DegCod > 0)
|
||||
{
|
||||
Frm_BeginFormGoTo (ActSeeDegInf);
|
||||
Deg_PutParamDegCod (DegCod);
|
||||
Par_PutParCode (Par_DegCod,DegCod);
|
||||
HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (DegShortName),
|
||||
"class=\"LT BT_LINK\"");
|
||||
Str_FreeGoToTitle ();
|
||||
|
@ -9650,7 +9650,7 @@ static void Brw_WriteRowDocData (unsigned *NumDocsNotHidden,MYSQL_ROW row)
|
|||
if (CrsCod > 0)
|
||||
{
|
||||
Frm_BeginFormGoTo (ActSeeCrsInf);
|
||||
Crs_PutParamCrsCod (CrsCod);
|
||||
Par_PutParCode (Par_CrsCod,CrsCod);
|
||||
HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (CrsShortName),
|
||||
"class=\"LT BT_LINK\"");
|
||||
Str_FreeGoToTitle ();
|
||||
|
@ -9725,36 +9725,36 @@ static void Brw_WriteRowDocData (unsigned *NumDocsNotHidden,MYSQL_ROW row)
|
|||
if (CrsCod > 0)
|
||||
{
|
||||
Frm_BeginFormGoTo (Action);
|
||||
Crs_PutParamCrsCod (CrsCod); // Go to course
|
||||
Par_PutParCode (Par_CrsCod,CrsCod); // Go to course
|
||||
if (GrpCod > 0)
|
||||
Grp_PutParamGrpCod (&GrpCod);
|
||||
Par_PutParCode (Par_GrpCod,GrpCod);
|
||||
}
|
||||
else if (DegCod > 0)
|
||||
{
|
||||
Frm_BeginFormGoTo (Action);
|
||||
Deg_PutParamDegCod (DegCod); // Go to degree
|
||||
Par_PutParCode (Par_DegCod,DegCod); // Go to degree
|
||||
}
|
||||
else if (CtrCod > 0)
|
||||
{
|
||||
Frm_BeginFormGoTo (Action);
|
||||
Ctr_PutParamCtrCod (CtrCod); // Go to center
|
||||
Par_PutParCode (Par_CtrCod,CtrCod); // Go to center
|
||||
}
|
||||
else if (InsCod > 0)
|
||||
{
|
||||
Frm_BeginFormGoTo (Action);
|
||||
Ins_PutParamInsCod (InsCod); // Go to institution
|
||||
Par_PutParCode (Par_InsCod,InsCod); // Go to institution
|
||||
}
|
||||
else
|
||||
Frm_BeginForm (Action);
|
||||
|
||||
/* Parameters to go to file / folder */
|
||||
if (FileMetadata.FilFolLnk.Type == Brw_IS_FOLDER)
|
||||
Brw_PutImplicitParamsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
Brw_PutImplicitParsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
||||
else
|
||||
Brw_PutParamsFileBrowser (NULL, // Not used
|
||||
NULL, // Not used
|
||||
Brw_IS_UNKNOWN, // Not used
|
||||
FileMetadata.FilCod);
|
||||
Brw_PutParsFileBrowser (NULL, // Not used
|
||||
NULL, // Not used
|
||||
Brw_IS_UNKNOWN, // Not used
|
||||
FileMetadata.FilCod);
|
||||
|
||||
/* File or folder icon */
|
||||
HTM_BUTTON_Submit_Begin (FileNameToShow,"class=\"LT BT_LINK\"");
|
||||
|
@ -9798,7 +9798,7 @@ static void Brw_PutLinkToAskRemOldFiles (void)
|
|||
extern const char *Txt_Remove_old_files;
|
||||
|
||||
Lay_PutContextualLinkIconText (ActReqRemOldBrf,NULL,
|
||||
Brw_PutHiddenParamFullTreeIfSelected,&Gbl.FileBrowser.FullTree,
|
||||
Brw_PutParFullTreeIfSelected,&Gbl.FileBrowser.FullTree,
|
||||
"trash.svg",Ico_RED,
|
||||
Txt_Remove_old_files,NULL);
|
||||
}
|
||||
|
@ -9819,7 +9819,7 @@ void Brw_AskRemoveOldFiles (void)
|
|||
|
||||
/***** Begin form *****/
|
||||
Frm_BeginForm (ActRemOldBrf);
|
||||
Brw_PutHiddenParamFullTreeIfSelected (&Gbl.FileBrowser.FullTree);
|
||||
Brw_PutParFullTreeIfSelected (&Gbl.FileBrowser.FullTree);
|
||||
|
||||
/***** Begin box *****/
|
||||
Box_BoxBegin (NULL,Txt_Remove_old_files,
|
||||
|
@ -9874,9 +9874,9 @@ void Brw_RemoveOldFilesBriefcase (void)
|
|||
/***** Get parameter with number of months without access *****/
|
||||
Months = (unsigned)
|
||||
Par_GetParUnsignedLong ("Months",
|
||||
Brw_MIN_MONTHS_TO_REMOVE_OLD_FILES,
|
||||
Brw_MAX_MONTHS_IN_BRIEFCASE,
|
||||
Brw_DEF_MONTHS_TO_REMOVE_OLD_FILES);
|
||||
Brw_MIN_MONTHS_TO_REMOVE_OLD_FILES,
|
||||
Brw_MAX_MONTHS_IN_BRIEFCASE,
|
||||
Brw_DEF_MONTHS_TO_REMOVE_OLD_FILES);
|
||||
|
||||
/***** Remove old files *****/
|
||||
Brw_RemoveOldFilesInBrowser (Months,&Removed);
|
||||
|
|
|
@ -191,7 +191,7 @@ void Brw_GetSelectedUsrsAndShowWorks (void);
|
|||
void Brw_ShowFileBrowserOrWorks (void);
|
||||
void Brw_ShowAgainFileBrowserOrWorks (void);
|
||||
|
||||
void Brw_PutHiddenParamFullTreeIfSelected (void *FullTree);
|
||||
void Brw_PutParFullTreeIfSelected (void *FullTree);
|
||||
|
||||
void Brw_CreateDirDownloadTmp (void);
|
||||
|
||||
|
@ -252,9 +252,9 @@ void Brw_PutIconFile (const char *FileName,
|
|||
void Brw_CreateTmpPublicLinkToPrivateFile (const char *FullPathIncludingFile,
|
||||
const char *FileName);
|
||||
|
||||
void Brw_PutImplicitParamsFileBrowser (void *FilFolLnk);
|
||||
void Brw_PutParamsFileBrowser (const char *PathInTree,const char *FilFolLnkName,
|
||||
Brw_FileType_t FileType,long FilCod);
|
||||
void Brw_PutImplicitParsFileBrowser (void *FilFolLnk);
|
||||
void Brw_PutParsFileBrowser (const char *PathInTree,const char *FilFolLnkName,
|
||||
Brw_FileType_t FileType,long FilCod);
|
||||
|
||||
void Brw_RemoveZonesOfGroupsOfType (long GrpTypCod);
|
||||
void Brw_RemoveGrpZones (long CrsCod,long GrpCod);
|
||||
|
|
|
@ -124,10 +124,10 @@ void BrwRsc_WriteDocFileNameInCrsProgram (long FilCod,bool PutFormToGo,
|
|||
ActSeeAdmDocCrsGrp; // All documents
|
||||
Frm_BeginForm (NextAction);
|
||||
if (FileMetadata.FilCod > 0)
|
||||
Brw_PutParamsFileBrowser (NULL, // Not used
|
||||
NULL, // Not used
|
||||
Brw_IS_UNKNOWN, // Not used
|
||||
FileMetadata.FilCod);
|
||||
Brw_PutParsFileBrowser (NULL, // Not used
|
||||
NULL, // Not used
|
||||
Brw_IS_UNKNOWN, // Not used
|
||||
FileMetadata.FilCod);
|
||||
HTM_BUTTON_Submit_Begin (Txt_Actions[NextAction],
|
||||
"class=\"LM BT_LINK PRG_LNK_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
@ -205,10 +205,10 @@ void BrwRsc_WriteMrkFileNameInCrsProgram (long FilCod,bool PutFormToGo,
|
|||
ActSeeAdmMrk; // All marks files
|
||||
Frm_BeginForm (NextAction);
|
||||
if (FileMetadata.FilCod > 0)
|
||||
Brw_PutParamsFileBrowser (NULL, // Not used
|
||||
NULL, // Not used
|
||||
Brw_IS_UNKNOWN, // Not used
|
||||
FileMetadata.FilCod);
|
||||
Brw_PutParsFileBrowser (NULL, // Not used
|
||||
NULL, // Not used
|
||||
Brw_IS_UNKNOWN, // Not used
|
||||
FileMetadata.FilCod);
|
||||
HTM_BUTTON_Submit_Begin (Txt_Actions[NextAction],
|
||||
"class=\"LM BT_LINK PRG_LNK_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
|
|
@ -58,7 +58,7 @@ static struct Bld_Building *Bld_EditingBuilding = NULL; // Static variable to ke
|
|||
/***************************** Private prototypes ****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static Bld_Order_t Bld_GetParamBuildingOrder (void);
|
||||
static Bld_Order_t Bld_GetParBuildingOrder (void);
|
||||
static bool Bld_CheckIfICanCreateBuildings (void);
|
||||
static void Bld_PutIconsListingBuildings (__attribute__((unused)) void *Args);
|
||||
static void Bld_PutIconToEditBuildings (void);
|
||||
|
@ -67,7 +67,7 @@ static void Bld_PutIconsEditingBuildings (__attribute__((unused)) void *Args);
|
|||
static void Bld_EditBuildingsInternal (void);
|
||||
|
||||
static void Bld_ListBuildingsForEdition (const struct Bld_Buildings *Buildings);
|
||||
static void Bld_PutParamBldCod (void *BldCod);
|
||||
static void Bld_PutParBldCod (void *BldCod);
|
||||
|
||||
static void Bld_RenameBuilding (Cns_ShrtOrFullName_t ShrtOrFullName);
|
||||
|
||||
|
@ -111,7 +111,7 @@ void Bld_SeeBuildings (void)
|
|||
Bld_ResetBuildings (&Buildings);
|
||||
|
||||
/***** Get parameter with the type of order in the list of buildings *****/
|
||||
Buildings.SelectedOrder = Bld_GetParamBuildingOrder ();
|
||||
Buildings.SelectedOrder = Bld_GetParBuildingOrder ();
|
||||
|
||||
/***** Get list of buildings *****/
|
||||
Bld_GetListBuildings (&Buildings,Bld_ALL_DATA);
|
||||
|
@ -193,12 +193,12 @@ void Bld_SeeBuildings (void)
|
|||
/********* Get parameter with the type or order in list of buildings *********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static Bld_Order_t Bld_GetParamBuildingOrder (void)
|
||||
static Bld_Order_t Bld_GetParBuildingOrder (void)
|
||||
{
|
||||
return (Bld_Order_t) Par_GetParUnsignedLong ("Order",
|
||||
0,
|
||||
Bld_NUM_ORDERS - 1,
|
||||
(unsigned long) Bld_ORDER_DEFAULT);
|
||||
0,
|
||||
Bld_NUM_ORDERS - 1,
|
||||
(unsigned long) Bld_ORDER_DEFAULT);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -432,7 +432,7 @@ static void Bld_ListBuildingsForEdition (const struct Bld_Buildings *Buildings)
|
|||
/* Put icon to remove building */
|
||||
HTM_TD_Begin ("class=\"BM\"");
|
||||
Ico_PutContextualIconToRemove (ActRemBld,NULL,
|
||||
Bld_PutParamBldCod,&Building->BldCod);
|
||||
Bld_PutParBldCod,&Building->BldCod);
|
||||
HTM_TD_End ();
|
||||
|
||||
/* Building code */
|
||||
|
@ -445,7 +445,7 @@ static void Bld_ListBuildingsForEdition (const struct Bld_Buildings *Buildings)
|
|||
/* Building short name */
|
||||
HTM_TD_Begin ("class=\"LM\"");
|
||||
Frm_BeginFormAnchor (ActRenBldSho,Anchor);
|
||||
Bld_PutParamBldCod (&Building->BldCod);
|
||||
Par_PutParCode (Par_BldCod,Building->BldCod);
|
||||
HTM_INPUT_TEXT ("ShortName",Bld_MAX_CHARS_SHRT_NAME,Building->ShrtName,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"size=\"10\" class=\"INPUT_SHORT_NAME INPUT_%s\"",
|
||||
|
@ -456,7 +456,7 @@ static void Bld_ListBuildingsForEdition (const struct Bld_Buildings *Buildings)
|
|||
/* Building full name */
|
||||
HTM_TD_Begin ("class=\"LM\"");
|
||||
Frm_BeginFormAnchor (ActRenBldFul,Anchor);
|
||||
Bld_PutParamBldCod (&Building->BldCod);
|
||||
Par_PutParCode (Par_BldCod,Building->BldCod);
|
||||
HTM_INPUT_TEXT ("FullName",Bld_MAX_CHARS_FULL_NAME,Building->FullName,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"size=\"20\" class=\"INPUT_FULL_NAME INPUT_%s\"",
|
||||
|
@ -467,7 +467,7 @@ static void Bld_ListBuildingsForEdition (const struct Bld_Buildings *Buildings)
|
|||
/* Building location */
|
||||
HTM_TD_Begin ("class=\"LM\"");
|
||||
Frm_BeginFormAnchor (ActRenBldLoc,Anchor);
|
||||
Bld_PutParamBldCod (&Building->BldCod);
|
||||
Par_PutParCode (Par_BldCod,Building->BldCod);
|
||||
HTM_INPUT_TEXT ("Location",Bld_MAX_CHARS_LOCATION,Building->Location,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"size=\"15\" class=\"INPUT_FULL_NAME INPUT_%s\"",
|
||||
|
@ -486,7 +486,7 @@ static void Bld_ListBuildingsForEdition (const struct Bld_Buildings *Buildings)
|
|||
/******************* Write parameter with code of building *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Bld_PutParamBldCod (void *BldCod)
|
||||
static void Bld_PutParBldCod (void *BldCod)
|
||||
{
|
||||
if (BldCod)
|
||||
Par_PutParCode (Par_BldCod,*((long *) BldCod));
|
||||
|
@ -556,23 +556,23 @@ static void Bld_RenameBuilding (Cns_ShrtOrFullName_t ShrtOrFullName)
|
|||
extern const char *Txt_The_building_X_already_exists;
|
||||
extern const char *Txt_The_building_X_has_been_renamed_as_Y;
|
||||
extern const char *Txt_The_name_X_has_not_changed;
|
||||
const char *ParamName = NULL; // Initialized to avoid warning
|
||||
const char *FieldName = NULL; // Initialized to avoid warning
|
||||
unsigned MaxBytes = 0; // Initialized to avoid warning
|
||||
char *CurrentClaName = NULL; // Initialized to avoid warning
|
||||
const char *ParName = NULL; // Initialized to avoid warning
|
||||
const char *FldName = NULL; // Initialized to avoid warning
|
||||
unsigned MaxBytes = 0; // Initialized to avoid warning
|
||||
char *CurrentClaName = NULL; // Initialized to avoid warning
|
||||
char NewClaName[Bld_MAX_BYTES_FULL_NAME + 1];
|
||||
|
||||
switch (ShrtOrFullName)
|
||||
{
|
||||
case Cns_SHRT_NAME:
|
||||
ParamName = "ShortName";
|
||||
FieldName = "ShortName";
|
||||
ParName = "ShortName";
|
||||
FldName = "ShortName";
|
||||
MaxBytes = Bld_MAX_BYTES_SHRT_NAME;
|
||||
CurrentClaName = Bld_EditingBuilding->ShrtName;
|
||||
break;
|
||||
case Cns_FULL_NAME:
|
||||
ParamName = "FullName";
|
||||
FieldName = "FullName";
|
||||
ParName = "FullName";
|
||||
FldName = "FullName";
|
||||
MaxBytes = Bld_MAX_BYTES_FULL_NAME;
|
||||
CurrentClaName = Bld_EditingBuilding->FullName;
|
||||
break;
|
||||
|
@ -583,7 +583,7 @@ static void Bld_RenameBuilding (Cns_ShrtOrFullName_t ShrtOrFullName)
|
|||
Bld_EditingBuilding->BldCod = Par_GetAndCheckParCode (Par_BldCod);
|
||||
|
||||
/* Get the new name for the building */
|
||||
Par_GetParText (ParamName,NewClaName,MaxBytes);
|
||||
Par_GetParText (ParName,NewClaName,MaxBytes);
|
||||
|
||||
/***** Get from the database the old names of the building *****/
|
||||
Bld_GetDataOfBuildingByCod (Bld_EditingBuilding);
|
||||
|
@ -596,14 +596,14 @@ static void Bld_RenameBuilding (Cns_ShrtOrFullName_t ShrtOrFullName)
|
|||
if (strcmp (CurrentClaName,NewClaName)) // Different names
|
||||
{
|
||||
/***** If building was in database... *****/
|
||||
if (Bld_DB_CheckIfBuildingNameExists (ParamName,NewClaName,Bld_EditingBuilding->BldCod))
|
||||
if (Bld_DB_CheckIfBuildingNameExists (ParName,NewClaName,Bld_EditingBuilding->BldCod))
|
||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||
Txt_The_building_X_already_exists,
|
||||
NewClaName);
|
||||
else
|
||||
{
|
||||
/* Update the table changing old name by new name */
|
||||
Bld_DB_UpdateBuildingName (Bld_EditingBuilding->BldCod,FieldName,NewClaName);
|
||||
Bld_DB_UpdateBuildingName (Bld_EditingBuilding->BldCod,FldName,NewClaName);
|
||||
|
||||
/* Write message to show the change made */
|
||||
Ale_CreateAlert (Ale_SUCCESS,NULL,
|
||||
|
|
|
@ -115,7 +115,7 @@ unsigned Bld_DB_GetDataOfBuildingByCod (MYSQL_RES **mysql_res,long BldCod)
|
|||
/******************** Check if the name of building exists *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
bool Bld_DB_CheckIfBuildingNameExists (const char *FieldName,const char *Name,long BldCod)
|
||||
bool Bld_DB_CheckIfBuildingNameExists (const char *FldName,const char *Name,long BldCod)
|
||||
{
|
||||
return
|
||||
DB_QueryEXISTS ("can not check if the name of a building already existed",
|
||||
|
@ -126,7 +126,7 @@ bool Bld_DB_CheckIfBuildingNameExists (const char *FieldName,const char *Name,lo
|
|||
" AND %s='%s'"
|
||||
" AND BldCod<>%ld)",
|
||||
Gbl.Hierarchy.Ctr.CtrCod,
|
||||
FieldName,Name,
|
||||
FldName,Name,
|
||||
BldCod);
|
||||
}
|
||||
|
||||
|
@ -135,13 +135,13 @@ bool Bld_DB_CheckIfBuildingNameExists (const char *FieldName,const char *Name,lo
|
|||
/*************** Update building changing old name by new name ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Bld_DB_UpdateBuildingName (long BldCod,const char *FieldName,const char *NewBuildingName)
|
||||
void Bld_DB_UpdateBuildingName (long BldCod,const char *FldName,const char *NewBuildingName)
|
||||
{
|
||||
DB_QueryUPDATE ("can not update the name of a building",
|
||||
"UPDATE bld_buildings"
|
||||
" SET %s='%s'"
|
||||
" WHERE BldCod=%ld",
|
||||
FieldName,
|
||||
FldName,
|
||||
NewBuildingName,
|
||||
BldCod);
|
||||
}
|
||||
|
|
|
@ -41,9 +41,9 @@ unsigned Bld_DB_GetListBuildings (MYSQL_RES **mysql_res,
|
|||
Bld_WhichData_t WhichData,
|
||||
Bld_Order_t SelectedOrder);
|
||||
unsigned Bld_DB_GetDataOfBuildingByCod (MYSQL_RES **mysql_res,long BldCod);
|
||||
bool Bld_DB_CheckIfBuildingNameExists (const char *FieldName,const char *Name,long BldCod);
|
||||
bool Bld_DB_CheckIfBuildingNameExists (const char *FldName,const char *Name,long BldCod);
|
||||
|
||||
void Bld_DB_UpdateBuildingName (long BldCod,const char *FieldName,const char *NewBuildingName);
|
||||
void Bld_DB_UpdateBuildingName (long BldCod,const char *FldName,const char *NewBuildingName);
|
||||
|
||||
void Bld_DB_RemoveBuilding (long BldCod);
|
||||
void Bld_DB_RemoveAllBuildingsInCtr (long CtrCod);
|
||||
|
|
|
@ -73,7 +73,7 @@ const bool Cal_DayIsValidAsFirstDayOfWeek[7] =
|
|||
|
||||
static void Cal_PutIconsFirstDayOfWeek (__attribute__((unused)) void *Args);
|
||||
|
||||
static unsigned Cal_GetParamFirstDayOfWeek (void);
|
||||
static unsigned Cal_GetParFirstDayOfWeek (void);
|
||||
|
||||
static void Cal_DrawCalendar (Act_Action_t ActionSeeCalendar,
|
||||
Act_Action_t ActionChangeCalendar1stDay,
|
||||
|
@ -115,7 +115,7 @@ static void Cal_PutIconsFirstDayOfWeek (__attribute__((unused)) void *Args)
|
|||
/*****************************************************************************/
|
||||
|
||||
void Cal_ShowFormToSelFirstDayOfWeek (Act_Action_t Action,
|
||||
void (*FuncParams) (void *Args),void *Args)
|
||||
void (*FuncPars) (void *Args),void *Args)
|
||||
{
|
||||
extern const char *Txt_First_day_of_the_week_X;
|
||||
extern const char *Txt_DAYS[7];
|
||||
|
@ -132,8 +132,8 @@ void Cal_ShowFormToSelFirstDayOfWeek (Act_Action_t Action,
|
|||
Set_BeginPref (FirstDayOfWeek == Gbl.Prefs.FirstDayOfWeek);
|
||||
Frm_BeginForm (Action);
|
||||
Par_PutParUnsigned (NULL,"FirstDayOfWeek",FirstDayOfWeek);
|
||||
if (FuncParams) // Extra parameters depending on the action
|
||||
FuncParams (Args);
|
||||
if (FuncPars) // Extra parameters depending on the action
|
||||
FuncPars (Args);
|
||||
snprintf (Icon,sizeof (Icon),"first-day-of-week-%u.png",FirstDayOfWeek);
|
||||
if (asprintf (&Title,Txt_First_day_of_the_week_X,
|
||||
Txt_DAYS[FirstDayOfWeek]) < 0)
|
||||
|
@ -153,7 +153,7 @@ void Cal_ShowFormToSelFirstDayOfWeek (Act_Action_t Action,
|
|||
void Cal_ChangeFirstDayOfWeek (void)
|
||||
{
|
||||
/***** Get param with icon set *****/
|
||||
Gbl.Prefs.FirstDayOfWeek = Cal_GetParamFirstDayOfWeek ();
|
||||
Gbl.Prefs.FirstDayOfWeek = Cal_GetParFirstDayOfWeek ();
|
||||
|
||||
/***** Store icon first day of week database *****/
|
||||
if (Gbl.Usrs.Me.Logged)
|
||||
|
@ -167,15 +167,15 @@ void Cal_ChangeFirstDayOfWeek (void)
|
|||
/*********************** Get parameter with icon set *************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static unsigned Cal_GetParamFirstDayOfWeek (void)
|
||||
static unsigned Cal_GetParFirstDayOfWeek (void)
|
||||
{
|
||||
unsigned FirstDayOfWeek;
|
||||
|
||||
FirstDayOfWeek = (unsigned)
|
||||
Par_GetParUnsignedLong ("FirstDayOfWeek",
|
||||
0,
|
||||
6,
|
||||
Cal_FIRST_DAY_OF_WEEK_DEFAULT);
|
||||
0,
|
||||
6,
|
||||
Cal_FIRST_DAY_OF_WEEK_DEFAULT);
|
||||
if (!Cal_DayIsValidAsFirstDayOfWeek[FirstDayOfWeek])
|
||||
FirstDayOfWeek = Cal_FIRST_DAY_OF_WEEK_DEFAULT;
|
||||
|
||||
|
@ -204,7 +204,7 @@ unsigned Cal_GetFirstDayOfWeekFromStr (const char *Str)
|
|||
void Cal_DrawCurrentMonth (void)
|
||||
{
|
||||
extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
|
||||
char ParamsStr[Frm_MAX_BYTES_PARAMS_STR + 1];
|
||||
char ParsStr[Frm_MAX_BYTES_PARAMS_STR + 1];
|
||||
|
||||
/***** Draw the month in JavaScript *****/
|
||||
/* JavaScript will write HTML here */
|
||||
|
@ -220,10 +220,10 @@ void Cal_DrawCurrentMonth (void)
|
|||
Gbl.Hierarchy.Ctr.PlcCod,
|
||||
The_GetSuffix (),
|
||||
Cfg_URL_SWAD_CGI,Lan_STR_LANG_ID[Gbl.Prefs.Language]);
|
||||
Frm_SetParamsForm (ParamsStr,ActSeeCal,true);
|
||||
HTM_TxtF ("'%s',",ParamsStr);
|
||||
Frm_SetParamsForm (ParamsStr,ActSeeDatCfe,true);
|
||||
HTM_TxtF ("'%s');",ParamsStr);
|
||||
Frm_SetParsForm (ParsStr,ActSeeCal,true);
|
||||
HTM_TxtF ("'%s',",ParsStr);
|
||||
Frm_SetParsForm (ParsStr,ActSeeDatCfe,true);
|
||||
HTM_TxtF ("'%s');",ParsStr);
|
||||
HTM_SCRIPT_End ();
|
||||
}
|
||||
|
||||
|
@ -252,7 +252,7 @@ static void Cal_DrawCalendar (Act_Action_t ActionSeeCalendar,
|
|||
{
|
||||
extern const char *Hlp_START_Calendar;
|
||||
extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
|
||||
char ParamsStr[Frm_MAX_BYTES_PARAMS_STR + 1];
|
||||
char ParsStr[Frm_MAX_BYTES_PARAMS_STR + 1];
|
||||
|
||||
/***** Begin box *****/
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
|
@ -291,10 +291,10 @@ static void Cal_DrawCalendar (Act_Action_t ActionSeeCalendar,
|
|||
"false",
|
||||
The_GetSuffix (),
|
||||
Cfg_URL_SWAD_CGI,Lan_STR_LANG_ID[Gbl.Prefs.Language]);
|
||||
Frm_SetParamsForm (ParamsStr,ActionSeeCalendar,true);
|
||||
HTM_TxtF ("'%s',",ParamsStr);
|
||||
Frm_SetParamsForm (ParamsStr,ActSeeDatCfe,true);
|
||||
HTM_TxtF ("'%s');",ParamsStr);
|
||||
Frm_SetParsForm (ParsStr,ActionSeeCalendar,true);
|
||||
HTM_TxtF ("'%s',",ParsStr);
|
||||
Frm_SetParsForm (ParsStr,ActSeeDatCfe,true);
|
||||
HTM_TxtF ("'%s');",ParsStr);
|
||||
HTM_SCRIPT_End ();
|
||||
|
||||
/***** End box *****/
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
void Cal_PutIconsToSelectFirstDayOfWeek (void);
|
||||
void Cal_ShowFormToSelFirstDayOfWeek (Act_Action_t Action,
|
||||
void (*FuncParams) (void *Args),void *Args);
|
||||
void (*FuncPars) (void *Args),void *Args);
|
||||
void Cal_ChangeFirstDayOfWeek (void);
|
||||
unsigned Cal_GetFirstDayOfWeekFromStr (const char *Str);
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ extern struct Globals Gbl;
|
|||
/***************************** Private prototypes ****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static long Cfe_GetParamsCallsForExams (struct Cfe_CallsForExams *CallsForExams);
|
||||
static long Cfe_GetParsCallsForExams (struct Cfe_CallsForExams *CallsForExams);
|
||||
|
||||
static void Cfe_GetExaCodToHighlight (struct Cfe_CallsForExams *CallsForExams);
|
||||
static void Cfe_GetDateToHighlight (struct Cfe_CallsForExams *CallsForExams);
|
||||
|
@ -82,7 +82,7 @@ static void Cfe_ShowCallForExam (struct Cfe_CallsForExams *CallsForExams,
|
|||
bool HighLight);
|
||||
static void Cfe_PutIconsCallForExam (void *CallsForExams);
|
||||
|
||||
static void Cfe_PutParamExaCodToEdit (void *ExaCod);
|
||||
static void Cfe_PutParExaCod (void *ExaCod);
|
||||
|
||||
static void Cfe_GetNotifContentCallForExam (const struct Cfe_CallsForExams *CallsForExams,
|
||||
char **ContentStr);
|
||||
|
@ -146,7 +146,7 @@ void Cfe_PutFrmEditACallForExam (void)
|
|||
Cfe_AllocMemCallForExam (&CallsForExams);
|
||||
|
||||
/***** Get the code of the call for exam *****/
|
||||
ExaCod = Cfe_GetParamsCallsForExams (&CallsForExams);
|
||||
ExaCod = Cfe_GetParsCallsForExams (&CallsForExams);
|
||||
|
||||
if (ExaCod > 0) // -1 indicates that this is a new call for exam
|
||||
/***** Read call for exam from the database *****/
|
||||
|
@ -164,7 +164,7 @@ void Cfe_PutFrmEditACallForExam (void)
|
|||
/****************** Get parameters of a call for exam ************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static long Cfe_GetParamsCallsForExams (struct Cfe_CallsForExams *CallsForExams)
|
||||
static long Cfe_GetParsCallsForExams (struct Cfe_CallsForExams *CallsForExams)
|
||||
{
|
||||
long ExaCod;
|
||||
|
||||
|
@ -181,9 +181,9 @@ static long Cfe_GetParamsCallsForExams (struct Cfe_CallsForExams *CallsForExams)
|
|||
/***** Get the year *****/
|
||||
CallsForExams->CallForExam.Year = (unsigned)
|
||||
Par_GetParUnsignedLong ("Year",
|
||||
0, // N.A.
|
||||
Deg_MAX_YEARS_PER_DEGREE,
|
||||
(unsigned long) Gbl.Hierarchy.Crs.Year);
|
||||
0, // N.A.
|
||||
Deg_MAX_YEARS_PER_DEGREE,
|
||||
(unsigned long) Gbl.Hierarchy.Crs.Year);
|
||||
|
||||
/***** Get the type of call for exam *****/
|
||||
Par_GetParText ("ExamSession",CallsForExams->CallForExam.Session,Cfe_MAX_BYTES_SESSION);
|
||||
|
@ -204,15 +204,15 @@ static long Cfe_GetParamsCallsForExams (struct Cfe_CallsForExams *CallsForExams)
|
|||
|
||||
/***** Get the hour of the exam *****/
|
||||
CallsForExams->CallForExam.StartTime.Hour = (unsigned) Par_GetParUnsignedLong ("ExamHour",
|
||||
0,23,0);
|
||||
0,23,0);
|
||||
CallsForExams->CallForExam.StartTime.Minute = (unsigned) Par_GetParUnsignedLong ("ExamMinute",
|
||||
0,59,0);
|
||||
0,59,0);
|
||||
|
||||
/***** Get the duration of the exam *****/
|
||||
CallsForExams->CallForExam.Duration.Hour = (unsigned) Par_GetParUnsignedLong ("DurationHour",
|
||||
0,23,0);
|
||||
0,23,0);
|
||||
CallsForExams->CallForExam.Duration.Minute = (unsigned) Par_GetParUnsignedLong ("DurationMinute",
|
||||
0,59,0);
|
||||
0,59,0);
|
||||
|
||||
/***** Get the place where the exam will happen, the modality of exam,
|
||||
the structure of exam, the mandatory documentation, the mandatory material,
|
||||
|
@ -321,7 +321,7 @@ void Cfe_ReceiveCallForExam1 (void)
|
|||
Cfe_AllocMemCallForExam (CallsForExams);
|
||||
|
||||
/***** Get parameters of the call for exam *****/
|
||||
ExaCod = Cfe_GetParamsCallsForExams (CallsForExams);
|
||||
ExaCod = Cfe_GetParsCallsForExams (CallsForExams);
|
||||
NewCallForExam = (ExaCod < 0);
|
||||
|
||||
/***** Add the call for exam to the database and read it again from the database *****/
|
||||
|
@ -421,7 +421,7 @@ void Cfe_ReqRemoveCallForExam (void)
|
|||
|
||||
/* End alert */
|
||||
Ale_ShowAlertAndButton2 (ActRemCfe,NULL,NULL,
|
||||
Cfe_PutParamExaCodToEdit,&CallsForExams.ExaCod,
|
||||
Cfe_PutParExaCod,&CallsForExams.ExaCod,
|
||||
Btn_REMOVE_BUTTON,Act_GetActionText (ActRemCfe));
|
||||
}
|
||||
|
||||
|
@ -1489,7 +1489,7 @@ static void Cfe_PutIconsCallForExam (void *CallsForExams)
|
|||
{
|
||||
/***** Icon to remove call for exam *****/
|
||||
Ico_PutContextualIconToRemove (ActReqRemCfe,NULL,
|
||||
Cfe_PutParamExaCodToEdit,
|
||||
Cfe_PutParExaCod,
|
||||
&((struct Cfe_CallsForExams *) CallsForExams)->ExaCod);
|
||||
|
||||
/***** Icon to hide/unhide call for exam *****/
|
||||
|
@ -1498,7 +1498,7 @@ static void Cfe_PutIconsCallForExam (void *CallsForExams)
|
|||
case Cfe_VISIBLE_CALL_FOR_EXAM:
|
||||
case Cfe_HIDDEN_CALL_FOR_EXAM:
|
||||
Ico_PutContextualIconToHideUnhide (ActionHideUnhide,((struct Cfe_CallsForExams *) CallsForExams)->Anchor,
|
||||
Cfe_PutParamExaCodToEdit,
|
||||
Cfe_PutParExaCod,
|
||||
&((struct Cfe_CallsForExams *) CallsForExams)->ExaCod,
|
||||
((struct Cfe_CallsForExams *) CallsForExams)->CallForExam.Status == Cfe_HIDDEN_CALL_FOR_EXAM);
|
||||
break;
|
||||
|
@ -1508,19 +1508,19 @@ static void Cfe_PutIconsCallForExam (void *CallsForExams)
|
|||
|
||||
/***** Icon to edit call for exam *****/
|
||||
Ico_PutContextualIconToEdit (ActEdiCfe,NULL,
|
||||
Cfe_PutParamExaCodToEdit,
|
||||
Cfe_PutParExaCod,
|
||||
&((struct Cfe_CallsForExams *) CallsForExams)->ExaCod);
|
||||
}
|
||||
|
||||
/***** Link to print view *****/
|
||||
Ico_PutContextualIconToPrint (ActPrnCfe,
|
||||
Cfe_PutParamExaCodToEdit,
|
||||
Cfe_PutParExaCod,
|
||||
&((struct Cfe_CallsForExams *) CallsForExams)->ExaCod);
|
||||
|
||||
/***** Link to get resource link *****/
|
||||
if (PrgRsc_CheckIfICanGetLink ())
|
||||
Ico_PutContextualIconToGetLink (ActReqLnkCfe,NULL,
|
||||
Cfe_PutParamExaCodToEdit,
|
||||
Cfe_PutParExaCod,
|
||||
&((struct Cfe_CallsForExams *) CallsForExams)->ExaCod);
|
||||
}
|
||||
}
|
||||
|
@ -1544,7 +1544,7 @@ bool Cfe_CheckIfICanEditCallsForExams (void)
|
|||
/***************** Param with the code of a call for exam ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Cfe_PutParamExaCodToEdit (void *ExaCod)
|
||||
static void Cfe_PutParExaCod (void *ExaCod)
|
||||
{
|
||||
if (ExaCod)
|
||||
Par_PutParCode (Par_ExaCod,*((long *) ExaCod));
|
||||
|
|
|
@ -78,7 +78,7 @@ static bool Ctr_CheckIfICanCreateCenters (void);
|
|||
static void Ctr_PutIconsListingCenters (__attribute__((unused)) void *Args);
|
||||
static void Ctr_PutIconToEditCenters (void);
|
||||
static void Ctr_ListOneCenterForSeeing (struct Ctr_Center *Ctr,unsigned NumCtr);
|
||||
static void Ctr_GetParamCtrOrder (void);
|
||||
static void Ctr_GetParCtrOrder (void);
|
||||
|
||||
static void Ctr_EditCentersInternal (void);
|
||||
static void Ctr_PutIconsEditingCenters (__attribute__((unused)) void *Args);
|
||||
|
@ -89,7 +89,6 @@ static void Ctr_ListCentersForEdition (const struct Plc_Places *Places);
|
|||
static bool Ctr_CheckIfICanEditACenter (struct Ctr_Center *Ctr);
|
||||
|
||||
static void Ctr_ShowAlertAndButtonToGoToCtr (void);
|
||||
static void Ctr_PutParamGoToCtr (void *CtrCod);
|
||||
|
||||
static void Ctr_PutFormToCreateCenter (const struct Plc_Places *Places);
|
||||
static void Ctr_PutHeadCentersForSeeing (bool OrderSelectable);
|
||||
|
@ -103,6 +102,8 @@ static void Ctr_EditingCenterDestructor (void);
|
|||
|
||||
static void Ctr_FormToGoToMap (struct Ctr_Center *Ctr);
|
||||
|
||||
static void Ctr_PutParCtrCod (void *CtrCod);
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************* List centers with pending degrees ***********************/
|
||||
/*****************************************************************************/
|
||||
|
@ -189,7 +190,7 @@ void Ctr_DrawCenterLogoAndNameWithLink (struct Ctr_Center *Ctr,Act_Action_t Acti
|
|||
{
|
||||
/***** Begin form *****/
|
||||
Frm_BeginFormGoTo (Action);
|
||||
Ctr_PutParamCtrCod (Ctr->CtrCod);
|
||||
Par_PutParCode (Par_CtrCod,Ctr->CtrCod);
|
||||
|
||||
/***** Link to action *****/
|
||||
HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (Ctr->FullName),
|
||||
|
@ -221,7 +222,7 @@ void Ctr_ShowCtrsOfCurrentIns (void)
|
|||
return;
|
||||
|
||||
/***** Get parameter with the type of order in the list of centers *****/
|
||||
Ctr_GetParamCtrOrder ();
|
||||
Ctr_GetParCtrOrder ();
|
||||
|
||||
/***** Get list of centers *****/
|
||||
Ctr_GetFullListOfCenters (Gbl.Hierarchy.Ins.InsCod,
|
||||
|
@ -413,13 +414,13 @@ static void Ctr_ListOneCenterForSeeing (struct Ctr_Center *Ctr,unsigned NumCtr)
|
|||
/********** Get parameter with the type or order in list of centers **********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Ctr_GetParamCtrOrder (void)
|
||||
static void Ctr_GetParCtrOrder (void)
|
||||
{
|
||||
Gbl.Hierarchy.Ctrs.SelectedOrder = (Ctr_Order_t)
|
||||
Par_GetParUnsignedLong ("Order",
|
||||
0,
|
||||
Ctr_NUM_ORDERS - 1,
|
||||
(unsigned long) Ctr_ORDER_DEFAULT);
|
||||
0,
|
||||
Ctr_NUM_ORDERS - 1,
|
||||
(unsigned long) Ctr_ORDER_DEFAULT);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -794,12 +795,12 @@ static void Ctr_ListCentersForEdition (const struct Plc_Places *Places)
|
|||
HTM_TD_Begin ("class=\"BM\"");
|
||||
if (!ICanEdit || // I cannot edit
|
||||
NumDegs || // Center has degrees
|
||||
NumUsrsCtr || // Center has users who claim to belong to it
|
||||
NumUsrsCtr || // Center has users who claim to belong to it
|
||||
NumUsrsInCrssOfCtr) // Center has users
|
||||
Ico_PutIconRemovalNotAllowed ();
|
||||
else // I can remove center
|
||||
Ico_PutContextualIconToRemove (ActRemCtr,NULL,
|
||||
Hie_PutParamOtherHieCod,&Ctr->CtrCod);
|
||||
Hie_PutParOtherHieCod,&Ctr->CtrCod);
|
||||
HTM_TD_End ();
|
||||
|
||||
/* Center code */
|
||||
|
@ -817,7 +818,7 @@ static void Ctr_ListCentersForEdition (const struct Plc_Places *Places)
|
|||
if (ICanEdit)
|
||||
{
|
||||
Frm_BeginForm (ActChgCtrPlc);
|
||||
Hie_PutParamOtherHieCod (&Ctr->CtrCod);
|
||||
Par_PutParCode (Par_OthHieCod,Ctr->CtrCod);
|
||||
HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,
|
||||
"name=\"PlcCod\""
|
||||
" class=\"PLC_SEL INPUT_%s\"",
|
||||
|
@ -847,7 +848,7 @@ static void Ctr_ListCentersForEdition (const struct Plc_Places *Places)
|
|||
if (ICanEdit)
|
||||
{
|
||||
Frm_BeginForm (ActRenCtrSho);
|
||||
Hie_PutParamOtherHieCod (&Ctr->CtrCod);
|
||||
Par_PutParCode (Par_OthHieCod,Ctr->CtrCod);
|
||||
HTM_INPUT_TEXT ("ShortName",Cns_HIERARCHY_MAX_CHARS_SHRT_NAME,Ctr->ShrtName,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"class=\"INPUT_SHORT_NAME INPUT_%s\"",
|
||||
|
@ -863,7 +864,7 @@ static void Ctr_ListCentersForEdition (const struct Plc_Places *Places)
|
|||
if (ICanEdit)
|
||||
{
|
||||
Frm_BeginForm (ActRenCtrFul);
|
||||
Hie_PutParamOtherHieCod (&Ctr->CtrCod);
|
||||
Par_PutParCode (Par_OthHieCod,Ctr->CtrCod);
|
||||
HTM_INPUT_TEXT ("FullName",Cns_HIERARCHY_MAX_CHARS_FULL_NAME,Ctr->FullName,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"class=\"INPUT_FULL_NAME INPUT_%s\"",
|
||||
|
@ -879,7 +880,7 @@ static void Ctr_ListCentersForEdition (const struct Plc_Places *Places)
|
|||
if (ICanEdit)
|
||||
{
|
||||
Frm_BeginForm (ActChgCtrWWW);
|
||||
Hie_PutParamOtherHieCod (&Ctr->CtrCod);
|
||||
Par_PutParCode (Par_OthHieCod,Ctr->CtrCod);
|
||||
HTM_INPUT_URL ("WWW",Ctr->WWW,HTM_SUBMIT_ON_CHANGE,
|
||||
"class=\"INPUT_WWW_NARROW INPUT_%s\""
|
||||
" required=\"required\"",
|
||||
|
@ -952,15 +953,6 @@ static bool Ctr_CheckIfICanEditACenter (struct Ctr_Center *Ctr)
|
|||
Gbl.Usrs.Me.UsrDat.UsrCod == Ctr->RequesterUsrCod); // I am the requester
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** Write parameter with code of center ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Ctr_PutParamCtrCod (long CtrCod)
|
||||
{
|
||||
Par_PutParLong (NULL,"ctr",CtrCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************************* Remove a center *****************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -1098,23 +1090,23 @@ void Ctr_RenameCenter (struct Ctr_Center *Ctr,Cns_ShrtOrFullName_t ShrtOrFullNam
|
|||
extern const char *Txt_The_center_X_already_exists;
|
||||
extern const char *Txt_The_center_X_has_been_renamed_as_Y;
|
||||
extern const char *Txt_The_name_X_has_not_changed;
|
||||
const char *ParamName = NULL; // Initialized to avoid warning
|
||||
const char *FieldName = NULL; // Initialized to avoid warning
|
||||
unsigned MaxBytes = 0; // Initialized to avoid warning
|
||||
char *CurrentCtrName = NULL; // Initialized to avoid warning
|
||||
const char *ParName = NULL; // Initialized to avoid warning
|
||||
const char *FldName = NULL; // Initialized to avoid warning
|
||||
unsigned MaxBytes = 0; // Initialized to avoid warning
|
||||
char *CurrentCtrName = NULL; // Initialized to avoid warning
|
||||
char NewCtrName[Cns_HIERARCHY_MAX_BYTES_FULL_NAME + 1];
|
||||
|
||||
switch (ShrtOrFullName)
|
||||
{
|
||||
case Cns_SHRT_NAME:
|
||||
ParamName = "ShortName";
|
||||
FieldName = "ShortName";
|
||||
ParName = "ShortName";
|
||||
FldName = "ShortName";
|
||||
MaxBytes = Cns_HIERARCHY_MAX_BYTES_SHRT_NAME;
|
||||
CurrentCtrName = Ctr->ShrtName;
|
||||
break;
|
||||
case Cns_FULL_NAME:
|
||||
ParamName = "FullName";
|
||||
FieldName = "FullName";
|
||||
ParName = "FullName";
|
||||
FldName = "FullName";
|
||||
MaxBytes = Cns_HIERARCHY_MAX_BYTES_FULL_NAME;
|
||||
CurrentCtrName = Ctr->FullName;
|
||||
break;
|
||||
|
@ -1122,7 +1114,7 @@ void Ctr_RenameCenter (struct Ctr_Center *Ctr,Cns_ShrtOrFullName_t ShrtOrFullNam
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get the new name for the center */
|
||||
Par_GetParText (ParamName,NewCtrName,MaxBytes);
|
||||
Par_GetParText (ParName,NewCtrName,MaxBytes);
|
||||
|
||||
/***** Get from the database the old names of the center *****/
|
||||
Ctr_GetDataOfCenterByCod (Ctr);
|
||||
|
@ -1137,14 +1129,14 @@ void Ctr_RenameCenter (struct Ctr_Center *Ctr,Cns_ShrtOrFullName_t ShrtOrFullNam
|
|||
if (strcmp (CurrentCtrName,NewCtrName)) // Different names
|
||||
{
|
||||
/***** If degree was in database... *****/
|
||||
if (Ctr_DB_CheckIfCtrNameExistsInIns (ParamName,NewCtrName,Ctr->CtrCod,Gbl.Hierarchy.Ins.InsCod))
|
||||
if (Ctr_DB_CheckIfCtrNameExistsInIns (ParName,NewCtrName,Ctr->CtrCod,Gbl.Hierarchy.Ins.InsCod))
|
||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||
Txt_The_center_X_already_exists,
|
||||
NewCtrName);
|
||||
else
|
||||
{
|
||||
/* Update the table changing old name by new name */
|
||||
Ctr_DB_UpdateCtrName (Ctr->CtrCod,FieldName,NewCtrName);
|
||||
Ctr_DB_UpdateCtrName (Ctr->CtrCod,FldName,NewCtrName);
|
||||
|
||||
/* Write message to show the change made */
|
||||
Ale_CreateAlert (Ale_SUCCESS,NULL,
|
||||
|
@ -1216,7 +1208,7 @@ void Ctr_ChangeCtrStatus (void)
|
|||
Ctr_EditingCtr->CtrCod = Par_GetAndCheckParCode (Par_OthHieCod);
|
||||
|
||||
/* Get parameter with status */
|
||||
Status = Hie_GetParamStatus (); // New status
|
||||
Status = Hie_GetParStatus (); // New status
|
||||
|
||||
/***** Get data of center *****/
|
||||
Ctr_GetDataOfCenterByCod (Ctr_EditingCtr);
|
||||
|
@ -1261,7 +1253,7 @@ static void Ctr_ShowAlertAndButtonToGoToCtr (void)
|
|||
{
|
||||
/***** Alert with button to go to center *****/
|
||||
Ale_ShowLastAlertAndButton (ActSeeDeg,NULL,NULL,
|
||||
Ctr_PutParamGoToCtr,&Ctr_EditingCtr->CtrCod,
|
||||
Ctr_PutParCtrCod,&Ctr_EditingCtr->CtrCod,
|
||||
Btn_CONFIRM_BUTTON,
|
||||
Str_BuildGoToTitle (Ctr_EditingCtr->ShrtName));
|
||||
Str_FreeGoToTitle ();
|
||||
|
@ -1271,12 +1263,6 @@ static void Ctr_ShowAlertAndButtonToGoToCtr (void)
|
|||
Ale_ShowAlerts (NULL);
|
||||
}
|
||||
|
||||
static void Ctr_PutParamGoToCtr (void *CtrCod)
|
||||
{
|
||||
if (CtrCod)
|
||||
Ctr_PutParamCtrCod (*((long *) CtrCod));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************* Put a form to create a new center *********************/
|
||||
/*****************************************************************************/
|
||||
|
@ -1909,7 +1895,7 @@ static void Ctr_FormToGoToMap (struct Ctr_Center *Ctr)
|
|||
{
|
||||
Ctr_EditingCtr = Ctr; // Used to pass parameter with the code of the center
|
||||
Lay_PutContextualLinkOnlyIcon (ActSeeCtrInf,NULL,
|
||||
Ctr_PutParamGoToCtr,&Ctr_EditingCtr->CtrCod,
|
||||
Ctr_PutParCtrCod,&Ctr_EditingCtr->CtrCod,
|
||||
"map-marker-alt.svg",Ico_BLACK);
|
||||
}
|
||||
}
|
||||
|
@ -2087,3 +2073,13 @@ unsigned Ctr_GetCachedNumUsrsWhoClaimToBelongToCtr (struct Ctr_Center *Ctr)
|
|||
|
||||
return NumUsrsCtr;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** Write parameter with code of center ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Ctr_PutParCtrCod (void *CtrCod)
|
||||
{
|
||||
if (CtrCod)
|
||||
Par_PutParCode (Par_CtrCod,*((long *) CtrCod));
|
||||
}
|
||||
|
|
|
@ -93,7 +93,6 @@ void Ctr_GetFullListOfCenters (long InsCod,Ctr_Order_t SelectedOrder);
|
|||
bool Ctr_GetDataOfCenterByCod (struct Ctr_Center *Ctr);
|
||||
void Ctr_FreeListCenters (void);
|
||||
void Ctr_WriteSelectorOfCenter (void);
|
||||
void Ctr_PutParamCtrCod (long CtrCod);
|
||||
void Ctr_RemoveCenter (void);
|
||||
void Ctr_ChangeCtrPlc (void);
|
||||
void Ctr_RenameCenterShort (void);
|
||||
|
|
|
@ -582,7 +582,7 @@ static void CtrCfg_Institution (bool PrintView,bool PutForm)
|
|||
if (!PrintView)
|
||||
{
|
||||
Frm_BeginFormGoTo (ActSeeInsInf);
|
||||
Ins_PutParamInsCod (Gbl.Hierarchy.Ins.InsCod);
|
||||
Par_PutParCode (Par_InsCod,Gbl.Hierarchy.Ins.InsCod);
|
||||
HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (Gbl.Hierarchy.Ins.ShrtName),
|
||||
"class=\"LT BT_LINK\"");
|
||||
Str_FreeGoToTitle ();
|
||||
|
@ -704,7 +704,7 @@ static void CtrCfg_WWW (bool PrintView,bool PutForm)
|
|||
|
||||
static void CtrCfg_Shortcut (bool PrintView)
|
||||
{
|
||||
HieCfg_Shortcut (PrintView,"ctr",Gbl.Hierarchy.Ctr.CtrCod);
|
||||
HieCfg_Shortcut (PrintView,Par_CtrCod,Gbl.Hierarchy.Ctr.CtrCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -713,7 +713,7 @@ static void CtrCfg_Shortcut (bool PrintView)
|
|||
|
||||
static void CtrCfg_QR (void)
|
||||
{
|
||||
HieCfg_QR ("ctr",Gbl.Hierarchy.Ctr.CtrCod);
|
||||
HieCfg_QR (Par_CtrCod,Gbl.Hierarchy.Ctr.CtrCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -757,7 +757,7 @@ static void CtrCfg_NumDegs (void)
|
|||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LB DAT_%s\"",The_GetSuffix ());
|
||||
Frm_BeginFormGoTo (ActSeeDeg);
|
||||
Ctr_PutParamCtrCod (Gbl.Hierarchy.Ctr.CtrCod);
|
||||
Par_PutParCode (Par_CtrCod,Gbl.Hierarchy.Ctr.CtrCod);
|
||||
if (asprintf (&Title,Txt_Degrees_of_CENTER_X,Gbl.Hierarchy.Ctr.ShrtName) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
HTM_BUTTON_Submit_Begin (Title,"class=\"LB BT_LINK\"");
|
||||
|
@ -872,7 +872,7 @@ void CtrCfg_ReceivePhoto (void)
|
|||
{
|
||||
extern const char *Txt_Wrong_file_type;
|
||||
char Path[PATH_MAX + 1];
|
||||
struct Param *Param;
|
||||
struct Par_Param *Par;
|
||||
char FileNameImgSrc[PATH_MAX + 1];
|
||||
char *PtrExtension;
|
||||
size_t LengthExtension;
|
||||
|
@ -885,8 +885,8 @@ void CtrCfg_ReceivePhoto (void)
|
|||
char ErrorMsg[256];
|
||||
|
||||
/***** Copy in disk the file received *****/
|
||||
Param = Fil_StartReceptionOfFile (Fil_NAME_OF_PARAM_FILENAME_ORG,
|
||||
FileNameImgSrc,MIMEType);
|
||||
Par = Fil_StartReceptionOfFile (Fil_NAME_OF_PARAM_FILENAME_ORG,
|
||||
FileNameImgSrc,MIMEType);
|
||||
|
||||
/* Check if the file type is image/ or application/octet-stream */
|
||||
if (strncmp (MIMEType,"image/",strlen ("image/")))
|
||||
|
@ -924,7 +924,7 @@ void CtrCfg_ReceivePhoto (void)
|
|||
/* End the reception of image in a temporary file */
|
||||
snprintf (PathFileImgTmp,sizeof (PathFileImgTmp),"%s/%s.%s",
|
||||
Cfg_PATH_MEDIA_TMP_PRIVATE,Cry_GetUniqueNameEncrypted (),PtrExtension);
|
||||
if (!Fil_EndReceptionOfFile (PathFileImgTmp,Param))
|
||||
if (!Fil_EndReceptionOfFile (PathFileImgTmp,Par))
|
||||
{
|
||||
Ale_ShowAlert (Ale_WARNING,"Error copying file.");
|
||||
return;
|
||||
|
|
|
@ -292,7 +292,7 @@ unsigned Ctr_DB_GetPhotoAttribution (MYSQL_RES **mysql_res,long CtrCod)
|
|||
/********************* Check if the name of center exists ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
bool Ctr_DB_CheckIfCtrNameExistsInIns (const char *FieldName,const char *Name,
|
||||
bool Ctr_DB_CheckIfCtrNameExistsInIns (const char *FldName,const char *Name,
|
||||
long CtrCod,long InsCod)
|
||||
{
|
||||
return
|
||||
|
@ -304,7 +304,7 @@ bool Ctr_DB_CheckIfCtrNameExistsInIns (const char *FieldName,const char *Name,
|
|||
" AND %s='%s'"
|
||||
" AND CtrCod<>%ld)",
|
||||
InsCod,
|
||||
FieldName,
|
||||
FldName,
|
||||
Name,
|
||||
CtrCod);
|
||||
}
|
||||
|
@ -535,14 +535,14 @@ void Ctr_DB_UpdateCtrPlc (long CtrCod,long NewPlcCod)
|
|||
/****************** Update center name in table of centers *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Ctr_DB_UpdateCtrName (long CtrCod,const char *FieldName,const char *NewCtrName)
|
||||
void Ctr_DB_UpdateCtrName (long CtrCod,const char *FldName,const char *NewCtrName)
|
||||
{
|
||||
/***** Update center changing old name by new name */
|
||||
DB_QueryUPDATE ("can not update the name of a center",
|
||||
"UPDATE ctr_centers"
|
||||
" SET %s='%s'"
|
||||
" WHERE CtrCod=%ld",
|
||||
FieldName,
|
||||
FldName,
|
||||
NewCtrName,
|
||||
CtrCod);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ unsigned Ctr_DB_GetDataOfCenterByCod (MYSQL_RES **mysql_res,long CtrCod);
|
|||
long Ctr_DB_GetInsCodOfCenterByCod (long CtrCod);
|
||||
void Ctr_DB_GetShortNameOfCenterByCod (long CtrCod,char ShrtName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1]);
|
||||
unsigned Ctr_DB_GetPhotoAttribution (MYSQL_RES **mysql_res,long CtrCod);
|
||||
bool Ctr_DB_CheckIfCtrNameExistsInIns (const char *FieldName,const char *Name,
|
||||
bool Ctr_DB_CheckIfCtrNameExistsInIns (const char *FldName,const char *Name,
|
||||
long CtrCod,long InsCod);
|
||||
|
||||
unsigned Ctr_DB_SearchCtrs (MYSQL_RES **mysql_res,
|
||||
|
@ -69,7 +69,7 @@ unsigned Ctr_DB_GetNumCtrsWithUsrs (Rol_Role_t Role,
|
|||
|
||||
void Ctr_DB_UpdateCtrIns (long CtrCod,long NewInsCod);
|
||||
void Ctr_DB_UpdateCtrPlc (long CtrCod,long NewPlcCod);
|
||||
void Ctr_DB_UpdateCtrName (long CtrCod,const char *FieldName,const char *NewCtrName);
|
||||
void Ctr_DB_UpdateCtrName (long CtrCod,const char *FldName,const char *NewCtrName);
|
||||
void Ctr_DB_UpdateCtrWWW (long CtrCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1]);
|
||||
void Ctr_DB_UpdateCtrPhotoAttribution (long CtrCod,const char NewPhotoAttribution[Med_MAX_BYTES_ATTRIBUTION + 1]);
|
||||
void Ctr_DB_UpdateCtrCoordinate (long CtrCod,
|
||||
|
|
|
@ -629,11 +629,12 @@ 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.
|
||||
|
||||
*/
|
||||
#define Log_PLATFORM_VERSION "SWAD 22.72 (2023-03-09)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 22.73 (2023-03-10)"
|
||||
#define CSS_FILE "swad22.57.1.css"
|
||||
#define JS_FILE "swad22.49.js"
|
||||
/*
|
||||
Version 22.72: Mar 09, 2023 Code refactoring in parameters. Not finished. (? lines)
|
||||
Version 22.73: Mar 10, 2023 Code refactoring in parameters. (336668 lines)
|
||||
Version 22.72: Mar 09, 2023 Code refactoring in parameters. Not finished. (336749 lines)
|
||||
Version 22.71: Mar 08, 2023 Code refactoring in parameters. Not finished. (336806 lines)
|
||||
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)
|
||||
|
|
|
@ -305,7 +305,7 @@ static void Cht_WriteLinkToChat1 (const char *RoomCode,const char *RoomShrtName,
|
|||
/***** Begin form *****/
|
||||
Frm_BeginForm (ActCht);
|
||||
|
||||
Cht_WriteParamsRoomCodeAndNames (RoomCode,RoomShrtName,RoomFullName);
|
||||
Cht_WriteParsRoomCodeAndNames (RoomCode,RoomShrtName,RoomFullName);
|
||||
|
||||
/* Begin button */
|
||||
HTM_BUTTON_Submit_Begin (RoomFullName,
|
||||
|
@ -348,7 +348,7 @@ static void Cht_WriteLinkToChat2 (const char *RoomCode,const char *RoomFullName)
|
|||
/*** Write parameters with code and names (short and full) of a chat room ****/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Cht_WriteParamsRoomCodeAndNames (const char *RoomCode,const char *RoomShrtName,const char *RoomFullName)
|
||||
void Cht_WriteParsRoomCodeAndNames (const char *RoomCode,const char *RoomShrtName,const char *RoomFullName)
|
||||
{
|
||||
Par_PutParString (NULL,"RoomCode",RoomCode);
|
||||
Par_PutParString (NULL,"RoomShrtName",RoomShrtName);
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
void Cht_ShowChatRooms (void);
|
||||
void Cht_ShowListOfAvailableChatRooms (void);
|
||||
void Cht_ShowListOfChatRoomsWithUsrs (void);
|
||||
void Cht_WriteParamsRoomCodeAndNames (const char *RoomCode,const char *RoomShortName,const char *RoomFullName);
|
||||
void Cht_WriteParsRoomCodeAndNames (const char *RoomCode,const char *RoomShortName,const char *RoomFullName);
|
||||
void Cht_OpenChatWindow (void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -61,7 +61,7 @@ extern struct Globals Gbl;
|
|||
/*****************************************************************************/
|
||||
|
||||
static void Con_PutIconToUpdateConnected (__attribute__((unused)) void *Args);
|
||||
static void Con_PutParamScope (__attribute__((unused)) void *Args);
|
||||
static void Con_PutParScope (__attribute__((unused)) void *Args);
|
||||
|
||||
static void Con_ShowGlobalConnectedUsrsRole (Rol_Role_t Role,unsigned UsrsTotal);
|
||||
|
||||
|
@ -136,13 +136,13 @@ void Con_ShowConnectedUsrs (void)
|
|||
static void Con_PutIconToUpdateConnected (__attribute__((unused)) void *Args)
|
||||
{
|
||||
Lay_PutContextualLinkOnlyIcon (ActLstCon,NULL,
|
||||
Con_PutParamScope,NULL,
|
||||
Con_PutParScope,NULL,
|
||||
"recycle.svg",Ico_BLACK);
|
||||
}
|
||||
|
||||
static void Con_PutParamScope (__attribute__((unused)) void *Args)
|
||||
static void Con_PutParScope (__attribute__((unused)) void *Args)
|
||||
{
|
||||
Sco_PutParamScope ("ScopeCon",Gbl.Scope.Current);
|
||||
Sco_PutParScope ("ScopeCon",Gbl.Scope.Current);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -412,7 +412,7 @@ static void Con_ShowConnectedUsrsWithARoleBelongingToCurrentCrsOnRightColumn (Ro
|
|||
HTM_TR_Begin (NULL);
|
||||
HTM_TD_Begin ("colspan=\"3\" class=\"CM\"");
|
||||
Frm_BeginForm (ActLstCon);
|
||||
Sco_PutParamScope ("ScopeCon",HieLvl_CRS);
|
||||
Sco_PutParScope ("ScopeCon",HieLvl_CRS);
|
||||
HTM_INPUT_IMAGE (Cfg_URL_ICON_PUBLIC,"ellipsis-h.svg",
|
||||
Txt_Connected_users,
|
||||
"class=\"ICO16x16 ICO_HIGHLIGHT ICO_BLACK_%s\"",
|
||||
|
@ -601,7 +601,7 @@ static void Con_WriteRowConnectedUsrOnRightColumn (Rol_Role_t Role)
|
|||
if (!NextAction[Role])
|
||||
Err_WrongRoleExit ();
|
||||
Frm_BeginForm (NextAction[Role]);
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
|
||||
HTM_DIV_Begin ("class=\"CON_NAME_NARROW\""); // Limited width
|
||||
HTM_BUTTON_Submit_Begin (Txt_View_record_for_this_course,
|
||||
|
@ -709,7 +709,7 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
|
|||
if (!NextAction[Role])
|
||||
Err_WrongRoleExit ();
|
||||
Frm_BeginForm (NextAction[Role]);
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat.EnUsrCod);
|
||||
Usr_PutParUsrCodEncrypted (UsrDat.EnUsrCod);
|
||||
}
|
||||
|
||||
if (PutLinkToRecord)
|
||||
|
|
|
@ -72,19 +72,19 @@ static void Cty_ListOneCountryForSeeing (struct Cty_Countr *Cty,unsigned NumCty)
|
|||
static void Cty_PutIconsListingCountries (__attribute__((unused)) void *Args);
|
||||
static void Cty_PutIconToEditCountries (void);
|
||||
|
||||
static void Cty_GetParamCtyOrder (void);
|
||||
static void Cty_GetParCtyOrder (void);
|
||||
|
||||
static void Cty_EditCountriesInternal (void);
|
||||
static void Cty_PutIconsEditingCountries (__attribute__((unused)) void *Args);
|
||||
static void Cty_PutIconToViewCountries (void);
|
||||
|
||||
static void Cty_ListCountriesForEdition (void);
|
||||
static void Cty_PutParamOtherCtyCod (void *CtyCod);
|
||||
static void Cty_PutParOthCtyCod (void *CtyCod);
|
||||
|
||||
static void Cty_UpdateCtyName (long CtyCod,const char *FieldName,const char *NewCtyName);
|
||||
static void Cty_UpdateCtyName (long CtyCod,const char *FldName,const char *NewCtyName);
|
||||
|
||||
static void Cty_ShowAlertAndButtonToGoToCty (void);
|
||||
static void Cty_PutParamGoToCty (void *CtyCod);
|
||||
static void Cty_PutParGoToCty (void *CtyCod);
|
||||
|
||||
static void Cty_PutFormToCreateCountry (void);
|
||||
static void Cty_PutHeadCountriesForEdition (void);
|
||||
|
@ -199,7 +199,7 @@ void Cty_ListCountries (void)
|
|||
void Cty_ListCountries1 (void)
|
||||
{
|
||||
/***** Get parameter with the type of order in the list of countries *****/
|
||||
Cty_GetParamCtyOrder ();
|
||||
Cty_GetParCtyOrder ();
|
||||
|
||||
/***** Get list of countries *****/
|
||||
Cty_GetFullListOfCountries ();
|
||||
|
@ -512,7 +512,7 @@ void Cty_DrawCountryMapAndNameWithLink (struct Cty_Countr *Cty,Act_Action_t Acti
|
|||
|
||||
/***** Begin form *****/
|
||||
Frm_BeginFormGoTo (Action);
|
||||
Cty_PutParamCtyCod (Cty->CtyCod);
|
||||
Par_PutParCode (Par_CtyCod,Cty->CtyCod);
|
||||
|
||||
/***** Begin container *****/
|
||||
HTM_DIV_Begin ("class=\"%s\"",ClassContainer);
|
||||
|
@ -654,13 +654,13 @@ void Cty_WriteScriptGoogleGeochart (void)
|
|||
/******** Get parameter with the type or order in list of countries **********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Cty_GetParamCtyOrder (void)
|
||||
static void Cty_GetParCtyOrder (void)
|
||||
{
|
||||
Gbl.Hierarchy.Ctys.SelectedOrder = (Cty_Order_t)
|
||||
Par_GetParUnsignedLong ("Order",
|
||||
0,
|
||||
Cty_NUM_ORDERS - 1,
|
||||
(unsigned long) Cty_ORDER_DEFAULT);
|
||||
0,
|
||||
Cty_NUM_ORDERS - 1,
|
||||
(unsigned long) Cty_ORDER_DEFAULT);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -918,7 +918,7 @@ void Cty_WriteCountryName (long CtyCod)
|
|||
{
|
||||
/***** Write country name with link to country information *****/
|
||||
Frm_BeginForm (ActSeeCtyInf);
|
||||
Cty_PutParamCtyCod (CtyCod);
|
||||
Par_PutParCode (Par_CtyCod,CtyCod);
|
||||
HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeCtyInf),
|
||||
"class=\"BT_LINK\"");
|
||||
HTM_Txt (CtyName);
|
||||
|
@ -1089,7 +1089,7 @@ static void Cty_ListCountriesForEdition (void)
|
|||
Ico_PutIconRemovalNotAllowed ();
|
||||
else
|
||||
Ico_PutContextualIconToRemove (ActRemCty,NULL,
|
||||
Cty_PutParamOtherCtyCod,&Cty->CtyCod);
|
||||
Cty_PutParOthCtyCod,&Cty->CtyCod);
|
||||
HTM_TD_End ();
|
||||
|
||||
/* Numerical country code (ISO 3166-1) */
|
||||
|
@ -1135,7 +1135,7 @@ static void Cty_ListCountriesForEdition (void)
|
|||
/* Name */
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
Frm_BeginForm (ActRenCty);
|
||||
Cty_PutParamOtherCtyCod (&Cty->CtyCod);
|
||||
Par_PutParCode (Par_OthCtyCod,Cty->CtyCod);
|
||||
Par_PutParUnsigned (NULL,"Lan",(unsigned) Lan);
|
||||
HTM_INPUT_TEXT ("Name",Cty_MAX_CHARS_NAME,Cty->Name[Lan],
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
|
@ -1147,7 +1147,7 @@ static void Cty_ListCountriesForEdition (void)
|
|||
/* WWW */
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
Frm_BeginForm (ActChgCtyWWW);
|
||||
Cty_PutParamOtherCtyCod (&Cty->CtyCod);
|
||||
Par_PutParCode (Par_OthCtyCod,Cty->CtyCod);
|
||||
Par_PutParUnsigned (NULL,"Lan",(unsigned) Lan);
|
||||
HTM_INPUT_URL ("WWW",Cty->WWW[Lan],HTM_SUBMIT_ON_CHANGE,
|
||||
"class=\"INPUT_WWW_NARROW INPUT_%s\""
|
||||
|
@ -1168,16 +1168,7 @@ static void Cty_ListCountriesForEdition (void)
|
|||
/******************** Write parameter with code of country *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Cty_PutParamCtyCod (long CtyCod)
|
||||
{
|
||||
Par_PutParLong (NULL,"cty",CtyCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** Write parameter with code of country *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Cty_PutParamOtherCtyCod (void *CtyCod)
|
||||
static void Cty_PutParOthCtyCod (void *CtyCod)
|
||||
{
|
||||
if (CtyCod)
|
||||
Par_PutParCode (Par_OthCtyCod,*((long *) CtyCod));
|
||||
|
@ -1251,7 +1242,7 @@ void Cty_RenameCountry (void)
|
|||
extern const char *Txt_The_name_X_has_not_changed;
|
||||
char NewCtyName[Cty_MAX_BYTES_NAME + 1];
|
||||
Lan_Language_t Language;
|
||||
char FieldName[4 + 1 + 2 + 1]; // Example: "Name_en"
|
||||
char FldName[4 + 1 + 2 + 1]; // Example: "Name_en"
|
||||
|
||||
/***** Country constructor *****/
|
||||
Cty_EditingCountryConstructor ();
|
||||
|
@ -1260,7 +1251,7 @@ void Cty_RenameCountry (void)
|
|||
Cty_EditingCty->CtyCod = Par_GetAndCheckParCode (Par_OthCtyCod);
|
||||
|
||||
/***** Get the lenguage *****/
|
||||
Language = Lan_GetParamLanguage ();
|
||||
Language = Lan_GetParLanguage ();
|
||||
|
||||
/***** Get the new name for the country *****/
|
||||
Par_GetParText ("Name",NewCtyName,Cty_MAX_BYTES_NAME);
|
||||
|
@ -1285,9 +1276,9 @@ void Cty_RenameCountry (void)
|
|||
else
|
||||
{
|
||||
/* Update the table changing old name by new name */
|
||||
snprintf (FieldName,sizeof (FieldName),"Name_%s",
|
||||
snprintf (FldName,sizeof (FldName),"Name_%s",
|
||||
Lan_STR_LANG_ID[Language]);
|
||||
Cty_UpdateCtyName (Cty_EditingCty->CtyCod,FieldName,NewCtyName);
|
||||
Cty_UpdateCtyName (Cty_EditingCty->CtyCod,FldName,NewCtyName);
|
||||
|
||||
/* Write message to show the change made */
|
||||
Ale_CreateAlert (Ale_SUCCESS,NULL,
|
||||
|
@ -1311,10 +1302,10 @@ void Cty_RenameCountry (void)
|
|||
/************ Update institution name in table of institutions ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Cty_UpdateCtyName (long CtyCod,const char *FieldName,const char *NewCtyName)
|
||||
static void Cty_UpdateCtyName (long CtyCod,const char *FldName,const char *NewCtyName)
|
||||
{
|
||||
/***** Update country changing old name by new name */
|
||||
Cty_DB_UpdateCtyField (CtyCod,FieldName,NewCtyName);
|
||||
Cty_DB_UpdateCtyField (CtyCod,FldName,NewCtyName);
|
||||
|
||||
/***** Flush cache *****/
|
||||
Cty_FlushCacheCountryName ();
|
||||
|
@ -1330,7 +1321,7 @@ void Cty_ChangeCtyWWW (void)
|
|||
extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
|
||||
char NewWWW[Cns_MAX_BYTES_WWW + 1];
|
||||
Lan_Language_t Language;
|
||||
char FieldName[3 + 1 + 2 + 1]; // Example: "WWW_en"
|
||||
char FldName[3 + 1 + 2 + 1]; // Example: "WWW_en"
|
||||
|
||||
/***** Country constructor *****/
|
||||
Cty_EditingCountryConstructor ();
|
||||
|
@ -1339,7 +1330,7 @@ void Cty_ChangeCtyWWW (void)
|
|||
Cty_EditingCty->CtyCod = Par_GetAndCheckParCode (Par_OthCtyCod);
|
||||
|
||||
/***** Get the lenguage *****/
|
||||
Language = Lan_GetParamLanguage ();
|
||||
Language = Lan_GetParLanguage ();
|
||||
|
||||
/***** Get the new WWW for the country *****/
|
||||
Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
||||
|
@ -1348,9 +1339,9 @@ void Cty_ChangeCtyWWW (void)
|
|||
Cty_GetDataOfCountryByCod (Cty_EditingCty);
|
||||
|
||||
/***** Update the table changing old WWW by new WWW *****/
|
||||
snprintf (FieldName,sizeof (FieldName),"Name_%s",
|
||||
snprintf (FldName,sizeof (FldName),"Name_%s",
|
||||
Lan_STR_LANG_ID[Language]);
|
||||
Cty_DB_UpdateCtyField (Cty_EditingCty->CtyCod,FieldName,NewWWW);
|
||||
Cty_DB_UpdateCtyField (Cty_EditingCty->CtyCod,FldName,NewWWW);
|
||||
Str_Copy (Cty_EditingCty->WWW[Language],NewWWW,
|
||||
sizeof (Cty_EditingCty->WWW[Language]) - 1);
|
||||
|
||||
|
@ -1389,7 +1380,7 @@ static void Cty_ShowAlertAndButtonToGoToCty (void)
|
|||
{
|
||||
/***** Alert with button to go to couuntry *****/
|
||||
Ale_ShowLastAlertAndButton (ActSeeIns,NULL,NULL,
|
||||
Cty_PutParamGoToCty,&Cty_EditingCty->CtyCod,
|
||||
Cty_PutParGoToCty,&Cty_EditingCty->CtyCod,
|
||||
Btn_CONFIRM_BUTTON,
|
||||
Str_BuildGoToTitle (Cty_EditingCty->Name[Gbl.Prefs.Language]));
|
||||
Str_FreeGoToTitle ();
|
||||
|
@ -1399,11 +1390,10 @@ static void Cty_ShowAlertAndButtonToGoToCty (void)
|
|||
Ale_ShowAlerts (NULL);
|
||||
}
|
||||
|
||||
static void Cty_PutParamGoToCty (void *CtyCod)
|
||||
static void Cty_PutParGoToCty (void *CtyCod)
|
||||
{
|
||||
if (CtyCod)
|
||||
/***** Put parameter *****/
|
||||
Cty_PutParamCtyCod (*((long *) CtyCod));
|
||||
Par_PutParCode (Par_CtyCod,*((long *) CtyCod));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1556,7 +1546,7 @@ void Cty_ReceiveFormNewCountry (void)
|
|||
extern const char *Txt_The_country_X_already_exists;
|
||||
extern const char *Txt_You_must_specify_the_name;
|
||||
extern const char *Txt_Created_new_country_X;
|
||||
char ParamName[32];
|
||||
char ParName[32];
|
||||
bool CreateCountry = true;
|
||||
Lan_Language_t Lan;
|
||||
unsigned i;
|
||||
|
@ -1611,8 +1601,8 @@ void Cty_ReceiveFormNewCountry (void)
|
|||
Lan <= (Lan_Language_t) Lan_NUM_LANGUAGES;
|
||||
Lan++)
|
||||
{
|
||||
snprintf (ParamName,sizeof (ParamName),"Name_%s",Lan_STR_LANG_ID[Lan]);
|
||||
Par_GetParText (ParamName,Cty_EditingCty->Name[Lan],Cty_MAX_BYTES_NAME);
|
||||
snprintf (ParName,sizeof (ParName),"Name_%s",Lan_STR_LANG_ID[Lan]);
|
||||
Par_GetParText (ParName,Cty_EditingCty->Name[Lan],Cty_MAX_BYTES_NAME);
|
||||
|
||||
if (Cty_EditingCty->Name[Lan][0]) // If there's a country name
|
||||
{
|
||||
|
@ -1634,8 +1624,8 @@ void Cty_ReceiveFormNewCountry (void)
|
|||
break;
|
||||
}
|
||||
|
||||
snprintf (ParamName,sizeof (ParamName),"WWW_%s",Lan_STR_LANG_ID[Lan]);
|
||||
Par_GetParText (ParamName,Cty_EditingCty->WWW[Lan],Cns_MAX_BYTES_WWW);
|
||||
snprintf (ParName,sizeof (ParName),"WWW_%s",Lan_STR_LANG_ID[Lan]);
|
||||
Par_GetParText (ParName,Cty_EditingCty->WWW[Lan],Cns_MAX_BYTES_WWW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1883,7 +1873,7 @@ static void Cty_FormToGoToMap (struct Cty_Countr *Cty)
|
|||
{
|
||||
Cty_EditingCty = Cty; // Used to pass parameter with the code of the country
|
||||
Lay_PutContextualLinkOnlyIcon (ActSeeCtyInf,NULL,
|
||||
Cty_PutParamGoToCty,&Cty_EditingCty->CtyCod,
|
||||
Cty_PutParGoToCty,&Cty_EditingCty->CtyCod,
|
||||
"map-marker-alt.svg",Ico_BLACK);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ void Cty_DrawCountryMap (struct Cty_Countr *Cty,const char *Class);
|
|||
bool Cty_CheckIfCountryPhotoExists (struct Cty_Countr *Cty);
|
||||
|
||||
void Cty_WriteScriptGoogleGeochart (void);
|
||||
void Cty_PutHiddenParamCtyOrder (void);
|
||||
void Cty_PutParCtyOrder (void);
|
||||
void Cty_EditCountries (void);
|
||||
void Cty_GetBasicListOfCountries (void);
|
||||
void Cty_GetFullListOfCountries (void);
|
||||
|
@ -103,7 +103,6 @@ bool Cty_GetDataOfCountryByCod (struct Cty_Countr *Cty);
|
|||
void Cty_FlushCacheCountryName (void);
|
||||
void Cty_GetCountryName (long CtyCod,Lan_Language_t Language,
|
||||
char CtyName[Cty_MAX_BYTES_NAME + 1]);
|
||||
void Cty_PutParamCtyCod (long CtyCod);
|
||||
void Cty_RemoveCountry (void);
|
||||
void Cty_RenameCountry (void);
|
||||
void Cty_ChangeCtyWWW (void);
|
||||
|
|
|
@ -425,7 +425,7 @@ static void CtyCfg_Name (bool PutLink)
|
|||
|
||||
static void CtyCfg_Shortcut (bool PrintView)
|
||||
{
|
||||
HieCfg_Shortcut (PrintView,"cty",Gbl.Hierarchy.Cty.CtyCod);
|
||||
HieCfg_Shortcut (PrintView,Par_CtyCod,Gbl.Hierarchy.Cty.CtyCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -434,7 +434,7 @@ static void CtyCfg_Shortcut (bool PrintView)
|
|||
|
||||
static void CtyCfg_QR (void)
|
||||
{
|
||||
HieCfg_QR ("cty",Gbl.Hierarchy.Cty.CtyCod);
|
||||
HieCfg_QR (Par_CtyCod,Gbl.Hierarchy.Cty.CtyCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -478,7 +478,7 @@ static void CtyCfg_NumInss (void)
|
|||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LT DAT_%s\"",The_GetSuffix ());
|
||||
Frm_BeginFormGoTo (ActSeeIns);
|
||||
Cty_PutParamCtyCod (Gbl.Hierarchy.Cty.CtyCod);
|
||||
Par_PutParCode (Par_CtyCod,Gbl.Hierarchy.Cty.CtyCod);
|
||||
if (asprintf (&Title,Txt_Institutions_of_COUNTRY_X,
|
||||
Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language]) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
|
|
|
@ -516,13 +516,13 @@ bool Cty_DB_CheckIfMapIsAvailable (long CtyCod)
|
|||
/******** Update country changing old field value by new field value *********/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Cty_DB_UpdateCtyField (long CtyCod,const char *FieldName,const char *FieldValue)
|
||||
void Cty_DB_UpdateCtyField (long CtyCod,const char *FldName,const char *FldValue)
|
||||
{
|
||||
DB_QueryUPDATE ("can not update a field value of a country",
|
||||
"UPDATE cty_countrs"
|
||||
" SET %s='%s'"
|
||||
" WHERE CtyCod='%03ld'",
|
||||
FieldName,FieldValue,
|
||||
FldName,FldValue,
|
||||
CtyCod);
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ unsigned Cty_DB_GetCtrsWithCoordsInCurrentCty (MYSQL_RES **mysql_res);
|
|||
unsigned Cty_DB_GetMapAttr (MYSQL_RES **mysql_res,long CtyCod);
|
||||
bool Cty_DB_CheckIfMapIsAvailable (long CtyCod);
|
||||
|
||||
void Cty_DB_UpdateCtyField (long CtyCod,const char *FieldName,const char *FieldValue);
|
||||
void Cty_DB_UpdateCtyField (long CtyCod,const char *FldName,const char *FldValue);
|
||||
void Cty_DB_UpdateCtyMapAttr (const char NewMapAttribution[Med_MAX_BYTES_ATTRIBUTION + 1]);
|
||||
|
||||
unsigned Cty_DB_GetCtysFromUsr (MYSQL_RES **mysql_res,long UsrCod);
|
||||
|
|
|
@ -107,7 +107,7 @@ static void Crs_PutFormToCreateCourse (void);
|
|||
static void Crs_PutHeadCoursesForSeeing (void);
|
||||
static void Crs_PutHeadCoursesForEdition (void);
|
||||
static void Crs_ReceiveFormRequestOrCreateCrs (Hie_Status_t Status);
|
||||
static void Crs_GetParamsNewCourse (struct Crs_Course *Crs);
|
||||
static void Crs_GetParsNewCourse (struct Crs_Course *Crs);
|
||||
|
||||
static void Crs_GetDataOfCourseFromRow (struct Crs_Course *Crs,MYSQL_ROW row);
|
||||
|
||||
|
@ -187,7 +187,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
IsLastItemInLevel[1] = true;
|
||||
Lay_IndentDependingOnLevel (1,IsLastItemInLevel);
|
||||
Frm_BeginForm (ActMyCrs);
|
||||
Cty_PutParamCtyCod (-1L);
|
||||
// Cty_PutParCtyCod (-1L);
|
||||
HTM_BUTTON_Submit_Begin (Txt_System,
|
||||
"class=\"BT_LINK FORM_IN_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
@ -219,7 +219,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
IsLastItemInLevel[2] = (NumCty == NumCtys - 1);
|
||||
Lay_IndentDependingOnLevel (2,IsLastItemInLevel);
|
||||
Frm_BeginForm (ActMyCrs);
|
||||
Cty_PutParamCtyCod (Hie.Cty.CtyCod);
|
||||
Par_PutParCode (Par_CtyCod,Hie.Cty.CtyCod);
|
||||
HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeCtyInf),
|
||||
"class=\"BT_LINK FORM_IN_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
@ -253,7 +253,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
IsLastItemInLevel[3] = (NumIns == NumInss - 1);
|
||||
Lay_IndentDependingOnLevel (3,IsLastItemInLevel);
|
||||
Frm_BeginForm (ActMyCrs);
|
||||
Ins_PutParamInsCod (Hie.Ins.InsCod);
|
||||
Par_PutParCode (Par_InsCod,Hie.Ins.InsCod);
|
||||
HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeInsInf),
|
||||
"class=\"BT_LINK FORM_IN_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
@ -287,7 +287,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
IsLastItemInLevel[4] = (NumCtr == NumCtrs - 1);
|
||||
Lay_IndentDependingOnLevel (4,IsLastItemInLevel);
|
||||
Frm_BeginForm (ActMyCrs);
|
||||
Ctr_PutParamCtrCod (Hie.Ctr.CtrCod);
|
||||
Par_PutParCode (Par_CtrCod,Hie.Ctr.CtrCod);
|
||||
HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeCtrInf),
|
||||
"class=\"BT_LINK FORM_IN_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
@ -321,7 +321,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
IsLastItemInLevel[5] = (NumDeg == NumDegs - 1);
|
||||
Lay_IndentDependingOnLevel (5,IsLastItemInLevel);
|
||||
Frm_BeginForm (ActMyCrs);
|
||||
Deg_PutParamDegCod (Hie.Deg.DegCod);
|
||||
Par_PutParCode (Par_DegCod,Hie.Deg.DegCod);
|
||||
HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeDegInf),
|
||||
"class=\"BT_LINK FORM_IN_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
@ -355,7 +355,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
IsLastItemInLevel[6] = (NumCrs == NumCrss - 1);
|
||||
Lay_IndentDependingOnLevel (6,IsLastItemInLevel);
|
||||
Frm_BeginForm (ActMyCrs);
|
||||
Crs_PutParamCrsCod (Hie.Crs.CrsCod);
|
||||
Par_PutParCode (Par_CrsCod,Hie.Crs.CrsCod);
|
||||
HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (Hie.Crs.ShrtName),
|
||||
"class=\"BT_LINK FORM_IN_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
@ -994,7 +994,7 @@ static bool Crs_ListCoursesOfAYearForSeeing (unsigned Year)
|
|||
HTM_TD_Begin ("class=\"LM %s_%s %s\"",
|
||||
TxtClassStrong,The_GetSuffix (),BgColor);
|
||||
Frm_BeginFormGoTo (ActSeeCrsInf);
|
||||
Crs_PutParamCrsCod (Crs->CrsCod);
|
||||
Par_PutParCode (Par_CrsCod,Crs->CrsCod);
|
||||
HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (Crs->FullName),
|
||||
"class=\"LM BT_LINK\"");
|
||||
Str_FreeGoToTitle ();
|
||||
|
@ -1175,7 +1175,7 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year)
|
|||
Ico_PutIconRemovalNotAllowed ();
|
||||
else // Crs->NumUsrs == 0 && ICanEdit
|
||||
Ico_PutContextualIconToRemove (ActRemCrs,NULL,
|
||||
Hie_PutParamOtherHieCod,&Crs->CrsCod);
|
||||
Hie_PutParOtherHieCod,&Crs->CrsCod);
|
||||
HTM_TD_End ();
|
||||
|
||||
/* Course code */
|
||||
|
@ -1188,7 +1188,7 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year)
|
|||
if (ICanEdit)
|
||||
{
|
||||
Frm_BeginForm (ActChgInsCrsCod);
|
||||
Hie_PutParamOtherHieCod (&Crs->CrsCod);
|
||||
Par_PutParCode (Par_OthHieCod,Crs->CrsCod);
|
||||
HTM_INPUT_TEXT ("InsCrsCod",Crs_MAX_CHARS_INSTITUTIONAL_CRS_COD,
|
||||
Crs->InstitutionalCrsCod,HTM_SUBMIT_ON_CHANGE,
|
||||
"class=\"INPUT_INS_CODE INPUT_%s\"",
|
||||
|
@ -1204,7 +1204,7 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year)
|
|||
if (ICanEdit)
|
||||
{
|
||||
Frm_BeginForm (ActChgCrsYea);
|
||||
Hie_PutParamOtherHieCod (&Crs->CrsCod);
|
||||
Par_PutParCode (Par_OthHieCod,Crs->CrsCod);
|
||||
HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,
|
||||
"name=\"OthCrsYear\""
|
||||
" class=\"HIE_SEL_NARROW INPUT_%s\"",
|
||||
|
@ -1229,7 +1229,7 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year)
|
|||
if (ICanEdit)
|
||||
{
|
||||
Frm_BeginForm (ActRenCrsSho);
|
||||
Hie_PutParamOtherHieCod (&Crs->CrsCod);
|
||||
Par_PutParCode (Par_OthHieCod,Crs->CrsCod);
|
||||
HTM_INPUT_TEXT ("ShortName",Cns_HIERARCHY_MAX_CHARS_SHRT_NAME,Crs->ShrtName,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"class=\"INPUT_SHORT_NAME INPUT_%s\"",
|
||||
|
@ -1245,7 +1245,7 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year)
|
|||
if (ICanEdit)
|
||||
{
|
||||
Frm_BeginForm (ActRenCrsFul);
|
||||
Hie_PutParamOtherHieCod (&Crs->CrsCod);
|
||||
Par_PutParCode (Par_OthHieCod,Crs->CrsCod);
|
||||
HTM_INPUT_TEXT ("FullName",Cns_HIERARCHY_MAX_CHARS_FULL_NAME,Crs->FullName,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"class=\"INPUT_FULL_NAME INPUT_%s\"",
|
||||
|
@ -1509,7 +1509,7 @@ static void Crs_ReceiveFormRequestOrCreateCrs (Hie_Status_t Status)
|
|||
Crs_EditingCrs->DegCod = Gbl.Hierarchy.Deg.DegCod;
|
||||
|
||||
/* Get parameters of the new course */
|
||||
Crs_GetParamsNewCourse (Crs_EditingCrs);
|
||||
Crs_GetParsNewCourse (Crs_EditingCrs);
|
||||
|
||||
/***** Check if year is correct *****/
|
||||
if (Crs_EditingCrs->Year <= Deg_MAX_YEARS_PER_DEGREE) // If year is valid
|
||||
|
@ -1549,7 +1549,7 @@ static void Crs_ReceiveFormRequestOrCreateCrs (Hie_Status_t Status)
|
|||
/************** Get the parameters of a new course from form *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Crs_GetParamsNewCourse (struct Crs_Course *Crs)
|
||||
static void Crs_GetParsNewCourse (struct Crs_Course *Crs)
|
||||
{
|
||||
char YearStr[2 + 1];
|
||||
|
||||
|
@ -1968,23 +1968,23 @@ void Crs_RenameCourse (struct Crs_Course *Crs,Cns_ShrtOrFullName_t ShrtOrFullNam
|
|||
extern const char *Txt_The_course_X_already_exists;
|
||||
extern const char *Txt_The_course_X_has_been_renamed_as_Y;
|
||||
extern const char *Txt_The_name_X_has_not_changed;
|
||||
const char *ParamName = NULL; // Initialized to avoid warning
|
||||
const char *FieldName = NULL; // Initialized to avoid warning
|
||||
unsigned MaxBytes = 0; // Initialized to avoid warning
|
||||
char *CurrentCrsName = NULL; // Initialized to avoid warning
|
||||
const char *ParName = NULL; // Initialized to avoid warning
|
||||
const char *FldName = NULL; // Initialized to avoid warning
|
||||
unsigned MaxBytes = 0; // Initialized to avoid warning
|
||||
char *CurrentCrsName = NULL; // Initialized to avoid warning
|
||||
char NewCrsName[Cns_HIERARCHY_MAX_BYTES_FULL_NAME + 1];
|
||||
|
||||
switch (ShrtOrFullName)
|
||||
{
|
||||
case Cns_SHRT_NAME:
|
||||
ParamName = "ShortName";
|
||||
FieldName = "ShortName";
|
||||
ParName = "ShortName";
|
||||
FldName = "ShortName";
|
||||
MaxBytes = Cns_HIERARCHY_MAX_BYTES_SHRT_NAME;
|
||||
CurrentCrsName = Crs->ShrtName;
|
||||
break;
|
||||
case Cns_FULL_NAME:
|
||||
ParamName = "FullName";
|
||||
FieldName = "FullName";
|
||||
ParName = "FullName";
|
||||
FldName = "FullName";
|
||||
MaxBytes = Cns_HIERARCHY_MAX_BYTES_FULL_NAME;
|
||||
CurrentCrsName = Crs->FullName;
|
||||
break;
|
||||
|
@ -1992,7 +1992,7 @@ void Crs_RenameCourse (struct Crs_Course *Crs,Cns_ShrtOrFullName_t ShrtOrFullNam
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get the new name for the course */
|
||||
Par_GetParText (ParamName,NewCrsName,MaxBytes);
|
||||
Par_GetParText (ParName,NewCrsName,MaxBytes);
|
||||
|
||||
/***** Get from the database the data of the degree *****/
|
||||
Crs_GetDataOfCourseByCod (Crs);
|
||||
|
@ -2007,7 +2007,7 @@ void Crs_RenameCourse (struct Crs_Course *Crs,Cns_ShrtOrFullName_t ShrtOrFullNam
|
|||
if (strcmp (CurrentCrsName,NewCrsName)) // Different names
|
||||
{
|
||||
/***** If course was in database... *****/
|
||||
if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg (ParamName,NewCrsName,Crs->CrsCod,
|
||||
if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg (ParName,NewCrsName,Crs->CrsCod,
|
||||
Crs->DegCod,Crs->Year))
|
||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||
Txt_The_course_X_already_exists,
|
||||
|
@ -2015,7 +2015,7 @@ void Crs_RenameCourse (struct Crs_Course *Crs,Cns_ShrtOrFullName_t ShrtOrFullNam
|
|||
else
|
||||
{
|
||||
/* Update the table changing old name by new name */
|
||||
Crs_DB_UpdateCrsName (Crs->CrsCod,FieldName,NewCrsName);
|
||||
Crs_DB_UpdateCrsName (Crs->CrsCod,FldName,NewCrsName);
|
||||
|
||||
/* Create alert to show the change made */
|
||||
Ale_CreateAlert (Ale_SUCCESS,NULL,
|
||||
|
@ -2054,7 +2054,7 @@ void Crs_ChangeCrsStatus (void)
|
|||
Crs_EditingCrs->CrsCod = Par_GetAndCheckParCode (Par_OthHieCod);
|
||||
|
||||
/* Get parameter with status */
|
||||
Status = Hie_GetParamStatus (); // New status
|
||||
Status = Hie_GetParStatus (); // New status
|
||||
|
||||
/***** Get data of course *****/
|
||||
Crs_GetDataOfCourseByCod (Crs_EditingCrs);
|
||||
|
@ -2138,7 +2138,7 @@ static void Crs_PutButtonToGoToCrs (void)
|
|||
if (Crs_EditingCrs->CrsCod != Gbl.Hierarchy.Crs.CrsCod)
|
||||
{
|
||||
Frm_BeginForm (ActSeeCrsInf);
|
||||
Crs_PutParamCrsCod (Crs_EditingCrs->CrsCod);
|
||||
Par_PutParCode (Par_CrsCod,Crs_EditingCrs->CrsCod);
|
||||
Btn_PutConfirmButton (Str_BuildGoToTitle (Crs_EditingCrs->ShrtName));
|
||||
Str_FreeGoToTitle ();
|
||||
Frm_EndForm ();
|
||||
|
@ -2157,7 +2157,7 @@ static void Crs_PutButtonToRegisterInCrs (void)
|
|||
Frm_BeginForm (ActReqSignUp);
|
||||
// If the course being edited is different to the current one...
|
||||
if (Crs_EditingCrs->CrsCod != Gbl.Hierarchy.Crs.CrsCod)
|
||||
Crs_PutParamCrsCod (Crs_EditingCrs->CrsCod);
|
||||
Par_PutParCode (Par_CrsCod,Crs_EditingCrs->CrsCod);
|
||||
|
||||
if (asprintf (&TxtButton,Txt_Register_me_in_X,Crs_EditingCrs->ShrtName) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
|
@ -2192,7 +2192,7 @@ void Crs_ReqSelectOneOfMyCourses (void)
|
|||
static void Crs_PutIconToSearchCourses (__attribute__((unused)) void *Args)
|
||||
{
|
||||
Lay_PutContextualLinkOnlyIcon (ActReqSch,NULL,
|
||||
Sch_PutLinkToSearchCoursesParams,NULL,
|
||||
Sch_PutLinkToSearchCoursesPars,NULL,
|
||||
"search.svg",Ico_BLACK);
|
||||
}
|
||||
|
||||
|
@ -2231,15 +2231,6 @@ void Crs_PutIconToSelectMyCourses (__attribute__((unused)) void *Args)
|
|||
"sitemap.svg",Ico_BLACK);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** Write parameter with code of course ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Crs_PutParamCrsCod (long CrsCod)
|
||||
{
|
||||
Par_PutParLong (NULL,"crs",CrsCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************** Write courses of a user **************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -2454,7 +2445,7 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA
|
|||
HTM_TD_Begin ("class=\"LT %s_%s %s\"",
|
||||
ClassTxt,The_GetSuffix (),BgColor);
|
||||
Frm_BeginFormGoTo (ActSeeDegInf);
|
||||
Deg_PutParamDegCod (Deg.DegCod);
|
||||
Par_PutParCode (Par_DegCod,Deg.DegCod);
|
||||
HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (row[2]),
|
||||
"class=\"LT BT_LINK\"");
|
||||
Str_FreeGoToTitle ();
|
||||
|
@ -2474,7 +2465,7 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA
|
|||
HTM_TD_Begin ("class=\"LT %s_%s %s\"",
|
||||
ClassTxt,The_GetSuffix (),BgColor);
|
||||
Frm_BeginFormGoTo (ActSeeCrsInf);
|
||||
Crs_PutParamCrsCod (CrsCod);
|
||||
Par_PutParCode (Par_CrsCod,CrsCod);
|
||||
HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (row[5]),
|
||||
"class=\"LT BT_LINK\"");
|
||||
Str_FreeGoToTitle ();
|
||||
|
@ -2599,9 +2590,9 @@ void Crs_RemoveOldCrss (void)
|
|||
/***** Get parameter with number of months without access *****/
|
||||
MonthsWithoutAccess = (unsigned)
|
||||
Par_GetParUnsignedLong ("Months",
|
||||
Crs_MIN_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_CRSS,
|
||||
Crs_MAX_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_CRSS,
|
||||
UINT_MAX);
|
||||
Crs_MIN_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_CRSS,
|
||||
Crs_MAX_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_CRSS,
|
||||
UINT_MAX);
|
||||
if (MonthsWithoutAccess == UINT_MAX)
|
||||
Err_ShowErrorAndExit ("Wrong number of months without clicks.");
|
||||
SecondsWithoutAccess = (unsigned long) MonthsWithoutAccess * Dat_SECONDS_IN_ONE_MONTH;
|
||||
|
|
|
@ -125,7 +125,6 @@ void Crs_ContEditAfterChgCrs (void);
|
|||
|
||||
void Crs_PutIconToSelectMyCoursesInBreadcrumb (void);
|
||||
void Crs_PutIconToSelectMyCourses (__attribute__((unused)) void *Args);
|
||||
void Crs_PutParamCrsCod (long CrsCod);
|
||||
|
||||
void Crs_ReqSelectOneOfMyCourses (void);
|
||||
|
||||
|
|
|
@ -253,7 +253,7 @@ static void CrsCfg_Degree (bool PrintView,bool PutForm)
|
|||
if (!PrintView)
|
||||
{
|
||||
Frm_BeginFormGoTo (ActSeeDegInf);
|
||||
Deg_PutParamDegCod (Gbl.Hierarchy.Deg.DegCod);
|
||||
Par_PutParCode (Par_DegCod,Gbl.Hierarchy.Deg.DegCod);
|
||||
HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (Gbl.Hierarchy.Deg.ShrtName),
|
||||
"class=\"LT BT_LINK\"");
|
||||
Str_FreeGoToTitle ();
|
||||
|
@ -404,7 +404,7 @@ static void CrsCfg_InternalCode (void)
|
|||
|
||||
static void CrsCfg_Shortcut (bool PrintView)
|
||||
{
|
||||
HieCfg_Shortcut (PrintView,"crs",Gbl.Hierarchy.Crs.CrsCod);
|
||||
HieCfg_Shortcut (PrintView,Par_CrsCod,Gbl.Hierarchy.Crs.CrsCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -413,7 +413,7 @@ static void CrsCfg_Shortcut (bool PrintView)
|
|||
|
||||
static void CrsCfg_QR (void)
|
||||
{
|
||||
HieCfg_QR ("crs",Gbl.Hierarchy.Crs.CrsCod);
|
||||
HieCfg_QR (Par_CrsCod,Gbl.Hierarchy.Crs.CrsCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -212,7 +212,7 @@ bool Crs_DB_CheckIfCrsCodExists (long CrsCod)
|
|||
/********** Check if the name of course exists in existing courses ***********/
|
||||
/*****************************************************************************/
|
||||
|
||||
bool Crs_DB_CheckIfCrsNameExistsInYearOfDeg (const char *FieldName,const char *Name,long CrsCod,
|
||||
bool Crs_DB_CheckIfCrsNameExistsInYearOfDeg (const char *FldName,const char *Name,long CrsCod,
|
||||
long DegCod,unsigned Year)
|
||||
{
|
||||
return
|
||||
|
@ -226,7 +226,7 @@ bool Crs_DB_CheckIfCrsNameExistsInYearOfDeg (const char *FieldName,const char *N
|
|||
" AND CrsCod<>%ld)",
|
||||
DegCod,
|
||||
Year,
|
||||
FieldName,
|
||||
FldName,
|
||||
Name,
|
||||
CrsCod);
|
||||
}
|
||||
|
@ -502,13 +502,13 @@ void Crs_DB_UpdateCrsYear (long CrsCod,unsigned NewYear)
|
|||
/***************** Update course name in table of courses ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Crs_DB_UpdateCrsName (long CrsCod,const char *FieldName,const char *NewCrsName)
|
||||
void Crs_DB_UpdateCrsName (long CrsCod,const char *FldName,const char *NewCrsName)
|
||||
{
|
||||
DB_QueryUPDATE ("can not update the name of a course",
|
||||
"UPDATE crs_courses"
|
||||
" SET %s='%s'"
|
||||
" WHERE CrsCod=%ld",
|
||||
FieldName,NewCrsName,
|
||||
FldName,NewCrsName,
|
||||
CrsCod);
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ void Crs_DB_GetShortNamesByCod (long CrsCod,
|
|||
char CrsShortName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1],
|
||||
char DegShortName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1]);
|
||||
bool Crs_DB_CheckIfCrsCodExists (long CrsCod);
|
||||
bool Crs_DB_CheckIfCrsNameExistsInYearOfDeg (const char *FieldName,const char *Name,long CrsCod,
|
||||
bool Crs_DB_CheckIfCrsNameExistsInYearOfDeg (const char *FldName,const char *Name,long CrsCod,
|
||||
long DegCod,unsigned Year);
|
||||
unsigned Crs_DB_GetCrssOfAUsr (MYSQL_RES **mysql_res,long UsrCod,Rol_Role_t Role);
|
||||
unsigned Crs_DB_GetOldCrss (MYSQL_RES **mysql_res,unsigned long SecondsWithoutAccess);
|
||||
|
@ -66,7 +66,7 @@ unsigned Crs_DB_GetCrssFromUsr (MYSQL_RES **mysql_res,long UsrCod,long DegCod);
|
|||
|
||||
void Crs_DB_UpdateInstitutionalCrsCod (long CrsCod,const char *NewInstitutionalCrsCod);
|
||||
void Crs_DB_UpdateCrsYear (long CrsCod,unsigned NewYear);
|
||||
void Crs_DB_UpdateCrsName (long CrsCod,const char *FieldName,const char *NewCrsName);
|
||||
void Crs_DB_UpdateCrsName (long CrsCod,const char *FldName,const char *NewCrsName);
|
||||
void Crs_DB_UpdateCrsDeg (long CrsCod,long DegCod);
|
||||
void Crs_DB_UpdateCrsStatus (long CrsCod,Hie_Status_t Status);
|
||||
|
||||
|
|
60
swad_date.c
60
swad_date.c
|
@ -110,13 +110,13 @@ static struct
|
|||
.TimeSendInMicroseconds = 0L,
|
||||
};
|
||||
|
||||
static const char *Dat_ParamName[Dat_NUM_START_END_TIME] =
|
||||
static const char *Dat_ParName[Dat_NUM_START_END_TIME] =
|
||||
{
|
||||
[Dat_STR_TIME] = "Start",
|
||||
[Dat_END_TIME] = "End",
|
||||
};
|
||||
|
||||
static const char *Dat_ParamTimeUTCName[Dat_NUM_START_END_TIME] =
|
||||
static const char *Dat_ParTimeUTCName[Dat_NUM_START_END_TIME] =
|
||||
{
|
||||
[Dat_STR_TIME] = "StartTimeUTC",
|
||||
[Dat_END_TIME] = "EndTimeUTC",
|
||||
|
@ -127,7 +127,7 @@ static const char *Dat_ParamTimeUTCName[Dat_NUM_START_END_TIME] =
|
|||
/*****************************************************************************/
|
||||
|
||||
static void Dat_PutIconsDateFormat (__attribute__((unused)) void *Args);
|
||||
static unsigned Dat_GetParamDateFormat (void);
|
||||
static unsigned Dat_GetParDateFormat (void);
|
||||
|
||||
/*****************************************************************************/
|
||||
/*********************** Set/get start execution time ************************/
|
||||
|
@ -372,7 +372,7 @@ void Dat_PutScriptDateFormat (Dat_Format_t Format)
|
|||
void Dat_ChangeDateFormat (void)
|
||||
{
|
||||
/***** Get param with date format *****/
|
||||
Gbl.Prefs.DateFormat = Dat_GetParamDateFormat ();
|
||||
Gbl.Prefs.DateFormat = Dat_GetParDateFormat ();
|
||||
|
||||
/***** Store date format in database *****/
|
||||
if (Gbl.Usrs.Me.Logged)
|
||||
|
@ -386,12 +386,12 @@ void Dat_ChangeDateFormat (void)
|
|||
/********************** Get parameter with date format ***********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static Dat_Format_t Dat_GetParamDateFormat (void)
|
||||
static Dat_Format_t Dat_GetParDateFormat (void)
|
||||
{
|
||||
return (Dat_Format_t) Par_GetParUnsignedLong ("DateFormat",
|
||||
0L,
|
||||
(unsigned long) (Dat_NUM_OPTIONS_FORMAT - 1),
|
||||
(unsigned long) Dat_FORMAT_DEFAULT);
|
||||
0L,
|
||||
(unsigned long) (Dat_NUM_OPTIONS_FORMAT - 1),
|
||||
(unsigned long) Dat_FORMAT_DEFAULT);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -755,7 +755,7 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
|
|||
"adjustDateForm('%s');"
|
||||
"setUTCFromLocalDateTimeForm('%s');"
|
||||
"this.form.submit();return false;\"",
|
||||
Id,Dat_ParamName[StartEndTime],
|
||||
Id,Dat_ParName[StartEndTime],
|
||||
The_GetSuffix (),
|
||||
Id,Id);
|
||||
else
|
||||
|
@ -765,7 +765,7 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
|
|||
" onchange=\""
|
||||
"adjustDateForm('%s');"
|
||||
"setUTCFromLocalDateTimeForm('%s');\"",
|
||||
Id,Dat_ParamName[StartEndTime],
|
||||
Id,Dat_ParName[StartEndTime],
|
||||
The_GetSuffix (),
|
||||
Id,Id);
|
||||
for (Year = FirstYear;
|
||||
|
@ -786,7 +786,7 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
|
|||
"adjustDateForm('%s');"
|
||||
"setUTCFromLocalDateTimeForm('%s');"
|
||||
"this.form.submit();return false;\"",
|
||||
Id,Dat_ParamName[StartEndTime],
|
||||
Id,Dat_ParName[StartEndTime],
|
||||
The_GetSuffix (),
|
||||
Id,Id);
|
||||
else
|
||||
|
@ -796,7 +796,7 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
|
|||
" onchange=\""
|
||||
"adjustDateForm('%s');"
|
||||
"setUTCFromLocalDateTimeForm('%s');\"",
|
||||
Id,Dat_ParamName[StartEndTime],
|
||||
Id,Dat_ParName[StartEndTime],
|
||||
The_GetSuffix (),
|
||||
Id,Id);
|
||||
for (Month = 1;
|
||||
|
@ -815,7 +815,7 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
|
|||
" class=\"INPUT_%s\""
|
||||
" onchange=\"setUTCFromLocalDateTimeForm('%s');"
|
||||
"this.form.submit();return false;\"",
|
||||
Id,Dat_ParamName[StartEndTime],
|
||||
Id,Dat_ParName[StartEndTime],
|
||||
The_GetSuffix (),
|
||||
Id);
|
||||
else
|
||||
|
@ -823,7 +823,7 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
|
|||
"id=\"%sDay\" name=\"%sDay\""
|
||||
" class=\"INPUT_%s\""
|
||||
" onchange=\"setUTCFromLocalDateTimeForm('%s');\"",
|
||||
Id,Dat_ParamName[StartEndTime],
|
||||
Id,Dat_ParName[StartEndTime],
|
||||
The_GetSuffix (),
|
||||
Id);
|
||||
for (Day = 1;
|
||||
|
@ -842,7 +842,7 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
|
|||
" class=\"INPUT_%s\""
|
||||
" onchange=\"setUTCFromLocalDateTimeForm('%s');"
|
||||
"this.form.submit();return false;\"",
|
||||
Id,Dat_ParamName[StartEndTime],
|
||||
Id,Dat_ParName[StartEndTime],
|
||||
The_GetSuffix (),
|
||||
Id);
|
||||
else
|
||||
|
@ -850,7 +850,7 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
|
|||
"id=\"%sHour\" name=\"%sHour\""
|
||||
" class=\"INPUT_%s\""
|
||||
" onchange=\"setUTCFromLocalDateTimeForm('%s');\"",
|
||||
Id,Dat_ParamName[StartEndTime],
|
||||
Id,Dat_ParName[StartEndTime],
|
||||
The_GetSuffix (),
|
||||
Id);
|
||||
for (Hour = 0;
|
||||
|
@ -869,7 +869,7 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
|
|||
" class=\"INPUT_%s\""
|
||||
" onchange=\"setUTCFromLocalDateTimeForm('%s');"
|
||||
"this.form.submit();return false;\"",
|
||||
Id,Dat_ParamName[StartEndTime],
|
||||
Id,Dat_ParName[StartEndTime],
|
||||
The_GetSuffix (),
|
||||
Id);
|
||||
else
|
||||
|
@ -877,7 +877,7 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
|
|||
"id=\"%sMinute\" name=\"%sMinute\""
|
||||
" class=\"INPUT_%s\""
|
||||
" onchange=\"setUTCFromLocalDateTimeForm('%s');\"",
|
||||
Id,Dat_ParamName[StartEndTime],
|
||||
Id,Dat_ParName[StartEndTime],
|
||||
The_GetSuffix (),
|
||||
Id);
|
||||
for (Minute = 0;
|
||||
|
@ -898,7 +898,7 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
|
|||
" class=\"INPUT_%s\""
|
||||
" onchange=\"setUTCFromLocalDateTimeForm('%s');"
|
||||
"this.form.submit();return false;\"",
|
||||
Id,Dat_ParamName[StartEndTime],
|
||||
Id,Dat_ParName[StartEndTime],
|
||||
The_GetSuffix (),
|
||||
Id);
|
||||
else
|
||||
|
@ -906,7 +906,7 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
|
|||
"id=\"%sSecond\" name=\"%sSecond\""
|
||||
" class=\"INPUT_%s\""
|
||||
" onchange=\"setUTCFromLocalDateTimeForm('%s');\"",
|
||||
Id,Dat_ParamName[StartEndTime],
|
||||
Id,Dat_ParName[StartEndTime],
|
||||
The_GetSuffix (),
|
||||
Id);
|
||||
for (Second = 0;
|
||||
|
@ -925,7 +925,7 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
|
|||
/***** Hidden field with UTC time (seconds since 1970) used to send time *****/
|
||||
if (asprintf (&IdTimeUTC,"%sTimeUTC",Id) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
Par_PutParLong (IdTimeUTC,Dat_ParamTimeUTCName[StartEndTime],(long) TimeUTC);
|
||||
Par_PutParLong (IdTimeUTC,Dat_ParTimeUTCName[StartEndTime],(long) TimeUTC);
|
||||
free (IdTimeUTC);
|
||||
|
||||
/***** Script to set selectors to local date and time from UTC time *****/
|
||||
|
@ -947,7 +947,7 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
|
|||
|
||||
time_t Dat_GetTimeUTCFromForm (Dat_StartEndTime_t StartEndTime)
|
||||
{
|
||||
return Par_GetParLong (Dat_ParamTimeUTCName[StartEndTime]);
|
||||
return Par_GetParLong (Dat_ParTimeUTCName[StartEndTime]);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -956,7 +956,7 @@ time_t Dat_GetTimeUTCFromForm (Dat_StartEndTime_t StartEndTime)
|
|||
/**************** in minutes ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Dat_PutHiddenParBrowserTZDiff (void)
|
||||
void Dat_PutParBrowserTZDiff (void)
|
||||
{
|
||||
Par_PutParString ("BrowserTZName","BrowserTZName","");
|
||||
Par_PutParLong ("BrowserTZDiff","BrowserTZDiff",0);
|
||||
|
@ -1160,17 +1160,17 @@ void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear,
|
|||
/*************************** Get a date from a form **************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Dat_GetDateFromForm (const char *ParamNameDay,const char *ParamNameMonth,const char *ParamNameYear,
|
||||
void Dat_GetDateFromForm (const char *ParNameDay,const char *ParNameMonth,const char *ParNameYear,
|
||||
unsigned *Day,unsigned *Month,unsigned *Year)
|
||||
{
|
||||
/**** Get day ****/
|
||||
*Day = (unsigned) Par_GetParUnsignedLong (ParamNameDay ,1,31,0);
|
||||
*Day = (unsigned) Par_GetParUnsignedLong (ParNameDay ,1,31,0);
|
||||
|
||||
/**** Get month ****/
|
||||
*Month = (unsigned) Par_GetParUnsignedLong (ParamNameMonth,1,12,0);
|
||||
*Month = (unsigned) Par_GetParUnsignedLong (ParNameMonth,1,12,0);
|
||||
|
||||
/**** Get year ****/
|
||||
*Year = (unsigned) Par_GetParUnsignedLong (ParamNameYear ,0,UINT_MAX,0);
|
||||
*Year = (unsigned) Par_GetParUnsignedLong (ParNameYear ,0,UINT_MAX,0);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1199,10 +1199,10 @@ void Dat_SetIniEndDatesToRecentWeeks (void)
|
|||
/******** Write parameters of initial and final dates *****/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Dat_WriteParamsIniEndDates (void)
|
||||
void Dat_WriteParsIniEndDates (void)
|
||||
{
|
||||
Par_PutParUnsigned (NULL,Dat_ParamTimeUTCName[Dat_STR_TIME],Dat_Time.Range.TimeUTC[Dat_STR_TIME]);
|
||||
Par_PutParUnsigned (NULL,Dat_ParamTimeUTCName[Dat_END_TIME],Dat_Time.Range.TimeUTC[Dat_END_TIME]);
|
||||
Par_PutParUnsigned (NULL,Dat_ParTimeUTCName[Dat_STR_TIME],Dat_Time.Range.TimeUTC[Dat_STR_TIME]);
|
||||
Par_PutParUnsigned (NULL,Dat_ParTimeUTCName[Dat_END_TIME],Dat_Time.Range.TimeUTC[Dat_END_TIME]);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -179,19 +179,19 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
|
|||
bool SubmitFormOnChange);
|
||||
time_t Dat_GetTimeUTCFromForm (Dat_StartEndTime_t StartEndTime);
|
||||
|
||||
void Dat_PutHiddenParBrowserTZDiff (void);
|
||||
void Dat_PutParBrowserTZDiff (void);
|
||||
void Dat_GetBrowserTimeZone (char BrowserTimeZone[Dat_MAX_BYTES_TIME_ZONE + 1]);
|
||||
|
||||
void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear,
|
||||
const char *Id,
|
||||
struct Dat_Date *DateSelected,
|
||||
bool SubmitFormOnChange,bool Disabled);
|
||||
void Dat_GetDateFromForm (const char *ParamNameDay,const char *ParamNameMonth,const char *ParamNameYear,
|
||||
void Dat_GetDateFromForm (const char *ParNameDay,const char *ParNameMonth,const char *ParNameYear,
|
||||
unsigned *Day,unsigned *Month,unsigned *Year);
|
||||
|
||||
void Dat_SetIniEndDatesToPastAndNow (void);
|
||||
void Dat_SetIniEndDatesToRecentWeeks (void);
|
||||
void Dat_WriteParamsIniEndDates (void);
|
||||
void Dat_WriteParsIniEndDates (void);
|
||||
void Dat_GetIniEndDatesFromForm (void);
|
||||
|
||||
void Dat_WriteRFC822DateFromTM (FILE *File,struct tm *tm);
|
||||
|
|
|
@ -102,11 +102,12 @@ static void Deg_ReceiveFormRequestOrCreateDeg (Hie_Status_t Status);
|
|||
static void Deg_GetDataOfDegreeFromRow (struct Deg_Degree *Deg,MYSQL_ROW row);
|
||||
|
||||
static void Deg_ShowAlertAndButtonToGoToDeg (void);
|
||||
static void Deg_PutParamGoToDeg (void *DegCod);
|
||||
|
||||
static void Deg_EditingDegreeConstructor (void);
|
||||
static void Deg_EditingDegreeDestructor (void);
|
||||
|
||||
static void Deg_PutParDegCod (void *DegCod);
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************* List degrees with pending courses ***********************/
|
||||
/*****************************************************************************/
|
||||
|
@ -193,7 +194,7 @@ void Deg_DrawDegreeLogoAndNameWithLink (struct Deg_Degree *Deg,Act_Action_t Acti
|
|||
{
|
||||
/***** Begin form *****/
|
||||
Frm_BeginFormGoTo (Action);
|
||||
Deg_PutParamDegCod (Deg->DegCod);
|
||||
Par_PutParCode (Par_DegCod,Deg->DegCod);
|
||||
|
||||
/***** Link to action *****/
|
||||
HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (Deg->FullName),
|
||||
|
@ -351,7 +352,7 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
|
|||
Ico_PutIconRemovalNotAllowed ();
|
||||
else
|
||||
Ico_PutContextualIconToRemove (ActRemDeg,NULL,
|
||||
Hie_PutParamOtherHieCod,&Deg->DegCod);
|
||||
Hie_PutParOtherHieCod,&Deg->DegCod);
|
||||
HTM_TD_End ();
|
||||
|
||||
/* Degree code */
|
||||
|
@ -369,7 +370,7 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
|
|||
if (ICanEdit)
|
||||
{
|
||||
Frm_BeginForm (ActRenDegSho);
|
||||
Hie_PutParamOtherHieCod (&Deg->DegCod);
|
||||
Par_PutParCode (Par_OthHieCod,Deg->DegCod);
|
||||
HTM_INPUT_TEXT ("ShortName",Cns_HIERARCHY_MAX_CHARS_SHRT_NAME,Deg->ShrtName,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"class=\"INPUT_SHORT_NAME INPUT_%s\"",
|
||||
|
@ -385,7 +386,7 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
|
|||
if (ICanEdit)
|
||||
{
|
||||
Frm_BeginForm (ActRenDegFul);
|
||||
Hie_PutParamOtherHieCod (&Deg->DegCod);
|
||||
Par_PutParCode (Par_OthHieCod,Deg->DegCod);
|
||||
HTM_INPUT_TEXT ("FullName",Cns_HIERARCHY_MAX_CHARS_FULL_NAME,Deg->FullName,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"class=\"INPUT_FULL_NAME INPUT_%s\"",
|
||||
|
@ -401,7 +402,7 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
|
|||
if (ICanEdit)
|
||||
{
|
||||
Frm_BeginForm (ActChgDegTyp);
|
||||
Hie_PutParamOtherHieCod (&Deg->DegCod);
|
||||
Par_PutParCode (Par_OthHieCod,Deg->DegCod);
|
||||
HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,
|
||||
"name=\"OthDegTypCod\""
|
||||
" class=\"HIE_SEL_NARROW INPUT_%s\"",
|
||||
|
@ -432,7 +433,7 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
|
|||
if (ICanEdit)
|
||||
{
|
||||
Frm_BeginForm (ActChgDegWWW);
|
||||
Hie_PutParamOtherHieCod (&Deg->DegCod);
|
||||
Par_PutParCode (Par_OthHieCod,Deg->DegCod);
|
||||
HTM_INPUT_URL ("WWW",Deg->WWW,HTM_SUBMIT_ON_CHANGE,
|
||||
"class=\"INPUT_WWW_NARROW INPUT_%s\""
|
||||
" required=\"required\"",
|
||||
|
@ -1167,15 +1168,6 @@ void Deg_RemoveDegree (void)
|
|||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** Write parameter with code of degree ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Deg_PutParamDegCod (long DegCod)
|
||||
{
|
||||
Par_PutParLong (NULL,"deg",DegCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************* Get data of a degree from its code ********************/
|
||||
/*****************************************************************************/
|
||||
|
@ -1335,23 +1327,23 @@ void Deg_RenameDegree (struct Deg_Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFullNam
|
|||
extern const char *Txt_The_degree_X_already_exists;
|
||||
extern const char *Txt_The_degree_X_has_been_renamed_as_Y;
|
||||
extern const char *Txt_The_name_X_has_not_changed;
|
||||
const char *ParamName = NULL; // Initialized to avoid warning
|
||||
const char *FieldName = NULL; // Initialized to avoid warning
|
||||
unsigned MaxBytes = 0; // Initialized to avoid warning
|
||||
char *CurrentDegName = NULL; // Initialized to avoid warning
|
||||
const char *ParName = NULL; // Initialized to avoid warning
|
||||
const char *FldName = NULL; // Initialized to avoid warning
|
||||
unsigned MaxBytes = 0; // Initialized to avoid warning
|
||||
char *CurrentDegName = NULL; // Initialized to avoid warning
|
||||
char NewDegName[Cns_HIERARCHY_MAX_BYTES_FULL_NAME + 1];
|
||||
|
||||
switch (ShrtOrFullName)
|
||||
{
|
||||
case Cns_SHRT_NAME:
|
||||
ParamName = "ShortName";
|
||||
FieldName = "ShortName";
|
||||
ParName = "ShortName";
|
||||
FldName = "ShortName";
|
||||
MaxBytes = Cns_HIERARCHY_MAX_BYTES_SHRT_NAME;
|
||||
CurrentDegName = Deg->ShrtName;
|
||||
break;
|
||||
case Cns_FULL_NAME:
|
||||
ParamName = "FullName";
|
||||
FieldName = "FullName";
|
||||
ParName = "FullName";
|
||||
FldName = "FullName";
|
||||
MaxBytes = Cns_HIERARCHY_MAX_BYTES_FULL_NAME;
|
||||
CurrentDegName = Deg->FullName;
|
||||
break;
|
||||
|
@ -1359,7 +1351,7 @@ void Deg_RenameDegree (struct Deg_Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFullNam
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Get the new name for the degree */
|
||||
Par_GetParText (ParamName,NewDegName,MaxBytes);
|
||||
Par_GetParText (ParName,NewDegName,MaxBytes);
|
||||
|
||||
/***** Get data of degree *****/
|
||||
Deg_GetDataOfDegreeByCod (Deg);
|
||||
|
@ -1372,14 +1364,14 @@ void Deg_RenameDegree (struct Deg_Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFullNam
|
|||
if (strcmp (CurrentDegName,NewDegName)) // Different names
|
||||
{
|
||||
/***** If degree was in database... *****/
|
||||
if (Deg_DB_CheckIfDegNameExistsInCtr (ParamName,NewDegName,Deg->DegCod,Deg->CtrCod))
|
||||
if (Deg_DB_CheckIfDegNameExistsInCtr (ParName,NewDegName,Deg->DegCod,Deg->CtrCod))
|
||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||
Txt_The_degree_X_already_exists,
|
||||
NewDegName);
|
||||
else
|
||||
{
|
||||
/* Update the table changing old name by new name */
|
||||
Deg_DB_UpdateDegNameDB (Deg->DegCod,FieldName,NewDegName);
|
||||
Deg_DB_UpdateDegNameDB (Deg->DegCod,FldName,NewDegName);
|
||||
|
||||
/* Write message to show the change made */
|
||||
Ale_CreateAlert (Ale_SUCCESS,NULL,
|
||||
|
@ -1487,7 +1479,7 @@ void Deg_ChangeDegStatus (void)
|
|||
Deg_EditingDeg->DegCod = Par_GetAndCheckParCode (Par_OthHieCod);
|
||||
|
||||
/* Get parameter with status */
|
||||
Status = Hie_GetParamStatus (); // New status
|
||||
Status = Hie_GetParStatus (); // New status
|
||||
|
||||
/***** Get data of degree *****/
|
||||
Deg_GetDataOfDegreeByCod (Deg_EditingDeg);
|
||||
|
@ -1532,7 +1524,7 @@ static void Deg_ShowAlertAndButtonToGoToDeg (void)
|
|||
{
|
||||
/***** Alert with button to go to degree *****/
|
||||
Ale_ShowLastAlertAndButton (ActSeeCrs,NULL,NULL,
|
||||
Deg_PutParamGoToDeg,&Deg_EditingDeg->DegCod,
|
||||
Deg_PutParDegCod,&Deg_EditingDeg->DegCod,
|
||||
Btn_CONFIRM_BUTTON,
|
||||
Str_BuildGoToTitle (Deg_EditingDeg->ShrtName));
|
||||
Str_FreeGoToTitle ();
|
||||
|
@ -1542,12 +1534,6 @@ static void Deg_ShowAlertAndButtonToGoToDeg (void)
|
|||
Ale_ShowAlerts (NULL);
|
||||
}
|
||||
|
||||
static void Deg_PutParamGoToDeg (void *DegCod)
|
||||
{
|
||||
if (DegCod)
|
||||
Deg_PutParamDegCod (*((long *) DegCod));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*********** Show a form for sending a logo of the current degree ************/
|
||||
/*****************************************************************************/
|
||||
|
@ -1997,3 +1983,13 @@ bool Deg_CheckIfUsrBelongsToDeg (long UsrCod,long DegCod)
|
|||
Gbl.Cache.UsrBelongsToDeg.Belongs = Deg_DB_CheckIfUsrBelongsToDeg (UsrCod,DegCod);
|
||||
return Gbl.Cache.UsrBelongsToDeg.Belongs;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** Write parameter with code of degree ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Deg_PutParDegCod (void *DegCod)
|
||||
{
|
||||
if (DegCod)
|
||||
Par_PutParCode (Par_DegCod,*((long *) DegCod));
|
||||
}
|
||||
|
|
|
@ -92,8 +92,6 @@ void Deg_ReceiveFormReqDeg (void);
|
|||
void Deg_ReceiveFormNewDeg (void);
|
||||
void Deg_RemoveDegree (void);
|
||||
|
||||
void Deg_PutParamDegCod (long DegCod);
|
||||
|
||||
bool Deg_GetDataOfDegreeByCod (struct Deg_Degree *Deg);
|
||||
void Deg_RemoveDegreeCompletely (long DegCod);
|
||||
void Deg_RenameDegreeShort (void);
|
||||
|
|
|
@ -248,7 +248,7 @@ static void DegCfg_Center (bool PrintView,bool PutForm)
|
|||
if (!PrintView)
|
||||
{
|
||||
Frm_BeginFormGoTo (ActSeeCtrInf);
|
||||
Ctr_PutParamCtrCod (Gbl.Hierarchy.Ctr.CtrCod);
|
||||
Par_PutParCode (Par_CtrCod,Gbl.Hierarchy.Ctr.CtrCod);
|
||||
HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (Gbl.Hierarchy.Ctr.ShrtName),
|
||||
"class=\"LB BT_LINK\"");
|
||||
Str_FreeGoToTitle ();
|
||||
|
@ -304,7 +304,7 @@ static void DegCfg_WWW (bool PrintView,bool PutForm)
|
|||
|
||||
static void DegCfg_Shortcut (bool PrintView)
|
||||
{
|
||||
HieCfg_Shortcut (PrintView,"deg",Gbl.Hierarchy.Deg.DegCod);
|
||||
HieCfg_Shortcut (PrintView,Par_DegCod,Gbl.Hierarchy.Deg.DegCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -313,7 +313,7 @@ static void DegCfg_Shortcut (bool PrintView)
|
|||
|
||||
static void DegCfg_QR (void)
|
||||
{
|
||||
HieCfg_QR ("deg",Gbl.Hierarchy.Deg.DegCod);
|
||||
HieCfg_QR (Par_DegCod,Gbl.Hierarchy.Deg.DegCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -336,7 +336,7 @@ static void DegCfg_NumCrss (void)
|
|||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LB DAT_%s\"",The_GetSuffix ());
|
||||
Frm_BeginFormGoTo (ActSeeCrs);
|
||||
Deg_PutParamDegCod (Gbl.Hierarchy.Deg.DegCod);
|
||||
Par_PutParCode (Par_DegCod,Gbl.Hierarchy.Deg.DegCod);
|
||||
if (asprintf (&Title,Txt_Courses_of_DEGREE_X,Gbl.Hierarchy.Deg.ShrtName) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
HTM_BUTTON_Submit_Begin (Title,"class=\"LB BT_LINK\"");
|
||||
|
|
|
@ -516,7 +516,7 @@ unsigned Deg_DB_GetDegsWithStds (MYSQL_RES **mysql_res)
|
|||
/********************* Check if the name of degree exists ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
bool Deg_DB_CheckIfDegNameExistsInCtr (const char *FieldName,const char *Name,
|
||||
bool Deg_DB_CheckIfDegNameExistsInCtr (const char *FldName,const char *Name,
|
||||
long DegCod,long CtrCod)
|
||||
{
|
||||
return
|
||||
|
@ -528,7 +528,7 @@ bool Deg_DB_CheckIfDegNameExistsInCtr (const char *FieldName,const char *Name,
|
|||
" AND %s='%s'"
|
||||
" AND DegCod<>%ld)",
|
||||
CtrCod,
|
||||
FieldName,Name,
|
||||
FldName,Name,
|
||||
DegCod);
|
||||
}
|
||||
|
||||
|
@ -679,14 +679,14 @@ void Deg_DB_UpdateDegTypName (long DegTypCod,
|
|||
/***************** Update degree name in table of degrees ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Deg_DB_UpdateDegNameDB (long DegCod,const char *FieldName,
|
||||
void Deg_DB_UpdateDegNameDB (long DegCod,const char *FldName,
|
||||
const char NewDegName[Cns_HIERARCHY_MAX_BYTES_FULL_NAME + 1])
|
||||
{
|
||||
DB_QueryUPDATE ("can not update the name of a degree",
|
||||
"UPDATE deg_degrees"
|
||||
" SET %s='%s'"
|
||||
" WHERE DegCod=%ld",
|
||||
FieldName,
|
||||
FldName,
|
||||
NewDegName,
|
||||
DegCod);
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ unsigned Deg_DB_GetDegsOfCurrentCtrBasic (MYSQL_RES **mysql_res);
|
|||
unsigned Deg_DB_GetDegsOfCurrentCtrFull (MYSQL_RES **mysql_res);
|
||||
unsigned Deg_DB_GetDegsWithPendingCrss (MYSQL_RES **mysql_res);
|
||||
unsigned Deg_DB_GetDegsWithStds (MYSQL_RES **mysql_res);
|
||||
bool Deg_DB_CheckIfDegNameExistsInCtr (const char *FieldName,const char *Name,
|
||||
bool Deg_DB_CheckIfDegNameExistsInCtr (const char *FldName,const char *Name,
|
||||
long DegCod,long CtrCod);
|
||||
|
||||
unsigned Deg_DB_SearchDegs (MYSQL_RES **mysql_res,
|
||||
|
@ -72,7 +72,7 @@ unsigned Deg_DB_GetNumDegsInCtr (long CtrCod);
|
|||
|
||||
void Deg_DB_UpdateDegTypName (long DegTypCod,
|
||||
const char NewNameDegTyp[DegTyp_MAX_BYTES_DEGREE_TYPE_NAME + 1]);
|
||||
void Deg_DB_UpdateDegNameDB (long DegCod,const char *FieldName,
|
||||
void Deg_DB_UpdateDegNameDB (long DegCod,const char *FldName,
|
||||
const char NewDegName[Cns_HIERARCHY_MAX_BYTES_FULL_NAME + 1]);
|
||||
void Deg_DB_UpdateDegCtr (long DegCod,long NewCtrCod);
|
||||
void Deg_DB_UpdateDegTyp (long DegCod,long NewDegTypCod);
|
||||
|
|
|
@ -66,7 +66,7 @@ static struct DegTyp_DegreeType *DegTyp_EditingDegTyp = NULL; // Static variable
|
|||
|
||||
static void DegTyp_SeeDegreeTypes (Act_Action_t NextAction,HieLvl_Level_t Scope,
|
||||
DegTyp_Order_t DefaultOrder);
|
||||
static DegTyp_Order_t DegTyp_GetParamDegTypOrder (DegTyp_Order_t DefaultOrder);
|
||||
static DegTyp_Order_t DegTyp_GetParDegTypOrder (DegTyp_Order_t DefaultOrder);
|
||||
|
||||
static void DegTyp_ListDegreeTypes (const struct DegTyp_DegTypes *DegTypes,
|
||||
Act_Action_t NextAction,
|
||||
|
@ -88,7 +88,7 @@ static void DegTyp_PutHeadDegreeTypesForSeeing (Act_Action_t NextAction,
|
|||
DegTyp_Order_t SelectedOrder);
|
||||
static void DegTyp_PutHeadDegreeTypesForEdition (void);
|
||||
|
||||
static void DegTyp_PutParamOtherDegTypCod (void *DegTypCod);
|
||||
static void DegTyp_PutParOtherDegTypCod (void *DegTypCod);
|
||||
|
||||
static void DegTyp_RemoveDegreeTypeCompletely (long DegTypCod);
|
||||
|
||||
|
@ -152,7 +152,7 @@ static void DegTyp_SeeDegreeTypes (Act_Action_t NextAction,HieLvl_Level_t Scope,
|
|||
struct DegTyp_DegTypes DegTypes;
|
||||
|
||||
/***** Get parameter with the type of order in the list of degree types *****/
|
||||
SelectedOrder = DegTyp_GetParamDegTypOrder (DefaultOrder);
|
||||
SelectedOrder = DegTyp_GetParDegTypOrder (DefaultOrder);
|
||||
|
||||
/***** Get list of degree types *****/
|
||||
DegTyp_GetListDegreeTypes (&DegTypes,Scope,SelectedOrder);
|
||||
|
@ -168,12 +168,12 @@ static void DegTyp_SeeDegreeTypes (Act_Action_t NextAction,HieLvl_Level_t Scope,
|
|||
/******* Get parameter with the type or order in list of degree types ********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static DegTyp_Order_t DegTyp_GetParamDegTypOrder (DegTyp_Order_t DefaultOrder)
|
||||
static DegTyp_Order_t DegTyp_GetParDegTypOrder (DegTyp_Order_t DefaultOrder)
|
||||
{
|
||||
return (DegTyp_Order_t) Par_GetParUnsignedLong ("Order",
|
||||
0,
|
||||
DegTyp_NUM_ORDERS - 1,
|
||||
(unsigned long) DefaultOrder);
|
||||
0,
|
||||
DegTyp_NUM_ORDERS - 1,
|
||||
(unsigned long) DefaultOrder);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -410,7 +410,7 @@ static void DegTyp_ListDegreeTypesForEdition (const struct DegTyp_DegTypes *DegT
|
|||
Ico_PutIconRemovalNotAllowed ();
|
||||
else
|
||||
Ico_PutContextualIconToRemove (ActRemDegTyp,NULL,
|
||||
DegTyp_PutParamOtherDegTypCod,
|
||||
DegTyp_PutParOtherDegTypCod,
|
||||
&DegTypes->Lst[NumDegTyp].DegTypCod);
|
||||
HTM_TD_End ();
|
||||
|
||||
|
@ -422,7 +422,7 @@ static void DegTyp_ListDegreeTypesForEdition (const struct DegTyp_DegTypes *DegT
|
|||
/* Name of degree type */
|
||||
HTM_TD_Begin ("class=\"LM\"");
|
||||
Frm_BeginForm (ActRenDegTyp);
|
||||
DegTyp_PutParamOtherDegTypCod (&DegTypes->Lst[NumDegTyp].DegTypCod);
|
||||
DegTyp_PutParOtherDegTypCod (&DegTypes->Lst[NumDegTyp].DegTypCod);
|
||||
HTM_INPUT_TEXT ("DegTypName",DegTyp_MAX_CHARS_DEGREE_TYPE_NAME,
|
||||
DegTypes->Lst[NumDegTyp].DegTypName,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
|
@ -543,7 +543,7 @@ static void DegTyp_PutHeadDegreeTypesForSeeing (Act_Action_t NextAction,
|
|||
{
|
||||
Figures.Scope = Scope;
|
||||
Figures.FigureType = Fig_DEGREE_TYPES;
|
||||
Fig_PutHiddenParamFigures (&Figures);
|
||||
Fig_PutParsFigures (&Figures);
|
||||
}
|
||||
Par_PutParUnsigned (NULL,"Order",(unsigned) Order);
|
||||
|
||||
|
@ -726,7 +726,7 @@ void DegTyp_RemoveDegreeType (void)
|
|||
/***************** Write parameter with code of degree type ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void DegTyp_PutParamOtherDegTypCod (void *DegTypCod)
|
||||
static void DegTyp_PutParOtherDegTypCod (void *DegTypCod)
|
||||
{
|
||||
if (DegTypCod)
|
||||
Par_PutParCode (Par_OthDegTypCod,*((long *) DegTypCod));
|
||||
|
|
|
@ -66,14 +66,14 @@ static struct Dpt_Department *Dpt_EditingDpt = NULL; // Static variable to keep
|
|||
|
||||
static void Dpt_ResetDepartments (struct Dpt_Departments *Departments);
|
||||
|
||||
static Dpt_Order_t Dpt_GetParamDptOrder (void);
|
||||
static Dpt_Order_t Dpt_GetParDptOrder (void);
|
||||
static void Dpt_PutIconToEditDpts (__attribute__((unused)) void *Args);
|
||||
static void Dpt_EditDepartmentsInternal (void);
|
||||
|
||||
static void Dpt_GetListDepartments (struct Dpt_Departments *Departments,long InsCod);
|
||||
|
||||
static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departments);
|
||||
static void Dpt_PutParamDptCod (void *DptCod);
|
||||
static void Dpt_PutParDptCod (void *DptCod);
|
||||
|
||||
static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName);
|
||||
|
||||
|
@ -126,7 +126,7 @@ void Dpt_SeeDepts (void)
|
|||
Dpt_ResetDepartments (&Departments);
|
||||
|
||||
/***** Get parameter with the type of order in the list of departments *****/
|
||||
Departments.SelectedOrder = Dpt_GetParamDptOrder ();
|
||||
Departments.SelectedOrder = Dpt_GetParDptOrder ();
|
||||
|
||||
/***** Get list of departments *****/
|
||||
Dpt_GetListDepartments (&Departments,Gbl.Hierarchy.Ins.InsCod);
|
||||
|
@ -237,12 +237,12 @@ void Dpt_SeeDepts (void)
|
|||
/******** Get parameter with the type or order in list of departments ********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static Dpt_Order_t Dpt_GetParamDptOrder (void)
|
||||
static Dpt_Order_t Dpt_GetParDptOrder (void)
|
||||
{
|
||||
return (Dpt_Order_t) Par_GetParUnsignedLong ("Order",
|
||||
0,
|
||||
Dpt_NUM_ORDERS - 1,
|
||||
(unsigned long) Dpt_ORDER_DEFAULT);
|
||||
0,
|
||||
Dpt_NUM_ORDERS - 1,
|
||||
(unsigned long) Dpt_ORDER_DEFAULT);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -477,7 +477,7 @@ static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departm
|
|||
Ico_PutIconRemovalNotAllowed ();
|
||||
else
|
||||
Ico_PutContextualIconToRemove (ActRemDpt,NULL,
|
||||
Dpt_PutParamDptCod,&Dpt->DptCod);
|
||||
Dpt_PutParDptCod,&Dpt->DptCod);
|
||||
HTM_TD_End ();
|
||||
|
||||
/* Department code */
|
||||
|
@ -488,7 +488,7 @@ static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departm
|
|||
/* Institution */
|
||||
HTM_TD_Begin ("class=\"CM\"");
|
||||
Frm_BeginForm (ActChgDptIns);
|
||||
Dpt_PutParamDptCod (&Dpt->DptCod);
|
||||
Par_PutParCode (Par_DptCod,Dpt->DptCod);
|
||||
HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,
|
||||
"name=\"OthInsCod\""
|
||||
" class=\"HIE_SEL_NARROW INPUT_%s\"",
|
||||
|
@ -508,7 +508,7 @@ static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departm
|
|||
/* Department short name */
|
||||
HTM_TD_Begin ("class=\"CM\"");
|
||||
Frm_BeginForm (ActRenDptSho);
|
||||
Dpt_PutParamDptCod (&Dpt->DptCod);
|
||||
Par_PutParCode (Par_DptCod,Dpt->DptCod);
|
||||
HTM_INPUT_TEXT ("ShortName",Cns_HIERARCHY_MAX_CHARS_SHRT_NAME,Dpt->ShrtName,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"class=\"INPUT_SHORT_NAME INPUT_%s\"",
|
||||
|
@ -519,7 +519,7 @@ static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departm
|
|||
/* Department full name */
|
||||
HTM_TD_Begin ("class=\"CM\"");
|
||||
Frm_BeginForm (ActRenDptFul);
|
||||
Dpt_PutParamDptCod (&Dpt->DptCod);
|
||||
Par_PutParCode (Par_DptCod,Dpt->DptCod);
|
||||
HTM_INPUT_TEXT ("FullName",Cns_HIERARCHY_MAX_CHARS_FULL_NAME,Dpt->FullName,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"class=\"INPUT_FULL_NAME INPUT_%s\"",
|
||||
|
@ -530,7 +530,7 @@ static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departm
|
|||
/* Department WWW */
|
||||
HTM_TD_Begin ("class=\"CM\"");
|
||||
Frm_BeginForm (ActChgDptWWW);
|
||||
Dpt_PutParamDptCod (&Dpt->DptCod);
|
||||
Par_PutParCode (Par_DptCod,Dpt->DptCod);
|
||||
HTM_INPUT_URL ("WWW",Dpt->WWW,HTM_SUBMIT_ON_CHANGE,
|
||||
"class=\"INPUT_WWW_NARROW INPUT_%s\""
|
||||
" required=\"required\"",
|
||||
|
@ -554,12 +554,10 @@ static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departm
|
|||
/****************** Write parameter with code of department ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Dpt_PutParamDptCod (void *DptCod)
|
||||
static void Dpt_PutParDptCod (void *DptCod)
|
||||
{
|
||||
extern const char *Par_CodeStr[];
|
||||
|
||||
if (DptCod)
|
||||
Par_PutParLong (NULL,Par_CodeStr[Par_DptCod],*((long *) DptCod));
|
||||
Par_PutParCode (Par_DptCod,*((long *) DptCod));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -661,23 +659,23 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName)
|
|||
extern const char *Txt_The_department_X_already_exists;
|
||||
extern const char *Txt_The_department_X_has_been_renamed_as_Y;
|
||||
extern const char *Txt_The_name_X_has_not_changed;
|
||||
const char *ParamName = NULL; // Initialized to avoid warning
|
||||
const char *FieldName = NULL; // Initialized to avoid warning
|
||||
size_t MaxBytes = 0; // Initialized to avoid warning
|
||||
char *CurrentDptName = NULL; // Initialized to avoid warning
|
||||
const char *ParName = NULL; // Initialized to avoid warning
|
||||
const char *FldName = NULL; // Initialized to avoid warning
|
||||
size_t MaxBytes = 0; // Initialized to avoid warning
|
||||
char *CurrentDptName = NULL; // Initialized to avoid warning
|
||||
char NewDptName[Cns_HIERARCHY_MAX_BYTES_FULL_NAME + 1];
|
||||
|
||||
switch (ShrtOrFullName)
|
||||
{
|
||||
case Cns_SHRT_NAME:
|
||||
ParamName = "ShortName";
|
||||
FieldName = "ShortName";
|
||||
ParName = "ShortName";
|
||||
FldName = "ShortName";
|
||||
MaxBytes = Cns_HIERARCHY_MAX_BYTES_SHRT_NAME;
|
||||
CurrentDptName = Dpt_EditingDpt->ShrtName;
|
||||
break;
|
||||
case Cns_FULL_NAME:
|
||||
ParamName = "FullName";
|
||||
FieldName = "FullName";
|
||||
ParName = "FullName";
|
||||
FldName = "FullName";
|
||||
MaxBytes = Cns_HIERARCHY_MAX_BYTES_FULL_NAME;
|
||||
CurrentDptName = Dpt_EditingDpt->FullName;
|
||||
break;
|
||||
|
@ -688,7 +686,7 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName)
|
|||
Dpt_EditingDpt->DptCod = Par_GetAndCheckParCode (Par_DptCod);
|
||||
|
||||
/* Get the new name for the department */
|
||||
Par_GetParText (ParamName,NewDptName,MaxBytes);
|
||||
Par_GetParText (ParName,NewDptName,MaxBytes);
|
||||
|
||||
/***** Get from the database the old names of the department *****/
|
||||
Dpt_GetDataOfDepartmentByCod (Dpt_EditingDpt);
|
||||
|
@ -701,14 +699,14 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName)
|
|||
if (strcmp (CurrentDptName,NewDptName)) // Different names
|
||||
{
|
||||
/***** If degree was in database... *****/
|
||||
if (Dpt_DB_CheckIfDepartmentNameExists (ParamName,NewDptName,Dpt_EditingDpt->DptCod))
|
||||
if (Dpt_DB_CheckIfDepartmentNameExists (ParName,NewDptName,Dpt_EditingDpt->DptCod))
|
||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||
Txt_The_department_X_already_exists,
|
||||
NewDptName);
|
||||
else
|
||||
{
|
||||
/* Update the table changing old name by new name */
|
||||
Dpt_DB_UpdateDptName (Dpt_EditingDpt->DptCod,FieldName,NewDptName);
|
||||
Dpt_DB_UpdateDptName (Dpt_EditingDpt->DptCod,FldName,NewDptName);
|
||||
|
||||
/* Write message to show the change made */
|
||||
Ale_CreateAlert (Ale_SUCCESS,NULL,
|
||||
|
@ -987,7 +985,7 @@ unsigned Dpt_GetNumDptsInIns (long InsCod)
|
|||
/*****************************************************************************/
|
||||
|
||||
void Dpt_WriteSelectorDepartment (long InsCod,long DptCod,
|
||||
const char *ParamName,
|
||||
const char *ParName,
|
||||
const char *SelectClass,
|
||||
long FirstOption,
|
||||
const char *TextWhenNoDptSelected,
|
||||
|
@ -1008,7 +1006,7 @@ void Dpt_WriteSelectorDepartment (long InsCod,long DptCod,
|
|||
/* Begin selector */
|
||||
HTM_SELECT_Begin (SubmitFormOnChange,
|
||||
"id=\"%s\" name=\"%s\" class=\"%s\"",
|
||||
ParamName,ParamName,SelectClass);
|
||||
ParName,ParName,SelectClass);
|
||||
|
||||
if (FirstOption <= 0)
|
||||
{
|
||||
|
|
|
@ -79,7 +79,7 @@ void Dpt_FlushCacheNumDptsInIns (void);
|
|||
unsigned Dpt_GetNumDptsInIns (long InsCod);
|
||||
|
||||
void Dpt_WriteSelectorDepartment (long InsCod,long DptCod,
|
||||
const char *ParamName,
|
||||
const char *ParName,
|
||||
const char *SelectClass,
|
||||
long FirstOption,
|
||||
const char *TextWhenNoDptSelected,
|
||||
|
|
|
@ -149,7 +149,7 @@ unsigned Dpt_DB_GetDataOfDepartmentByCod (MYSQL_RES **mysql_res,long DptCod)
|
|||
/******************* Check if the name of department exists ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
bool Dpt_DB_CheckIfDepartmentNameExists (const char *FieldName,const char *Name,long DptCod)
|
||||
bool Dpt_DB_CheckIfDepartmentNameExists (const char *FldName,const char *Name,long DptCod)
|
||||
{
|
||||
return
|
||||
DB_QueryEXISTS ("can not check if the department name already existed",
|
||||
|
@ -158,7 +158,7 @@ bool Dpt_DB_CheckIfDepartmentNameExists (const char *FieldName,const char *Name,
|
|||
" FROM dpt_departments"
|
||||
" WHERE %s='%s'"
|
||||
" AND DptCod<>%ld)",
|
||||
FieldName,Name,
|
||||
FldName,Name,
|
||||
DptCod);
|
||||
}
|
||||
|
||||
|
@ -223,13 +223,13 @@ void Dpt_DB_UpdateDptIns (long DptCod,long NewInsCod)
|
|||
/************* Update department name in table of departments ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Dpt_DB_UpdateDptName (long DptCod,const char *FieldName,const char *NewDptName)
|
||||
void Dpt_DB_UpdateDptName (long DptCod,const char *FldName,const char *NewDptName)
|
||||
{
|
||||
DB_QueryUPDATE ("can not update the name of a department",
|
||||
"UPDATE dpt_departments"
|
||||
" SET %s='%s'"
|
||||
" WHERE DptCod=%ld",
|
||||
FieldName,NewDptName,
|
||||
FldName,NewDptName,
|
||||
DptCod);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,12 +41,12 @@ void Dpt_DB_CreateDepartment (const struct Dpt_Department *Dpt);
|
|||
unsigned Dpt_DB_GetListDepartments (MYSQL_RES **mysql_res,
|
||||
long InsCod,Dpt_Order_t SelectedOrder);
|
||||
unsigned Dpt_DB_GetDataOfDepartmentByCod (MYSQL_RES **mysql_res,long DptCod);
|
||||
bool Dpt_DB_CheckIfDepartmentNameExists (const char *FieldName,const char *Name,long DptCod);
|
||||
bool Dpt_DB_CheckIfDepartmentNameExists (const char *FldName,const char *Name,long DptCod);
|
||||
unsigned Dpt_DB_GetNumDepartmentsInInstitution (long InsCod);
|
||||
unsigned Dpt_DB_GetNumTchsCurrentInsInDepartment (long DptCod);
|
||||
|
||||
void Dpt_DB_UpdateDptIns (long DptCod,long NewInsCod);
|
||||
void Dpt_DB_UpdateDptName (long DptCod,const char *FieldName,const char *NewDptName);
|
||||
void Dpt_DB_UpdateDptName (long DptCod,const char *FldName,const char *NewDptName);
|
||||
void Dpt_DB_UpdateDptWWW (long DptCod,char NewWWW[Cns_MAX_BYTES_WWW + 1]);
|
||||
|
||||
void Dpt_DB_RemoveDepartment (long DptCod);
|
||||
|
|
|
@ -69,7 +69,7 @@ void Dup_ReportUsrAsPossibleDuplicate (void)
|
|||
extern const char *Txt_Thank_you_for_reporting_a_possible_duplicate_user;
|
||||
|
||||
/***** Get user to be reported as possible duplicate *****/
|
||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
|
||||
{
|
||||
/* Check if it's allowed to me to report users as possible duplicatedr */
|
||||
if (Gbl.Usrs.Me.Role.Logged >= Rol_TCH &&
|
||||
|
@ -225,7 +225,7 @@ void Dup_ListDuplicateUsrs (void)
|
|||
void Dup_GetUsrCodAndListSimilarUsrs (void)
|
||||
{
|
||||
/***** Get user to be removed from list of possible duplicates *****/
|
||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
|
||||
Dup_ListSimilarUsrs ();
|
||||
else
|
||||
Ale_ShowAlertUserNotFoundOrYouDoNotHavePermission ();
|
||||
|
@ -352,7 +352,7 @@ static void Dup_PutButtonToViewSimilarUsrs (const struct Usr_Data *UsrDat)
|
|||
extern const char *Txt_Similar_users;
|
||||
|
||||
Frm_BeginForm (ActLstSimUsr);
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
Btn_PutConfirmButtonInline (Txt_Similar_users);
|
||||
Frm_EndForm ();
|
||||
}
|
||||
|
@ -366,7 +366,7 @@ static void Dup_PutButtonToEliminateUsrAccount (const struct Usr_Data *UsrDat)
|
|||
extern const char *Txt_Eliminate_user_account;
|
||||
|
||||
Frm_BeginForm (ActUpdOth);
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
Par_PutParUnsigned (NULL,"RegRemAction",(unsigned) Enr_ELIMINATE_ONE_USR_FROM_PLATFORM);
|
||||
Btn_PutRemoveButtonInline (Txt_Eliminate_user_account);
|
||||
Frm_EndForm ();
|
||||
|
@ -381,7 +381,7 @@ static void Dup_PutButtonToRemoveFromListOfDupUsrs (const struct Usr_Data *UsrDa
|
|||
extern const char *Txt_Not_duplicated;
|
||||
|
||||
Frm_BeginForm (ActRemDupUsr);
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
Btn_PutConfirmButtonInline (Txt_Not_duplicated);
|
||||
Frm_EndForm ();
|
||||
}
|
||||
|
@ -393,7 +393,7 @@ static void Dup_PutButtonToRemoveFromListOfDupUsrs (const struct Usr_Data *UsrDa
|
|||
void Dup_RemoveUsrFromListDupUsrs (void)
|
||||
{
|
||||
/***** Get user to be removed from list of possible duplicates *****/
|
||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
|
||||
{
|
||||
/* Remove entry from database */
|
||||
Dup_DB_RemoveUsrFromDuplicated (Gbl.Usrs.Other.UsrDat.UsrCod);
|
||||
|
|
|
@ -180,7 +180,7 @@ void Enr_PutButtonInlineToRegisterStds (long CrsCod)
|
|||
1 << Rol_STD)) // No students in course
|
||||
{
|
||||
Frm_BeginForm (ActReqEnrSevStd);
|
||||
Crs_PutParamCrsCod (CrsCod);
|
||||
Par_PutParCode (Par_CrsCod,CrsCod);
|
||||
Btn_PutCreateButtonInline (Txt_Register_students);
|
||||
Frm_EndForm ();
|
||||
}
|
||||
|
@ -330,15 +330,15 @@ static void Enr_NotifyAfterEnrolment (const struct Usr_Data *UsrDat,
|
|||
/****** Write a form to request another user's ID, @nickname or email ********/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction,void (*FuncParams) (void))
|
||||
void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction,void (*FuncPars) (void))
|
||||
{
|
||||
extern const char *Txt_nick_email_or_ID;
|
||||
extern const char *Txt_Continue;
|
||||
|
||||
/***** Form to request user's ID, @nickname or email address *****/
|
||||
Frm_BeginForm (NextAction);
|
||||
if (FuncParams)
|
||||
FuncParams ();
|
||||
if (FuncPars)
|
||||
FuncPars ();
|
||||
|
||||
/***** Label *****/
|
||||
HTM_LABEL_Begin ("for=\"OtherUsrIDNickOrEMail\" class=\"RM FORM_IN_%s\"",
|
||||
|
@ -713,9 +713,9 @@ void Enr_RemoveOldUsrs (void)
|
|||
/***** Get parameter with number of months without access *****/
|
||||
MonthsWithoutAccess = (unsigned)
|
||||
Par_GetParUnsignedLong ("Months",
|
||||
Usr_MIN_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_USRS,
|
||||
Usr_MAX_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_USRS,
|
||||
(unsigned long) UINT_MAX);
|
||||
Usr_MIN_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_USRS,
|
||||
Usr_MAX_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_USRS,
|
||||
(unsigned long) UINT_MAX);
|
||||
if (MonthsWithoutAccess == UINT_MAX)
|
||||
Err_ShowErrorAndExit ("Wrong number of months.");
|
||||
SecondsWithoutAccess = (time_t) MonthsWithoutAccess * Dat_SECONDS_IN_ONE_MONTH;
|
||||
|
@ -944,9 +944,9 @@ static void Enr_ReceiveFormUsrsCrs (Rol_Role_t Role)
|
|||
|
||||
RegRemUsrsAction = (Enr_RegRemUsrsAction_t)
|
||||
Par_GetParUnsignedLong ("RegRemAction",
|
||||
0,
|
||||
Enr_NUM_REG_REM_USRS_ACTIONS - 1,
|
||||
(unsigned long) Enr_REG_REM_USRS_UNKNOWN_ACTION);
|
||||
0,
|
||||
Enr_NUM_REG_REM_USRS_ACTIONS - 1,
|
||||
(unsigned long) Enr_REG_REM_USRS_UNKNOWN_ACTION);
|
||||
switch (RegRemUsrsAction)
|
||||
{
|
||||
case Enr_REGISTER_SPECIFIED_USRS_IN_CRS:
|
||||
|
@ -1706,7 +1706,7 @@ void Enr_AskRemAllStdsThisCrs (void)
|
|||
|
||||
/* Show form to request confirmation */
|
||||
Frm_BeginForm (ActRemAllStdCrs);
|
||||
Grp_PutParamAllGroups ();
|
||||
Grp_PutParAllGroups ();
|
||||
Pwd_AskForConfirmationOnDangerousAction ();
|
||||
Btn_PutRemoveButton (Txt_Remove_all_students);
|
||||
Frm_EndForm ();
|
||||
|
@ -1822,9 +1822,9 @@ void Enr_SignUpInCrs (void)
|
|||
/***** Get new role from record form *****/
|
||||
RoleFromForm = (Rol_Role_t)
|
||||
Par_GetParUnsignedLong ("Role",
|
||||
0,
|
||||
Rol_NUM_ROLES - 1,
|
||||
(unsigned long) Rol_UNK);
|
||||
0,
|
||||
Rol_NUM_ROLES - 1,
|
||||
(unsigned long) Rol_UNK);
|
||||
|
||||
/* Check if role is correct */
|
||||
if (!(RoleFromForm == Rol_STD ||
|
||||
|
@ -1925,7 +1925,7 @@ void Enr_AskIfRejectSignUp (void)
|
|||
Rol_Role_t Role;
|
||||
|
||||
/***** Get user's code *****/
|
||||
Usr_GetParamOtherUsrCodEncryptedAndGetListIDs ();
|
||||
Usr_GetParOtherUsrCodEncryptedAndGetListIDs ();
|
||||
|
||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,
|
||||
Usr_DONT_GET_PREFS,
|
||||
|
@ -1963,7 +1963,7 @@ void Enr_AskIfRejectSignUp (void)
|
|||
|
||||
/* End alert */
|
||||
Ale_ShowAlertAndButton2 (ActRejSignUp,NULL,NULL,
|
||||
Usr_PutParamOtherUsrCodEncrypted,Gbl.Usrs.Other.UsrDat.EnUsrCod,
|
||||
Usr_PutParOtherUsrCodEncrypted,Gbl.Usrs.Other.UsrDat.EnUsrCod,
|
||||
Btn_REMOVE_BUTTON,Txt_Reject);
|
||||
}
|
||||
else
|
||||
|
@ -1984,7 +1984,7 @@ void Enr_RejectSignUp (void)
|
|||
extern const char *Txt_Enrolment_of_X_rejected;
|
||||
|
||||
/***** Get user's code *****/
|
||||
Usr_GetParamOtherUsrCodEncryptedAndGetListIDs ();
|
||||
Usr_GetParOtherUsrCodEncryptedAndGetListIDs ();
|
||||
|
||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,
|
||||
Usr_DONT_GET_PREFS,
|
||||
|
@ -2226,7 +2226,7 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected)
|
|||
Deg_GetDataOfDegreeByCod (&Deg);
|
||||
|
||||
Frm_BeginFormGoTo (ActSeeCrsInf);
|
||||
Crs_PutParamCrsCod (Crs.CrsCod);
|
||||
Par_PutParCode (Par_CrsCod,Crs.CrsCod);
|
||||
HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (Crs.FullName),
|
||||
"class=\"LT BT_LINK\"");
|
||||
Str_FreeGoToTitle ();
|
||||
|
@ -2274,8 +2274,8 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected)
|
|||
if (!NextAction[DesiredRole])
|
||||
Err_WrongRoleExit ();
|
||||
Frm_BeginForm (NextAction[DesiredRole]);
|
||||
Crs_PutParamCrsCod (Crs.CrsCod);
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat.EnUsrCod);
|
||||
Par_PutParCode (Par_CrsCod,Crs.CrsCod);
|
||||
Usr_PutParUsrCodEncrypted (UsrDat.EnUsrCod);
|
||||
Btn_PutCreateButtonInline (Txt_Register);
|
||||
Frm_EndForm ();
|
||||
HTM_TD_End ();
|
||||
|
@ -2284,8 +2284,8 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected)
|
|||
HTM_TD_Begin ("class=\"LT DAT_%s\"",
|
||||
The_GetSuffix ());
|
||||
Frm_BeginForm (ActReqRejSignUp);
|
||||
Crs_PutParamCrsCod (Crs.CrsCod);
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat.EnUsrCod);
|
||||
Par_PutParCode (Par_CrsCod,Crs.CrsCod);
|
||||
Usr_PutParUsrCodEncrypted (UsrDat.EnUsrCod);
|
||||
Btn_PutRemoveButtonInline (Txt_Reject);
|
||||
Frm_EndForm ();
|
||||
HTM_TD_End ();
|
||||
|
@ -2496,7 +2496,7 @@ static void Enr_AskIfRegRemAnotherUsr (Rol_Role_t Role)
|
|||
struct Usr_ListUsrCods ListUsrCods;
|
||||
|
||||
/***** Check if UsrCod is present in parameters *****/
|
||||
Usr_GetParamOtherUsrCodEncryptedAndGetListIDs ();
|
||||
Usr_GetParOtherUsrCodEncryptedAndGetListIDs ();
|
||||
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
|
||||
{
|
||||
/***** If UsrCod is present in parameters,
|
||||
|
@ -2508,7 +2508,7 @@ static void Enr_AskIfRegRemAnotherUsr (Rol_Role_t Role)
|
|||
else // Parameter with user code not present
|
||||
/***** If UsrCod is not present in parameters from form,
|
||||
use user's ID to identify the user to be enroled /removed *****/
|
||||
Usr_GetParamOtherUsrIDNickOrEMailAndGetUsrCods (&ListUsrCods);
|
||||
Usr_GetParOtherUsrIDNickOrEMailAndGetUsrCods (&ListUsrCods);
|
||||
|
||||
Enr_AskIfRegRemUsr (&ListUsrCods,Role);
|
||||
}
|
||||
|
@ -2643,7 +2643,7 @@ void Enr_ReqRemMeFromCrs (void)
|
|||
void Enr_ReqRemUsrFromCrs (void)
|
||||
{
|
||||
/***** Get user to be removed *****/
|
||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
|
||||
{
|
||||
if (Enr_CheckIfICanRemUsrFromCrs ())
|
||||
Enr_AskIfRemoveUsrFromCrs (&Gbl.Usrs.Other.UsrDat);
|
||||
|
@ -2663,7 +2663,7 @@ void Enr_RemUsrFromCrs1 (void)
|
|||
if (Pwd_GetConfirmationOnDangerousAction ())
|
||||
{
|
||||
/***** Get user to be removed *****/
|
||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
|
||||
{
|
||||
if (Enr_CheckIfICanRemUsrFromCrs ())
|
||||
Enr_EffectivelyRemUsrFromCrs (&Gbl.Usrs.Other.UsrDat,&Gbl.Hierarchy.Crs,
|
||||
|
@ -2754,7 +2754,7 @@ void Enr_CreateNewUsr1 (void)
|
|||
};
|
||||
|
||||
/***** Get user's ID from form *****/
|
||||
ID_GetParamOtherUsrIDPlain (); // User's ID was already modified and passed as a hidden parameter
|
||||
ID_GetParOtherUsrIDPlain (); // User's ID was already modified and passed as a hidden parameter
|
||||
|
||||
if (ID_CheckIfUsrIDIsValid (Gbl.Usrs.Other.UsrDat.IDs.List[0].ID)) // User's ID valid
|
||||
{
|
||||
|
@ -2857,16 +2857,16 @@ void Enr_ModifyUsr1 (void)
|
|||
};
|
||||
|
||||
/***** Get user from form *****/
|
||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
|
||||
{
|
||||
ItsMe = Usr_ItsMe (Gbl.Usrs.Other.UsrDat.UsrCod);
|
||||
|
||||
/***** Get the action to do *****/
|
||||
Gbl.Usrs.RegRemAction = (Enr_RegRemOneUsrAction_t)
|
||||
Par_GetParUnsignedLong ("RegRemAction",
|
||||
0,
|
||||
Enr_REG_REM_ONE_USR_NUM_ACTIONS - 1,
|
||||
(unsigned long) Enr_REG_REM_ONE_USR_UNKNOWN_ACTION);
|
||||
0,
|
||||
Enr_REG_REM_ONE_USR_NUM_ACTIONS - 1,
|
||||
(unsigned long) Enr_REG_REM_ONE_USR_UNKNOWN_ACTION);
|
||||
switch (Gbl.Usrs.RegRemAction)
|
||||
{
|
||||
case Enr_REGISTER_MODIFY_ONE_USR_IN_CRS:
|
||||
|
@ -3074,7 +3074,7 @@ static void Enr_AskIfRemoveUsrFromCrs (struct Usr_Data *UsrDat)
|
|||
if (!NextAction[UsrDat->Roles.InCurrentCrs])
|
||||
Err_WrongRoleExit ();
|
||||
Frm_BeginForm (NextAction[UsrDat->Roles.InCurrentCrs]);
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
Pwd_AskForConfirmationOnDangerousAction ();
|
||||
Btn_PutRemoveButton (ItsMe ? Txt_Remove_me_from_this_course :
|
||||
Txt_Remove_user_from_this_course);
|
||||
|
|
|
@ -82,7 +82,7 @@ void Enr_ModifyRoleInCurrentCrs (struct Usr_Data *UsrDat,Rol_Role_t NewRole);
|
|||
void Enr_RegisterUsrInCurrentCrs (struct Usr_Data *UsrDat,Rol_Role_t NewRole,
|
||||
Enr_KeepOrSetAccepted_t KeepOrSetAccepted);
|
||||
|
||||
void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction,void (*FuncParams) (void));
|
||||
void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction,void (*FuncPars) (void));
|
||||
|
||||
void Enr_ReqAcceptRegisterInCrs (void);
|
||||
void Enr_GetNotifEnrolment (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
|
||||
|
|
84
swad_exam.c
84
swad_exam.c
|
@ -113,20 +113,20 @@ extern struct Globals Gbl;
|
|||
static void Exa_PutIconsListExams (void *Exams);
|
||||
static void Exa_PutIconToCreateNewExam (struct Exa_Exams *Exams);
|
||||
static void Exa_PutButtonToCreateNewExam (struct Exa_Exams *Exams);
|
||||
static void Exa_PutParamsToCreateNewExam (void *Exams);
|
||||
static void Exa_PutParsToCreateNewExam (void *Exams);
|
||||
|
||||
static void Exa_ShowOneExam (struct Exa_Exams *Exams,bool ShowOnlyThisExam);
|
||||
|
||||
static void Exa_PutIconsOneExam (void *Exams);
|
||||
static void Exa_WriteAuthor (struct Exa_Exam *Exam);
|
||||
|
||||
static void Exa_PutHiddenParamExamOrder (Exa_Order_t SelectedOrder);
|
||||
static void Exa_PutParExamOrder (Exa_Order_t SelectedOrder);
|
||||
|
||||
static void Exa_PutIconsToRemEditOneExam (struct Exa_Exams *Exams,
|
||||
const char *Anchor);
|
||||
|
||||
static void Exa_PutHiddenParamOrder (Exa_Order_t SelectedOrder);
|
||||
static Exa_Order_t Exa_GetParamOrder (void);
|
||||
static void Exa_PutParOrder (Exa_Order_t SelectedOrder);
|
||||
static Exa_Order_t Exa_GetParOrder (void);
|
||||
|
||||
static void Exa_RemoveExamFromAllTables (long ExaCod);
|
||||
|
||||
|
@ -198,7 +198,7 @@ void Exa_SeeAllExams (void)
|
|||
Exa_ResetExams (&Exams);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams,false); // Don't check exam code
|
||||
Exa_GetPars (&Exams,false); // Don't check exam code
|
||||
|
||||
/***** Show all exams *****/
|
||||
Exa_ListAllExams (&Exams);
|
||||
|
@ -257,7 +257,7 @@ void Exa_ListAllExams (struct Exa_Exams *Exams)
|
|||
|
||||
/* Form to change order */
|
||||
Frm_BeginForm (ActSeeAllExa);
|
||||
Pag_PutHiddenParamPagNum (Pag_EXAMS,Exams->CurrentPage);
|
||||
Pag_PutParPagNum (Pag_EXAMS,Exams->CurrentPage);
|
||||
Par_PutParUnsigned (NULL,"Order",(unsigned) Order);
|
||||
HTM_BUTTON_Submit_Begin (Txt_EXAMS_ORDER_HELP[Order],
|
||||
"class=\"BT_LINK\"");
|
||||
|
@ -354,7 +354,7 @@ static void Exa_PutIconsListExams (void *Exams)
|
|||
/***** Link to get resource link *****/
|
||||
if (PrgRsc_CheckIfICanGetLink ())
|
||||
Ico_PutContextualIconToGetLink (ActReqLnkExa,NULL,
|
||||
Exa_PutParams,Exams);
|
||||
Exa_PutPars,Exams);
|
||||
|
||||
/***** Put icon to show a figure *****/
|
||||
Fig_PutIconToShowFigure (Fig_EXAMS);
|
||||
|
@ -368,7 +368,7 @@ static void Exa_PutIconsListExams (void *Exams)
|
|||
static void Exa_PutIconToCreateNewExam (struct Exa_Exams *Exams)
|
||||
{
|
||||
Ico_PutContextualIconToAdd (ActFrmNewExa,NULL,
|
||||
Exa_PutParamsToCreateNewExam,Exams);
|
||||
Exa_PutParsToCreateNewExam,Exams);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -380,7 +380,7 @@ static void Exa_PutButtonToCreateNewExam (struct Exa_Exams *Exams)
|
|||
extern const char *Txt_New_exam;
|
||||
|
||||
Frm_BeginForm (ActFrmNewExa);
|
||||
Exa_PutParamsToCreateNewExam (Exams);
|
||||
Exa_PutParsToCreateNewExam (Exams);
|
||||
Btn_PutConfirmButton (Txt_New_exam);
|
||||
Frm_EndForm ();
|
||||
}
|
||||
|
@ -389,12 +389,12 @@ static void Exa_PutButtonToCreateNewExam (struct Exa_Exams *Exams)
|
|||
/******************* Put parameters to create a new exam *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Exa_PutParamsToCreateNewExam (void *Exams)
|
||||
static void Exa_PutParsToCreateNewExam (void *Exams)
|
||||
{
|
||||
if (Exams)
|
||||
{
|
||||
Exa_PutHiddenParamExamOrder (((struct Exa_Exams *) Exams)->SelectedOrder);
|
||||
Pag_PutHiddenParamPagNum (Pag_EXAMS,((struct Exa_Exams *) Exams)->CurrentPage);
|
||||
Exa_PutParExamOrder (((struct Exa_Exams *) Exams)->SelectedOrder);
|
||||
Pag_PutParPagNum (Pag_EXAMS,((struct Exa_Exams *) Exams)->CurrentPage);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -413,7 +413,7 @@ void Exa_SeeOneExam (void)
|
|||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams,true);
|
||||
Exa_GetPars (&Exams,true);
|
||||
|
||||
/***** Get exam data *****/
|
||||
Exa_GetDataOfExamByCod (&Exams.Exam);
|
||||
|
@ -529,7 +529,7 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,bool ShowOnlyThisExam)
|
|||
/* Exam title */
|
||||
HTM_ARTICLE_Begin (Anchor);
|
||||
Frm_BeginForm (ActSeeExa);
|
||||
Exa_PutParams (Exams);
|
||||
Exa_PutPars (Exams);
|
||||
HTM_BUTTON_Submit_Begin (Txt_View_exam,"class=\"LT BT_LINK %s_%s\"",
|
||||
Exams->Exam.Hidden ? "ASG_TITLE_LIGHT":
|
||||
"ASG_TITLE",
|
||||
|
@ -561,7 +561,7 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,bool ShowOnlyThisExam)
|
|||
HTM_TD_Begin ("class=\"RT %s\"",The_GetColorRows ());
|
||||
|
||||
Frm_BeginForm (ActSeeExa);
|
||||
Exa_PutParams (Exams);
|
||||
Exa_PutPars (Exams);
|
||||
HTM_BUTTON_Submit_Begin (Txt_Sessions,"class=\"LT BT_LINK %s_%s\"",
|
||||
Exams->Exam.Hidden ? "ASG_TITLE_LIGHT":
|
||||
"ASG_TITLE",
|
||||
|
@ -654,7 +654,7 @@ static void Exa_WriteAuthor (struct Exa_Exam *Exam)
|
|||
/****** Put a hidden parameter with the type of order in list of exams *******/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Exa_PutHiddenParamExamOrder (Exa_Order_t SelectedOrder)
|
||||
static void Exa_PutParExamOrder (Exa_Order_t SelectedOrder)
|
||||
{
|
||||
Par_PutParUnsigned (NULL,"Order",(unsigned) SelectedOrder);
|
||||
}
|
||||
|
@ -683,44 +683,44 @@ static void Exa_PutIconsToRemEditOneExam (struct Exa_Exams *Exams,
|
|||
{
|
||||
/***** Icon to remove exam *****/
|
||||
Ico_PutContextualIconToRemove (ActReqRemExa,NULL,
|
||||
Exa_PutParams,Exams);
|
||||
Exa_PutPars,Exams);
|
||||
|
||||
/***** Icon to hide/unhide exam *****/
|
||||
Ico_PutContextualIconToHideUnhide (ActionHideUnhide,Anchor,
|
||||
Exa_PutParams,Exams,
|
||||
Exa_PutPars,Exams,
|
||||
Exams->Exam.Hidden);
|
||||
|
||||
/***** Icon to edit exam *****/
|
||||
Ico_PutContextualIconToEdit (ActEdiOneExa,NULL,
|
||||
Exa_PutParams,Exams);
|
||||
Exa_PutPars,Exams);
|
||||
}
|
||||
|
||||
/***** Put icon to view results of sessions in exam *****/
|
||||
if (ActionShowResults[Gbl.Usrs.Me.Role.Logged])
|
||||
Ico_PutContextualIconToShowResults (ActionShowResults[Gbl.Usrs.Me.Role.Logged],ExaRes_RESULTS_BOX_ID,
|
||||
Exa_PutParams,Exams);
|
||||
Exa_PutPars,Exams);
|
||||
|
||||
/***** Link to get resource link *****/
|
||||
if (PrgRsc_CheckIfICanGetLink ())
|
||||
Ico_PutContextualIconToGetLink (ActReqLnkExa,NULL,
|
||||
Exa_PutParams,Exams);
|
||||
Exa_PutPars,Exams);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*********************** Params used to edit an exam **************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_PutParams (void *Exams)
|
||||
void Exa_PutPars (void *Exams)
|
||||
{
|
||||
Grp_WhichGroups_t WhichGroups;
|
||||
|
||||
if (Exams)
|
||||
{
|
||||
Par_PutParCode (Par_ExaCod,((struct Exa_Exams *) Exams)->Exam.ExaCod);
|
||||
Exa_PutHiddenParamOrder (((struct Exa_Exams *) Exams)->SelectedOrder);
|
||||
WhichGroups = Grp_GetParamWhichGroups ();
|
||||
Grp_PutParamWhichGroups (&WhichGroups);
|
||||
Pag_PutHiddenParamPagNum (Pag_EXAMS,((struct Exa_Exams *) Exams)->CurrentPage);
|
||||
Exa_PutParOrder (((struct Exa_Exams *) Exams)->SelectedOrder);
|
||||
WhichGroups = Grp_GetParWhichGroups ();
|
||||
Grp_PutParWhichGroups (&WhichGroups);
|
||||
Pag_PutParPagNum (Pag_EXAMS,((struct Exa_Exams *) Exams)->CurrentPage);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -728,17 +728,17 @@ void Exa_PutParams (void *Exams)
|
|||
/******************* Get parameters used to edit an exam **********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_GetParams (struct Exa_Exams *Exams,bool CheckExaCod)
|
||||
void Exa_GetPars (struct Exa_Exams *Exams,bool CheckExaCod)
|
||||
{
|
||||
long (*GetExaCo[2]) (Par_Code_t ParamCode) =
|
||||
long (*GetExaCo[2]) (Par_Code_t ParCode) =
|
||||
{
|
||||
[false] = Par_GetParCode,
|
||||
[true ] = Par_GetAndCheckParCode,
|
||||
};
|
||||
|
||||
/***** Get other parameters *****/
|
||||
Exams->SelectedOrder = Exa_GetParamOrder ();
|
||||
Exams->CurrentPage = Pag_GetParamPagNum (Pag_EXAMS);
|
||||
Exams->SelectedOrder = Exa_GetParOrder ();
|
||||
Exams->CurrentPage = Pag_GetParPagNum (Pag_EXAMS);
|
||||
|
||||
/***** Get exam code *****/
|
||||
Exams->Exam.ExaCod = GetExaCo[CheckExaCod] (Par_ExaCod);
|
||||
|
@ -748,7 +748,7 @@ void Exa_GetParams (struct Exa_Exams *Exams,bool CheckExaCod)
|
|||
/****** Put a hidden parameter with the type of order in list of exams *******/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Exa_PutHiddenParamOrder (Exa_Order_t SelectedOrder)
|
||||
static void Exa_PutParOrder (Exa_Order_t SelectedOrder)
|
||||
{
|
||||
if (SelectedOrder != Exa_ORDER_DEFAULT)
|
||||
Par_PutParUnsigned (NULL,"Order",(unsigned) SelectedOrder);
|
||||
|
@ -758,12 +758,12 @@ static void Exa_PutHiddenParamOrder (Exa_Order_t SelectedOrder)
|
|||
/********** Get parameter with the type or order in list of exams ************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static Exa_Order_t Exa_GetParamOrder (void)
|
||||
static Exa_Order_t Exa_GetParOrder (void)
|
||||
{
|
||||
return (Exa_Order_t) Par_GetParUnsignedLong ("Order",
|
||||
0,
|
||||
Exa_NUM_ORDERS - 1,
|
||||
(unsigned long) Exa_ORDER_DEFAULT);
|
||||
0,
|
||||
Exa_NUM_ORDERS - 1,
|
||||
(unsigned long) Exa_ORDER_DEFAULT);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -844,7 +844,7 @@ void Exa_GetListSelectedExaCods (struct Exa_Exams *Exams)
|
|||
)
|
||||
{
|
||||
/* Get next exam selected */
|
||||
Par_GetNextStrUntilSeparParamMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
Par_GetNextStrUntilSeparParMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
ExaCod = Str_ConvertStrCodToLongCod (LongStr);
|
||||
|
||||
/* Set each exam in *StrExaCodsSelected as selected */
|
||||
|
@ -990,14 +990,14 @@ void Exa_AskRemExam (void)
|
|||
Exa_ResetExam (&Exams.Exam);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams,true);
|
||||
Exa_GetPars (&Exams,true);
|
||||
|
||||
/***** Get data of the exam from database *****/
|
||||
Exa_GetDataOfExamByCod (&Exams.Exam);
|
||||
|
||||
/***** Show question and button to remove exam *****/
|
||||
Ale_ShowAlertAndButton (ActRemExa,NULL,NULL,
|
||||
Exa_PutParams,&Exams,
|
||||
Exa_PutPars,&Exams,
|
||||
Btn_REMOVE_BUTTON,Txt_Remove_exam,
|
||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_exam_X,
|
||||
Exams.Exam.Title);
|
||||
|
@ -1212,7 +1212,7 @@ static void Exa_HideUnhideExam (bool Hide)
|
|||
Exa_ResetExam (&Exams.Exam);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams,true);
|
||||
Exa_GetPars (&Exams,true);
|
||||
|
||||
/***** Get data of the exam from database *****/
|
||||
Exa_GetDataOfExamByCod (&Exams.Exam);
|
||||
|
@ -1244,7 +1244,7 @@ void Exa_RequestCreatOrEditExam (void)
|
|||
ExaSet_ResetSet (&Set);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams,false); // Don't check exam code
|
||||
Exa_GetPars (&Exams,false); // Don't check exam code
|
||||
ItsANewExam = (Exams.Exam.ExaCod <= 0);
|
||||
|
||||
/***** Get exam data *****/
|
||||
|
@ -1309,7 +1309,7 @@ void Exa_PutFormEditionExam (struct Exa_Exams *Exams,
|
|||
/***** Begin form *****/
|
||||
Frm_BeginForm (ItsANewExam ? ActNewExa :
|
||||
ActChgExa);
|
||||
Exa_PutParams (Exams);
|
||||
Exa_PutPars (Exams);
|
||||
|
||||
/***** Begin box and table *****/
|
||||
if (ItsANewExam)
|
||||
|
@ -1417,7 +1417,7 @@ void Exa_ReceiveFormExam (void)
|
|||
ExaSet_ResetSet (&Set);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams,false); // Don't check exam code
|
||||
Exa_GetPars (&Exams,false); // Don't check exam code
|
||||
ItsANewExam = (Exams.Exam.ExaCod <= 0);
|
||||
|
||||
/***** Get all current exam data from database *****/
|
||||
|
|
|
@ -51,8 +51,8 @@ void Exa_ShowOnlyOneExamBegin (struct Exa_Exams *Exams,
|
|||
void Exa_ShowOnlyOneExamEnd (void);
|
||||
|
||||
void Exa_SetCurrentExaCod (long ExaCod);
|
||||
void Exa_PutParams (void *Exams);
|
||||
void Exa_GetParams (struct Exa_Exams *Exams,bool CheckExaCod);
|
||||
void Exa_PutPars (void *Exams);
|
||||
void Exa_GetPars (struct Exa_Exams *Exams,bool CheckExaCod);
|
||||
|
||||
void Exa_GetListExams (struct Exa_Exams *Exams,Exa_Order_t SelectedOrder);
|
||||
void Exa_GetListSelectedExaCods (struct Exa_Exams *Exams);
|
||||
|
|
|
@ -109,7 +109,7 @@ static void ExaPrn_WriteJSToUpdateExamPrint (const struct ExaPrn_Print *Print,
|
|||
|
||||
static void ExaPrn_GetAnswerFromForm (struct ExaPrn_Print *Print,unsigned QstInd);
|
||||
|
||||
static unsigned ExaPrn_GetParamQstInd (void);
|
||||
static unsigned ExaPrn_GetParQstInd (void);
|
||||
|
||||
static void ExaPrn_ComputeScoreAndStoreQuestionOfPrint (struct ExaPrn_Print *Print,
|
||||
unsigned QstInd);
|
||||
|
@ -174,7 +174,7 @@ void ExaPrn_ShowExamPrint (void)
|
|||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSes_GetAndCheckParameters (&Exams,&Session);
|
||||
ExaSes_GetAndCheckPars (&Exams,&Session);
|
||||
|
||||
/***** Check if I can access to this session *****/
|
||||
if (ExaSes_CheckIfICanAnswerThisSession (&Exams.Exam,&Session))
|
||||
|
@ -680,7 +680,7 @@ static void ExaPrn_ShowTableWithQstsToFill (struct Exa_Exams *Exams,
|
|||
|
||||
/***** Form to end/close this exam print *****/
|
||||
Frm_BeginForm (ActEndExaPrn);
|
||||
ExaSes_PutParamsEdit (Exams);
|
||||
ExaSes_PutParsEdit (Exams);
|
||||
Btn_PutCreateButton (Txt_I_have_finished);
|
||||
Frm_EndForm ();
|
||||
}
|
||||
|
@ -995,7 +995,7 @@ void ExaPrn_ReceivePrintAnswer (void)
|
|||
Err_WrongExamExit ();
|
||||
|
||||
/***** Get question index from form *****/
|
||||
QstInd = ExaPrn_GetParamQstInd ();
|
||||
QstInd = ExaPrn_GetParQstInd ();
|
||||
|
||||
/***** Set log print code, action and question index *****/
|
||||
ExaLog_SetPrnCod (Print.PrnCod);
|
||||
|
@ -1036,7 +1036,7 @@ void ExaPrn_ReceivePrintAnswer (void)
|
|||
|
||||
/***** Form to end/close this exam print *****/
|
||||
Frm_BeginForm (ActEndExaPrn);
|
||||
ExaSes_PutParamsEdit (&Exams);
|
||||
ExaSes_PutParsEdit (&Exams);
|
||||
Btn_PutCreateButton (Txt_Continue);
|
||||
Frm_EndForm ();
|
||||
}
|
||||
|
@ -1057,7 +1057,7 @@ static void ExaPrn_GetAnswerFromForm (struct ExaPrn_Print *Print,unsigned QstInd
|
|||
/********************* Get parameter with question index *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static unsigned ExaPrn_GetParamQstInd (void)
|
||||
static unsigned ExaPrn_GetParQstInd (void)
|
||||
{
|
||||
long QstInd;
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ void ExaRsc_GetLinkToExam (void)
|
|||
Exa_ResetExams (&Exams);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams,true);
|
||||
Exa_GetPars (&Exams,true);
|
||||
|
||||
/***** Get exam title *****/
|
||||
ExaRsc_GetTitleFromExaCod (Exams.Exam.ExaCod,Title,sizeof (Title) - 1);
|
||||
|
|
|
@ -194,7 +194,7 @@ void ExaRes_ShowMyResultsInExa (void)
|
|||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams,true);
|
||||
Exa_GetPars (&Exams,true);
|
||||
|
||||
/***** Get exam data from database *****/
|
||||
Exa_GetDataOfExamByCod (&Exams.Exam);
|
||||
|
@ -242,7 +242,7 @@ void ExaRes_ShowMyResultsInSes (void)
|
|||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams,true);
|
||||
Exa_GetPars (&Exams,true);
|
||||
Session.SesCod = Par_GetAndCheckParCode (Par_SesCod);
|
||||
Exa_GetDataOfExamByCod (&Exams.Exam);
|
||||
ExaSes_GetDataOfSessionByCod (&Session);
|
||||
|
@ -355,7 +355,7 @@ static void ExaRes_ListAllResultsInSelectedExams (struct Exa_Exams *Exams)
|
|||
Ptr = Gbl.Usrs.Selected.List[Rol_UNK];
|
||||
while (*Ptr)
|
||||
{
|
||||
Par_GetNextStrUntilSeparParamMult (&Ptr,Gbl.Usrs.Other.UsrDat.EnUsrCod,
|
||||
Par_GetNextStrUntilSeparParMult (&Ptr,Gbl.Usrs.Other.UsrDat.EnUsrCod,
|
||||
Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64);
|
||||
Usr_GetUsrCodFromEncryptedUsrCod (&Gbl.Usrs.Other.UsrDat);
|
||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&Gbl.Usrs.Other.UsrDat,
|
||||
|
@ -388,7 +388,7 @@ void ExaRes_ShowAllResultsInExa (void)
|
|||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams,true);
|
||||
Exa_GetPars (&Exams,true);
|
||||
Exa_GetDataOfExamByCod (&Exams.Exam);
|
||||
|
||||
/***** Exam begin *****/
|
||||
|
@ -456,7 +456,7 @@ void ExaRes_ShowAllResultsInSes (void)
|
|||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams,true);
|
||||
Exa_GetPars (&Exams,true);
|
||||
Session.SesCod = Par_GetAndCheckParCode (Par_SesCod);
|
||||
|
||||
/***** Get exam data and session *****/
|
||||
|
@ -578,8 +578,8 @@ static void ExaRes_ListExamsToSelect (struct Exa_Exams *Exams)
|
|||
/***** Begin form to update the results
|
||||
depending on the exams selected *****/
|
||||
Frm_BeginFormAnchor (Gbl.Action.Act,ExaRes_RESULTS_TABLE_ID);
|
||||
Grp_PutParamsCodGrps ();
|
||||
Usr_PutHiddenParSelectedUsrsCods (&Gbl.Usrs.Selected);
|
||||
Grp_PutParsCodGrps ();
|
||||
Usr_PutParSelectedUsrsCods (&Gbl.Usrs.Selected);
|
||||
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_BeginWidePadding (2);
|
||||
|
@ -1027,13 +1027,13 @@ static void ExaRes_ShowResults (struct Exa_Exams *Exams,
|
|||
{
|
||||
case Usr_ME:
|
||||
Frm_BeginForm (ActSeeOneExaResMe);
|
||||
ExaSes_PutParamsEdit (Exams);
|
||||
ExaSes_PutParsEdit (Exams);
|
||||
Ico_PutIconLink ("tasks.svg",Ico_BLACK,ActSeeOneExaResMe);
|
||||
break;
|
||||
case Usr_OTHER:
|
||||
Frm_BeginForm (ActSeeOneExaResOth);
|
||||
ExaSes_PutParamsEdit (Exams);
|
||||
Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod);
|
||||
ExaSes_PutParsEdit (Exams);
|
||||
Usr_PutParOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod);
|
||||
Ico_PutIconLink ("tasks.svg",Ico_BLACK,ActSeeOneExaResOth);
|
||||
break;
|
||||
}
|
||||
|
@ -1243,7 +1243,7 @@ void ExaRes_ShowExaResultAfterFinish (void)
|
|||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSes_GetAndCheckParameters (&Exams,&Session);
|
||||
ExaSes_GetAndCheckPars (&Exams,&Session);
|
||||
|
||||
/***** Get exam print data *****/
|
||||
Print.SesCod = Session.SesCod;
|
||||
|
@ -1283,7 +1283,7 @@ void ExaRes_ShowOneExaResult (void)
|
|||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSes_GetAndCheckParameters (&Exams,&Session);
|
||||
ExaSes_GetAndCheckPars (&Exams,&Session);
|
||||
|
||||
/***** Pointer to user's data *****/
|
||||
MeOrOther = (Gbl.Action.Act == ActSeeOneExaResMe) ? Usr_ME :
|
||||
|
@ -1296,7 +1296,7 @@ void ExaRes_ShowOneExaResult (void)
|
|||
case Usr_OTHER:
|
||||
default:
|
||||
UsrDat = &Gbl.Usrs.Other.UsrDat;
|
||||
Usr_GetParamOtherUsrCodEncrypted (UsrDat);
|
||||
Usr_GetParOtherUsrCodEncrypted (UsrDat);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ void ExaSes_ListSessions (struct Exa_Exams *Exams,
|
|||
{
|
||||
Set_BeginSettingsHead ();
|
||||
Grp_ShowFormToSelWhichGrps (ActSeeExa,
|
||||
Exa_PutParams,Exams);
|
||||
Exa_PutPars,Exams);
|
||||
Set_EndSettingsHead ();
|
||||
}
|
||||
break;
|
||||
|
@ -254,7 +254,7 @@ static void ExaSes_PutIconsInListOfSessions (void *Exams)
|
|||
static void ExaSes_PutIconToCreateNewSession (struct Exa_Exams *Exams)
|
||||
{
|
||||
Ico_PutContextualIconToAdd (ActReqNewExaSes,ExaSes_NEW_SESSION_SECTION_ID,
|
||||
Exa_PutParams,Exams);
|
||||
Exa_PutPars,Exams);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -442,16 +442,16 @@ static void ExaSes_ListOneOrMoreSessionsIcons (struct Exa_Exams *Exams,
|
|||
{
|
||||
/***** Icon to remove the exam session *****/
|
||||
Ico_PutContextualIconToRemove (ActReqRemExaSes,NULL,
|
||||
ExaSes_PutParamsEdit,Exams);
|
||||
ExaSes_PutParsEdit,Exams);
|
||||
|
||||
/***** Icon to hide/unhide the exam session *****/
|
||||
Ico_PutContextualIconToHideUnhide (ActionHideUnhide,Anchor,
|
||||
ExaSes_PutParamsEdit,Exams,
|
||||
ExaSes_PutParsEdit,Exams,
|
||||
Session->Hidden);
|
||||
|
||||
/***** Icon to edit the exam session *****/
|
||||
Ico_PutContextualIconToEdit (ActEdiOneExaSes,Anchor,
|
||||
ExaSes_PutParamsEdit,Exams);
|
||||
ExaSes_PutParsEdit,Exams);
|
||||
}
|
||||
|
||||
/***** End cell *****/
|
||||
|
@ -520,7 +520,7 @@ static void ExaSes_ListOneOrMoreSessionsTitleGrps (struct Exa_Exams *Exams,
|
|||
if (ExaSes_CheckIfICanAnswerThisSession (&Exams->Exam,Session))
|
||||
{
|
||||
Frm_BeginForm (ActSeeExaPrn);
|
||||
Exa_PutParams (Exams);
|
||||
Exa_PutPars (Exams);
|
||||
Par_PutParCode (Par_SesCod,Session->SesCod);
|
||||
HTM_BUTTON_Submit_Begin (Gbl.Usrs.Me.Role.Logged == Rol_STD ? Txt_Play :
|
||||
Txt_Resume,
|
||||
|
@ -647,7 +647,7 @@ static void ExaSes_ListOneOrMoreSessionsResultStd (struct Exa_Exams *Exams,
|
|||
Exams->Exam.ExaCod = Session->ExaCod;
|
||||
Exams->SesCod = Session->SesCod;
|
||||
Lay_PutContextualLinkOnlyIcon (ActSeeMyExaResSes,ExaRes_RESULTS_BOX_ID,
|
||||
ExaSes_PutParamsEdit,Exams,
|
||||
ExaSes_PutParsEdit,Exams,
|
||||
"trophy.svg",Ico_BLACK);
|
||||
}
|
||||
else
|
||||
|
@ -667,7 +667,7 @@ static void ExaSes_ListOneOrMoreSessionsResultTch (struct Exa_Exams *Exams,
|
|||
/***** Show exam session results *****/
|
||||
if (ExaSes_CheckIfICanEditThisSession (Session->UsrCod))
|
||||
Lay_PutContextualLinkOnlyIcon (ActSeeUsrExaResSes,ExaRes_RESULTS_BOX_ID,
|
||||
ExaSes_PutParamsEdit,Exams,
|
||||
ExaSes_PutParsEdit,Exams,
|
||||
"trophy.svg",Ico_BLACK);
|
||||
|
||||
/***** Check if visibility of session results can be changed *****/
|
||||
|
@ -676,11 +676,11 @@ static void ExaSes_ListOneOrMoreSessionsResultTch (struct Exa_Exams *Exams,
|
|||
/***** Put form to change visibility of session results *****/
|
||||
if (Session->ShowUsrResults)
|
||||
Lay_PutContextualLinkOnlyIcon (ActChgVisExaRes,NULL,
|
||||
ExaSes_PutParamsEdit,Exams,
|
||||
ExaSes_PutParsEdit,Exams,
|
||||
"eye.svg",Ico_GREEN);
|
||||
else
|
||||
Lay_PutContextualLinkOnlyIcon (ActChgVisExaRes,NULL,
|
||||
ExaSes_PutParamsEdit,Exams,
|
||||
ExaSes_PutParsEdit,Exams,
|
||||
"eye-slash.svg",Ico_RED);
|
||||
}
|
||||
else // Don't put form
|
||||
|
@ -708,7 +708,7 @@ void ExaSes_ToggleVisResultsSesUsr (void)
|
|||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSes_GetAndCheckParameters (&Exams,&Session);
|
||||
ExaSes_GetAndCheckPars (&Exams,&Session);
|
||||
|
||||
/***** Check if visibility of session results can be changed *****/
|
||||
if (!ExaSes_CheckIfVisibilityOfResultsCanBeChanged (&Session))
|
||||
|
@ -797,13 +797,13 @@ void ExaSes_RequestRemoveSession (void)
|
|||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSes_GetAndCheckParameters (&Exams,&Session);
|
||||
ExaSes_GetAndCheckPars (&Exams,&Session);
|
||||
|
||||
/***** Show question and button to remove question *****/
|
||||
Exams.Exam.ExaCod = Session.ExaCod;
|
||||
Exams.SesCod = Session.SesCod;
|
||||
Ale_ShowAlertAndButton (ActRemExaSes,NULL,NULL,
|
||||
ExaSes_PutParamsEdit,&Exams,
|
||||
ExaSes_PutParsEdit,&Exams,
|
||||
Btn_REMOVE_BUTTON,Txt_Remove_session,
|
||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_session_X,
|
||||
Session.Title);
|
||||
|
@ -829,7 +829,7 @@ void ExaSes_RemoveSession (void)
|
|||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSes_GetAndCheckParameters (&Exams,&Session);
|
||||
ExaSes_GetAndCheckPars (&Exams,&Session);
|
||||
|
||||
/***** Check if I can remove this exam session *****/
|
||||
if (!ExaSes_CheckIfICanEditThisSession (Session.UsrCod))
|
||||
|
@ -874,7 +874,7 @@ void ExaSes_HideSession (void)
|
|||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSes_GetAndCheckParameters (&Exams,&Session);
|
||||
ExaSes_GetAndCheckPars (&Exams,&Session);
|
||||
|
||||
/***** Check if I can remove this exam session *****/
|
||||
if (!ExaSes_CheckIfICanEditThisSession (Session.UsrCod))
|
||||
|
@ -903,7 +903,7 @@ void ExaSes_UnhideSession (void)
|
|||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSes_GetAndCheckParameters (&Exams,&Session);
|
||||
ExaSes_GetAndCheckPars (&Exams,&Session);
|
||||
|
||||
/***** Check if I can remove this exam session *****/
|
||||
if (!ExaSes_CheckIfICanEditThisSession (Session.UsrCod))
|
||||
|
@ -921,11 +921,11 @@ void ExaSes_UnhideSession (void)
|
|||
/******************* Params used to edit an exam session *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void ExaSes_PutParamsEdit (void *Exams)
|
||||
void ExaSes_PutParsEdit (void *Exams)
|
||||
{
|
||||
if (Exams)
|
||||
{
|
||||
Exa_PutParams (Exams);
|
||||
Exa_PutPars (Exams);
|
||||
Par_PutParCode (Par_SesCod,((struct Exa_Exams *) Exams)->SesCod);
|
||||
}
|
||||
}
|
||||
|
@ -934,12 +934,12 @@ void ExaSes_PutParamsEdit (void *Exams)
|
|||
/************************** Get and check parameters *************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void ExaSes_GetAndCheckParameters (struct Exa_Exams *Exams,
|
||||
void ExaSes_GetAndCheckPars (struct Exa_Exams *Exams,
|
||||
struct ExaSes_Session *Session)
|
||||
{
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (Exams,true);
|
||||
Grp_GetParamWhichGroups ();
|
||||
Exa_GetPars (Exams,true);
|
||||
Grp_GetParWhichGroups ();
|
||||
Session->SesCod = Par_GetAndCheckParCode (Par_SesCod);
|
||||
|
||||
/***** Get exam data from database *****/
|
||||
|
@ -1099,7 +1099,7 @@ void ExaSes_PutButtonNewSession (struct Exa_Exams *Exams)
|
|||
extern const char *Txt_New_session;
|
||||
|
||||
Frm_BeginFormAnchor (ActReqNewExaSes,ExaSes_NEW_SESSION_SECTION_ID);
|
||||
Exa_PutParams (Exams);
|
||||
Exa_PutPars (Exams);
|
||||
Btn_PutConfirmButton (Txt_New_session);
|
||||
Frm_EndForm ();
|
||||
}
|
||||
|
@ -1120,8 +1120,8 @@ void ExaSes_RequestCreatOrEditSes (void)
|
|||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams,true);
|
||||
Grp_GetParamWhichGroups ();
|
||||
Exa_GetPars (&Exams,true);
|
||||
Grp_GetParWhichGroups ();
|
||||
Session.SesCod = Par_GetParCode (Par_SesCod);
|
||||
ItsANewSession = (Session.SesCod <= 0);
|
||||
|
||||
|
@ -1166,8 +1166,8 @@ void ExaSes_ReceiveFormSession (void)
|
|||
ExaSes_ResetSession (&Session);
|
||||
|
||||
/***** Get main parameters *****/
|
||||
Exa_GetParams (&Exams,true);
|
||||
Grp_GetParamWhichGroups ();
|
||||
Exa_GetPars (&Exams,true);
|
||||
Grp_GetParWhichGroups ();
|
||||
Session.SesCod = Par_GetParCode (Par_SesCod);
|
||||
ItsANewSession = (Session.SesCod <= 0);
|
||||
|
||||
|
|
|
@ -63,8 +63,8 @@ void ExaSes_RemoveSession (void);
|
|||
void ExaSes_HideSession (void);
|
||||
void ExaSes_UnhideSession (void);
|
||||
|
||||
void ExaSes_PutParamsEdit (void *Exams);
|
||||
void ExaSes_GetAndCheckParameters (struct Exa_Exams *Exams,
|
||||
void ExaSes_PutParsEdit (void *Exams);
|
||||
void ExaSes_GetAndCheckPars (struct Exa_Exams *Exams,
|
||||
struct ExaSes_Session *Session);
|
||||
|
||||
void ExaSes_PutButtonNewSession (struct Exa_Exams *Exams);
|
||||
|
|
|
@ -73,7 +73,7 @@ extern struct Globals Gbl;
|
|||
/***************************** Private prototypes ****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void ExaSet_PutParamsOneQst (void *Exams);
|
||||
static void ExaSet_PutParsOneQst (void *Exams);
|
||||
|
||||
static void ExaSet_PutFormNewSet (struct Exa_Exams *Exams,
|
||||
struct ExaSet_Set *Set,
|
||||
|
@ -85,7 +85,7 @@ static bool ExaSet_CheckSetTitleReceivedFromForm (const struct ExaSet_Set *Set,
|
|||
static void ExaSet_CreateSet (struct ExaSet_Set *Set);
|
||||
static void ExaSet_UpdateSet (const struct ExaSet_Set *Set);
|
||||
|
||||
static void ExaSet_PutParamSetCod (long SetCod);
|
||||
static void ExaSet_PutParSetCod (long SetCod);
|
||||
|
||||
static void ExaSet_ListSetQuestions (struct Exa_Exams *Exams,
|
||||
const struct ExaSet_Set *Set);
|
||||
|
@ -113,8 +113,8 @@ static void ExaSet_RemoveMediaFromAllAnsOfQst (long QstCod,long SetCod);
|
|||
|
||||
static void ExaSet_ChangeValidityQst (Qst_Validity_t Valid);
|
||||
|
||||
static void ExaSet_GetAndCheckParameters (struct Exa_Exams *Exams,
|
||||
struct ExaSet_Set *Set);
|
||||
static void ExaSet_GetAndCheckPars (struct Exa_Exams *Exams,
|
||||
struct ExaSet_Set *Set);
|
||||
|
||||
static void ExaSet_ExchangeSets (long ExaCod,
|
||||
unsigned SetIndTop,unsigned SetIndBottom);
|
||||
|
@ -126,12 +126,12 @@ static void ExaSet_PutButtonToAddNewQuestions (struct Exa_Exams *Exams);
|
|||
/************ Put parameter to move/remove one set of questions **************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void ExaSet_PutParamsOneSet (void *Exams)
|
||||
void ExaSet_PutParsOneSet (void *Exams)
|
||||
{
|
||||
if (Exams)
|
||||
{
|
||||
Exa_PutParams (Exams);
|
||||
ExaSet_PutParamSetCod (((struct Exa_Exams *) Exams)->SetCod);
|
||||
Exa_PutPars (Exams);
|
||||
ExaSet_PutParSetCod (((struct Exa_Exams *) Exams)->SetCod);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,10 +139,13 @@ void ExaSet_PutParamsOneSet (void *Exams)
|
|||
/**************** Put parameter to move/remove one question ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void ExaSet_PutParamsOneQst (void *Exams)
|
||||
static void ExaSet_PutParsOneQst (void *Exams)
|
||||
{
|
||||
ExaSet_PutParamsOneSet (Exams);
|
||||
Qst_PutParamQstCod (&(((struct Exa_Exams *) Exams)->QstCod));
|
||||
if (Exams)
|
||||
{
|
||||
ExaSet_PutParsOneSet (Exams);
|
||||
Par_PutParCode (Par_QstCod,((struct Exa_Exams *) Exams)->QstCod);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -212,7 +215,7 @@ static void ExaSet_PutFormNewSet (struct Exa_Exams *Exams,
|
|||
|
||||
/***** Begin form *****/
|
||||
Frm_BeginForm (ActNewExaSet);
|
||||
Exa_PutParams (Exams);
|
||||
Exa_PutPars (Exams);
|
||||
|
||||
/***** Begin box and table *****/
|
||||
Box_BoxTableBegin (NULL,Txt_New_set_of_questions,
|
||||
|
@ -282,7 +285,7 @@ void ExaSet_ReceiveFormSet (void)
|
|||
ExaSet_ResetSet (&Set);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams,true);
|
||||
Exa_GetPars (&Exams,true);
|
||||
Set.ExaCod = Exams.Exam.ExaCod;
|
||||
Exams.SetCod = Set.SetCod = Par_GetParCode (Par_SesCod);
|
||||
ItsANewSet = (Set.SetCod <= 0);
|
||||
|
@ -317,9 +320,9 @@ static void ExaSet_ReceiveSetFieldsFromForm (struct ExaSet_Set *Set)
|
|||
|
||||
/***** Get number of questions in set to appear in exam print *****/
|
||||
Set->NumQstsToPrint = (unsigned) Par_GetParUnsignedLong ("NumQstsToPrint",
|
||||
0,
|
||||
UINT_MAX,
|
||||
0);
|
||||
0,
|
||||
UINT_MAX,
|
||||
0);
|
||||
}
|
||||
|
||||
static bool ExaSet_CheckSetTitleReceivedFromForm (const struct ExaSet_Set *Set,
|
||||
|
@ -374,7 +377,7 @@ void ExaSet_ChangeSetTitle (void)
|
|||
ExaSet_ResetSet (&Set);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSet_GetAndCheckParameters (&Exams,&Set);
|
||||
ExaSet_GetAndCheckPars (&Exams,&Set);
|
||||
|
||||
/***** Check if exam is editable *****/
|
||||
if (!Exa_CheckIfEditable (&Exams.Exam))
|
||||
|
@ -418,7 +421,7 @@ void ExaSet_ChangeNumQstsToExam (void)
|
|||
ExaSet_ResetSet (&Set);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSet_GetAndCheckParameters (&Exams,&Set);
|
||||
ExaSet_GetAndCheckPars (&Exams,&Set);
|
||||
|
||||
/***** Check if exam is editable *****/
|
||||
if (!Exa_CheckIfEditable (&Exams.Exam))
|
||||
|
@ -426,9 +429,9 @@ void ExaSet_ChangeNumQstsToExam (void)
|
|||
|
||||
/***** Get number of questions in set to appear in exam print *****/
|
||||
NumQstsToPrint = (unsigned) Par_GetParUnsignedLong ("NumQstsToPrint",
|
||||
0,
|
||||
UINT_MAX,
|
||||
0);
|
||||
0,
|
||||
UINT_MAX,
|
||||
0);
|
||||
|
||||
/***** Check if title should be changed *****/
|
||||
if (NumQstsToPrint != Set.NumQstsToPrint)
|
||||
|
@ -501,7 +504,7 @@ void ExaSet_RequestCreatOrEditSet (void)
|
|||
ExaSet_ResetSet (&Set);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (&Exams,true);
|
||||
Exa_GetPars (&Exams,true);
|
||||
Exams.SetCod = Set.SetCod = Par_GetParCode (Par_SesCod);
|
||||
ItsANewSet = (Set.SetCod <= 0);
|
||||
|
||||
|
@ -540,7 +543,7 @@ void ExaSet_ReqSelectQstsToAddToSet (void)
|
|||
ExaSet_ResetSet (&Set);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSet_GetAndCheckParameters (&Exams,&Set);
|
||||
ExaSet_GetAndCheckPars (&Exams,&Set);
|
||||
|
||||
/***** Show form to select questions for set *****/
|
||||
Qst_RequestSelectQstsForExamSet (&Exams);
|
||||
|
@ -565,7 +568,7 @@ void ExaSet_ListQstsToAddToSet (void)
|
|||
ExaSet_ResetSet (&Set);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSet_GetAndCheckParameters (&Exams,&Set);
|
||||
ExaSet_GetAndCheckPars (&Exams,&Set);
|
||||
|
||||
/***** Get set data from database *****/
|
||||
ExaSet_GetDataOfSetByCod (&Set);
|
||||
|
@ -583,7 +586,7 @@ void ExaSet_ListQstsToAddToSet (void)
|
|||
/**************** Write parameter with index of set of questions *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void ExaSet_PutParamSetCod (long SetCod)
|
||||
static void ExaSet_PutParSetCod (long SetCod)
|
||||
{
|
||||
Par_PutParUnsigned (NULL,"SetCod",SetCod);
|
||||
}
|
||||
|
@ -742,14 +745,14 @@ static void ExaSet_ListOneOrMoreSetsForEdition (struct Exa_Exams *Exams,
|
|||
/* Put icon to remove the set */
|
||||
if (ICanEditSets)
|
||||
Ico_PutContextualIconToRemove (ActReqRemExaSet,NULL,
|
||||
ExaSet_PutParamsOneSet,Exams);
|
||||
ExaSet_PutParsOneSet,Exams);
|
||||
else
|
||||
Ico_PutIconRemovalNotAllowed ();
|
||||
|
||||
/* Put icon to move up the question */
|
||||
if (ICanEditSets && Set.SetInd > 1)
|
||||
Lay_PutContextualLinkOnlyIcon (ActUp_ExaSet,Anchor,
|
||||
ExaSet_PutParamsOneSet,Exams,
|
||||
ExaSet_PutParsOneSet,Exams,
|
||||
"arrow-up.svg",Ico_BLACK);
|
||||
else
|
||||
Ico_PutIconOff ("arrow-up.svg",Ico_BLACK,
|
||||
|
@ -758,7 +761,7 @@ static void ExaSet_ListOneOrMoreSetsForEdition (struct Exa_Exams *Exams,
|
|||
/* Put icon to move down the set */
|
||||
if (ICanEditSets && Set.SetInd < MaxSetInd)
|
||||
Lay_PutContextualLinkOnlyIcon (ActDwnExaSet,Anchor,
|
||||
ExaSet_PutParamsOneSet,Exams,
|
||||
ExaSet_PutParsOneSet,Exams,
|
||||
"arrow-down.svg",Ico_BLACK);
|
||||
else
|
||||
Ico_PutIconOff ("arrow-down.svg",Ico_BLACK,
|
||||
|
@ -778,7 +781,7 @@ static void ExaSet_ListOneOrMoreSetsForEdition (struct Exa_Exams *Exams,
|
|||
if (ICanEditSets)
|
||||
{
|
||||
Frm_BeginFormAnchor (ActChgTitExaSet,Anchor);
|
||||
ExaSet_PutParamsOneSet (Exams);
|
||||
ExaSet_PutParsOneSet (Exams);
|
||||
HTM_INPUT_TEXT ("Title",ExaSet_MAX_CHARS_TITLE,Set.Title,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"id=\"Title\""
|
||||
|
@ -808,7 +811,7 @@ static void ExaSet_ListOneOrMoreSetsForEdition (struct Exa_Exams *Exams,
|
|||
if (ICanEditSets)
|
||||
{
|
||||
Frm_BeginFormAnchor (ActChgNumQstExaSet,Anchor);
|
||||
ExaSet_PutParamsOneSet (Exams);
|
||||
ExaSet_PutParsOneSet (Exams);
|
||||
HTM_INPUT_LONG ("NumQstsToPrint",0,UINT_MAX,(long) Set.NumQstsToPrint,
|
||||
HTM_SUBMIT_ON_CHANGE,false,
|
||||
"class=\"INPUT_LONG\" required=\"required\"");
|
||||
|
@ -949,13 +952,13 @@ static void ExaSet_ListOneOrMoreQuestionsForEdition (struct Exa_Exams *Exams,
|
|||
/* Put icon to remove the question */
|
||||
if (ICanEditQuestions)
|
||||
Ico_PutContextualIconToRemove (ActReqRemSetQst,NULL,
|
||||
ExaSet_PutParamsOneQst,Exams);
|
||||
ExaSet_PutParsOneQst,Exams);
|
||||
else
|
||||
Ico_PutIconRemovalNotAllowed ();
|
||||
|
||||
/* Put icon to validate/invalidate the question */
|
||||
Lay_PutContextualLinkOnlyIcon (ValInv[Question.Validity].NextAction,Anchor,
|
||||
ExaSet_PutParamsOneQst,Exams,
|
||||
ExaSet_PutParsOneQst,Exams,
|
||||
ValInv[Question.Validity].Icon,
|
||||
ValInv[Question.Validity].Color);
|
||||
|
||||
|
@ -1204,7 +1207,7 @@ void ExaSet_AddQstsToSet (void)
|
|||
ExaSet_ResetSet (&Set);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSet_GetAndCheckParameters (&Exams,&Set);
|
||||
ExaSet_GetAndCheckPars (&Exams,&Set);
|
||||
|
||||
/***** Get set data from database *****/
|
||||
ExaSet_GetDataOfSetByCod (&Set);
|
||||
|
@ -1226,7 +1229,7 @@ void ExaSet_AddQstsToSet (void)
|
|||
while (*Ptr)
|
||||
{
|
||||
/* Get next code */
|
||||
Par_GetNextStrUntilSeparParamMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
Par_GetNextStrUntilSeparParMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
if (sscanf (LongStr,"%ld",&QstCod) != 1)
|
||||
Err_WrongQuestionExit ();
|
||||
|
||||
|
@ -1357,7 +1360,7 @@ void ExaSet_RequestRemoveSet (void)
|
|||
ExaSet_ResetSet (&Set);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSet_GetAndCheckParameters (&Exams,&Set);
|
||||
ExaSet_GetAndCheckPars (&Exams,&Set);
|
||||
|
||||
/***** Check if exam is editable *****/
|
||||
if (!Exa_CheckIfEditable (&Exams.Exam))
|
||||
|
@ -1365,7 +1368,7 @@ void ExaSet_RequestRemoveSet (void)
|
|||
|
||||
/***** Show question and button to remove question *****/
|
||||
Ale_ShowAlertAndButton (ActRemExaSet,NULL,NULL,
|
||||
ExaSet_PutParamsOneSet,&Exams,
|
||||
ExaSet_PutParsOneSet,&Exams,
|
||||
Btn_REMOVE_BUTTON,Txt_Remove_set_of_questions,
|
||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_set_of_questions_X,
|
||||
Set.Title);
|
||||
|
@ -1391,7 +1394,7 @@ void ExaSet_RemoveSet (void)
|
|||
ExaSet_ResetSet (&Set);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSet_GetAndCheckParameters (&Exams,&Set);
|
||||
ExaSet_GetAndCheckPars (&Exams,&Set);
|
||||
|
||||
/***** Check if exam is editable *****/
|
||||
if (!Exa_CheckIfEditable (&Exams.Exam))
|
||||
|
@ -1433,7 +1436,7 @@ void ExaSet_MoveUpSet (void)
|
|||
ExaSet_ResetSet (&Set);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSet_GetAndCheckParameters (&Exams,&Set);
|
||||
ExaSet_GetAndCheckPars (&Exams,&Set);
|
||||
|
||||
/***** Check if exam is editable *****/
|
||||
if (!Exa_CheckIfEditable (&Exams.Exam))
|
||||
|
@ -1480,7 +1483,7 @@ void ExaSet_MoveDownSet (void)
|
|||
ExaSet_ResetSet (&Set);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSet_GetAndCheckParameters (&Exams,&Set);
|
||||
ExaSet_GetAndCheckPars (&Exams,&Set);
|
||||
|
||||
/***** Check if exam is editable *****/
|
||||
if (!Exa_CheckIfEditable (&Exams.Exam))
|
||||
|
@ -1529,7 +1532,7 @@ void ExaSet_RequestRemoveQstFromSet (void)
|
|||
ExaSet_ResetSet (&Set);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSet_GetAndCheckParameters (&Exams,&Set);
|
||||
ExaSet_GetAndCheckPars (&Exams,&Set);
|
||||
|
||||
/***** Get question code *****/
|
||||
Exams.QstCod = Par_GetAndCheckParCode (Par_QstCod);
|
||||
|
@ -1539,7 +1542,7 @@ void ExaSet_RequestRemoveQstFromSet (void)
|
|||
|
||||
/***** Show question and button to remove question *****/
|
||||
Ale_ShowAlertAndButton (ActRemExaQst,Anchor,NULL,
|
||||
ExaSet_PutParamsOneQst,&Exams,
|
||||
ExaSet_PutParsOneQst,&Exams,
|
||||
Btn_REMOVE_BUTTON,Txt_Remove_question,
|
||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_question_X,
|
||||
Exams.QstCod);
|
||||
|
@ -1569,7 +1572,7 @@ void ExaSet_RemoveQstFromSet (void)
|
|||
ExaSet_ResetSet (&Set);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSet_GetAndCheckParameters (&Exams,&Set);
|
||||
ExaSet_GetAndCheckPars (&Exams,&Set);
|
||||
|
||||
/***** Get question code *****/
|
||||
QstCod = Par_GetAndCheckParCode (Par_QstCod);
|
||||
|
@ -1650,7 +1653,7 @@ static void ExaSet_ChangeValidityQst (Qst_Validity_t Validity)
|
|||
ExaSet_ResetSet (&Set);
|
||||
|
||||
/***** Get and check parameters *****/
|
||||
ExaSet_GetAndCheckParameters (&Exams,&Set);
|
||||
ExaSet_GetAndCheckPars (&Exams,&Set);
|
||||
|
||||
/***** Get question code *****/
|
||||
QstCod = Par_GetAndCheckParCode (Par_QstCod);
|
||||
|
@ -1668,12 +1671,12 @@ static void ExaSet_ChangeValidityQst (Qst_Validity_t Validity)
|
|||
/************************** Get and check parameters *************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void ExaSet_GetAndCheckParameters (struct Exa_Exams *Exams,
|
||||
struct ExaSet_Set *Set)
|
||||
static void ExaSet_GetAndCheckPars (struct Exa_Exams *Exams,
|
||||
struct ExaSet_Set *Set)
|
||||
{
|
||||
/***** Get parameters *****/
|
||||
Exa_GetParams (Exams,true);
|
||||
Grp_GetParamWhichGroups ();
|
||||
Exa_GetPars (Exams,true);
|
||||
Grp_GetParWhichGroups ();
|
||||
Set->SetCod = Par_GetAndCheckParCode (Par_SesCod);
|
||||
|
||||
/***** Get exam data from database *****/
|
||||
|
@ -1740,7 +1743,7 @@ static void ExaSet_ExchangeSets (long ExaCod,
|
|||
static void ExaSet_PutIconToAddNewQuestions (void *Exams)
|
||||
{
|
||||
Ico_PutContextualIconToAdd (ActReqAddQstExaSet,NULL,
|
||||
ExaSet_PutParamsOneSet,Exams);
|
||||
ExaSet_PutParsOneSet,Exams);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1752,7 +1755,7 @@ static void ExaSet_PutButtonToAddNewQuestions (struct Exa_Exams *Exams)
|
|||
extern const char *Txt_Add_questions;
|
||||
|
||||
Frm_BeginForm (ActReqAddQstExaSet);
|
||||
ExaSet_PutParamsOneSet (Exams);
|
||||
ExaSet_PutParsOneSet (Exams);
|
||||
Btn_PutConfirmButtonInline (Txt_Add_questions);
|
||||
Frm_EndForm ();
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
/***************************** Public prototypes *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void ExaSet_PutParamsOneSet (void *Exams);
|
||||
void ExaSet_PutParsOneSet (void *Exams);
|
||||
|
||||
void ExaSet_GetDataOfSetByCod (struct ExaSet_Set *Set);
|
||||
|
||||
|
|
|
@ -65,8 +65,8 @@ extern struct Globals Gbl;
|
|||
|
||||
static void Fig_ReqShowFigure (Fig_FigureType_t SelectedFigureType);
|
||||
|
||||
static void Fig_PutHiddenParamFigureType (Fig_FigureType_t FigureType);
|
||||
static void Fig_PutHiddenParamScopeFig (HieLvl_Level_t ScopeFig);
|
||||
static void Fig_PutParFigureType (Fig_FigureType_t FigureType);
|
||||
static void Fig_PutParScopeFig (HieLvl_Level_t ScopeFig);
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************** Show use of the platform *************************/
|
||||
|
@ -153,7 +153,7 @@ void Fig_PutIconToShowFigure (Fig_FigureType_t FigureType)
|
|||
Figures.Scope = Gbl.Scope.Current;
|
||||
Figures.FigureType = FigureType;
|
||||
Lay_PutContextualLinkOnlyIcon (ActSeeUseGbl,NULL,
|
||||
Fig_PutHiddenParamFigures,&Figures,
|
||||
Fig_PutParsFigures,&Figures,
|
||||
"chart-pie.svg",Ico_BLACK);
|
||||
}
|
||||
|
||||
|
@ -161,12 +161,12 @@ void Fig_PutIconToShowFigure (Fig_FigureType_t FigureType)
|
|||
/************* Put hidden parameters for figures (statistics) ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Fig_PutHiddenParamFigures (void *Figures)
|
||||
void Fig_PutParsFigures (void *Figures)
|
||||
{
|
||||
if (Figures)
|
||||
{
|
||||
Fig_PutHiddenParamScopeFig (((struct Fig_Figures *) Figures)->Scope);
|
||||
Fig_PutHiddenParamFigureType (((struct Fig_Figures *) Figures)->FigureType);
|
||||
Fig_PutParScopeFig (((struct Fig_Figures *) Figures)->Scope);
|
||||
Fig_PutParFigureType (((struct Fig_Figures *) Figures)->FigureType);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -174,7 +174,7 @@ void Fig_PutHiddenParamFigures (void *Figures)
|
|||
/********* Put hidden parameter for the type of figure (statistic) ***********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Fig_PutHiddenParamFigureType (Fig_FigureType_t FigureType)
|
||||
static void Fig_PutParFigureType (Fig_FigureType_t FigureType)
|
||||
{
|
||||
Par_PutParUnsigned (NULL,"FigureType",(unsigned) FigureType);
|
||||
}
|
||||
|
@ -183,9 +183,9 @@ static void Fig_PutHiddenParamFigureType (Fig_FigureType_t FigureType)
|
|||
/********* Put hidden parameter for the type of figure (statistic) ***********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Fig_PutHiddenParamScopeFig (HieLvl_Level_t ScopeFig)
|
||||
static void Fig_PutParScopeFig (HieLvl_Level_t ScopeFig)
|
||||
{
|
||||
Sco_PutParamScope ("ScopeFig",ScopeFig);
|
||||
Sco_PutParScope ("ScopeFig",ScopeFig);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -235,9 +235,9 @@ void Fig_ShowFigures (void)
|
|||
/***** Get the type of figure ******/
|
||||
SelectedFigureType = (Fig_FigureType_t)
|
||||
Par_GetParUnsignedLong ("FigureType",
|
||||
0,
|
||||
Fig_NUM_FIGURES - 1,
|
||||
(unsigned long) Fig_FIGURE_TYPE_DEF);
|
||||
0,
|
||||
Fig_NUM_FIGURES - 1,
|
||||
(unsigned long) Fig_FIGURE_TYPE_DEF);
|
||||
|
||||
/***** Show again the form to see use of the platform *****/
|
||||
Fig_ReqShowFigure (SelectedFigureType);
|
||||
|
|
|
@ -86,7 +86,7 @@ struct Fig_Figures
|
|||
|
||||
void Fig_ReqShowFigures (void);
|
||||
void Fig_PutIconToShowFigure (Fig_FigureType_t FigureType);
|
||||
void Fig_PutHiddenParamFigures (void *Figures);
|
||||
void Fig_PutParsFigures (void *Figures);
|
||||
void Fig_ShowFigures (void);
|
||||
|
||||
#endif
|
||||
|
|
42
swad_file.c
42
swad_file.c
|
@ -238,58 +238,58 @@ Content-Type: image/pjpeg
|
|||
000020 03030304 03030405 08050504 04050A07 ················
|
||||
etc, etc.
|
||||
*/
|
||||
struct Param *Fil_StartReceptionOfFile (const char *ParamFile,
|
||||
char *FileName,char *MIMEType)
|
||||
struct Par_Param *Fil_StartReceptionOfFile (const char *ParFile,
|
||||
char *FileName,char *MIMEType)
|
||||
{
|
||||
struct Param *Param;
|
||||
struct Par_Param *Par;
|
||||
FILE *QueryFile = Fil_GetQueryFile ();
|
||||
|
||||
/***** Set default values *****/
|
||||
FileName[0] = 0;
|
||||
|
||||
/***** Get parameter *****/
|
||||
Par_GetParameter (Par_PARAM_SINGLE,ParamFile,NULL,Fil_MAX_FILE_SIZE,&Param);
|
||||
Par_GetPar (Par_PARAM_SINGLE,ParFile,NULL,Fil_MAX_FILE_SIZE,&Par);
|
||||
|
||||
/***** Get filename *****/
|
||||
/* Check if filename exists */
|
||||
if (Param->FileName.Start == 0 ||
|
||||
Param->FileName.Length == 0)
|
||||
if (Par->FileName.Start == 0 ||
|
||||
Par->FileName.Length == 0)
|
||||
{
|
||||
FileName[0] = MIMEType[0] = '\0';
|
||||
return Param;
|
||||
return Par;
|
||||
}
|
||||
if (Param->FileName.Length > PATH_MAX)
|
||||
if (Par->FileName.Length > PATH_MAX)
|
||||
Err_ShowErrorAndExit ("Error while getting filename.");
|
||||
|
||||
/* Copy filename */
|
||||
fseek (QueryFile,Param->FileName.Start,SEEK_SET);
|
||||
if (fread (FileName,sizeof (char),Param->FileName.Length,QueryFile) !=
|
||||
Param->FileName.Length)
|
||||
fseek (QueryFile,Par->FileName.Start,SEEK_SET);
|
||||
if (fread (FileName,sizeof (char),Par->FileName.Length,QueryFile) !=
|
||||
Par->FileName.Length)
|
||||
Err_ShowErrorAndExit ("Error while getting filename.");
|
||||
FileName[Param->FileName.Length] = '\0';
|
||||
FileName[Par->FileName.Length] = '\0';
|
||||
|
||||
/***** Get MIME type *****/
|
||||
/* Check if MIME type exists */
|
||||
if (Param->ContentType.Start == 0 ||
|
||||
Param->ContentType.Length == 0 ||
|
||||
Param->ContentType.Length > Brw_MAX_BYTES_MIME_TYPE)
|
||||
if (Par->ContentType.Start == 0 ||
|
||||
Par->ContentType.Length == 0 ||
|
||||
Par->ContentType.Length > Brw_MAX_BYTES_MIME_TYPE)
|
||||
Err_ShowErrorAndExit ("Error while getting content type.");
|
||||
|
||||
/* Copy MIME type */
|
||||
fseek (QueryFile,Param->ContentType.Start,SEEK_SET);
|
||||
if (fread (MIMEType,sizeof (char),Param->ContentType.Length,QueryFile) !=
|
||||
Param->ContentType.Length)
|
||||
fseek (QueryFile,Par->ContentType.Start,SEEK_SET);
|
||||
if (fread (MIMEType,sizeof (char),Par->ContentType.Length,QueryFile) !=
|
||||
Par->ContentType.Length)
|
||||
Err_ShowErrorAndExit ("Error while getting content type.");
|
||||
MIMEType[Param->ContentType.Length] = '\0';
|
||||
MIMEType[Par->ContentType.Length] = '\0';
|
||||
|
||||
return Param;
|
||||
return Par;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/****************** End the reception of data of a file **********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
bool Fil_EndReceptionOfFile (char *FileNameDataTmp,struct Param *Param)
|
||||
bool Fil_EndReceptionOfFile (char *FileNameDataTmp,struct Par_Param *Param)
|
||||
{
|
||||
FILE *FileDataTmp;
|
||||
unsigned char Bytes[Fil_NUM_BYTES_PER_CHUNK];
|
||||
|
|
|
@ -58,9 +58,9 @@ void Fil_CreateFileForHTMLOutput (void);
|
|||
void Fil_CloseAndRemoveFileForHTMLOutput (void);
|
||||
bool Fil_ReadStdinIntoTmpFile (void);
|
||||
void Fil_EndOfReadingStdin (void);
|
||||
struct Param *Fil_StartReceptionOfFile (const char *ParamFile,
|
||||
char *FileName,char *MIMEType);
|
||||
bool Fil_EndReceptionOfFile (char *FileNameDataTmp,struct Param *Param);
|
||||
struct Par_Param *Fil_StartReceptionOfFile (const char *ParFile,
|
||||
char *FileName,char *MIMEType);
|
||||
bool Fil_EndReceptionOfFile (char *FileNameDataTmp,struct Par_Param *Par);
|
||||
void Fil_CreateUpdateFile (const char CurrentName[PATH_MAX + 1],
|
||||
const char *ExtensionOldName,
|
||||
char OldName[PATH_MAX + 1],
|
||||
|
|
|
@ -86,7 +86,7 @@ static void Fol_PutIconToUnfollow (const char EncryptedUsrCod[Cry_BYTES_ENCRYPTE
|
|||
|
||||
static void Fol_RequestFollowUsrs (Act_Action_t NextAction);
|
||||
static void Fol_RequestUnfollowUsrs (Act_Action_t NextAction);
|
||||
static void Fol_PutHiddenParSelectedUsrsCods (void *SelectedUsrs);
|
||||
static void Fol_PutParSelectedUsrsCods (void *SelectedUsrs);
|
||||
static void Fol_GetFollowedFromSelectedUsrs (unsigned *NumFollowed,
|
||||
unsigned *NumNotFollowed);
|
||||
|
||||
|
@ -359,7 +359,7 @@ void Fol_ShowFollowingAndFollowers (const struct Usr_Data *UsrDat,
|
|||
{
|
||||
Frm_BeginForm (IFollowUsr ? ActUnfUsr :
|
||||
ActFolUsr);
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
HTM_INPUT_IMAGE (Cfg_URL_ICON_PUBLIC,
|
||||
IFollowUsr ? "user-check.svg" :
|
||||
"user-plus.svg",
|
||||
|
@ -397,7 +397,7 @@ static void Fol_ShowNumberOfFollowingOrFollowers (const struct Usr_Data *UsrDat,
|
|||
{
|
||||
/* Form to list users */
|
||||
Frm_BeginFormAnchor (Action,Fol_FOLLOW_SECTION_ID);
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
HTM_BUTTON_Submit_Begin (Title,"class=\"BT_LINK\"");
|
||||
}
|
||||
HTM_Unsigned (NumUsrs);
|
||||
|
@ -416,7 +416,7 @@ static void Fol_ShowNumberOfFollowingOrFollowers (const struct Usr_Data *UsrDat,
|
|||
{
|
||||
/* Form to list users */
|
||||
Frm_BeginFormAnchor (Action,Fol_FOLLOW_SECTION_ID);
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
HTM_BUTTON_Submit_Begin (Title,"class=\"BT_LINK\"");
|
||||
}
|
||||
HTM_Txt (Title);
|
||||
|
@ -438,7 +438,7 @@ static void Fol_ShowNumberOfFollowingOrFollowers (const struct Usr_Data *UsrDat,
|
|||
void Fol_ListFollowing (void)
|
||||
{
|
||||
/***** Get user to view user he/she follows *****/
|
||||
Usr_GetParamOtherUsrCodEncryptedAndGetListIDs ();
|
||||
Usr_GetParOtherUsrCodEncryptedAndGetListIDs ();
|
||||
|
||||
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
|
||||
{
|
||||
|
@ -517,7 +517,7 @@ static void Fol_ListFollowingUsr (struct Usr_Data *UsrDat)
|
|||
void Fol_ListFollowers (void)
|
||||
{
|
||||
/***** Get user to view user he/she follows *****/
|
||||
Usr_GetParamOtherUsrCodEncryptedAndGetListIDs ();
|
||||
Usr_GetParOtherUsrCodEncryptedAndGetListIDs ();
|
||||
|
||||
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
|
||||
{
|
||||
|
@ -623,7 +623,7 @@ static void Fol_ShowFollowedOrFollower (struct Usr_Data *UsrDat)
|
|||
{
|
||||
/* Put form to go to public profile */
|
||||
Frm_BeginForm (ActSeeOthPubPrf);
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
HTM_DIV_Begin ("class=\"LT FOLLOW_USR_NAME DAT_%s\"", // Limited width
|
||||
The_GetSuffix ());
|
||||
HTM_BUTTON_Submit_Begin (Txt_Another_user_s_profile,
|
||||
|
@ -685,7 +685,7 @@ static void Fol_WriteRowUsrToFollowOnRightColumn (struct Usr_Data *UsrDat)
|
|||
{
|
||||
/* Put form to go to public profile */
|
||||
Frm_BeginForm (ActSeeOthPubPrf);
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
Usr_PutParUsrCodEncrypted (UsrDat->EnUsrCod);
|
||||
HTM_DIV_Begin ("class=\"CON_NAME_FOLLOW CON_CRS LT\""); // Limited width
|
||||
HTM_BUTTON_Submit_Begin (Txt_Another_user_s_profile,
|
||||
"class=\"LT BT_LINK\"");
|
||||
|
@ -740,7 +740,7 @@ static void Fol_PutInactiveIconToFollowUnfollow (void)
|
|||
static void Fol_PutIconToFollow (const char EncryptedUsrCod[Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64 + 1])
|
||||
{
|
||||
Frm_BeginForm (ActFolUsr);
|
||||
Usr_PutParamUsrCodEncrypted (EncryptedUsrCod);
|
||||
Usr_PutParUsrCodEncrypted (EncryptedUsrCod);
|
||||
HTM_INPUT_IMAGE (Cfg_URL_ICON_PUBLIC,"user-plus.svg",
|
||||
Act_GetActionText (ActFolUsr),
|
||||
"class=\"FOLLOW_USR_ICO ICO16x16 ICO_%s_%s ICO_HIGHLIGHT\"",
|
||||
|
@ -755,7 +755,7 @@ static void Fol_PutIconToFollow (const char EncryptedUsrCod[Cry_BYTES_ENCRYPTED_
|
|||
static void Fol_PutIconToUnfollow (const char EncryptedUsrCod[Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64 + 1])
|
||||
{
|
||||
Frm_BeginForm (ActUnfUsr);
|
||||
Usr_PutParamUsrCodEncrypted (EncryptedUsrCod);
|
||||
Usr_PutParUsrCodEncrypted (EncryptedUsrCod);
|
||||
HTM_INPUT_IMAGE (Cfg_URL_ICON_PUBLIC,"user-check.svg",
|
||||
Act_GetActionText (ActUnfUsr),
|
||||
"class=\"FOLLOW_USR_ICO ICO_HIGHLIGHT ICO16x16\"");
|
||||
|
@ -769,7 +769,7 @@ static void Fol_PutIconToUnfollow (const char EncryptedUsrCod[Cry_BYTES_ENCRYPTE
|
|||
void Fol_FollowUsr1 (void)
|
||||
{
|
||||
/***** Get user to be followed *****/
|
||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
|
||||
{
|
||||
// Follow only if I do not follow him/her
|
||||
if (!Fol_DB_CheckUsrIsFollowerOf (Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||
|
@ -804,7 +804,7 @@ void Fol_FollowUsr2 (void)
|
|||
void Fol_UnfollowUsr1 (void)
|
||||
{
|
||||
/***** Get user to be unfollowed *****/
|
||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||
if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ())
|
||||
{
|
||||
// Unfollow only if I follow him/her
|
||||
if (Fol_DB_CheckUsrIsFollowerOf (Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||
|
@ -866,12 +866,12 @@ static void Fol_RequestFollowUsrs (Act_Action_t NextAction)
|
|||
{
|
||||
if (NumNotFollowed == 1)
|
||||
Ale_ShowAlertAndButton (NextAction,NULL,NULL,
|
||||
Fol_PutHiddenParSelectedUsrsCods,&Gbl.Usrs.Selected,
|
||||
Fol_PutParSelectedUsrsCods,&Gbl.Usrs.Selected,
|
||||
Btn_CREATE_BUTTON,Txt_Follow,
|
||||
Ale_QUESTION,Txt_Do_you_want_to_follow_the_selected_user_whom_you_do_not_follow_yet);
|
||||
else
|
||||
Ale_ShowAlertAndButton (NextAction,NULL,NULL,
|
||||
Fol_PutHiddenParSelectedUsrsCods,&Gbl.Usrs.Selected,
|
||||
Fol_PutParSelectedUsrsCods,&Gbl.Usrs.Selected,
|
||||
Btn_CREATE_BUTTON,Txt_Follow,
|
||||
Ale_QUESTION,Txt_Do_you_want_to_follow_the_X_selected_users_whom_you_do_not_follow_yet,
|
||||
NumNotFollowed);
|
||||
|
@ -910,12 +910,12 @@ static void Fol_RequestUnfollowUsrs (Act_Action_t NextAction)
|
|||
{
|
||||
if (NumFollowed == 1)
|
||||
Ale_ShowAlertAndButton (NextAction,NULL,NULL,
|
||||
Fol_PutHiddenParSelectedUsrsCods,&Gbl.Usrs.Selected,
|
||||
Fol_PutParSelectedUsrsCods,&Gbl.Usrs.Selected,
|
||||
Btn_CREATE_BUTTON,Txt_Unfollow,
|
||||
Ale_QUESTION,Txt_Do_you_want_to_stop_following_the_selected_user_whom_you_follow);
|
||||
else
|
||||
Ale_ShowAlertAndButton (NextAction,NULL,NULL,
|
||||
Fol_PutHiddenParSelectedUsrsCods,&Gbl.Usrs.Selected,
|
||||
Fol_PutParSelectedUsrsCods,&Gbl.Usrs.Selected,
|
||||
Btn_CREATE_BUTTON,Txt_Unfollow,
|
||||
Ale_QUESTION,Txt_Do_you_want_to_stop_following_the_X_selected_users_whom_you_follow,
|
||||
NumFollowed);
|
||||
|
@ -925,10 +925,10 @@ static void Fol_RequestUnfollowUsrs (Act_Action_t NextAction)
|
|||
Usr_FreeListsSelectedEncryptedUsrsCods (&Gbl.Usrs.Selected);
|
||||
}
|
||||
|
||||
static void Fol_PutHiddenParSelectedUsrsCods (void *SelectedUsrs)
|
||||
static void Fol_PutParSelectedUsrsCods (void *SelectedUsrs)
|
||||
{
|
||||
if (SelectedUsrs)
|
||||
Usr_PutHiddenParSelectedUsrsCods ((struct Usr_SelectedUsrs *) SelectedUsrs);
|
||||
Usr_PutParSelectedUsrsCods ((struct Usr_SelectedUsrs *) SelectedUsrs);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -951,7 +951,7 @@ static void Fol_GetFollowedFromSelectedUsrs (unsigned *NumFollowed,
|
|||
Ptr = Gbl.Usrs.Selected.List[Rol_UNK];
|
||||
while (*Ptr)
|
||||
{
|
||||
Par_GetNextStrUntilSeparParamMult (&Ptr,UsrDat.EnUsrCod,
|
||||
Par_GetNextStrUntilSeparParMult (&Ptr,UsrDat.EnUsrCod,
|
||||
Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64);
|
||||
Usr_GetUsrCodFromEncryptedUsrCod (&UsrDat);
|
||||
if (Gbl.Usrs.Me.UsrDat.UsrCod != UsrDat.UsrCod) // Skip me
|
||||
|
@ -999,7 +999,7 @@ void Fol_FollowUsrs ()
|
|||
Ptr = Gbl.Usrs.Selected.List[Rol_UNK];
|
||||
while (*Ptr)
|
||||
{
|
||||
Par_GetNextStrUntilSeparParamMult (&Ptr,UsrDat.EnUsrCod,
|
||||
Par_GetNextStrUntilSeparParMult (&Ptr,UsrDat.EnUsrCod,
|
||||
Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64);
|
||||
Usr_GetUsrCodFromEncryptedUsrCod (&UsrDat);
|
||||
if (Gbl.Usrs.Me.UsrDat.UsrCod != UsrDat.UsrCod) // Skip me
|
||||
|
@ -1048,7 +1048,7 @@ void Fol_UnfollowUsrs (void)
|
|||
Ptr = Gbl.Usrs.Selected.List[Rol_UNK];
|
||||
while (*Ptr)
|
||||
{
|
||||
Par_GetNextStrUntilSeparParamMult (&Ptr,UsrDat.EnUsrCod,
|
||||
Par_GetNextStrUntilSeparParMult (&Ptr,UsrDat.EnUsrCod,
|
||||
Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64);
|
||||
Usr_GetUsrCodFromEncryptedUsrCod (&UsrDat);
|
||||
if (Gbl.Usrs.Me.UsrDat.UsrCod != UsrDat.UsrCod) // Skip me
|
||||
|
|
46
swad_form.c
46
swad_form.c
|
@ -54,7 +54,7 @@ static bool Frm_Inside = false;
|
|||
|
||||
static inline void Frm_SetInside (bool Inside);
|
||||
|
||||
static void Frm_BeginFormInternal (Act_Action_t NextAction,bool PutParameterLocationIfNoSesion,
|
||||
static void Frm_BeginFormInternal (Act_Action_t NextAction,bool PutParLocationIfNoSesion,
|
||||
const char *Id,const char *Anchor,const char *OnSubmit);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -105,11 +105,11 @@ void Frm_BeginFormId (Act_Action_t NextAction,const char *Id)
|
|||
Frm_BeginFormInternal (NextAction,true,Id,NULL,NULL); // Do put now parameter location (if no open session)
|
||||
}
|
||||
|
||||
static void Frm_BeginFormInternal (Act_Action_t NextAction,bool PutParameterLocationIfNoSesion,
|
||||
static void Frm_BeginFormInternal (Act_Action_t NextAction,bool PutParLocationIfNoSesion,
|
||||
const char *Id,const char *Anchor,const char *OnSubmit)
|
||||
{
|
||||
extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
|
||||
char ParamsStr[Frm_MAX_BYTES_PARAMS_STR + 1];
|
||||
char ParsStr[Frm_MAX_BYTES_PARAMS_STR + 1];
|
||||
|
||||
if (!Frm_CheckIfInside ())
|
||||
{
|
||||
|
@ -146,8 +146,8 @@ static void Frm_BeginFormInternal (Act_Action_t NextAction,bool PutParameterLoca
|
|||
HTM_Txt (" accept-charset=\"windows-1252\">");
|
||||
|
||||
/* Put basic form parameters */
|
||||
Frm_SetParamsForm (ParamsStr,NextAction,PutParameterLocationIfNoSesion);
|
||||
HTM_Txt (ParamsStr);
|
||||
Frm_SetParsForm (ParsStr,NextAction,PutParLocationIfNoSesion);
|
||||
HTM_Txt (ParsStr);
|
||||
|
||||
Frm_SetInside (true);
|
||||
}
|
||||
|
@ -172,28 +172,28 @@ void Frm_BeginFormNoAction (void)
|
|||
}
|
||||
}
|
||||
|
||||
void Frm_SetParamsForm (char ParamsStr[Frm_MAX_BYTES_PARAMS_STR + 1],Act_Action_t NextAction,
|
||||
bool PutParameterLocationIfNoSession)
|
||||
void Frm_SetParsForm (char ParsStr[Frm_MAX_BYTES_PARAMS_STR + 1],Act_Action_t NextAction,
|
||||
bool PutParLocationIfNoSession)
|
||||
{
|
||||
char ParamAction[Frm_MAX_BYTES_PARAM_ACTION + 1];
|
||||
char ParamSession[Frm_MAX_BYTES_PARAM_SESSION + 1];
|
||||
char ParamLocation[Frm_MAX_BYTES_PARAM_LOCATION + 1];
|
||||
char ParAction[Frm_MAX_BYTES_PARAM_ACTION + 1];
|
||||
char ParSession[Frm_MAX_BYTES_PARAM_SESSION + 1];
|
||||
char ParLocation[Frm_MAX_BYTES_PARAM_LOCATION + 1];
|
||||
|
||||
ParamAction[0] = '\0';
|
||||
ParamSession[0] = '\0';
|
||||
ParamLocation[0] = '\0';
|
||||
ParAction[0] = '\0';
|
||||
ParSession[0] = '\0';
|
||||
ParLocation[0] = '\0';
|
||||
|
||||
if (NextAction != ActUnk)
|
||||
{
|
||||
snprintf (ParamAction,sizeof (ParamAction),
|
||||
snprintf (ParAction,sizeof (ParAction),
|
||||
"<input type=\"hidden\" name=\"act\" value=\"%ld\" />",
|
||||
Act_GetActCod (NextAction));
|
||||
|
||||
if (Gbl.Session.Id[0])
|
||||
snprintf (ParamSession,sizeof (ParamSession),
|
||||
snprintf (ParSession,sizeof (ParSession),
|
||||
"<input type=\"hidden\" name=\"ses\" value=\"%s\" />",
|
||||
Gbl.Session.Id);
|
||||
else if (PutParameterLocationIfNoSession)
|
||||
else if (PutParLocationIfNoSession)
|
||||
// Extra parameters necessary when there's no open session
|
||||
{
|
||||
/* If session is open, course code will be get from session data,
|
||||
|
@ -202,27 +202,27 @@ void Frm_SetParamsForm (char ParamsStr[Frm_MAX_BYTES_PARAMS_STR + 1],Act_Action_
|
|||
switch (Gbl.Hierarchy.Level)
|
||||
{
|
||||
case HieLvl_CTY: // Country
|
||||
snprintf (ParamLocation,sizeof (ParamLocation),
|
||||
snprintf (ParLocation,sizeof (ParLocation),
|
||||
"<input type=\"hidden\" name=\"cty\" value=\"%ld\" />",
|
||||
Gbl.Hierarchy.Cty.CtyCod);
|
||||
break;
|
||||
case HieLvl_INS: // Institution
|
||||
snprintf (ParamLocation,sizeof (ParamLocation),
|
||||
snprintf (ParLocation,sizeof (ParLocation),
|
||||
"<input type=\"hidden\" name=\"ins\" value=\"%ld\" />",
|
||||
Gbl.Hierarchy.Ins.InsCod);
|
||||
break;
|
||||
case HieLvl_CTR: // Center
|
||||
snprintf (ParamLocation,sizeof (ParamLocation),
|
||||
snprintf (ParLocation,sizeof (ParLocation),
|
||||
"<input type=\"hidden\" name=\"ctr\" value=\"%ld\" />",
|
||||
Gbl.Hierarchy.Ctr.CtrCod);
|
||||
break;
|
||||
case HieLvl_DEG: // Degree
|
||||
snprintf (ParamLocation,sizeof (ParamLocation),
|
||||
snprintf (ParLocation,sizeof (ParLocation),
|
||||
"<input type=\"hidden\" name=\"deg\" value=\"%ld\" />",
|
||||
Gbl.Hierarchy.Deg.DegCod);
|
||||
break;
|
||||
case HieLvl_CRS: // Course
|
||||
snprintf (ParamLocation,sizeof (ParamLocation),
|
||||
snprintf (ParLocation,sizeof (ParLocation),
|
||||
"<input type=\"hidden\" name=\"crs\" value=\"%ld\" />",
|
||||
Gbl.Hierarchy.Crs.CrsCod);
|
||||
break;
|
||||
|
@ -232,8 +232,8 @@ void Frm_SetParamsForm (char ParamsStr[Frm_MAX_BYTES_PARAMS_STR + 1],Act_Action_
|
|||
}
|
||||
}
|
||||
|
||||
snprintf (ParamsStr,Frm_MAX_BYTES_PARAMS_STR + 1,"%s%s%s",
|
||||
ParamAction,ParamSession,ParamLocation);
|
||||
snprintf (ParsStr,Frm_MAX_BYTES_PARAMS_STR + 1,"%s%s%s",
|
||||
ParAction,ParSession,ParLocation);
|
||||
}
|
||||
|
||||
void Frm_EndForm (void)
|
||||
|
|
|
@ -55,8 +55,8 @@ void Frm_BeginFormAnchorOnSubmit (Act_Action_t NextAction,const char *Anchor,con
|
|||
void Frm_BeginFormId (Act_Action_t NextAction,const char *Id);
|
||||
void Frm_BeginFormAnchor (Act_Action_t NextAction,const char *Anchor);
|
||||
void Frm_BeginFormNoAction (void);
|
||||
void Frm_SetParamsForm (char ParamsStr[Frm_MAX_BYTES_PARAMS_STR + 1],Act_Action_t NextAction,
|
||||
bool PutParameterLocationIfNoSession);
|
||||
void Frm_SetParsForm (char ParsStr[Frm_MAX_BYTES_PARAMS_STR + 1],Act_Action_t NextAction,
|
||||
bool PutParLocationIfNoSession);
|
||||
void Frm_EndForm (void);
|
||||
|
||||
void Frm_SetUniqueId (char UniqueId[Frm_MAX_BYTES_ID + 1]);
|
||||
|
|
226
swad_forum.c
226
swad_forum.c
|
@ -326,10 +326,10 @@ static void For_GetPstData (long PstCod,long *UsrCod,time_t *CreatTimeUTC,
|
|||
struct Med_Media *Media);
|
||||
static void For_WriteNumberOfPosts (const struct For_Forums *Forums,long UsrCod);
|
||||
|
||||
static void For_PutParamsForum (void *Forums);
|
||||
static void For_PutParsForum (void *Forums);
|
||||
|
||||
static void For_PutParamForumSet (For_ForumSet_t ForumSet);
|
||||
static void For_PutParamForumLocation (long Location);
|
||||
static void For_PutParForumSet (For_ForumSet_t ForumSet);
|
||||
static void For_PutParForumLocation (long Location);
|
||||
|
||||
static void For_PutIconsForums (__attribute__((unused)) void *Args);
|
||||
static void For_PutFormWhichForums (const struct For_Forums *Forums);
|
||||
|
@ -363,7 +363,7 @@ static unsigned For_GetNumOfUnreadPostsInThr (long ThrCod,unsigned NumPostsInThr
|
|||
static void For_WriteNumberOfThrs (unsigned NumThrs);
|
||||
|
||||
static void For_PutIconsThreads (void *Forums);
|
||||
static void For_PutAllHiddenParamsNewThread (void *Forums);
|
||||
static void For_PutParsNewThread (void *Forums);
|
||||
static void For_ListForumThrs (struct For_Forums *Forums,
|
||||
long ThrCods[Pag_ITEMS_PER_PAGE],
|
||||
long ThrCodHighlighted,
|
||||
|
@ -376,7 +376,7 @@ static void For_RestrictAccess (const struct For_Forums *Forums);
|
|||
static void For_WriteFormForumPst (struct For_Forums *Forums,
|
||||
bool IsReply,const char *Subject);
|
||||
|
||||
static void For_PutAllHiddenParamsRemThread (void *Forums);
|
||||
static void For_PutParsRemThread (void *Forums);
|
||||
|
||||
static bool For_CheckIfICanMoveThreads (void);
|
||||
static void For_InsertThrInClipboard (long ThrCod);
|
||||
|
@ -424,7 +424,7 @@ void For_EnablePost (void)
|
|||
For_ResetForums (&Forums);
|
||||
|
||||
/***** Get parameters related to forum *****/
|
||||
For_GetParamsForums (&Forums);
|
||||
For_GetParsForums (&Forums);
|
||||
|
||||
/***** Delete post from table of disabled posts *****/
|
||||
For_DB_RemovePstFromDisabled (Forums.PstCod);
|
||||
|
@ -449,7 +449,7 @@ void For_DisablePost (void)
|
|||
struct For_Forums Forums;
|
||||
|
||||
/***** Get parameters related to forums *****/
|
||||
For_GetParamsForums (&Forums);
|
||||
For_GetParsForums (&Forums);
|
||||
|
||||
/***** Check if post really exists, if it has not been removed *****/
|
||||
if (For_DB_CheckIfForumPstExists (Forums.PstCod))
|
||||
|
@ -826,26 +826,26 @@ static void For_PutIconsOneThread (void *Forums)
|
|||
/***** Put icon to write a new post *****/
|
||||
Ico_PutContextualIconToAdd (For_ActionsSeePstFor[((struct For_Forums *) Forums)->Forum.Type],
|
||||
For_NEW_POST_SECTION_ID,
|
||||
For_PutAllHiddenParamsNewPost,Forums);
|
||||
For_PutParsNewPost,Forums);
|
||||
|
||||
/***** Put icon to get resource link *****/
|
||||
if (((struct For_Forums *) Forums)->Forum.Type == For_FORUM_COURSE_USRS &&
|
||||
PrgRsc_CheckIfICanGetLink ())
|
||||
Ico_PutContextualIconToGetLink (ActReqLnkForCrsUsr,NULL,
|
||||
For_PutAllHiddenParamsNewPost,Forums);
|
||||
For_PutParsNewPost,Forums);
|
||||
}
|
||||
}
|
||||
|
||||
void For_PutAllHiddenParamsNewPost (void *Forums)
|
||||
void For_PutParsNewPost (void *Forums)
|
||||
{
|
||||
if (Forums)
|
||||
For_PutAllHiddenParamsForum (((struct For_Forums *) Forums)->CurrentPageThrs, // Page of threads = current
|
||||
UINT_MAX, // Page of posts = last
|
||||
((struct For_Forums *) Forums)->ForumSet,
|
||||
((struct For_Forums *) Forums)->ThreadsOrder,
|
||||
((struct For_Forums *) Forums)->Forum.Location,
|
||||
((struct For_Forums *) Forums)->Thread.Current,
|
||||
-1L);
|
||||
For_PutAllParsForum (((struct For_Forums *) Forums)->CurrentPageThrs, // Page of threads = current
|
||||
UINT_MAX, // Page of posts = last
|
||||
((struct For_Forums *) Forums)->ForumSet,
|
||||
((struct For_Forums *) Forums)->ThreadsOrder,
|
||||
((struct For_Forums *) Forums)->Forum.Location,
|
||||
((struct For_Forums *) Forums)->Thread.Current,
|
||||
-1L);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -944,7 +944,7 @@ static void For_ShowAForumPost (struct For_Forums *Forums,
|
|||
Frm_BeginFormAnchor (Enabled ? For_ActionsDisPstFor[Forums->Forum.Type] :
|
||||
For_ActionsEnbPstFor[Forums->Forum.Type],
|
||||
For_FORUM_POSTS_SECTION_ID);
|
||||
For_PutParamsForum (Forums);
|
||||
For_PutParsForum (Forums);
|
||||
Ico_PutIconLink (Enabled ? "eye.svg" :
|
||||
"eye-slash.svg",
|
||||
Enabled ? Ico_GREEN :
|
||||
|
@ -975,7 +975,7 @@ static void For_ShowAForumPost (struct For_Forums *Forums,
|
|||
Ico_PutContextualIconToRemove (For_ActionsDelPstFor[Forums->Forum.Type],
|
||||
PstNum == 1 ? For_FORUM_THREADS_SECTION_ID : // First and unique post in thread
|
||||
For_FORUM_POSTS_SECTION_ID, // Last of several posts in thread
|
||||
For_PutParamsForum,Forums);
|
||||
For_PutParsForum,Forums);
|
||||
|
||||
HTM_TD_End ();
|
||||
|
||||
|
@ -1116,31 +1116,31 @@ static void For_WriteNumberOfPosts (const struct For_Forums *Forums,long UsrCod)
|
|||
/************** Put all hidden parameters related to forums ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void For_PutParamsForum (void *Forums)
|
||||
static void For_PutParsForum (void *Forums)
|
||||
{
|
||||
if (Forums)
|
||||
For_PutAllHiddenParamsForum (((struct For_Forums *) Forums)->CurrentPageThrs, // Page of threads = current
|
||||
((struct For_Forums *) Forums)->CurrentPagePsts, // Page of posts = current
|
||||
((struct For_Forums *) Forums)->ForumSet,
|
||||
((struct For_Forums *) Forums)->ThreadsOrder,
|
||||
((struct For_Forums *) Forums)->Forum.Location,
|
||||
((struct For_Forums *) Forums)->Thread.Current,
|
||||
((struct For_Forums *) Forums)->PstCod);
|
||||
For_PutAllParsForum (((struct For_Forums *) Forums)->CurrentPageThrs, // Page of threads = current
|
||||
((struct For_Forums *) Forums)->CurrentPagePsts, // Page of posts = current
|
||||
((struct For_Forums *) Forums)->ForumSet,
|
||||
((struct For_Forums *) Forums)->ThreadsOrder,
|
||||
((struct For_Forums *) Forums)->Forum.Location,
|
||||
((struct For_Forums *) Forums)->Thread.Current,
|
||||
((struct For_Forums *) Forums)->PstCod);
|
||||
}
|
||||
|
||||
void For_PutAllHiddenParamsForum (unsigned NumPageThreads,
|
||||
unsigned NumPagePosts,
|
||||
For_ForumSet_t ForumSet,
|
||||
Dat_StartEndTime_t Order,
|
||||
long Location,
|
||||
long ThrCod,
|
||||
long PstCod)
|
||||
void For_PutAllParsForum (unsigned NumPageThreads,
|
||||
unsigned NumPagePosts,
|
||||
For_ForumSet_t ForumSet,
|
||||
Dat_StartEndTime_t Order,
|
||||
long Location,
|
||||
long ThrCod,
|
||||
long PstCod)
|
||||
{
|
||||
Pag_PutHiddenParamPagNum (Pag_THREADS_FORUM,NumPageThreads);
|
||||
Pag_PutHiddenParamPagNum (Pag_POSTS_FORUM,NumPagePosts);
|
||||
For_PutParamForumSet (ForumSet);
|
||||
Pag_PutParPagNum (Pag_THREADS_FORUM,NumPageThreads);
|
||||
Pag_PutParPagNum (Pag_POSTS_FORUM,NumPagePosts);
|
||||
For_PutParForumSet (ForumSet);
|
||||
Par_PutParOrder ((unsigned) Order);
|
||||
For_PutParamForumLocation (Location);
|
||||
For_PutParForumLocation (Location);
|
||||
Par_PutParCode (Par_ThrCod,ThrCod);
|
||||
Par_PutParCode (Par_PstCod,PstCod);
|
||||
}
|
||||
|
@ -1149,7 +1149,7 @@ void For_PutAllHiddenParamsForum (unsigned NumPageThreads,
|
|||
/********* Put a hidden parameter with set of forums I want to see ***********/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void For_PutParamForumSet (For_ForumSet_t ForumSet)
|
||||
static void For_PutParForumSet (For_ForumSet_t ForumSet)
|
||||
{
|
||||
Par_PutParUnsigned (NULL,"ForumSet",(unsigned) ForumSet);
|
||||
}
|
||||
|
@ -1159,7 +1159,7 @@ static void For_PutParamForumSet (For_ForumSet_t ForumSet)
|
|||
/************** forum institution, center, degree and course *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void For_PutParamForumLocation (long Location)
|
||||
static void For_PutParForumLocation (long Location)
|
||||
{
|
||||
if (Location > 0)
|
||||
/***** Put a hidden parameter with the
|
||||
|
@ -1696,13 +1696,13 @@ static void For_WriteLinkToForum (const struct For_Forums *Forums,
|
|||
{
|
||||
Frm_BeginFormAnchor (For_ActionsPasThrFor[Forum->Type],
|
||||
For_FORUM_THREADS_SECTION_ID);
|
||||
For_PutAllHiddenParamsForum (1, // Page of threads = first
|
||||
1, // Page of posts = first
|
||||
Forums->ForumSet,
|
||||
Forums->ThreadsOrder,
|
||||
Forum->Location,
|
||||
Forums->Thread.ToMove,
|
||||
-1L);
|
||||
For_PutAllParsForum (1, // Page of threads = first
|
||||
1, // Page of posts = first
|
||||
Forums->ForumSet,
|
||||
Forums->ThreadsOrder,
|
||||
Forum->Location,
|
||||
Forums->Thread.ToMove,
|
||||
-1L);
|
||||
Ico_PutIconPaste (For_ActionsPasThrFor[Forum->Type]);
|
||||
Frm_EndForm ();
|
||||
}
|
||||
|
@ -1711,13 +1711,13 @@ static void For_WriteLinkToForum (const struct For_Forums *Forums,
|
|||
/***** Write link to forum *****/
|
||||
Frm_BeginFormAnchor (For_ActionsSeeFor[Forum->Type],
|
||||
For_FORUM_THREADS_SECTION_ID);
|
||||
For_PutAllHiddenParamsForum (1, // Page of threads = first
|
||||
1, // Page of posts = first
|
||||
Forums->ForumSet,
|
||||
Forums->ThreadsOrder,
|
||||
Forum->Location,
|
||||
-1L,
|
||||
-1L);
|
||||
For_PutAllParsForum (1, // Page of threads = first
|
||||
1, // Page of posts = first
|
||||
Forums->ForumSet,
|
||||
Forums->ThreadsOrder,
|
||||
Forum->Location,
|
||||
-1L,
|
||||
-1L);
|
||||
|
||||
HTM_BUTTON_Submit_Begin (Act_GetActionText (For_ActionsSeeFor[Forum->Type]),
|
||||
NumThrsWithNewPosts ? "class=\"BT_LINK FORM_IN_%s BOLD\"" :
|
||||
|
@ -1950,7 +1950,7 @@ void For_ShowForumTheads (void)
|
|||
For_ResetForums (&Forums);
|
||||
|
||||
/***** Get parameters related to forums *****/
|
||||
For_GetParamsForums (&Forums);
|
||||
For_GetParsForums (&Forums);
|
||||
|
||||
/***** Show forum list again *****/
|
||||
For_ShowForumList (&Forums);
|
||||
|
@ -2047,13 +2047,13 @@ void For_ShowForumThreadsHighlightingOneThread (struct For_Forums *Forums,
|
|||
|
||||
Frm_BeginFormAnchor (For_ActionsSeeFor[Forums->Forum.Type],
|
||||
For_FORUM_THREADS_SECTION_ID);
|
||||
For_PutAllHiddenParamsForum (Forums->CurrentPageThrs, // Page of threads = current
|
||||
1, // Page of posts = first
|
||||
Forums->ForumSet,
|
||||
Order,
|
||||
Forums->Forum.Location,
|
||||
-1L,
|
||||
-1L);
|
||||
For_PutAllParsForum (Forums->CurrentPageThrs, // Page of threads = current
|
||||
1, // Page of posts = first
|
||||
Forums->ForumSet,
|
||||
Order,
|
||||
Forums->Forum.Location,
|
||||
-1L,
|
||||
-1L);
|
||||
HTM_BUTTON_Submit_Begin (Txt_FORUM_THREAD_HELP_ORDER[Order],
|
||||
"class=\"BT_LINK\"");
|
||||
if (Order == Forums->ThreadsOrder)
|
||||
|
@ -2107,26 +2107,26 @@ static void For_PutIconsThreads (void *Forums)
|
|||
/***** Put icon to write a new thread *****/
|
||||
Ico_PutContextualIconToAdd (For_ActionsSeeFor[((struct For_Forums *) Forums)->Forum.Type],
|
||||
For_NEW_THREAD_SECTION_ID,
|
||||
For_PutAllHiddenParamsNewThread,Forums);
|
||||
For_PutParsNewThread,Forums);
|
||||
|
||||
/***** Put icon to get resource link *****/
|
||||
if (((struct For_Forums *) Forums)->Forum.Type == For_FORUM_COURSE_USRS &&
|
||||
PrgRsc_CheckIfICanGetLink ())
|
||||
Ico_PutContextualIconToGetLink (ActReqLnkForCrsUsr,NULL,
|
||||
For_PutAllHiddenParamsNewPost,Forums);
|
||||
For_PutParsNewPost,Forums);
|
||||
}
|
||||
}
|
||||
|
||||
static void For_PutAllHiddenParamsNewThread (void *Forums)
|
||||
static void For_PutParsNewThread (void *Forums)
|
||||
{
|
||||
if (Forums)
|
||||
For_PutAllHiddenParamsForum (1, // Page of threads = first
|
||||
1, // Page of posts = first
|
||||
((struct For_Forums *)Forums)->ForumSet,
|
||||
((struct For_Forums *)Forums)->ThreadsOrder,
|
||||
((struct For_Forums *)Forums)->Forum.Location,
|
||||
-1L,
|
||||
-1L);
|
||||
For_PutAllParsForum (1, // Page of threads = first
|
||||
1, // Page of posts = first
|
||||
((struct For_Forums *)Forums)->ForumSet,
|
||||
((struct For_Forums *)Forums)->ThreadsOrder,
|
||||
((struct For_Forums *)Forums)->Forum.Location,
|
||||
-1L,
|
||||
-1L);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -2213,7 +2213,7 @@ static void For_ListForumThrs (struct For_Forums *Forums,
|
|||
{
|
||||
HTM_BR ();
|
||||
Ico_PutContextualIconToRemove (For_ActionsReqDelThr[Forums->Forum.Type],For_REMOVE_THREAD_SECTION_ID,
|
||||
For_PutParamsForum,Forums);
|
||||
For_PutParsForum,Forums);
|
||||
}
|
||||
|
||||
/***** Put button to cut the thread for moving it to another forum *****/
|
||||
|
@ -2222,13 +2222,13 @@ static void For_ListForumThrs (struct For_Forums *Forums,
|
|||
HTM_BR ();
|
||||
Frm_BeginFormAnchor (For_ActionsCutThrFor[Forums->Forum.Type],
|
||||
For_FORUM_THREADS_SECTION_ID);
|
||||
For_PutAllHiddenParamsForum (Forums->CurrentPageThrs, // Page of threads = current
|
||||
1, // Page of posts = first
|
||||
Forums->ForumSet,
|
||||
Forums->ThreadsOrder,
|
||||
Forums->Forum.Location,
|
||||
Thr.ThrCod,
|
||||
-1L);
|
||||
For_PutAllParsForum (Forums->CurrentPageThrs, // Page of threads = current
|
||||
1, // Page of posts = first
|
||||
Forums->ForumSet,
|
||||
Forums->ThreadsOrder,
|
||||
Forums->Forum.Location,
|
||||
Thr.ThrCod,
|
||||
-1L);
|
||||
Ico_PutIconCut (For_ActionsCutThrFor[Forums->Forum.Type]);
|
||||
Frm_EndForm ();
|
||||
}
|
||||
|
@ -2399,7 +2399,7 @@ void For_ShowThreadPosts (void)
|
|||
For_ResetForums (&Forums);
|
||||
|
||||
/***** Get parameters related to forums *****/
|
||||
For_GetParamsForums (&Forums);
|
||||
For_GetParsForums (&Forums);
|
||||
|
||||
/***** Show forum list again *****/
|
||||
For_ShowForumList (&Forums);
|
||||
|
@ -2415,7 +2415,7 @@ void For_ShowThreadPosts (void)
|
|||
/********************* Get parameters related to a forum *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void For_GetParamsForums (struct For_Forums *Forums)
|
||||
void For_GetParsForums (struct For_Forums *Forums)
|
||||
{
|
||||
/***** Set forum type *****/
|
||||
For_SetForumType (Forums);
|
||||
|
@ -2448,20 +2448,20 @@ void For_GetParamsForums (struct For_Forums *Forums)
|
|||
/***** Get which forums I want to see *****/
|
||||
Forums->ForumSet = (For_ForumSet_t)
|
||||
Par_GetParUnsignedLong ("ForumSet",
|
||||
0,
|
||||
For_NUM_FORUM_SETS - 1,
|
||||
(unsigned long) For_DEFAULT_FORUM_SET);
|
||||
0,
|
||||
For_NUM_FORUM_SETS - 1,
|
||||
(unsigned long) For_DEFAULT_FORUM_SET);
|
||||
|
||||
/***** Get order type *****/
|
||||
Forums->ThreadsOrder = (Dat_StartEndTime_t)
|
||||
Par_GetParUnsignedLong ("Order",
|
||||
0,
|
||||
Dat_NUM_START_END_TIME - 1,
|
||||
(unsigned long) For_DEFAULT_ORDER);
|
||||
0,
|
||||
Dat_NUM_START_END_TIME - 1,
|
||||
(unsigned long) For_DEFAULT_ORDER);
|
||||
|
||||
/***** Get optional page numbers for threads and posts *****/
|
||||
Forums->CurrentPageThrs = Pag_GetParamPagNum (Pag_THREADS_FORUM);
|
||||
Forums->CurrentPagePsts = Pag_GetParamPagNum (Pag_POSTS_FORUM);
|
||||
Forums->CurrentPageThrs = Pag_GetParPagNum (Pag_THREADS_FORUM);
|
||||
Forums->CurrentPagePsts = Pag_GetParPagNum (Pag_POSTS_FORUM);
|
||||
|
||||
/***** Restrict access to forum *****/
|
||||
For_RestrictAccess (Forums);
|
||||
|
@ -2691,13 +2691,13 @@ static void For_WriteFormForumPst (struct For_Forums *Forums,
|
|||
{
|
||||
Frm_BeginFormAnchor (For_ActionsRecRepFor[Forums->Forum.Type],
|
||||
For_FORUM_POSTS_SECTION_ID);
|
||||
For_PutAllHiddenParamsNewPost (Forums);
|
||||
For_PutParsNewPost (Forums);
|
||||
}
|
||||
else // Form to write the first post of a new thread
|
||||
{
|
||||
Frm_BeginFormAnchor (For_ActionsRecThrFor[Forums->Forum.Type],
|
||||
For_FORUM_POSTS_SECTION_ID);
|
||||
For_PutAllHiddenParamsNewThread (Forums);
|
||||
For_PutParsNewThread (Forums);
|
||||
}
|
||||
|
||||
/***** Subject and content *****/
|
||||
|
@ -2780,7 +2780,7 @@ void For_ReceiveForumPost (void)
|
|||
For_ResetForums (&Forums);
|
||||
|
||||
/***** Get parameters related to forum *****/
|
||||
For_GetParamsForums (&Forums);
|
||||
For_GetParsForums (&Forums);
|
||||
|
||||
/***** Get the code of the thread y the número of page *****/
|
||||
if (Gbl.Action.Act == ActRcvRepForCrsUsr || Gbl.Action.Act == ActRcvRepForCrsTch ||
|
||||
|
@ -2898,7 +2898,7 @@ void For_RemovePost (void)
|
|||
For_ResetForums (&Forums);
|
||||
|
||||
/***** Get parameters related to forum *****/
|
||||
For_GetParamsForums (&Forums);
|
||||
For_GetParsForums (&Forums);
|
||||
|
||||
/***** Initialize image *****/
|
||||
Med_MediaConstructor (&Media);
|
||||
|
@ -2973,7 +2973,7 @@ void For_RequestRemoveThread (void)
|
|||
For_ResetForums (&Forums);
|
||||
|
||||
/***** Get parameters related to forum *****/
|
||||
For_GetParamsForums (&Forums);
|
||||
For_GetParsForums (&Forums);
|
||||
|
||||
/***** Get subject of the thread to delete *****/
|
||||
For_DB_GetThrSubject (Forums.Thread.Current,Subject);
|
||||
|
@ -2986,14 +2986,14 @@ void For_RequestRemoveThread (void)
|
|||
if (Subject[0])
|
||||
Ale_ShowAlertAndButton (For_ActionsDelThrFor[Forums.Forum.Type],
|
||||
For_FORUM_THREADS_SECTION_ID,NULL,
|
||||
For_PutAllHiddenParamsRemThread,&Forums,
|
||||
For_PutParsRemThread,&Forums,
|
||||
Btn_REMOVE_BUTTON,Txt_Remove_thread,
|
||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_entire_thread_X,
|
||||
Subject);
|
||||
else
|
||||
Ale_ShowAlertAndButton (For_ActionsDelThrFor[Forums.Forum.Type],
|
||||
For_FORUM_THREADS_SECTION_ID,NULL,
|
||||
For_PutAllHiddenParamsRemThread,&Forums,
|
||||
For_PutParsRemThread,&Forums,
|
||||
Btn_REMOVE_BUTTON,Txt_Remove_thread,
|
||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_entire_thread);
|
||||
HTM_SECTION_End ();
|
||||
|
@ -3002,16 +3002,16 @@ void For_RequestRemoveThread (void)
|
|||
For_ShowForumThreadsHighlightingOneThread (&Forums,Ale_SUCCESS,NULL);
|
||||
}
|
||||
|
||||
static void For_PutAllHiddenParamsRemThread (void *Forums)
|
||||
static void For_PutParsRemThread (void *Forums)
|
||||
{
|
||||
if (Forums)
|
||||
For_PutAllHiddenParamsForum (((struct For_Forums *) Forums)->CurrentPageThrs, // Page of threads = current
|
||||
1, // Page of posts = first
|
||||
((struct For_Forums *) Forums)->ForumSet,
|
||||
((struct For_Forums *) Forums)->ThreadsOrder,
|
||||
((struct For_Forums *) Forums)->Forum.Location,
|
||||
((struct For_Forums *) Forums)->Thread.Current,
|
||||
-1L);
|
||||
For_PutAllParsForum (((struct For_Forums *) Forums)->CurrentPageThrs, // Page of threads = current
|
||||
1, // Page of posts = first
|
||||
((struct For_Forums *) Forums)->ForumSet,
|
||||
((struct For_Forums *) Forums)->ThreadsOrder,
|
||||
((struct For_Forums *) Forums)->Forum.Location,
|
||||
((struct For_Forums *) Forums)->Thread.Current,
|
||||
-1L);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -3030,7 +3030,7 @@ void For_RemoveThread (void)
|
|||
For_ResetForums (&Forums);
|
||||
|
||||
/***** Get parameters related to forum *****/
|
||||
For_GetParamsForums (&Forums);
|
||||
For_GetParsForums (&Forums);
|
||||
|
||||
if (PermissionThreadDeletion[Forums.Forum.Type] &
|
||||
(1 << Gbl.Usrs.Me.Role.Logged)) // If I have permission to remove thread in this forum...
|
||||
|
@ -3074,7 +3074,7 @@ void For_CutThread (void)
|
|||
For_ResetForums (&Forums);
|
||||
|
||||
/***** Get parameters related to forum *****/
|
||||
For_GetParamsForums (&Forums);
|
||||
For_GetParsForums (&Forums);
|
||||
|
||||
/***** Get subject of thread to cut *****/
|
||||
For_DB_GetThrSubject (Forums.Thread.Current,Subject);
|
||||
|
@ -3115,7 +3115,7 @@ void For_PasteThread (void)
|
|||
For_ResetForums (&Forums);
|
||||
|
||||
/***** Get parameters related to forum *****/
|
||||
For_GetParamsForums (&Forums);
|
||||
For_GetParsForums (&Forums);
|
||||
|
||||
/***** Get subject of thread to paste *****/
|
||||
For_DB_GetThrSubject (Forums.Thread.Current,Subject);
|
||||
|
@ -3311,7 +3311,7 @@ static void For_ShowStatOfAForumType (For_ForumType_t ForumType,
|
|||
const char *Icon;
|
||||
const char **ForumName1;
|
||||
const char **ForumName2;
|
||||
} Params[For_NUM_TYPES_FORUM] =
|
||||
} Pars[For_NUM_TYPES_FORUM] =
|
||||
{
|
||||
[For_FORUM_COURSE_USRS] = {"chalkboard-teacher.svg",&Txt_Courses ,&EmptyName },
|
||||
[For_FORUM_COURSE_TCHS] = {"chalkboard-teacher.svg",&Txt_Courses ,&Txt_only_teachers},
|
||||
|
@ -3327,11 +3327,11 @@ static void For_ShowStatOfAForumType (For_ForumType_t ForumType,
|
|||
[For_FORUM__SWAD__TCHS] = {"swad64x64.png" ,&PlatformShortName,&Txt_only_teachers},
|
||||
};
|
||||
|
||||
if (Params[ForumType].Icon)
|
||||
if (Pars[ForumType].Icon)
|
||||
For_WriteForumTitleAndStats (ForumType,CtyCod,InsCod,CtrCod,DegCod,CrsCod,
|
||||
Params[ForumType].Icon,FiguresForum,
|
||||
*Params[ForumType].ForumName1,
|
||||
*Params[ForumType].ForumName2);
|
||||
Pars[ForumType].Icon,FiguresForum,
|
||||
*Pars[ForumType].ForumName1,
|
||||
*Pars[ForumType].ForumName2);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
18
swad_forum.h
18
swad_forum.h
|
@ -132,19 +132,19 @@ void For_GetForumTypeAndLocationOfAPost (long PstCod,struct For_Forum *Forum);
|
|||
void For_ShowPostsOfAThread (struct For_Forums *Forums,
|
||||
Ale_AlertType_t AlertType,const char *Message);
|
||||
|
||||
void For_PutAllHiddenParamsNewPost (void *Forums);
|
||||
void For_PutParsNewPost (void *Forums);
|
||||
|
||||
void For_GetSummaryAndContentForumPst (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
|
||||
char **ContentStr,
|
||||
long PstCod,bool GetContent);
|
||||
|
||||
void For_PutAllHiddenParamsForum (unsigned NumPageThreads,
|
||||
unsigned NumPagePosts,
|
||||
For_ForumSet_t ForumSet,
|
||||
Dat_StartEndTime_t Order,
|
||||
long Location,
|
||||
long ThrCod,
|
||||
long PstCod);
|
||||
void For_PutAllParsForum (unsigned NumPageThreads,
|
||||
unsigned NumPagePosts,
|
||||
For_ForumSet_t ForumSet,
|
||||
Dat_StartEndTime_t Order,
|
||||
long Location,
|
||||
long ThrCod,
|
||||
long PstCod);
|
||||
|
||||
void For_ShowForumList (struct For_Forums *Forums);
|
||||
|
||||
|
@ -158,7 +158,7 @@ void For_ShowForumThreadsHighlightingOneThread (struct For_Forums *Forums,
|
|||
|
||||
void For_ShowThreadPosts (void);
|
||||
|
||||
void For_GetParamsForums (struct For_Forums *Forums);
|
||||
void For_GetParsForums (struct For_Forums *Forums);
|
||||
|
||||
void For_ReceiveForumPost (void);
|
||||
void For_RemovePost (void);
|
||||
|
|
|
@ -53,7 +53,7 @@ void ForRsc_GetLinkToThread (void)
|
|||
For_ResetForums (&Forums);
|
||||
|
||||
/***** Get parameters related to forums *****/
|
||||
For_GetParamsForums (&Forums);
|
||||
For_GetParsForums (&Forums);
|
||||
|
||||
/***** Get thread subject *****/
|
||||
ForRsc_GetTitleFromThrCod (Forums.Thread.Current,Subject,sizeof (Subject) - 1);
|
||||
|
@ -105,7 +105,7 @@ void ForRsc_WriteThreadInCrsProgram (long ThrCod,bool PutFormToGo,
|
|||
ActSeeForCrsUsr; // All threads
|
||||
Frm_BeginFormAnchor (NextAction,ThrCod > 0 ? For_FORUM_POSTS_SECTION_ID :
|
||||
For_FORUM_THREADS_SECTION_ID);
|
||||
For_PutAllHiddenParamsNewPost (&Forums);
|
||||
For_PutParsNewPost (&Forums);
|
||||
HTM_BUTTON_Submit_Begin (Txt_Actions[NextAction],
|
||||
"class=\"LM BT_LINK PRG_LNK_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
|
157
swad_game.c
157
swad_game.c
|
@ -114,7 +114,7 @@ static bool Gam_CheckIfICanListGameQuestions (void);
|
|||
static void Gam_PutIconsListGames (void *Games);
|
||||
static void Gam_PutIconToCreateNewGame (struct Gam_Games *Games);
|
||||
static void Gam_PutButtonToCreateNewGame (struct Gam_Games *Games);
|
||||
static void Gam_PutParamsToCreateNewGame (void *Games);
|
||||
static void Gam_PutParsToCreateNewGame (void *Games);
|
||||
|
||||
static void Gam_ShowGameMainData (struct Gam_Games *Games,
|
||||
bool ShowOnlyThisGame);
|
||||
|
@ -122,14 +122,14 @@ static void Gam_ShowGameMainData (struct Gam_Games *Games,
|
|||
static void Gam_PutIconsOneGame (void *Games);
|
||||
static void Gam_WriteAuthor (struct Gam_Game *Game);
|
||||
|
||||
static void Gam_PutHiddenParamGameOrder (Gam_Order_t SelectedOrder);
|
||||
static void Gam_PutParGameOrder (Gam_Order_t SelectedOrder);
|
||||
|
||||
static void Gam_PutIconsToRemEditOneGame (struct Gam_Games *Games,
|
||||
const char *Anchor);
|
||||
|
||||
static void Gam_PutParamsOneQst (void *Games);
|
||||
static void Gam_PutHiddenParamOrder (Gam_Order_t SelectedOrder);
|
||||
static Gam_Order_t Gam_GetParamOrder (void);
|
||||
static void Gam_PutParsOneQst (void *Games);
|
||||
static void Gam_PutParOrder (Gam_Order_t SelectedOrder);
|
||||
static Gam_Order_t Gam_GetParOrder (void);
|
||||
|
||||
static void Gam_RemoveGameFromAllTables (long GamCod);
|
||||
|
||||
|
@ -213,7 +213,7 @@ void Gam_SeeAllGames (void)
|
|||
Gam_ResetGames (&Games);
|
||||
|
||||
/***** Get parameters *****/
|
||||
Gam_GetParams (&Games); // Return value ignored
|
||||
Gam_GetPars (&Games); // Return value ignored
|
||||
|
||||
/***** Show all games *****/
|
||||
Gam_ListAllGames (&Games);
|
||||
|
@ -278,7 +278,7 @@ void Gam_ListAllGames (struct Gam_Games *Games)
|
|||
|
||||
/* Form to change order */
|
||||
Frm_BeginForm (ActSeeAllGam);
|
||||
Pag_PutHiddenParamPagNum (Pag_GAMES,Games->CurrentPage);
|
||||
Pag_PutParPagNum (Pag_GAMES,Games->CurrentPage);
|
||||
Par_PutParUnsigned (NULL,"Order",(unsigned) Order);
|
||||
|
||||
HTM_BUTTON_Submit_Begin (Txt_GAMES_ORDER_HELP[Order],
|
||||
|
@ -393,7 +393,7 @@ static void Gam_PutIconsListGames (void *Games)
|
|||
/***** Link to get resource link *****/
|
||||
if (PrgRsc_CheckIfICanGetLink ())
|
||||
Ico_PutContextualIconToGetLink (ActReqLnkGam,NULL,
|
||||
Gam_PutParams,Games);
|
||||
Gam_PutPars,Games);
|
||||
|
||||
/***** Put icon to show a figure *****/
|
||||
Fig_PutIconToShowFigure (Fig_GAMES);
|
||||
|
@ -407,7 +407,7 @@ static void Gam_PutIconsListGames (void *Games)
|
|||
static void Gam_PutIconToCreateNewGame (struct Gam_Games *Games)
|
||||
{
|
||||
Ico_PutContextualIconToAdd (ActFrmNewGam,NULL,
|
||||
Gam_PutParamsToCreateNewGame,Games);
|
||||
Gam_PutParsToCreateNewGame,Games);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -419,7 +419,7 @@ static void Gam_PutButtonToCreateNewGame (struct Gam_Games *Games)
|
|||
extern const char *Txt_New_game;
|
||||
|
||||
Frm_BeginForm (ActFrmNewGam);
|
||||
Gam_PutParamsToCreateNewGame (Games);
|
||||
Gam_PutParsToCreateNewGame (Games);
|
||||
|
||||
Btn_PutConfirmButton (Txt_New_game);
|
||||
|
||||
|
@ -430,12 +430,12 @@ static void Gam_PutButtonToCreateNewGame (struct Gam_Games *Games)
|
|||
/******************** Put parameters to create a new game ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Gam_PutParamsToCreateNewGame (void *Games)
|
||||
static void Gam_PutParsToCreateNewGame (void *Games)
|
||||
{
|
||||
if (Games)
|
||||
{
|
||||
Gam_PutHiddenParamGameOrder (((struct Gam_Games *) Games)->SelectedOrder);
|
||||
Pag_PutHiddenParamPagNum (Pag_GAMES,((struct Gam_Games *) Games)->CurrentPage);
|
||||
Gam_PutParGameOrder (((struct Gam_Games *) Games)->SelectedOrder);
|
||||
Pag_PutParPagNum (Pag_GAMES,((struct Gam_Games *) Games)->CurrentPage);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -454,7 +454,7 @@ void Gam_SeeOneGame (void)
|
|||
Gam_ResetGame (&Games.Game);
|
||||
|
||||
/***** Get parameters *****/
|
||||
if ((Games.Game.GamCod = Gam_GetParams (&Games)) <= 0)
|
||||
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
|
||||
Err_WrongGameExit ();
|
||||
Gam_GetDataOfGameByCod (&Games.Game);
|
||||
|
||||
|
@ -579,7 +579,7 @@ static void Gam_ShowGameMainData (struct Gam_Games *Games,
|
|||
/* Game title */
|
||||
HTM_ARTICLE_Begin (Anchor);
|
||||
Frm_BeginForm (ActSeeGam);
|
||||
Gam_PutParams (Games);
|
||||
Gam_PutPars (Games);
|
||||
HTM_BUTTON_Submit_Begin (Txt_View_game,"class=\"LT BT_LINK %s_%s\"",
|
||||
Games->Game.Hidden ? "ASG_TITLE_LIGHT":
|
||||
"ASG_TITLE",
|
||||
|
@ -611,7 +611,7 @@ static void Gam_ShowGameMainData (struct Gam_Games *Games,
|
|||
HTM_TD_Begin ("class=\"RT %s\"",The_GetColorRows ());
|
||||
|
||||
Frm_BeginForm (ActSeeGam);
|
||||
Gam_PutParams (Games);
|
||||
Gam_PutPars (Games);
|
||||
HTM_BUTTON_Submit_Begin (Txt_Matches,"class=\"LT BT_LINK %s_%s\"",
|
||||
Games->Game.Hidden ? "ASG_TITLE_LIGHT":
|
||||
"ASG_TITLE",
|
||||
|
@ -704,7 +704,7 @@ static void Gam_WriteAuthor (struct Gam_Game *Game)
|
|||
/****** Put a hidden parameter with the type of order in list of games *******/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Gam_PutHiddenParamGameOrder (Gam_Order_t SelectedOrder)
|
||||
static void Gam_PutParGameOrder (Gam_Order_t SelectedOrder)
|
||||
{
|
||||
Par_PutParUnsigned (NULL,"Order",(unsigned) SelectedOrder);
|
||||
}
|
||||
|
@ -733,32 +733,32 @@ static void Gam_PutIconsToRemEditOneGame (struct Gam_Games *Games,
|
|||
{
|
||||
/***** Icon to remove game *****/
|
||||
Ico_PutContextualIconToRemove (ActReqRemGam,NULL,
|
||||
Gam_PutParams,Games);
|
||||
Gam_PutPars,Games);
|
||||
|
||||
/***** Icon to unhide/hide game *****/
|
||||
Ico_PutContextualIconToHideUnhide (ActionHideUnhide,Anchor,
|
||||
Gam_PutParams,Games,
|
||||
Gam_PutPars,Games,
|
||||
Games->Game.Hidden);
|
||||
|
||||
/***** Icon to edit game *****/
|
||||
Ico_PutContextualIconToEdit (ActEdiOneGam,NULL,
|
||||
Gam_PutParams,Games);
|
||||
Gam_PutPars,Games);
|
||||
}
|
||||
|
||||
if (Gam_CheckIfICanListGameQuestions ())
|
||||
/***** Icon to view game listing its questions *****/
|
||||
Ico_PutContextualIconToView (ActLstOneGam,NULL,
|
||||
Gam_PutParams,Games);
|
||||
Gam_PutPars,Games);
|
||||
|
||||
/***** Put icon to view matches results *****/
|
||||
if (ActionShowResults[Gbl.Usrs.Me.Role.Logged])
|
||||
Ico_PutContextualIconToShowResults (ActionShowResults[Gbl.Usrs.Me.Role.Logged],MchRes_RESULTS_BOX_ID,
|
||||
Gam_PutParams,Games);
|
||||
Gam_PutPars,Games);
|
||||
|
||||
/***** Link to get resource link *****/
|
||||
if (PrgRsc_CheckIfICanGetLink ())
|
||||
Ico_PutContextualIconToGetLink (ActReqLnkGam,NULL,
|
||||
Gam_PutParams,Games);
|
||||
Gam_PutPars,Games);
|
||||
|
||||
}
|
||||
|
||||
|
@ -766,12 +766,12 @@ static void Gam_PutIconsToRemEditOneGame (struct Gam_Games *Games,
|
|||
/**************** Put parameter to move/remove one question ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Gam_PutParamsOneQst (void *Games)
|
||||
static void Gam_PutParsOneQst (void *Games)
|
||||
{
|
||||
if (Games)
|
||||
{
|
||||
Gam_PutParams (Games);
|
||||
Gam_PutParamQstInd (((struct Gam_Games *) Games)->QstInd);
|
||||
Gam_PutPars (Games);
|
||||
Gam_PutParQstInd (((struct Gam_Games *) Games)->QstInd);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -779,42 +779,29 @@ static void Gam_PutParamsOneQst (void *Games)
|
|||
/*********************** Params used to edit a game **************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Gam_PutParams (void *Games)
|
||||
void Gam_PutPars (void *Games)
|
||||
{
|
||||
Grp_WhichGroups_t WhichGroups;
|
||||
|
||||
if (Games)
|
||||
{
|
||||
if (((struct Gam_Games *) Games)->Game.GamCod > 0)
|
||||
Gam_PutParamGamCod (((struct Gam_Games *) Games)->Game.GamCod);
|
||||
Gam_PutHiddenParamOrder (((struct Gam_Games *) Games)->SelectedOrder);
|
||||
WhichGroups = Grp_GetParamWhichGroups ();
|
||||
Grp_PutParamWhichGroups (&WhichGroups);
|
||||
Pag_PutHiddenParamPagNum (Pag_GAMES,((struct Gam_Games *) Games)->CurrentPage);
|
||||
Par_PutParCode (Par_GamCod,((struct Gam_Games *) Games)->Game.GamCod);
|
||||
Gam_PutParOrder (((struct Gam_Games *) Games)->SelectedOrder);
|
||||
WhichGroups = Grp_GetParWhichGroups ();
|
||||
Grp_PutParWhichGroups (&WhichGroups);
|
||||
Pag_PutParPagNum (Pag_GAMES,((struct Gam_Games *) Games)->CurrentPage);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************** Write parameter with code of game **********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Gam_PutParamGamCod (long GamCod)
|
||||
{
|
||||
extern const char *Par_CodeStr[];
|
||||
|
||||
if (GamCod > 0)
|
||||
Par_PutParLong (NULL,Par_CodeStr[Par_GamCod],GamCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************* Get parameters used to edit a game **********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
long Gam_GetParams (struct Gam_Games *Games)
|
||||
long Gam_GetPars (struct Gam_Games *Games)
|
||||
{
|
||||
/***** Get other parameters *****/
|
||||
Games->SelectedOrder = Gam_GetParamOrder ();
|
||||
Games->CurrentPage = Pag_GetParamPagNum (Pag_GAMES);
|
||||
Games->SelectedOrder = Gam_GetParOrder ();
|
||||
Games->CurrentPage = Pag_GetParPagNum (Pag_GAMES);
|
||||
|
||||
/***** Get game code *****/
|
||||
return Par_GetParCode (Par_GamCod);
|
||||
|
@ -824,7 +811,7 @@ long Gam_GetParams (struct Gam_Games *Games)
|
|||
/****** Put a hidden parameter with the type of order in list of games *******/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Gam_PutHiddenParamOrder (Gam_Order_t SelectedOrder)
|
||||
static void Gam_PutParOrder (Gam_Order_t SelectedOrder)
|
||||
{
|
||||
if (SelectedOrder != Gam_ORDER_DEFAULT)
|
||||
Par_PutParUnsigned (NULL,"Order",(unsigned) SelectedOrder);
|
||||
|
@ -834,12 +821,12 @@ static void Gam_PutHiddenParamOrder (Gam_Order_t SelectedOrder)
|
|||
/********** Get parameter with the type or order in list of games ************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static Gam_Order_t Gam_GetParamOrder (void)
|
||||
static Gam_Order_t Gam_GetParOrder (void)
|
||||
{
|
||||
return (Gam_Order_t) Par_GetParUnsignedLong ("Order",
|
||||
0,
|
||||
Gam_NUM_ORDERS - 1,
|
||||
(unsigned long) Gam_ORDER_DEFAULT);
|
||||
0,
|
||||
Gam_NUM_ORDERS - 1,
|
||||
(unsigned long) Gam_ORDER_DEFAULT);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -926,7 +913,7 @@ void Gam_GetListSelectedGamCods (struct Gam_Games *Games)
|
|||
)
|
||||
{
|
||||
/* Get next game selected */
|
||||
Par_GetNextStrUntilSeparParamMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
Par_GetNextStrUntilSeparParMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
GamCod = Str_ConvertStrCodToLongCod (LongStr);
|
||||
|
||||
/* Set each game in *StrGamCodsSelected as selected */
|
||||
|
@ -1063,7 +1050,7 @@ void Gam_AskRemGame (void)
|
|||
Gam_ResetGame (&Games.Game);
|
||||
|
||||
/***** Get parameters *****/
|
||||
if ((Games.Game.GamCod = Gam_GetParams (&Games)) <= 0)
|
||||
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
|
||||
Err_WrongGameExit ();
|
||||
|
||||
/***** Get data of the game from database *****/
|
||||
|
@ -1073,7 +1060,7 @@ void Gam_AskRemGame (void)
|
|||
|
||||
/***** Show question and button to remove game *****/
|
||||
Ale_ShowAlertAndButton (ActRemGam,NULL,NULL,
|
||||
Gam_PutParams,&Games,
|
||||
Gam_PutPars,&Games,
|
||||
Btn_REMOVE_BUTTON,Txt_Remove_game,
|
||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_game_X,
|
||||
Games.Game.Title);
|
||||
|
@ -1163,7 +1150,7 @@ void Gam_HideGame (void)
|
|||
Gam_ResetGame (&Games.Game);
|
||||
|
||||
/***** Get parameters *****/
|
||||
if ((Games.Game.GamCod = Gam_GetParams (&Games)) <= 0)
|
||||
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
|
||||
Err_WrongGameExit ();
|
||||
|
||||
/***** Get data of the game from database *****/
|
||||
|
@ -1193,7 +1180,7 @@ void Gam_UnhideGame (void)
|
|||
Gam_ResetGame (&Games.Game);
|
||||
|
||||
/***** Get parameters *****/
|
||||
if ((Games.Game.GamCod = Gam_GetParams (&Games)) <= 0)
|
||||
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
|
||||
Err_WrongGameExit ();
|
||||
|
||||
/***** Get data of the game from database *****/
|
||||
|
@ -1228,7 +1215,7 @@ void Gam_ListGame (void)
|
|||
Err_NoPermissionExit ();
|
||||
|
||||
/***** Get parameters *****/
|
||||
if ((Games.Game.GamCod = Gam_GetParams (&Games)) <= 0)
|
||||
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
|
||||
Err_WrongGameExit ();
|
||||
|
||||
/***** Get game data *****/
|
||||
|
@ -1262,7 +1249,7 @@ void Gam_RequestCreatOrEditGame (void)
|
|||
Err_NoPermissionExit ();
|
||||
|
||||
/***** Get parameters *****/
|
||||
ItsANewGame = ((Games.Game.GamCod = Gam_GetParams (&Games)) <= 0);
|
||||
ItsANewGame = ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0);
|
||||
|
||||
/***** Get game data *****/
|
||||
if (ItsANewGame)
|
||||
|
@ -1312,7 +1299,7 @@ static void Gam_PutFormsEditionGame (struct Gam_Games *Games,
|
|||
/***** Begin form *****/
|
||||
Frm_BeginForm (ItsANewGame ? ActNewGam :
|
||||
ActChgGam);
|
||||
Gam_PutParams (Games);
|
||||
Gam_PutPars (Games);
|
||||
|
||||
/***** Begin box and table *****/
|
||||
if (ItsANewGame)
|
||||
|
@ -1420,7 +1407,7 @@ void Gam_ReceiveFormGame (void)
|
|||
Err_NoPermissionExit ();
|
||||
|
||||
/***** Get parameters *****/
|
||||
ItsANewGame = ((Games.Game.GamCod = Gam_GetParams (&Games)) <= 0);
|
||||
ItsANewGame = ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0);
|
||||
|
||||
/***** If I can edit games ==> receive game from form *****/
|
||||
if (Gam_CheckIfICanEditGames ())
|
||||
|
@ -1552,7 +1539,7 @@ void Gam_ReqSelectQstsToAddToGame (void)
|
|||
Gam_ResetGame (&Games.Game);
|
||||
|
||||
/***** Get parameters *****/
|
||||
if ((Games.Game.GamCod = Gam_GetParams (&Games)) <= 0)
|
||||
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
|
||||
Err_WrongGameExit ();
|
||||
Gam_GetDataOfGameByCod (&Games.Game);
|
||||
|
||||
|
@ -1584,7 +1571,7 @@ void Gam_ListQstsToAddToGame (void)
|
|||
Gam_ResetGame (&Games.Game);
|
||||
|
||||
/***** Get parameters *****/
|
||||
if ((Games.Game.GamCod = Gam_GetParams (&Games)) <= 0)
|
||||
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
|
||||
Err_WrongGameExit ();
|
||||
Gam_GetDataOfGameByCod (&Games.Game);
|
||||
|
||||
|
@ -1600,7 +1587,7 @@ void Gam_ListQstsToAddToGame (void)
|
|||
/****************** Write parameter with index of question *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Gam_PutParamQstInd (unsigned QstInd)
|
||||
void Gam_PutParQstInd (unsigned QstInd)
|
||||
{
|
||||
Par_PutParUnsigned (NULL,"QstInd",QstInd);
|
||||
}
|
||||
|
@ -1609,7 +1596,7 @@ void Gam_PutParamQstInd (unsigned QstInd)
|
|||
/******************* Get parameter with index of question ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
unsigned Gam_GetParamQstInd (void)
|
||||
unsigned Gam_GetParQstInd (void)
|
||||
{
|
||||
long QstInd;
|
||||
|
||||
|
@ -1738,14 +1725,14 @@ static void Gam_ListOneOrMoreQuestionsForEdition (struct Gam_Games *Games,
|
|||
/* Put icon to remove the question */
|
||||
if (ICanEditQuestions)
|
||||
Ico_PutContextualIconToRemove (ActReqRemGamQst,NULL,
|
||||
Gam_PutParamsOneQst,Games);
|
||||
Gam_PutParsOneQst,Games);
|
||||
else
|
||||
Ico_PutIconRemovalNotAllowed ();
|
||||
|
||||
/* Put icon to move up the question */
|
||||
if (ICanEditQuestions && QstInd > 1)
|
||||
Lay_PutContextualLinkOnlyIcon (ActUp_GamQst,Anchor,
|
||||
Gam_PutParamsOneQst,Games,
|
||||
Gam_PutParsOneQst,Games,
|
||||
"arrow-up.svg",Ico_BLACK);
|
||||
else
|
||||
Ico_PutIconOff ("arrow-up.svg",Ico_BLACK,
|
||||
|
@ -1754,7 +1741,7 @@ static void Gam_ListOneOrMoreQuestionsForEdition (struct Gam_Games *Games,
|
|||
/* Put icon to move down the question */
|
||||
if (ICanEditQuestions && QstInd < MaxQstInd)
|
||||
Lay_PutContextualLinkOnlyIcon (ActDwnGamQst,Anchor,
|
||||
Gam_PutParamsOneQst,Games,
|
||||
Gam_PutParsOneQst,Games,
|
||||
"arrow-down.svg",Ico_BLACK);
|
||||
else
|
||||
Ico_PutIconOff ("arrow-down.svg",Ico_BLACK,
|
||||
|
@ -1763,7 +1750,7 @@ static void Gam_ListOneOrMoreQuestionsForEdition (struct Gam_Games *Games,
|
|||
/* Put icon to edit the question */
|
||||
if (ICanEditQuestions)
|
||||
Ico_PutContextualIconToEdit (ActEdiOneTstQst,NULL,
|
||||
Qst_PutParamQstCod,&Question.QstCod);
|
||||
Qst_PutParQstCod,&Question.QstCod);
|
||||
|
||||
HTM_TD_End ();
|
||||
|
||||
|
@ -1791,7 +1778,7 @@ static void Gam_ListOneOrMoreQuestionsForEdition (struct Gam_Games *Games,
|
|||
|
||||
static void Gam_PutIconToAddNewQuestions (void *Games)
|
||||
{
|
||||
Ico_PutContextualIconToAdd (ActAddOneGamQst,NULL,Gam_PutParams,Games);
|
||||
Ico_PutContextualIconToAdd (ActAddOneGamQst,NULL,Gam_PutPars,Games);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1803,7 +1790,7 @@ static void Gam_PutButtonToAddNewQuestions (struct Gam_Games *Games)
|
|||
extern const char *Txt_Add_questions;
|
||||
|
||||
Frm_BeginForm (ActAddOneGamQst);
|
||||
Gam_PutParams (Games);
|
||||
Gam_PutPars (Games);
|
||||
|
||||
Btn_PutConfirmButton (Txt_Add_questions);
|
||||
|
||||
|
@ -1833,7 +1820,7 @@ void Gam_AddQstsToGame (void)
|
|||
Gam_ResetGame (&Games.Game);
|
||||
|
||||
/***** Get parameters *****/
|
||||
if ((Games.Game.GamCod = Gam_GetParams (&Games)) <= 0)
|
||||
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
|
||||
Err_WrongGameExit ();
|
||||
Gam_GetDataOfGameByCod (&Games.Game);
|
||||
|
||||
|
@ -1858,7 +1845,7 @@ void Gam_AddQstsToGame (void)
|
|||
while (*Ptr)
|
||||
{
|
||||
/* Get next code */
|
||||
Par_GetNextStrUntilSeparParamMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
Par_GetNextStrUntilSeparParMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
if (sscanf (LongStr,"%ld",&QstCod) != 1)
|
||||
Err_WrongQuestionExit ();
|
||||
|
||||
|
@ -1938,7 +1925,7 @@ void Gam_RequestRemoveQstFromGame (void)
|
|||
Gam_ResetGame (&Games.Game);
|
||||
|
||||
/***** Get parameters *****/
|
||||
if ((Games.Game.GamCod = Gam_GetParams (&Games)) <= 0)
|
||||
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
|
||||
Err_WrongGameExit ();
|
||||
Gam_GetDataOfGameByCod (&Games.Game);
|
||||
|
||||
|
@ -1947,12 +1934,12 @@ void Gam_RequestRemoveQstFromGame (void)
|
|||
Err_NoPermissionExit ();
|
||||
|
||||
/***** Get question index *****/
|
||||
QstInd = Gam_GetParamQstInd ();
|
||||
QstInd = Gam_GetParQstInd ();
|
||||
|
||||
/***** Show question and button to remove question *****/
|
||||
Games.QstInd = QstInd;
|
||||
Ale_ShowAlertAndButton (ActRemGamQst,NULL,NULL,
|
||||
Gam_PutParamsOneQst,&Games,
|
||||
Gam_PutParsOneQst,&Games,
|
||||
Btn_REMOVE_BUTTON,Txt_Remove_question,
|
||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_question_X,
|
||||
QstInd);
|
||||
|
@ -1980,7 +1967,7 @@ void Gam_RemoveQstFromGame (void)
|
|||
Gam_ResetGame (&Games.Game);
|
||||
|
||||
/***** Get parameters *****/
|
||||
if ((Games.Game.GamCod = Gam_GetParams (&Games)) <= 0)
|
||||
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
|
||||
Err_WrongGameExit ();
|
||||
Gam_GetDataOfGameByCod (&Games.Game);
|
||||
|
||||
|
@ -1989,7 +1976,7 @@ void Gam_RemoveQstFromGame (void)
|
|||
Err_NoPermissionExit ();
|
||||
|
||||
/***** Get question index *****/
|
||||
QstInd = Gam_GetParamQstInd ();
|
||||
QstInd = Gam_GetParQstInd ();
|
||||
|
||||
/***** Remove the question from all tables *****/
|
||||
/* Remove answers from this test question */
|
||||
|
@ -2029,7 +2016,7 @@ void Gam_MoveUpQst (void)
|
|||
Gam_ResetGame (&Games.Game);
|
||||
|
||||
/***** Get parameters *****/
|
||||
if ((Games.Game.GamCod = Gam_GetParams (&Games)) <= 0)
|
||||
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
|
||||
Err_WrongGameExit ();
|
||||
Gam_GetDataOfGameByCod (&Games.Game);
|
||||
|
||||
|
@ -2038,7 +2025,7 @@ void Gam_MoveUpQst (void)
|
|||
Err_NoPermissionExit ();
|
||||
|
||||
/***** Get question index *****/
|
||||
QstIndBottom = Gam_GetParamQstInd ();
|
||||
QstIndBottom = Gam_GetParQstInd ();
|
||||
|
||||
/***** Move up question *****/
|
||||
if (QstIndBottom > 1) // 2, 3, 4...
|
||||
|
@ -2079,7 +2066,7 @@ void Gam_MoveDownQst (void)
|
|||
Gam_ResetGame (&Games.Game);
|
||||
|
||||
/***** Get parameters *****/
|
||||
if ((Games.Game.GamCod = Gam_GetParams (&Games)) <= 0)
|
||||
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
|
||||
Err_WrongGameExit ();
|
||||
Gam_GetDataOfGameByCod (&Games.Game);
|
||||
|
||||
|
@ -2088,7 +2075,7 @@ void Gam_MoveDownQst (void)
|
|||
Err_NoPermissionExit ();
|
||||
|
||||
/***** Get question index *****/
|
||||
QstIndTop = Gam_GetParamQstInd ();
|
||||
QstIndTop = Gam_GetParQstInd ();
|
||||
|
||||
/***** Get maximum question index *****/
|
||||
MaxQstInd = Gam_DB_GetMaxQuestionIndexInGame (Games.Game.GamCod); // 0 is no questions in game
|
||||
|
@ -2181,7 +2168,7 @@ void Gam_PutButtonNewMatch (struct Gam_Games *Games)
|
|||
extern const char *Txt_New_match;
|
||||
|
||||
Frm_BeginFormAnchor (ActReqNewMch,Mch_NEW_MATCH_SECTION_ID);
|
||||
Gam_PutParams (Games);
|
||||
Gam_PutPars (Games);
|
||||
|
||||
Btn_PutConfirmButton (Txt_New_match);
|
||||
|
||||
|
@ -2203,7 +2190,7 @@ void Gam_RequestNewMatch (void)
|
|||
Gam_ResetGame (&Games.Game);
|
||||
|
||||
/***** Get parameters *****/
|
||||
if ((Games.Game.GamCod = Gam_GetParams (&Games)) <= 0)
|
||||
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
|
||||
Err_WrongGameExit ();
|
||||
Gam_GetDataOfGameByCod (&Games.Game);
|
||||
|
||||
|
|
|
@ -118,9 +118,8 @@ void Gam_ShowOnlyOneGameBegin (struct Gam_Games *Games,
|
|||
void Gam_ShowOnlyOneGameEnd (void);
|
||||
|
||||
void Gam_SetCurrentGamCod (long GamCod);
|
||||
void Gam_PutParams (void *Games);
|
||||
void Gam_PutParamGamCod (long GamCod);
|
||||
long Gam_GetParams (struct Gam_Games *Games);
|
||||
void Gam_PutPars (void *Games);
|
||||
long Gam_GetPars (struct Gam_Games *Games);
|
||||
|
||||
void Gam_GetListGames (struct Gam_Games *Games,Gam_Order_t SelectedOrder);
|
||||
void Gam_GetListSelectedGamCods (struct Gam_Games *Games);
|
||||
|
@ -144,8 +143,8 @@ void Gam_ReceiveFormGame (void);
|
|||
void Gam_ReqSelectQstsToAddToGame (void);
|
||||
void Gam_ListQstsToAddToGame (void);
|
||||
|
||||
void Gam_PutParamQstInd (unsigned QstInd);
|
||||
unsigned Gam_GetParamQstInd (void);
|
||||
void Gam_PutParQstInd (unsigned QstInd);
|
||||
unsigned Gam_GetParQstInd (void);
|
||||
|
||||
void Gam_AddQstsToGame (void);
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "swad_game.h"
|
||||
#include "swad_game_database.h"
|
||||
#include "swad_game_resource.h"
|
||||
#include "swad_parameter.h"
|
||||
#include "swad_program_database.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -49,7 +50,7 @@ void GamRsc_GetLinkToGame (void)
|
|||
Gam_ResetGames (&Games);
|
||||
|
||||
/***** Get parameters *****/
|
||||
GamCod = Gam_GetParams (&Games);
|
||||
GamCod = Gam_GetPars (&Games);
|
||||
|
||||
/***** Get game title *****/
|
||||
GamRsc_GetTitleFromGamCod (GamCod,Title,sizeof (Title) - 1);
|
||||
|
@ -85,7 +86,7 @@ void GamRsc_WriteGameInCrsProgram (long GamCod,bool PutFormToGo,
|
|||
NextAction = (GamCod > 0) ? ActSeeGam : // Game specified
|
||||
ActSeeAllGam; // All games
|
||||
Frm_BeginForm (NextAction);
|
||||
Gam_PutParamGamCod (GamCod);
|
||||
Par_PutParCode (Par_GamCod,GamCod);
|
||||
HTM_BUTTON_Submit_Begin (Txt_Actions[NextAction],
|
||||
"class=\"LM BT_LINK PRG_LNK_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
|
|
@ -109,7 +109,7 @@ void Gbl_InitializeGlobals (void)
|
|||
Gbl.Session.IsOpen = false;
|
||||
Gbl.Session.HasBeenDisconnected = false;
|
||||
Gbl.Session.Id[0] = '\0';
|
||||
Gbl.Session.ParamsInsertedIntoDB = false;
|
||||
Gbl.Session.ParsInsertedIntoDB = false;
|
||||
|
||||
Gbl.Usrs.Me.UsrIdLogin[0] = '\0';
|
||||
Gbl.Usrs.Me.LoginPlainPassword[0] = '\0';
|
||||
|
@ -149,7 +149,7 @@ void Gbl_InitializeGlobals (void)
|
|||
Gbl.Action.Tab = TabUnk;
|
||||
|
||||
Gbl.Usrs.Selected.Filled = false; // Lists of encrypted codes of users selected from form are not filled
|
||||
Gbl.Usrs.Selected.ParamSuffix = NULL;// Don't add suffix to param names
|
||||
Gbl.Usrs.Selected.ParSuffix = NULL; // Don't add suffix to param names
|
||||
Gbl.Usrs.Selected.Option = Usr_OPTION_UNKNOWN;
|
||||
for (Role = (Rol_Role_t) 0;
|
||||
Role <= (Rol_Role_t) (Rol_NUM_ROLES - 1);
|
||||
|
@ -295,7 +295,7 @@ void Gbl_Cleanup (void)
|
|||
if (!Gbl.Action.UsesAJAX &&
|
||||
!Gbl.WebService.IsWebService &&
|
||||
Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB)
|
||||
Ses_DB_RemoveParam ();
|
||||
Ses_DB_RemovePar ();
|
||||
Enr_FreeMyCourses ();
|
||||
Deg_FreeMyDegrees ();
|
||||
Ctr_FreeMyCenters ();
|
||||
|
@ -320,6 +320,6 @@ void Gbl_Cleanup (void)
|
|||
Usr_FreeListOtherRecipients ();
|
||||
Usr_FreeListsSelectedEncryptedUsrsCods (&Gbl.Usrs.Selected);
|
||||
Syl_FreeListItemsSyllabus ();
|
||||
Par_FreeParams ();
|
||||
Par_FreePars ();
|
||||
Ale_ResetAllAlerts ();
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ struct Globals
|
|||
bool HasBeenDisconnected;
|
||||
char Id[Cns_BYTES_SESSION_ID + 1];
|
||||
long UsrCod;
|
||||
bool ParamsInsertedIntoDB; // If parameters are inserted in the database in this session
|
||||
bool ParsInsertedIntoDB; // If parameters are inserted in the database in this session
|
||||
} Session;
|
||||
struct
|
||||
{
|
||||
|
|
111
swad_group.c
111
swad_group.c
|
@ -143,7 +143,8 @@ static void Grp_RemoveGroupTypeCompletely (void);
|
|||
static void Grp_RemoveGroupCompletely (void);
|
||||
|
||||
static void Grp_WriteMaxStds (char Str[Cns_MAX_DECIMAL_DIGITS_UINT + 1],unsigned MaxStudents);
|
||||
static void Grp_PutParamGrpTypCod (void *GrpTypCod);
|
||||
static void Grp_PutParGrpTypCod (void *GrpTypCod);
|
||||
static void Grp_PutParGrpCod (void *GrpCod);
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************* Write the names of the selected groups ******************/
|
||||
|
@ -348,7 +349,7 @@ static void Grp_PutIconToCreateNewGroup (void)
|
|||
/*************** Show form to select one or several groups *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Grp_ShowFormToSelectSeveralGroups (void (*FuncParams) (void *Args),void *Args,
|
||||
void Grp_ShowFormToSelectSeveralGroups (void (*FuncPars) (void *Args),void *Args,
|
||||
Grp_WhichGroups_t GroupsSelectableByStdsOrNETs)
|
||||
{
|
||||
extern const char *Hlp_USERS_Groups;
|
||||
|
@ -378,9 +379,9 @@ void Grp_ShowFormToSelectSeveralGroups (void (*FuncParams) (void *Args),void *Ar
|
|||
depending on the groups selected *****/
|
||||
Frm_BeginFormAnchor (Gbl.Action.Act, // Repeat current action
|
||||
Usr_USER_LIST_SECTION_ID);
|
||||
Set_PutParamsPrefsAboutUsrList ();
|
||||
if (FuncParams)
|
||||
FuncParams (Args);
|
||||
Set_PutParsPrefsAboutUsrList ();
|
||||
if (FuncPars)
|
||||
FuncPars (Args);
|
||||
|
||||
/***** Select all groups *****/
|
||||
Grp_PutCheckboxAllGrps (GroupsSelectableByStdsOrNETs);
|
||||
|
@ -463,7 +464,7 @@ static void Grp_PutCheckboxAllGrps (Grp_WhichGroups_t GroupsSelectableByStdsOrNE
|
|||
/************ Put parameters with the groups of students selected ************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Grp_PutParamsCodGrps (void)
|
||||
void Grp_PutParsCodGrps (void)
|
||||
{
|
||||
extern const char *Par_SEPARATOR_PARAM_MULTIPLE;
|
||||
unsigned NumGrpSel;
|
||||
|
@ -558,7 +559,7 @@ void Grp_GetParCodsSeveralGrpsToShowUsrs (void)
|
|||
|
||||
void Grp_GetParCodsSeveralGrps (void)
|
||||
{
|
||||
char *ParamLstCodGrps;
|
||||
char *ParLstCodGrps;
|
||||
const char *Ptr;
|
||||
char LongStr[Cns_MAX_DECIMAL_DIGITS_LONG + 1];
|
||||
unsigned NumGrp;
|
||||
|
@ -570,19 +571,19 @@ void Grp_GetParCodsSeveralGrps (void)
|
|||
if (Gbl.Crs.Grps.NumGrps) // If course has groups
|
||||
{
|
||||
/***** Allocate memory for the list of group codes selected *****/
|
||||
if ((ParamLstCodGrps = malloc (MaxSizeLstGrpCods + 1)) == NULL)
|
||||
if ((ParLstCodGrps = malloc (MaxSizeLstGrpCods + 1)) == NULL)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
|
||||
/***** Get parameter with list of groups to list *****/
|
||||
Par_GetParMultiToText ("GrpCods",ParamLstCodGrps,MaxSizeLstGrpCods);
|
||||
Par_GetParMultiToText ("GrpCods",ParLstCodGrps,MaxSizeLstGrpCods);
|
||||
|
||||
if (ParamLstCodGrps[0])
|
||||
if (ParLstCodGrps[0])
|
||||
{
|
||||
/***** Count number of groups selected from LstCodGrps *****/
|
||||
for (Ptr = ParamLstCodGrps, NumGrp = 0;
|
||||
for (Ptr = ParLstCodGrps, NumGrp = 0;
|
||||
*Ptr;
|
||||
NumGrp++)
|
||||
Par_GetNextStrUntilSeparParamMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
Par_GetNextStrUntilSeparParMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
Gbl.Crs.Grps.LstGrpsSel.NumGrps = NumGrp;
|
||||
|
||||
if (Gbl.Crs.Grps.LstGrpsSel.NumGrps) // If I have selected groups...
|
||||
|
@ -591,18 +592,18 @@ void Grp_GetParCodsSeveralGrps (void)
|
|||
if ((Gbl.Crs.Grps.LstGrpsSel.GrpCods = calloc (Gbl.Crs.Grps.LstGrpsSel.NumGrps,
|
||||
sizeof (*Gbl.Crs.Grps.LstGrpsSel.GrpCods))) == NULL)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
for (Ptr = ParamLstCodGrps, NumGrp = 0;
|
||||
for (Ptr = ParLstCodGrps, NumGrp = 0;
|
||||
*Ptr;
|
||||
NumGrp++)
|
||||
{
|
||||
Par_GetNextStrUntilSeparParamMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
Par_GetNextStrUntilSeparParMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
Gbl.Crs.Grps.LstGrpsSel.GrpCods[NumGrp] = Str_ConvertStrCodToLongCod (LongStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***** Free memory used for the list of groups to show *****/
|
||||
free (ParamLstCodGrps);
|
||||
free (ParLstCodGrps);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1247,13 +1248,13 @@ static void Grp_ListGroupTypesForEdition (void)
|
|||
/* Put icon to remove group type */
|
||||
HTM_TD_Begin ("class=\"BM\"");
|
||||
Ico_PutContextualIconToRemove (ActReqRemGrpTyp,Grp_GROUP_TYPES_SECTION_ID,
|
||||
Grp_PutParamGrpTypCod,&Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod);
|
||||
Grp_PutParGrpTypCod,&Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod);
|
||||
HTM_TD_End ();
|
||||
|
||||
/* Name of group type */
|
||||
HTM_TD_Begin ("class=\"LM\"");
|
||||
Frm_BeginFormAnchor (ActRenGrpTyp,Grp_GROUP_TYPES_SECTION_ID);
|
||||
Grp_PutParamGrpTypCod (&Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod);
|
||||
Par_PutParCode (Par_GrpTypCod,Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod);
|
||||
HTM_INPUT_TEXT ("GrpTypName",Grp_MAX_CHARS_GROUP_TYPE_NAME,
|
||||
Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypName,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
|
@ -1265,7 +1266,7 @@ static void Grp_ListGroupTypesForEdition (void)
|
|||
/* Is it mandatory to register in any group? */
|
||||
HTM_TD_Begin ("class=\"CM\"");
|
||||
Frm_BeginFormAnchor (ActChgMdtGrpTyp,Grp_GROUP_TYPES_SECTION_ID);
|
||||
Grp_PutParamGrpTypCod (&Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod);
|
||||
Par_PutParCode (Par_GrpTypCod,Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod);
|
||||
HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,
|
||||
"name=\"MandatoryEnrolment\""
|
||||
" class=\"INPUT_%s\" style=\"width:150px;\"",
|
||||
|
@ -1283,7 +1284,7 @@ static void Grp_ListGroupTypesForEdition (void)
|
|||
/* Is it possible to register in multiple groups? */
|
||||
HTM_TD_Begin ("class=\"CM\"");
|
||||
Frm_BeginFormAnchor (ActChgMulGrpTyp,Grp_GROUP_TYPES_SECTION_ID);
|
||||
Grp_PutParamGrpTypCod (&Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod);
|
||||
Par_PutParCode (Par_GrpTypCod,Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod);
|
||||
HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,
|
||||
"name=\"MultipleEnrolment\""
|
||||
" class=\"INPUT_%s\" style=\"width:150px;\"",
|
||||
|
@ -1301,7 +1302,7 @@ static void Grp_ListGroupTypesForEdition (void)
|
|||
/* Open time */
|
||||
HTM_TD_Begin ("class=\"LM\"");
|
||||
Frm_BeginFormAnchor (ActChgTimGrpTyp,Grp_GROUP_TYPES_SECTION_ID);
|
||||
Grp_PutParamGrpTypCod (&Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod);
|
||||
Par_PutParCode (Par_GrpTypCod,Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod);
|
||||
HTM_TABLE_BeginCenterPadding (2);
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
|
@ -1440,7 +1441,7 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms)
|
|||
/***** Icon to remove group *****/
|
||||
HTM_TD_Begin ("class=\"BM\"");
|
||||
Ico_PutContextualIconToRemove (ActReqRemGrp,Grp_GROUPS_SECTION_ID,
|
||||
Grp_PutParamGrpCod,&Grp->GrpCod);
|
||||
Grp_PutParGrpCod,&Grp->GrpCod);
|
||||
HTM_TD_End ();
|
||||
|
||||
/***** Icon to open/close group *****/
|
||||
|
@ -1448,7 +1449,7 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms)
|
|||
Frm_BeginFormAnchor (Grp->Open ? ActCloGrp :
|
||||
ActOpeGrp,
|
||||
Grp_GROUPS_SECTION_ID);
|
||||
Grp_PutParamGrpCod (&Grp->GrpCod);
|
||||
Par_PutParCode (Par_GrpCod,Grp->GrpCod);
|
||||
Ico_PutIconLink (Grp->Open ? "unlock.svg" :
|
||||
"lock.svg",
|
||||
Grp->Open ? Ico_GREEN :
|
||||
|
@ -1463,7 +1464,7 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms)
|
|||
Frm_BeginFormAnchor (Grp->FileZones ? ActDisFilZonGrp :
|
||||
ActEnaFilZonGrp,
|
||||
Grp_GROUPS_SECTION_ID);
|
||||
Grp_PutParamGrpCod (&Grp->GrpCod);
|
||||
Par_PutParCode (Par_GrpCod,Grp->GrpCod);
|
||||
Ico_PutIconLink (Grp->FileZones ? "folder-open.svg" :
|
||||
"folder.svg",
|
||||
Grp->FileZones ? Ico_GREEN :
|
||||
|
@ -1477,7 +1478,7 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms)
|
|||
/* Begin selector */
|
||||
HTM_TD_Begin ("class=\"CM\"");
|
||||
Frm_BeginFormAnchor (ActChgGrpTyp,Grp_GROUPS_SECTION_ID);
|
||||
Grp_PutParamGrpCod (&Grp->GrpCod);
|
||||
Par_PutParCode (Par_GrpCod,Grp->GrpCod);
|
||||
HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,
|
||||
"name=\"GrpTypCod\""
|
||||
" class=\"INPUT_%s\" style=\"width:100px;\"",
|
||||
|
@ -1502,7 +1503,7 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms)
|
|||
/***** Group name *****/
|
||||
HTM_TD_Begin ("class=\"CM\"");
|
||||
Frm_BeginFormAnchor (ActRenGrp,Grp_GROUPS_SECTION_ID);
|
||||
Grp_PutParamGrpCod (&Grp->GrpCod);
|
||||
Par_PutParCode (Par_GrpCod,Grp->GrpCod);
|
||||
HTM_INPUT_TEXT ("GrpName",Grp_MAX_CHARS_GROUP_NAME,Grp->GrpName,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"size=\"20\" class=\"INPUT_%s\"",
|
||||
|
@ -1514,7 +1515,7 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms)
|
|||
/* Begin selector */
|
||||
HTM_TD_Begin ("class=\"CM\"");
|
||||
Frm_BeginFormAnchor (ActChgGrpRoo,Grp_GROUPS_SECTION_ID);
|
||||
Grp_PutParamGrpCod (&Grp->GrpCod);
|
||||
Par_PutParCode (Par_GrpCod,Grp->GrpCod);
|
||||
HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,
|
||||
"name=\"RooCod\""
|
||||
" class=\"INPUT_%s\" style=\"width:100px;\"",
|
||||
|
@ -1556,7 +1557,7 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms)
|
|||
/***** Maximum number of students of the group (row[3]) *****/
|
||||
HTM_TD_Begin ("class=\"CM\"");
|
||||
Frm_BeginFormAnchor (ActChgMaxStdGrp,Grp_GROUPS_SECTION_ID);
|
||||
Grp_PutParamGrpCod (&Grp->GrpCod);
|
||||
Par_PutParCode (Par_GrpCod,Grp->GrpCod);
|
||||
Grp_WriteMaxStds (StrMaxStudents,Grp->MaxStudents);
|
||||
HTM_INPUT_TEXT ("MaxStudents",Cns_MAX_DECIMAL_DIGITS_UINT,StrMaxStudents,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
|
@ -1620,7 +1621,7 @@ void Grp_ListGrpsToEditAsgAttSvyEvtMch (struct GroupType *GrpTyp,
|
|||
static const struct
|
||||
{
|
||||
const char *Table;
|
||||
Par_Code_t ParamCode;
|
||||
Par_Code_t ParCode;
|
||||
} AssociationsToGrps[Grp_NUM_ASSOCIATIONS_TO_GROUPS] =
|
||||
{
|
||||
[Grp_ASSIGNMENT] = {"asg_groups",Par_AsgCod},
|
||||
|
@ -1652,7 +1653,7 @@ void Grp_ListGrpsToEditAsgAttSvyEvtMch (struct GroupType *GrpTyp,
|
|||
|
||||
if (Cod > 0) // Cod == -1L means new item, assignment, event, survey, exam event or match
|
||||
AssociatedToGrp = Grp_DB_CheckIfAssociatedToGrp (AssociationsToGrps[WhichIsAssociatedToGrp].Table,
|
||||
AssociationsToGrps[WhichIsAssociatedToGrp].ParamCode,
|
||||
AssociationsToGrps[WhichIsAssociatedToGrp].ParCode,
|
||||
Cod,Grp->GrpCod);
|
||||
else
|
||||
AssociatedToGrp = false;
|
||||
|
@ -3400,13 +3401,13 @@ static void Grp_AskConfirmRemGrpTypWithGrps (unsigned NumGrps)
|
|||
/***** Show question and button to remove type of group *****/
|
||||
if (NumGrps == 1)
|
||||
Ale_ShowAlertAndButton (ActRemGrpTyp,Grp_GROUP_TYPES_SECTION_ID,NULL,
|
||||
Grp_PutParamGrpTypCod,&Gbl.Crs.Grps.GrpTyp.GrpTypCod,
|
||||
Grp_PutParGrpTypCod,&Gbl.Crs.Grps.GrpTyp.GrpTypCod,
|
||||
Btn_REMOVE_BUTTON,Txt_Remove_type_of_group,
|
||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_type_of_group_X_1_group_,
|
||||
Gbl.Crs.Grps.GrpTyp.GrpTypName);
|
||||
else
|
||||
Ale_ShowAlertAndButton (ActRemGrpTyp,Grp_GROUP_TYPES_SECTION_ID,NULL,
|
||||
Grp_PutParamGrpTypCod,&Gbl.Crs.Grps.GrpTyp.GrpTypCod,
|
||||
Grp_PutParGrpTypCod,&Gbl.Crs.Grps.GrpTyp.GrpTypCod,
|
||||
Btn_REMOVE_BUTTON,Txt_Remove_type_of_group,
|
||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_type_of_group_X_Y_groups_,
|
||||
Gbl.Crs.Grps.GrpTyp.GrpTypName,NumGrps);
|
||||
|
@ -3443,19 +3444,19 @@ static void Grp_AskConfirmRemGrp (void)
|
|||
/***** Show question and button to remove group *****/
|
||||
if (NumStds == 0)
|
||||
Ale_ShowAlertAndButton (ActRemGrp,Grp_GROUPS_SECTION_ID,NULL,
|
||||
Grp_PutParamGrpCod,&Gbl.Crs.Grps.GrpCod,
|
||||
Grp_PutParGrpCod,&Gbl.Crs.Grps.GrpCod,
|
||||
Btn_REMOVE_BUTTON,Txt_Remove_group,
|
||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_group_X,
|
||||
GrpDat.GrpName);
|
||||
else if (NumStds == 1)
|
||||
Ale_ShowAlertAndButton (ActRemGrp,Grp_GROUPS_SECTION_ID,NULL,
|
||||
Grp_PutParamGrpCod,&Gbl.Crs.Grps.GrpCod,
|
||||
Grp_PutParGrpCod,&Gbl.Crs.Grps.GrpCod,
|
||||
Btn_REMOVE_BUTTON,Txt_Remove_group,
|
||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_group_X_1_student_,
|
||||
GrpDat.GrpName);
|
||||
else
|
||||
Ale_ShowAlertAndButton (ActRemGrp,Grp_GROUPS_SECTION_ID,NULL,
|
||||
Grp_PutParamGrpCod,&Gbl.Crs.Grps.GrpCod,
|
||||
Grp_PutParGrpCod,&Gbl.Crs.Grps.GrpCod,
|
||||
Btn_REMOVE_BUTTON,Txt_Remove_group,
|
||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_group_X_Y_students_,
|
||||
GrpDat.GrpName,NumStds);
|
||||
|
@ -3959,9 +3960,9 @@ void Grp_ChangeMaxStdsGrp (void)
|
|||
/* Get the new maximum number of students of the group */
|
||||
NewMaxStds = (unsigned)
|
||||
Par_GetParUnsignedLong ("MaxStudents",
|
||||
0,
|
||||
Grp_MAX_STUDENTS_IN_A_GROUP,
|
||||
Grp_NUM_STUDENTS_NOT_LIMITED);
|
||||
0,
|
||||
Grp_MAX_STUDENTS_IN_A_GROUP,
|
||||
Grp_NUM_STUDENTS_NOT_LIMITED);
|
||||
|
||||
/* Get from the database the type, name, and old maximum of students of the group */
|
||||
GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod;
|
||||
|
@ -4173,7 +4174,7 @@ void Grp_RenameGroup (void)
|
|||
/****************** Write parameter with code of group type ******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Grp_PutParamGrpTypCod (void *GrpTypCod)
|
||||
static void Grp_PutParGrpTypCod (void *GrpTypCod)
|
||||
{
|
||||
if (GrpTypCod)
|
||||
Par_PutParCode (Par_GrpTypCod,*((long *) GrpTypCod));
|
||||
|
@ -4183,7 +4184,7 @@ static void Grp_PutParamGrpTypCod (void *GrpTypCod)
|
|||
/********************* Write parameter with code of group ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Grp_PutParamGrpCod (void *GrpCod)
|
||||
static void Grp_PutParGrpCod (void *GrpCod)
|
||||
{
|
||||
if (GrpCod)
|
||||
Par_PutParCode (Par_GrpCod,*((long *) GrpCod));
|
||||
|
@ -4196,7 +4197,7 @@ void Grp_PutParamGrpCod (void *GrpCod)
|
|||
void Grp_GetLstCodsGrpWanted (struct ListCodGrps *LstGrpsWanted)
|
||||
{
|
||||
unsigned NumGrpTyp;
|
||||
char Param[6 + Cns_MAX_DECIMAL_DIGITS_LONG + 1];
|
||||
char Par[6 + Cns_MAX_DECIMAL_DIGITS_LONG + 1];
|
||||
char LongStr[1 + Cns_MAX_DECIMAL_DIGITS_LONG + 1];
|
||||
char **LstStrCodGrps;
|
||||
const char *Ptr;
|
||||
|
@ -4219,9 +4220,9 @@ void Grp_GetLstCodsGrpWanted (struct ListCodGrps *LstGrpsWanted)
|
|||
Err_NotEnoughMemoryExit ();
|
||||
|
||||
/***** Get the multiple parameter code of group of this type *****/
|
||||
snprintf (Param,sizeof (Param),"GrpCod%ld",
|
||||
snprintf (Par,sizeof (Par),"GrpCod%ld",
|
||||
Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod);
|
||||
Par_GetParMultiToText (Param,LstStrCodGrps[NumGrpTyp],
|
||||
Par_GetParMultiToText (Par,LstStrCodGrps[NumGrpTyp],
|
||||
((Cns_MAX_DECIMAL_DIGITS_LONG + 1) * Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].NumGrps) - 1);
|
||||
if (LstStrCodGrps[NumGrpTyp][0])
|
||||
{
|
||||
|
@ -4229,7 +4230,7 @@ void Grp_GetLstCodsGrpWanted (struct ListCodGrps *LstGrpsWanted)
|
|||
for (Ptr = LstStrCodGrps[NumGrpTyp], NumGrpWanted = 0;
|
||||
*Ptr;
|
||||
NumGrpWanted++)
|
||||
Par_GetNextStrUntilSeparParamMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
Par_GetNextStrUntilSeparParMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
|
||||
/***** Add the number of groups selected of this type to the number of groups selected total *****/
|
||||
LstGrpsWanted->NumGrps += NumGrpWanted;
|
||||
|
@ -4254,7 +4255,7 @@ void Grp_GetLstCodsGrpWanted (struct ListCodGrps *LstGrpsWanted)
|
|||
*Ptr;
|
||||
NumGrpWanted++)
|
||||
{
|
||||
Par_GetNextStrUntilSeparParamMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
Par_GetNextStrUntilSeparParMult (&Ptr,LongStr,Cns_MAX_DECIMAL_DIGITS_LONG);
|
||||
LstGrpsWanted->GrpCods[NumGrpWanted] = Str_ConvertStrCodToLongCod (LongStr);
|
||||
}
|
||||
/* Free memory used by the list of group codes of this type */
|
||||
|
@ -4282,7 +4283,7 @@ void Grp_FreeListCodGrp (struct ListCodGrps *LstGrps)
|
|||
/*********** Put parameter that indicates all groups selected ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Grp_PutParamAllGroups (void)
|
||||
void Grp_PutParAllGroups (void)
|
||||
{
|
||||
Par_PutParChar ("AllGroups",'Y');
|
||||
}
|
||||
|
@ -4291,19 +4292,19 @@ void Grp_PutParamAllGroups (void)
|
|||
/************* Parameter to show only my groups or all groups ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Grp_PutParamWhichGroups (void *WhichGrps)
|
||||
void Grp_PutParWhichGroups (void *WhichGrps)
|
||||
{
|
||||
if (WhichGrps)
|
||||
Par_PutParUnsigned (NULL,"WhichGrps",
|
||||
(unsigned) *((Grp_WhichGroups_t *) WhichGrps));
|
||||
}
|
||||
|
||||
void Grp_PutParamWhichGrpsOnlyMyGrps (void)
|
||||
void Grp_PutParWhichGrpsOnlyMyGrps (void)
|
||||
{
|
||||
Par_PutParUnsigned (NULL,"WhichGrps",(unsigned) Grp_MY_GROUPS);
|
||||
}
|
||||
|
||||
void Grp_PutParamWhichGrpsAllGrps (void)
|
||||
void Grp_PutParWhichGrpsAllGrps (void)
|
||||
{
|
||||
Par_PutParUnsigned (NULL,"WhichGrps",(unsigned) Grp_ALL_GROUPS);
|
||||
}
|
||||
|
@ -4313,7 +4314,7 @@ void Grp_PutParamWhichGrpsAllGrps (void)
|
|||
/*****************************************************************************/
|
||||
|
||||
void Grp_ShowFormToSelWhichGrps (Act_Action_t Action,
|
||||
void (*FuncParams) (void *Args),void *Args)
|
||||
void (*FuncPars) (void *Args),void *Args)
|
||||
{
|
||||
extern const char *Txt_GROUP_WHICH_GROUPS[2];
|
||||
Grp_WhichGroups_t WhichGrps;
|
||||
|
@ -4329,8 +4330,8 @@ void Grp_ShowFormToSelWhichGrps (Act_Action_t Action,
|
|||
Set_BeginPref (WhichGrps == Gbl.Crs.Grps.WhichGrps);
|
||||
Frm_BeginForm (Action);
|
||||
Par_PutParUnsigned (NULL,"WhichGrps",(unsigned) WhichGrps);
|
||||
if (FuncParams) // Extra parameters depending on the action
|
||||
FuncParams (Args);
|
||||
if (FuncPars) // Extra parameters depending on the action
|
||||
FuncPars (Args);
|
||||
Ico_PutSettingIconLink (WhichGrps == Grp_MY_GROUPS ? "mysitemap.png" :
|
||||
"sitemap.svg",
|
||||
Ico_BLACK,Txt_GROUP_WHICH_GROUPS[WhichGrps]);
|
||||
|
@ -4346,7 +4347,7 @@ void Grp_ShowFormToSelWhichGrps (Act_Action_t Action,
|
|||
/************* Get whether to show only my groups or all groups **************/
|
||||
/*****************************************************************************/
|
||||
|
||||
Grp_WhichGroups_t Grp_GetParamWhichGroups (void)
|
||||
Grp_WhichGroups_t Grp_GetParWhichGroups (void)
|
||||
{
|
||||
static bool AlreadyGot = false;
|
||||
Grp_WhichGroups_t WhichGroupsDefault;
|
||||
|
@ -4386,9 +4387,9 @@ Grp_WhichGroups_t Grp_GetParamWhichGroups (void)
|
|||
/* Get parameter */
|
||||
Gbl.Crs.Grps.WhichGrps = (Grp_WhichGroups_t)
|
||||
Par_GetParUnsignedLong ("WhichGrps",
|
||||
0,
|
||||
Grp_NUM_WHICH_GROUPS - 1,
|
||||
(unsigned long) WhichGroupsDefault);
|
||||
0,
|
||||
Grp_NUM_WHICH_GROUPS - 1,
|
||||
(unsigned long) WhichGroupsDefault);
|
||||
|
||||
AlreadyGot = true;
|
||||
}
|
||||
|
|
17
swad_group.h
17
swad_group.h
|
@ -165,9 +165,9 @@ struct Grp_Groups
|
|||
void Grp_WriteNamesOfSelectedGrps (void);
|
||||
void Grp_ReqEditGroups (void);
|
||||
|
||||
void Grp_ShowFormToSelectSeveralGroups (void (*FuncParams) (void *Args),void *Args,
|
||||
void Grp_ShowFormToSelectSeveralGroups (void (*FuncPars) (void *Args),void *Args,
|
||||
Grp_WhichGroups_t GroupsSelectableByStdsOrNETs);
|
||||
void Grp_PutParamsCodGrps (void);
|
||||
void Grp_PutParsCodGrps (void);
|
||||
void Grp_GetParCodsSeveralGrpsToShowUsrs (void);
|
||||
void Grp_GetParCodsSeveralGrps (void);
|
||||
void Grp_FreeListCodSelectedGrps (void);
|
||||
|
@ -223,17 +223,16 @@ void Grp_ChangeMaxStdsGrp (void);
|
|||
unsigned Grp_ConvertToNumMaxStdsGrp (const char *StrMaxStudents);
|
||||
void Grp_RenameGroupType (void);
|
||||
void Grp_RenameGroup (void);
|
||||
void Grp_PutParamGrpCod (void *GrpCod);
|
||||
void Grp_GetLstCodsGrpWanted (struct ListCodGrps *LstGrpsWanted);
|
||||
void Grp_FreeListCodGrp (struct ListCodGrps *LstGrps);
|
||||
void Grp_PutParamAllGroups (void);
|
||||
void Grp_PutParAllGroups (void);
|
||||
|
||||
void Grp_PutParamWhichGroups (void *WhichGrps);
|
||||
void Grp_PutParamWhichGrpsOnlyMyGrps (void);
|
||||
void Grp_PutParamWhichGrpsAllGrps (void);
|
||||
void Grp_PutParWhichGroups (void *WhichGrps);
|
||||
void Grp_PutParWhichGrpsOnlyMyGrps (void);
|
||||
void Grp_PutParWhichGrpsAllGrps (void);
|
||||
void Grp_ShowFormToSelWhichGrps (Act_Action_t Action,
|
||||
void (*FuncParams) (void *Args),void *Args);
|
||||
Grp_WhichGroups_t Grp_GetParamWhichGroups (void);
|
||||
void (*FuncPars) (void *Args),void *Args);
|
||||
Grp_WhichGroups_t Grp_GetParWhichGroups (void);
|
||||
|
||||
void Grp_DB_RemoveCrsGrps (long CrsCod);
|
||||
|
||||
|
|
|
@ -679,7 +679,7 @@ long Grp_DB_GetGrpTypeFromGrp (long GrpCod)
|
|||
/*********** exam session or match is associated to a given group ************/
|
||||
/*****************************************************************************/
|
||||
|
||||
bool Grp_DB_CheckIfAssociatedToGrp (const char *Table,Par_Code_t ParamCode,
|
||||
bool Grp_DB_CheckIfAssociatedToGrp (const char *Table,Par_Code_t ParCode,
|
||||
long Cod,long GrpCod)
|
||||
{
|
||||
extern const char *Par_CodeStr[]; // Database field name must be equal to code parameter name
|
||||
|
@ -692,7 +692,7 @@ bool Grp_DB_CheckIfAssociatedToGrp (const char *Table,Par_Code_t ParamCode,
|
|||
" WHERE %s=%ld"
|
||||
" AND GrpCod=%ld)",
|
||||
Table,
|
||||
Par_CodeStr[ParamCode],Cod,
|
||||
Par_CodeStr[ParCode],Cod,
|
||||
GrpCod);
|
||||
}
|
||||
|
||||
|
@ -701,7 +701,7 @@ bool Grp_DB_CheckIfAssociatedToGrp (const char *Table,Par_Code_t ParamCode,
|
|||
/************ exam session or match is associated to any group **************/
|
||||
/*****************************************************************************/
|
||||
|
||||
bool Grp_DB_CheckIfAssociatedToGrps (const char *Table,Par_Code_t ParamCode,long Cod)
|
||||
bool Grp_DB_CheckIfAssociatedToGrps (const char *Table,Par_Code_t ParCode,long Cod)
|
||||
{
|
||||
extern const char *Par_CodeStr[]; // Database field name must be equal to code parameter name
|
||||
|
||||
|
@ -718,7 +718,7 @@ bool Grp_DB_CheckIfAssociatedToGrps (const char *Table,Par_Code_t ParamCode,long
|
|||
" FROM %s"
|
||||
" WHERE %s=%ld)",
|
||||
Table,
|
||||
Par_CodeStr[ParamCode],Cod);
|
||||
Par_CodeStr[ParCode],Cod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -78,9 +78,9 @@ unsigned Grp_DB_GetNamesGrpsUsrBelongsTo (MYSQL_RES **mysql_res,
|
|||
|
||||
long Grp_DB_GetGrpTypeFromGrp (long GrpCod);
|
||||
|
||||
bool Grp_DB_CheckIfAssociatedToGrp (const char *Table,Par_Code_t ParamCode,
|
||||
bool Grp_DB_CheckIfAssociatedToGrp (const char *Table,Par_Code_t ParCode,
|
||||
long Cod,long GrpCod);
|
||||
bool Grp_DB_CheckIfAssociatedToGrps (const char *Table,Par_Code_t ParamCode,long Cod);
|
||||
bool Grp_DB_CheckIfAssociatedToGrps (const char *Table,Par_Code_t ParCode,long Cod);
|
||||
|
||||
void Grp_DB_ChangeMandatoryEnrolmentOfAGrpTyp (long GrpTypCod,
|
||||
bool NewMandatoryEnrolment);
|
||||
|
|
|
@ -102,6 +102,7 @@ void Hie_SeePending (void)
|
|||
|
||||
void Hie_WriteMenuHierarchy (void)
|
||||
{
|
||||
extern const char *Par_CodeStr[];
|
||||
extern const char *Txt_Country;
|
||||
extern const char *Txt_Institution;
|
||||
extern const char *Txt_Center;
|
||||
|
@ -115,7 +116,7 @@ void Hie_WriteMenuHierarchy (void)
|
|||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT","cty",Txt_Country);
|
||||
Frm_LabelColumn ("RT",Par_CodeStr[Par_CtyCod],Txt_Country);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
|
@ -131,7 +132,7 @@ void Hie_WriteMenuHierarchy (void)
|
|||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT","ins",Txt_Institution);
|
||||
Frm_LabelColumn ("RT",Par_CodeStr[Par_InsCod],Txt_Institution);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
|
@ -147,7 +148,7 @@ void Hie_WriteMenuHierarchy (void)
|
|||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT","ctr",Txt_Center);
|
||||
Frm_LabelColumn ("RT",Par_CodeStr[Par_CtrCod],Txt_Center);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
|
@ -163,7 +164,7 @@ void Hie_WriteMenuHierarchy (void)
|
|||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT","deg",Txt_Degree);
|
||||
Frm_LabelColumn ("RT",Par_CodeStr[Par_DegCod],Txt_Degree);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
|
@ -179,7 +180,7 @@ void Hie_WriteMenuHierarchy (void)
|
|||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT","crs",Txt_Course);
|
||||
Frm_LabelColumn ("RT",Par_CodeStr[Par_CrsCod],Txt_Course);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
|
@ -231,7 +232,7 @@ void Hie_WriteHierarchyInBreadcrumb (void)
|
|||
|
||||
/***** Form to go to see institutions of this country *****/
|
||||
Frm_BeginFormGoTo (ActSeeIns);
|
||||
Cty_PutParamCtyCod (Gbl.Hierarchy.Cty.CtyCod);
|
||||
Par_PutParCode (Par_CtyCod,Gbl.Hierarchy.Cty.CtyCod);
|
||||
HTM_BUTTON_Submit_Begin (Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language],
|
||||
"class=\"BT_LINK\"");
|
||||
HTM_Txt (Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language]);
|
||||
|
@ -266,7 +267,7 @@ void Hie_WriteHierarchyInBreadcrumb (void)
|
|||
|
||||
/***** Form to see centers of this institution *****/
|
||||
Frm_BeginFormGoTo (ActSeeCtr);
|
||||
Ins_PutParamInsCod (Gbl.Hierarchy.Ins.InsCod);
|
||||
Par_PutParCode (Par_InsCod,Gbl.Hierarchy.Ins.InsCod);
|
||||
HTM_BUTTON_Submit_Begin (Gbl.Hierarchy.Ins.FullName,
|
||||
"class=\"BT_LINK\"");
|
||||
HTM_Txt (Gbl.Hierarchy.Ins.ShrtName);
|
||||
|
@ -313,7 +314,7 @@ void Hie_WriteHierarchyInBreadcrumb (void)
|
|||
|
||||
/***** Form to see degrees of this center *****/
|
||||
Frm_BeginFormGoTo (ActSeeDeg);
|
||||
Ctr_PutParamCtrCod (Gbl.Hierarchy.Ctr.CtrCod);
|
||||
Par_PutParCode (Par_CtrCod,Gbl.Hierarchy.Ctr.CtrCod);
|
||||
HTM_BUTTON_Submit_Begin (Gbl.Hierarchy.Ctr.FullName,
|
||||
"class=\"BT_LINK\"");
|
||||
HTM_Txt (Gbl.Hierarchy.Ctr.ShrtName);
|
||||
|
@ -360,7 +361,7 @@ void Hie_WriteHierarchyInBreadcrumb (void)
|
|||
|
||||
/***** Form to go to see courses of this degree *****/
|
||||
Frm_BeginFormGoTo (ActSeeCrs);
|
||||
Deg_PutParamDegCod (Gbl.Hierarchy.Deg.DegCod);
|
||||
Par_PutParCode (Par_DegCod,Gbl.Hierarchy.Deg.DegCod);
|
||||
HTM_BUTTON_Submit_Begin (Gbl.Hierarchy.Deg.FullName,
|
||||
"class=\"BT_LINK\"");
|
||||
HTM_Txt (Gbl.Hierarchy.Deg.ShrtName);
|
||||
|
@ -802,7 +803,7 @@ void Hie_WriteStatusCellEditable (bool ICanEdit,Hie_Status_t Status,
|
|||
{
|
||||
/* Begin form */
|
||||
Frm_BeginForm (NextAction);
|
||||
Hie_PutParamOtherHieCod (&HieCod);
|
||||
Par_PutParCode (Par_OthHieCod,HieCod);
|
||||
|
||||
/* Selector */
|
||||
HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,
|
||||
|
@ -832,7 +833,7 @@ void Hie_WriteStatusCellEditable (bool ICanEdit,Hie_Status_t Status,
|
|||
/**************************** Get parameter status ***************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
Hie_Status_t Hie_GetParamStatus (void)
|
||||
Hie_Status_t Hie_GetParStatus (void)
|
||||
{
|
||||
Hie_Status_t Status;
|
||||
Hie_StatusTxt_t StatusTxt;
|
||||
|
@ -840,9 +841,9 @@ Hie_Status_t Hie_GetParamStatus (void)
|
|||
/***** Get parameter with status *****/
|
||||
Status = (Hie_Status_t)
|
||||
Par_GetParUnsignedLong ("Status",
|
||||
0,
|
||||
(unsigned long) Hie_MAX_STATUS,
|
||||
(unsigned long) Hie_WRONG_STATUS);
|
||||
0,
|
||||
(unsigned long) Hie_MAX_STATUS,
|
||||
(unsigned long) Hie_WRONG_STATUS);
|
||||
|
||||
if (Status == Hie_WRONG_STATUS)
|
||||
Err_WrongStatusExit ();
|
||||
|
@ -897,7 +898,7 @@ static Hie_Status_t Hie_GetStatusBitsFromStatusTxt (Hie_StatusTxt_t StatusTxt)
|
|||
/**** Write parameter with code of other institution/center/degree/course ****/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Hie_PutParamOtherHieCod (void *HieCod)
|
||||
void Hie_PutParOtherHieCod (void *HieCod)
|
||||
{
|
||||
if (HieCod)
|
||||
Par_PutParCode (Par_OthHieCod,*((long *) HieCod));
|
||||
|
|
|
@ -68,8 +68,8 @@ void Hie_WriteStatusCell (Hie_Status_t Status,
|
|||
void Hie_WriteStatusCellEditable (bool ICanEdit,Hie_Status_t Status,
|
||||
Act_Action_t NextAction,long HieCod,
|
||||
const char *Txt[Hie_NUM_STATUS_TXT]);
|
||||
Hie_Status_t Hie_GetParamStatus (void);
|
||||
void Hie_PutParamOtherHieCod (void *HieCod);
|
||||
Hie_Status_t Hie_GetParStatus (void);
|
||||
void Hie_PutParOtherHieCod (void *HieCod);
|
||||
|
||||
//-------------------------------- Figures ------------------------------------
|
||||
void Hie_GetAndShowHierarchyStats (void);
|
||||
|
|
|
@ -203,8 +203,9 @@ void HieCfg_WWW (bool PrintView,bool PutForm,Act_Action_t NextAction,
|
|||
/********************** Show shortcut in configuration ***********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void HieCfg_Shortcut (bool PrintView,const char *ParamName,long HieCod)
|
||||
void HieCfg_Shortcut (bool PrintView,Par_Code_t ParCode,long HieCod)
|
||||
{
|
||||
extern const char *Par_CodeStr[];
|
||||
extern const char *Txt_Shortcut;
|
||||
|
||||
/***** Short cut *****/
|
||||
|
@ -217,24 +218,24 @@ void HieCfg_Shortcut (bool PrintView,const char *ParamName,long HieCod)
|
|||
HTM_TD_Begin ("class=\"LB DAT_%s\"",The_GetSuffix ());
|
||||
if (!PrintView)
|
||||
{
|
||||
if (ParamName)
|
||||
HTM_A_Begin ("href=\"%s/?%s=%ld\" target=\"_blank\""
|
||||
" class=\"DAT_%s\"",
|
||||
Cfg_URL_SWAD_CGI,
|
||||
ParamName,HieCod,
|
||||
The_GetSuffix ());
|
||||
else
|
||||
if (ParCode == Par_None)
|
||||
HTM_A_Begin ("href=\"%s/\" target=\"_blank\" class=\"DAT_%s\"",
|
||||
Cfg_URL_SWAD_CGI,
|
||||
The_GetSuffix ());
|
||||
else
|
||||
HTM_A_Begin ("href=\"%s/?%s=%ld\" target=\"_blank\""
|
||||
" class=\"DAT_%s\"",
|
||||
Cfg_URL_SWAD_CGI,
|
||||
Par_CodeStr[ParCode],HieCod,
|
||||
The_GetSuffix ());
|
||||
}
|
||||
if (ParamName)
|
||||
HTM_TxtF ("%s/?%s=%ld",
|
||||
Cfg_URL_SWAD_CGI,
|
||||
ParamName,HieCod);
|
||||
else
|
||||
if (ParCode == Par_None)
|
||||
HTM_TxtF ("%s/",
|
||||
Cfg_URL_SWAD_CGI);
|
||||
else
|
||||
HTM_TxtF ("%s/?%s=%ld",
|
||||
Cfg_URL_SWAD_CGI,
|
||||
Par_CodeStr[ParCode],HieCod);
|
||||
if (!PrintView)
|
||||
HTM_A_End ();
|
||||
HTM_TD_End ();
|
||||
|
@ -263,7 +264,7 @@ void HieCfg_NumCtrs (unsigned NumCtrs,bool PutForm)
|
|||
if (PutForm)
|
||||
{
|
||||
Frm_BeginFormGoTo (ActSeeCtr);
|
||||
Ins_PutParamInsCod (Gbl.Hierarchy.Ins.InsCod);
|
||||
Par_PutParCode (Par_InsCod,Gbl.Hierarchy.Ins.InsCod);
|
||||
if (asprintf (&Title,Txt_Centers_of_INSTITUTION_X,
|
||||
Gbl.Hierarchy.Ins.ShrtName) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
|
@ -311,7 +312,7 @@ void HieCfg_NumCtrsWithMap (unsigned NumCtrs,unsigned NumCtrsWithMap)
|
|||
/************************* Show QR in configuration **************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void HieCfg_QR (const char *ParamName,long HieCod)
|
||||
void HieCfg_QR (Par_Code_t ParCode,long HieCod)
|
||||
{
|
||||
extern const char *Txt_QR_code;
|
||||
|
||||
|
@ -323,7 +324,7 @@ void HieCfg_QR (const char *ParamName,long HieCod)
|
|||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LB DAT_%s\"",The_GetSuffix ());
|
||||
QR_LinkTo (250,ParamName,HieCod);
|
||||
QR_LinkTo (250,ParCode,HieCod);
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue