From 06f41515fdc1fd8832a8464e110adbb79a7aebe4 Mon Sep 17 00:00:00 2001 From: acanas Date: Tue, 29 Jun 2021 11:17:34 +0200 Subject: [PATCH] Version 20.94.9: Jun 29, 2021 Query moved from module swad_menu to module swad_setting. --- swad_changelog.h | 5 +- swad_menu.c | 126 ++++++++++++++++++++++++----------------------- swad_setting.c | 14 ++++++ swad_setting.h | 1 + 4 files changed, 83 insertions(+), 63 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 39325649..207a50ce 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -602,14 +602,15 @@ TODO: FIX BUG, URGENT! En las fechas como par TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo. */ -#define Log_PLATFORM_VERSION "SWAD 20.94.8 (2021-06-28)" +#define Log_PLATFORM_VERSION "SWAD 20.94.9 (2021-06-28)" #define CSS_FILE "swad20.45.css" #define JS_FILE "swad20.69.1.js" /* TODO: Rename CENTRE to CENTER in help wiki. TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams - Version 20.94.8: Jun 29, 2021 Queries moved to module swad_group_database. (? lines) + Version 20.94.9: Jun 29, 2021 Query moved from module swad_menu to module swad_setting. (313848 lines) + Version 20.94.8: Jun 29, 2021 Queries moved to module swad_group_database. (313834 lines) Version 20.94.7: Jun 28, 2021 Queries moved to module swad_group_database. (313782 lines) Version 20.94.6: Jun 28, 2021 Fixed bug in removal of project. (313688 lines) Version 20.94.5: Jun 25, 2021 Queries moved to module swad_group_database. (313686 lines) diff --git a/swad_menu.c b/swad_menu.c index ed184fbd..59e02c83 100644 --- a/swad_menu.c +++ b/swad_menu.c @@ -215,54 +215,63 @@ void Mnu_WriteMenuThisTab (void) const char *Title; bool IsTheSelectedAction; - /***** Menu start *****/ + /***** Begin container *****/ HTM_Txt (""); } @@ -280,22 +289,22 @@ void Mnu_PutIconsToSelectMenu (void) Box_BoxBegin (NULL,Txt_Menu, Mnu_PutIconsMenu,NULL, Hlp_PROFILE_Settings_menu,Box_NOT_CLOSABLE); - Set_BeginSettingsHead (); - Set_BeginOneSettingSelector (); - for (Menu = (Mnu_Menu_t) 0; - Menu <= (Mnu_Menu_t) (Mnu_NUM_MENUS - 1); - Menu++) - { - HTM_DIV_Begin ("class=\"%s\"",Menu == Gbl.Prefs.Menu ? "PREF_ON" : - "PREF_OFF"); - Frm_BeginForm (ActChgMnu); - Par_PutHiddenParamUnsigned (NULL,"Menu",(unsigned) Menu); - Ico_PutSettingIconLink (Mnu_MenuIcons[Menu],Txt_MENU_NAMES[Menu]); - Frm_EndForm (); - HTM_DIV_End (); - } - Set_EndOneSettingSelector (); - Set_EndSettingsHead (); + Set_BeginSettingsHead (); + Set_BeginOneSettingSelector (); + for (Menu = (Mnu_Menu_t) 0; + Menu <= (Mnu_Menu_t) (Mnu_NUM_MENUS - 1); + Menu++) + { + HTM_DIV_Begin ("class=\"%s\"",Menu == Gbl.Prefs.Menu ? "PREF_ON" : + "PREF_OFF"); + Frm_BeginForm (ActChgMnu); + Par_PutHiddenParamUnsigned (NULL,"Menu",(unsigned) Menu); + Ico_PutSettingIconLink (Mnu_MenuIcons[Menu],Txt_MENU_NAMES[Menu]); + Frm_EndForm (); + HTM_DIV_End (); + } + Set_EndOneSettingSelector (); + Set_EndSettingsHead (); Box_BoxEnd (); } @@ -320,12 +329,7 @@ void Mnu_ChangeMenu (void) /***** Store menu in database *****/ if (Gbl.Usrs.Me.Logged) - DB_QueryUPDATE ("can not update your setting about menu", - "UPDATE usr_data" - " SET Menu=%u" - " WHERE UsrCod=%ld", - (unsigned) Gbl.Prefs.Menu, - Gbl.Usrs.Me.UsrDat.UsrCod); + Set_DB_ChangeMenu (Gbl.Prefs.Menu); /***** Set settings from current IP *****/ Set_SetSettingsFromIP (); diff --git a/swad_setting.c b/swad_setting.c index df7f89a1..b85a7f4e 100644 --- a/swad_setting.c +++ b/swad_setting.c @@ -367,6 +367,20 @@ void Set_DB_ChangeFirstDayOfWeek (unsigned FirstDayOfWeek) Gbl.Usrs.Me.UsrDat.UsrCod); } +/*****************************************************************************/ +/***************** Update my settings about first day of week ****************/ +/*****************************************************************************/ + +void Set_DB_ChangeMenu (Mnu_Menu_t Menu) + { + DB_QueryUPDATE ("can not update your setting about menu", + "UPDATE usr_data" + " SET Menu=%u" + " WHERE UsrCod=%ld", + (unsigned) Menu, + Gbl.Usrs.Me.UsrDat.UsrCod); + } + /*****************************************************************************/ /*********** Head to select one or several settings using icons **************/ /*****************************************************************************/ diff --git a/swad_setting.h b/swad_setting.h index e3220083..8cf8615d 100644 --- a/swad_setting.h +++ b/swad_setting.h @@ -52,6 +52,7 @@ unsigned Set_GetParamSideCols (void); void Set_DB_UpdateMySettingsAboutDateFormat (Dat_Format_t DateFormat); void Set_DB_ChangeFirstDayOfWeek (unsigned FirstDayOfWeek); +void Set_DB_ChangeMenu (Mnu_Menu_t Menu); void Set_BeginSettingsHead (void); void Set_EndSettingsHead (void);