diff --git a/swad_ID.c b/swad_ID.c
index aa65630a..8a898239 100644
--- a/swad_ID.c
+++ b/swad_ID.c
@@ -54,12 +54,6 @@ extern struct Globals Gbl;
/******************************* Private types *******************************/
/*****************************************************************************/
-typedef enum
- {
- ID_REQUEST_CONFIRM_ID,
- ID_CONFIRM_ID,
- } ID_ReqConfOrConfID_t;
-
/*****************************************************************************/
/***************************** Private variables *****************************/
/*****************************************************************************/
@@ -70,9 +64,8 @@ typedef enum
static bool ID_CheckIfUsrIDIsValidUsingMinDigits (const char *UsrID,unsigned MinDigits);
-static void ID_PutLinkToReqConfirmID (struct UsrData *UsrDat,unsigned NumID);
-static void ID_PutButtonToConfirmID (unsigned NumID);
-static void ID_PutParamsConfirmID (void);
+static void ID_PutLinkToConfirmID (struct UsrData *UsrDat,unsigned NumID,
+ const char *Anchor);
static void ID_RemoveUsrID (const struct UsrData *UsrDat,bool ItsMe);
static bool ID_CheckIfConfirmed (long UsrCod,const char *UsrID);
@@ -80,8 +73,6 @@ static void ID_RemoveUsrIDFromDB (long UsrCod,const char *UsrID);
static void ID_NewUsrID (const struct UsrData *UsrDat,bool ItsMe);
static void ID_InsertANewUsrIDInDB (long UsrCod,const char *NewID,bool Confirmed);
-static void ID_ReqConfOrConfOtherUsrID (ID_ReqConfOrConfID_t ReqConfOrConfID);
-
/*****************************************************************************/
/********************** Get list of IDs of a user ****************************/
/*****************************************************************************/
@@ -368,7 +359,7 @@ static bool ID_CheckIfUsrIDIsValidUsingMinDigits (const char *UsrID,unsigned Min
/*************************** Write list of user's ID *************************/
/*****************************************************************************/
-void ID_WriteUsrIDs (struct UsrData *UsrDat)
+void ID_WriteUsrIDs (struct UsrData *UsrDat,const char *Anchor)
{
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
unsigned NumID;
@@ -399,7 +390,7 @@ void ID_WriteUsrIDs (struct UsrData *UsrDat)
if (ICanConfirmUsrID &&
!UsrDat->IDs.List[NumID].Confirmed)
- ID_PutLinkToReqConfirmID (UsrDat,NumID);
+ ID_PutLinkToConfirmID (UsrDat,NumID,Anchor);
}
}
@@ -448,55 +439,49 @@ bool ID_ICanSeeOtherUsrIDs (const struct UsrData *UsrDat)
}
/*****************************************************************************/
-/******** Put a link to request the confirmation of another user's ID ********/
+/****************** Put a link to confirm of another user's ID ***************/
/*****************************************************************************/
-static void ID_PutLinkToReqConfirmID (struct UsrData *UsrDat,unsigned NumID)
+static void ID_PutLinkToConfirmID (struct UsrData *UsrDat,unsigned NumID,
+ const char *Anchor)
{
+ extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
extern const char *The_ClassFormBold[The_NUM_THEMES];
extern const char *Txt_Confirm_ID;
- Act_FormStart ( UsrDat->RoleInCurrentCrsDB == Rol_STUDENT ? ActReqCnfID_Std :
- (UsrDat->RoleInCurrentCrsDB == Rol_TEACHER ? ActReqCnfID_Tch :
- ActReqCnfID_Oth)); // Guest, visitor or admin
+ /***** Start form *****/
+ Act_FormStartAnchor ( UsrDat->RoleInCurrentCrsDB == Rol_STUDENT ? ActCnfID_Std :
+ (UsrDat->RoleInCurrentCrsDB == Rol_TEACHER ? ActCnfID_Tch :
+ ActCnfID_Oth),
+ Anchor);
+ if (Gbl.Action.Original != ActUnk)
+ {
+ Par_PutHiddenParamLong ("OriginalActCod",Act_Actions[Gbl.Action.Original].ActCod); // Original action, used to know where we came from
+ switch (Gbl.Action.Original)
+ {
+ case ActSeeRecSevGst:
+ Usr_PutHiddenParUsrCodAll (ActCnfID_Oth,Gbl.Usrs.Select.All);
+ break;
+ case ActSeeRecSevStd:
+ Usr_PutHiddenParUsrCodAll (ActCnfID_Std,Gbl.Usrs.Select.All);
+ break;
+ case ActSeeRecSevTch:
+ Usr_PutHiddenParUsrCodAll (ActCnfID_Tch,Gbl.Usrs.Select.All);
+ break;
+ }
+ }
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
fprintf (Gbl.F.Out,"",
UsrDat->IDs.List[NumID].ID);
+
+ /***** Put link *****/
Lay_PutIconLink ("ok_on16x16.gif",Txt_Confirm_ID,Txt_Confirm_ID,
The_ClassFormBold[Gbl.Prefs.Theme],NULL);
+
+ /***** End form *****/
Act_FormEnd ();
}
-/*****************************************************************************/
-/**************** Put a button to confirm another user's ID ******************/
-/*****************************************************************************/
-
-static void ID_PutButtonToConfirmID (unsigned NumID)
- {
- extern const char *Txt_Do_you_want_to_confirm_the_ID_X;
- extern const char *Txt_Confirm_ID;
-
- Gbl.Usrs.Other.NumIDToConfirm = NumID;
-
- /***** Ask for confirmation *****/
- sprintf (Gbl.Title,Txt_Do_you_want_to_confirm_the_ID_X,
- Gbl.Usrs.Other.UsrDat.IDs.List[NumID].ID);
- Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Title);
- Lay_ShowAlertAndButton2 ( Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT ? ActCnfID_Std :
- (Gbl.Usrs.Other.UsrDat.RoleInCurrentCrsDB == Rol_TEACHER ? ActCnfID_Tch :
- ActCnfID_Oth), // Guest, visitor or admin
- NULL,
- ID_PutParamsConfirmID,
- Lay_CREATE_BUTTON,Txt_Confirm_ID);
- }
-
-static void ID_PutParamsConfirmID (void)
- {
- Usr_PutParamOtherUsrCodEncrypted ();
- fprintf (Gbl.F.Out,"",
- Gbl.Usrs.Other.UsrDat.IDs.List[Gbl.Usrs.Other.NumIDToConfirm].ID);
- }
-
/*****************************************************************************/
/*********** Put a link to the action used to request user's IDs *************/
/*****************************************************************************/
@@ -539,7 +524,8 @@ void ID_ShowFormOthIDs (void)
Lay_StartRoundFrame (NULL,Txt_ID,NULL,NULL);
/***** Show user's record *****/
- Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,&Gbl.Usrs.Other.UsrDat);
+ Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,
+ &Gbl.Usrs.Other.UsrDat,NULL);
/***** Form with the user's ID *****/
Lay_StartTableWide (2);
@@ -719,7 +705,8 @@ void ID_RemoveOtherUsrID (void)
ID_GetListIDsFromUsrCod (&Gbl.Usrs.Other.UsrDat);
/***** Show user's record *****/
- Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,&Gbl.Usrs.Other.UsrDat);
+ Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,
+ &Gbl.Usrs.Other.UsrDat,NULL);
}
else // User not found
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
@@ -834,7 +821,8 @@ void ID_NewOtherUsrID (void)
ID_GetListIDsFromUsrCod (&Gbl.Usrs.Other.UsrDat);
/***** Show user's record *****/
- Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,&Gbl.Usrs.Other.UsrDat);
+ Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,
+ &Gbl.Usrs.Other.UsrDat,NULL);
}
else // User not found
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
@@ -945,39 +933,29 @@ static void ID_InsertANewUsrIDInDB (long UsrCod,const char *NewID,bool Confirmed
DB_QueryINSERT (Query,"can not insert a new ID");
}
-/*****************************************************************************/
-/*************** Request the confirmation of another user's ID ***************/
-/*****************************************************************************/
-
-void ID_RequestConfirmOtherUsrID (void)
- {
- ID_ReqConfOrConfOtherUsrID (ID_REQUEST_CONFIRM_ID);
- }
-
/*****************************************************************************/
/************************ Confirm another user's ID **************************/
/*****************************************************************************/
void ID_ConfirmOtherUsrID (void)
- {
- ID_ReqConfOrConfOtherUsrID (ID_CONFIRM_ID);
- }
-
-/*****************************************************************************/
-/********** Request the confirmation or confirm another user's ID ************/
-/*****************************************************************************/
-
-static void ID_ReqConfOrConfOtherUsrID (ID_ReqConfOrConfID_t ReqConfOrConfID)
{
extern const char *Txt_ID_X_had_already_been_confirmed;
extern const char *Txt_The_ID_X_has_been_confirmed;
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
+ long OriginalActCod;
char UsrID[ID_MAX_BYTES_USR_ID + 1];
bool ICanConfirm;
bool Found;
unsigned NumID;
unsigned NumIDFound = 0; // Initialized to avoid warning
+ /***** Initialize alert type and message *****/
+ Gbl.AlertType = Lay_NONE; // Do not show alert
+
+ /***** Get where we came from *****/
+ OriginalActCod = Par_GetParToLong ("OriginalActCod");
+ Gbl.Action.Original = Act_GetActionFromActCod (OriginalActCod);
+
/***** Get other user's code from form and get user's data *****/
ICanConfirm = false;
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
@@ -1007,40 +985,59 @@ static void ID_ReqConfOrConfOtherUsrID (ID_ReqConfOrConfID_t ReqConfOrConfID)
if (Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].Confirmed)
{
/***** ID found and already confirmed *****/
+ Gbl.AlertType = Lay_INFO;
sprintf (Gbl.Message,Txt_ID_X_had_already_been_confirmed,
Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].ID);
- Lay_ShowAlert (Lay_INFO,Gbl.Message);
}
else
{
- switch (ReqConfOrConfID)
- {
- case ID_REQUEST_CONFIRM_ID: // Ask if confirm ID
- /***** Put button to confirm ID *****/
- ID_PutButtonToConfirmID (NumIDFound);
- break;
- case ID_CONFIRM_ID: // Confirm ID
- /***** Mark this ID as confirmed *****/
- ID_ConfirmUsrID (&Gbl.Usrs.Other.UsrDat,
- Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].ID);
- Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].Confirmed = true;
+ /***** Mark this ID as confirmed *****/
+ ID_ConfirmUsrID (&Gbl.Usrs.Other.UsrDat,
+ Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].ID);
+ Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].Confirmed = true;
- /***** Write success message *****/
- sprintf (Gbl.Message,Txt_The_ID_X_has_been_confirmed,
- Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].ID);
- Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
- break;
- }
+ /***** Write success message *****/
+ Gbl.AlertType = Lay_SUCCESS;
+ sprintf (Gbl.Message,Txt_The_ID_X_has_been_confirmed,
+ Gbl.Usrs.Other.UsrDat.IDs.List[NumIDFound].ID);
}
}
else // User's ID not found
- Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
-
- /***** Show user's record *****/
- Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,&Gbl.Usrs.Other.UsrDat);
+ {
+ Gbl.AlertType = Lay_WARNING;
+ sprintf (Gbl.Message,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
+ }
+ }
+ else // I can not confirm
+ {
+ Gbl.AlertType = Lay_WARNING;
+ sprintf (Gbl.Message,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
+ }
+
+ /***** Show one or multiple records *****/
+ switch (Gbl.Action.Original)
+ {
+ case ActSeeRecSevGst:
+ /* Show multiple records of guests again (including the updated one) */
+ Rec_ListRecordsGstsShow ();
+ break;
+ case ActSeeRecSevStd:
+ /* Show multiple records of students again (including the updated one) */
+ Rec_ListRecordsStdsShow ();
+ break;
+ case ActSeeRecSevTch:
+ /* Show multiple records of teachers again (including the updated one) */
+ Rec_ListRecordsTchsShow ();
+ break;
+ default:
+ /* Show optional alert */
+ Lay_ShowPendingAlert ();
+
+ /* Show only the updated record of this user */
+ Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,
+ &Gbl.Usrs.Other.UsrDat,NULL);
+ break;
}
- else // User not found
- Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
}
/*****************************************************************************/
diff --git a/swad_ID.h b/swad_ID.h
index 986a2d93..f0e0b389 100644
--- a/swad_ID.h
+++ b/swad_ID.h
@@ -69,7 +69,7 @@ void ID_GetParamOtherUsrIDPlain (void);
bool ID_CheckIfUsrIDIsValid (const char *UsrID);
bool ID_CheckIfUsrIDSeemsAValidID (const char *UsrID);
-void ID_WriteUsrIDs (struct UsrData *UsrDat);
+void ID_WriteUsrIDs (struct UsrData *UsrDat,const char *Anchor);
bool ID_ICanSeeOtherUsrIDs (const struct UsrData *UsrDat);
void ID_PutLinkToChangeUsrIDs (void);
@@ -80,7 +80,6 @@ void ID_RemoveOtherUsrID (void);
void ID_NewMyUsrID (void);
void ID_NewOtherUsrID (void);
-void ID_RequestConfirmOtherUsrID (void);
void ID_ConfirmOtherUsrID (void);
void ID_ConfirmUsrID (const struct UsrData *UsrDat,const char *UsrID);
diff --git a/swad_action.c b/swad_action.c
index 701030b2..25c1c165 100644
--- a/swad_action.c
+++ b/swad_action.c
@@ -1079,9 +1079,6 @@ Users:
884. ActRcvFrmEnrSevStd Receive a form with IDs of users to be registeres/removed to/from current course
885. ActRcvFrmEnrSevTch Receive a form with IDs of users to be registeres/removed to/from current course
- 886. ActReqCnfID_Oth Request the confirmation of another user's ID
- 887. ActReqCnfID_Std Request the confirmation of another user's ID
- 888. ActReqCnfID_Tch Request the confirmation of another user's ID
889. ActCnfID_Oth Confirm another user's ID
890. ActCnfID_Std Confirm another user's ID
891. ActCnfID_Tch Confirm another user's ID
@@ -2453,12 +2450,12 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
/* ActSeeRecOneStd */{1174,-1,TabUnk,ActLstStd ,0x118,0x100, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Rec_GetUsrAndShowRecordOneStdCrs,NULL},
/* ActSeeRecOneTch */{1175,-1,TabUnk,ActLstTch ,0x1FC,0x1FC,0x1FC,0x1FC,0x1FC,0x1FC,0x1FC,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Rec_GetUsrAndShowRecordOneTchCrs,NULL},
- /* ActSeeRecSevGst */{1187,-1,TabUnk,ActLstOth ,0x100,0x100,0x100,0x100,0x100,0x100,0x100,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Rec_ListRecordsGsts ,NULL},
- /* ActSeeRecSevStd */{ 89,-1,TabUnk,ActLstStd ,0x118,0x100, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Rec_ListRecordsStdsForEdit ,NULL},
- /* ActSeeRecSevTch */{ 22,-1,TabUnk,ActLstTch ,0x1FF,0x1FF, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Rec_ListRecordsTchs ,NULL},
- /* ActPrnRecSevGst */{1188,-1,TabUnk,ActLstOth ,0x100,0x100,0x100,0x100,0x100,0x100,0x100,Act_CONT_NORM,Act_BLNK_WINDOW,NULL ,Rec_ListRecordsGsts ,NULL},
- /* ActPrnRecSevStd */{ 111,-1,TabUnk,ActLstStd ,0x118,0x100, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BLNK_WINDOW,NULL ,Rec_ListRecordsStdsForPrint ,NULL},
- /* ActPrnRecSevTch */{ 127,-1,TabUnk,ActLstTch ,0x1FF,0x1FF, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BLNK_WINDOW,NULL ,Rec_ListRecordsTchs ,NULL},
+ /* ActSeeRecSevGst */{1187,-1,TabUnk,ActLstOth ,0x100,0x100,0x100,0x100,0x100,0x100,0x100,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Rec_ListRecordsGstsShow ,NULL},
+ /* ActSeeRecSevStd */{ 89,-1,TabUnk,ActLstStd ,0x118,0x100, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Rec_ListRecordsStdsShow ,NULL},
+ /* ActSeeRecSevTch */{ 22,-1,TabUnk,ActLstTch ,0x1FF,0x1FF, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Rec_ListRecordsTchsShow ,NULL},
+ /* ActPrnRecSevGst */{1188,-1,TabUnk,ActLstOth ,0x100,0x100,0x100,0x100,0x100,0x100,0x100,Act_CONT_NORM,Act_BLNK_WINDOW,NULL ,Rec_ListRecordsGstsPrint ,NULL},
+ /* ActPrnRecSevStd */{ 111,-1,TabUnk,ActLstStd ,0x118,0x100, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BLNK_WINDOW,NULL ,Rec_ListRecordsStdsPrint ,NULL},
+ /* ActPrnRecSevTch */{ 127,-1,TabUnk,ActLstTch ,0x1FF,0x1FF, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BLNK_WINDOW,NULL ,Rec_ListRecordsTchsPrint ,NULL},
/* ActRcvRecOthUsr */{ 300,-1,TabUnk,ActLstStd ,0x110,0x100, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Rec_UpdateAndShowOtherCrsRecord,NULL},
/* ActEdiRecFie */{ 292,-1,TabUnk,ActLstStd ,0x110,0x100, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Rec_ReqEditRecordFields ,NULL},
@@ -2554,9 +2551,6 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
/* ActRcvFrmEnrSevStd*/{1428,-1,TabUnk,ActLstStd ,0x1FE,0x1FE,0x1FE,0x1FE,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Enr_ReceiveFormAdminStds ,NULL},
/* ActRcvFrmEnrSevTch*/{1429,-1,TabUnk,ActLstTch ,0x1FE,0x1FE,0x1FE,0x1FE,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Enr_ReceiveFormAdminTchs ,NULL},
- /* ActReqCnfID_Oth */{1565,-1,TabUnk,ActLstOth ,0x1F0,0x1E0,0x1E0,0x1E0,0x1E0,0x1E0,0x1E0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,ID_RequestConfirmOtherUsrID ,NULL},
- /* ActReqCnfID_Std */{1566,-1,TabUnk,ActLstStd ,0x1F0,0x1E0,0x1E0,0x1E0,0x1E0,0x1E0,0x1E0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,ID_RequestConfirmOtherUsrID ,NULL},
- /* ActReqCnfID_Tch */{1567,-1,TabUnk,ActLstTch ,0x1F0,0x1E0,0x1E0,0x1E0,0x1E0,0x1E0,0x1E0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,ID_RequestConfirmOtherUsrID ,NULL},
/* ActCnfID_Oth */{1568,-1,TabUnk,ActLstOth ,0x1F0,0x1E0,0x1E0,0x1E0,0x1E0,0x1E0,0x1E0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,ID_ConfirmOtherUsrID ,NULL},
/* ActCnfID_Std */{1569,-1,TabUnk,ActLstStd ,0x1F0,0x1E0,0x1E0,0x1E0,0x1E0,0x1E0,0x1E0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,ID_ConfirmOtherUsrID ,NULL},
/* ActCnfID_Tch */{1570,-1,TabUnk,ActLstTch ,0x1F0,0x1E0,0x1E0,0x1E0,0x1E0,0x1E0,0x1E0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,ID_ConfirmOtherUsrID ,NULL},
@@ -4555,9 +4549,9 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un
ActReqDatTchGrp, // #1562
ActChgDatTchGrp, // #1563
ActDowTchGrp, // #1564
- ActReqCnfID_Oth, // #1565
- ActReqCnfID_Std, // #1566
- ActReqCnfID_Tch, // #1567
+ -1, // #1565 (obsolete action)
+ -1, // #1566 (obsolete action)
+ -1, // #1567 (obsolete action)
ActCnfID_Oth, // #1568
ActCnfID_Std, // #1569
ActCnfID_Tch, // #1570
@@ -4638,6 +4632,18 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un
static void Act_FormStartInternal (Act_Action_t NextAction,bool PutParameterLocationIfNoSesion,
const char *Id,const char *Anchor,const char *OnSubmit);
+/*****************************************************************************/
+/****************** Get action from permanent action code ********************/
+/*****************************************************************************/
+
+Act_Action_t Act_GetActionFromActCod (long ActCod)
+ {
+ if (ActCod >= 0 && ActCod <= Act_MAX_ACTION_COD)
+ return Act_FromActCodToAction[ActCod];
+
+ return ActUnk;
+ }
+
/*****************************************************************************/
/************* Check if I have permission to execute an action ***************/
/*****************************************************************************/
diff --git a/swad_action.h b/swad_action.h
index 53d4ffee..d74b0513 100644
--- a/swad_action.h
+++ b/swad_action.h
@@ -57,7 +57,7 @@ typedef enum
typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
-#define Act_NUM_ACTIONS (1 + 9 + 43 + 17 + 47 + 32 + 24 + 115 + 72 + 416 + 159 + 172 + 42 + 14 + 97)
+#define Act_NUM_ACTIONS (1 + 9 + 43 + 17 + 47 + 32 + 24 + 115 + 72 + 416 + 156 + 172 + 42 + 14 + 97)
#define Act_MAX_ACTION_COD 1638
@@ -1096,53 +1096,50 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to
#define ActRcvFrmEnrSevStd (ActChgNumRowFooGrp + 117)
#define ActRcvFrmEnrSevTch (ActChgNumRowFooGrp + 118)
-#define ActReqCnfID_Oth (ActChgNumRowFooGrp + 119)
-#define ActReqCnfID_Std (ActChgNumRowFooGrp + 120)
-#define ActReqCnfID_Tch (ActChgNumRowFooGrp + 121)
-#define ActCnfID_Oth (ActChgNumRowFooGrp + 122)
-#define ActCnfID_Std (ActChgNumRowFooGrp + 123)
-#define ActCnfID_Tch (ActChgNumRowFooGrp + 124)
+#define ActCnfID_Oth (ActChgNumRowFooGrp + 119)
+#define ActCnfID_Std (ActChgNumRowFooGrp + 120)
+#define ActCnfID_Tch (ActChgNumRowFooGrp + 121)
-#define ActFrmIDsOth (ActChgNumRowFooGrp + 125)
-#define ActFrmIDsStd (ActChgNumRowFooGrp + 126)
-#define ActFrmIDsTch (ActChgNumRowFooGrp + 127)
-#define ActRemID_Oth (ActChgNumRowFooGrp + 128)
-#define ActRemID_Std (ActChgNumRowFooGrp + 129)
-#define ActRemID_Tch (ActChgNumRowFooGrp + 130)
-#define ActNewID_Oth (ActChgNumRowFooGrp + 131)
-#define ActNewID_Std (ActChgNumRowFooGrp + 132)
-#define ActNewID_Tch (ActChgNumRowFooGrp + 133)
-#define ActFrmPwdOth (ActChgNumRowFooGrp + 134)
-#define ActFrmPwdStd (ActChgNumRowFooGrp + 135)
-#define ActFrmPwdTch (ActChgNumRowFooGrp + 136)
-#define ActChgPwdOth (ActChgNumRowFooGrp + 137)
-#define ActChgPwdStd (ActChgNumRowFooGrp + 138)
-#define ActChgPwdTch (ActChgNumRowFooGrp + 139)
-#define ActFrmMaiOth (ActChgNumRowFooGrp + 140)
-#define ActFrmMaiStd (ActChgNumRowFooGrp + 141)
-#define ActFrmMaiTch (ActChgNumRowFooGrp + 142)
-#define ActRemMaiOth (ActChgNumRowFooGrp + 143)
-#define ActRemMaiStd (ActChgNumRowFooGrp + 144)
-#define ActRemMaiTch (ActChgNumRowFooGrp + 145)
-#define ActNewMaiOth (ActChgNumRowFooGrp + 146)
-#define ActNewMaiStd (ActChgNumRowFooGrp + 147)
-#define ActNewMaiTch (ActChgNumRowFooGrp + 148)
+#define ActFrmIDsOth (ActChgNumRowFooGrp + 122)
+#define ActFrmIDsStd (ActChgNumRowFooGrp + 123)
+#define ActFrmIDsTch (ActChgNumRowFooGrp + 124)
+#define ActRemID_Oth (ActChgNumRowFooGrp + 125)
+#define ActRemID_Std (ActChgNumRowFooGrp + 126)
+#define ActRemID_Tch (ActChgNumRowFooGrp + 127)
+#define ActNewID_Oth (ActChgNumRowFooGrp + 128)
+#define ActNewID_Std (ActChgNumRowFooGrp + 129)
+#define ActNewID_Tch (ActChgNumRowFooGrp + 130)
+#define ActFrmPwdOth (ActChgNumRowFooGrp + 131)
+#define ActFrmPwdStd (ActChgNumRowFooGrp + 132)
+#define ActFrmPwdTch (ActChgNumRowFooGrp + 133)
+#define ActChgPwdOth (ActChgNumRowFooGrp + 134)
+#define ActChgPwdStd (ActChgNumRowFooGrp + 135)
+#define ActChgPwdTch (ActChgNumRowFooGrp + 136)
+#define ActFrmMaiOth (ActChgNumRowFooGrp + 137)
+#define ActFrmMaiStd (ActChgNumRowFooGrp + 138)
+#define ActFrmMaiTch (ActChgNumRowFooGrp + 139)
+#define ActRemMaiOth (ActChgNumRowFooGrp + 140)
+#define ActRemMaiStd (ActChgNumRowFooGrp + 141)
+#define ActRemMaiTch (ActChgNumRowFooGrp + 142)
+#define ActNewMaiOth (ActChgNumRowFooGrp + 143)
+#define ActNewMaiStd (ActChgNumRowFooGrp + 144)
+#define ActNewMaiTch (ActChgNumRowFooGrp + 145)
-#define ActRemStdCrs (ActChgNumRowFooGrp + 149)
-#define ActRemTchCrs (ActChgNumRowFooGrp + 150)
-#define ActRemUsrGbl (ActChgNumRowFooGrp + 151)
+#define ActRemStdCrs (ActChgNumRowFooGrp + 146)
+#define ActRemTchCrs (ActChgNumRowFooGrp + 147)
+#define ActRemUsrGbl (ActChgNumRowFooGrp + 148)
-#define ActReqRemAllStdCrs (ActChgNumRowFooGrp + 152)
-#define ActRemAllStdCrs (ActChgNumRowFooGrp + 153)
+#define ActReqRemAllStdCrs (ActChgNumRowFooGrp + 149)
+#define ActRemAllStdCrs (ActChgNumRowFooGrp + 150)
-#define ActReqRemOldUsr (ActChgNumRowFooGrp + 154)
-#define ActRemOldUsr (ActChgNumRowFooGrp + 155)
+#define ActReqRemOldUsr (ActChgNumRowFooGrp + 151)
+#define ActRemOldUsr (ActChgNumRowFooGrp + 152)
-#define ActLstDupUsr (ActChgNumRowFooGrp + 156)
-#define ActLstSimUsr (ActChgNumRowFooGrp + 157)
-#define ActRemDupUsr (ActChgNumRowFooGrp + 158)
+#define ActLstDupUsr (ActChgNumRowFooGrp + 153)
+#define ActLstSimUsr (ActChgNumRowFooGrp + 154)
+#define ActRemDupUsr (ActChgNumRowFooGrp + 155)
-#define ActLstClk (ActChgNumRowFooGrp + 159)
+#define ActLstClk (ActChgNumRowFooGrp + 156)
/*****************************************************************************/
/******************************** Social tab *********************************/
@@ -1547,6 +1544,8 @@ struct Act_Actions
/***************************** Public prototypes *****************************/
/*****************************************************************************/
+Act_Action_t Act_GetActionFromActCod (long ActCod);
+
bool Act_CheckIfIHavePermissionToExecuteAction (Act_Action_t Action);
const char *Act_GetTitleAction (Act_Action_t Action);
const char *Act_GetSubtitleAction (Act_Action_t Action);
diff --git a/swad_attendance.c b/swad_attendance.c
index e7347004..6422ea98 100644
--- a/swad_attendance.c
+++ b/swad_attendance.c
@@ -2067,7 +2067,7 @@ static void Att_WriteRowStdToCallTheRoll (unsigned NumStd,struct UsrData *UsrDat
UsrDat->Accepted ? "DAT_SMALL_N" :
"DAT_SMALL",
Gbl.RowEvenOdd);
- ID_WriteUsrIDs (UsrDat);
+ ID_WriteUsrIDs (UsrDat,NULL);
fprintf (Gbl.F.Out,"");
/***** Write student's name *****/
@@ -3298,7 +3298,7 @@ static void Att_WriteRowStdSeveralAttEvents (unsigned NumStd,struct UsrData *Usr
UsrDat->Accepted ? "DAT_SMALL_N" :
"DAT_SMALL",
Gbl.RowEvenOdd);
- ID_WriteUsrIDs (UsrDat);
+ ID_WriteUsrIDs (UsrDat,NULL);
fprintf (Gbl.F.Out,"");
/***** Write student's name *****/
@@ -3444,7 +3444,7 @@ static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat)
Gbl.RowEvenOdd,
UsrDat->Accepted ? "DAT_SMALL_N" :
"DAT_SMALL");
- ID_WriteUsrIDs (UsrDat);
+ ID_WriteUsrIDs (UsrDat,NULL);
fprintf (Gbl.F.Out,"");
/***** Write student's name *****/
diff --git a/swad_centre.c b/swad_centre.c
index e9553c48..c622dbdb 100644
--- a/swad_centre.c
+++ b/swad_centre.c
@@ -1813,7 +1813,7 @@ void Ctr_ChangeCtrInsInConfig (void)
void Ctr_ContEditAfterChgCtrInConfig (void)
{
/***** Write error/success message *****/
- Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+ Lay_ShowPendingAlert ();
/***** Show the form again *****/
Ctr_ShowConfiguration ();
@@ -2160,7 +2160,7 @@ void Ctr_ChangeCtrStatus (void)
void Ctr_ContEditAfterChgCtr (void)
{
/***** Write success / warning message *****/
- Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+ Lay_ShowPendingAlert ();
if (Gbl.AlertType == Lay_SUCCESS)
/***** Put button to go to centre changed *****/
diff --git a/swad_changelog.h b/swad_changelog.h
index 7457c5d5..15ea0943 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -234,13 +234,17 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 16.208.7 (2017-05-08)"
+#define Log_PLATFORM_VERSION "SWAD 16.209 (2017-05-08)"
#define CSS_FILE "swad16.208.7.css"
#define JS_FILE "swad16.206.3.js"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
/*
+ Version 16.209: May 09, 2017 Confirmation of user's ID is made directly, without confirmation. (218836 lines)
+ 1 change necessary in database:
+UPDATE actions SET Obsolete='Y' WHERE ActCod IN ('1565','1566','1567');
+
Version 16.208.7: May 09, 2017 Changes in layout of student records. (218771 lines)
Version 16.208.6: May 09, 2017 Changes in alerts.
Changes in layout of student records. (218744 lines)
diff --git a/swad_connected.c b/swad_connected.c
index 43cca439..8c6659e5 100644
--- a/swad_connected.c
+++ b/swad_connected.c
@@ -179,7 +179,6 @@ void Con_ShowLastClicks (void)
void Con_GetAndShowLastClicks (void)
{
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
- extern Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD];
extern const char *Txt_Click;
extern const char *Txt_ELAPSED_TIME;
extern const char *Txt_Role;
@@ -269,12 +268,12 @@ void Con_GetAndShowLastClicks (void)
ActCod = Str_ConvertStrCodToLongCod (row[1]);
/* Use a special color for this row depending on the action */
- ClassRow = (Act_Actions[Act_FromActCodToAction[ActCod]].BrowserWindow == Act_DOWNLD_FILE) ? "DAT_SMALL_YELLOW LEFT_MIDDLE" :
- (ActCod == Act_Actions[ActLogIn].ActCod ||
+ ClassRow = (Act_Actions[Act_GetActionFromActCod (ActCod)].BrowserWindow == Act_DOWNLD_FILE) ? "DAT_SMALL_YELLOW LEFT_MIDDLE" :
+ (ActCod == Act_Actions[ActLogIn ].ActCod ||
ActCod == Act_Actions[ActLogInNew].ActCod) ? "DAT_SMALL_GREEN" :
- (ActCod == Act_Actions[ActLogOut].ActCod ) ? "DAT_SMALL_RED" :
- (ActCod == Act_Actions[ActWebSvc].ActCod ) ? "DAT_SMALL_BLUE" :
- "DAT_SMALL_GREY";
+ (ActCod == Act_Actions[ActLogOut ].ActCod) ? "DAT_SMALL_RED" :
+ (ActCod == Act_Actions[ActWebSvc ].ActCod) ? "DAT_SMALL_BLUE" :
+ "DAT_SMALL_GREY";
/* Compute elapsed time from last access */
if (sscanf (row[2],"%ld",&TimeDiff) != 1)
diff --git a/swad_course.c b/swad_course.c
index d267f713..8ead30d7 100644
--- a/swad_course.c
+++ b/swad_course.c
@@ -2385,7 +2385,7 @@ void Crs_ChangeCrsDegInConfig (void)
void Crs_ContEditAfterChgCrsInConfig (void)
{
/***** Write error/success message *****/
- Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+ Lay_ShowPendingAlert ();
/***** Show the form again *****/
Crs_ShowIntroduction ();
@@ -2772,7 +2772,7 @@ void Crs_ContEditAfterChgCrs (void)
bool PutButtonToRequestRegistration;
/***** Write warning / success message *****/
- Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+ Lay_ShowPendingAlert ();
if (Gbl.AlertType == Lay_SUCCESS)
{
diff --git a/swad_degree.c b/swad_degree.c
index 4d8d084d..f546f5ee 100644
--- a/swad_degree.c
+++ b/swad_degree.c
@@ -2086,7 +2086,7 @@ void Deg_ChangeDegCtrInConfig (void)
void Deg_ContEditAfterChgDegInConfig (void)
{
/***** Write success / warning message *****/
- Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+ Lay_ShowPendingAlert ();
/***** Show the form again *****/
Deg_ShowConfiguration ();
@@ -2252,7 +2252,7 @@ void Deg_ChangeDegStatus (void)
void Deg_ContEditAfterChgDeg (void)
{
/***** Write success / warning message *****/
- Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+ Lay_ShowPendingAlert ();
if (Gbl.AlertType == Lay_SUCCESS)
/***** Put button to go to degree changed *****/
diff --git a/swad_enrolment.c b/swad_enrolment.c
index 261080ee..3062d909 100644
--- a/swad_enrolment.c
+++ b/swad_enrolment.c
@@ -3183,7 +3183,8 @@ static void Enr_ShowFormToEditOtherUsr (void)
fprintf (Gbl.F.Out,"");
/***** User's record *****/
- Rec_ShowSharedUsrRecord (Rec_SHA_OTHER_EXISTING_USR_FORM,&Gbl.Usrs.Other.UsrDat);
+ Rec_ShowSharedUsrRecord (Rec_SHA_OTHER_EXISTING_USR_FORM,
+ &Gbl.Usrs.Other.UsrDat,NULL);
}
/*****************************************************************************/
@@ -3633,13 +3634,13 @@ void Enr_CreateNewUsr1 (void)
void Enr_CreateNewUsr2 (void)
{
if (Gbl.AlertType == Lay_ERROR) // User's ID not valid
- Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+ Lay_ShowPendingAlert ();
else // User's ID valid
{
if (Gbl.CurrentCrs.Crs.CrsCod > 0) // Course selected
{
/***** Show optional alert *****/
- Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+ Lay_ShowPendingAlert ();
/***** Change user's groups *****/
if (Gbl.CurrentCrs.Grps.NumGrps) // This course has groups?
@@ -3786,7 +3787,7 @@ void Enr_ModifyUsr2 (void)
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
if (Gbl.AlertType == Lay_WARNING)
- Lay_ShowAlert (Gbl.AlertType,Txt_User_not_found_or_you_do_not_have_permission_);
+ Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
else // No error
switch (Gbl.Usrs.RegRemAction)
{
@@ -3794,7 +3795,7 @@ void Enr_ModifyUsr2 (void)
if (Gbl.CurrentCrs.Crs.CrsCod > 0)
{
/***** Show optional alert *****/
- Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+ Lay_ShowPendingAlert ();
/***** Change user's groups *****/
if (Gbl.CurrentCrs.Grps.NumGrps) // This course has groups?
diff --git a/swad_file_browser.c b/swad_file_browser.c
index 34d07338..3cf6ce69 100644
--- a/swad_file_browser.c
+++ b/swad_file_browser.c
@@ -3407,7 +3407,7 @@ static void Brw_ShowDataOwnerAsgWrk (struct UsrData *UsrDat)
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
/***** Show user's ID *****/
- ID_WriteUsrIDs (UsrDat);
+ ID_WriteUsrIDs (UsrDat,NULL);
/***** Show user's name *****/
fprintf (Gbl.F.Out,"
");
diff --git a/swad_follow.c b/swad_follow.c
index 825bea7a..0f6c1564 100644
--- a/swad_follow.c
+++ b/swad_follow.c
@@ -996,6 +996,7 @@ static void Fol_PutIconToUnfollow (struct UsrData *UsrDat)
void Fol_FollowUsr1 (void)
{
+ extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
char Query[256];
bool CreateNotif;
bool NotifyByEmail;
@@ -1033,7 +1034,10 @@ void Fol_FollowUsr1 (void)
Gbl.AlertType = Lay_SUCCESS;
}
else
+ {
Gbl.AlertType = Lay_WARNING;
+ sprintf (Gbl.Message,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
+ }
}
void Fol_FollowUsr2 (void)
@@ -1042,11 +1046,14 @@ void Fol_FollowUsr2 (void)
if (Gbl.AlertType == Lay_SUCCESS)
/***** Show user's profile again *****/
- Gbl.AlertType = Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat) ? Lay_SUCCESS :
- Lay_WARNING;
+ if (!Prf_ShowUserProfile (&Gbl.Usrs.Other.UsrDat))
+ {
+ Gbl.AlertType = Lay_WARNING;
+ sprintf (Gbl.Message,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
+ }
- if (Gbl.AlertType == Lay_WARNING)
- Lay_ShowAlert (Gbl.AlertType,Txt_User_not_found_or_you_do_not_have_permission_);
+ if (Gbl.AlertType != Lay_SUCCESS)
+ Lay_ShowPendingAlert ();
}
/*****************************************************************************/
@@ -1055,6 +1062,7 @@ void Fol_FollowUsr2 (void)
void Fol_UnfollowUsr1 (void)
{
+ extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
char Query[256];
/***** Get user to be unfollowed *****/
@@ -1074,13 +1082,14 @@ void Fol_UnfollowUsr1 (void)
Gbl.AlertType = Lay_SUCCESS;
}
else
+ {
Gbl.AlertType = Lay_WARNING;
+ sprintf (Gbl.Message,"%s",Txt_User_not_found_or_you_do_not_have_permission_);
+ }
}
void Fol_UnfollowUsr2 (void)
{
- extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
-
/***** Get user to be unfollowed *****/
if (Gbl.AlertType == Lay_SUCCESS)
{
@@ -1092,7 +1101,7 @@ void Fol_UnfollowUsr2 (void)
Fol_ListFollowingUsr (&Gbl.Usrs.Me.UsrDat); // List users I follow
}
else
- Lay_ShowAlert (Gbl.AlertType,Txt_User_not_found_or_you_do_not_have_permission_);
+ Lay_ShowPendingAlert ();
}
/*****************************************************************************/
diff --git a/swad_global.c b/swad_global.c
index e79af0eb..7af387b4 100644
--- a/swad_global.c
+++ b/swad_global.c
@@ -179,7 +179,8 @@ void Gbl_InitializeGlobals (void)
Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail[0] = '\0';
Usr_UsrDataConstructor (&Gbl.Usrs.Other.UsrDat);
- Gbl.Action.Act = ActUnk;
+ Gbl.Action.Act = ActUnk;
+ Gbl.Action.Original = ActUnk; // Used in some actions to know what action gave rise to the current action
Gbl.Action.UsesAJAX = false;
Gbl.Action.IsAJAXAutoRefresh = false;
Gbl.Action.Tab = TabUnk;
diff --git a/swad_global.h b/swad_global.h
index 662cfc18..407320ac 100644
--- a/swad_global.h
+++ b/swad_global.h
@@ -175,6 +175,7 @@ struct Globals
{
Tab_Tab_t Tab;
Act_Action_t Act;
+ Act_Action_t Original; // Used in some actions to know what action gave rise to the current action
bool UsesAJAX; // Do not generate full HTML page, only the content of a div
bool IsAJAXAutoRefresh; // It's an automatic refresh drom time to time
} Action;
@@ -372,7 +373,6 @@ struct Globals
struct ListUsrs LstUsrs[Rol_NUM_ROLES];
struct
{
- // bool MultipleUsrs; // Listing multiple users?
char *All;
char *Std;
char *Tch;
diff --git a/swad_holiday.c b/swad_holiday.c
index e0d0ff57..964dbd99 100644
--- a/swad_holiday.c
+++ b/swad_holiday.c
@@ -659,7 +659,7 @@ void Hld_RemoveHoliday1 (void)
void Hld_RemoveHoliday2 (void)
{
/***** Show success message *****/
- Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+ Lay_ShowPendingAlert ();
/***** Show the form again *****/
Hld_EditHolidays ();
@@ -709,7 +709,7 @@ void Hld_ChangeHolidayPlace1 (void)
void Hld_ChangeHolidayPlace2 (void)
{
/***** Show success message *****/
- Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+ Lay_ShowPendingAlert ();
/***** Show the form again *****/
Hld_EditHolidays ();
@@ -753,7 +753,7 @@ void Hld_ChangeHolidayType1 (void)
void Hld_ChangeHolidayType2 (void)
{
/***** Show success message *****/
- Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+ Lay_ShowPendingAlert ();
/***** Show the form again *****/
Hld_EditHolidays ();
@@ -857,7 +857,7 @@ static void Hld_ChangeDate (Hld_StartOrEndDate_t StartOrEndDate)
void Hld_ChangeDate2 (void)
{
/***** Show success message *****/
- Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+ Lay_ShowPendingAlert ();
/***** Show the form again *****/
Hld_EditHolidays ();
@@ -926,7 +926,7 @@ void Hld_RenameHoliday1 (void)
void Hld_RenameHoliday2 (void)
{
/***** Write error/success message *****/
- Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+ Lay_ShowPendingAlert ();
/***** Show the form again *****/
Hld_EditHolidays ();
@@ -1161,7 +1161,7 @@ void Hld_RecFormNewHoliday1 (void)
void Hld_RecFormNewHoliday2 (void)
{
/***** Write error/success message *****/
- Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+ Lay_ShowPendingAlert ();
/***** Show the form again *****/
Hld_EditHolidays ();
diff --git a/swad_institution.c b/swad_institution.c
index 76738979..794ecff4 100644
--- a/swad_institution.c
+++ b/swad_institution.c
@@ -1922,7 +1922,7 @@ void Ins_ChangeInsCtyInConfig (void)
void Ins_ContEditAfterChgInsInConfig (void)
{
/***** Write success / warning message *****/
- Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+ Lay_ShowPendingAlert ();
/***** Show the form again *****/
Ins_ShowConfiguration ();
@@ -2088,7 +2088,7 @@ void Ins_ChangeInsStatus (void)
void Ins_ContEditAfterChgIns (void)
{
/***** Write success / warning message *****/
- Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+ Lay_ShowPendingAlert ();
if (Gbl.AlertType == Lay_SUCCESS)
/***** Put button to go to institution changed *****/
diff --git a/swad_layout.c b/swad_layout.c
index 936e399e..a13944c9 100644
--- a/swad_layout.c
+++ b/swad_layout.c
@@ -1660,6 +1660,18 @@ void Lay_ShowErrorAndExit (const char *Message)
exit (0);
}
+/*****************************************************************************/
+/*********************** Show a write-pending alert **************************/
+/*****************************************************************************/
+// Gbl.AlertType must be Lay_NONE or any type of alert
+// If Gbl.AlertType != Lay_NONE ==> Gbl.Message must hold the message
+
+void Lay_ShowPendingAlert (void)
+ {
+ if (Gbl.AlertType != Lay_NONE)
+ Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
+ }
+
/*****************************************************************************/
/******************** Show an alert message to the user **********************/
/*****************************************************************************/
diff --git a/swad_layout.h b/swad_layout.h
index 3dc13079..65259e14 100644
--- a/swad_layout.h
+++ b/swad_layout.h
@@ -131,6 +131,7 @@ void Lay_StartTableWideMargin (unsigned CellPadding);
void Lay_EndTable (void);
void Lay_ShowErrorAndExit (const char *Message);
+void Lay_ShowPendingAlert (void);
void Lay_ShowAlert (Lay_AlertType_t AlertType,const char *Message);
void Lay_ShowAlertAndButton1 (Lay_AlertType_t AlertType,const char *Message);
void Lay_ShowAlertAndButton2 (Act_Action_t NextAction,const char *Anchor,
diff --git a/swad_mail.c b/swad_mail.c
index 9433986b..a942f13a 100644
--- a/swad_mail.c
+++ b/swad_mail.c
@@ -1162,7 +1162,8 @@ void Mai_ShowFormOthEmail (void)
Lay_StartRoundFrame (NULL,Txt_Email,NULL,NULL);
/***** Show user's record *****/
- Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,&Gbl.Usrs.Other.UsrDat);
+ Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,
+ &Gbl.Usrs.Other.UsrDat,NULL);
/***** Form with the user's email *****/
Lay_StartTableCenter (2);
@@ -1359,7 +1360,8 @@ void Mai_RemoveOtherUsrEmail (void)
Mai_RemoveEmail (&Gbl.Usrs.Other.UsrDat);
/***** Show user's record *****/
- Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,&Gbl.Usrs.Other.UsrDat);
+ Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,
+ &Gbl.Usrs.Other.UsrDat,NULL);
}
else // User not found
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
@@ -1438,7 +1440,8 @@ void Mai_NewOtherUsrEmail (void)
(Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod)); // It's me?
/***** Show user's record *****/
- Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,&Gbl.Usrs.Other.UsrDat);
+ Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,
+ &Gbl.Usrs.Other.UsrDat,NULL);
}
else // User not found
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
diff --git a/swad_message.c b/swad_message.c
index 8a253f62..d2e938e3 100644
--- a/swad_message.c
+++ b/swad_message.c
@@ -402,7 +402,7 @@ static void Msg_ShowOneUniqueRecipient (void)
fprintf (Gbl.F.Out,"