mirror of https://github.com/acanas/swad-core.git
Version 15.115
This commit is contained in:
parent
c2c6088807
commit
62e15884a8
|
@ -573,7 +573,7 @@ function readOldTimelineData () {
|
|||
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
|
||||
document.getElementById("view_old_posts_container").style.display = 'none';
|
||||
}
|
2356
swad_action.c
2356
swad_action.c
File diff suppressed because it is too large
Load Diff
|
@ -85,11 +85,14 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica
|
|||
#define ActUnk 1
|
||||
#define ActHom 2
|
||||
#define ActMnu 3
|
||||
|
||||
// The following 5 actions use AJAX to refresh only a part of the page
|
||||
#define ActRefCon 4
|
||||
#define ActRefLstClk 5
|
||||
#define ActRefNewSocPubGbl 6
|
||||
#define ActRefOldSocPubUsr 7
|
||||
#define ActRefOldSocPubGbl 8
|
||||
#define ActRefOldSocPubGbl 7
|
||||
#define ActRefOldSocPubUsr 8
|
||||
|
||||
#define ActWebSvc 9
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -2917,10 +2917,10 @@ static void Att_PutButtonToShowDetails (void)
|
|||
|
||||
/***** Button to show more details *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\">");
|
||||
Act_FormStart (Gbl.CurrentAct);
|
||||
Act_FormStart (Gbl.Action.Act);
|
||||
Par_PutHiddenParamChar ("ShowDetails",'Y');
|
||||
Grp_PutParamsCodGrps ();
|
||||
Usr_PutHiddenParUsrCodAll (Gbl.CurrentAct,Gbl.Usrs.Select.All);
|
||||
Usr_PutHiddenParUsrCodAll (Gbl.Action.Act,Gbl.Usrs.Select.All);
|
||||
if (Gbl.AttEvents.StrAttCodsSelected[0])
|
||||
Par_PutHiddenParamString ("AttCods",Gbl.AttEvents.StrAttCodsSelected);
|
||||
Lay_PutConfirmButton (Txt_Show_more_details);
|
||||
|
@ -2948,9 +2948,9 @@ static void Att_ListEventsToSelect (Att_TypeOfView_t TypeOfView)
|
|||
depending on the events selected *****/
|
||||
if (TypeOfView == Att_NORMAL_VIEW)
|
||||
{
|
||||
Act_FormStart (Gbl.CurrentAct);
|
||||
Act_FormStart (Gbl.Action.Act);
|
||||
Grp_PutParamsCodGrps ();
|
||||
Usr_PutHiddenParUsrCodAll (Gbl.CurrentAct,Gbl.Usrs.Select.All);
|
||||
Usr_PutHiddenParUsrCodAll (Gbl.Action.Act,Gbl.Usrs.Select.All);
|
||||
}
|
||||
|
||||
/***** Start frame *****/
|
||||
|
|
|
@ -234,7 +234,7 @@ void Cal_DrawCalendar (void)
|
|||
extern const char *Txt_Print;
|
||||
extern const char *Txt_STR_LANG_ID[1+Txt_NUM_LANGUAGES];
|
||||
char Params[256+256+Ses_LENGTH_SESSION_ID+256];
|
||||
bool PrintView = (Gbl.CurrentAct == ActPrnCal);
|
||||
bool PrintView = (Gbl.Action.Act == ActPrnCal);
|
||||
|
||||
/***** Get list of holidays *****/
|
||||
if (!Gbl.Hlds.LstIsRead)
|
||||
|
@ -280,7 +280,7 @@ void Cal_DrawCalendar (void)
|
|||
Gbl.Prefs.FirstDayOfWeek,
|
||||
(long) Gbl.StartExecutionTimeUTC,
|
||||
Gbl.CurrentCtr.Ctr.PlcCod,
|
||||
(Gbl.CurrentAct == ActPrnCal) ? "true" :
|
||||
(Gbl.Action.Act == ActPrnCal) ? "true" :
|
||||
"false",
|
||||
Cfg_HTTPS_URL_SWAD_CGI,
|
||||
Txt_STR_LANG_ID[Gbl.Prefs.Language]);
|
||||
|
|
|
@ -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: Forum SWAD should be always named "SWAD"?
|
||||
// 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: 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 *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.114.4 (2016-01-17)"
|
||||
#define CSS_FILE "swad15.113.8.css"
|
||||
#define JS_FILE "swad15.113.8.js"
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.115 (2016-01-17)"
|
||||
#define CSS_FILE "swad15.115.css"
|
||||
#define JS_FILE "swad15.115.js"
|
||||
|
||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
||||
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
|
||||
/*
|
||||
Version 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.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)
|
||||
|
|
|
@ -665,7 +665,7 @@ void Cty_ListCountries2 (void)
|
|||
Lay_EndRoundFrameTable ();
|
||||
|
||||
/***** Div for Google Geochart *****/
|
||||
if (Gbl.CurrentAct == ActSeeCty)
|
||||
if (Gbl.Action.Act == ActSeeCty)
|
||||
{
|
||||
fprintf (Gbl.F.Out,"<div id=\"chart_div\""
|
||||
" style=\"width:500px; margin:12px auto;\">"
|
||||
|
|
|
@ -976,7 +976,7 @@ void Deg_InitCurrentCourse (void)
|
|||
}
|
||||
|
||||
/***** 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
|
||||
|
||||
/***** Initialize default fields for edition to current values *****/
|
||||
|
|
|
@ -1482,7 +1482,7 @@ void Brw_GetParAndInitFileBrowser (void)
|
|||
Brw_GetDataCurrentGrp ();
|
||||
|
||||
/***** Get type of file browser *****/
|
||||
switch (Gbl.CurrentAct)
|
||||
switch (Gbl.Action.Act)
|
||||
{
|
||||
/***** Documents of institution *****/
|
||||
case ActSeeAdmDocIns: // Access to a documents zone from menu
|
||||
|
@ -2045,7 +2045,7 @@ void Brw_GetParAndInitFileBrowser (void)
|
|||
break;
|
||||
}
|
||||
|
||||
switch (Gbl.CurrentAct)
|
||||
switch (Gbl.Action.Act)
|
||||
{
|
||||
case ActCreFolDocIns: case ActRenFolDocIns:
|
||||
case ActCreFolShaIns: case ActRenFolShaIns:
|
||||
|
@ -2151,7 +2151,7 @@ static long Brw_GetGrpSettings (void)
|
|||
}
|
||||
else // Parameter GrpCod not found!
|
||||
/***** Try to get group code from database *****/
|
||||
switch (Gbl.CurrentAct)
|
||||
switch (Gbl.Action.Act)
|
||||
{
|
||||
case ActSeeAdmDocCrsGrp:
|
||||
case ActSeeDocGrp:
|
||||
|
@ -2182,7 +2182,7 @@ static void Brw_GetDataCurrentGrp (void)
|
|||
GrpDat.GrpCod = Gbl.CurrentCrs.Grps.GrpCod;
|
||||
Grp_GetDataOfGroupByCod (&GrpDat);
|
||||
|
||||
switch (Gbl.CurrentAct)
|
||||
switch (Gbl.Action.Act)
|
||||
{
|
||||
case ActSeeAdmDocCrsGrp:// Access to see/admin a documents zone from menu
|
||||
case ActChgToSeeDocCrs:// Access to see a documents zone
|
||||
|
@ -3460,7 +3460,7 @@ static void Brw_WriteTopBeforeShowingFileBrowser (void)
|
|||
Brw_PutFormToShowOrAdmin (Brw_SHOW,ActSeeMrkGrp);
|
||||
break;
|
||||
case Brw_ADMI_BRIEF_USR:
|
||||
if (Gbl.CurrentAct != ActAskRemOldBrf)
|
||||
if (Gbl.Action.Act != ActAskRemOldBrf)
|
||||
Brw_PutFormToAskRemOldFiles ();
|
||||
break;
|
||||
default:
|
||||
|
@ -3511,34 +3511,34 @@ static void Brw_UpdateLastAccess (void)
|
|||
{
|
||||
case Brw_SHOW_DOCUM_CRS:
|
||||
case Brw_ADMI_DOCUM_CRS:
|
||||
if (Gbl.CurrentAct == ActChgToSeeDocCrs ||
|
||||
Gbl.CurrentAct == ActChgToAdmDocCrs)// Update group of last access to a documents zone only when user changes zone
|
||||
if (Gbl.Action.Act == ActChgToSeeDocCrs ||
|
||||
Gbl.Action.Act == ActChgToAdmDocCrs)// Update group of last access to a documents zone only when user changes zone
|
||||
Brw_UpdateGrpLastAccZone ("LastDowGrpCod",-1L);
|
||||
break;
|
||||
case Brw_SHOW_DOCUM_GRP:
|
||||
case Brw_ADMI_DOCUM_GRP:
|
||||
if (Gbl.CurrentAct == ActChgToSeeDocCrs ||
|
||||
Gbl.CurrentAct == ActChgToAdmDocCrs)// Update group of last access to a documents zone only when user changes zone
|
||||
if (Gbl.Action.Act == ActChgToSeeDocCrs ||
|
||||
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);
|
||||
break;
|
||||
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);
|
||||
break;
|
||||
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);
|
||||
break;
|
||||
case Brw_SHOW_MARKS_CRS:
|
||||
case Brw_ADMI_MARKS_CRS:
|
||||
if (Gbl.CurrentAct == ActChgToSeeMrk ||
|
||||
Gbl.CurrentAct == ActChgToAdmMrk) // Update group of last access to a marks zone only when user changes zone
|
||||
if (Gbl.Action.Act == ActChgToSeeMrk ||
|
||||
Gbl.Action.Act == ActChgToAdmMrk) // Update group of last access to a marks zone only when user changes zone
|
||||
Brw_UpdateGrpLastAccZone ("LastAssGrpCod",-1L);
|
||||
break;
|
||||
case Brw_SHOW_MARKS_GRP:
|
||||
case Brw_ADMI_MARKS_GRP:
|
||||
if (Gbl.CurrentAct == ActChgToSeeMrk ||
|
||||
Gbl.CurrentAct == ActChgToAdmMrk) // Update group of last access to a marks zone only when user changes zone
|
||||
if (Gbl.Action.Act == ActChgToSeeMrk ||
|
||||
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);
|
||||
break;
|
||||
default:
|
||||
|
@ -9424,7 +9424,7 @@ static bool Brw_CheckIfICanEditFileMetadata (long PublisherUsrCod)
|
|||
{
|
||||
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 ActReqDatShaIns: case ActChgDatShaIns:
|
||||
|
|
|
@ -232,12 +232,12 @@ static void Fol_ShowNumberOfFollowingOrFollowers (const struct UsrData *UsrDat,
|
|||
Act_FormStartAnchor (Action,"follow_section");
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
|
||||
Act_LinkFormSubmit (Title,
|
||||
(Gbl.CurrentAct == Action) ? "FOLLOW_NUM_B" :
|
||||
(Gbl.Action.Act == Action) ? "FOLLOW_NUM_B" :
|
||||
"FOLLOW_NUM");
|
||||
}
|
||||
else
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\">",
|
||||
(Gbl.CurrentAct == Action) ? "FOLLOW_NUM_B" :
|
||||
(Gbl.Action.Act == Action) ? "FOLLOW_NUM_B" :
|
||||
"FOLLOW_NUM");
|
||||
fprintf (Gbl.F.Out,"%u",NumUsrs);
|
||||
if (NumUsrs)
|
||||
|
@ -250,7 +250,7 @@ static void Fol_ShowNumberOfFollowingOrFollowers (const struct UsrData *UsrDat,
|
|||
|
||||
/***** Text *****/
|
||||
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]);
|
||||
if (NumUsrs)
|
||||
{
|
||||
|
@ -258,7 +258,7 @@ static void Fol_ShowNumberOfFollowingOrFollowers (const struct UsrData *UsrDat,
|
|||
Act_FormStartAnchor (Action,"follow_section");
|
||||
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
|
||||
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]);
|
||||
}
|
||||
fprintf (Gbl.F.Out,"%s",Title);
|
||||
|
|
14
swad_forum.c
14
swad_forum.c
|
@ -1439,7 +1439,7 @@ void For_SetForumTypeAndRestrictAccess (void)
|
|||
extern const char *Txt_You_dont_have_permission_to_access_to_this_forum;
|
||||
bool ICanSeeForum = false;
|
||||
|
||||
switch (Gbl.CurrentAct)
|
||||
switch (Gbl.Action.Act)
|
||||
{
|
||||
case ActSeeForSWAUsr: case ActSeePstForSWAUsr:
|
||||
case ActRcvThrForSWAUsr: case ActRcvRepForSWAUsr:
|
||||
|
@ -3757,12 +3757,12 @@ void For_RecForumPst (void)
|
|||
For_SetForumTypeAndRestrictAccess ();
|
||||
|
||||
/***** Get the code of the thread y the número of page *****/
|
||||
if (Gbl.CurrentAct == ActRcvRepForCrsUsr || Gbl.CurrentAct == ActRcvRepForCrsTch ||
|
||||
Gbl.CurrentAct == ActRcvRepForDegUsr || Gbl.CurrentAct == ActRcvRepForDegTch ||
|
||||
Gbl.CurrentAct == ActRcvRepForCtrUsr || Gbl.CurrentAct == ActRcvRepForCtrTch ||
|
||||
Gbl.CurrentAct == ActRcvRepForInsUsr || Gbl.CurrentAct == ActRcvRepForInsTch ||
|
||||
Gbl.CurrentAct == ActRcvRepForGenUsr || Gbl.CurrentAct == ActRcvRepForGenTch ||
|
||||
Gbl.CurrentAct == ActRcvRepForSWAUsr || Gbl.CurrentAct == ActRcvRepForSWATch)
|
||||
if (Gbl.Action.Act == ActRcvRepForCrsUsr || Gbl.Action.Act == ActRcvRepForCrsTch ||
|
||||
Gbl.Action.Act == ActRcvRepForDegUsr || Gbl.Action.Act == ActRcvRepForDegTch ||
|
||||
Gbl.Action.Act == ActRcvRepForCtrUsr || Gbl.Action.Act == ActRcvRepForCtrTch ||
|
||||
Gbl.Action.Act == ActRcvRepForInsUsr || Gbl.Action.Act == ActRcvRepForInsTch ||
|
||||
Gbl.Action.Act == ActRcvRepForGenUsr || Gbl.Action.Act == ActRcvRepForGenTch ||
|
||||
Gbl.Action.Act == ActRcvRepForSWAUsr || Gbl.Action.Act == ActRcvRepForSWATch)
|
||||
{
|
||||
PstIsAReply = true;
|
||||
|
||||
|
|
|
@ -178,8 +178,9 @@ void Gbl_InitializeGlobals (void)
|
|||
Gbl.Usrs.Other.UsrDat.UsrIDNickOrEmail[0] = '\0';
|
||||
Usr_UsrDataConstructor (&Gbl.Usrs.Other.UsrDat);
|
||||
|
||||
Gbl.CurrentAct = ActUnk;
|
||||
Gbl.CurrentTab = TabUnk;
|
||||
Gbl.Action.Act = ActUnk;
|
||||
Gbl.Action.UsesAJAX = false;
|
||||
Gbl.Action.Tab = TabUnk;
|
||||
|
||||
Gbl.Usrs.LstGsts.NumUsrs = 0;
|
||||
Gbl.Usrs.LstGsts.Lst = NULL;
|
||||
|
@ -437,13 +438,9 @@ void Gbl_InitializeGlobals (void)
|
|||
|
||||
void Gbl_Cleanup (void)
|
||||
{
|
||||
if (Gbl.CurrentAct != ActRefCon &&
|
||||
Gbl.CurrentAct != ActRefLstClk &&
|
||||
Gbl.CurrentAct != ActRefNewSocPubGbl &&
|
||||
Gbl.CurrentAct != ActRefOldSocPubUsr &&
|
||||
Gbl.CurrentAct != ActRefOldSocPubGbl &&
|
||||
if (!Gbl.Action.UsesAJAX &&
|
||||
!Gbl.WebService.IsWebService &&
|
||||
Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW &&
|
||||
Act_Actions[Gbl.Action.Act].BrowserWindow == Act_MAIN_WINDOW &&
|
||||
!Gbl.HiddenParamsInsertedIntoDB)
|
||||
Ses_RemoveHiddenParFromThisSession ();
|
||||
Usr_UsrDataDestructor (&Gbl.Usrs.Me.UsrDat);
|
||||
|
|
|
@ -154,8 +154,12 @@ struct Globals
|
|||
} Session;
|
||||
|
||||
bool YearOK;
|
||||
Act_Tab_t CurrentTab;
|
||||
Act_Action_t CurrentAct;
|
||||
struct
|
||||
{
|
||||
Act_Tab_t Tab;
|
||||
Act_Action_t Act;
|
||||
bool UsesAJAX;
|
||||
} Action;
|
||||
time_t StartExecutionTimeUTC;
|
||||
struct tm *tblock;
|
||||
struct DateTime Now;
|
||||
|
|
|
@ -4210,7 +4210,7 @@ void Grp_GetParamWhichGrps (void)
|
|||
Gbl.CurrentCrs.Grps.WhichGrps = (Grp_WhichGroups_t) UnsignedNum;
|
||||
}
|
||||
else // This parameter does not exist ==> set default value
|
||||
switch (Gbl.CurrentAct)
|
||||
switch (Gbl.Action.Act)
|
||||
{
|
||||
case ActSeeCrsTT:
|
||||
case ActPrnCrsTT:
|
||||
|
|
|
@ -134,7 +134,7 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
|
|||
"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 */
|
||||
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Txt_Go_to_one_of_my_courses,
|
||||
ActMyCrs,
|
||||
|
@ -192,9 +192,9 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
|
|||
{
|
||||
if (Gbl.Usrs.Me.IBelongToCurrentCrs) // I belong to this course
|
||||
{
|
||||
if (Gbl.CurrentAct != ActAutUsrInt &&
|
||||
Gbl.CurrentAct != ActAutUsrExt &&
|
||||
Gbl.CurrentAct != ActAutUsrChgLan) // I am not just logged
|
||||
if (Gbl.Action.Act != ActAutUsrInt &&
|
||||
Gbl.Action.Act != ActAutUsrExt &&
|
||||
Gbl.Action.Act != ActAutUsrChgLan) // I am not just logged
|
||||
{
|
||||
/* Request my removing from this course */
|
||||
sprintf (Gbl.Title,Txt_Remove_me_from_the_course_X,
|
||||
|
|
|
@ -484,7 +484,7 @@ static void Ind_PutButtonToConfirmIWantToSeeBigList (unsigned NumCrss)
|
|||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||
|
||||
/***** 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);
|
||||
Par_PutHiddenParamLong ("OthDegTypCod",Gbl.Stat.DegTypCod);
|
||||
Par_PutHiddenParamLong ("DptCod",Gbl.Stat.DptCod);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
switch (Gbl.CurrentAct)
|
||||
switch (Gbl.Action.Act)
|
||||
{
|
||||
case ActSeeCrsInf:
|
||||
case ActEdiCrsInf:
|
||||
|
|
148
swad_layout.c
148
swad_layout.c
|
@ -123,11 +123,7 @@ void Lay_WriteStartOfPage (void)
|
|||
Con_ComputeConnectedUsrsBelongingToCurrentCrs ();
|
||||
|
||||
/***** Send head width the file type for the HTTP protocol *****/
|
||||
if (Gbl.CurrentAct == ActRefCon ||
|
||||
Gbl.CurrentAct == ActRefLstClk ||
|
||||
Gbl.CurrentAct == ActRefNewSocPubGbl ||
|
||||
Gbl.CurrentAct == ActRefOldSocPubUsr ||
|
||||
Gbl.CurrentAct == ActRefOldSocPubGbl)
|
||||
if (Gbl.Action.UsesAJAX)
|
||||
// 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");
|
||||
|
@ -197,31 +193,31 @@ void Lay_WriteStartOfPage (void)
|
|||
// css/dropzone.css
|
||||
// images/spritemap@2x.png
|
||||
// images/spritemap.png
|
||||
if (Gbl.CurrentAct == ActFrmCreDocIns || // Brw_ADMI_DOCUM_INS
|
||||
Gbl.CurrentAct == ActFrmCreShaIns || // Brw_ADMI_SHARE_INS
|
||||
Gbl.CurrentAct == ActFrmCreDocCtr || // Brw_ADMI_DOCUM_CTR
|
||||
Gbl.CurrentAct == ActFrmCreShaCtr || // Brw_ADMI_SHARE_CTR
|
||||
Gbl.CurrentAct == ActFrmCreDocDeg || // Brw_ADMI_DOCUM_DEG
|
||||
Gbl.CurrentAct == ActFrmCreShaDeg || // Brw_ADMI_SHARE_DEG
|
||||
Gbl.CurrentAct == ActFrmCreDocCrs || // Brw_ADMI_DOCUM_CRS
|
||||
Gbl.CurrentAct == ActFrmCreDocGrp || // Brw_ADMI_DOCUM_GRP
|
||||
Gbl.CurrentAct == ActFrmCreShaCrs || // Brw_ADMI_SHARE_CRS
|
||||
Gbl.CurrentAct == ActFrmCreShaGrp || // Brw_ADMI_SHARE_GRP
|
||||
Gbl.CurrentAct == ActFrmCreAsgUsr || // Brw_ADMI_ASSIG_USR
|
||||
Gbl.CurrentAct == ActFrmCreAsgCrs || // Brw_ADMI_ASSIG_CRS
|
||||
Gbl.CurrentAct == ActFrmCreWrkUsr || // Brw_ADMI_WORKS_USR
|
||||
Gbl.CurrentAct == ActFrmCreWrkCrs || // Brw_ADMI_WORKS_CRS
|
||||
Gbl.CurrentAct == ActFrmCreMrkCrs || // Brw_ADMI_MARKS_CRS
|
||||
Gbl.CurrentAct == ActFrmCreMrkGrp || // Brw_ADMI_MARKS_GRP
|
||||
Gbl.CurrentAct == ActFrmCreBrf) // Brw_ADMI_BRIEF_USR
|
||||
if (Gbl.Action.Act == ActFrmCreDocIns || // Brw_ADMI_DOCUM_INS
|
||||
Gbl.Action.Act == ActFrmCreShaIns || // Brw_ADMI_SHARE_INS
|
||||
Gbl.Action.Act == ActFrmCreDocCtr || // Brw_ADMI_DOCUM_CTR
|
||||
Gbl.Action.Act == ActFrmCreShaCtr || // Brw_ADMI_SHARE_CTR
|
||||
Gbl.Action.Act == ActFrmCreDocDeg || // Brw_ADMI_DOCUM_DEG
|
||||
Gbl.Action.Act == ActFrmCreShaDeg || // Brw_ADMI_SHARE_DEG
|
||||
Gbl.Action.Act == ActFrmCreDocCrs || // Brw_ADMI_DOCUM_CRS
|
||||
Gbl.Action.Act == ActFrmCreDocGrp || // Brw_ADMI_DOCUM_GRP
|
||||
Gbl.Action.Act == ActFrmCreShaCrs || // Brw_ADMI_SHARE_CRS
|
||||
Gbl.Action.Act == ActFrmCreShaGrp || // Brw_ADMI_SHARE_GRP
|
||||
Gbl.Action.Act == ActFrmCreAsgUsr || // Brw_ADMI_ASSIG_USR
|
||||
Gbl.Action.Act == ActFrmCreAsgCrs || // Brw_ADMI_ASSIG_CRS
|
||||
Gbl.Action.Act == ActFrmCreWrkUsr || // Brw_ADMI_WORKS_USR
|
||||
Gbl.Action.Act == ActFrmCreWrkCrs || // Brw_ADMI_WORKS_CRS
|
||||
Gbl.Action.Act == ActFrmCreMrkCrs || // Brw_ADMI_MARKS_CRS
|
||||
Gbl.Action.Act == ActFrmCreMrkGrp || // Brw_ADMI_MARKS_GRP
|
||||
Gbl.Action.Act == ActFrmCreBrf) // Brw_ADMI_BRIEF_USR
|
||||
fprintf (Gbl.F.Out,"<link rel=\"StyleSheet\""
|
||||
" href=\"%s/dropzone/css/dropzone.css\""
|
||||
" type=\"text/css\" />\n",
|
||||
Cfg_HTTPS_URL_SWAD_PUBLIC);
|
||||
|
||||
/* Redirect to correct language */
|
||||
if ((Gbl.CurrentAct == ActAutUsrInt ||
|
||||
Gbl.CurrentAct == ActAutUsrExt) && // Action is log in
|
||||
if ((Gbl.Action.Act == ActAutUsrInt ||
|
||||
Gbl.Action.Act == ActAutUsrExt) && // Action is log in
|
||||
Gbl.Usrs.Me.Logged && // I am just logged
|
||||
Gbl.Usrs.Me.UsrDat.Prefs.Language != Txt_Current_CGI_SWAD_Language) // My language != current language
|
||||
Lay_WriteRedirectionToMyLanguage ();
|
||||
|
@ -232,7 +228,7 @@ void Lay_WriteStartOfPage (void)
|
|||
fprintf (Gbl.F.Out,"</head>\n");
|
||||
|
||||
/***** 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"
|
||||
"<div id=\"zoomLyr\" class=\"ZOOM\">"
|
||||
"<img id=\"zoomImg\" src=\"%s/usr_bl.jpg\""
|
||||
|
@ -317,16 +313,16 @@ void Lay_WriteStartOfPage (void)
|
|||
|
||||
/* Write title of the current action */
|
||||
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 ();
|
||||
|
||||
Gbl.Layout.WritingHTMLStart = false;
|
||||
Gbl.Layout.HTMLStartWritten = true;
|
||||
|
||||
/* Write new year greeting */
|
||||
if (Gbl.CurrentAct == ActAutUsrInt ||
|
||||
Gbl.CurrentAct == ActAutUsrExt ||
|
||||
Gbl.CurrentAct == ActAutUsrChgLan)
|
||||
if (Gbl.Action.Act == ActAutUsrInt ||
|
||||
Gbl.Action.Act == ActAutUsrExt ||
|
||||
Gbl.Action.Act == ActAutUsrChgLan)
|
||||
if (Gbl.Now.Date.Month == 1 &&
|
||||
Gbl.Now.Date.Day == 1)
|
||||
{
|
||||
|
@ -354,7 +350,7 @@ static void Lay_WriteEndOfPage (void)
|
|||
"</div>"); // main_zone_central_container
|
||||
|
||||
/***** Write page footer *****/
|
||||
if (Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW)
|
||||
if (Act_Actions[Gbl.Action.Act].BrowserWindow == Act_MAIN_WINDOW)
|
||||
Lay_WriteFootFromHTMLFile ();
|
||||
|
||||
/***** End of main zone and page *****/
|
||||
|
@ -451,7 +447,7 @@ static void Lay_WriteScripts (void)
|
|||
#endif
|
||||
|
||||
/***** 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_WriteScriptParamsAJAX ();
|
||||
|
@ -459,8 +455,8 @@ static void Lay_WriteScripts (void)
|
|||
|
||||
/***** Prepare script to draw months *****/
|
||||
if ((Gbl.Prefs.SideCols & Lay_SHOW_LEFT_COLUMN) || // Left column visible
|
||||
Gbl.CurrentAct == ActSeeCal ||
|
||||
Gbl.CurrentAct == ActPrnCal)
|
||||
Gbl.Action.Act == ActSeeCal ||
|
||||
Gbl.Action.Act == ActPrnCal)
|
||||
{
|
||||
/***** Get list of holidays *****/
|
||||
if (!Gbl.Hlds.LstIsRead)
|
||||
|
@ -524,7 +520,7 @@ static void Lay_WriteScripts (void)
|
|||
}
|
||||
|
||||
/***** Scripts depending on action *****/
|
||||
switch (Gbl.CurrentAct)
|
||||
switch (Gbl.Action.Act)
|
||||
{
|
||||
/***** Script to print world map *****/
|
||||
case ActSeeCty:
|
||||
|
@ -610,19 +606,19 @@ static void Lay_WriteScriptInit (void)
|
|||
Txt_STR_LANG_ID[Gbl.Prefs.Language],
|
||||
Gbl.Usrs.Connected.TimeToRefreshInMs);
|
||||
|
||||
if (Gbl.CurrentAct == ActLstClk)
|
||||
if (Gbl.Action.Act == ActLstClk)
|
||||
// Refresh timeline via AJAX
|
||||
fprintf (Gbl.F.Out," setTimeout(\"refreshLastClicks()\",%lu);\n",
|
||||
Cfg_TIME_TO_REFRESH_LAST_CLICKS);
|
||||
else if (Gbl.CurrentAct == ActSeeSocTmlGbl ||
|
||||
Gbl.CurrentAct == ActRcvSocPstGbl ||
|
||||
Gbl.CurrentAct == ActRcvSocComGbl ||
|
||||
Gbl.CurrentAct == ActShaSocNotGbl ||
|
||||
Gbl.CurrentAct == ActUnsSocPubGbl ||
|
||||
Gbl.CurrentAct == ActReqRemSocPubGbl ||
|
||||
Gbl.CurrentAct == ActRemSocPubGbl ||
|
||||
Gbl.CurrentAct == ActReqRemSocComGbl ||
|
||||
Gbl.CurrentAct == ActRemSocComGbl)
|
||||
else if (Gbl.Action.Act == ActSeeSocTmlGbl ||
|
||||
Gbl.Action.Act == ActRcvSocPstGbl ||
|
||||
Gbl.Action.Act == ActRcvSocComGbl ||
|
||||
Gbl.Action.Act == ActShaSocNotGbl ||
|
||||
Gbl.Action.Act == ActUnsSocPubGbl ||
|
||||
Gbl.Action.Act == ActReqRemSocPubGbl ||
|
||||
Gbl.Action.Act == ActRemSocPubGbl ||
|
||||
Gbl.Action.Act == ActReqRemSocComGbl ||
|
||||
Gbl.Action.Act == ActRemSocComGbl)
|
||||
// Refresh timeline via AJAX
|
||||
fprintf (Gbl.F.Out," setTimeout(\"refreshNewTimeline()\",%lu);\n",
|
||||
Cfg_TIME_TO_REFRESH_SOCIAL_TIMELINE);
|
||||
|
@ -642,22 +638,22 @@ static void Lay_WriteScriptParamsAJAX (void)
|
|||
|
||||
/***** Parameter to refresh connected users *****/
|
||||
fprintf (Gbl.F.Out,"var RefreshParamNxtActCon = \"act=%ld\";\n",
|
||||
Act_Actions[ActRefCon ].ActCod);
|
||||
Act_Actions[ActRefCon].ActCod);
|
||||
|
||||
/***** Parameter to refresh clicks in realtime *****/
|
||||
fprintf (Gbl.F.Out,"var RefreshParamNxtActLog = \"act=%ld\";\n",
|
||||
Act_Actions[ActRefLstClk].ActCod);
|
||||
|
||||
/***** Parameters related with refreshing of social timeline *****/
|
||||
if (Gbl.CurrentAct == ActSeeSocTmlGbl ||
|
||||
Gbl.CurrentAct == ActRcvSocPstGbl ||
|
||||
Gbl.CurrentAct == ActRcvSocComGbl ||
|
||||
Gbl.CurrentAct == ActShaSocNotGbl ||
|
||||
Gbl.CurrentAct == ActUnsSocPubGbl ||
|
||||
Gbl.CurrentAct == ActReqRemSocPubGbl ||
|
||||
Gbl.CurrentAct == ActRemSocPubGbl ||
|
||||
Gbl.CurrentAct == ActReqRemSocComGbl ||
|
||||
Gbl.CurrentAct == ActRemSocComGbl)
|
||||
if (Gbl.Action.Act == ActSeeSocTmlGbl ||
|
||||
Gbl.Action.Act == ActRcvSocPstGbl ||
|
||||
Gbl.Action.Act == ActRcvSocComGbl ||
|
||||
Gbl.Action.Act == ActShaSocNotGbl ||
|
||||
Gbl.Action.Act == ActUnsSocPubGbl ||
|
||||
Gbl.Action.Act == ActReqRemSocPubGbl ||
|
||||
Gbl.Action.Act == ActRemSocPubGbl ||
|
||||
Gbl.Action.Act == ActReqRemSocComGbl ||
|
||||
Gbl.Action.Act == ActRemSocComGbl)
|
||||
/* In all the actions related to view or editing global timeline ==>
|
||||
put parameters used by AJAX */
|
||||
fprintf (Gbl.F.Out,"var RefreshParamNxtActNewPub = \"act=%ld\";\n"
|
||||
|
@ -665,15 +661,15 @@ static void Lay_WriteScriptParamsAJAX (void)
|
|||
"var RefreshParamUsr = \"\";\n", // No user specified
|
||||
Act_Actions[ActRefNewSocPubGbl].ActCod,
|
||||
Act_Actions[ActRefOldSocPubGbl].ActCod);
|
||||
else if (Gbl.CurrentAct == ActSeePubPrf ||
|
||||
Gbl.CurrentAct == ActRcvSocPstGbl ||
|
||||
Gbl.CurrentAct == ActRcvSocComUsr ||
|
||||
Gbl.CurrentAct == ActShaSocNotGbl ||
|
||||
Gbl.CurrentAct == ActUnsSocPubGbl ||
|
||||
Gbl.CurrentAct == ActReqRemSocPubGbl ||
|
||||
Gbl.CurrentAct == ActRemSocPubGbl ||
|
||||
Gbl.CurrentAct == ActReqRemSocComGbl ||
|
||||
Gbl.CurrentAct == ActRemSocComGbl)
|
||||
else if (Gbl.Action.Act == ActSeePubPrf ||
|
||||
Gbl.Action.Act == ActRcvSocPstGbl ||
|
||||
Gbl.Action.Act == ActRcvSocComUsr ||
|
||||
Gbl.Action.Act == ActShaSocNotGbl ||
|
||||
Gbl.Action.Act == ActUnsSocPubGbl ||
|
||||
Gbl.Action.Act == ActReqRemSocPubGbl ||
|
||||
Gbl.Action.Act == ActRemSocPubGbl ||
|
||||
Gbl.Action.Act == ActReqRemSocComGbl ||
|
||||
Gbl.Action.Act == ActRemSocComGbl)
|
||||
{
|
||||
/* In all the actions related to view or editing user's timeline ==>
|
||||
put parameters used by AJAX */
|
||||
|
@ -872,18 +868,18 @@ static void Lay_WriteTitleAction (void)
|
|||
fprintf (Gbl.F.Out,"<div id=\"action_title\""
|
||||
" style=\"background-image:url('%s/%s/%s');\">",
|
||||
Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION,
|
||||
Act_Actions[Act_Actions[Gbl.CurrentAct].SuperAction].Icon);
|
||||
Act_Actions[Act_Actions[Gbl.Action.Act].SuperAction].Icon);
|
||||
|
||||
/***** Title *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"%s\">%s > %s</div>",
|
||||
The_ClassTitleAction[Gbl.Prefs.Theme],
|
||||
Txt_TABS_FULL_TXT[Act_Actions[Gbl.CurrentAct].Tab],
|
||||
Act_GetTitleAction (Gbl.CurrentAct));
|
||||
Txt_TABS_FULL_TXT[Act_Actions[Gbl.Action.Act].Tab],
|
||||
Act_GetTitleAction (Gbl.Action.Act));
|
||||
|
||||
/***** Subtitle *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"%s\">%s</div>",
|
||||
The_ClassSubtitleAction[Gbl.Prefs.Theme],
|
||||
Act_GetSubtitleAction (Gbl.CurrentAct));
|
||||
Act_GetSubtitleAction (Gbl.Action.Act));
|
||||
|
||||
/***** Container end *****/
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
|
@ -968,8 +964,8 @@ static void Lay_ShowRightColumn (void)
|
|||
|
||||
/***** SWADroid advertisement *****/
|
||||
if (!Gbl.Usrs.Me.Logged ||
|
||||
Gbl.CurrentAct == ActAutUsrInt ||
|
||||
Gbl.CurrentAct == ActAutUsrExt)
|
||||
Gbl.Action.Act == ActAutUsrInt ||
|
||||
Gbl.Action.Act == ActAutUsrExt)
|
||||
fprintf (Gbl.F.Out,"<div class=\"LEFT_RIGHT_CELL\">"
|
||||
"<a href=\"https://play.google.com/store/apps/details?id=es.ugr.swad.swadroid\""
|
||||
" target=\"_blank\" title=\"%s\">"
|
||||
|
@ -1354,11 +1350,7 @@ void Lay_ShowErrorAndExit (const char *Message)
|
|||
|
||||
/***** Page is generated (except </body> and </html>).
|
||||
Compute time to generate page *****/
|
||||
if (Gbl.CurrentAct != ActRefCon && // Refreshing connected users
|
||||
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
|
||||
if (!Gbl.Action.UsesAJAX)
|
||||
Sta_ComputeTimeToGeneratePage ();
|
||||
|
||||
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_CloseAndRemoveFileForHTMLOutput ();
|
||||
|
||||
if (Gbl.CurrentAct != ActRefCon && // Refreshing connected users
|
||||
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
|
||||
if (!Gbl.Action.UsesAJAX)
|
||||
{
|
||||
/***** Compute time to send page *****/
|
||||
Sta_ComputeTimeToSendPage ();
|
||||
|
@ -1392,7 +1380,7 @@ void Lay_ShowErrorAndExit (const char *Message)
|
|||
if (!Gbl.Layout.HTMLEndWritten)
|
||||
{
|
||||
// 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 ();
|
||||
|
||||
fprintf (Gbl.F.Out,"</body>\n"
|
||||
|
|
12
swad_main.c
12
swad_main.c
|
@ -126,7 +126,7 @@ int main (int argc, char *argv[])
|
|||
Con_RemoveOldConnected ();
|
||||
|
||||
/***** 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 ();
|
||||
|
||||
/***** 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 *****/
|
||||
if (!Act_CheckIfIHavePermissionToExecuteAction (Gbl.CurrentAct))
|
||||
if (!Act_CheckIfIHavePermissionToExecuteAction (Gbl.Action.Act))
|
||||
Lay_ShowErrorAndExit (Txt_You_dont_have_permission_to_perform_this_action);
|
||||
|
||||
/***** Update most frequently used actions *****/
|
||||
Act_UpdateMFUActions ();
|
||||
|
||||
/***** Execute a function depending on the action *****/
|
||||
if (Act_Actions[Gbl.CurrentAct].FunctionPriori != NULL)
|
||||
Act_Actions[Gbl.CurrentAct].FunctionPriori ();
|
||||
if (Act_Actions[Gbl.Action.Act].FunctionPriori != NULL)
|
||||
Act_Actions[Gbl.Action.Act].FunctionPriori ();
|
||||
|
||||
/***** Start writing HTML output *****/
|
||||
Lay_WriteStartOfPage ();
|
||||
|
||||
/***** Make a processing or other depending on the action *****/
|
||||
if (Act_Actions[Gbl.CurrentAct].FunctionPosteriori != NULL)
|
||||
Act_Actions[Gbl.CurrentAct].FunctionPosteriori ();
|
||||
if (Act_Actions[Gbl.Action.Act].FunctionPosteriori != NULL)
|
||||
Act_Actions[Gbl.Action.Act].FunctionPosteriori ();
|
||||
}
|
||||
|
||||
/***** Cleanup and exit *****/
|
||||
|
|
|
@ -205,7 +205,7 @@ Act_Action_t Mnu_GetFirstActionAvailableInCurrentTab (void)
|
|||
NumOptInMenu < Act_MAX_OPTIONS_IN_MENU_PER_TAB;
|
||||
NumOptInMenu++)
|
||||
{
|
||||
if ((Action = Mnu_MenuActions[Gbl.CurrentTab][NumOptInMenu]) == 0)
|
||||
if ((Action = Mnu_MenuActions[Gbl.Action.Tab][NumOptInMenu]) == 0)
|
||||
return ActUnk;
|
||||
if (Act_CheckIfIHavePermissionToExecuteAction (Action))
|
||||
return Action;
|
||||
|
@ -236,12 +236,12 @@ void Mnu_WriteMenuThisTab (void)
|
|||
NumOptInMenu < Act_MAX_OPTIONS_IN_MENU_PER_TAB;
|
||||
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
|
||||
break;
|
||||
if (Act_CheckIfIHavePermissionToExecuteAction (NumAct))
|
||||
{
|
||||
IsTheSelectedAction = (NumAct == Act_Actions[Gbl.CurrentAct].SuperAction);
|
||||
IsTheSelectedAction = (NumAct == Act_Actions[Gbl.Action.Act].SuperAction);
|
||||
|
||||
Title = Act_GetSubtitleAction (NumAct);
|
||||
|
||||
|
@ -271,7 +271,7 @@ void Mnu_WriteMenuThisTab (void)
|
|||
"</div>",
|
||||
IsTheSelectedAction ? The_ClassTxtMenuOn[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 *****/
|
||||
fprintf (Gbl.F.Out,"</div>"
|
||||
|
|
|
@ -1722,7 +1722,7 @@ static void Msg_ShowSentOrReceivedMessages (Msg_TypeOfMessages_t TypeOfMessages)
|
|||
/***** Show form to delete all messages *****/
|
||||
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
|
||||
{
|
||||
/***** 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)
|
||||
{
|
||||
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))
|
||||
// Sender is banned
|
||||
|
|
|
@ -543,7 +543,7 @@ void Pag_GetParamPagNum (Pag_WhatPaginate_t WhatPaginate)
|
|||
switch (WhatPaginate)
|
||||
{
|
||||
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
|
||||
// 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
|
||||
|
|
|
@ -142,7 +142,7 @@ void Par_GetMainParameters (void)
|
|||
/***** Get action to perform *****/
|
||||
if (Gbl.WebService.IsWebService)
|
||||
{
|
||||
Gbl.CurrentAct = ActWebSvc;
|
||||
Gbl.Action.Act = ActWebSvc;
|
||||
Tab_SetCurrentTab ();
|
||||
return;
|
||||
}
|
||||
|
@ -152,14 +152,14 @@ void Par_GetMainParameters (void)
|
|||
if (Gbl.Imported.ExternalUsrId[0] &&
|
||||
Gbl.Imported.ExternalSesId[0])
|
||||
{
|
||||
Gbl.CurrentAct = ActAutUsrExt;
|
||||
Gbl.Action.Act = ActAutUsrExt;
|
||||
Tab_SetCurrentTab ();
|
||||
return;
|
||||
}
|
||||
// SWAD is not called from external site
|
||||
|
||||
/***** Set dfault action *****/
|
||||
Gbl.CurrentAct = ActUnk;
|
||||
Gbl.Action.Act = ActUnk;
|
||||
|
||||
/***** Get another user's nickname, if exists
|
||||
(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
|
||||
// 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 *****/
|
||||
|
@ -179,7 +179,7 @@ void Par_GetMainParameters (void)
|
|||
{
|
||||
if (sscanf (UnsignedStr,"%u",&UnsignedNum) == 1)
|
||||
if (UnsignedNum <= Act_MAX_ACTION_COD)
|
||||
Gbl.CurrentAct = Act_FromActCodToAction[UnsignedNum];
|
||||
Gbl.Action.Act = Act_FromActCodToAction[UnsignedNum];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -188,8 +188,14 @@ void Par_GetMainParameters (void)
|
|||
if (UnsignedStr[0])
|
||||
if (sscanf (UnsignedStr,"%u",&UnsignedNum) == 1)
|
||||
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 *****/
|
||||
Par_GetParToText ("ses",Gbl.Session.Id,Ses_LENGTH_SESSION_ID);
|
||||
|
@ -228,7 +234,7 @@ void Par_GetMainParameters (void)
|
|||
}
|
||||
|
||||
/***** Get user password and login *****/
|
||||
switch (Gbl.CurrentAct)
|
||||
switch (Gbl.Action.Act)
|
||||
{
|
||||
case ActAutUsrInt:
|
||||
Pwd_GetParamUsrPwdLogin ();
|
||||
|
@ -329,15 +335,15 @@ void Par_GetMainParameters (void)
|
|||
}
|
||||
|
||||
/***** Get tab to activate *****/
|
||||
Gbl.CurrentTab = TabUnk;
|
||||
if (Gbl.CurrentAct == ActMnu)
|
||||
Gbl.Action.Tab = TabUnk;
|
||||
if (Gbl.Action.Act == ActMnu)
|
||||
{
|
||||
Par_GetParToText ("NxtTab",UnsignedStr,10);
|
||||
if (UnsignedStr[0])
|
||||
if (sscanf (UnsignedStr,"%u",&UnsignedNum) == 1)
|
||||
if (UnsignedNum < Tab_NUM_TABS)
|
||||
{
|
||||
Gbl.CurrentTab = (Act_Tab_t) UnsignedNum;
|
||||
Gbl.Action.Tab = (Act_Tab_t) UnsignedNum;
|
||||
Tab_DisableIncompatibleTabs ();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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];
|
||||
bool PhotoExists;
|
||||
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
|
||||
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,
|
||||
because some browsers (i.e., IE5)
|
||||
|
@ -1120,7 +1120,7 @@ void Pho_ChangePhotoVisibility (void)
|
|||
char Query[128];
|
||||
|
||||
/***** 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 *****/
|
||||
sprintf (Query,"UPDATE usr_data SET PhotoVisibility='%s'"
|
||||
|
|
|
@ -180,7 +180,8 @@ static void Pri_PutFormVisibility (const char *TxtLabel,
|
|||
/************************ 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;
|
||||
|
||||
|
@ -190,14 +191,15 @@ Pri_Visibility_t Pri_GetVisibilityFromStr (const char *Str)
|
|||
if (!strcasecmp (Str,Pri_VisibilityDB[Visibility]))
|
||||
return Visibility;
|
||||
|
||||
return Pri_VISIBILITY_DEFAULT;
|
||||
return DefaultVisibility;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**************** 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];
|
||||
unsigned UnsignedNum;
|
||||
|
@ -212,7 +214,7 @@ Pri_Visibility_t Pri_GetParamVisibility (const char *ParamName)
|
|||
return (Pri_Visibility_t) UnsignedNum;
|
||||
}
|
||||
|
||||
return Pri_VISIBILITY_DEFAULT;
|
||||
return DefaultVisibility;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
/***** Visibility (who can see user's photo / public profile) *****/
|
||||
#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_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_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 *****************************/
|
||||
|
@ -51,8 +52,10 @@ typedef enum
|
|||
void Pri_PutLinkToChangeMyPrivacy (void);
|
||||
void Pri_EditMyPrivacy (void);
|
||||
|
||||
Pri_Visibility_t Pri_GetVisibilityFromStr (const char *Str);
|
||||
Pri_Visibility_t Pri_GetParamVisibility (const char *ParamName);
|
||||
Pri_Visibility_t Pri_GetVisibilityFromStr (const char *Str,
|
||||
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);
|
||||
|
||||
|
|
|
@ -284,7 +284,7 @@ void Prf_ChangeProfileVisibility (void)
|
|||
char Query[128];
|
||||
|
||||
/***** 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 *****/
|
||||
sprintf (Query,"UPDATE usr_data SET ProfileVisibility='%s'"
|
||||
|
|
|
@ -874,7 +874,7 @@ void Rec_ListRecordsGsts (void)
|
|||
extern const char *Txt_You_must_select_one_ore_more_users;
|
||||
unsigned NumUsrs = 0;
|
||||
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;
|
||||
struct UsrData UsrDat;
|
||||
|
||||
|
@ -882,7 +882,7 @@ void Rec_ListRecordsGsts (void)
|
|||
Gbl.Usrs.Listing.RecsUsrs = Rec_RECORD_USERS_GUESTS;
|
||||
|
||||
/***** Get parameter with number of user records per page (only for printing) *****/
|
||||
if (Gbl.CurrentAct == ActPrnRecSevGst)
|
||||
if (Gbl.Action.Act == ActPrnRecSevGst)
|
||||
Rec_GetParamRecordsPerPage ();
|
||||
|
||||
/***** Get list of selected users *****/
|
||||
|
@ -896,7 +896,7 @@ void Rec_ListRecordsGsts (void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (Gbl.CurrentAct == ActSeeRecSevGst)
|
||||
if (Gbl.Action.Act == ActSeeRecSevGst)
|
||||
{
|
||||
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
|
||||
|
||||
|
@ -924,7 +924,7 @@ void Rec_ListRecordsGsts (void)
|
|||
{
|
||||
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\""
|
||||
" style=\"margin-bottom:12px;");
|
||||
if (Gbl.CurrentAct == ActPrnRecSevGst &&
|
||||
if (Gbl.Action.Act == ActPrnRecSevGst &&
|
||||
NumUsrs != 0 &&
|
||||
(NumUsrs % Gbl.Usrs.Listing.RecsPerPag) == 0)
|
||||
fprintf (Gbl.F.Out,"page-break-before:always;");
|
||||
|
@ -1099,7 +1099,7 @@ static void Rec_ListRecordsStds (Rec_RecordViewType_t TypeOfView)
|
|||
" class=\"CENTER_MIDDLE\""
|
||||
" style=\"margin-bottom:12px;",
|
||||
Anchor);
|
||||
if (Gbl.CurrentAct == ActPrnRecSevStd &&
|
||||
if (Gbl.Action.Act == ActPrnRecSevStd &&
|
||||
NumUsr != 0 &&
|
||||
(NumUsr % Gbl.Usrs.Listing.RecsPerPag) == 0)
|
||||
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];
|
||||
unsigned NumUsrs = 0;
|
||||
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;
|
||||
struct UsrData UsrDat;
|
||||
bool ShowOfficeHours;
|
||||
|
@ -1226,7 +1226,7 @@ void Rec_ListRecordsTchs (void)
|
|||
ShowOfficeHours = Rec_GetParamShowOfficeHours ();
|
||||
|
||||
/***** Get parameter with number of user records per page (only for printing) *****/
|
||||
if (Gbl.CurrentAct == ActPrnRecSevTch)
|
||||
if (Gbl.Action.Act == ActPrnRecSevTch)
|
||||
Rec_GetParamRecordsPerPage ();
|
||||
|
||||
/***** Get list of selected teachers *****/
|
||||
|
@ -1240,7 +1240,7 @@ void Rec_ListRecordsTchs (void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (Gbl.CurrentAct == ActSeeRecSevTch)
|
||||
if (Gbl.Action.Act == ActSeeRecSevTch)
|
||||
{
|
||||
/***** Show contextual 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\""
|
||||
" style=\"margin-bottom:12px;");
|
||||
if (Gbl.CurrentAct == ActPrnRecSevTch &&
|
||||
if (Gbl.Action.Act == ActPrnRecSevTch &&
|
||||
NumUsrs != 0 &&
|
||||
(NumUsrs % Gbl.Usrs.Listing.RecsPerPag) == 0)
|
||||
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
|
||||
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 *****/
|
||||
sprintf (StrRecordWidth,"%upx",Rec_RECORD_WIDTH);
|
||||
|
@ -2436,8 +2436,8 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
|
|||
Act_FormStart (ActChgMyData);
|
||||
break;
|
||||
case Rec_FORM_NEW_RECORD_OTHER_NEW_USR:
|
||||
Act_FormStart ( Gbl.CurrentAct == ActReqMdfStd ? ActCreStd :
|
||||
(Gbl.CurrentAct == ActReqMdfTch ? ActCreTch :
|
||||
Act_FormStart ( Gbl.Action.Act == ActReqMdfStd ? ActCreStd :
|
||||
(Gbl.Action.Act == ActReqMdfTch ? ActCreTch :
|
||||
ActCreOth));
|
||||
ID_PutParamOtherUsrIDPlain (); // New user
|
||||
break;
|
||||
|
|
|
@ -305,7 +305,7 @@ bool Ses_GetSessionData (void)
|
|||
Gbl.CurrentCrs.Crs.CrsCod = Str_ConvertStrCodToLongCod (row[7]);
|
||||
|
||||
/***** 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]) */
|
||||
Gbl.Search.WhatToSearch = Sch_SEARCH_ALL;
|
||||
|
|
|
@ -57,10 +57,10 @@
|
|||
|
||||
// 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_REC_PUBS_TO_GET_AND_SHOW 10 // Recent publishings to show (first time)
|
||||
#define Soc_MAX_OLD_PUBS_TO_GET_AND_SHOW 10 // IMPORTANT: If you change this number,
|
||||
// set also this constant
|
||||
// to the new value in JavaScript
|
||||
#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 20 // IMPORTANT: If you change this number,
|
||||
// set also this constant to the new value
|
||||
// in JavaScript function readOldTimelineData
|
||||
|
||||
#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 *****/
|
||||
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\">");
|
||||
|
||||
|
|
|
@ -271,7 +271,7 @@ void Sta_LogAccess (const char *Comments)
|
|||
{
|
||||
char Query[2048];
|
||||
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;
|
||||
|
||||
/***** Insert access into database *****/
|
||||
|
@ -280,7 +280,7 @@ void Sta_LogAccess (const char *Comments)
|
|||
"Role,ClickTime,TimeToGenerate,TimeToSend,IP)"
|
||||
" VALUES ('%ld','%ld','%ld','%ld','%ld','%ld','%ld',"
|
||||
"'%u',NOW(),'%ld','%ld','%s')",
|
||||
Act_Actions[Gbl.CurrentAct].ActCod,
|
||||
Act_Actions[Gbl.Action.Act].ActCod,
|
||||
Gbl.CurrentCty.Cty.CtyCod,
|
||||
Gbl.CurrentIns.Ins.InsCod,
|
||||
Gbl.CurrentCtr.Ctr.CtrCod,
|
||||
|
@ -305,7 +305,7 @@ void Sta_LogAccess (const char *Comments)
|
|||
"Role,ClickTime,TimeToGenerate,TimeToSend,IP)"
|
||||
" VALUES ('%ld','%ld','%ld','%ld','%ld','%ld','%ld','%ld',"
|
||||
"'%u',NOW(),'%ld','%ld','%s')",
|
||||
LogCod,Act_Actions[Gbl.CurrentAct].ActCod,
|
||||
LogCod,Act_Actions[Gbl.Action.Act].ActCod,
|
||||
Gbl.CurrentCty.Cty.CtyCod,
|
||||
Gbl.CurrentIns.Ins.InsCod,
|
||||
Gbl.CurrentCtr.Ctr.CtrCod,
|
||||
|
@ -1423,7 +1423,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
|
|||
DB_FreeMySQLResult (&mysql_res);
|
||||
|
||||
/***** Free the memory used by the list of users *****/
|
||||
if (Gbl.CurrentAct == ActSeeAccCrs)
|
||||
if (Gbl.Action.Act == ActSeeAccCrs)
|
||||
Usr_FreeListsSelectedUsrCods ();
|
||||
|
||||
/***** 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\">",
|
||||
The_ClassForm[Gbl.Prefs.Theme]);
|
||||
|
||||
Act_FormStartAnchor (Gbl.CurrentAct,"stat_form");
|
||||
Act_FormStartAnchor (Gbl.Action.Act,"stat_form");
|
||||
Sta_WriteParamsDatesSeeAccesses ();
|
||||
Par_PutHiddenParamUnsigned ("GroupedBy",(unsigned) Gbl.Stat.ClicksGroupedBy);
|
||||
Par_PutHiddenParamUnsigned ("CountType",(unsigned) Gbl.Stat.CountType);
|
||||
Par_PutHiddenParamUnsigned ("StatAct",(unsigned) Gbl.Stat.NumAction);
|
||||
if (Gbl.CurrentAct == ActSeeAccCrs)
|
||||
if (Gbl.Action.Act == ActSeeAccCrs)
|
||||
Usr_PutHiddenParUsrCodAll (ActSeeAccCrs,Gbl.Usrs.Select.All);
|
||||
else // Gbl.CurrentAct == ActSeeAccGbl
|
||||
else // Gbl.Action.Act == ActSeeAccGbl
|
||||
{
|
||||
Par_PutHiddenParamUnsigned ("Role",(unsigned) Gbl.Stat.Role);
|
||||
Sco_PutParamScope (Gbl.Scope.Current);
|
||||
|
|
|
@ -2226,7 +2226,7 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst,ch
|
|||
unsigned NumAns,NumAnswers = 0;
|
||||
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
|
||||
{
|
||||
|
@ -2781,9 +2781,9 @@ static void Svy_ListSvyQuestions (struct Survey *Svy,struct SurveyQuestion *SvyQ
|
|||
MYSQL_ROW row;
|
||||
unsigned NumQsts;
|
||||
unsigned NumQst;
|
||||
bool Editing = (Gbl.CurrentAct == ActEdiOneSvy ||
|
||||
Gbl.CurrentAct == ActEdiOneSvyQst ||
|
||||
Gbl.CurrentAct == ActRcvSvyQst);
|
||||
bool Editing = (Gbl.Action.Act == ActEdiOneSvy ||
|
||||
Gbl.Action.Act == ActEdiOneSvyQst ||
|
||||
Gbl.Action.Act == ActRcvSvyQst);
|
||||
bool PutFormAnswerSurvey = Svy->Status.ICanAnswer && !Editing;
|
||||
|
||||
/***** Get data of questions from database *****/
|
||||
|
|
|
@ -190,8 +190,8 @@ void Syl_EditSyllabus (void)
|
|||
/***** Set syllabus type and load syllabus from XML file to memory *****/
|
||||
InfoType = Syl_SetSyllabusTypeAndLoadToMemory ();
|
||||
|
||||
if (Gbl.CurrentAct == ActEditorSylLec ||
|
||||
Gbl.CurrentAct == ActEditorSylPra)
|
||||
if (Gbl.Action.Act == ActEditorSylLec ||
|
||||
Gbl.Action.Act == ActEditorSylPra)
|
||||
Gbl.CurrentCrs.Syllabus.EditionIsActive = true;
|
||||
|
||||
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
|
||||
|
||||
/***** Set the type of syllabus (lectures or practicals) *****/
|
||||
switch (Gbl.CurrentAct)
|
||||
switch (Gbl.Action.Act)
|
||||
{
|
||||
case ActSeeSyl:
|
||||
InfoType = (Gbl.CurrentCrs.Syllabus.WhichSyllabus == Syl_LECTURES ? Inf_LECTURES :
|
||||
|
@ -483,10 +483,10 @@ static void Syl_ShowSyllabus (Inf_InfoType_t InfoType)
|
|||
int i;
|
||||
int NumButtons = Gbl.CurrentCrs.Syllabus.EditionIsActive ? 5 :
|
||||
0;
|
||||
bool ShowRowInsertNewItem = (Gbl.CurrentAct == ActInsIteSylLec || Gbl.CurrentAct == ActInsIteSylPra ||
|
||||
Gbl.CurrentAct == ActModIteSylLec || Gbl.CurrentAct == ActModIteSylPra ||
|
||||
Gbl.CurrentAct == ActRgtIteSylLec || Gbl.CurrentAct == ActRgtIteSylPra ||
|
||||
Gbl.CurrentAct == ActLftIteSylLec || Gbl.CurrentAct == ActLftIteSylPra);
|
||||
bool ShowRowInsertNewItem = (Gbl.Action.Act == ActInsIteSylLec || Gbl.Action.Act == ActInsIteSylPra ||
|
||||
Gbl.Action.Act == ActModIteSylLec || Gbl.Action.Act == ActModIteSylPra ||
|
||||
Gbl.Action.Act == ActRgtIteSylLec || Gbl.Action.Act == ActRgtIteSylPra ||
|
||||
Gbl.Action.Act == ActLftIteSylLec || Gbl.Action.Act == ActLftIteSylPra);
|
||||
|
||||
/***** Set width of columns of the table *****/
|
||||
fprintf (Gbl.F.Out,"<colgroup>");
|
||||
|
|
58
swad_tab.c
58
swad_tab.c
|
@ -102,9 +102,9 @@ void Tab_DrawTabs (void)
|
|||
ICanViewTab = Tab_CheckIfICanViewTab (NumTab);
|
||||
|
||||
/* 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 ();
|
||||
}
|
||||
|
||||
|
@ -112,20 +112,20 @@ void Tab_DrawTabs (void)
|
|||
{
|
||||
/* Form, icon (at top) and text (at bottom) of the tab */
|
||||
fprintf (Gbl.F.Out,"<li class=\"%s %s\">",
|
||||
NumTab == Gbl.CurrentTab ? "TAB_ON" :
|
||||
NumTab == Gbl.Action.Tab ? "TAB_ON" :
|
||||
"TAB_OFF",
|
||||
NumTab == Gbl.CurrentTab ? The_TabOnBgColors[Gbl.Prefs.Theme] :
|
||||
NumTab == Gbl.Action.Tab ? The_TabOnBgColors[Gbl.Prefs.Theme] :
|
||||
The_TabOffBgColors[Gbl.Prefs.Theme]);
|
||||
if (ICanViewTab)
|
||||
{
|
||||
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,">");
|
||||
Act_FormStart (ActMnu);
|
||||
Par_PutHiddenParamUnsigned ("NxtTab",(unsigned) 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]);
|
||||
fprintf (Gbl.F.Out,"<img src=\"%s/%s/%s\""
|
||||
" alt=\"%s\" title=\"%s\""
|
||||
|
@ -136,7 +136,7 @@ void Tab_DrawTabs (void)
|
|||
Tab_TabIcons[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],
|
||||
Txt_TABS_SHORT_TXT[NumTab]);
|
||||
Act_FormEnd ();
|
||||
|
@ -211,15 +211,15 @@ void Tab_DrawBreadcrumb (void)
|
|||
/***** Home *****/
|
||||
Tab_WriteBreadcrumbHome ();
|
||||
|
||||
if (Gbl.CurrentAct == ActMnu ||
|
||||
Act_Actions[Act_Actions[Gbl.CurrentAct].SuperAction].IndexInMenu >= 0)
|
||||
if (Gbl.Action.Act == ActMnu ||
|
||||
Act_Actions[Act_Actions[Gbl.Action.Act].SuperAction].IndexInMenu >= 0)
|
||||
{
|
||||
/***** Tab *****/
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\"> > </span>",
|
||||
The_ClassTxtTabOn[Gbl.Prefs.Theme]);
|
||||
Tab_WriteBreadcrumbTab ();
|
||||
|
||||
if (Act_Actions[Act_Actions[Gbl.CurrentAct].SuperAction].IndexInMenu >= 0)
|
||||
if (Act_Actions[Act_Actions[Gbl.Action.Act].SuperAction].IndexInMenu >= 0)
|
||||
{
|
||||
/***** Menu *****/
|
||||
fprintf (Gbl.F.Out,"<span class=\"%s\"> > </span>",
|
||||
|
@ -258,12 +258,12 @@ static void Tab_WriteBreadcrumbTab (void)
|
|||
|
||||
/***** Start form *****/
|
||||
Act_FormStart (ActMnu);
|
||||
Par_PutHiddenParamUnsigned ("NxtTab",(unsigned) Gbl.CurrentTab);
|
||||
Act_LinkFormSubmit (Txt_TABS_FULL_TXT[Gbl.CurrentTab],The_ClassTxtTabOn[Gbl.Prefs.Theme]);
|
||||
Par_PutHiddenParamUnsigned ("NxtTab",(unsigned) Gbl.Action.Tab);
|
||||
Act_LinkFormSubmit (Txt_TABS_FULL_TXT[Gbl.Action.Tab],The_ClassTxtTabOn[Gbl.Prefs.Theme]);
|
||||
|
||||
/***** Title and end of form *****/
|
||||
fprintf (Gbl.F.Out,"%s</a>",
|
||||
Txt_TABS_FULL_TXT[Gbl.CurrentTab]);
|
||||
Txt_TABS_FULL_TXT[Gbl.Action.Tab]);
|
||||
Act_FormEnd ();
|
||||
}
|
||||
|
||||
|
@ -274,10 +274,10 @@ static void Tab_WriteBreadcrumbTab (void)
|
|||
static void Tab_WriteBreadcrumbAction (void)
|
||||
{
|
||||
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 *****/
|
||||
Act_FormStart (Act_Actions[Gbl.CurrentAct].SuperAction);
|
||||
Act_FormStart (Act_Actions[Gbl.Action.Act].SuperAction);
|
||||
Act_LinkFormSubmit (Title,The_ClassTxtTabOn[Gbl.Prefs.Theme]);
|
||||
|
||||
/***** Title and end of form *****/
|
||||
|
@ -292,53 +292,53 @@ static void Tab_WriteBreadcrumbAction (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
|
||||
are incompatible with the current tab *****/
|
||||
switch (Gbl.CurrentTab)
|
||||
switch (Gbl.Action.Tab)
|
||||
{
|
||||
case TabCty:
|
||||
if (Gbl.CurrentCty.Cty.CtyCod <= 0) // No country selected
|
||||
Gbl.CurrentAct = ActSeeCty;
|
||||
Gbl.Action.Act = ActSeeCty;
|
||||
break;
|
||||
case TabIns:
|
||||
if (Gbl.CurrentIns.Ins.InsCod <= 0) // 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
|
||||
Gbl.CurrentAct = ActSeeCty;
|
||||
Gbl.Action.Act = ActSeeCty;
|
||||
}
|
||||
break;
|
||||
case TabCtr:
|
||||
if (Gbl.CurrentCtr.Ctr.CtrCod <= 0) // 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
|
||||
Gbl.CurrentAct = ActSeeIns;
|
||||
Gbl.Action.Act = ActSeeIns;
|
||||
else // No country selected
|
||||
Gbl.CurrentAct = ActSeeCty;
|
||||
Gbl.Action.Act = ActSeeCty;
|
||||
}
|
||||
break;
|
||||
case TabDeg:
|
||||
if (Gbl.CurrentDeg.Deg.DegCod <= 0) // 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
|
||||
Gbl.CurrentAct = ActSeeCtr;
|
||||
Gbl.Action.Act = ActSeeCtr;
|
||||
else if (Gbl.CurrentCty.Cty.CtyCod > 0) // Country selected, but no institution selected
|
||||
Gbl.CurrentAct = ActSeeIns;
|
||||
Gbl.Action.Act = ActSeeIns;
|
||||
else // No country selected
|
||||
Gbl.CurrentAct = ActSeeCty;
|
||||
Gbl.Action.Act = ActSeeCty;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
Gbl.CurrentTab = Act_Actions[Gbl.CurrentAct].Tab;
|
||||
Gbl.Action.Tab = Act_Actions[Gbl.Action.Act].Tab;
|
||||
|
||||
Tab_DisableIncompatibleTabs ();
|
||||
}
|
||||
|
@ -351,7 +351,7 @@ void Tab_DisableIncompatibleTabs (void)
|
|||
{
|
||||
/***** Set country, institution, centre, degree and course depending on the current tab.
|
||||
This will disable tabs incompatible with the current one. *****/
|
||||
switch (Gbl.CurrentTab)
|
||||
switch (Gbl.Action.Tab)
|
||||
{
|
||||
case TabSys:
|
||||
Gbl.CurrentCty.Cty.CtyCod = -1L;
|
||||
|
|
14
swad_test.c
14
swad_test.c
|
@ -739,7 +739,7 @@ static void Tst_WriteTestHead (unsigned NumTst)
|
|||
extern const char *Txt_Test_No_X_that_you_make_in_this_course;
|
||||
|
||||
/***** Start table *****/
|
||||
Lay_StartRoundFrameTable (NULL,2,Gbl.CurrentAct == ActSeeTst ? Txt_Test :
|
||||
Lay_StartRoundFrameTable (NULL,2,Gbl.Action.Act == ActSeeTst ? Txt_Test :
|
||||
Txt_Test_result);
|
||||
Lay_WriteHeaderClassPhoto (3,false,false,
|
||||
Gbl.CurrentIns.Ins.InsCod,
|
||||
|
@ -747,7 +747,7 @@ static void Tst_WriteTestHead (unsigned NumTst)
|
|||
Gbl.CurrentCrs.Crs.CrsCod);
|
||||
|
||||
/***** Header row *****/
|
||||
if (Gbl.CurrentAct == ActAssTst &&
|
||||
if (Gbl.Action.Act == ActAssTst &&
|
||||
Gbl.Usrs.Me.IBelongToCurrentCrs)
|
||||
{
|
||||
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\">",
|
||||
Gbl.RowEvenOdd);
|
||||
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'));
|
||||
else // Assessing exam / Viewing old exam
|
||||
{
|
||||
|
@ -3893,7 +3893,7 @@ static int Tst_GetParamsTst (void)
|
|||
}
|
||||
|
||||
/***** Get other parameters, depending on action *****/
|
||||
if (Gbl.CurrentAct == ActSeeTst)
|
||||
if (Gbl.Action.Act == ActSeeTst)
|
||||
{
|
||||
Tst_GetParamNumQst ();
|
||||
if (Gbl.Test.NumQsts < Gbl.Test.Config.Min ||
|
||||
|
@ -4093,7 +4093,7 @@ static void Tst_PutFormEditOneQst (char *Stem,char *Feedback)
|
|||
bool TagNotFound;
|
||||
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 ();
|
||||
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);
|
||||
if (ICanViewExam)
|
||||
{
|
||||
Act_FormStart (Gbl.CurrentAct == ActSeeMyTstExa ? ActSeeOneTstExaMe :
|
||||
Act_FormStart (Gbl.Action.Act == ActSeeMyTstExa ? ActSeeOneTstExaMe :
|
||||
ActSeeOneTstExaOth);
|
||||
Tst_PutParamTstCod (TstCod);
|
||||
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);
|
||||
Gbl.Test.Config.FeedbackType = Tst_FEEDBACK_FULL_FEEDBACK; // Initialize feedback to maximum
|
||||
ICanViewScore = true;
|
||||
switch (Gbl.CurrentAct)
|
||||
switch (Gbl.Action.Act)
|
||||
{
|
||||
case ActSeeOneTstExaMe:
|
||||
if (Gbl.Usrs.Other.UsrDat.UsrCod != Gbl.Usrs.Me.UsrDat.UsrCod) // The exam is not mine
|
||||
|
|
|
@ -231,7 +231,7 @@ void TT_ShowClassTimeTable (void)
|
|||
bool PutEditOfficeHours;
|
||||
|
||||
/***** Initializations *****/
|
||||
switch (Gbl.CurrentAct)
|
||||
switch (Gbl.Action.Act)
|
||||
{
|
||||
case ActSeeCrsTT:
|
||||
case ActPrnCrsTT:
|
||||
|
@ -246,8 +246,8 @@ void TT_ShowClassTimeTable (void)
|
|||
default:
|
||||
Lay_ShowErrorAndExit ("Wrong action.");
|
||||
}
|
||||
PrintView = (Gbl.CurrentAct == ActPrnCrsTT ||
|
||||
Gbl.CurrentAct == ActPrnMyTT);
|
||||
PrintView = (Gbl.Action.Act == ActPrnCrsTT ||
|
||||
Gbl.Action.Act == ActPrnMyTT);
|
||||
PutEditCrsTT = (TimeTableType == TT_COURSE_TIMETABLE &&
|
||||
!PrintView &&
|
||||
Gbl.Usrs.Me.LoggedRole >= Rol_TEACHER);
|
||||
|
@ -383,8 +383,8 @@ void TT_ShowTimeTable (TT_TimeTableType_t TimeTableType,long UsrCod)
|
|||
TT_CreatTimeTableFromDB (TimeTableType,UsrCod);
|
||||
|
||||
/***** If timetable must be modified... *****/
|
||||
if (Gbl.CurrentAct == ActChgCrsTT ||
|
||||
Gbl.CurrentAct == ActChgTut)
|
||||
if (Gbl.Action.Act == ActChgCrsTT ||
|
||||
Gbl.Action.Act == ActChgTut)
|
||||
{
|
||||
/* Get parameters for time table editing */
|
||||
TT_GetParamsTimeTable ();
|
||||
|
@ -571,8 +571,8 @@ static void TT_CreatTimeTableFromDB (TT_TimeTableType_t TimeTableType,long UsrCo
|
|||
break;
|
||||
case TT_COURSE_TIMETABLE:
|
||||
if (Gbl.CurrentCrs.Grps.WhichGrps == Grp_ALL_GROUPS ||
|
||||
Gbl.CurrentAct == ActEdiCrsTT ||
|
||||
Gbl.CurrentAct == ActChgCrsTT) // If we are editing, all groups are shown
|
||||
Gbl.Action.Act == ActEdiCrsTT ||
|
||||
Gbl.Action.Act == ActChgCrsTT) // If we are editing, all groups are shown
|
||||
sprintf (Query,"SELECT Day,Hour,Duration,Place,ClassType,GroupName,GrpCod"
|
||||
" FROM timetable_crs"
|
||||
" WHERE CrsCod='%ld'"
|
||||
|
@ -773,7 +773,7 @@ static void TT_DrawTimeTable (TT_TimeTableType_t TimeTableType)
|
|||
unsigned ColumnsToDrawIncludingExtraColumn;
|
||||
unsigned ContinuousFreeMinicolumns;
|
||||
|
||||
switch (Gbl.CurrentAct)
|
||||
switch (Gbl.Action.Act)
|
||||
{
|
||||
case ActSeeCrsTT: case ActPrnCrsTT: case ActChgCrsTT1stDay:
|
||||
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);
|
||||
|
||||
/***** Get list of groups types and groups in this course *****/
|
||||
if (Gbl.CurrentAct == ActEdiCrsTT ||
|
||||
Gbl.CurrentAct == ActChgCrsTT)
|
||||
if (Gbl.Action.Act == ActEdiCrsTT ||
|
||||
Gbl.Action.Act == ActChgCrsTT)
|
||||
Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_ONLY_GROUP_TYPES_WITH_GROUPS);
|
||||
|
||||
/***** 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 *****/
|
||||
if (Gbl.CurrentAct == ActEdiCrsTT ||
|
||||
Gbl.CurrentAct == ActChgCrsTT)
|
||||
if (Gbl.Action.Act == ActEdiCrsTT ||
|
||||
Gbl.Action.Act == ActChgCrsTT)
|
||||
Grp_FreeListGrpTypesAndGrps ();
|
||||
|
||||
/***** Row with day names *****/
|
||||
|
@ -1109,7 +1109,7 @@ static void TT_TimeTableDrawCell (TT_TimeTableType_t TimeTableType,
|
|||
return;
|
||||
|
||||
/***** Set type of view depending on current action *****/
|
||||
switch (Gbl.CurrentAct)
|
||||
switch (Gbl.Action.Act)
|
||||
{
|
||||
case ActSeeCrsTT: case ActPrnCrsTT: case ActChgCrsTT1stDay:
|
||||
case ActSeeMyTT: case ActPrnMyTT: case ActChgMyTT1stDay:
|
||||
|
|
62
swad_user.c
62
swad_user.c
|
@ -196,7 +196,7 @@ void Usr_InformAboutNumClicksBeforePhoto (void)
|
|||
{
|
||||
if (Gbl.Usrs.Me.NumAccWithoutPhoto >= Pho_MAX_CLICKS_WITHOUT_PHOTO)
|
||||
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_,
|
||||
Pho_MAX_CLICKS_WITHOUT_PHOTO-Gbl.Usrs.Me.NumAccWithoutPhoto);
|
||||
|
@ -249,8 +249,8 @@ void Usr_ResetUsrDataExceptUsrCodAndIDs (struct UsrData *UsrDat)
|
|||
UsrDat->EmailConfirmed = false;
|
||||
|
||||
UsrDat->Photo[0] = '\0';
|
||||
UsrDat->PhotoVisibility =
|
||||
UsrDat->ProfileVisibility = Pri_VISIBILITY_DEFAULT;
|
||||
UsrDat->PhotoVisibility = Pri_PHOTO_VISIBILITY_DEFAULT;
|
||||
UsrDat->ProfileVisibility = Pri_PROFILE_VISIBILITY_DEFAULT;
|
||||
|
||||
UsrDat->CtyCod = -1L;
|
||||
UsrDat->OriginPlace[0] = '\0';
|
||||
|
@ -486,8 +486,8 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat)
|
|||
/* Get rest of data */
|
||||
strncpy (UsrDat->Photo,row[10],sizeof (UsrDat->Photo) - 1);
|
||||
UsrDat->Photo[sizeof (UsrDat->Photo) - 1] = '\0';
|
||||
UsrDat->PhotoVisibility = Pri_GetVisibilityFromStr (row[11]);
|
||||
UsrDat->ProfileVisibility = Pri_GetVisibilityFromStr (row[12]);
|
||||
UsrDat->PhotoVisibility = Pri_GetVisibilityFromStr (row[11],Pri_PHOTO_VISIBILITY_DEFAULT);
|
||||
UsrDat->ProfileVisibility = Pri_GetVisibilityFromStr (row[12],Pri_PROFILE_VISIBILITY_DEFAULT);
|
||||
UsrDat->CtyCod = Str_ConvertStrCodToLongCod (row[13]);
|
||||
UsrDat->InsCtyCod = Str_ConvertStrCodToLongCod (row[14]);
|
||||
UsrDat->InsCod = Str_ConvertStrCodToLongCod (row[15]);
|
||||
|
@ -1863,9 +1863,9 @@ void Usr_ChkUsrAndGetUsrData (void)
|
|||
|
||||
if (Gbl.Session.HasBeenDisconnected)
|
||||
{
|
||||
if (Gbl.CurrentAct != ActRefCon)
|
||||
if (Gbl.Action.Act != ActRefCon)
|
||||
{
|
||||
Gbl.CurrentAct = ActLogOut;
|
||||
Gbl.Action.Act = ActLogOut;
|
||||
Tab_SetCurrentTab ();
|
||||
Lay_ShowAlert (Lay_WARNING,Txt_The_session_has_expired_due_to_inactivity);
|
||||
PutFormLogin = true;
|
||||
|
@ -1874,7 +1874,7 @@ void Usr_ChkUsrAndGetUsrData (void)
|
|||
else // !Gbl.Session.HasBeenDisconnected
|
||||
{
|
||||
/***** Check user and get user's data *****/
|
||||
if (Gbl.CurrentAct == ActCreUsrAcc)
|
||||
if (Gbl.Action.Act == ActCreUsrAcc)
|
||||
{
|
||||
/***** Create new account and login *****/
|
||||
if (Acc_CreateNewAccountAndLogIn ()) // User logged in
|
||||
|
@ -1892,7 +1892,7 @@ void Usr_ChkUsrAndGetUsrData (void)
|
|||
Mai_SendMailMsgToConfirmEmail ();
|
||||
}
|
||||
}
|
||||
else // Gbl.CurrentAct != ActCreUsrAcc
|
||||
else // Gbl.Action.Act != ActCreUsrAcc
|
||||
{
|
||||
/***** Check user and get user's data *****/
|
||||
if (Gbl.Session.IsOpen)
|
||||
|
@ -1902,7 +1902,7 @@ void Usr_ChkUsrAndGetUsrData (void)
|
|||
Gbl.Usrs.Me.Logged = true;
|
||||
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 ();
|
||||
else
|
||||
{
|
||||
|
@ -1914,7 +1914,7 @@ void Usr_ChkUsrAndGetUsrData (void)
|
|||
else
|
||||
PutFormLogin = true;
|
||||
}
|
||||
else if (Gbl.CurrentAct == ActAutUsrInt)
|
||||
else if (Gbl.Action.Act == ActAutUsrInt)
|
||||
{
|
||||
if (Usr_ChkUsrAndGetUsrDataFromDirectLogin ()) // User logged in
|
||||
{
|
||||
|
@ -1929,7 +1929,7 @@ void Usr_ChkUsrAndGetUsrData (void)
|
|||
else
|
||||
PutFormLogin = true;
|
||||
}
|
||||
else if (Gbl.CurrentAct == ActAutUsrExt)
|
||||
else if (Gbl.Action.Act == ActAutUsrExt)
|
||||
{
|
||||
if (Usr_ChkUsrAndGetUsrDataFromExternalLogin ()) // User logged in
|
||||
{
|
||||
|
@ -1957,15 +1957,15 @@ void Usr_ChkUsrAndGetUsrData (void)
|
|||
}
|
||||
|
||||
/***** Adjust tab and action *****/
|
||||
if (Gbl.CurrentAct != ActRefCon)
|
||||
if (Gbl.Action.Act != ActRefCon)
|
||||
{
|
||||
if (Gbl.Usrs.Me.Logged)
|
||||
{
|
||||
/***** Set default tab when unknown *****/
|
||||
if (Gbl.CurrentTab == TabUnk)
|
||||
if (Gbl.Action.Tab == TabUnk)
|
||||
{
|
||||
// Don't adjust Gbl.CurrentAct here
|
||||
Gbl.CurrentTab = ((Gbl.Usrs.Me.UsrLast.LastTab == TabCrs) &&
|
||||
// Don't adjust Gbl.Action.Act here
|
||||
Gbl.Action.Tab = ((Gbl.Usrs.Me.UsrLast.LastTab == TabCrs) &&
|
||||
(Gbl.CurrentCrs.Crs.CrsCod <= 0)) ? TabSys :
|
||||
Gbl.Usrs.Me.UsrLast.LastTab;
|
||||
Tab_DisableIncompatibleTabs ();
|
||||
|
@ -1973,11 +1973,11 @@ void Usr_ChkUsrAndGetUsrData (void)
|
|||
Usr_UpdateMyLastData ();
|
||||
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 ();
|
||||
|
||||
/***** 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)
|
||||
{
|
||||
|
@ -1987,7 +1987,7 @@ void Usr_ChkUsrAndGetUsrData (void)
|
|||
else
|
||||
Action = Mnu_GetFirstActionAvailableInCurrentTab ();
|
||||
if (Action != ActUnk)
|
||||
Gbl.CurrentAct = Action;
|
||||
Gbl.Action.Act = Action;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2386,8 +2386,8 @@ static void Usr_SetUsrRoleAndPrefs (void)
|
|||
|
||||
/***** Get my last data *****/
|
||||
Usr_GetMyLastData ();
|
||||
if (Gbl.CurrentAct == ActAutUsrInt ||
|
||||
Gbl.CurrentAct == ActAutUsrExt) // If I just logged in...
|
||||
if (Gbl.Action.Act == ActAutUsrInt ||
|
||||
Gbl.Action.Act == ActAutUsrExt) // If I just logged in...
|
||||
{
|
||||
/***** WhatToSearch is stored in session,
|
||||
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.CurrentDegTyp.DegTyp.AllowDirectLogIn && // ...but the current degree type...
|
||||
!Gbl.CurrentCrs.Crs.AllowDirectLogIn && // ...and the current course do not allow to log in directly
|
||||
(Gbl.CurrentAct == ActSeeCrsInf ||
|
||||
Gbl.CurrentAct == ActAutUsrInt ||
|
||||
Gbl.CurrentAct == ActHom))
|
||||
(Gbl.Action.Act == ActSeeCrsInf ||
|
||||
Gbl.Action.Act == ActAutUsrInt ||
|
||||
Gbl.Action.Act == ActHom))
|
||||
{
|
||||
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,
|
||||
|
@ -2636,7 +2636,7 @@ void Usr_UpdateMyLastData (void)
|
|||
sprintf (Query,"UPDATE usr_last SET LastCrs='%ld',LastTab='%u',LastTime=NOW()"
|
||||
" WHERE UsrCod='%ld'",
|
||||
Gbl.CurrentCrs.Crs.CrsCod,
|
||||
(unsigned) Gbl.CurrentTab,
|
||||
(unsigned) Gbl.Action.Tab,
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
DB_QueryUPDATE (Query,"can not update last user's data");
|
||||
}
|
||||
|
@ -2658,7 +2658,7 @@ static void Usr_InsertMyLastData (void)
|
|||
" VALUES ('%ld','%ld','%u',NOW())",
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||
Gbl.CurrentCrs.Crs.CrsCod,
|
||||
(unsigned) Gbl.CurrentTab);
|
||||
(unsigned) Gbl.Action.Tab);
|
||||
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 *****/
|
||||
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"
|
||||
" FROM crs_usr,usr_data"
|
||||
" WHERE crs_usr.CrsCod='%ld'"
|
||||
|
@ -4539,12 +4539,12 @@ static void Usr_PutButtonToConfirmIWantToSeeBigList (unsigned NumUsrs)
|
|||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||
|
||||
/***** Put form to confirm that I want to see the big list *****/
|
||||
Act_FormStart (Gbl.CurrentAct);
|
||||
Act_FormStart (Gbl.Action.Act);
|
||||
Grp_PutParamsCodGrps ();
|
||||
Usr_PutParamUsrListType (Gbl.Usrs.Me.ListType);
|
||||
Usr_PutParamColsClassPhoto ();
|
||||
Usr_PutParamListWithPhotos ();
|
||||
Usr_PutExtraParamsUsrList (Gbl.CurrentAct);
|
||||
Usr_PutExtraParamsUsrList (Gbl.Action.Act);
|
||||
Par_PutHiddenParamChar ("ShowBigList",'Y');
|
||||
|
||||
/***** Send button *****/
|
||||
|
@ -4581,7 +4581,7 @@ void Usr_GetListsSelectedUsrs (void)
|
|||
/***** Get selected users *****/
|
||||
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);
|
||||
Str_ChangeFormat (Str_FROM_FORM,Str_TO_TEXT,
|
||||
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)
|
||||
{
|
||||
switch (Gbl.CurrentAct)
|
||||
switch (Gbl.Action.Act)
|
||||
{
|
||||
case ActLstGst:
|
||||
case ActLstStd:
|
||||
|
|
Loading…
Reference in New Issue