Version 17.29

This commit is contained in:
Antonio Cañas Vargas 2018-04-24 13:21:53 +02:00
parent 38e7617d2c
commit d488416717
187 changed files with 658 additions and 522 deletions

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General 3 License as it under the terms of the GNU Affero General 3 License as
@ -2411,19 +2411,31 @@ a:hover img.CENTRE_PHOTO_SHOW
} }
.GAM_PLAY_NUM_QST .GAM_PLAY_NUM_QST
{ {
width:15%; width:10%;
float:left; float:left;
/* position:relative; */ /* position:relative; */
padding-bottom:24pt; padding-bottom:24pt;
color:#808080; color:#808080;
font-size:48pt; font-size:48pt;
font-weight:bold; font-weight:bold;
// background:pink;
} }
.GAM_PLAY_QST_CONTAINER .GAM_PLAY_QST_CONTAINER
{ {
width:85%; width:80%;
float:left; float:left;
/* position:relative; */ /* position:relative; */
// background:blue;
}
.GAM_PLAY_NXT_CONTAINER
{
width:10%;
float:left;
/* position:relative; */
// background:grey;
} }
.GAM_PLAY_QST .GAM_PLAY_QST
{ {
@ -2441,7 +2453,7 @@ a:hover img.CENTRE_PHOTO_SHOW
} }
.GAM_PLAY_CONTINUE .GAM_PLAY_CONTINUE
{ {
font-size:24pt; font-size:16pt;
} }
/******************************* Time table **********************************/ /******************************* Time table **********************************/

View File

@ -4,7 +4,7 @@
SWAD (Shared Workspace At a Distance), SWAD (Shared Workspace At a Distance),
is a web platform developed at the University of Granada (Spain), is a web platform developed at the University of Granada (Spain),
and used to support university teaching. and used to support university teaching.
Copyright (C) 1999-2017 Antonio Cañas-Vargas Copyright (C) 1999-2018 Antonio Cañas-Vargas
University of Granada (SPAIN) (acanas@ugr.es) University of Granada (SPAIN) (acanas@ugr.es)
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -363,7 +363,6 @@ static bool ID_CheckIfUsrIDIsValidUsingMinDigits (const char *UsrID,unsigned Min
void ID_WriteUsrIDs (struct UsrData *UsrDat,const char *Anchor) void ID_WriteUsrIDs (struct UsrData *UsrDat,const char *Anchor)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
unsigned NumID; unsigned NumID;
bool ICanSeeUsrID; bool ICanSeeUsrID;
bool ICanConfirmUsrID; bool ICanConfirmUsrID;
@ -372,7 +371,7 @@ void ID_WriteUsrIDs (struct UsrData *UsrDat,const char *Anchor)
ICanConfirmUsrID = ICanSeeUsrID && ICanConfirmUsrID = ICanSeeUsrID &&
(UsrDat->UsrCod != Gbl.Usrs.Me.UsrDat.UsrCod) && // Not me (UsrDat->UsrCod != Gbl.Usrs.Me.UsrDat.UsrCod) && // Not me
!Gbl.Form.Inside && // Not inside another form !Gbl.Form.Inside && // Not inside another form
Act_Actions[Gbl.Action.Act].BrowserTab == Act_BRW_1ST_TAB; // Only in main browser tab Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB; // Only in main browser tab
for (NumID = 0; for (NumID = 0;
NumID < UsrDat->IDs.Num; NumID < UsrDat->IDs.Num;
@ -448,7 +447,6 @@ bool ID_ICanSeeOtherUsrIDs (const struct UsrData *UsrDat)
static void ID_PutLinkToConfirmID (struct UsrData *UsrDat,unsigned NumID, static void ID_PutLinkToConfirmID (struct UsrData *UsrDat,unsigned NumID,
const char *Anchor) const char *Anchor)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
extern const char *The_ClassFormBold[The_NUM_THEMES]; extern const char *The_ClassFormBold[The_NUM_THEMES];
extern const char *Txt_Confirm_ID; extern const char *Txt_Confirm_ID;
Act_Action_t NextAction; Act_Action_t NextAction;
@ -471,7 +469,7 @@ static void ID_PutLinkToConfirmID (struct UsrData *UsrDat,unsigned NumID,
if (Gbl.Action.Original != ActUnk) if (Gbl.Action.Original != ActUnk)
{ {
Par_PutHiddenParamLong ("OriginalActCod", Par_PutHiddenParamLong ("OriginalActCod",
Act_Actions[Gbl.Action.Original].ActCod); // Original action, used to know where we came from Act_GetActCod (Gbl.Action.Original)); // Original action, used to know where we came from
switch (Gbl.Action.Original) switch (Gbl.Action.Original)
{ {
case ActSeeRecSevGst: case ActSeeRecSevGst:

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General 3 License as it under the terms of the GNU Affero General 3 License as
@ -98,7 +98,6 @@ void MFU_FreeMFUActions (struct MFU_ListMFUActions *ListMFUActions)
void MFU_GetMFUActions (struct MFU_ListMFUActions *ListMFUActions,unsigned MaxActionsShown) void MFU_GetMFUActions (struct MFU_ListMFUActions *ListMFUActions,unsigned MaxActionsShown)
{ {
extern Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD]; extern Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD];
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
char Query[512]; char Query[512];
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
@ -123,7 +122,7 @@ void MFU_GetMFUActions (struct MFU_ListMFUActions *ListMFUActions,unsigned MaxAc
ActCod = Str_ConvertStrCodToLongCod (row[0]); ActCod = Str_ConvertStrCodToLongCod (row[0]);
if (ActCod >= 0 && ActCod <= Act_MAX_ACTION_COD) if (ActCod >= 0 && ActCod <= Act_MAX_ACTION_COD)
if ((Action = Act_FromActCodToAction[ActCod]) >= 0) if ((Action = Act_FromActCodToAction[ActCod]) >= 0)
if (Act_Actions[Action].IndexInMenu >= 0) // MFU actions must be only actions shown on menu (database could contain wrong action numbers) if (Act_GetIndexInMenu (Action) >= 0) // MFU actions must be only actions shown on menu (database could contain wrong action numbers)
if (Act_CheckIfIHavePermissionToExecuteAction (Action)) if (Act_CheckIfIHavePermissionToExecuteAction (Action))
ListMFUActions->Actions[ListMFUActions->NumActions++] = Action; ListMFUActions->Actions[ListMFUActions->NumActions++] = Action;
} }
@ -139,7 +138,6 @@ void MFU_GetMFUActions (struct MFU_ListMFUActions *ListMFUActions,unsigned MaxAc
Act_Action_t MFU_GetMyLastActionInCurrentTab (void) Act_Action_t MFU_GetMyLastActionInCurrentTab (void)
{ {
extern Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD]; extern Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD];
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
char Query[512]; char Query[512];
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
@ -147,7 +145,6 @@ Act_Action_t MFU_GetMyLastActionInCurrentTab (void)
unsigned NumAct; unsigned NumAct;
long ActCod; long ActCod;
Act_Action_t Action; Act_Action_t Action;
Act_Action_t SuperAction;
Act_Action_t MoreRecentActionInCurrentTab = ActUnk; Act_Action_t MoreRecentActionInCurrentTab = ActUnk;
if (Gbl.Usrs.Me.UsrDat.UsrCod > 0) if (Gbl.Usrs.Me.UsrDat.UsrCod > 0)
@ -170,15 +167,12 @@ Act_Action_t MFU_GetMyLastActionInCurrentTab (void)
ActCod = Str_ConvertStrCodToLongCod (row[0]); ActCod = Str_ConvertStrCodToLongCod (row[0]);
if (ActCod >= 0 && ActCod <= Act_MAX_ACTION_COD) if (ActCod >= 0 && ActCod <= Act_MAX_ACTION_COD)
if ((Action = Act_FromActCodToAction[ActCod]) >= 0) if ((Action = Act_FromActCodToAction[ActCod]) >= 0)
{ if (Act_GetTab (Act_GetSuperAction (Action)) == Gbl.Action.Tab)
SuperAction = Act_Actions[Action].SuperAction;
if (Act_Actions[SuperAction].Tab == Gbl.Action.Tab)
if (Act_CheckIfIHavePermissionToExecuteAction (Action)) if (Act_CheckIfIHavePermissionToExecuteAction (Action))
{ {
MoreRecentActionInCurrentTab = Action; MoreRecentActionInCurrentTab = Action;
break; break;
} }
}
} }
/***** Free structure that stores the query result *****/ /***** Free structure that stores the query result *****/
@ -210,14 +204,12 @@ void MFU_ShowMyMFUActions (void)
void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions) void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
extern const char *Hlp_ANALYTICS_Frequent; extern const char *Hlp_ANALYTICS_Frequent;
extern const char *The_ClassFormNoWrap[The_NUM_THEMES]; extern const char *The_ClassFormNoWrap[The_NUM_THEMES];
extern const char *Txt_My_frequent_actions; extern const char *Txt_My_frequent_actions;
extern const char *Txt_TABS_TXT[Tab_NUM_TABS]; extern const char *Txt_TABS_TXT[Tab_NUM_TABS];
unsigned NumAct; unsigned NumAct;
Act_Action_t Action; Act_Action_t Action;
Act_Action_t SuperAction;
const char *Title; const char *Title;
char TabStr[MFU_MAX_BYTES_TAB + 1]; char TabStr[MFU_MAX_BYTES_TAB + 1];
char MenuStr[MFU_MAX_BYTES_MENU + 1]; char MenuStr[MFU_MAX_BYTES_MENU + 1];
@ -239,8 +231,7 @@ void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions)
if ((Title = Act_GetTitleAction (Action)) != NULL) if ((Title = Act_GetTitleAction (Action)) != NULL)
{ {
/* Action string */ /* Action string */
SuperAction = Act_Actions[Action].SuperAction; Str_Copy (TabStr,Txt_TABS_TXT[Act_GetTab (Act_GetSuperAction (Action))],
Str_Copy (TabStr,Txt_TABS_TXT[Act_Actions[SuperAction].Tab],
MFU_MAX_BYTES_TAB); MFU_MAX_BYTES_TAB);
Str_Copy (MenuStr,Title, Str_Copy (MenuStr,Title,
MFU_MAX_BYTES_MENU); MFU_MAX_BYTES_MENU);
@ -252,7 +243,7 @@ void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions)
Act_LinkFormSubmit (TabMenuStr,The_ClassFormNoWrap[Gbl.Prefs.Theme],NULL); Act_LinkFormSubmit (TabMenuStr,The_ClassFormNoWrap[Gbl.Prefs.Theme],NULL);
fprintf (Gbl.F.Out,"<img src=\"%s/%s/%s\" alt=\"%s\" />", fprintf (Gbl.F.Out,"<img src=\"%s/%s/%s\" alt=\"%s\" />",
Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION, Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION,
Act_Actions[Action].Icon, Act_GetIcon (Action),
MenuStr); MenuStr);
fprintf (Gbl.F.Out," %s</a>",TabMenuStr); fprintf (Gbl.F.Out," %s</a>",TabMenuStr);
Act_FormEnd (); Act_FormEnd ();
@ -271,13 +262,11 @@ void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions)
void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions) void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
extern const char *Txt_My_frequent_actions; extern const char *Txt_My_frequent_actions;
extern const char *Txt_Frequent_ACTIONS; extern const char *Txt_Frequent_ACTIONS;
extern const char *Txt_TABS_TXT[Tab_NUM_TABS]; extern const char *Txt_TABS_TXT[Tab_NUM_TABS];
unsigned NumAct; unsigned NumAct;
Act_Action_t Action; Act_Action_t Action;
Act_Action_t SuperAction;
const char *Title; const char *Title;
char TabStr[MFU_MAX_BYTES_TAB + 1]; char TabStr[MFU_MAX_BYTES_TAB + 1];
char MenuStr[MFU_MAX_BYTES_MENU + 1]; char MenuStr[MFU_MAX_BYTES_MENU + 1];
@ -303,8 +292,7 @@ void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions)
if ((Title = Act_GetTitleAction (Action)) != NULL) if ((Title = Act_GetTitleAction (Action)) != NULL)
{ {
/* Action string */ /* Action string */
SuperAction = Act_Actions[Action].SuperAction; Str_Copy (TabStr,Txt_TABS_TXT[Act_GetTab (Act_GetSuperAction (Action))],
Str_Copy (TabStr,Txt_TABS_TXT[Act_Actions[SuperAction].Tab],
MFU_MAX_BYTES_TAB); MFU_MAX_BYTES_TAB);
Str_Copy (MenuStr,Title, Str_Copy (MenuStr,Title,
MFU_MAX_BYTES_MENU); MFU_MAX_BYTES_MENU);
@ -316,7 +304,7 @@ void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions)
Act_LinkFormSubmit (TabMenuStr,NULL,NULL); Act_LinkFormSubmit (TabMenuStr,NULL,NULL);
fprintf (Gbl.F.Out,"<img src=\"%s/%s/%s\" alt=\"%s\" />", fprintf (Gbl.F.Out,"<img src=\"%s/%s/%s\" alt=\"%s\" />",
Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION, Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION,
Act_Actions[Action].Icon, Act_GetIcon (Action),
MenuStr); MenuStr);
fprintf (Gbl.F.Out," %s</a>",MenuStr); fprintf (Gbl.F.Out," %s</a>",MenuStr);
Act_FormEnd (); Act_FormEnd ();
@ -340,27 +328,30 @@ void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions)
void MFU_UpdateMFUActions (void) void MFU_UpdateMFUActions (void)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
char Query[1024]; char Query[1024];
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
float Score; float Score;
long ActCod;
Act_Action_t SuperAction;
/***** In some cases, don't register action *****/ /***** In some cases, don't register action *****/
if (!Gbl.Usrs.Me.Logged) if (!Gbl.Usrs.Me.Logged)
return; return;
if (Act_Actions[Act_Actions[Gbl.Action.Act].SuperAction].IndexInMenu < 0) if (Act_GetIndexInMenu (Gbl.Action.Act) < 0)
return; return;
if (Act_Actions[Gbl.Action.Act].SuperAction == ActMFUAct) SuperAction = Act_GetSuperAction (Gbl.Action.Act);
if (SuperAction == ActMFUAct)
return; return;
ActCod = Act_GetActCod (SuperAction);
Str_SetDecimalPointToUS (); // To get the decimal point as a dot Str_SetDecimalPointToUS (); // To get the decimal point as a dot
/***** Get current score *****/ /***** Get current score *****/
sprintf (Query,"SELECT Score FROM actions_MFU" sprintf (Query,"SELECT Score FROM actions_MFU"
" WHERE UsrCod=%ld AND ActCod=%ld", " WHERE UsrCod=%ld AND ActCod=%ld",
Gbl.Usrs.Me.UsrDat.UsrCod, Gbl.Usrs.Me.UsrDat.UsrCod,ActCod);
Act_Actions[Act_Actions[Gbl.Action.Act].SuperAction].ActCod);
if (DB_QuerySELECT (Query,&mysql_res,"can not get score for current action")) if (DB_QuerySELECT (Query,&mysql_res,"can not get score for current action"))
{ {
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
@ -381,17 +372,14 @@ void MFU_UpdateMFUActions (void)
" (UsrCod,ActCod,Score,LastClick)" " (UsrCod,ActCod,Score,LastClick)"
" VALUES" " VALUES"
" (%ld,%ld,'%f',NOW())", " (%ld,%ld,'%f',NOW())",
Gbl.Usrs.Me.UsrDat.UsrCod, Gbl.Usrs.Me.UsrDat.UsrCod,ActCod,Score);
Act_Actions[Act_Actions[Gbl.Action.Act].SuperAction].ActCod,
Score);
DB_QueryREPLACE (Query,"can not update most frequently used actions"); DB_QueryREPLACE (Query,"can not update most frequently used actions");
/***** Update score for other actions *****/ /***** Update score for other actions *****/
sprintf (Query,"UPDATE actions_MFU SET Score=GREATEST(Score*'%f','%f')" sprintf (Query,"UPDATE actions_MFU SET Score=GREATEST(Score*'%f','%f')"
" WHERE UsrCod=%ld AND ActCod<>%ld", " WHERE UsrCod=%ld AND ActCod<>%ld",
MFU_DECREASE_FACTOR,MFU_MIN_SCORE, MFU_DECREASE_FACTOR,MFU_MIN_SCORE,
Gbl.Usrs.Me.UsrDat.UsrCod, Gbl.Usrs.Me.UsrDat.UsrCod,ActCod);
Act_Actions[Act_Actions[Gbl.Action.Act].SuperAction].ActCod);
DB_QueryUPDATE (Query,"can not update most frequently used actions"); DB_QueryUPDATE (Query,"can not update most frequently used actions");
Str_SetDecimalPointToLocal (); // Return to local system Str_SetDecimalPointToLocal (); // Return to local system

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General 3 License as it under the terms of the GNU Affero General 3 License as
@ -147,7 +147,6 @@ void QR_LinkTo (unsigned Size,const char *ParamStr,long Cod)
void QR_ExamAnnnouncement (void) void QR_ExamAnnnouncement (void)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
extern const char *Txt_Link_to_announcement_of_exam; extern const char *Txt_Link_to_announcement_of_exam;
/***** Show QR code with direct link to the exam announcement *****/ /***** Show QR code with direct link to the exam announcement *****/
@ -157,7 +156,7 @@ void QR_ExamAnnnouncement (void)
" style=\"width:250px; height:250px;\" />" " style=\"width:250px; height:250px;\" />"
"</div>", "</div>",
300,300, 300,300,
Cfg_URL_SWAD_CGI,Gbl.CurrentCrs.Crs.CrsCod,Act_Actions[ActSeeAllExaAnn].ActCod, Cfg_URL_SWAD_CGI,Gbl.CurrentCrs.Crs.CrsCod,Act_GetActCod (ActSeeAllExaAnn),
Txt_Link_to_announcement_of_exam, Txt_Link_to_announcement_of_exam,
Txt_Link_to_announcement_of_exam); Txt_Link_to_announcement_of_exam);
} }

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General 3 License as it under the terms of the GNU Affero General 3 License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -4940,6 +4940,48 @@ Act_Action_t Act_GetActionFromActCod (long ActCod)
return ActUnk; return ActUnk;
} }
/*****************************************************************************/
/****************** Get permanent action code from action ********************/
/*****************************************************************************/
long Act_GetActCod (Act_Action_t Action)
{
if (Action < 0 || Action >= Act_NUM_ACTIONS)
return -1L;
return Act_Actions[Action].ActCod;
}
/*****************************************************************************/
/***************** Get index in menu associated to an action ******************/
/*****************************************************************************/
signed int Act_GetIndexInMenu (Act_Action_t Action)
{
return Act_Actions[Act_GetSuperAction (Action)].IndexInMenu;
}
/*****************************************************************************/
/********************* Get tab associated to an action ***********************/
/*****************************************************************************/
Tab_Tab_t Act_GetTab (Act_Action_t Action)
{
return Act_Actions[Act_GetSuperAction (Action)].Tab;
}
/*****************************************************************************/
/***************** Get superaction associated to an action *******************/
/*****************************************************************************/
Act_Action_t Act_GetSuperAction (Act_Action_t Action)
{
if (Action < 0 || Action >= Act_NUM_ACTIONS)
return ActUnk;
return Act_Actions[Action].SuperAction;
}
/*****************************************************************************/ /*****************************************************************************/
/************* Check if I have permission to execute an action ***************/ /************* Check if I have permission to execute an action ***************/
/*****************************************************************************/ /*****************************************************************************/
@ -4968,6 +5010,66 @@ bool Act_CheckIfIHavePermissionToExecuteAction (Act_Action_t Action)
return Permission & (1 << Gbl.Usrs.Me.Role.Logged); return Permission & (1 << Gbl.Usrs.Me.Role.Logged);
} }
/*****************************************************************************/
/***************** Get content type associated to an action ******************/
/*****************************************************************************/
Act_Content_t Act_GetContentType (Act_Action_t Action)
{
if (Action < 0 || Action >= Act_NUM_ACTIONS)
return Act_CONT_NORM;
return Act_Actions[Action].ContentType;
}
/*****************************************************************************/
/****************** Get browser tab associated to an action ******************/
/*****************************************************************************/
Act_BrowserTab_t Act_GetBrowserTab (Act_Action_t Action)
{
if (Action < 0 || Action >= Act_NUM_ACTIONS)
return Act_BRW_UNK_TAB;
return Act_Actions[Action].BrowserTab;
}
/*****************************************************************************/
/********* Get pointer to function a priori associated to an action **********/
/*****************************************************************************/
void (*Act_GetFunctionPriori (Act_Action_t Action)) (void)
{
if (Action < 0 || Action >= Act_NUM_ACTIONS)
return NULL;
return Act_Actions[Action].FunctionPriori;
}
/*****************************************************************************/
/******* Get pointer to function a posteriori associated to an action ********/
/*****************************************************************************/
void (*Act_GetFunctionPosteriori (Act_Action_t Action)) (void)
{
if (Action < 0 || Action >= Act_NUM_ACTIONS)
return NULL;
return Act_Actions[Action].FunctionPosteriori;
}
/*****************************************************************************/
/********************** Get icon associated to an action *********************/
/*****************************************************************************/
const char *Act_GetIcon (Act_Action_t Action)
{
if (Action < 0 || Action >= Act_NUM_ACTIONS)
return NULL;
return Act_Actions[Action].Icon;
}
/*****************************************************************************/ /*****************************************************************************/
/******************* Get the title associated to an action *******************/ /******************* Get the title associated to an action *******************/
/*****************************************************************************/ /*****************************************************************************/
@ -4975,13 +5077,11 @@ bool Act_CheckIfIHavePermissionToExecuteAction (Act_Action_t Action)
const char *Act_GetTitleAction (Act_Action_t Action) const char *Act_GetTitleAction (Act_Action_t Action)
{ {
extern const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB]; extern const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB];
Act_Action_t SuperAction;
if (Action < 0 || Action >= Act_NUM_ACTIONS) if (Action < 0 || Action >= Act_NUM_ACTIONS)
return NULL; return NULL;
SuperAction = Act_Actions[Action].SuperAction; return Txt_MENU_TITLE[Act_GetTab (Action)][Act_GetIndexInMenu (Action)];
return Txt_MENU_TITLE[Act_Actions[SuperAction].Tab][Act_Actions[SuperAction].IndexInMenu];
} }
/*****************************************************************************/ /*****************************************************************************/
@ -4991,13 +5091,11 @@ const char *Act_GetTitleAction (Act_Action_t Action)
const char *Act_GetSubtitleAction (Act_Action_t Action) const char *Act_GetSubtitleAction (Act_Action_t Action)
{ {
extern const char *Txt_MENU_SUBTITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB]; extern const char *Txt_MENU_SUBTITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB];
Act_Action_t SuperAction;
if (Action < 0 || Action >= Act_NUM_ACTIONS) if (Action < 0 || Action >= Act_NUM_ACTIONS)
return NULL; return NULL;
SuperAction = Act_Actions[Action].SuperAction; return Txt_MENU_SUBTITLE[Act_GetTab (Action)][Act_GetIndexInMenu (Action)];
return Txt_MENU_SUBTITLE[Act_Actions[SuperAction].Tab][Act_Actions[SuperAction].IndexInMenu];
} }
/*****************************************************************************/ /*****************************************************************************/
@ -5104,7 +5202,7 @@ static void Act_FormStartInternal (Act_Action_t NextAction,bool PutParameterLoca
if (OnSubmit) if (OnSubmit)
if (OnSubmit[0]) if (OnSubmit[0])
fprintf (Gbl.F.Out," onsubmit=\"%s;\"",OnSubmit); fprintf (Gbl.F.Out," onsubmit=\"%s;\"",OnSubmit);
switch (Act_Actions[NextAction].BrowserTab) switch (Act_GetBrowserTab (NextAction))
{ {
case Act_BRW_NEW_TAB: case Act_BRW_NEW_TAB:
case Act_DOWNLD_FILE: case Act_DOWNLD_FILE:
@ -5113,7 +5211,7 @@ static void Act_FormStartInternal (Act_Action_t NextAction,bool PutParameterLoca
default: default:
break; break;
} }
if (Act_Actions[NextAction].ContentType == Act_CONT_DATA) if (Act_GetContentType (NextAction) == Act_CONT_DATA)
fprintf (Gbl.F.Out," enctype=\"multipart/form-data\""); fprintf (Gbl.F.Out," enctype=\"multipart/form-data\"");
fprintf (Gbl.F.Out," accept-charset=\"windows-1252\">"); fprintf (Gbl.F.Out," accept-charset=\"windows-1252\">");
@ -5140,7 +5238,7 @@ void Act_SetParamsForm (char *ParamsStr,Act_Action_t NextAction,
if (NextAction != ActUnk) if (NextAction != ActUnk)
sprintf (ParamAction,"<input type=\"hidden\" name=\"act\"" sprintf (ParamAction,"<input type=\"hidden\" name=\"act\""
" value=\"%ld\" />", " value=\"%ld\" />",
Act_Actions[NextAction].ActCod); Act_GetActCod (NextAction));
if (Gbl.Session.Id[0]) if (Gbl.Session.Id[0])
sprintf (ParamSession,"<input type=\"hidden\" name=\"ses\"" sprintf (ParamSession,"<input type=\"hidden\" name=\"ses\""
@ -5302,7 +5400,7 @@ void Act_AdjustCurrentAction (void)
bool IAmATeacher; bool IAmATeacher;
/***** Don't adjust anything when current action is not a menu option *****/ /***** Don't adjust anything when current action is not a menu option *****/
if (Gbl.Action.Act != Act_Actions[Gbl.Action.Act].SuperAction) // It is not a menu option if (Gbl.Action.Act != Act_GetSuperAction (Gbl.Action.Act)) // It is not a menu option
return; return;
/***** Don't adjust anything when refreshing users or on a web service *****/ /***** Don't adjust anything when refreshing users or on a web service *****/

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -49,6 +49,7 @@ typedef enum
typedef enum typedef enum
{ {
Act_BRW_UNK_TAB, // Unknown tab
Act_BRW_1ST_TAB, // The main (original, first) tab in the browser Act_BRW_1ST_TAB, // The main (original, first) tab in the browser
Act_BRW_NEW_TAB, // A new (second) blank tab in the browser Act_BRW_NEW_TAB, // A new (second) blank tab in the browser
Act_BRW_2ND_TAB, // The second tab in the browser Act_BRW_2ND_TAB, // The second tab in the browser
@ -1635,8 +1636,8 @@ struct Act_Actions
unsigned PermissionSys; unsigned PermissionSys;
Act_Content_t ContentType; Act_Content_t ContentType;
Act_BrowserTab_t BrowserTab; Act_BrowserTab_t BrowserTab;
void (*FunctionPriori)(); void (*FunctionPriori) ();
void (*FunctionPosteriori)(); void (*FunctionPosteriori) ();
const char *Icon; const char *Icon;
}; };
@ -1645,8 +1646,17 @@ struct Act_Actions
/*****************************************************************************/ /*****************************************************************************/
Act_Action_t Act_GetActionFromActCod (long ActCod); Act_Action_t Act_GetActionFromActCod (long ActCod);
long Act_GetActCod (Act_Action_t Action);
signed int Act_GetIndexInMenu (Act_Action_t Action);
Tab_Tab_t Act_GetTab (Act_Action_t Action);
Act_Action_t Act_GetSuperAction (Act_Action_t Action);
bool Act_CheckIfIHavePermissionToExecuteAction (Act_Action_t Action); bool Act_CheckIfIHavePermissionToExecuteAction (Act_Action_t Action);
Act_Content_t Act_GetContentType (Act_Action_t Action);
Act_BrowserTab_t Act_GetBrowserTab (Act_Action_t Action);
void (*Act_GetFunctionPriori (Act_Action_t Action)) (void);
void (*Act_GetFunctionPosteriori (Act_Action_t Action)) (void);
const char *Act_GetIcon (Act_Action_t Action);
const char *Act_GetTitleAction (Act_Action_t Action); const char *Act_GetTitleAction (Act_Action_t Action);
const char *Act_GetSubtitleAction (Act_Action_t Action); const char *Act_GetSubtitleAction (Act_Action_t Action);
char *Act_GetActionTextFromDB (long ActCod, char *Act_GetActionTextFromDB (long ActCod,

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General 3 License as it under the terms of the GNU Affero General 3 License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General 3 License as it under the terms of the GNU Affero General 3 License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -284,6 +284,9 @@ Esto no est
----- Mensaje original ----- ----- Mensaje original -----
Hola Antonio, ya hemos terminado un curso y me piden un control de la asistencia por parte de cada alumno en horas y minutos. ¿Sabes si los puedo visualizar todos sin tener que ir entrando uno por uno? Hola Antonio, ya hemos terminado un curso y me piden un control de la asistencia por parte de cada alumno en horas y minutos. ¿Sabes si los puedo visualizar todos sin tener que ir entrando uno por uno?
Gracias Gracias
---
Una pregunta: hay un calendario que me vendría muy bien poder colorear o remarcar las fechas que dura cada asignatura, ya que son módulos que se van autoevaluando a lo largo del curso, ¿es posible? porque he visto que el calendario no es editable,
*/ */
// TODO: Check actions table. All actions must be present in table. // TODO: Check actions table. All actions must be present in table.
@ -293,6 +296,33 @@ Gracias
// TODO: Urgente: Un profesor no puede eliminar archivos de estudiantes de la zona de actividades, ni subir nuevos, mientras está abierta la actividad, pero sí cuando está cerrada. ¿Qué sentido tiene? // TODO: Urgente: Un profesor no puede eliminar archivos de estudiantes de la zona de actividades, ni subir nuevos, mientras está abierta la actividad, pero sí cuando está cerrada. ¿Qué sentido tiene?
// TODO: Suggested by Pablo Merino Ávila: statistics on test exams grouped by tags
// TODO: Suggested by Jesús García Miranda: copiar un fichero syllabus.xml de una asignatura a otra (bajar el fichero y poder importarlo desde otra).
// ---
// TODO: Sugerencia de David Cabrera Hidalgo: en la descarga de archivos, pulsando el botón del centro del ratón equivale a "abrir en pestaña nueva". Si se usara el método GET se podrían ir abriendo enlaces en otras pestañas para visitarlos posteriormente.
/*
Pilar Ossorio Castellanos en OpenSWAD
Pues tendría que hacer cambios en el programa. Lo anoto como urgente...
¡Gracias!
Antonio
----- Mensaje original -----
Hola Antonio, he ampliado el evento y nos deja comentar. El problema es que el profesor que es tutor del evento es no-editor, y no puede comentar el evento como yo, que si lo soy pero no he participado en el evento.¿cómo podríamos hacer para que ese profesor pudiera comentar, siendo el tutor, pero no siendo editor?
*/
// TODO: En el maletín cualquiera debería poder hacer un zip de una carpeta, no solo el superusuario
// TODO: Al buscar un profesor deberían salir también las asignaturas en las que es profesor no editor
// TODO: En el pefil público de un usuario deberían contabilizarse como profesor las asignaturas en las que sea profesor no editor
// TODO: Eliminar todas las preguntas de test de un golpe
// TODO: URGENTE: Cuando se cree un descriptor nuevo TIENE QUE ESTAR INHABILITADO porque si no los alumnos pueden ver el examen (Miguel Damas)
// TODO: URGENTE: No se puede eliminar ni ocultar el enlace "Preparacion terreno_ hoyos._." de la asignatura PLANTACIÓN Y SIEMBRA (código 2165) de OpenSWAD.
/*****************************************************************************/ /*****************************************************************************/
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
@ -313,6 +343,9 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf ps2pdf source.ps destination.pdf
*/ */
/* /*
Version 17.29: Apr 24, 2018 Code refactoring and bug fixing related to actions. (234579 lines)
Version 17.28: Jan 09, 2018 Added average of all test exams. (? lines)
Version 17.27.2: Dec 20, 2017 Changes displaying a game question. (234507 lines)
Version 17.27.1: Dec 20, 2017 Changes in icon to play game. (234484 lines) Version 17.27.1: Dec 20, 2017 Changes in icon to play game. (234484 lines)
Version 17.27: Dec 19, 2017 Statistics tab is renamed as Analytics. (234464 lines) Version 17.27: Dec 19, 2017 Statistics tab is renamed as Analytics. (234464 lines)
Copy the following icons to icon public directory: Copy the following icons to icon public directory:

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General 3 License as it under the terms of the GNU Affero General 3 License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cańas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -180,7 +180,6 @@ void Con_ShowLastClicks (void)
void Con_GetAndShowLastClicks (void) void Con_GetAndShowLastClicks (void)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
extern const char *Txt_Click; extern const char *Txt_Click;
extern const char *Txt_ELAPSED_TIME; extern const char *Txt_ELAPSED_TIME;
extern const char *Txt_Role; extern const char *Txt_Role;
@ -270,12 +269,12 @@ void Con_GetAndShowLastClicks (void)
ActCod = Str_ConvertStrCodToLongCod (row[1]); ActCod = Str_ConvertStrCodToLongCod (row[1]);
/* Use a special color for this row depending on the action */ /* Use a special color for this row depending on the action */
ClassRow = (Act_Actions[Act_GetActionFromActCod (ActCod)].BrowserTab == Act_DOWNLD_FILE) ? "DAT_SMALL_YELLOW LEFT_MIDDLE" : ClassRow = (Act_GetBrowserTab (Act_GetActionFromActCod (ActCod)) == Act_DOWNLD_FILE) ? "DAT_SMALL_YELLOW LEFT_MIDDLE" :
(ActCod == Act_Actions[ActLogIn ].ActCod || (ActCod == Act_GetActCod (ActLogIn ) ||
ActCod == Act_Actions[ActLogInNew].ActCod) ? "DAT_SMALL_GREEN" : ActCod == Act_GetActCod (ActLogInNew)) ? "DAT_SMALL_GREEN" :
(ActCod == Act_Actions[ActLogOut ].ActCod) ? "DAT_SMALL_RED" : (ActCod == Act_GetActCod (ActLogOut )) ? "DAT_SMALL_RED" :
(ActCod == Act_Actions[ActWebSvc ].ActCod) ? "DAT_SMALL_BLUE" : (ActCod == Act_GetActCod (ActWebSvc )) ? "DAT_SMALL_BLUE" :
"DAT_SMALL_GREY"; "DAT_SMALL_GREY";
/* Compute elapsed time from last access */ /* Compute elapsed time from last access */
if (sscanf (row[2],"%ld",&TimeDiff) != 1) if (sscanf (row[2],"%ld",&TimeDiff) != 1)

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -1216,12 +1216,11 @@ void Cty_WriteSelectorOfCountry (void)
void Cty_WriteCountryName (long CtyCod,const char *ClassLink) void Cty_WriteCountryName (long CtyCod,const char *ClassLink)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
char CtyName[Cty_MAX_BYTES_NAME + 1]; char CtyName[Cty_MAX_BYTES_NAME + 1];
char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1]; char ActTxt[Act_MAX_BYTES_ACTION_TXT + 1];
bool PutForm = ClassLink && bool PutForm = ClassLink &&
!Gbl.Form.Inside && // Only if not inside another form !Gbl.Form.Inside && // Only if not inside another form
Act_Actions[Gbl.Action.Act].BrowserTab == Act_BRW_1ST_TAB; // Only in main browser tab Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB; // Only in main browser tab
/***** Get country name *****/ /***** Get country name *****/
Cty_GetCountryName (CtyCod,CtyName); Cty_GetCountryName (CtyCod,CtyName);
@ -1231,7 +1230,7 @@ void Cty_WriteCountryName (long CtyCod,const char *ClassLink)
/***** Write country name with link to country information *****/ /***** Write country name with link to country information *****/
Act_FormStart (ActSeeCtyInf); Act_FormStart (ActSeeCtyInf);
Cty_PutParamCtyCod (CtyCod); Cty_PutParamCtyCod (CtyCod);
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeCtyInf].ActCod,ActTxt), Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_GetActCod (ActSeeCtyInf),ActTxt),
ClassLink,NULL); ClassLink,NULL);
fprintf (Gbl.F.Out,"%s</a>",CtyName); fprintf (Gbl.F.Out,"%s</a>",CtyName);
Act_FormEnd (); Act_FormEnd ();

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cańas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -510,7 +510,6 @@ static void Crs_ShowNumUsrsInCrs (Rol_Role_t Role)
static void Crs_WriteListMyCoursesToSelectOne (void) static void Crs_WriteListMyCoursesToSelectOne (void)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
extern const char *Hlp_PROFILE_Courses; extern const char *Hlp_PROFILE_Courses;
extern const char *The_ClassForm[The_NUM_THEMES]; extern const char *The_ClassForm[The_NUM_THEMES];
extern const char *The_ClassFormDark[The_NUM_THEMES]; extern const char *The_ClassFormDark[The_NUM_THEMES];
@ -596,7 +595,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Lay_IndentDependingOnLevel (1,IsLastItemInLevel); Lay_IndentDependingOnLevel (1,IsLastItemInLevel);
Act_FormStart (ActMyCrs); Act_FormStart (ActMyCrs);
Cty_PutParamCtyCod (Cty.CtyCod); Cty_PutParamCtyCod (Cty.CtyCod);
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeCtyInf].ActCod,ActTxt), Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_GetActCod (ActSeeCtyInf),ActTxt),
Highlight ? ClassHighlight : Highlight ? ClassHighlight :
ClassNormal,NULL); ClassNormal,NULL);
/* Country map */ /* Country map */
@ -637,7 +636,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Lay_IndentDependingOnLevel (2,IsLastItemInLevel); Lay_IndentDependingOnLevel (2,IsLastItemInLevel);
Act_FormStart (ActMyCrs); Act_FormStart (ActMyCrs);
Ins_PutParamInsCod (Ins.InsCod); Ins_PutParamInsCod (Ins.InsCod);
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeInsInf].ActCod,ActTxt), Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_GetActCod (ActSeeInsInf),ActTxt),
Highlight ? ClassHighlight : Highlight ? ClassHighlight :
ClassNormal,NULL); ClassNormal,NULL);
Log_DrawLogo (Sco_SCOPE_INS,Ins.InsCod,Ins.ShrtName,20,NULL,true); Log_DrawLogo (Sco_SCOPE_INS,Ins.InsCod,Ins.ShrtName,20,NULL,true);
@ -670,7 +669,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Lay_IndentDependingOnLevel (3,IsLastItemInLevel); Lay_IndentDependingOnLevel (3,IsLastItemInLevel);
Act_FormStart (ActMyCrs); Act_FormStart (ActMyCrs);
Ctr_PutParamCtrCod (Ctr.CtrCod); Ctr_PutParamCtrCod (Ctr.CtrCod);
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeCtrInf].ActCod,ActTxt), Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_GetActCod (ActSeeCtrInf),ActTxt),
Highlight ? ClassHighlight : Highlight ? ClassHighlight :
ClassNormal,NULL); ClassNormal,NULL);
Log_DrawLogo (Sco_SCOPE_CTR,Ctr.CtrCod,Ctr.ShrtName,20,NULL,true); Log_DrawLogo (Sco_SCOPE_CTR,Ctr.CtrCod,Ctr.ShrtName,20,NULL,true);
@ -703,7 +702,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
Lay_IndentDependingOnLevel (4,IsLastItemInLevel); Lay_IndentDependingOnLevel (4,IsLastItemInLevel);
Act_FormStart (ActMyCrs); Act_FormStart (ActMyCrs);
Deg_PutParamDegCod (Deg.DegCod); Deg_PutParamDegCod (Deg.DegCod);
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeDegInf].ActCod,ActTxt), Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_GetActCod (ActSeeDegInf),ActTxt),
Highlight ? ClassHighlight : Highlight ? ClassHighlight :
ClassNormal,NULL); ClassNormal,NULL);
Log_DrawLogo (Sco_SCOPE_DEG,Deg.DegCod,Deg.ShrtName,20,NULL,true); Log_DrawLogo (Sco_SCOPE_DEG,Deg.DegCod,Deg.ShrtName,20,NULL,true);

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General 3 License as it under the terms of the GNU Affero General 3 License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General 3 License as it under the terms of the GNU Affero General 3 License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -8800,7 +8800,6 @@ static void Brw_PutFormToCreateAFolder (const char FileNameToShow[NAME_MAX + 1])
static void Brw_PutFormToUploadFilesUsingDropzone (const char *FileNameToShow) static void Brw_PutFormToUploadFilesUsingDropzone (const char *FileNameToShow)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
extern const char *Txt_Upload_files; extern const char *Txt_Upload_files;
extern const char *Txt_or_you_can_upload_new_files_to_the_folder_X; extern const char *Txt_or_you_can_upload_new_files_to_the_folder_X;
extern const char *Txt_Select_one_or_more_files_from_your_computer_or_drag_and_drop_here; extern const char *Txt_Select_one_or_more_files_from_your_computer_or_drag_and_drop_here;
@ -8829,7 +8828,7 @@ static void Brw_PutFormToUploadFilesUsingDropzone (const char *FileNameToShow)
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Prefs.Language], Txt_STR_LANG_ID[Gbl.Prefs.Language],
Gbl.Prefs.IconsURL); Gbl.Prefs.IconsURL);
Par_PutHiddenParamLong ("act",Act_Actions[Brw_ActUploadFileDropzone[Gbl.FileBrowser.Type]].ActCod); Par_PutHiddenParamLong ("act",Act_GetActCod (Brw_ActUploadFileDropzone[Gbl.FileBrowser.Type]));
Par_PutHiddenParamString ("ses",Gbl.Session.Id); Par_PutHiddenParamString ("ses",Gbl.Session.Id);
Brw_PutParamsFileBrowser (Brw_ActUploadFileDropzone[Gbl.FileBrowser.Type], Brw_PutParamsFileBrowser (Brw_ActUploadFileDropzone[Gbl.FileBrowser.Type],
Gbl.FileBrowser.Priv.PathInTreeUntilFilFolLnk, Gbl.FileBrowser.Priv.PathInTreeUntilFilFolLnk,

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General 3 License as it under the terms of the GNU Affero General 3 License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -2059,7 +2059,6 @@ static void For_WriteLinkToForum (struct Forum *Forum,
unsigned Level, unsigned Level,
bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]) bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS])
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
extern const char *The_ClassForm[The_NUM_THEMES]; extern const char *The_ClassForm[The_NUM_THEMES];
extern const char *The_ClassFormBold[The_NUM_THEMES]; extern const char *The_ClassFormBold[The_NUM_THEMES];
extern const char *Txt_Copy_not_allowed; extern const char *Txt_Copy_not_allowed;
@ -2127,7 +2126,7 @@ static void For_WriteLinkToForum (struct Forum *Forum,
Forum->Location, Forum->Location,
-1L, -1L,
-1L); -1L);
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[For_ActionsSeeFor[Forum->Type]].ActCod,ActTxt), Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_GetActCod (For_ActionsSeeFor[Forum->Type]),ActTxt),
Style,NULL); Style,NULL);
For_SetForumName (Forum,ForumName,Gbl.Prefs.Language,true); For_SetForumName (Forum,ForumName,Gbl.Prefs.Language,true);
switch (Forum->Type) switch (Forum->Type)

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -3608,8 +3608,9 @@ static void Gam_PlayGameShowQuestionAndAnswers (bool ShowAnswers)
fprintf (Gbl.F.Out,"<div class=\"GAM_PLAY_NUM_QST\">%u</div>", fprintf (Gbl.F.Out,"<div class=\"GAM_PLAY_NUM_QST\">%u</div>",
QstInd + 1); QstInd + 1);
/* Write the stem (row[2]) and the image (row[3], row[4], row[5]) */
fprintf (Gbl.F.Out,"<div class=\"GAM_PLAY_QST_CONTAINER\">"); fprintf (Gbl.F.Out,"<div class=\"GAM_PLAY_QST_CONTAINER\">");
/* Write the stem (row[2]) and the image (row[3], row[4], row[5]) */
Tst_WriteQstStem (row[2],"GAM_PLAY_QST"); Tst_WriteQstStem (row[2],"GAM_PLAY_QST");
Img_GetImageNameTitleAndURLFromRow (row[3],row[4],row[5],&Gbl.Test.Image); Img_GetImageNameTitleAndURLFromRow (row[3],row[4],row[5],&Gbl.Test.Image);
Img_ShowImage (&Gbl.Test.Image, Img_ShowImage (&Gbl.Test.Image,
@ -3630,12 +3631,13 @@ static void Gam_PlayGameShowQuestionAndAnswers (bool ShowAnswers)
Tst_WriteAnswersGameResult (&Game,QstInd,QstCod, Tst_WriteAnswersGameResult (&Game,QstInd,QstCod,
"GAM_PLAY_QST",false); // Don't show result "GAM_PLAY_QST",false); // Don't show result
} }
fprintf (Gbl.F.Out,"</div>"); else
fprintf (Gbl.F.Out,"&nbsp;");
/* End container for number and question */
fprintf (Gbl.F.Out,"</div>"); fprintf (Gbl.F.Out,"</div>");
/***** Put button to continue *****/ /***** Put button to continue *****/
fprintf (Gbl.F.Out,"<div class=\"GAM_PLAY_NXT_CONTAINER\">");
if (ShowAnswers) if (ShowAnswers)
{ {
/* Get index of the next question */ /* Get index of the next question */
@ -3647,6 +3649,10 @@ static void Gam_PlayGameShowQuestionAndAnswers (bool ShowAnswers)
else else
/* Put button to show answers */ /* Put button to show answers */
Gam_PutBigButtonToContinue (ActPlyGamAns,Game.GamCod,QstInd); Gam_PutBigButtonToContinue (ActPlyGamAns,Game.GamCod,QstInd);
fprintf (Gbl.F.Out,"</div>");
/***** End container for question *****/
fprintf (Gbl.F.Out,"</div>");
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -483,12 +483,11 @@ void Gbl_InitializeGlobals (void)
void Gbl_Cleanup (void) void Gbl_Cleanup (void)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
Rol_Role_t Role; Rol_Role_t Role;
if (!Gbl.Action.UsesAJAX && if (!Gbl.Action.UsesAJAX &&
!Gbl.WebService.IsWebService && !Gbl.WebService.IsWebService &&
Act_Actions[Gbl.Action.Act].BrowserTab == Act_BRW_1ST_TAB) Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB)
Ses_RemoveHiddenParFromThisSession (); Ses_RemoveHiddenParFromThisSession ();
Usr_FreeMyCourses (); Usr_FreeMyCourses ();
Usr_FreeMyDegrees (); Usr_FreeMyDegrees ();

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General 3 License as it under the terms of the GNU Affero General 3 License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General 3 License as it under the terms of the GNU Affero General 3 License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General 3 License as it under the terms of the GNU Affero General 3 License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cańas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -682,7 +682,6 @@ static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1
static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t IndicatorsLayout, static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t IndicatorsLayout,
unsigned NumCrss,MYSQL_RES *mysql_res) unsigned NumCrss,MYSQL_RES *mysql_res)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
extern const char *Txt_Degree; extern const char *Txt_Degree;
extern const char *Txt_Course; extern const char *Txt_Course;
extern const char *Txt_Institutional_BR_code; extern const char *Txt_Institutional_BR_code;
@ -715,6 +714,7 @@ static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t Indicat
unsigned NumStds; unsigned NumStds;
unsigned NumIndicators; unsigned NumIndicators;
struct Ind_IndicatorsCrs Indicators; struct Ind_IndicatorsCrs Indicators;
long ActCod;
/***** Start table *****/ /***** Start table *****/
fprintf (Gbl.F.Out,"<table class=\"INDICATORS\">"); fprintf (Gbl.F.Out,"<table class=\"INDICATORS\">");
@ -1003,6 +1003,8 @@ static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t Indicat
/* The number of indicators may have changed */ /* The number of indicators may have changed */
if (Gbl.Stat.IndicatorsSelected[Indicators.NumIndicators]) if (Gbl.Stat.IndicatorsSelected[Indicators.NumIndicators])
{ {
ActCod = Act_GetActCod (ActReqStaCrs);
/* Write a row for this course */ /* Write a row for this course */
switch (IndicatorsLayout) switch (IndicatorsLayout)
{ {
@ -1077,8 +1079,8 @@ static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t Indicat
"DAT_SMALL_RED"), "DAT_SMALL_RED"),
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
row[3], row[3],
Gbl.RowEvenOdd,Cfg_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, Gbl.RowEvenOdd,Cfg_URL_SWAD_CGI,CrsCod,ActCod,
Cfg_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, Cfg_URL_SWAD_CGI,CrsCod,ActCod,
Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : Indicators.CourseAllOK ? "DAT_SMALL_GREEN" :
(Indicators.CoursePartiallyOK ? "DAT_SMALL" : (Indicators.CoursePartiallyOK ? "DAT_SMALL" :
@ -1243,8 +1245,8 @@ static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t Indicat
"DAT_SMALL_RED"), "DAT_SMALL_RED"),
Gbl.RowEvenOdd, Gbl.RowEvenOdd,
row[3], row[3],
Gbl.RowEvenOdd,Cfg_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, Gbl.RowEvenOdd,Cfg_URL_SWAD_CGI,CrsCod,ActCod,
Cfg_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, Cfg_URL_SWAD_CGI,CrsCod,ActCod,
NumTchs != 0 ? "DAT_SMALL_GREEN" : NumTchs != 0 ? "DAT_SMALL_GREEN" :
"DAT_SMALL_RED", "DAT_SMALL_RED",

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -107,7 +107,6 @@ static void Lay_HelpTextEditor (const char *Text,const char *InlineMath,const ch
void Lay_WriteStartOfPage (void) void Lay_WriteStartOfPage (void)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES];
extern const unsigned Txt_Current_CGI_SWAD_Language; extern const unsigned Txt_Current_CGI_SWAD_Language;
extern const char *The_TabOnBgColors[The_NUM_THEMES]; extern const char *The_TabOnBgColors[The_NUM_THEMES];
@ -252,7 +251,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.Action.Act].BrowserTab == Act_BRW_1ST_TAB) if (Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB)
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\""
@ -337,7 +336,7 @@ 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.Action.Act].SuperAction].IndexInMenu >= 0) Act_GetIndexInMenu (Gbl.Action.Act) >= 0)
Lay_WriteTitleAction (); Lay_WriteTitleAction ();
Gbl.Layout.WritingHTMLStart = false; Gbl.Layout.WritingHTMLStart = false;
@ -389,8 +388,6 @@ void Lay_WriteHTTPStatus204NoContent (void)
static void Lay_WriteEndOfPage (void) static void Lay_WriteEndOfPage (void)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
if (!Gbl.Layout.DivsEndWritten) if (!Gbl.Layout.DivsEndWritten)
{ {
/***** End of central part of main zone *****/ /***** End of central part of main zone *****/
@ -399,7 +396,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.Action.Act].BrowserTab == Act_BRW_1ST_TAB) if (Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB)
Lay_WriteFootFromHTMLFile (); Lay_WriteFootFromHTMLFile ();
/***** End of main zone and page *****/ /***** End of main zone and page *****/
@ -443,27 +440,25 @@ static void Lay_WritePageTitle (void)
static void Lay_WriteRedirToMyLangOnLogIn (void) static void Lay_WriteRedirToMyLangOnLogIn (void)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES];
fprintf (Gbl.F.Out,"<meta http-equiv=\"refresh\"" fprintf (Gbl.F.Out,"<meta http-equiv=\"refresh\""
" content=\"0; url='%s/%s?act=%ld&amp;ses=%s'\">", " content=\"0; url='%s/%s?act=%ld&amp;ses=%s'\">",
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Usrs.Me.UsrDat.Prefs.Language], Txt_STR_LANG_ID[Gbl.Usrs.Me.UsrDat.Prefs.Language],
Act_Actions[ActLogInLan].ActCod, Act_GetActCod (ActLogInLan),
Gbl.Session.Id); Gbl.Session.Id);
} }
static void Lay_WriteRedirToMyLangOnViewUsrAgd (void) static void Lay_WriteRedirToMyLangOnViewUsrAgd (void)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES];
fprintf (Gbl.F.Out,"<meta http-equiv=\"refresh\"" fprintf (Gbl.F.Out,"<meta http-equiv=\"refresh\""
" content=\"0; url='%s/%s?act=%ld&amp;ses=%s&amp;agd=@%s'\">", " content=\"0; url='%s/%s?act=%ld&amp;ses=%s&amp;agd=@%s'\">",
Cfg_URL_SWAD_CGI, Cfg_URL_SWAD_CGI,
Txt_STR_LANG_ID[Gbl.Usrs.Me.UsrDat.Prefs.Language], Txt_STR_LANG_ID[Gbl.Usrs.Me.UsrDat.Prefs.Language],
Act_Actions[ActLogInUsrAgdLan].ActCod, Act_GetActCod (ActLogInUsrAgdLan),
Gbl.Session.Id, Gbl.Session.Id,
Gbl.Usrs.Other.UsrDat.Nickname); Gbl.Usrs.Other.UsrDat.Nickname);
} }
@ -474,7 +469,6 @@ static void Lay_WriteRedirToMyLangOnViewUsrAgd (void)
static void Lay_WriteScripts (void) static void Lay_WriteScripts (void)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
extern const char *Txt_DAYS_CAPS[7]; extern const char *Txt_DAYS_CAPS[7];
extern const char *Txt_DAYS_SMALL[7]; extern const char *Txt_DAYS_SMALL[7];
extern const char *Txt_Exam_of_X; extern const char *Txt_Exam_of_X;
@ -724,18 +718,16 @@ static void Lay_WriteScriptInit (void)
static void Lay_WriteScriptParamsAJAX (void) static void Lay_WriteScriptParamsAJAX (void)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
/***** Start script *****/ /***** Start script *****/
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n"); fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n");
/***** 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_GetActCod (ActRefCon));
/***** 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_GetActCod (ActRefLstClk));
/***** Parameters related with expanding/contracting folders in file browsers *****/ /***** Parameters related with expanding/contracting folders in file browsers *****/
if (Gbl.FileBrowser.Type != Brw_UNKNOWN) if (Gbl.FileBrowser.Type != Brw_UNKNOWN)
@ -743,8 +735,8 @@ static void Lay_WriteScriptParamsAJAX (void)
put parameters used by AJAX */ put parameters used by AJAX */
fprintf (Gbl.F.Out,"var RefreshParamExpand = \"act=%ld\";\n" fprintf (Gbl.F.Out,"var RefreshParamExpand = \"act=%ld\";\n"
"var RefreshParamContract = \"act=%ld\";\n", "var RefreshParamContract = \"act=%ld\";\n",
Act_Actions[Brw_GetActionExpand () ].ActCod, Act_GetActCod (Brw_GetActionExpand () ),
Act_Actions[Brw_GetActionContract ()].ActCod); Act_GetActCod (Brw_GetActionContract ()));
/***** Parameters related with social timeline refreshing *****/ /***** Parameters related with social timeline refreshing *****/
switch (Gbl.Action.Act) switch (Gbl.Action.Act)
@ -768,8 +760,8 @@ static void Lay_WriteScriptParamsAJAX (void)
"var RefreshParamNxtActOldPub = \"act=%ld\";\n" "var RefreshParamNxtActOldPub = \"act=%ld\";\n"
"var RefreshParamUsr = \"\";\n" // No user specified "var RefreshParamUsr = \"\";\n" // No user specified
"var RefreshParamWhichUsrs = \"WhichUsrs=%u\";\n", "var RefreshParamWhichUsrs = \"WhichUsrs=%u\";\n",
Act_Actions[ActRefNewSocPubGbl].ActCod, Act_GetActCod (ActRefNewSocPubGbl),
Act_Actions[ActRefOldSocPubGbl].ActCod, Act_GetActCod (ActRefOldSocPubGbl),
(unsigned) Gbl.Social.WhichUsrs); (unsigned) Gbl.Social.WhichUsrs);
break; break;
case ActSeeOthPubPrf: case ActSeeOthPubPrf:
@ -794,7 +786,7 @@ static void Lay_WriteScriptParamsAJAX (void)
Gbl.Usrs.Other.UsrDat.Nickname); Gbl.Usrs.Other.UsrDat.Nickname);
fprintf (Gbl.F.Out,"var RefreshParamNxtActOldPub = \"act=%ld\";\n" fprintf (Gbl.F.Out,"var RefreshParamNxtActOldPub = \"act=%ld\";\n"
"var RefreshParamUsr = \"OtherUsrCod=%s\";\n", "var RefreshParamUsr = \"OtherUsrCod=%s\";\n",
Act_Actions[ActRefOldSocPubUsr].ActCod, Act_GetActCod (ActRefOldSocPubUsr),
Gbl.Usrs.Other.UsrDat.EncryptedUsrCod); Gbl.Usrs.Other.UsrDat.EncryptedUsrCod);
break; break;
default: default:
@ -975,22 +967,20 @@ static void Lay_WriteBreadcrumb (void)
static void Lay_WriteTitleAction (void) static void Lay_WriteTitleAction (void)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
extern const char *The_ClassTitleAction[The_NUM_THEMES]; extern const char *The_ClassTitleAction[The_NUM_THEMES];
extern const char *The_ClassSubtitleAction[The_NUM_THEMES]; extern const char *The_ClassSubtitleAction[The_NUM_THEMES];
extern const char *Txt_TABS_TXT[Tab_NUM_TABS]; extern const char *Txt_TABS_TXT[Tab_NUM_TABS];
Act_Action_t SuperAction = Act_Actions[Gbl.Action.Act].SuperAction;
/***** Container start *****/ /***** Container start *****/
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[SuperAction].Icon); Act_GetIcon (Act_GetSuperAction (Gbl.Action.Act)));
/***** 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_TXT[Act_Actions[SuperAction].Tab], Txt_TABS_TXT[Act_GetTab (Gbl.Action.Act)],
Act_GetTitleAction (Gbl.Action.Act)); Act_GetTitleAction (Gbl.Action.Act));
/***** Subtitle *****/ /***** Subtitle *****/
@ -1209,8 +1199,6 @@ void Lay_EndSection (void)
void Lay_ShowErrorAndExit (const char *Txt) void Lay_ShowErrorAndExit (const char *Txt)
{ {
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
/***** Unlock tables if locked *****/ /***** Unlock tables if locked *****/
if (Gbl.DB.LockedTables) if (Gbl.DB.LockedTables)
{ {
@ -1267,7 +1255,7 @@ void Lay_ShowErrorAndExit (const char *Txt)
if (!Gbl.Layout.HTMLEndWritten) if (!Gbl.Layout.HTMLEndWritten)
{ {
// Here Gbl.F.Out is stdout // Here Gbl.F.Out is stdout
if (Act_Actions[Gbl.Action.Act].BrowserTab == Act_BRW_1ST_TAB) if (Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB)
Lay_WriteAboutZone (); Lay_WriteAboutZone ();
fprintf (Gbl.F.Out,"</body>\n" fprintf (Gbl.F.Out,"</body>\n"

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -6,7 +6,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

View File

@ -8,7 +8,7 @@
and used to support university teaching. and used to support university teaching.
This file is part of SWAD core. This file is part of SWAD core.
Copyright (C) 1999-2017 Antonio Cañas Vargas Copyright (C) 1999-2018 Antonio Cañas Vargas
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as

Some files were not shown because too many files have changed in this diff Show More