mirror of https://github.com/acanas/swad-core.git
Version 23.69: Mar 14, 2024 Actions defined as enum type.
This commit is contained in:
parent
24e0aa519d
commit
e84bf1b504
|
@ -59,7 +59,7 @@ Act_Action_t Act_GetActionFromActCod (long ActCod)
|
|||
|
||||
long Act_GetActCod (Act_Action_t Action)
|
||||
{
|
||||
if (Action < 0 || Action >= ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action >= ActLst_NUM_ACTIONS)
|
||||
return -1L;
|
||||
|
||||
return ActLst_Actions[Action].ActCod;
|
||||
|
@ -89,7 +89,7 @@ Tab_Tab_t Act_GetTab (Act_Action_t Action)
|
|||
|
||||
Act_Action_t Act_GetSuperAction (Act_Action_t Action)
|
||||
{
|
||||
if (Action < 0 || Action >= ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action >= ActLst_NUM_ACTIONS)
|
||||
return ActUnk;
|
||||
|
||||
return ActLst_Actions[Action].SuperAction;
|
||||
|
@ -103,7 +103,7 @@ bool Act_CheckIfIHavePermissionToExecuteAction (Act_Action_t Action)
|
|||
{
|
||||
unsigned Permission;
|
||||
|
||||
if (Action < 0 || Action >= ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action >= ActLst_NUM_ACTIONS)
|
||||
return false;
|
||||
|
||||
switch (Gbl.Hierarchy.Level)
|
||||
|
@ -140,7 +140,7 @@ bool Act_CheckIfIHavePermissionToExecuteAction (Act_Action_t Action)
|
|||
|
||||
Act_Content_t Act_GetContentType (Act_Action_t Action)
|
||||
{
|
||||
if (Action < 0 || Action >= ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action >= ActLst_NUM_ACTIONS)
|
||||
return Act_CONT_NORM;
|
||||
|
||||
return ActLst_Actions[Action].ContentType;
|
||||
|
@ -152,7 +152,7 @@ Act_Content_t Act_GetContentType (Act_Action_t Action)
|
|||
|
||||
Act_BrowserTab_t Act_GetBrowserTab (Act_Action_t Action)
|
||||
{
|
||||
if (Action < 0 || Action >= ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action >= ActLst_NUM_ACTIONS)
|
||||
return Act_UNK_TAB;
|
||||
|
||||
return ActLst_Actions[Action].BrowserTab;
|
||||
|
@ -164,7 +164,7 @@ Act_BrowserTab_t Act_GetBrowserTab (Act_Action_t Action)
|
|||
|
||||
void (*Act_GetFunctionPriori (Act_Action_t Action)) (void)
|
||||
{
|
||||
if (Action < 0 || Action >= ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action >= ActLst_NUM_ACTIONS)
|
||||
return NULL;
|
||||
|
||||
return ActLst_Actions[Action].FunctionPriori;
|
||||
|
@ -176,7 +176,7 @@ void (*Act_GetFunctionPriori (Act_Action_t Action)) (void)
|
|||
|
||||
void (*Act_GetFunctionPosteriori (Act_Action_t Action)) (void)
|
||||
{
|
||||
if (Action < 0 || Action >= ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action >= ActLst_NUM_ACTIONS)
|
||||
return NULL;
|
||||
|
||||
return ActLst_Actions[Action].FunctionPosteriori;
|
||||
|
@ -188,7 +188,7 @@ void (*Act_GetFunctionPosteriori (Act_Action_t Action)) (void)
|
|||
|
||||
const char *Act_GetIconFromAction (Act_Action_t Action)
|
||||
{
|
||||
if (Action < 0 || Action >= ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action >= ActLst_NUM_ACTIONS)
|
||||
return NULL;
|
||||
|
||||
return Ico_GetIcon (Mnu_GetIconFromAction (Action));
|
||||
|
@ -202,7 +202,7 @@ const char *Act_GetTitleAction (Act_Action_t Action)
|
|||
{
|
||||
extern const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB];
|
||||
|
||||
if (Action < 0 || Action >= ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action >= ActLst_NUM_ACTIONS)
|
||||
return NULL;
|
||||
|
||||
return Txt_MENU_TITLE[Act_GetTab (Action)][Act_GetIndexInMenu (Action)];
|
||||
|
@ -216,7 +216,7 @@ const char *Act_GetActionText (Act_Action_t Action)
|
|||
{
|
||||
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
||||
|
||||
if (Action >= 0 && Action < ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action < ActLst_NUM_ACTIONS)
|
||||
if (Txt_Actions[Action])
|
||||
if (Txt_Actions[Action][0])
|
||||
return Txt_Actions[Action];
|
||||
|
@ -242,7 +242,7 @@ void Act_AdjustActionWhenNoUsrLogged (void)
|
|||
};
|
||||
|
||||
if (Gbl.Hierarchy.Level >= Hie_NUM_LEVELS)
|
||||
Gbl.Hierarchy.Level = ActUnk;
|
||||
Gbl.Hierarchy.Level = Hie_UNK;
|
||||
|
||||
Gbl.Action.Act = Actions[Gbl.Hierarchy.Level];
|
||||
Tab_SetCurrentTab ();
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include <stdbool.h> // For boolean type
|
||||
|
||||
#include "swad_action_list.h"
|
||||
#include "swad_constant.h"
|
||||
#include "swad_cryptography.h"
|
||||
#include "swad_language.h"
|
||||
|
@ -69,8 +70,6 @@ typedef enum
|
|||
Act_WEB_SVC, // Web service. Send output to client using SOAP.
|
||||
} Act_BrowserTab_t;
|
||||
|
||||
typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
|
||||
|
||||
struct Act_Actions
|
||||
{
|
||||
long ActCod; // Unique, time-persistent numerical code for the action
|
||||
|
|
File diff suppressed because it is too large
Load Diff
3228
swad_action_list.h
3228
swad_action_list.h
File diff suppressed because it is too large
Load Diff
|
@ -9720,7 +9720,6 @@ Act_Action_t Brw_GetActionContract (void)
|
|||
return Brw_ActContractFolder[Gbl.FileBrowser.Type];
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************* Show stats about exploration trees ********************/
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -633,10 +633,11 @@ Me sale este error, no s
|
|||
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
|
||||
*/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 23.68.1 (2024-03-14)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 23.69 (2024-03-14)"
|
||||
#define CSS_FILE "swad23.67.2.css"
|
||||
#define JS_FILE "swad23.53.6.js"
|
||||
/*
|
||||
Version 23.69: Mar 14, 2024 Actions defined as enum type. (335591 lines)
|
||||
Version 23.68.1: Mar 14, 2024 Code refactoring in menu icons. (335591 lines)
|
||||
Version 23.68: Mar 14, 2024 New order in list of actions. (335700 lines)
|
||||
Version 23.67.3: Mar 09, 2024 Changes in global hits. (335454 lines)
|
||||
|
|
|
@ -538,6 +538,9 @@ void Tmt_ShowTimeTable (struct Tmt_Timetable *Timetable,long UsrCod)
|
|||
case ActPrnRecSevTch:
|
||||
Timetable->View = Vie_PRINT;
|
||||
break;
|
||||
default:
|
||||
Err_WrongActionExit ();
|
||||
break;
|
||||
}
|
||||
|
||||
/***** If editing ==> configure and allocate timetable *****/
|
||||
|
|
Loading…
Reference in New Issue