mirror of https://github.com/acanas/swad-core.git
Version 16.30.1
This commit is contained in:
parent
0484b6b9dc
commit
8c89a1433b
14
swad_MFU.c
14
swad_MFU.c
|
@ -140,6 +140,7 @@ Act_Action_t MFU_GetMyLastActionInCurrentTab (void)
|
|||
unsigned NumAct;
|
||||
long ActCod;
|
||||
Act_Action_t Action;
|
||||
Act_Action_t SuperAction;
|
||||
Act_Action_t MoreRecentActionInCurrentTab = ActUnk;
|
||||
|
||||
if (Gbl.Usrs.Me.UsrDat.UsrCod > 0)
|
||||
|
@ -162,13 +163,16 @@ Act_Action_t MFU_GetMyLastActionInCurrentTab (void)
|
|||
ActCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||
if (ActCod >= 0 && ActCod <= Act_MAX_ACTION_COD)
|
||||
if ((Action = Act_FromActCodToAction[ActCod]) >= 0)
|
||||
if (Act_Actions[Action].Tab == Gbl.Action.Tab)
|
||||
{
|
||||
SuperAction = Act_Actions[Action].SuperAction;
|
||||
if (Act_Actions[SuperAction].Tab == Gbl.Action.Tab)
|
||||
if (Act_CheckIfIHavePermissionToExecuteAction (Action))
|
||||
{
|
||||
MoreRecentActionInCurrentTab = Action;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***** Free structure that stores the query result *****/
|
||||
DB_FreeMySQLResult (&mysql_res);
|
||||
|
@ -205,6 +209,7 @@ void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions)
|
|||
extern const char *Txt_TABS_FULL_TXT[Tab_NUM_TABS];
|
||||
unsigned NumAct;
|
||||
Act_Action_t Action;
|
||||
Act_Action_t SuperAction;
|
||||
const char *Title;
|
||||
char TabStr[128+1];
|
||||
char MenuStr[128+1];
|
||||
|
@ -225,7 +230,8 @@ void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions)
|
|||
if ((Title = Act_GetTitleAction (Action)) != NULL)
|
||||
{
|
||||
/* Action string */
|
||||
strncpy (TabStr,Txt_TABS_FULL_TXT[Act_Actions[Act_Actions[Action].SuperAction].Tab],128);
|
||||
SuperAction = Act_Actions[Action].SuperAction;
|
||||
strncpy (TabStr,Txt_TABS_FULL_TXT[Act_Actions[SuperAction].Tab],128);
|
||||
TabStr[128] = '\0';
|
||||
strncpy (MenuStr,Title,128);
|
||||
MenuStr[128] = '\0';
|
||||
|
@ -262,6 +268,7 @@ void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions)
|
|||
extern const char *Txt_TABS_FULL_TXT[Tab_NUM_TABS];
|
||||
unsigned NumAct;
|
||||
Act_Action_t Action;
|
||||
Act_Action_t SuperAction;
|
||||
const char *Title;
|
||||
char TabStr[128+1];
|
||||
char MenuStr[128+1];
|
||||
|
@ -287,7 +294,8 @@ void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions)
|
|||
if ((Title = Act_GetTitleAction (Action)) != NULL)
|
||||
{
|
||||
/* Action string */
|
||||
strncpy (TabStr,Txt_TABS_FULL_TXT[Act_Actions[Act_Actions[Action].SuperAction].Tab],128);
|
||||
SuperAction = Act_Actions[Action].SuperAction;
|
||||
strncpy (TabStr,Txt_TABS_FULL_TXT[Act_Actions[SuperAction].Tab],128);
|
||||
TabStr[128] = '\0';
|
||||
strncpy (MenuStr,Title,128);
|
||||
MenuStr[128] = '\0';
|
||||
|
|
|
@ -4472,10 +4472,12 @@ bool Act_CheckIfIHavePermissionToExecuteAction (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];
|
||||
Act_Action_t SuperAction = Act_Actions[Action].SuperAction;
|
||||
Act_Action_t SuperAction;
|
||||
|
||||
if (Action < 0 || Action >= Act_NUM_ACTIONS)
|
||||
return NULL;
|
||||
|
||||
SuperAction = Act_Actions[Action].SuperAction;
|
||||
return Txt_MENU_TITLE[Act_Actions[SuperAction].Tab][Act_Actions[SuperAction].IndexInMenu];
|
||||
}
|
||||
|
||||
|
@ -4486,10 +4488,13 @@ const char *Act_GetTitleAction (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];
|
||||
Act_Action_t SuperAction;
|
||||
|
||||
if (Action < 0 || Action >= Act_NUM_ACTIONS)
|
||||
return NULL;
|
||||
return Txt_MENU_SUBTITLE[Act_Actions[Act_Actions[Action].SuperAction].Tab][Act_Actions[Act_Actions[Action].SuperAction].IndexInMenu];
|
||||
|
||||
SuperAction = Act_Actions[Action].SuperAction;
|
||||
return Txt_MENU_SUBTITLE[Act_Actions[SuperAction].Tab][Act_Actions[SuperAction].IndexInMenu];
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -150,14 +150,15 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.30 (2016-10-20)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.30.1 (2016-10-20)"
|
||||
#define CSS_FILE "swad16.25.css"
|
||||
#define JS_FILE "swad15.238.1.js"
|
||||
|
||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
||||
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
|
||||
/*
|
||||
Version 16.30: Oct 20, 2016 Removed country in edition of institutions. (? lines)
|
||||
Version 16.30.1: Oct 20, 2016 Code refactoring related to tabs. (205077 lines)
|
||||
Version 16.30: Oct 20, 2016 Removed country in edition of institutions. (205058 lines)
|
||||
1 change necessary in database:
|
||||
UPDATE actions SET Obsolete='Y' WHERE ActCod='865';
|
||||
|
||||
|
|
|
@ -763,6 +763,7 @@ static void Rep_WriteSectionHitsPerAction (struct Rep_Report *Report)
|
|||
unsigned long NumRow;
|
||||
long ActCod;
|
||||
Act_Action_t Action;
|
||||
Act_Action_t SuperAction;
|
||||
Tab_Tab_t Tab;
|
||||
char ActTxt[Act_MAX_LENGTH_ACTION_TXT+1];
|
||||
unsigned long NumClicks;
|
||||
|
@ -809,7 +810,8 @@ static void Rep_WriteSectionHitsPerAction (struct Rep_Report *Report)
|
|||
Action = Act_FromActCodToAction[ActCod];
|
||||
if (Action >= 0)
|
||||
{
|
||||
Tab = Act_Actions[Act_Actions[Action].SuperAction].Tab;
|
||||
SuperAction = Act_Actions[Action].SuperAction;
|
||||
Tab = Act_Actions[SuperAction].Tab;
|
||||
if (Txt_TABS_FULL_TXT[Tab])
|
||||
fprintf (Gbl.F.Rep,"%s > ",Txt_TABS_FULL_TXT[Tab]);
|
||||
}
|
||||
|
|
|
@ -727,7 +727,9 @@ static void Sta_WriteSelectorAction (void)
|
|||
extern const char *The_ClassForm[The_NUM_THEMES];
|
||||
extern const char *Txt_Action;
|
||||
extern const char *Txt_TABS_SHORT_TXT[Tab_NUM_TABS];
|
||||
Act_Action_t NumAction;
|
||||
Act_Action_t Action;
|
||||
Act_Action_t SuperAction;
|
||||
Tab_Tab_t Tab;
|
||||
char ActTxt[Act_MAX_LENGTH_ACTION_TXT+1];
|
||||
|
||||
fprintf (Gbl.F.Out,"<tr>"
|
||||
|
@ -738,21 +740,22 @@ static void Sta_WriteSelectorAction (void)
|
|||
"<select name=\"StatAct\" id=\"StatAct\""
|
||||
" style=\"width:375px;\">",
|
||||
The_ClassForm[Gbl.Prefs.Theme],Txt_Action);
|
||||
for (NumAction = (Act_Action_t) 0;
|
||||
NumAction < Act_NUM_ACTIONS;
|
||||
NumAction++)
|
||||
for (Action = (Act_Action_t) 0;
|
||||
Action < Act_NUM_ACTIONS;
|
||||
Action++)
|
||||
{
|
||||
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) NumAction);
|
||||
if (NumAction == Gbl.Stat.NumAction)
|
||||
fprintf (Gbl.F.Out,"<option value=\"%u\"",(unsigned) Action);
|
||||
if (Action == Gbl.Stat.NumAction)
|
||||
fprintf (Gbl.F.Out," selected=\"selected\"");
|
||||
fprintf (Gbl.F.Out,">");
|
||||
if (NumAction)
|
||||
fprintf (Gbl.F.Out,"%u: ",NumAction);
|
||||
if (Txt_TABS_SHORT_TXT[Act_Actions[NumAction].Tab])
|
||||
fprintf (Gbl.F.Out,"%s > ",
|
||||
Txt_TABS_SHORT_TXT[Act_Actions[NumAction].Tab]);
|
||||
if (Action)
|
||||
fprintf (Gbl.F.Out,"%u: ",(unsigned) Action);
|
||||
SuperAction = Act_Actions[Action].SuperAction;
|
||||
Tab = Act_Actions[SuperAction].Tab;
|
||||
if (Txt_TABS_SHORT_TXT[Tab])
|
||||
fprintf (Gbl.F.Out,"%s > ",Txt_TABS_SHORT_TXT[Tab]);
|
||||
fprintf (Gbl.F.Out,"%s",
|
||||
Act_GetActionTextFromDB (Act_Actions[NumAction].ActCod,ActTxt));
|
||||
Act_GetActionTextFromDB (Act_Actions[Action].ActCod,ActTxt));
|
||||
}
|
||||
|
||||
fprintf (Gbl.F.Out,"</select>"
|
||||
|
|
11
swad_tab.c
11
swad_tab.c
|
@ -262,8 +262,7 @@ static void Tab_WriteBreadcrumbTab (void)
|
|||
Act_LinkFormSubmit (Txt_TABS_FULL_TXT[Gbl.Action.Tab],The_ClassTxtTabOn[Gbl.Prefs.Theme],NULL);
|
||||
|
||||
/***** Title and end of form *****/
|
||||
fprintf (Gbl.F.Out,"%s</a>",
|
||||
Txt_TABS_FULL_TXT[Gbl.Action.Tab]);
|
||||
fprintf (Gbl.F.Out,"%s</a>",Txt_TABS_FULL_TXT[Gbl.Action.Tab]);
|
||||
Act_FormEnd ();
|
||||
}
|
||||
|
||||
|
@ -294,8 +293,10 @@ static void Tab_WriteBreadcrumbAction (void)
|
|||
void Tab_SetCurrentTab (void)
|
||||
{
|
||||
extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
|
||||
Act_Action_t SuperAction;
|
||||
|
||||
Gbl.Action.Tab = Act_Actions[Gbl.Action.Act].Tab;
|
||||
SuperAction = Act_Actions[Gbl.Action.Act].SuperAction;
|
||||
Gbl.Action.Tab = Act_Actions[SuperAction].Tab;
|
||||
|
||||
/***** Change action and tab if country, institution, centre or degree
|
||||
are incompatible with the current tab *****/
|
||||
|
@ -341,7 +342,9 @@ void Tab_SetCurrentTab (void)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
Gbl.Action.Tab = Act_Actions[Gbl.Action.Act].Tab;
|
||||
|
||||
SuperAction = Act_Actions[Gbl.Action.Act].SuperAction;
|
||||
Gbl.Action.Tab = Act_Actions[SuperAction].Tab;
|
||||
|
||||
Tab_DisableIncompatibleTabs ();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue