Version 15.115

This commit is contained in:
Antonio Cañas Vargas 2016-01-17 15:10:54 +01:00
parent c2c6088807
commit 62e15884a8
38 changed files with 1478 additions and 1474 deletions

View File

@ -573,7 +573,7 @@ function readOldTimelineData () {
timeline.appendChild(oldTimeline.firstChild); timeline.appendChild(oldTimeline.firstChild);
} }
if (countOldTimeline < 10) // Set to Soc_MAX_OLD_PUBS_TO_GET_AND_SHOW if (countOldTimeline < 20) // Set to Soc_MAX_OLD_PUBS_TO_GET_AND_SHOW
// No more old publishings // No more old publishings
document.getElementById("view_old_posts_container").style.display = 'none'; document.getElementById("view_old_posts_container").style.display = 'none';
} }

File diff suppressed because it is too large Load Diff

View File

@ -85,11 +85,14 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica
#define ActUnk 1 #define ActUnk 1
#define ActHom 2 #define ActHom 2
#define ActMnu 3 #define ActMnu 3
// The following 5 actions use AJAX to refresh only a part of the page
#define ActRefCon 4 #define ActRefCon 4
#define ActRefLstClk 5 #define ActRefLstClk 5
#define ActRefNewSocPubGbl 6 #define ActRefNewSocPubGbl 6
#define ActRefOldSocPubUsr 7 #define ActRefOldSocPubGbl 7
#define ActRefOldSocPubGbl 8 #define ActRefOldSocPubUsr 8
#define ActWebSvc 9 #define ActWebSvc 9
/*****************************************************************************/ /*****************************************************************************/

View File

@ -2917,10 +2917,10 @@ static void Att_PutButtonToShowDetails (void)
/***** Button to show more details *****/ /***** Button to show more details *****/
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\">"); fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\">");
Act_FormStart (Gbl.CurrentAct); Act_FormStart (Gbl.Action.Act);
Par_PutHiddenParamChar ("ShowDetails",'Y'); Par_PutHiddenParamChar ("ShowDetails",'Y');
Grp_PutParamsCodGrps (); Grp_PutParamsCodGrps ();
Usr_PutHiddenParUsrCodAll (Gbl.CurrentAct,Gbl.Usrs.Select.All); Usr_PutHiddenParUsrCodAll (Gbl.Action.Act,Gbl.Usrs.Select.All);
if (Gbl.AttEvents.StrAttCodsSelected[0]) if (Gbl.AttEvents.StrAttCodsSelected[0])
Par_PutHiddenParamString ("AttCods",Gbl.AttEvents.StrAttCodsSelected); Par_PutHiddenParamString ("AttCods",Gbl.AttEvents.StrAttCodsSelected);
Lay_PutConfirmButton (Txt_Show_more_details); Lay_PutConfirmButton (Txt_Show_more_details);
@ -2948,9 +2948,9 @@ static void Att_ListEventsToSelect (Att_TypeOfView_t TypeOfView)
depending on the events selected *****/ depending on the events selected *****/
if (TypeOfView == Att_NORMAL_VIEW) if (TypeOfView == Att_NORMAL_VIEW)
{ {
Act_FormStart (Gbl.CurrentAct); Act_FormStart (Gbl.Action.Act);
Grp_PutParamsCodGrps (); Grp_PutParamsCodGrps ();
Usr_PutHiddenParUsrCodAll (Gbl.CurrentAct,Gbl.Usrs.Select.All); Usr_PutHiddenParUsrCodAll (Gbl.Action.Act,Gbl.Usrs.Select.All);
} }
/***** Start frame *****/ /***** Start frame *****/

View File

@ -234,7 +234,7 @@ void Cal_DrawCalendar (void)
extern const char *Txt_Print; extern const char *Txt_Print;
extern const char *Txt_STR_LANG_ID[1+Txt_NUM_LANGUAGES]; extern const char *Txt_STR_LANG_ID[1+Txt_NUM_LANGUAGES];
char Params[256+256+Ses_LENGTH_SESSION_ID+256]; char Params[256+256+Ses_LENGTH_SESSION_ID+256];
bool PrintView = (Gbl.CurrentAct == ActPrnCal); bool PrintView = (Gbl.Action.Act == ActPrnCal);
/***** Get list of holidays *****/ /***** Get list of holidays *****/
if (!Gbl.Hlds.LstIsRead) if (!Gbl.Hlds.LstIsRead)
@ -280,7 +280,7 @@ void Cal_DrawCalendar (void)
Gbl.Prefs.FirstDayOfWeek, Gbl.Prefs.FirstDayOfWeek,
(long) Gbl.StartExecutionTimeUTC, (long) Gbl.StartExecutionTimeUTC,
Gbl.CurrentCtr.Ctr.PlcCod, Gbl.CurrentCtr.Ctr.PlcCod,
(Gbl.CurrentAct == ActPrnCal) ? "true" : (Gbl.Action.Act == ActPrnCal) ? "true" :
"false", "false",
Cfg_HTTPS_URL_SWAD_CGI, Cfg_HTTPS_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language]); Txt_STR_LANG_ID[Gbl.Prefs.Language]);

View File

@ -114,24 +114,29 @@
// TODO: FIX BUG: In results of search of students, no mark of confirmation is shown even if the student really has confirmed his/her registration in the course // TODO: FIX BUG: In results of search of students, no mark of confirmation is shown even if the student really has confirmed his/her registration in the course
// TODO: Forum SWAD should be always named "SWAD"? // TODO: Forum SWAD should be always named "SWAD"?
// TODO: Enable chat for guests? // TODO: Enable chat for guests?
// TODO: Go to forum post (or at least to forum thread) from social timeline? // TODO: Go to forum post (or at least to forum thread) from social timeline and notifications?
// TODO: Width of column for data in notifications is too short // TODO: Width of column for data in notifications is too short
// TODO: Increment one second after each refresh in social timeline? // TODO: Increment one second after each refresh in social timeline?
// TODO: Add a new type of visibility of profile "unknown". Keep the same for photos?
/*****************************************************************************/ /*****************************************************************************/
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.114.4 (2016-01-17)" #define Log_PLATFORM_VERSION "SWAD 15.115 (2016-01-17)"
#define CSS_FILE "swad15.113.8.css" #define CSS_FILE "swad15.115.css"
#define JS_FILE "swad15.113.8.js" #define JS_FILE "swad15.115.js"
// Number of lines (includes comments but not blank lines) has been got with the following command: // 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 // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/* /*
Version 15.114.4: Jan 17, 2016 Change related to button to remove a social post. (? lines) Version 15.115: Jan 17, 2016 Code refactoring in actions. (192823 lines)
2 changes necessary in database:
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1509','es','N','Refrescar timeline global (nuevos mensajes)');
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1510','es','N','Cargar mensajes anteriores en timeline global');
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1511','es','N','Cargar mensajes anteriores en timeline usuario');
Version 15.114.5: Jan 17, 2016 Distinct default visibility for photo and profile. (192827 lines)
Version 15.114.4: Jan 17, 2016 Change related to button to remove a social post. (192821 lines)
Version 15.114.3: Jan 17, 2016 Fixed bug when getting timeline. (192820 lines) Version 15.114.3: Jan 17, 2016 Fixed bug when getting timeline. (192820 lines)
Version 15.114.2: Jan 17, 2016 Fixed bug when getting timeline. (192811 lines) Version 15.114.2: Jan 17, 2016 Fixed bug when getting timeline. (192811 lines)
Version 15.114.1: Jan 17, 2016 Optimized queries to get timeline. (192790 lines) Version 15.114.1: Jan 17, 2016 Optimized queries to get timeline. (192790 lines)

View File

@ -665,7 +665,7 @@ void Cty_ListCountries2 (void)
Lay_EndRoundFrameTable (); Lay_EndRoundFrameTable ();
/***** Div for Google Geochart *****/ /***** Div for Google Geochart *****/
if (Gbl.CurrentAct == ActSeeCty) if (Gbl.Action.Act == ActSeeCty)
{ {
fprintf (Gbl.F.Out,"<div id=\"chart_div\"" fprintf (Gbl.F.Out,"<div id=\"chart_div\""
" style=\"width:500px; margin:12px auto;\">" " style=\"width:500px; margin:12px auto;\">"

View File

@ -976,7 +976,7 @@ void Deg_InitCurrentCourse (void)
} }
/***** Once we know course code, adjust action and tab *****/ /***** Once we know course code, adjust action and tab *****/
// if (Gbl.CurrentAct != ActMnu) // if (Gbl.Action.Act != ActMnu)
// Lay_SetCurrentTab (); // Use the tab associated to current action // Lay_SetCurrentTab (); // Use the tab associated to current action
/***** Initialize default fields for edition to current values *****/ /***** Initialize default fields for edition to current values *****/

View File

@ -1482,7 +1482,7 @@ void Brw_GetParAndInitFileBrowser (void)
Brw_GetDataCurrentGrp (); Brw_GetDataCurrentGrp ();
/***** Get type of file browser *****/ /***** Get type of file browser *****/
switch (Gbl.CurrentAct) switch (Gbl.Action.Act)
{ {
/***** Documents of institution *****/ /***** Documents of institution *****/
case ActSeeAdmDocIns: // Access to a documents zone from menu case ActSeeAdmDocIns: // Access to a documents zone from menu
@ -2045,7 +2045,7 @@ void Brw_GetParAndInitFileBrowser (void)
break; break;
} }
switch (Gbl.CurrentAct) switch (Gbl.Action.Act)
{ {
case ActCreFolDocIns: case ActRenFolDocIns: case ActCreFolDocIns: case ActRenFolDocIns:
case ActCreFolShaIns: case ActRenFolShaIns: case ActCreFolShaIns: case ActRenFolShaIns:
@ -2151,7 +2151,7 @@ static long Brw_GetGrpSettings (void)
} }
else // Parameter GrpCod not found! else // Parameter GrpCod not found!
/***** Try to get group code from database *****/ /***** Try to get group code from database *****/
switch (Gbl.CurrentAct) switch (Gbl.Action.Act)
{ {
case ActSeeAdmDocCrsGrp: case ActSeeAdmDocCrsGrp:
case ActSeeDocGrp: case ActSeeDocGrp:
@ -2182,7 +2182,7 @@ static void Brw_GetDataCurrentGrp (void)
GrpDat.GrpCod = Gbl.CurrentCrs.Grps.GrpCod; GrpDat.GrpCod = Gbl.CurrentCrs.Grps.GrpCod;
Grp_GetDataOfGroupByCod (&GrpDat); Grp_GetDataOfGroupByCod (&GrpDat);
switch (Gbl.CurrentAct) switch (Gbl.Action.Act)
{ {
case ActSeeAdmDocCrsGrp:// Access to see/admin a documents zone from menu case ActSeeAdmDocCrsGrp:// Access to see/admin a documents zone from menu
case ActChgToSeeDocCrs:// Access to see a documents zone case ActChgToSeeDocCrs:// Access to see a documents zone
@ -3460,7 +3460,7 @@ static void Brw_WriteTopBeforeShowingFileBrowser (void)
Brw_PutFormToShowOrAdmin (Brw_SHOW,ActSeeMrkGrp); Brw_PutFormToShowOrAdmin (Brw_SHOW,ActSeeMrkGrp);
break; break;
case Brw_ADMI_BRIEF_USR: case Brw_ADMI_BRIEF_USR:
if (Gbl.CurrentAct != ActAskRemOldBrf) if (Gbl.Action.Act != ActAskRemOldBrf)
Brw_PutFormToAskRemOldFiles (); Brw_PutFormToAskRemOldFiles ();
break; break;
default: default:
@ -3511,34 +3511,34 @@ static void Brw_UpdateLastAccess (void)
{ {
case Brw_SHOW_DOCUM_CRS: case Brw_SHOW_DOCUM_CRS:
case Brw_ADMI_DOCUM_CRS: case Brw_ADMI_DOCUM_CRS:
if (Gbl.CurrentAct == ActChgToSeeDocCrs || if (Gbl.Action.Act == ActChgToSeeDocCrs ||
Gbl.CurrentAct == ActChgToAdmDocCrs)// Update group of last access to a documents zone only when user changes zone Gbl.Action.Act == ActChgToAdmDocCrs)// Update group of last access to a documents zone only when user changes zone
Brw_UpdateGrpLastAccZone ("LastDowGrpCod",-1L); Brw_UpdateGrpLastAccZone ("LastDowGrpCod",-1L);
break; break;
case Brw_SHOW_DOCUM_GRP: case Brw_SHOW_DOCUM_GRP:
case Brw_ADMI_DOCUM_GRP: case Brw_ADMI_DOCUM_GRP:
if (Gbl.CurrentAct == ActChgToSeeDocCrs || if (Gbl.Action.Act == ActChgToSeeDocCrs ||
Gbl.CurrentAct == ActChgToAdmDocCrs)// Update group of last access to a documents zone only when user changes zone Gbl.Action.Act == ActChgToAdmDocCrs)// Update group of last access to a documents zone only when user changes zone
Brw_UpdateGrpLastAccZone ("LastDowGrpCod",Gbl.CurrentCrs.Grps.GrpCod); Brw_UpdateGrpLastAccZone ("LastDowGrpCod",Gbl.CurrentCrs.Grps.GrpCod);
break; break;
case Brw_ADMI_SHARE_CRS: case Brw_ADMI_SHARE_CRS:
if (Gbl.CurrentAct == ActChgToAdmSha) // Update group of last access to a shared files zone only when user changes zone if (Gbl.Action.Act == ActChgToAdmSha) // Update group of last access to a shared files zone only when user changes zone
Brw_UpdateGrpLastAccZone ("LastComGrpCod",-1L); Brw_UpdateGrpLastAccZone ("LastComGrpCod",-1L);
break; break;
case Brw_ADMI_SHARE_GRP: case Brw_ADMI_SHARE_GRP:
if (Gbl.CurrentAct == ActChgToAdmSha) // Update group of last access to a shared files zone only when user changes zone if (Gbl.Action.Act == ActChgToAdmSha) // Update group of last access to a shared files zone only when user changes zone
Brw_UpdateGrpLastAccZone ("LastComGrpCod",Gbl.CurrentCrs.Grps.GrpCod); Brw_UpdateGrpLastAccZone ("LastComGrpCod",Gbl.CurrentCrs.Grps.GrpCod);
break; break;
case Brw_SHOW_MARKS_CRS: case Brw_SHOW_MARKS_CRS:
case Brw_ADMI_MARKS_CRS: case Brw_ADMI_MARKS_CRS:
if (Gbl.CurrentAct == ActChgToSeeMrk || if (Gbl.Action.Act == ActChgToSeeMrk ||
Gbl.CurrentAct == ActChgToAdmMrk) // Update group of last access to a marks zone only when user changes zone Gbl.Action.Act == ActChgToAdmMrk) // Update group of last access to a marks zone only when user changes zone
Brw_UpdateGrpLastAccZone ("LastAssGrpCod",-1L); Brw_UpdateGrpLastAccZone ("LastAssGrpCod",-1L);
break; break;
case Brw_SHOW_MARKS_GRP: case Brw_SHOW_MARKS_GRP:
case Brw_ADMI_MARKS_GRP: case Brw_ADMI_MARKS_GRP:
if (Gbl.CurrentAct == ActChgToSeeMrk || if (Gbl.Action.Act == ActChgToSeeMrk ||
Gbl.CurrentAct == ActChgToAdmMrk) // Update group of last access to a marks zone only when user changes zone Gbl.Action.Act == ActChgToAdmMrk) // Update group of last access to a marks zone only when user changes zone
Brw_UpdateGrpLastAccZone ("LastAssGrpCod",Gbl.CurrentCrs.Grps.GrpCod); Brw_UpdateGrpLastAccZone ("LastAssGrpCod",Gbl.CurrentCrs.Grps.GrpCod);
break; break;
default: default:
@ -9424,7 +9424,7 @@ static bool Brw_CheckIfICanEditFileMetadata (long PublisherUsrCod)
{ {
long ZoneUsrCod; long ZoneUsrCod;
switch (Gbl.CurrentAct) // Only in actions where edition is allowed switch (Gbl.Action.Act) // Only in actions where edition is allowed
{ {
case ActReqDatAdmDocIns: case ActChgDatAdmDocIns: case ActReqDatAdmDocIns: case ActChgDatAdmDocIns:
case ActReqDatShaIns: case ActChgDatShaIns: case ActReqDatShaIns: case ActChgDatShaIns:

View File

@ -232,12 +232,12 @@ static void Fol_ShowNumberOfFollowingOrFollowers (const struct UsrData *UsrDat,
Act_FormStartAnchor (Action,"follow_section"); Act_FormStartAnchor (Action,"follow_section");
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
Act_LinkFormSubmit (Title, Act_LinkFormSubmit (Title,
(Gbl.CurrentAct == Action) ? "FOLLOW_NUM_B" : (Gbl.Action.Act == Action) ? "FOLLOW_NUM_B" :
"FOLLOW_NUM"); "FOLLOW_NUM");
} }
else else
fprintf (Gbl.F.Out,"<span class=\"%s\">", fprintf (Gbl.F.Out,"<span class=\"%s\">",
(Gbl.CurrentAct == Action) ? "FOLLOW_NUM_B" : (Gbl.Action.Act == Action) ? "FOLLOW_NUM_B" :
"FOLLOW_NUM"); "FOLLOW_NUM");
fprintf (Gbl.F.Out,"%u",NumUsrs); fprintf (Gbl.F.Out,"%u",NumUsrs);
if (NumUsrs) if (NumUsrs)
@ -250,7 +250,7 @@ static void Fol_ShowNumberOfFollowingOrFollowers (const struct UsrData *UsrDat,
/***** Text *****/ /***** Text *****/
fprintf (Gbl.F.Out,"<div class=\"%s\">", fprintf (Gbl.F.Out,"<div class=\"%s\">",
(Gbl.CurrentAct == Action) ? The_ClassFormBold[Gbl.Prefs.Theme] : (Gbl.Action.Act == Action) ? The_ClassFormBold[Gbl.Prefs.Theme] :
The_ClassForm[Gbl.Prefs.Theme]); The_ClassForm[Gbl.Prefs.Theme]);
if (NumUsrs) if (NumUsrs)
{ {
@ -258,7 +258,7 @@ static void Fol_ShowNumberOfFollowingOrFollowers (const struct UsrData *UsrDat,
Act_FormStartAnchor (Action,"follow_section"); Act_FormStartAnchor (Action,"follow_section");
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
Act_LinkFormSubmit (Title, Act_LinkFormSubmit (Title,
(Gbl.CurrentAct == Action) ? The_ClassFormBold[Gbl.Prefs.Theme] : (Gbl.Action.Act == Action) ? The_ClassFormBold[Gbl.Prefs.Theme] :
The_ClassForm[Gbl.Prefs.Theme]); The_ClassForm[Gbl.Prefs.Theme]);
} }
fprintf (Gbl.F.Out,"%s",Title); fprintf (Gbl.F.Out,"%s",Title);

View File

@ -1439,7 +1439,7 @@ void For_SetForumTypeAndRestrictAccess (void)
extern const char *Txt_You_dont_have_permission_to_access_to_this_forum; extern const char *Txt_You_dont_have_permission_to_access_to_this_forum;
bool ICanSeeForum = false; bool ICanSeeForum = false;
switch (Gbl.CurrentAct) switch (Gbl.Action.Act)
{ {
case ActSeeForSWAUsr: case ActSeePstForSWAUsr: case ActSeeForSWAUsr: case ActSeePstForSWAUsr:
case ActRcvThrForSWAUsr: case ActRcvRepForSWAUsr: case ActRcvThrForSWAUsr: case ActRcvRepForSWAUsr:
@ -3757,12 +3757,12 @@ void For_RecForumPst (void)
For_SetForumTypeAndRestrictAccess (); For_SetForumTypeAndRestrictAccess ();
/***** Get the code of the thread y the número of page *****/ /***** Get the code of the thread y the número of page *****/
if (Gbl.CurrentAct == ActRcvRepForCrsUsr || Gbl.CurrentAct == ActRcvRepForCrsTch || if (Gbl.Action.Act == ActRcvRepForCrsUsr || Gbl.Action.Act == ActRcvRepForCrsTch ||
Gbl.CurrentAct == ActRcvRepForDegUsr || Gbl.CurrentAct == ActRcvRepForDegTch || Gbl.Action.Act == ActRcvRepForDegUsr || Gbl.Action.Act == ActRcvRepForDegTch ||
Gbl.CurrentAct == ActRcvRepForCtrUsr || Gbl.CurrentAct == ActRcvRepForCtrTch || Gbl.Action.Act == ActRcvRepForCtrUsr || Gbl.Action.Act == ActRcvRepForCtrTch ||
Gbl.CurrentAct == ActRcvRepForInsUsr || Gbl.CurrentAct == ActRcvRepForInsTch || Gbl.Action.Act == ActRcvRepForInsUsr || Gbl.Action.Act == ActRcvRepForInsTch ||
Gbl.CurrentAct == ActRcvRepForGenUsr || Gbl.CurrentAct == ActRcvRepForGenTch || Gbl.Action.Act == ActRcvRepForGenUsr || Gbl.Action.Act == ActRcvRepForGenTch ||
Gbl.CurrentAct == ActRcvRepForSWAUsr || Gbl.CurrentAct == ActRcvRepForSWATch) Gbl.Action.Act == ActRcvRepForSWAUsr || Gbl.Action.Act == ActRcvRepForSWATch)
{ {
PstIsAReply = true; PstIsAReply = true;

View File

@ -178,8 +178,9 @@ void Gbl_InitializeGlobals (void)
Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail[0] = '\0'; Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail[0] = '\0';
Usr_UsrDataConstructor (&Gbl.Usrs.Other.UsrDat); Usr_UsrDataConstructor (&Gbl.Usrs.Other.UsrDat);
Gbl.CurrentAct = ActUnk; Gbl.Action.Act = ActUnk;
Gbl.CurrentTab = TabUnk; Gbl.Action.UsesAJAX = false;
Gbl.Action.Tab = TabUnk;
Gbl.Usrs.LstGsts.NumUsrs = 0; Gbl.Usrs.LstGsts.NumUsrs = 0;
Gbl.Usrs.LstGsts.Lst = NULL; Gbl.Usrs.LstGsts.Lst = NULL;
@ -437,13 +438,9 @@ void Gbl_InitializeGlobals (void)
void Gbl_Cleanup (void) void Gbl_Cleanup (void)
{ {
if (Gbl.CurrentAct != ActRefCon && if (!Gbl.Action.UsesAJAX &&
Gbl.CurrentAct != ActRefLstClk &&
Gbl.CurrentAct != ActRefNewSocPubGbl &&
Gbl.CurrentAct != ActRefOldSocPubUsr &&
Gbl.CurrentAct != ActRefOldSocPubGbl &&
!Gbl.WebService.IsWebService && !Gbl.WebService.IsWebService &&
Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW && Act_Actions[Gbl.Action.Act].BrowserWindow == Act_MAIN_WINDOW &&
!Gbl.HiddenParamsInsertedIntoDB) !Gbl.HiddenParamsInsertedIntoDB)
Ses_RemoveHiddenParFromThisSession (); Ses_RemoveHiddenParFromThisSession ();
Usr_UsrDataDestructor (&Gbl.Usrs.Me.UsrDat); Usr_UsrDataDestructor (&Gbl.Usrs.Me.UsrDat);

View File

@ -154,8 +154,12 @@ struct Globals
} Session; } Session;
bool YearOK; bool YearOK;
Act_Tab_t CurrentTab; struct
Act_Action_t CurrentAct; {
Act_Tab_t Tab;
Act_Action_t Act;
bool UsesAJAX;
} Action;
time_t StartExecutionTimeUTC; time_t StartExecutionTimeUTC;
struct tm *tblock; struct tm *tblock;
struct DateTime Now; struct DateTime Now;

View File

@ -4210,7 +4210,7 @@ void Grp_GetParamWhichGrps (void)
Gbl.CurrentCrs.Grps.WhichGrps = (Grp_WhichGroups_t) UnsignedNum; Gbl.CurrentCrs.Grps.WhichGrps = (Grp_WhichGroups_t) UnsignedNum;
} }
else // This parameter does not exist ==> set default value else // This parameter does not exist ==> set default value
switch (Gbl.CurrentAct) switch (Gbl.Action.Act)
{ {
case ActSeeCrsTT: case ActSeeCrsTT:
case ActPrnCrsTT: case ActPrnCrsTT:

View File

@ -134,7 +134,7 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
"BT_CONFIRM",Txt_Register_students); "BT_CONFIRM",Txt_Register_students);
} }
if (Gbl.CurrentAct != ActMyCrs) // I am not seeing the action to list my courses if (Gbl.Action.Act != ActMyCrs) // I am not seeing the action to list my courses
/* Request list my courses */ /* Request list my courses */
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Txt_Go_to_one_of_my_courses, Hlp_ShowRowHelpWhatWouldYouLikeToDo (Txt_Go_to_one_of_my_courses,
ActMyCrs, ActMyCrs,
@ -192,9 +192,9 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
{ {
if (Gbl.Usrs.Me.IBelongToCurrentCrs) // I belong to this course if (Gbl.Usrs.Me.IBelongToCurrentCrs) // I belong to this course
{ {
if (Gbl.CurrentAct != ActAutUsrInt && if (Gbl.Action.Act != ActAutUsrInt &&
Gbl.CurrentAct != ActAutUsrExt && Gbl.Action.Act != ActAutUsrExt &&
Gbl.CurrentAct != ActAutUsrChgLan) // I am not just logged Gbl.Action.Act != ActAutUsrChgLan) // I am not just logged
{ {
/* Request my removing from this course */ /* Request my removing from this course */
sprintf (Gbl.Title,Txt_Remove_me_from_the_course_X, sprintf (Gbl.Title,Txt_Remove_me_from_the_course_X,

View File

@ -484,7 +484,7 @@ static void Ind_PutButtonToConfirmIWantToSeeBigList (unsigned NumCrss)
Lay_ShowAlert (Lay_WARNING,Gbl.Message); Lay_ShowAlert (Lay_WARNING,Gbl.Message);
/***** Put form to confirm that I want to see the big list *****/ /***** Put form to confirm that I want to see the big list *****/
Act_FormStart (Gbl.CurrentAct); Act_FormStart (Gbl.Action.Act);
Sco_PutParamScope (Gbl.Scope.Current); Sco_PutParamScope (Gbl.Scope.Current);
Par_PutHiddenParamLong ("OthDegTypCod",Gbl.Stat.DegTypCod); Par_PutHiddenParamLong ("OthDegTypCod",Gbl.Stat.DegTypCod);
Par_PutHiddenParamLong ("DptCod",Gbl.Stat.DptCod); Par_PutHiddenParamLong ("DptCod",Gbl.Stat.DptCod);

View File

@ -1112,12 +1112,12 @@ void Inf_FormToSendURL (Inf_InfoSrc_t InfoSrc,Inf_InfoType_t InfoType)
} }
/*****************************************************************************/ /*****************************************************************************/
/******** Returns bibliography, assessment, etc. from Gbl.CurrentAct *********/ /******** Returns bibliography, assessment, etc. from Gbl.Action.Act *********/
/*****************************************************************************/ /*****************************************************************************/
Inf_InfoType_t Inf_AsignInfoType (void) Inf_InfoType_t Inf_AsignInfoType (void)
{ {
switch (Gbl.CurrentAct) switch (Gbl.Action.Act)
{ {
case ActSeeCrsInf: case ActSeeCrsInf:
case ActEdiCrsInf: case ActEdiCrsInf:

View File

@ -123,11 +123,7 @@ void Lay_WriteStartOfPage (void)
Con_ComputeConnectedUsrsBelongingToCurrentCrs (); Con_ComputeConnectedUsrsBelongingToCurrentCrs ();
/***** Send head width the file type for the HTTP protocol *****/ /***** Send head width the file type for the HTTP protocol *****/
if (Gbl.CurrentAct == ActRefCon || if (Gbl.Action.UsesAJAX)
Gbl.CurrentAct == ActRefLstClk ||
Gbl.CurrentAct == ActRefNewSocPubGbl ||
Gbl.CurrentAct == ActRefOldSocPubUsr ||
Gbl.CurrentAct == ActRefOldSocPubGbl)
// Don't generate a full HTML page, only the content of a DIV or similar // Don't generate a full HTML page, only the content of a DIV or similar
{ {
fprintf (Gbl.F.Out,"Content-Type: text/html; charset=windows-1252\r\n\r\n"); fprintf (Gbl.F.Out,"Content-Type: text/html; charset=windows-1252\r\n\r\n");
@ -197,31 +193,31 @@ void Lay_WriteStartOfPage (void)
// css/dropzone.css // css/dropzone.css
// images/spritemap@2x.png // images/spritemap@2x.png
// images/spritemap.png // images/spritemap.png
if (Gbl.CurrentAct == ActFrmCreDocIns || // Brw_ADMI_DOCUM_INS if (Gbl.Action.Act == ActFrmCreDocIns || // Brw_ADMI_DOCUM_INS
Gbl.CurrentAct == ActFrmCreShaIns || // Brw_ADMI_SHARE_INS Gbl.Action.Act == ActFrmCreShaIns || // Brw_ADMI_SHARE_INS
Gbl.CurrentAct == ActFrmCreDocCtr || // Brw_ADMI_DOCUM_CTR Gbl.Action.Act == ActFrmCreDocCtr || // Brw_ADMI_DOCUM_CTR
Gbl.CurrentAct == ActFrmCreShaCtr || // Brw_ADMI_SHARE_CTR Gbl.Action.Act == ActFrmCreShaCtr || // Brw_ADMI_SHARE_CTR
Gbl.CurrentAct == ActFrmCreDocDeg || // Brw_ADMI_DOCUM_DEG Gbl.Action.Act == ActFrmCreDocDeg || // Brw_ADMI_DOCUM_DEG
Gbl.CurrentAct == ActFrmCreShaDeg || // Brw_ADMI_SHARE_DEG Gbl.Action.Act == ActFrmCreShaDeg || // Brw_ADMI_SHARE_DEG
Gbl.CurrentAct == ActFrmCreDocCrs || // Brw_ADMI_DOCUM_CRS Gbl.Action.Act == ActFrmCreDocCrs || // Brw_ADMI_DOCUM_CRS
Gbl.CurrentAct == ActFrmCreDocGrp || // Brw_ADMI_DOCUM_GRP Gbl.Action.Act == ActFrmCreDocGrp || // Brw_ADMI_DOCUM_GRP
Gbl.CurrentAct == ActFrmCreShaCrs || // Brw_ADMI_SHARE_CRS Gbl.Action.Act == ActFrmCreShaCrs || // Brw_ADMI_SHARE_CRS
Gbl.CurrentAct == ActFrmCreShaGrp || // Brw_ADMI_SHARE_GRP Gbl.Action.Act == ActFrmCreShaGrp || // Brw_ADMI_SHARE_GRP
Gbl.CurrentAct == ActFrmCreAsgUsr || // Brw_ADMI_ASSIG_USR Gbl.Action.Act == ActFrmCreAsgUsr || // Brw_ADMI_ASSIG_USR
Gbl.CurrentAct == ActFrmCreAsgCrs || // Brw_ADMI_ASSIG_CRS Gbl.Action.Act == ActFrmCreAsgCrs || // Brw_ADMI_ASSIG_CRS
Gbl.CurrentAct == ActFrmCreWrkUsr || // Brw_ADMI_WORKS_USR Gbl.Action.Act == ActFrmCreWrkUsr || // Brw_ADMI_WORKS_USR
Gbl.CurrentAct == ActFrmCreWrkCrs || // Brw_ADMI_WORKS_CRS Gbl.Action.Act == ActFrmCreWrkCrs || // Brw_ADMI_WORKS_CRS
Gbl.CurrentAct == ActFrmCreMrkCrs || // Brw_ADMI_MARKS_CRS Gbl.Action.Act == ActFrmCreMrkCrs || // Brw_ADMI_MARKS_CRS
Gbl.CurrentAct == ActFrmCreMrkGrp || // Brw_ADMI_MARKS_GRP Gbl.Action.Act == ActFrmCreMrkGrp || // Brw_ADMI_MARKS_GRP
Gbl.CurrentAct == ActFrmCreBrf) // Brw_ADMI_BRIEF_USR Gbl.Action.Act == ActFrmCreBrf) // Brw_ADMI_BRIEF_USR
fprintf (Gbl.F.Out,"<link rel=\"StyleSheet\"" fprintf (Gbl.F.Out,"<link rel=\"StyleSheet\""
" href=\"%s/dropzone/css/dropzone.css\"" " href=\"%s/dropzone/css/dropzone.css\""
" type=\"text/css\" />\n", " type=\"text/css\" />\n",
Cfg_HTTPS_URL_SWAD_PUBLIC); Cfg_HTTPS_URL_SWAD_PUBLIC);
/* Redirect to correct language */ /* Redirect to correct language */
if ((Gbl.CurrentAct == ActAutUsrInt || if ((Gbl.Action.Act == ActAutUsrInt ||
Gbl.CurrentAct == ActAutUsrExt) && // Action is log in Gbl.Action.Act == ActAutUsrExt) && // Action is log in
Gbl.Usrs.Me.Logged && // I am just logged Gbl.Usrs.Me.Logged && // I am just logged
Gbl.Usrs.Me.UsrDat.Prefs.Language != Txt_Current_CGI_SWAD_Language) // My language != current language Gbl.Usrs.Me.UsrDat.Prefs.Language != Txt_Current_CGI_SWAD_Language) // My language != current language
Lay_WriteRedirectionToMyLanguage (); Lay_WriteRedirectionToMyLanguage ();
@ -232,7 +228,7 @@ void Lay_WriteStartOfPage (void)
fprintf (Gbl.F.Out,"</head>\n"); fprintf (Gbl.F.Out,"</head>\n");
/***** HTML body *****/ /***** HTML body *****/
if (Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW) if (Act_Actions[Gbl.Action.Act].BrowserWindow == Act_MAIN_WINDOW)
fprintf (Gbl.F.Out,"<body onload=\"init()\">\n" fprintf (Gbl.F.Out,"<body onload=\"init()\">\n"
"<div id=\"zoomLyr\" class=\"ZOOM\">" "<div id=\"zoomLyr\" class=\"ZOOM\">"
"<img id=\"zoomImg\" src=\"%s/usr_bl.jpg\"" "<img id=\"zoomImg\" src=\"%s/usr_bl.jpg\""
@ -317,16 +313,16 @@ void Lay_WriteStartOfPage (void)
/* Write title of the current action */ /* Write title of the current action */
if (Gbl.Prefs.Menu == Mnu_MENU_VERTICAL && if (Gbl.Prefs.Menu == Mnu_MENU_VERTICAL &&
Act_Actions[Act_Actions[Gbl.CurrentAct].SuperAction].IndexInMenu >= 0) Act_Actions[Act_Actions[Gbl.Action.Act].SuperAction].IndexInMenu >= 0)
Lay_WriteTitleAction (); Lay_WriteTitleAction ();
Gbl.Layout.WritingHTMLStart = false; Gbl.Layout.WritingHTMLStart = false;
Gbl.Layout.HTMLStartWritten = true; Gbl.Layout.HTMLStartWritten = true;
/* Write new year greeting */ /* Write new year greeting */
if (Gbl.CurrentAct == ActAutUsrInt || if (Gbl.Action.Act == ActAutUsrInt ||
Gbl.CurrentAct == ActAutUsrExt || Gbl.Action.Act == ActAutUsrExt ||
Gbl.CurrentAct == ActAutUsrChgLan) Gbl.Action.Act == ActAutUsrChgLan)
if (Gbl.Now.Date.Month == 1 && if (Gbl.Now.Date.Month == 1 &&
Gbl.Now.Date.Day == 1) Gbl.Now.Date.Day == 1)
{ {
@ -354,7 +350,7 @@ static void Lay_WriteEndOfPage (void)
"</div>"); // main_zone_central_container "</div>"); // main_zone_central_container
/***** Write page footer *****/ /***** Write page footer *****/
if (Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW) if (Act_Actions[Gbl.Action.Act].BrowserWindow == Act_MAIN_WINDOW)
Lay_WriteFootFromHTMLFile (); Lay_WriteFootFromHTMLFile ();
/***** End of main zone and page *****/ /***** End of main zone and page *****/
@ -451,7 +447,7 @@ static void Lay_WriteScripts (void)
#endif #endif
/***** Scripts used only in main window *****/ /***** Scripts used only in main window *****/
if (Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW) if (Act_Actions[Gbl.Action.Act].BrowserWindow == Act_MAIN_WINDOW)
{ {
Lay_WriteScriptInit (); Lay_WriteScriptInit ();
Lay_WriteScriptParamsAJAX (); Lay_WriteScriptParamsAJAX ();
@ -459,8 +455,8 @@ static void Lay_WriteScripts (void)
/***** Prepare script to draw months *****/ /***** Prepare script to draw months *****/
if ((Gbl.Prefs.SideCols & Lay_SHOW_LEFT_COLUMN) || // Left column visible if ((Gbl.Prefs.SideCols & Lay_SHOW_LEFT_COLUMN) || // Left column visible
Gbl.CurrentAct == ActSeeCal || Gbl.Action.Act == ActSeeCal ||
Gbl.CurrentAct == ActPrnCal) Gbl.Action.Act == ActPrnCal)
{ {
/***** Get list of holidays *****/ /***** Get list of holidays *****/
if (!Gbl.Hlds.LstIsRead) if (!Gbl.Hlds.LstIsRead)
@ -524,7 +520,7 @@ static void Lay_WriteScripts (void)
} }
/***** Scripts depending on action *****/ /***** Scripts depending on action *****/
switch (Gbl.CurrentAct) switch (Gbl.Action.Act)
{ {
/***** Script to print world map *****/ /***** Script to print world map *****/
case ActSeeCty: case ActSeeCty:
@ -610,19 +606,19 @@ static void Lay_WriteScriptInit (void)
Txt_STR_LANG_ID[Gbl.Prefs.Language], Txt_STR_LANG_ID[Gbl.Prefs.Language],
Gbl.Usrs.Connected.TimeToRefreshInMs); Gbl.Usrs.Connected.TimeToRefreshInMs);
if (Gbl.CurrentAct == ActLstClk) if (Gbl.Action.Act == ActLstClk)
// Refresh timeline via AJAX // Refresh timeline via AJAX
fprintf (Gbl.F.Out," setTimeout(\"refreshLastClicks()\",%lu);\n", fprintf (Gbl.F.Out," setTimeout(\"refreshLastClicks()\",%lu);\n",
Cfg_TIME_TO_REFRESH_LAST_CLICKS); Cfg_TIME_TO_REFRESH_LAST_CLICKS);
else if (Gbl.CurrentAct == ActSeeSocTmlGbl || else if (Gbl.Action.Act == ActSeeSocTmlGbl ||
Gbl.CurrentAct == ActRcvSocPstGbl || Gbl.Action.Act == ActRcvSocPstGbl ||
Gbl.CurrentAct == ActRcvSocComGbl || Gbl.Action.Act == ActRcvSocComGbl ||
Gbl.CurrentAct == ActShaSocNotGbl || Gbl.Action.Act == ActShaSocNotGbl ||
Gbl.CurrentAct == ActUnsSocPubGbl || Gbl.Action.Act == ActUnsSocPubGbl ||
Gbl.CurrentAct == ActReqRemSocPubGbl || Gbl.Action.Act == ActReqRemSocPubGbl ||
Gbl.CurrentAct == ActRemSocPubGbl || Gbl.Action.Act == ActRemSocPubGbl ||
Gbl.CurrentAct == ActReqRemSocComGbl || Gbl.Action.Act == ActReqRemSocComGbl ||
Gbl.CurrentAct == ActRemSocComGbl) Gbl.Action.Act == ActRemSocComGbl)
// Refresh timeline via AJAX // Refresh timeline via AJAX
fprintf (Gbl.F.Out," setTimeout(\"refreshNewTimeline()\",%lu);\n", fprintf (Gbl.F.Out," setTimeout(\"refreshNewTimeline()\",%lu);\n",
Cfg_TIME_TO_REFRESH_SOCIAL_TIMELINE); Cfg_TIME_TO_REFRESH_SOCIAL_TIMELINE);
@ -642,22 +638,22 @@ static void Lay_WriteScriptParamsAJAX (void)
/***** Parameter to refresh connected users *****/ /***** Parameter to refresh connected users *****/
fprintf (Gbl.F.Out,"var RefreshParamNxtActCon = \"act=%ld\";\n", fprintf (Gbl.F.Out,"var RefreshParamNxtActCon = \"act=%ld\";\n",
Act_Actions[ActRefCon ].ActCod); Act_Actions[ActRefCon].ActCod);
/***** Parameter to refresh clicks in realtime *****/ /***** Parameter to refresh clicks in realtime *****/
fprintf (Gbl.F.Out,"var RefreshParamNxtActLog = \"act=%ld\";\n", fprintf (Gbl.F.Out,"var RefreshParamNxtActLog = \"act=%ld\";\n",
Act_Actions[ActRefLstClk].ActCod); Act_Actions[ActRefLstClk].ActCod);
/***** Parameters related with refreshing of social timeline *****/ /***** Parameters related with refreshing of social timeline *****/
if (Gbl.CurrentAct == ActSeeSocTmlGbl || if (Gbl.Action.Act == ActSeeSocTmlGbl ||
Gbl.CurrentAct == ActRcvSocPstGbl || Gbl.Action.Act == ActRcvSocPstGbl ||
Gbl.CurrentAct == ActRcvSocComGbl || Gbl.Action.Act == ActRcvSocComGbl ||
Gbl.CurrentAct == ActShaSocNotGbl || Gbl.Action.Act == ActShaSocNotGbl ||
Gbl.CurrentAct == ActUnsSocPubGbl || Gbl.Action.Act == ActUnsSocPubGbl ||
Gbl.CurrentAct == ActReqRemSocPubGbl || Gbl.Action.Act == ActReqRemSocPubGbl ||
Gbl.CurrentAct == ActRemSocPubGbl || Gbl.Action.Act == ActRemSocPubGbl ||
Gbl.CurrentAct == ActReqRemSocComGbl || Gbl.Action.Act == ActReqRemSocComGbl ||
Gbl.CurrentAct == ActRemSocComGbl) Gbl.Action.Act == ActRemSocComGbl)
/* In all the actions related to view or editing global timeline ==> /* In all the actions related to view or editing global timeline ==>
put parameters used by AJAX */ put parameters used by AJAX */
fprintf (Gbl.F.Out,"var RefreshParamNxtActNewPub = \"act=%ld\";\n" fprintf (Gbl.F.Out,"var RefreshParamNxtActNewPub = \"act=%ld\";\n"
@ -665,15 +661,15 @@ static void Lay_WriteScriptParamsAJAX (void)
"var RefreshParamUsr = \"\";\n", // No user specified "var RefreshParamUsr = \"\";\n", // No user specified
Act_Actions[ActRefNewSocPubGbl].ActCod, Act_Actions[ActRefNewSocPubGbl].ActCod,
Act_Actions[ActRefOldSocPubGbl].ActCod); Act_Actions[ActRefOldSocPubGbl].ActCod);
else if (Gbl.CurrentAct == ActSeePubPrf || else if (Gbl.Action.Act == ActSeePubPrf ||
Gbl.CurrentAct == ActRcvSocPstGbl || Gbl.Action.Act == ActRcvSocPstGbl ||
Gbl.CurrentAct == ActRcvSocComUsr || Gbl.Action.Act == ActRcvSocComUsr ||
Gbl.CurrentAct == ActShaSocNotGbl || Gbl.Action.Act == ActShaSocNotGbl ||
Gbl.CurrentAct == ActUnsSocPubGbl || Gbl.Action.Act == ActUnsSocPubGbl ||
Gbl.CurrentAct == ActReqRemSocPubGbl || Gbl.Action.Act == ActReqRemSocPubGbl ||
Gbl.CurrentAct == ActRemSocPubGbl || Gbl.Action.Act == ActRemSocPubGbl ||
Gbl.CurrentAct == ActReqRemSocComGbl || Gbl.Action.Act == ActReqRemSocComGbl ||
Gbl.CurrentAct == ActRemSocComGbl) Gbl.Action.Act == ActRemSocComGbl)
{ {
/* In all the actions related to view or editing user's timeline ==> /* In all the actions related to view or editing user's timeline ==>
put parameters used by AJAX */ put parameters used by AJAX */
@ -872,18 +868,18 @@ static void Lay_WriteTitleAction (void)
fprintf (Gbl.F.Out,"<div id=\"action_title\"" fprintf (Gbl.F.Out,"<div id=\"action_title\""
" style=\"background-image:url('%s/%s/%s');\">", " style=\"background-image:url('%s/%s/%s');\">",
Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION, Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION,
Act_Actions[Act_Actions[Gbl.CurrentAct].SuperAction].Icon); Act_Actions[Act_Actions[Gbl.Action.Act].SuperAction].Icon);
/***** Title *****/ /***** Title *****/
fprintf (Gbl.F.Out,"<div class=\"%s\">%s &gt; %s</div>", fprintf (Gbl.F.Out,"<div class=\"%s\">%s &gt; %s</div>",
The_ClassTitleAction[Gbl.Prefs.Theme], The_ClassTitleAction[Gbl.Prefs.Theme],
Txt_TABS_FULL_TXT[Act_Actions[Gbl.CurrentAct].Tab], Txt_TABS_FULL_TXT[Act_Actions[Gbl.Action.Act].Tab],
Act_GetTitleAction (Gbl.CurrentAct)); Act_GetTitleAction (Gbl.Action.Act));
/***** Subtitle *****/ /***** Subtitle *****/
fprintf (Gbl.F.Out,"<div class=\"%s\">%s</div>", fprintf (Gbl.F.Out,"<div class=\"%s\">%s</div>",
The_ClassSubtitleAction[Gbl.Prefs.Theme], The_ClassSubtitleAction[Gbl.Prefs.Theme],
Act_GetSubtitleAction (Gbl.CurrentAct)); Act_GetSubtitleAction (Gbl.Action.Act));
/***** Container end *****/ /***** Container end *****/
fprintf (Gbl.F.Out,"</div>"); fprintf (Gbl.F.Out,"</div>");
@ -968,8 +964,8 @@ static void Lay_ShowRightColumn (void)
/***** SWADroid advertisement *****/ /***** SWADroid advertisement *****/
if (!Gbl.Usrs.Me.Logged || if (!Gbl.Usrs.Me.Logged ||
Gbl.CurrentAct == ActAutUsrInt || Gbl.Action.Act == ActAutUsrInt ||
Gbl.CurrentAct == ActAutUsrExt) Gbl.Action.Act == ActAutUsrExt)
fprintf (Gbl.F.Out,"<div class=\"LEFT_RIGHT_CELL\">" fprintf (Gbl.F.Out,"<div class=\"LEFT_RIGHT_CELL\">"
"<a href=\"https://play.google.com/store/apps/details?id=es.ugr.swad.swadroid\"" "<a href=\"https://play.google.com/store/apps/details?id=es.ugr.swad.swadroid\""
" target=\"_blank\" title=\"%s\">" " target=\"_blank\" title=\"%s\">"
@ -1354,11 +1350,7 @@ void Lay_ShowErrorAndExit (const char *Message)
/***** Page is generated (except </body> and </html>). /***** Page is generated (except </body> and </html>).
Compute time to generate page *****/ Compute time to generate page *****/
if (Gbl.CurrentAct != ActRefCon && // Refreshing connected users if (!Gbl.Action.UsesAJAX)
Gbl.CurrentAct != ActRefLstClk && // Refreshing last clics
Gbl.CurrentAct != ActRefNewSocPubGbl && // Refreshing new social publishings in timeline
Gbl.CurrentAct != ActRefOldSocPubUsr && // Refreshing old social publishings in timeline
Gbl.CurrentAct != ActRefOldSocPubGbl) // Refreshing old social publishings in timeline
Sta_ComputeTimeToGeneratePage (); Sta_ComputeTimeToGeneratePage ();
if (Gbl.WebService.IsWebService) // Serving a plugin request if (Gbl.WebService.IsWebService) // Serving a plugin request
@ -1376,11 +1368,7 @@ void Lay_ShowErrorAndExit (const char *Message)
Fil_FastCopyOfOpenFiles (Gbl.F.Out,stdout); Fil_FastCopyOfOpenFiles (Gbl.F.Out,stdout);
Fil_CloseAndRemoveFileForHTMLOutput (); Fil_CloseAndRemoveFileForHTMLOutput ();
if (Gbl.CurrentAct != ActRefCon && // Refreshing connected users if (!Gbl.Action.UsesAJAX)
Gbl.CurrentAct != ActRefLstClk && // Refreshing last clicks
Gbl.CurrentAct != ActRefNewSocPubGbl && // Refreshing new social publishings in timeline
Gbl.CurrentAct != ActRefOldSocPubUsr && // Refreshing old social publishings in timeline
Gbl.CurrentAct != ActRefOldSocPubGbl) // Refreshing old social publishings in timeline
{ {
/***** Compute time to send page *****/ /***** Compute time to send page *****/
Sta_ComputeTimeToSendPage (); Sta_ComputeTimeToSendPage ();
@ -1392,7 +1380,7 @@ void Lay_ShowErrorAndExit (const char *Message)
if (!Gbl.Layout.HTMLEndWritten) if (!Gbl.Layout.HTMLEndWritten)
{ {
// Here Gbl.F.Out is stdout // Here Gbl.F.Out is stdout
if (Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW) if (Act_Actions[Gbl.Action.Act].BrowserWindow == Act_MAIN_WINDOW)
Lay_WriteAboutZone (); Lay_WriteAboutZone ();
fprintf (Gbl.F.Out,"</body>\n" fprintf (Gbl.F.Out,"</body>\n"

View File

@ -126,7 +126,7 @@ int main (int argc, char *argv[])
Con_RemoveOldConnected (); Con_RemoveOldConnected ();
/***** Get number of sessions *****/ /***** Get number of sessions *****/
if (Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW) if (Act_Actions[Gbl.Action.Act].BrowserWindow == Act_MAIN_WINDOW)
Ses_GetNumSessions (); Ses_GetNumSessions ();
/***** Check user and get user's data *****/ /***** Check user and get user's data *****/
@ -134,22 +134,22 @@ int main (int argc, char *argv[])
} }
/***** Check if the user have permission to execute the action *****/ /***** Check if the user have permission to execute the action *****/
if (!Act_CheckIfIHavePermissionToExecuteAction (Gbl.CurrentAct)) if (!Act_CheckIfIHavePermissionToExecuteAction (Gbl.Action.Act))
Lay_ShowErrorAndExit (Txt_You_dont_have_permission_to_perform_this_action); Lay_ShowErrorAndExit (Txt_You_dont_have_permission_to_perform_this_action);
/***** Update most frequently used actions *****/ /***** Update most frequently used actions *****/
Act_UpdateMFUActions (); Act_UpdateMFUActions ();
/***** Execute a function depending on the action *****/ /***** Execute a function depending on the action *****/
if (Act_Actions[Gbl.CurrentAct].FunctionPriori != NULL) if (Act_Actions[Gbl.Action.Act].FunctionPriori != NULL)
Act_Actions[Gbl.CurrentAct].FunctionPriori (); Act_Actions[Gbl.Action.Act].FunctionPriori ();
/***** Start writing HTML output *****/ /***** Start writing HTML output *****/
Lay_WriteStartOfPage (); Lay_WriteStartOfPage ();
/***** Make a processing or other depending on the action *****/ /***** Make a processing or other depending on the action *****/
if (Act_Actions[Gbl.CurrentAct].FunctionPosteriori != NULL) if (Act_Actions[Gbl.Action.Act].FunctionPosteriori != NULL)
Act_Actions[Gbl.CurrentAct].FunctionPosteriori (); Act_Actions[Gbl.Action.Act].FunctionPosteriori ();
} }
/***** Cleanup and exit *****/ /***** Cleanup and exit *****/

View File

@ -205,7 +205,7 @@ Act_Action_t Mnu_GetFirstActionAvailableInCurrentTab (void)
NumOptInMenu < Act_MAX_OPTIONS_IN_MENU_PER_TAB; NumOptInMenu < Act_MAX_OPTIONS_IN_MENU_PER_TAB;
NumOptInMenu++) NumOptInMenu++)
{ {
if ((Action = Mnu_MenuActions[Gbl.CurrentTab][NumOptInMenu]) == 0) if ((Action = Mnu_MenuActions[Gbl.Action.Tab][NumOptInMenu]) == 0)
return ActUnk; return ActUnk;
if (Act_CheckIfIHavePermissionToExecuteAction (Action)) if (Act_CheckIfIHavePermissionToExecuteAction (Action))
return Action; return Action;
@ -236,12 +236,12 @@ void Mnu_WriteMenuThisTab (void)
NumOptInMenu < Act_MAX_OPTIONS_IN_MENU_PER_TAB; NumOptInMenu < Act_MAX_OPTIONS_IN_MENU_PER_TAB;
NumOptInMenu++) NumOptInMenu++)
{ {
NumAct = Mnu_MenuActions[Gbl.CurrentTab][NumOptInMenu]; NumAct = Mnu_MenuActions[Gbl.Action.Tab][NumOptInMenu];
if (NumAct == 0) // At the end of each tab, actions are initialized to 0, so 0 marks the end of the menu if (NumAct == 0) // At the end of each tab, actions are initialized to 0, so 0 marks the end of the menu
break; break;
if (Act_CheckIfIHavePermissionToExecuteAction (NumAct)) if (Act_CheckIfIHavePermissionToExecuteAction (NumAct))
{ {
IsTheSelectedAction = (NumAct == Act_Actions[Gbl.CurrentAct].SuperAction); IsTheSelectedAction = (NumAct == Act_Actions[Gbl.Action.Act].SuperAction);
Title = Act_GetSubtitleAction (NumAct); Title = Act_GetSubtitleAction (NumAct);
@ -271,7 +271,7 @@ void Mnu_WriteMenuThisTab (void)
"</div>", "</div>",
IsTheSelectedAction ? The_ClassTxtMenuOn[Gbl.Prefs.Theme] : IsTheSelectedAction ? The_ClassTxtMenuOn[Gbl.Prefs.Theme] :
The_ClassTxtMenuOff[Gbl.Prefs.Theme], The_ClassTxtMenuOff[Gbl.Prefs.Theme],
Txt_MENU_TITLE[Gbl.CurrentTab][NumOptInMenu]); Txt_MENU_TITLE[Gbl.Action.Tab][NumOptInMenu]);
/***** End of link and form *****/ /***** End of link and form *****/
fprintf (Gbl.F.Out,"</div>" fprintf (Gbl.F.Out,"</div>"

View File

@ -1722,7 +1722,7 @@ static void Msg_ShowSentOrReceivedMessages (Msg_TypeOfMessages_t TypeOfMessages)
/***** Show form to delete all messages *****/ /***** Show form to delete all messages *****/
Msg_ShowFormDelSentOrRecMsgs (TypeOfMessages,NumMsgs); Msg_ShowFormDelSentOrRecMsgs (TypeOfMessages,NumMsgs);
if (Gbl.CurrentAct == ActExpRcvMsg) // Expanding a message, perhaps it is the result of following a link if (Gbl.Action.Act == ActExpRcvMsg) // Expanding a message, perhaps it is the result of following a link
// from a notification of received message, so show the page where the message is inside // from a notification of received message, so show the page where the message is inside
{ {
/***** Get the page where the expanded message is inside *****/ /***** Get the page where the expanded message is inside *****/
@ -3144,7 +3144,7 @@ static void Msg_WriteMsgFrom (struct UsrData *UsrDat,bool Deleted)
if (UsrDat->UsrCod > 0) if (UsrDat->UsrCod > 0)
{ {
fprintf (Gbl.F.Out,"%s",UsrDat->FullName); fprintf (Gbl.F.Out,"%s",UsrDat->FullName);
if (Act_Actions[Gbl.CurrentAct].SuperAction == ActSeeRcvMsg) if (Act_Actions[Gbl.Action.Act].SuperAction == ActSeeRcvMsg)
{ {
if (Msg_CheckIfUsrIsBanned (UsrDat->UsrCod,Gbl.Usrs.Me.UsrDat.UsrCod)) if (Msg_CheckIfUsrIsBanned (UsrDat->UsrCod,Gbl.Usrs.Me.UsrDat.UsrCod))
// Sender is banned // Sender is banned

View File

@ -543,7 +543,7 @@ void Pag_GetParamPagNum (Pag_WhatPaginate_t WhatPaginate)
switch (WhatPaginate) switch (WhatPaginate)
{ {
case Pag_MESSAGES_RECEIVED: case Pag_MESSAGES_RECEIVED:
if (Gbl.CurrentAct == ActExpRcvMsg) // Expanding a message, perhaps it is the result of following a link if (Gbl.Action.Act == ActExpRcvMsg) // Expanding a message, perhaps it is the result of following a link
// from a notification of received message // from a notification of received message
// Show the page corresponding to the expanded message // Show the page corresponding to the expanded message
Gbl.Pag.CurrentPage = 1; // Now set the current page to the first, but later the correct page will be calculated Gbl.Pag.CurrentPage = 1; // Now set the current page to the first, but later the correct page will be calculated

View File

@ -142,7 +142,7 @@ void Par_GetMainParameters (void)
/***** Get action to perform *****/ /***** Get action to perform *****/
if (Gbl.WebService.IsWebService) if (Gbl.WebService.IsWebService)
{ {
Gbl.CurrentAct = ActWebSvc; Gbl.Action.Act = ActWebSvc;
Tab_SetCurrentTab (); Tab_SetCurrentTab ();
return; return;
} }
@ -152,14 +152,14 @@ void Par_GetMainParameters (void)
if (Gbl.Imported.ExternalUsrId[0] && if (Gbl.Imported.ExternalUsrId[0] &&
Gbl.Imported.ExternalSesId[0]) Gbl.Imported.ExternalSesId[0])
{ {
Gbl.CurrentAct = ActAutUsrExt; Gbl.Action.Act = ActAutUsrExt;
Tab_SetCurrentTab (); Tab_SetCurrentTab ();
return; return;
} }
// SWAD is not called from external site // SWAD is not called from external site
/***** Set dfault action *****/ /***** Set dfault action *****/
Gbl.CurrentAct = ActUnk; Gbl.Action.Act = ActUnk;
/***** Get another user's nickname, if exists /***** Get another user's nickname, if exists
(this nickname is used to get another user's info, (this nickname is used to get another user's info,
@ -170,7 +170,7 @@ void Par_GetMainParameters (void)
{ {
Gbl.Usrs.Other.UsrDat.UsrCod = OtherUsrCod; // Used to go to public profile Gbl.Usrs.Other.UsrDat.UsrCod = OtherUsrCod; // Used to go to public profile
// and to refresh old publishings in user's timeline // and to refresh old publishings in user's timeline
Gbl.CurrentAct = ActSeePubPrf; // Set default action if no other is specified Gbl.Action.Act = ActSeePubPrf; // Set default action if no other is specified
} }
/***** Get action to perform *****/ /***** Get action to perform *****/
@ -179,7 +179,7 @@ void Par_GetMainParameters (void)
{ {
if (sscanf (UnsignedStr,"%u",&UnsignedNum) == 1) if (sscanf (UnsignedStr,"%u",&UnsignedNum) == 1)
if (UnsignedNum <= Act_MAX_ACTION_COD) if (UnsignedNum <= Act_MAX_ACTION_COD)
Gbl.CurrentAct = Act_FromActCodToAction[UnsignedNum]; Gbl.Action.Act = Act_FromActCodToAction[UnsignedNum];
} }
else else
{ {
@ -188,8 +188,14 @@ void Par_GetMainParameters (void)
if (UnsignedStr[0]) if (UnsignedStr[0])
if (sscanf (UnsignedStr,"%u",&UnsignedNum) == 1) if (sscanf (UnsignedStr,"%u",&UnsignedNum) == 1)
if (UnsignedNum <= Act_MAX_ACTION_COD) if (UnsignedNum <= Act_MAX_ACTION_COD)
Gbl.CurrentAct = Act_FromActCodToAction[UnsignedNum]; Gbl.Action.Act = Act_FromActCodToAction[UnsignedNum];
} }
if (Gbl.Action.Act == ActRefCon ||
Gbl.Action.Act == ActRefLstClk ||
Gbl.Action.Act == ActRefNewSocPubGbl ||
Gbl.Action.Act == ActRefOldSocPubGbl ||
Gbl.Action.Act == ActRefOldSocPubUsr)
Gbl.Action.UsesAJAX = true;
/***** Get session identifier, if exists *****/ /***** Get session identifier, if exists *****/
Par_GetParToText ("ses",Gbl.Session.Id,Ses_LENGTH_SESSION_ID); Par_GetParToText ("ses",Gbl.Session.Id,Ses_LENGTH_SESSION_ID);
@ -228,7 +234,7 @@ void Par_GetMainParameters (void)
} }
/***** Get user password and login *****/ /***** Get user password and login *****/
switch (Gbl.CurrentAct) switch (Gbl.Action.Act)
{ {
case ActAutUsrInt: case ActAutUsrInt:
Pwd_GetParamUsrPwdLogin (); Pwd_GetParamUsrPwdLogin ();
@ -329,15 +335,15 @@ void Par_GetMainParameters (void)
} }
/***** Get tab to activate *****/ /***** Get tab to activate *****/
Gbl.CurrentTab = TabUnk; Gbl.Action.Tab = TabUnk;
if (Gbl.CurrentAct == ActMnu) if (Gbl.Action.Act == ActMnu)
{ {
Par_GetParToText ("NxtTab",UnsignedStr,10); Par_GetParToText ("NxtTab",UnsignedStr,10);
if (UnsignedStr[0]) if (UnsignedStr[0])
if (sscanf (UnsignedStr,"%u",&UnsignedNum) == 1) if (sscanf (UnsignedStr,"%u",&UnsignedNum) == 1)
if (UnsignedNum < Tab_NUM_TABS) if (UnsignedNum < Tab_NUM_TABS)
{ {
Gbl.CurrentTab = (Act_Tab_t) UnsignedNum; Gbl.Action.Tab = (Act_Tab_t) UnsignedNum;
Tab_DisableIncompatibleTabs (); Tab_DisableIncompatibleTabs ();
} }
} }

View File

@ -1036,10 +1036,10 @@ void Pho_ShowUsrPhoto (const struct UsrData *UsrDat,const char *PhotoURL,
char SpecialSurnames [2*(Usr_MAX_BYTES_NAME_SPEC_CHAR+1)+1]; char SpecialSurnames [2*(Usr_MAX_BYTES_NAME_SPEC_CHAR+1)+1];
bool PhotoExists; bool PhotoExists;
bool PutLinkToPublicProfile = !Gbl.Form.Inside && // Only if not inside another form bool PutLinkToPublicProfile = !Gbl.Form.Inside && // Only if not inside another form
Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW; // Only in main window Act_Actions[Gbl.Action.Act].BrowserWindow == Act_MAIN_WINDOW; // Only in main window
bool PutZoomCode = PhotoURL && // Photo exists bool PutZoomCode = PhotoURL && // Photo exists
Zoom == Pho_ZOOM && // Make zoom Zoom == Pho_ZOOM && // Make zoom
Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW; // Only in main window Act_Actions[Gbl.Action.Act].BrowserWindow == Act_MAIN_WINDOW; // Only in main window
/***** Replace tildes, ñ, etc. in full name by codes, /***** Replace tildes, ñ, etc. in full name by codes,
because some browsers (i.e., IE5) because some browsers (i.e., IE5)
@ -1120,7 +1120,7 @@ void Pho_ChangePhotoVisibility (void)
char Query[128]; char Query[128];
/***** Get param with public/private photo *****/ /***** Get param with public/private photo *****/
Gbl.Usrs.Me.UsrDat.PhotoVisibility = Pri_GetParamVisibility ("VisPho"); Gbl.Usrs.Me.UsrDat.PhotoVisibility = Pri_GetParamVisibility ("VisPho",Pri_PHOTO_VISIBILITY_DEFAULT);
/***** Store public/private photo in database *****/ /***** Store public/private photo in database *****/
sprintf (Query,"UPDATE usr_data SET PhotoVisibility='%s'" sprintf (Query,"UPDATE usr_data SET PhotoVisibility='%s'"

View File

@ -180,7 +180,8 @@ static void Pri_PutFormVisibility (const char *TxtLabel,
/************************ Get visibility from string *************************/ /************************ Get visibility from string *************************/
/*****************************************************************************/ /*****************************************************************************/
Pri_Visibility_t Pri_GetVisibilityFromStr (const char *Str) Pri_Visibility_t Pri_GetVisibilityFromStr (const char *Str,
Pri_Visibility_t DefaultVisibility)
{ {
Pri_Visibility_t Visibility; Pri_Visibility_t Visibility;
@ -190,14 +191,15 @@ Pri_Visibility_t Pri_GetVisibilityFromStr (const char *Str)
if (!strcasecmp (Str,Pri_VisibilityDB[Visibility])) if (!strcasecmp (Str,Pri_VisibilityDB[Visibility]))
return Visibility; return Visibility;
return Pri_VISIBILITY_DEFAULT; return DefaultVisibility;
} }
/*****************************************************************************/ /*****************************************************************************/
/**************** Get parameter with visibility from form ********************/ /**************** Get parameter with visibility from form ********************/
/*****************************************************************************/ /*****************************************************************************/
Pri_Visibility_t Pri_GetParamVisibility (const char *ParamName) Pri_Visibility_t Pri_GetParamVisibility (const char *ParamName,
Pri_Visibility_t DefaultVisibility)
{ {
char UnsignedStr[10+1]; char UnsignedStr[10+1];
unsigned UnsignedNum; unsigned UnsignedNum;
@ -212,7 +214,7 @@ Pri_Visibility_t Pri_GetParamVisibility (const char *ParamName)
return (Pri_Visibility_t) UnsignedNum; return (Pri_Visibility_t) UnsignedNum;
} }
return Pri_VISIBILITY_DEFAULT; return DefaultVisibility;
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -34,7 +34,7 @@
/***** Visibility (who can see user's photo / public profile) *****/ /***** Visibility (who can see user's photo / public profile) *****/
#define Pri_NUM_OPTIONS_PRIVACY 4 #define Pri_NUM_OPTIONS_PRIVACY 4
typedef enum typedef enum // These numbers are stored in database. So, if you change them here, do the same in database
{ {
Pri_VISIBILITY_USER = 0, // Only visible by me and my teachers if I am a student or my students if I am a teacher Pri_VISIBILITY_USER = 0, // Only visible by me and my teachers if I am a student or my students if I am a teacher
Pri_VISIBILITY_COURSE = 1, // Visible by users sharing courses with me Pri_VISIBILITY_COURSE = 1, // Visible by users sharing courses with me
@ -42,7 +42,8 @@ typedef enum
Pri_VISIBILITY_WORLD = 3, // Public, visible by all the people, even unlogged visitors Pri_VISIBILITY_WORLD = 3, // Public, visible by all the people, even unlogged visitors
} Pri_Visibility_t; } Pri_Visibility_t;
#define Pri_VISIBILITY_DEFAULT Pri_VISIBILITY_SYSTEM #define Pri_PHOTO_VISIBILITY_DEFAULT Pri_VISIBILITY_SYSTEM
#define Pri_PROFILE_VISIBILITY_DEFAULT Pri_VISIBILITY_SYSTEM
/*****************************************************************************/ /*****************************************************************************/
/***************************** Public prototypes *****************************/ /***************************** Public prototypes *****************************/
@ -51,8 +52,10 @@ typedef enum
void Pri_PutLinkToChangeMyPrivacy (void); void Pri_PutLinkToChangeMyPrivacy (void);
void Pri_EditMyPrivacy (void); void Pri_EditMyPrivacy (void);
Pri_Visibility_t Pri_GetVisibilityFromStr (const char *Str); Pri_Visibility_t Pri_GetVisibilityFromStr (const char *Str,
Pri_Visibility_t Pri_GetParamVisibility (const char *ParamName); Pri_Visibility_t DefaultVisibility);
Pri_Visibility_t Pri_GetParamVisibility (const char *ParamName,
Pri_Visibility_t DefaultVisibility);
bool Pri_ShowIsAllowed (Pri_Visibility_t Visibility,long OtherUsrCod); bool Pri_ShowIsAllowed (Pri_Visibility_t Visibility,long OtherUsrCod);

View File

@ -284,7 +284,7 @@ void Prf_ChangeProfileVisibility (void)
char Query[128]; char Query[128];
/***** Get param with public/private photo *****/ /***** Get param with public/private photo *****/
Gbl.Usrs.Me.UsrDat.ProfileVisibility = Pri_GetParamVisibility ("VisPrf"); Gbl.Usrs.Me.UsrDat.ProfileVisibility = Pri_GetParamVisibility ("VisPrf",Pri_PROFILE_VISIBILITY_DEFAULT);
/***** Store public/private photo in database *****/ /***** Store public/private photo in database *****/
sprintf (Query,"UPDATE usr_data SET ProfileVisibility='%s'" sprintf (Query,"UPDATE usr_data SET ProfileVisibility='%s'"

View File

@ -874,7 +874,7 @@ void Rec_ListRecordsGsts (void)
extern const char *Txt_You_must_select_one_ore_more_users; extern const char *Txt_You_must_select_one_ore_more_users;
unsigned NumUsrs = 0; unsigned NumUsrs = 0;
const char *Ptr; const char *Ptr;
Rec_RecordViewType_t TypeOfView = (Gbl.CurrentAct == ActSeeRecSevGst) ? Rec_RECORD_LIST : Rec_RecordViewType_t TypeOfView = (Gbl.Action.Act == ActSeeRecSevGst) ? Rec_RECORD_LIST :
Rec_RECORD_PRINT; Rec_RECORD_PRINT;
struct UsrData UsrDat; struct UsrData UsrDat;
@ -882,7 +882,7 @@ void Rec_ListRecordsGsts (void)
Gbl.Usrs.Listing.RecsUsrs = Rec_RECORD_USERS_GUESTS; Gbl.Usrs.Listing.RecsUsrs = Rec_RECORD_USERS_GUESTS;
/***** Get parameter with number of user records per page (only for printing) *****/ /***** Get parameter with number of user records per page (only for printing) *****/
if (Gbl.CurrentAct == ActPrnRecSevGst) if (Gbl.Action.Act == ActPrnRecSevGst)
Rec_GetParamRecordsPerPage (); Rec_GetParamRecordsPerPage ();
/***** Get list of selected users *****/ /***** Get list of selected users *****/
@ -896,7 +896,7 @@ void Rec_ListRecordsGsts (void)
return; return;
} }
if (Gbl.CurrentAct == ActSeeRecSevGst) if (Gbl.Action.Act == ActSeeRecSevGst)
{ {
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">"); fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
@ -924,7 +924,7 @@ void Rec_ListRecordsGsts (void)
{ {
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\"" fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\""
" style=\"margin-bottom:12px;"); " style=\"margin-bottom:12px;");
if (Gbl.CurrentAct == ActPrnRecSevGst && if (Gbl.Action.Act == ActPrnRecSevGst &&
NumUsrs != 0 && NumUsrs != 0 &&
(NumUsrs % Gbl.Usrs.Listing.RecsPerPag) == 0) (NumUsrs % Gbl.Usrs.Listing.RecsPerPag) == 0)
fprintf (Gbl.F.Out,"page-break-before:always;"); fprintf (Gbl.F.Out,"page-break-before:always;");
@ -1099,7 +1099,7 @@ static void Rec_ListRecordsStds (Rec_RecordViewType_t TypeOfView)
" class=\"CENTER_MIDDLE\"" " class=\"CENTER_MIDDLE\""
" style=\"margin-bottom:12px;", " style=\"margin-bottom:12px;",
Anchor); Anchor);
if (Gbl.CurrentAct == ActPrnRecSevStd && if (Gbl.Action.Act == ActPrnRecSevStd &&
NumUsr != 0 && NumUsr != 0 &&
(NumUsr % Gbl.Usrs.Listing.RecsPerPag) == 0) (NumUsr % Gbl.Usrs.Listing.RecsPerPag) == 0)
fprintf (Gbl.F.Out,"page-break-before:always;"); fprintf (Gbl.F.Out,"page-break-before:always;");
@ -1210,7 +1210,7 @@ void Rec_ListRecordsTchs (void)
extern const char *Txt_TIMETABLE_TYPES[TT_NUM_TIMETABLE_TYPES]; extern const char *Txt_TIMETABLE_TYPES[TT_NUM_TIMETABLE_TYPES];
unsigned NumUsrs = 0; unsigned NumUsrs = 0;
const char *Ptr; const char *Ptr;
Rec_RecordViewType_t TypeOfView = (Gbl.CurrentAct == ActSeeRecSevTch) ? Rec_RECORD_LIST : Rec_RecordViewType_t TypeOfView = (Gbl.Action.Act == ActSeeRecSevTch) ? Rec_RECORD_LIST :
Rec_RECORD_PRINT; Rec_RECORD_PRINT;
struct UsrData UsrDat; struct UsrData UsrDat;
bool ShowOfficeHours; bool ShowOfficeHours;
@ -1226,7 +1226,7 @@ void Rec_ListRecordsTchs (void)
ShowOfficeHours = Rec_GetParamShowOfficeHours (); ShowOfficeHours = Rec_GetParamShowOfficeHours ();
/***** Get parameter with number of user records per page (only for printing) *****/ /***** Get parameter with number of user records per page (only for printing) *****/
if (Gbl.CurrentAct == ActPrnRecSevTch) if (Gbl.Action.Act == ActPrnRecSevTch)
Rec_GetParamRecordsPerPage (); Rec_GetParamRecordsPerPage ();
/***** Get list of selected teachers *****/ /***** Get list of selected teachers *****/
@ -1240,7 +1240,7 @@ void Rec_ListRecordsTchs (void)
return; return;
} }
if (Gbl.CurrentAct == ActSeeRecSevTch) if (Gbl.Action.Act == ActSeeRecSevTch)
{ {
/***** Show contextual menu *****/ /***** Show contextual menu *****/
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">"); fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
@ -1281,7 +1281,7 @@ void Rec_ListRecordsTchs (void)
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\"" fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\""
" style=\"margin-bottom:12px;"); " style=\"margin-bottom:12px;");
if (Gbl.CurrentAct == ActPrnRecSevTch && if (Gbl.Action.Act == ActPrnRecSevTch &&
NumUsrs != 0 && NumUsrs != 0 &&
(NumUsrs % Gbl.Usrs.Listing.RecsPerPag) == 0) (NumUsrs % Gbl.Usrs.Listing.RecsPerPag) == 0)
fprintf (Gbl.F.Out,"page-break-before:always;"); fprintf (Gbl.F.Out,"page-break-before:always;");
@ -2076,7 +2076,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
} }
PutFormLinks = !Gbl.Form.Inside && // Only if not inside another form PutFormLinks = !Gbl.Form.Inside && // Only if not inside another form
Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW; // Only in main window Act_Actions[Gbl.Action.Act].BrowserWindow == Act_MAIN_WINDOW; // Only in main window
/***** Start frame *****/ /***** Start frame *****/
sprintf (StrRecordWidth,"%upx",Rec_RECORD_WIDTH); sprintf (StrRecordWidth,"%upx",Rec_RECORD_WIDTH);
@ -2436,8 +2436,8 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
Act_FormStart (ActChgMyData); Act_FormStart (ActChgMyData);
break; break;
case Rec_FORM_NEW_RECORD_OTHER_NEW_USR: case Rec_FORM_NEW_RECORD_OTHER_NEW_USR:
Act_FormStart ( Gbl.CurrentAct == ActReqMdfStd ? ActCreStd : Act_FormStart ( Gbl.Action.Act == ActReqMdfStd ? ActCreStd :
(Gbl.CurrentAct == ActReqMdfTch ? ActCreTch : (Gbl.Action.Act == ActReqMdfTch ? ActCreTch :
ActCreOth)); ActCreOth));
ID_PutParamOtherUsrIDPlain (); // New user ID_PutParamOtherUsrIDPlain (); // New user
break; break;

View File

@ -305,7 +305,7 @@ bool Ses_GetSessionData (void)
Gbl.CurrentCrs.Crs.CrsCod = Str_ConvertStrCodToLongCod (row[7]); Gbl.CurrentCrs.Crs.CrsCod = Str_ConvertStrCodToLongCod (row[7]);
/***** Get last search *****/ /***** Get last search *****/
if (Gbl.CurrentAct != ActLogOut) // When closing session, last search will not be needed if (Gbl.Action.Act != ActLogOut) // When closing session, last search will not be needed
{ {
/* Get what to search (row[8]) */ /* Get what to search (row[8]) */
Gbl.Search.WhatToSearch = Sch_SEARCH_ALL; Gbl.Search.WhatToSearch = Sch_SEARCH_ALL;

View File

@ -57,10 +57,10 @@
// Number of recent publishings got and shown the first time, before refreshing // Number of recent publishings got and shown the first time, before refreshing
#define Soc_MAX_NEW_PUBS_TO_GET_AND_SHOW 10000 // Unlimited #define Soc_MAX_NEW_PUBS_TO_GET_AND_SHOW 10000 // Unlimited
#define Soc_MAX_REC_PUBS_TO_GET_AND_SHOW 10 // Recent publishings to show (first time) #define Soc_MAX_REC_PUBS_TO_GET_AND_SHOW 20 // Recent publishings to show (first time)
#define Soc_MAX_OLD_PUBS_TO_GET_AND_SHOW 10 // IMPORTANT: If you change this number, #define Soc_MAX_OLD_PUBS_TO_GET_AND_SHOW 20 // IMPORTANT: If you change this number,
// set also this constant // set also this constant to the new value
// to the new value in JavaScript // in JavaScript function readOldTimelineData
#define Soc_MAX_LENGTH_ID (32+Cry_LENGTH_ENCRYPTED_STR_SHA256_BASE64+10+1) #define Soc_MAX_LENGTH_ID (32+Cry_LENGTH_ENCRYPTED_STR_SHA256_BASE64+10+1)
@ -1217,7 +1217,7 @@ static void Soc_WriteTopPublisher (const struct SocialPublishing *SocPub)
/***** Get user's data *****/ /***** Get user's data *****/
UsrDat.UsrCod = SocPub->PublisherCod; UsrDat.UsrCod = SocPub->PublisherCod;
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // TODO: Optimize with a specialized function, we only need FullName if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // Really we only need EncryptedUsrCod and FullName
{ {
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_TOP_CONTAINER SOCIAL_TOP_PUBLISHER\">"); fprintf (Gbl.F.Out,"<div class=\"SOCIAL_TOP_CONTAINER SOCIAL_TOP_PUBLISHER\">");

View File

@ -271,7 +271,7 @@ void Sta_LogAccess (const char *Comments)
{ {
char Query[2048]; char Query[2048];
long LogCod; long LogCod;
Rol_Role_t RoleToStore = (Gbl.CurrentAct == ActLogOut) ? Gbl.Usrs.Me.LoggedRoleBeforeCloseSession : Rol_Role_t RoleToStore = (Gbl.Action.Act == ActLogOut) ? Gbl.Usrs.Me.LoggedRoleBeforeCloseSession :
Gbl.Usrs.Me.LoggedRole; Gbl.Usrs.Me.LoggedRole;
/***** Insert access into database *****/ /***** Insert access into database *****/
@ -280,7 +280,7 @@ void Sta_LogAccess (const char *Comments)
"Role,ClickTime,TimeToGenerate,TimeToSend,IP)" "Role,ClickTime,TimeToGenerate,TimeToSend,IP)"
" VALUES ('%ld','%ld','%ld','%ld','%ld','%ld','%ld'," " VALUES ('%ld','%ld','%ld','%ld','%ld','%ld','%ld',"
"'%u',NOW(),'%ld','%ld','%s')", "'%u',NOW(),'%ld','%ld','%s')",
Act_Actions[Gbl.CurrentAct].ActCod, Act_Actions[Gbl.Action.Act].ActCod,
Gbl.CurrentCty.Cty.CtyCod, Gbl.CurrentCty.Cty.CtyCod,
Gbl.CurrentIns.Ins.InsCod, Gbl.CurrentIns.Ins.InsCod,
Gbl.CurrentCtr.Ctr.CtrCod, Gbl.CurrentCtr.Ctr.CtrCod,
@ -305,7 +305,7 @@ void Sta_LogAccess (const char *Comments)
"Role,ClickTime,TimeToGenerate,TimeToSend,IP)" "Role,ClickTime,TimeToGenerate,TimeToSend,IP)"
" VALUES ('%ld','%ld','%ld','%ld','%ld','%ld','%ld','%ld'," " VALUES ('%ld','%ld','%ld','%ld','%ld','%ld','%ld','%ld',"
"'%u',NOW(),'%ld','%ld','%s')", "'%u',NOW(),'%ld','%ld','%s')",
LogCod,Act_Actions[Gbl.CurrentAct].ActCod, LogCod,Act_Actions[Gbl.Action.Act].ActCod,
Gbl.CurrentCty.Cty.CtyCod, Gbl.CurrentCty.Cty.CtyCod,
Gbl.CurrentIns.Ins.InsCod, Gbl.CurrentIns.Ins.InsCod,
Gbl.CurrentCtr.Ctr.CtrCod, Gbl.CurrentCtr.Ctr.CtrCod,
@ -1423,7 +1423,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
DB_FreeMySQLResult (&mysql_res); DB_FreeMySQLResult (&mysql_res);
/***** Free the memory used by the list of users *****/ /***** Free the memory used by the list of users *****/
if (Gbl.CurrentAct == ActSeeAccCrs) if (Gbl.Action.Act == ActSeeAccCrs)
Usr_FreeListsSelectedUsrCods (); Usr_FreeListsSelectedUsrCods ();
/***** Free memory used by the data of the user *****/ /***** Free memory used by the data of the user *****/
@ -2037,14 +2037,14 @@ static void Sta_ShowDistrAccessesPerDaysAndHour (unsigned long NumRows,MYSQL_RES
"<td colspan=\"26\" class=\"%s CENTER_MIDDLE\">", "<td colspan=\"26\" class=\"%s CENTER_MIDDLE\">",
The_ClassForm[Gbl.Prefs.Theme]); The_ClassForm[Gbl.Prefs.Theme]);
Act_FormStartAnchor (Gbl.CurrentAct,"stat_form"); Act_FormStartAnchor (Gbl.Action.Act,"stat_form");
Sta_WriteParamsDatesSeeAccesses (); Sta_WriteParamsDatesSeeAccesses ();
Par_PutHiddenParamUnsigned ("GroupedBy",(unsigned) Gbl.Stat.ClicksGroupedBy); Par_PutHiddenParamUnsigned ("GroupedBy",(unsigned) Gbl.Stat.ClicksGroupedBy);
Par_PutHiddenParamUnsigned ("CountType",(unsigned) Gbl.Stat.CountType); Par_PutHiddenParamUnsigned ("CountType",(unsigned) Gbl.Stat.CountType);
Par_PutHiddenParamUnsigned ("StatAct",(unsigned) Gbl.Stat.NumAction); Par_PutHiddenParamUnsigned ("StatAct",(unsigned) Gbl.Stat.NumAction);
if (Gbl.CurrentAct == ActSeeAccCrs) if (Gbl.Action.Act == ActSeeAccCrs)
Usr_PutHiddenParUsrCodAll (ActSeeAccCrs,Gbl.Usrs.Select.All); Usr_PutHiddenParUsrCodAll (ActSeeAccCrs,Gbl.Usrs.Select.All);
else // Gbl.CurrentAct == ActSeeAccGbl else // Gbl.Action.Act == ActSeeAccGbl
{ {
Par_PutHiddenParamUnsigned ("Role",(unsigned) Gbl.Stat.Role); Par_PutHiddenParamUnsigned ("Role",(unsigned) Gbl.Stat.Role);
Sco_PutParamScope (Gbl.Scope.Current); Sco_PutParamScope (Gbl.Scope.Current);

View File

@ -2226,7 +2226,7 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst,ch
unsigned NumAns,NumAnswers = 0; unsigned NumAns,NumAnswers = 0;
Svy_AnswerType_t AnsType; Svy_AnswerType_t AnsType;
if (Gbl.CurrentAct == ActEdiOneSvyQst) // If no receiving the question, but editing a new or existing question if (Gbl.Action.Act == ActEdiOneSvyQst) // If no receiving the question, but editing a new or existing question
{ {
if ((SvyQst->QstCod > 0)) // If parameter QstCod received ==> question already exists in the database if ((SvyQst->QstCod > 0)) // If parameter QstCod received ==> question already exists in the database
{ {
@ -2781,9 +2781,9 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ
MYSQL_ROW row; MYSQL_ROW row;
unsigned NumQsts; unsigned NumQsts;
unsigned NumQst; unsigned NumQst;
bool Editing = (Gbl.CurrentAct == ActEdiOneSvy || bool Editing = (Gbl.Action.Act == ActEdiOneSvy ||
Gbl.CurrentAct == ActEdiOneSvyQst || Gbl.Action.Act == ActEdiOneSvyQst ||
Gbl.CurrentAct == ActRcvSvyQst); Gbl.Action.Act == ActRcvSvyQst);
bool PutFormAnswerSurvey = Svy->Status.ICanAnswer && !Editing; bool PutFormAnswerSurvey = Svy->Status.ICanAnswer && !Editing;
/***** Get data of questions from database *****/ /***** Get data of questions from database *****/

View File

@ -190,8 +190,8 @@ void Syl_EditSyllabus (void)
/***** Set syllabus type and load syllabus from XML file to memory *****/ /***** Set syllabus type and load syllabus from XML file to memory *****/
InfoType = Syl_SetSyllabusTypeAndLoadToMemory (); InfoType = Syl_SetSyllabusTypeAndLoadToMemory ();
if (Gbl.CurrentAct == ActEditorSylLec || if (Gbl.Action.Act == ActEditorSylLec ||
Gbl.CurrentAct == ActEditorSylPra) Gbl.Action.Act == ActEditorSylPra)
Gbl.CurrentCrs.Syllabus.EditionIsActive = true; Gbl.CurrentCrs.Syllabus.EditionIsActive = true;
if (Gbl.CurrentCrs.Syllabus.EditionIsActive || LstItemsSyllabus.NumItems) if (Gbl.CurrentCrs.Syllabus.EditionIsActive || LstItemsSyllabus.NumItems)
@ -243,7 +243,7 @@ static Inf_InfoType_t Syl_SetSyllabusTypeAndLoadToMemory (void)
Inf_InfoType_t InfoType = Inf_LECTURES; // Initialized to avoid warning Inf_InfoType_t InfoType = Inf_LECTURES; // Initialized to avoid warning
/***** Set the type of syllabus (lectures or practicals) *****/ /***** Set the type of syllabus (lectures or practicals) *****/
switch (Gbl.CurrentAct) switch (Gbl.Action.Act)
{ {
case ActSeeSyl: case ActSeeSyl:
InfoType = (Gbl.CurrentCrs.Syllabus.WhichSyllabus == Syl_LECTURES ? Inf_LECTURES : InfoType = (Gbl.CurrentCrs.Syllabus.WhichSyllabus == Syl_LECTURES ? Inf_LECTURES :
@ -483,10 +483,10 @@ static void Syl_ShowSyllabus (Inf_InfoType_t InfoType)
int i; int i;
int NumButtons = Gbl.CurrentCrs.Syllabus.EditionIsActive ? 5 : int NumButtons = Gbl.CurrentCrs.Syllabus.EditionIsActive ? 5 :
0; 0;
bool ShowRowInsertNewItem = (Gbl.CurrentAct == ActInsIteSylLec || Gbl.CurrentAct == ActInsIteSylPra || bool ShowRowInsertNewItem = (Gbl.Action.Act == ActInsIteSylLec || Gbl.Action.Act == ActInsIteSylPra ||
Gbl.CurrentAct == ActModIteSylLec || Gbl.CurrentAct == ActModIteSylPra || Gbl.Action.Act == ActModIteSylLec || Gbl.Action.Act == ActModIteSylPra ||
Gbl.CurrentAct == ActRgtIteSylLec || Gbl.CurrentAct == ActRgtIteSylPra || Gbl.Action.Act == ActRgtIteSylLec || Gbl.Action.Act == ActRgtIteSylPra ||
Gbl.CurrentAct == ActLftIteSylLec || Gbl.CurrentAct == ActLftIteSylPra); Gbl.Action.Act == ActLftIteSylLec || Gbl.Action.Act == ActLftIteSylPra);
/***** Set width of columns of the table *****/ /***** Set width of columns of the table *****/
fprintf (Gbl.F.Out,"<colgroup>"); fprintf (Gbl.F.Out,"<colgroup>");

View File

@ -102,9 +102,9 @@ void Tab_DrawTabs (void)
ICanViewTab = Tab_CheckIfICanViewTab (NumTab); ICanViewTab = Tab_CheckIfICanViewTab (NumTab);
/* If current tab is unknown, then activate the first one with access allowed */ /* If current tab is unknown, then activate the first one with access allowed */
if (Gbl.CurrentTab == TabUnk) if (Gbl.Action.Tab == TabUnk)
{ {
Gbl.CurrentTab = NumTab; Gbl.Action.Tab = NumTab;
Tab_DisableIncompatibleTabs (); Tab_DisableIncompatibleTabs ();
} }
@ -112,20 +112,20 @@ void Tab_DrawTabs (void)
{ {
/* Form, icon (at top) and text (at bottom) of the tab */ /* Form, icon (at top) and text (at bottom) of the tab */
fprintf (Gbl.F.Out,"<li class=\"%s %s\">", fprintf (Gbl.F.Out,"<li class=\"%s %s\">",
NumTab == Gbl.CurrentTab ? "TAB_ON" : NumTab == Gbl.Action.Tab ? "TAB_ON" :
"TAB_OFF", "TAB_OFF",
NumTab == Gbl.CurrentTab ? The_TabOnBgColors[Gbl.Prefs.Theme] : NumTab == Gbl.Action.Tab ? The_TabOnBgColors[Gbl.Prefs.Theme] :
The_TabOffBgColors[Gbl.Prefs.Theme]); The_TabOffBgColors[Gbl.Prefs.Theme]);
if (ICanViewTab) if (ICanViewTab)
{ {
fprintf (Gbl.F.Out,"<div"); // This div must be present even in current tab in order to render properly the tab fprintf (Gbl.F.Out,"<div"); // This div must be present even in current tab in order to render properly the tab
if (NumTab != Gbl.CurrentTab) if (NumTab != Gbl.Action.Tab)
fprintf (Gbl.F.Out," class=\"ICON_HIGHLIGHT\""); fprintf (Gbl.F.Out," class=\"ICON_HIGHLIGHT\"");
fprintf (Gbl.F.Out,">"); fprintf (Gbl.F.Out,">");
Act_FormStart (ActMnu); Act_FormStart (ActMnu);
Par_PutHiddenParamUnsigned ("NxtTab",(unsigned) NumTab); Par_PutHiddenParamUnsigned ("NxtTab",(unsigned) NumTab);
Act_LinkFormSubmit (Txt_TABS_FULL_TXT[NumTab], Act_LinkFormSubmit (Txt_TABS_FULL_TXT[NumTab],
NumTab == Gbl.CurrentTab ? The_ClassTxtTabOn[Gbl.Prefs.Theme] : NumTab == Gbl.Action.Tab ? The_ClassTxtTabOn[Gbl.Prefs.Theme] :
The_ClassTxtTabOff[Gbl.Prefs.Theme]); The_ClassTxtTabOff[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"<img src=\"%s/%s/%s\"" fprintf (Gbl.F.Out,"<img src=\"%s/%s/%s\""
" alt=\"%s\" title=\"%s\"" " alt=\"%s\" title=\"%s\""
@ -136,7 +136,7 @@ void Tab_DrawTabs (void)
Tab_TabIcons[NumTab], Tab_TabIcons[NumTab],
Txt_TABS_FULL_TXT[NumTab], Txt_TABS_FULL_TXT[NumTab],
Txt_TABS_FULL_TXT[NumTab], Txt_TABS_FULL_TXT[NumTab],
NumTab == Gbl.CurrentTab ? The_ClassTxtTabOn[Gbl.Prefs.Theme] : NumTab == Gbl.Action.Tab ? The_ClassTxtTabOn[Gbl.Prefs.Theme] :
The_ClassTxtTabOff[Gbl.Prefs.Theme], The_ClassTxtTabOff[Gbl.Prefs.Theme],
Txt_TABS_SHORT_TXT[NumTab]); Txt_TABS_SHORT_TXT[NumTab]);
Act_FormEnd (); Act_FormEnd ();
@ -211,15 +211,15 @@ void Tab_DrawBreadcrumb (void)
/***** Home *****/ /***** Home *****/
Tab_WriteBreadcrumbHome (); Tab_WriteBreadcrumbHome ();
if (Gbl.CurrentAct == ActMnu || if (Gbl.Action.Act == ActMnu ||
Act_Actions[Act_Actions[Gbl.CurrentAct].SuperAction].IndexInMenu >= 0) Act_Actions[Act_Actions[Gbl.Action.Act].SuperAction].IndexInMenu >= 0)
{ {
/***** Tab *****/ /***** Tab *****/
fprintf (Gbl.F.Out,"<span class=\"%s\"> &gt; </span>", fprintf (Gbl.F.Out,"<span class=\"%s\"> &gt; </span>",
The_ClassTxtTabOn[Gbl.Prefs.Theme]); The_ClassTxtTabOn[Gbl.Prefs.Theme]);
Tab_WriteBreadcrumbTab (); Tab_WriteBreadcrumbTab ();
if (Act_Actions[Act_Actions[Gbl.CurrentAct].SuperAction].IndexInMenu >= 0) if (Act_Actions[Act_Actions[Gbl.Action.Act].SuperAction].IndexInMenu >= 0)
{ {
/***** Menu *****/ /***** Menu *****/
fprintf (Gbl.F.Out,"<span class=\"%s\"> &gt; </span>", fprintf (Gbl.F.Out,"<span class=\"%s\"> &gt; </span>",
@ -258,12 +258,12 @@ static void Tab_WriteBreadcrumbTab (void)
/***** Start form *****/ /***** Start form *****/
Act_FormStart (ActMnu); Act_FormStart (ActMnu);
Par_PutHiddenParamUnsigned ("NxtTab",(unsigned) Gbl.CurrentTab); Par_PutHiddenParamUnsigned ("NxtTab",(unsigned) Gbl.Action.Tab);
Act_LinkFormSubmit (Txt_TABS_FULL_TXT[Gbl.CurrentTab],The_ClassTxtTabOn[Gbl.Prefs.Theme]); Act_LinkFormSubmit (Txt_TABS_FULL_TXT[Gbl.Action.Tab],The_ClassTxtTabOn[Gbl.Prefs.Theme]);
/***** Title and end of form *****/ /***** Title and end of form *****/
fprintf (Gbl.F.Out,"%s</a>", fprintf (Gbl.F.Out,"%s</a>",
Txt_TABS_FULL_TXT[Gbl.CurrentTab]); Txt_TABS_FULL_TXT[Gbl.Action.Tab]);
Act_FormEnd (); Act_FormEnd ();
} }
@ -274,10 +274,10 @@ static void Tab_WriteBreadcrumbTab (void)
static void Tab_WriteBreadcrumbAction (void) static void Tab_WriteBreadcrumbAction (void)
{ {
extern const char *The_ClassTxtTabOn[The_NUM_THEMES]; extern const char *The_ClassTxtTabOn[The_NUM_THEMES];
const char *Title = Act_GetTitleAction (Gbl.CurrentAct); const char *Title = Act_GetTitleAction (Gbl.Action.Act);
/***** Start form *****/ /***** Start form *****/
Act_FormStart (Act_Actions[Gbl.CurrentAct].SuperAction); Act_FormStart (Act_Actions[Gbl.Action.Act].SuperAction);
Act_LinkFormSubmit (Title,The_ClassTxtTabOn[Gbl.Prefs.Theme]); Act_LinkFormSubmit (Title,The_ClassTxtTabOn[Gbl.Prefs.Theme]);
/***** Title and end of form *****/ /***** Title and end of form *****/
@ -292,53 +292,53 @@ static void Tab_WriteBreadcrumbAction (void)
void Tab_SetCurrentTab (void) void Tab_SetCurrentTab (void)
{ {
Gbl.CurrentTab = Act_Actions[Gbl.CurrentAct].Tab; Gbl.Action.Tab = Act_Actions[Gbl.Action.Act].Tab;
/***** Change action and tab if country, institution, centre or degree /***** Change action and tab if country, institution, centre or degree
are incompatible with the current tab *****/ are incompatible with the current tab *****/
switch (Gbl.CurrentTab) switch (Gbl.Action.Tab)
{ {
case TabCty: case TabCty:
if (Gbl.CurrentCty.Cty.CtyCod <= 0) // No country selected if (Gbl.CurrentCty.Cty.CtyCod <= 0) // No country selected
Gbl.CurrentAct = ActSeeCty; Gbl.Action.Act = ActSeeCty;
break; break;
case TabIns: case TabIns:
if (Gbl.CurrentIns.Ins.InsCod <= 0) // No institution selected if (Gbl.CurrentIns.Ins.InsCod <= 0) // No institution selected
{ {
if (Gbl.CurrentCty.Cty.CtyCod > 0) // Country selected, but no institution selected if (Gbl.CurrentCty.Cty.CtyCod > 0) // Country selected, but no institution selected
Gbl.CurrentAct = ActSeeIns; Gbl.Action.Act = ActSeeIns;
else // No country selected else // No country selected
Gbl.CurrentAct = ActSeeCty; Gbl.Action.Act = ActSeeCty;
} }
break; break;
case TabCtr: case TabCtr:
if (Gbl.CurrentCtr.Ctr.CtrCod <= 0) // No centre selected if (Gbl.CurrentCtr.Ctr.CtrCod <= 0) // No centre selected
{ {
if (Gbl.CurrentIns.Ins.InsCod > 0) // Institution selected, but no centre selected if (Gbl.CurrentIns.Ins.InsCod > 0) // Institution selected, but no centre selected
Gbl.CurrentAct = ActSeeCtr; Gbl.Action.Act = ActSeeCtr;
else if (Gbl.CurrentCty.Cty.CtyCod > 0) // Country selected, but no institution selected else if (Gbl.CurrentCty.Cty.CtyCod > 0) // Country selected, but no institution selected
Gbl.CurrentAct = ActSeeIns; Gbl.Action.Act = ActSeeIns;
else // No country selected else // No country selected
Gbl.CurrentAct = ActSeeCty; Gbl.Action.Act = ActSeeCty;
} }
break; break;
case TabDeg: case TabDeg:
if (Gbl.CurrentDeg.Deg.DegCod <= 0) // No degree selected if (Gbl.CurrentDeg.Deg.DegCod <= 0) // No degree selected
{ {
if (Gbl.CurrentCtr.Ctr.CtrCod > 0) // Centre selected, but no degree selected if (Gbl.CurrentCtr.Ctr.CtrCod > 0) // Centre selected, but no degree selected
Gbl.CurrentAct = ActSeeDeg; Gbl.Action.Act = ActSeeDeg;
else if (Gbl.CurrentIns.Ins.InsCod > 0) // Institution selected, but no centre selected else if (Gbl.CurrentIns.Ins.InsCod > 0) // Institution selected, but no centre selected
Gbl.CurrentAct = ActSeeCtr; Gbl.Action.Act = ActSeeCtr;
else if (Gbl.CurrentCty.Cty.CtyCod > 0) // Country selected, but no institution selected else if (Gbl.CurrentCty.Cty.CtyCod > 0) // Country selected, but no institution selected
Gbl.CurrentAct = ActSeeIns; Gbl.Action.Act = ActSeeIns;
else // No country selected else // No country selected
Gbl.CurrentAct = ActSeeCty; Gbl.Action.Act = ActSeeCty;
} }
break; break;
default: default:
break; break;
} }
Gbl.CurrentTab = Act_Actions[Gbl.CurrentAct].Tab; Gbl.Action.Tab = Act_Actions[Gbl.Action.Act].Tab;
Tab_DisableIncompatibleTabs (); Tab_DisableIncompatibleTabs ();
} }
@ -351,7 +351,7 @@ void Tab_DisableIncompatibleTabs (void)
{ {
/***** Set country, institution, centre, degree and course depending on the current tab. /***** Set country, institution, centre, degree and course depending on the current tab.
This will disable tabs incompatible with the current one. *****/ This will disable tabs incompatible with the current one. *****/
switch (Gbl.CurrentTab) switch (Gbl.Action.Tab)
{ {
case TabSys: case TabSys:
Gbl.CurrentCty.Cty.CtyCod = -1L; Gbl.CurrentCty.Cty.CtyCod = -1L;

View File

@ -739,7 +739,7 @@ static void Tst_WriteTestHead (unsigned NumTst)
extern const char *Txt_Test_No_X_that_you_make_in_this_course; extern const char *Txt_Test_No_X_that_you_make_in_this_course;
/***** Start table *****/ /***** Start table *****/
Lay_StartRoundFrameTable (NULL,2,Gbl.CurrentAct == ActSeeTst ? Txt_Test : Lay_StartRoundFrameTable (NULL,2,Gbl.Action.Act == ActSeeTst ? Txt_Test :
Txt_Test_result); Txt_Test_result);
Lay_WriteHeaderClassPhoto (3,false,false, Lay_WriteHeaderClassPhoto (3,false,false,
Gbl.CurrentIns.Ins.InsCod, Gbl.CurrentIns.Ins.InsCod,
@ -747,7 +747,7 @@ static void Tst_WriteTestHead (unsigned NumTst)
Gbl.CurrentCrs.Crs.CrsCod); Gbl.CurrentCrs.Crs.CrsCod);
/***** Header row *****/ /***** Header row *****/
if (Gbl.CurrentAct == ActAssTst && if (Gbl.Action.Act == ActAssTst &&
Gbl.Usrs.Me.IBelongToCurrentCrs) Gbl.Usrs.Me.IBelongToCurrentCrs)
{ {
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
@ -970,7 +970,7 @@ static void Tst_WriteQstAndAnsExam (unsigned NumQst,long QstCod,MYSQL_ROW row,
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP COLOR%u\">", fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP COLOR%u\">",
Gbl.RowEvenOdd); Gbl.RowEvenOdd);
Tst_WriteQstStem (row[4],"TEST_EXA"); Tst_WriteQstStem (row[4],"TEST_EXA");
if (Gbl.CurrentAct == ActSeeTst) if (Gbl.Action.Act == ActSeeTst)
Tst_WriteAnswersOfAQstSeeExam (NumQst,QstCod,(Str_ConvertToUpperLetter (row[3][0]) == 'Y')); Tst_WriteAnswersOfAQstSeeExam (NumQst,QstCod,(Str_ConvertToUpperLetter (row[3][0]) == 'Y'));
else // Assessing exam / Viewing old exam else // Assessing exam / Viewing old exam
{ {
@ -3893,7 +3893,7 @@ static int Tst_GetParamsTst (void)
} }
/***** Get other parameters, depending on action *****/ /***** Get other parameters, depending on action *****/
if (Gbl.CurrentAct == ActSeeTst) if (Gbl.Action.Act == ActSeeTst)
{ {
Tst_GetParamNumQst (); Tst_GetParamNumQst ();
if (Gbl.Test.NumQsts < Gbl.Test.Config.Min || if (Gbl.Test.NumQsts < Gbl.Test.Config.Min ||
@ -4093,7 +4093,7 @@ static void Tst_PutFormEditOneQst (char *Stem,char *Feedback)
bool TagNotFound; bool TagNotFound;
bool OptionsDisabled; bool OptionsDisabled;
if (Gbl.CurrentAct == ActEdiOneTstQst) // If no receiving the question, but editing a new or existing question if (Gbl.Action.Act == ActEdiOneTstQst) // If no receiving the question, but editing a new or existing question
{ {
Tst_InitQst (); Tst_InitQst ();
if (Tst_GetQstCod ()) // If parameter QstCod received ==> question already exists in the database if (Tst_GetQstCod ()) // If parameter QstCod received ==> question already exists in the database
@ -6347,7 +6347,7 @@ static void Tst_ShowResultsOfTestExams (struct UsrData *UsrDat)
Gbl.RowEvenOdd); Gbl.RowEvenOdd);
if (ICanViewExam) if (ICanViewExam)
{ {
Act_FormStart (Gbl.CurrentAct == ActSeeMyTstExa ? ActSeeOneTstExaMe : Act_FormStart (Gbl.Action.Act == ActSeeMyTstExa ? ActSeeOneTstExaMe :
ActSeeOneTstExaOth); ActSeeOneTstExaOth);
Tst_PutParamTstCod (TstCod); Tst_PutParamTstCod (TstCod);
fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/file64x64.gif\"" fprintf (Gbl.F.Out,"<input type=\"image\" src=\"%s/file64x64.gif\""
@ -6544,7 +6544,7 @@ void Tst_ShowOneTestExam (void)
Tst_GetExamDataByTstCod (TstCod,&TstTimeUTC,&Gbl.Test.NumQsts,&NumQstsNotBlank,&TotalScore); Tst_GetExamDataByTstCod (TstCod,&TstTimeUTC,&Gbl.Test.NumQsts,&NumQstsNotBlank,&TotalScore);
Gbl.Test.Config.FeedbackType = Tst_FEEDBACK_FULL_FEEDBACK; // Initialize feedback to maximum Gbl.Test.Config.FeedbackType = Tst_FEEDBACK_FULL_FEEDBACK; // Initialize feedback to maximum
ICanViewScore = true; ICanViewScore = true;
switch (Gbl.CurrentAct) switch (Gbl.Action.Act)
{ {
case ActSeeOneTstExaMe: case ActSeeOneTstExaMe:
if (Gbl.Usrs.Other.UsrDat.UsrCod != Gbl.Usrs.Me.UsrDat.UsrCod) // The exam is not mine if (Gbl.Usrs.Other.UsrDat.UsrCod != Gbl.Usrs.Me.UsrDat.UsrCod) // The exam is not mine

View File

@ -231,7 +231,7 @@ void TT_ShowClassTimeTable (void)
bool PutEditOfficeHours; bool PutEditOfficeHours;
/***** Initializations *****/ /***** Initializations *****/
switch (Gbl.CurrentAct) switch (Gbl.Action.Act)
{ {
case ActSeeCrsTT: case ActSeeCrsTT:
case ActPrnCrsTT: case ActPrnCrsTT:
@ -246,8 +246,8 @@ void TT_ShowClassTimeTable (void)
default: default:
Lay_ShowErrorAndExit ("Wrong action."); Lay_ShowErrorAndExit ("Wrong action.");
} }
PrintView = (Gbl.CurrentAct == ActPrnCrsTT || PrintView = (Gbl.Action.Act == ActPrnCrsTT ||
Gbl.CurrentAct == ActPrnMyTT); Gbl.Action.Act == ActPrnMyTT);
PutEditCrsTT = (TimeTableType == TT_COURSE_TIMETABLE && PutEditCrsTT = (TimeTableType == TT_COURSE_TIMETABLE &&
!PrintView && !PrintView &&
Gbl.Usrs.Me.LoggedRole >= Rol_TEACHER); Gbl.Usrs.Me.LoggedRole >= Rol_TEACHER);
@ -383,8 +383,8 @@ void TT_ShowTimeTable (TT_TimeTableType_t TimeTableType,long UsrCod)
TT_CreatTimeTableFromDB (TimeTableType,UsrCod); TT_CreatTimeTableFromDB (TimeTableType,UsrCod);
/***** If timetable must be modified... *****/ /***** If timetable must be modified... *****/
if (Gbl.CurrentAct == ActChgCrsTT || if (Gbl.Action.Act == ActChgCrsTT ||
Gbl.CurrentAct == ActChgTut) Gbl.Action.Act == ActChgTut)
{ {
/* Get parameters for time table editing */ /* Get parameters for time table editing */
TT_GetParamsTimeTable (); TT_GetParamsTimeTable ();
@ -571,8 +571,8 @@ static void TT_CreatTimeTableFromDB (TT_TimeTableType_t TimeTableType,long UsrCo
break; break;
case TT_COURSE_TIMETABLE: case TT_COURSE_TIMETABLE:
if (Gbl.CurrentCrs.Grps.WhichGrps == Grp_ALL_GROUPS || if (Gbl.CurrentCrs.Grps.WhichGrps == Grp_ALL_GROUPS ||
Gbl.CurrentAct == ActEdiCrsTT || Gbl.Action.Act == ActEdiCrsTT ||
Gbl.CurrentAct == ActChgCrsTT) // If we are editing, all groups are shown Gbl.Action.Act == ActChgCrsTT) // If we are editing, all groups are shown
sprintf (Query,"SELECT Day,Hour,Duration,Place,ClassType,GroupName,GrpCod" sprintf (Query,"SELECT Day,Hour,Duration,Place,ClassType,GroupName,GrpCod"
" FROM timetable_crs" " FROM timetable_crs"
" WHERE CrsCod='%ld'" " WHERE CrsCod='%ld'"
@ -773,7 +773,7 @@ static void TT_DrawTimeTable (TT_TimeTableType_t TimeTableType)
unsigned ColumnsToDrawIncludingExtraColumn; unsigned ColumnsToDrawIncludingExtraColumn;
unsigned ContinuousFreeMinicolumns; unsigned ContinuousFreeMinicolumns;
switch (Gbl.CurrentAct) switch (Gbl.Action.Act)
{ {
case ActSeeCrsTT: case ActPrnCrsTT: case ActChgCrsTT1stDay: case ActSeeCrsTT: case ActPrnCrsTT: case ActChgCrsTT1stDay:
case ActSeeMyTT: case ActPrnMyTT: case ActChgMyTT1stDay: case ActSeeMyTT: case ActPrnMyTT: case ActChgMyTT1stDay:
@ -811,8 +811,8 @@ static void TT_DrawTimeTable (TT_TimeTableType_t TimeTableType)
TT_PERCENT_WIDTH_OF_AN_HOUR_COLUMN,TT_START_HOUR); TT_PERCENT_WIDTH_OF_AN_HOUR_COLUMN,TT_START_HOUR);
/***** Get list of groups types and groups in this course *****/ /***** Get list of groups types and groups in this course *****/
if (Gbl.CurrentAct == ActEdiCrsTT || if (Gbl.Action.Act == ActEdiCrsTT ||
Gbl.CurrentAct == ActChgCrsTT) Gbl.Action.Act == ActChgCrsTT)
Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_ONLY_GROUP_TYPES_WITH_GROUPS); Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_ONLY_GROUP_TYPES_WITH_GROUPS);
/***** Write the table row by row *****/ /***** Write the table row by row *****/
@ -902,8 +902,8 @@ static void TT_DrawTimeTable (TT_TimeTableType_t TimeTableType)
} }
/***** Free list of groups types and groups in this course *****/ /***** Free list of groups types and groups in this course *****/
if (Gbl.CurrentAct == ActEdiCrsTT || if (Gbl.Action.Act == ActEdiCrsTT ||
Gbl.CurrentAct == ActChgCrsTT) Gbl.Action.Act == ActChgCrsTT)
Grp_FreeListGrpTypesAndGrps (); Grp_FreeListGrpTypesAndGrps ();
/***** Row with day names *****/ /***** Row with day names *****/
@ -1109,7 +1109,7 @@ static void TT_TimeTableDrawCell (TT_TimeTableType_t TimeTableType,
return; return;
/***** Set type of view depending on current action *****/ /***** Set type of view depending on current action *****/
switch (Gbl.CurrentAct) switch (Gbl.Action.Act)
{ {
case ActSeeCrsTT: case ActPrnCrsTT: case ActChgCrsTT1stDay: case ActSeeCrsTT: case ActPrnCrsTT: case ActChgCrsTT1stDay:
case ActSeeMyTT: case ActPrnMyTT: case ActChgMyTT1stDay: case ActSeeMyTT: case ActPrnMyTT: case ActChgMyTT1stDay:

View File

@ -196,7 +196,7 @@ void Usr_InformAboutNumClicksBeforePhoto (void)
{ {
if (Gbl.Usrs.Me.NumAccWithoutPhoto >= Pho_MAX_CLICKS_WITHOUT_PHOTO) if (Gbl.Usrs.Me.NumAccWithoutPhoto >= Pho_MAX_CLICKS_WITHOUT_PHOTO)
Lay_ShowAlert (Lay_WARNING,Txt_You_must_send_your_photo_because_); Lay_ShowAlert (Lay_WARNING,Txt_You_must_send_your_photo_because_);
else if (Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW) else if (Act_Actions[Gbl.Action.Act].BrowserWindow == Act_MAIN_WINDOW)
{ {
sprintf (Message,Txt_You_can_only_perform_X_further_actions_, sprintf (Message,Txt_You_can_only_perform_X_further_actions_,
Pho_MAX_CLICKS_WITHOUT_PHOTO-Gbl.Usrs.Me.NumAccWithoutPhoto); Pho_MAX_CLICKS_WITHOUT_PHOTO-Gbl.Usrs.Me.NumAccWithoutPhoto);
@ -249,8 +249,8 @@ void Usr_ResetUsrDataExceptUsrCodAndIDs (struct UsrData *UsrDat)
UsrDat->EmailConfirmed = false; UsrDat->EmailConfirmed = false;
UsrDat->Photo[0] = '\0'; UsrDat->Photo[0] = '\0';
UsrDat->PhotoVisibility = UsrDat->PhotoVisibility = Pri_PHOTO_VISIBILITY_DEFAULT;
UsrDat->ProfileVisibility = Pri_VISIBILITY_DEFAULT; UsrDat->ProfileVisibility = Pri_PROFILE_VISIBILITY_DEFAULT;
UsrDat->CtyCod = -1L; UsrDat->CtyCod = -1L;
UsrDat->OriginPlace[0] = '\0'; UsrDat->OriginPlace[0] = '\0';
@ -486,8 +486,8 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat)
/* Get rest of data */ /* Get rest of data */
strncpy (UsrDat->Photo,row[10],sizeof (UsrDat->Photo) - 1); strncpy (UsrDat->Photo,row[10],sizeof (UsrDat->Photo) - 1);
UsrDat->Photo[sizeof (UsrDat->Photo) - 1] = '\0'; UsrDat->Photo[sizeof (UsrDat->Photo) - 1] = '\0';
UsrDat->PhotoVisibility = Pri_GetVisibilityFromStr (row[11]); UsrDat->PhotoVisibility = Pri_GetVisibilityFromStr (row[11],Pri_PHOTO_VISIBILITY_DEFAULT);
UsrDat->ProfileVisibility = Pri_GetVisibilityFromStr (row[12]); UsrDat->ProfileVisibility = Pri_GetVisibilityFromStr (row[12],Pri_PROFILE_VISIBILITY_DEFAULT);
UsrDat->CtyCod = Str_ConvertStrCodToLongCod (row[13]); UsrDat->CtyCod = Str_ConvertStrCodToLongCod (row[13]);
UsrDat->InsCtyCod = Str_ConvertStrCodToLongCod (row[14]); UsrDat->InsCtyCod = Str_ConvertStrCodToLongCod (row[14]);
UsrDat->InsCod = Str_ConvertStrCodToLongCod (row[15]); UsrDat->InsCod = Str_ConvertStrCodToLongCod (row[15]);
@ -1863,9 +1863,9 @@ void Usr_ChkUsrAndGetUsrData (void)
if (Gbl.Session.HasBeenDisconnected) if (Gbl.Session.HasBeenDisconnected)
{ {
if (Gbl.CurrentAct != ActRefCon) if (Gbl.Action.Act != ActRefCon)
{ {
Gbl.CurrentAct = ActLogOut; Gbl.Action.Act = ActLogOut;
Tab_SetCurrentTab (); Tab_SetCurrentTab ();
Lay_ShowAlert (Lay_WARNING,Txt_The_session_has_expired_due_to_inactivity); Lay_ShowAlert (Lay_WARNING,Txt_The_session_has_expired_due_to_inactivity);
PutFormLogin = true; PutFormLogin = true;
@ -1874,7 +1874,7 @@ void Usr_ChkUsrAndGetUsrData (void)
else // !Gbl.Session.HasBeenDisconnected else // !Gbl.Session.HasBeenDisconnected
{ {
/***** Check user and get user's data *****/ /***** Check user and get user's data *****/
if (Gbl.CurrentAct == ActCreUsrAcc) if (Gbl.Action.Act == ActCreUsrAcc)
{ {
/***** Create new account and login *****/ /***** Create new account and login *****/
if (Acc_CreateNewAccountAndLogIn ()) // User logged in if (Acc_CreateNewAccountAndLogIn ()) // User logged in
@ -1892,7 +1892,7 @@ void Usr_ChkUsrAndGetUsrData (void)
Mai_SendMailMsgToConfirmEmail (); Mai_SendMailMsgToConfirmEmail ();
} }
} }
else // Gbl.CurrentAct != ActCreUsrAcc else // Gbl.Action.Act != ActCreUsrAcc
{ {
/***** Check user and get user's data *****/ /***** Check user and get user's data *****/
if (Gbl.Session.IsOpen) if (Gbl.Session.IsOpen)
@ -1902,7 +1902,7 @@ void Usr_ChkUsrAndGetUsrData (void)
Gbl.Usrs.Me.Logged = true; Gbl.Usrs.Me.Logged = true;
Usr_SetUsrRoleAndPrefs (); Usr_SetUsrRoleAndPrefs ();
if (Gbl.CurrentAct == ActRefCon) // If refreshing connected users ==> don't refresh session if (Gbl.Action.Act == ActRefCon) // If refreshing connected users ==> don't refresh session
Ses_UpdateSessionLastRefreshInDB (); Ses_UpdateSessionLastRefreshInDB ();
else else
{ {
@ -1914,7 +1914,7 @@ void Usr_ChkUsrAndGetUsrData (void)
else else
PutFormLogin = true; PutFormLogin = true;
} }
else if (Gbl.CurrentAct == ActAutUsrInt) else if (Gbl.Action.Act == ActAutUsrInt)
{ {
if (Usr_ChkUsrAndGetUsrDataFromDirectLogin ()) // User logged in if (Usr_ChkUsrAndGetUsrDataFromDirectLogin ()) // User logged in
{ {
@ -1929,7 +1929,7 @@ void Usr_ChkUsrAndGetUsrData (void)
else else
PutFormLogin = true; PutFormLogin = true;
} }
else if (Gbl.CurrentAct == ActAutUsrExt) else if (Gbl.Action.Act == ActAutUsrExt)
{ {
if (Usr_ChkUsrAndGetUsrDataFromExternalLogin ()) // User logged in if (Usr_ChkUsrAndGetUsrDataFromExternalLogin ()) // User logged in
{ {
@ -1957,15 +1957,15 @@ void Usr_ChkUsrAndGetUsrData (void)
} }
/***** Adjust tab and action *****/ /***** Adjust tab and action *****/
if (Gbl.CurrentAct != ActRefCon) if (Gbl.Action.Act != ActRefCon)
{ {
if (Gbl.Usrs.Me.Logged) if (Gbl.Usrs.Me.Logged)
{ {
/***** Set default tab when unknown *****/ /***** Set default tab when unknown *****/
if (Gbl.CurrentTab == TabUnk) if (Gbl.Action.Tab == TabUnk)
{ {
// Don't adjust Gbl.CurrentAct here // Don't adjust Gbl.Action.Act here
Gbl.CurrentTab = ((Gbl.Usrs.Me.UsrLast.LastTab == TabCrs) && Gbl.Action.Tab = ((Gbl.Usrs.Me.UsrLast.LastTab == TabCrs) &&
(Gbl.CurrentCrs.Crs.CrsCod <= 0)) ? TabSys : (Gbl.CurrentCrs.Crs.CrsCod <= 0)) ? TabSys :
Gbl.Usrs.Me.UsrLast.LastTab; Gbl.Usrs.Me.UsrLast.LastTab;
Tab_DisableIncompatibleTabs (); Tab_DisableIncompatibleTabs ();
@ -1973,11 +1973,11 @@ void Usr_ChkUsrAndGetUsrData (void)
Usr_UpdateMyLastData (); Usr_UpdateMyLastData ();
Crs_UpdateCrsLast (); Crs_UpdateCrsLast ();
} }
else if (Gbl.CurrentAct == ActUnk) // No user logged and unknown action else if (Gbl.Action.Act == ActUnk) // No user logged and unknown action
Act_AdjustActionWhenNoUsrLogged (); Act_AdjustActionWhenNoUsrLogged ();
/***** When I change to another tab, go to the first option allowed *****/ /***** When I change to another tab, go to the first option allowed *****/
if (Gbl.CurrentAct == ActMnu) if (Gbl.Action.Act == ActMnu)
{ {
if (Gbl.Usrs.Me.Logged) if (Gbl.Usrs.Me.Logged)
{ {
@ -1987,7 +1987,7 @@ void Usr_ChkUsrAndGetUsrData (void)
else else
Action = Mnu_GetFirstActionAvailableInCurrentTab (); Action = Mnu_GetFirstActionAvailableInCurrentTab ();
if (Action != ActUnk) if (Action != ActUnk)
Gbl.CurrentAct = Action; Gbl.Action.Act = Action;
} }
} }
} }
@ -2386,8 +2386,8 @@ static void Usr_SetUsrRoleAndPrefs (void)
/***** Get my last data *****/ /***** Get my last data *****/
Usr_GetMyLastData (); Usr_GetMyLastData ();
if (Gbl.CurrentAct == ActAutUsrInt || if (Gbl.Action.Act == ActAutUsrInt ||
Gbl.CurrentAct == ActAutUsrExt) // If I just logged in... Gbl.Action.Act == ActAutUsrExt) // If I just logged in...
{ {
/***** WhatToSearch is stored in session, /***** WhatToSearch is stored in session,
but in login it is got from user's last data *****/ but in login it is got from user's last data *****/
@ -2548,9 +2548,9 @@ void Usr_WarningWhenDegreeTypeDoesntAllowDirectLogin (void)
Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT && // ...and I am a student in the current course... Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_STUDENT && // ...and I am a student in the current course...
!Gbl.CurrentDegTyp.DegTyp.AllowDirectLogIn && // ...but the current degree type... !Gbl.CurrentDegTyp.DegTyp.AllowDirectLogIn && // ...but the current degree type...
!Gbl.CurrentCrs.Crs.AllowDirectLogIn && // ...and the current course do not allow to log in directly !Gbl.CurrentCrs.Crs.AllowDirectLogIn && // ...and the current course do not allow to log in directly
(Gbl.CurrentAct == ActSeeCrsInf || (Gbl.Action.Act == ActSeeCrsInf ||
Gbl.CurrentAct == ActAutUsrInt || Gbl.Action.Act == ActAutUsrInt ||
Gbl.CurrentAct == ActHom)) Gbl.Action.Act == ActHom))
{ {
sprintf (Gbl.Message,Txt_This_course_requires_log_in_from_X_to_have_full_functionality_, sprintf (Gbl.Message,Txt_This_course_requires_log_in_from_X_to_have_full_functionality_,
Cfg_EXTERNAL_LOGIN_URL,Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME, Cfg_EXTERNAL_LOGIN_URL,Cfg_EXTERNAL_LOGIN_SERVICE_SHORT_NAME,
@ -2636,7 +2636,7 @@ void Usr_UpdateMyLastData (void)
sprintf (Query,"UPDATE usr_last SET LastCrs='%ld',LastTab='%u',LastTime=NOW()" sprintf (Query,"UPDATE usr_last SET LastCrs='%ld',LastTab='%u',LastTime=NOW()"
" WHERE UsrCod='%ld'", " WHERE UsrCod='%ld'",
Gbl.CurrentCrs.Crs.CrsCod, Gbl.CurrentCrs.Crs.CrsCod,
(unsigned) Gbl.CurrentTab, (unsigned) Gbl.Action.Tab,
Gbl.Usrs.Me.UsrDat.UsrCod); Gbl.Usrs.Me.UsrDat.UsrCod);
DB_QueryUPDATE (Query,"can not update last user's data"); DB_QueryUPDATE (Query,"can not update last user's data");
} }
@ -2658,7 +2658,7 @@ static void Usr_InsertMyLastData (void)
" VALUES ('%ld','%ld','%u',NOW())", " VALUES ('%ld','%ld','%u',NOW())",
Gbl.Usrs.Me.UsrDat.UsrCod, Gbl.Usrs.Me.UsrDat.UsrCod,
Gbl.CurrentCrs.Crs.CrsCod, Gbl.CurrentCrs.Crs.CrsCod,
(unsigned) Gbl.CurrentTab); (unsigned) Gbl.Action.Tab);
DB_QueryINSERT (Query,"can not insert last user's data"); DB_QueryINSERT (Query,"can not insert last user's data");
} }
/*****************************************************************************/ /*****************************************************************************/
@ -3653,7 +3653,7 @@ static void Usr_BuildQueryToGetUsrsLstCrs (Rol_Role_t Role,const char *UsrQuery,
} }
/***** Create query for users in the course *****/ /***** Create query for users in the course *****/
if (Gbl.CurrentAct == ActReqMsgUsr) // Selecting users to write a message if (Gbl.Action.Act == ActReqMsgUsr) // Selecting users to write a message
sprintf (Query,"SELECT crs_usr.UsrCod,crs_usr.Accepted,usr_data.Sex" sprintf (Query,"SELECT crs_usr.UsrCod,crs_usr.Accepted,usr_data.Sex"
" FROM crs_usr,usr_data" " FROM crs_usr,usr_data"
" WHERE crs_usr.CrsCod='%ld'" " WHERE crs_usr.CrsCod='%ld'"
@ -4539,12 +4539,12 @@ static void Usr_PutButtonToConfirmIWantToSeeBigList (unsigned NumUsrs)
Lay_ShowAlert (Lay_WARNING,Gbl.Message); Lay_ShowAlert (Lay_WARNING,Gbl.Message);
/***** Put form to confirm that I want to see the big list *****/ /***** Put form to confirm that I want to see the big list *****/
Act_FormStart (Gbl.CurrentAct); Act_FormStart (Gbl.Action.Act);
Grp_PutParamsCodGrps (); Grp_PutParamsCodGrps ();
Usr_PutParamUsrListType (Gbl.Usrs.Me.ListType); Usr_PutParamUsrListType (Gbl.Usrs.Me.ListType);
Usr_PutParamColsClassPhoto (); Usr_PutParamColsClassPhoto ();
Usr_PutParamListWithPhotos (); Usr_PutParamListWithPhotos ();
Usr_PutExtraParamsUsrList (Gbl.CurrentAct); Usr_PutExtraParamsUsrList (Gbl.Action.Act);
Par_PutHiddenParamChar ("ShowBigList",'Y'); Par_PutHiddenParamChar ("ShowBigList",'Y');
/***** Send button *****/ /***** Send button *****/
@ -4581,7 +4581,7 @@ void Usr_GetListsSelectedUsrs (void)
/***** Get selected users *****/ /***** Get selected users *****/
if (Gbl.Session.IsOpen) // If the session is open, get parameter from DB if (Gbl.Session.IsOpen) // If the session is open, get parameter from DB
{ {
Ses_GetHiddenParFromDB (Gbl.CurrentAct,"UsrCodAll", Ses_GetHiddenParFromDB (Gbl.Action.Act,"UsrCodAll",
Gbl.Usrs.Select.All,Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS); Gbl.Usrs.Select.All,Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS);
Str_ChangeFormat (Str_FROM_FORM,Str_TO_TEXT, Str_ChangeFormat (Str_FROM_FORM,Str_TO_TEXT,
Gbl.Usrs.Select.All,Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS,true); Gbl.Usrs.Select.All,Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS,true);
@ -5008,7 +5008,7 @@ static void Usr_FormToSelectUsrListType (Act_Action_t NextAction,Usr_ShowUsrsTyp
void Usr_PutExtraParamsUsrList (Act_Action_t NextAction) void Usr_PutExtraParamsUsrList (Act_Action_t NextAction)
{ {
switch (Gbl.CurrentAct) switch (Gbl.Action.Act)
{ {
case ActLstGst: case ActLstGst:
case ActLstStd: case ActLstStd: