Version 21.95.2: Apr 30, 2022 Fixed issue in most frequent actions. Reported by Pablo Millán Cubero.

This commit is contained in:
acanas 2022-04-30 22:48:30 +02:00
parent 486452782e
commit 0fa596df82
2 changed files with 39 additions and 17 deletions

View File

@ -58,6 +58,13 @@
extern struct Globals Gbl;
/*****************************************************************************/
/***************************** Private prototypes ****************************/
/*****************************************************************************/
static void MFU_PutIconAndText (Act_Action_t Action,
const char MenuStr[MFU_MAX_BYTES_MENU + 1]);
/*****************************************************************************/
/************** Allocate list of most frequently used actions ****************/
/*****************************************************************************/
@ -180,7 +187,6 @@ void MFU_ShowMyMFUActions (void)
void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions)
{
extern const char *Hlp_ANALYTICS_Frequent;
extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS];
extern const char *Txt_My_frequent_actions;
extern const char *Txt_TABS_TXT[Tab_NUM_TABS];
unsigned NumAct;
@ -189,7 +195,6 @@ void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions)
char TabStr[MFU_MAX_BYTES_TAB + 1];
char MenuStr[MFU_MAX_BYTES_MENU + 1];
char TabMenuStr[MFU_MAX_BYTES_TAB + 6 + MFU_MAX_BYTES_MENU + 1];
char URLIconSet[PATH_MAX + 1];
/***** Begin box *****/
Box_BoxBegin (NULL,Txt_My_frequent_actions,
@ -222,12 +227,7 @@ void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions)
HTM_BUTTON_Submit_Begin (TabMenuStr,
"class=\"BT_LINK FORM_IN_%s NOWRAP\"",
The_GetSuffix ());
snprintf (URLIconSet,sizeof (URLIconSet),"%s/%s",
Cfg_URL_ICON_SETS_PUBLIC,Ico_IconSetId[Gbl.Prefs.IconSet]);
HTM_IMG (URLIconSet,Act_GetIcon (Action),MenuStr,
"class=\"ICO_%s_%s\"",
Ico_GetPreffix (Ico_BLACK),The_GetSuffix ());
HTM_TxtF (" %s",TabMenuStr);
MFU_PutIconAndText (Action,MenuStr);
HTM_BUTTON_End ();
Frm_EndForm ();
HTM_LI_End ();
@ -250,7 +250,6 @@ void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions)
void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions)
{
extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS];
extern const char *Txt_My_frequent_actions;
extern const char *Txt_Frequent_ACTIONS;
extern const char *Txt_TABS_TXT[Tab_NUM_TABS];
@ -260,7 +259,6 @@ void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions)
char TabStr[MFU_MAX_BYTES_TAB + 1];
char MenuStr[MFU_MAX_BYTES_MENU + 1];
char TabMenuStr[MFU_MAX_BYTES_TAB + 6 + MFU_MAX_BYTES_MENU + 1];
char URLIconSet[PATH_MAX + 1];
/***** Begin div and link *****/
HTM_DIV_Begin ("id=\"MFU_actions\" class=\"MFU_%s\"",
@ -293,12 +291,7 @@ void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions)
HTM_LI_Begin ("class=\"ICO_HIGHLIGHT\"");
Frm_BeginForm (Action);
HTM_BUTTON_Submit_Begin (TabMenuStr,"class=\"BT_LINK\"");
snprintf (URLIconSet,sizeof (URLIconSet),"%s/%s",
Cfg_URL_ICON_SETS_PUBLIC,Ico_IconSetId[Gbl.Prefs.IconSet]);
HTM_IMG (URLIconSet,Act_GetIcon (Action),MenuStr,
"class=\"ICO_%s_%s\"",
Ico_GetPreffix (Ico_BLACK),The_GetSuffix ());
HTM_TxtF (" %s",MenuStr);
MFU_PutIconAndText (Action,MenuStr);
HTM_BUTTON_End ();
Frm_EndForm ();
HTM_LI_End ();
@ -312,6 +305,34 @@ void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions)
HTM_DIV_End ();
}
/*****************************************************************************/
/*********************** Put action icon and text ****************************/
/*****************************************************************************/
static void MFU_PutIconAndText (Act_Action_t Action,
const char MenuStr[MFU_MAX_BYTES_MENU + 1])
{
extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS];
static const Ico_Color_t Color[Ico_NUM_ICON_SETS] =
{
[Ico_ICON_SET_AWESOME] = Ico_BLACK,
[Ico_ICON_SET_NUVOLA ] = Ico_UNCHANGED,
};
char URLIconSet[PATH_MAX + 1];
snprintf (URLIconSet,sizeof (URLIconSet),"%s/%s",
Cfg_URL_ICON_SETS_PUBLIC,Ico_IconSetId[Gbl.Prefs.IconSet]);
if (Color[Gbl.Prefs.IconSet] == Ico_UNCHANGED)
HTM_IMG (URLIconSet,Act_GetIcon (Action),MenuStr,
NULL);
else
HTM_IMG (URLIconSet,Act_GetIcon (Action),MenuStr,
"class=\"ICO_%s_%s\"",
Ico_GetPreffix (Color[Gbl.Prefs.IconSet]),
The_GetSuffix ());
HTM_TxtF (" %s",MenuStr);
}
/*****************************************************************************/
/******************** Update most frequently used actions ********************/
/*****************************************************************************/

View File

@ -606,10 +606,11 @@ TODO: Fix bug: error al enviar un mensaje a dos recipientes, error on duplicate
TODO: Attach pdf files in multimedia.
*/
#define Log_PLATFORM_VERSION "SWAD 21.95.1 (2022-04-27)"
#define Log_PLATFORM_VERSION "SWAD 21.95.2 (2022-04-30)"
#define CSS_FILE "swad21.95.css"
#define JS_FILE "swad21.92.js"
/*
Version 21.95.2: Apr 30, 2022 Fixed issue in most frequent actions. Reported by Pablo Millán Cubero. (323423 lines)
Version 21.95.1: Apr 27, 2022 Fixing design of dark theme. (323406 lines)
Version 21.95: Apr 27, 2022 Fixing design of dark theme. (323404 lines)
Version 21.94.3: Apr 25, 2022 Fixing design of dark theme. (323402 lines)