Version 22.120.9: Sep 09, 2023 Code refactoring related to hidden-visible in attendance.

This commit is contained in:
acanas 2023-09-09 15:58:55 +02:00
parent 00de52d68e
commit 4323ce62ed
4 changed files with 18 additions and 24 deletions

View File

@ -108,6 +108,8 @@ static void Att_ResetEvent (struct Att_Event *Event);
static void Att_FreeListEvents (struct Att_Events *Events);
static void Att_HideUnhideEvent (HidVis_HiddenOrVisible_t HiddenOrVisible);
static void Att_PutParAttCod (void *Events);
static void Att_ShowLstGrpsToEditEvent (long AttCod);
@ -875,31 +877,20 @@ void Att_RemoveEventFromDB (long AttCod)
}
/*****************************************************************************/
/************************* Hide an attendance event **************************/
/********************* Hide/unhide an attendance event ***********************/
/*****************************************************************************/
void Att_HideEvent (void)
{
struct Att_Event Event;
/***** Get attendance event code *****/
Event.AttCod = ParCod_GetAndCheckPar (ParCod_Att);
/***** Get data of the attendance event from database *****/
Att_GetEventDataByCodAndCheckCrs (&Event);
/***** Hide attendance event *****/
Att_DB_HideOrUnhideEvent (Event.AttCod,true);
/***** Show attendance events again *****/
Att_SeeEvents ();
Att_HideUnhideEvent (HidVis_HIDDEN);
}
/*****************************************************************************/
/************************ Unhide an attendance event *************************/
/*****************************************************************************/
void Att_UnhideEvent (void)
{
Att_HideUnhideEvent (HidVis_VISIBLE);
}
static void Att_HideUnhideEvent (HidVis_HiddenOrVisible_t HiddenOrVisible)
{
struct Att_Event Event;
@ -910,7 +901,7 @@ void Att_UnhideEvent (void)
Att_GetEventDataByCodAndCheckCrs (&Event);
/***** Unhide attendance event *****/
Att_DB_HideOrUnhideEvent (Event.AttCod,false);
Att_DB_HideOrUnhideEvent (Event.AttCod,HiddenOrVisible);
/***** Show attendance events again *****/
Att_SeeEvents ();

View File

@ -297,15 +297,16 @@ void Att_DB_UpdateEvent (const struct Att_Event *Event,const char *Description)
/********************** Hide/unhide an attendance event **********************/
/*****************************************************************************/
void Att_DB_HideOrUnhideEvent (long AttCod,bool Hide)
void Att_DB_HideOrUnhideEvent (long AttCod,
HidVis_HiddenOrVisible_t HiddenOrVisible)
{
DB_QueryUPDATE ("can not hide/unhide assignment",
"UPDATE att_events"
" SET Hidden='%c'"
" WHERE AttCod=%ld"
" AND CrsCod=%ld",
Hide ? 'Y' :
'N',
HiddenOrVisible == HidVis_HIDDEN ? 'Y' :
'N',
AttCod,
Gbl.Hierarchy.Crs.CrsCod);
}

View File

@ -52,7 +52,8 @@ bool Att_DB_CheckIfSimilarEventExists (const char *Field,const char *Value,long
long Att_DB_CreateEvent (const struct Att_Event *Event,const char *Description);
void Att_DB_UpdateEvent (const struct Att_Event *Event,const char *Description);
void Att_DB_HideOrUnhideEvent (long AttCod,bool Hide);
void Att_DB_HideOrUnhideEvent (long AttCod,
HidVis_HiddenOrVisible_t HiddenOrVisible);
void Att_DB_CreateGroup (long AttCod,long GrpCod);
unsigned Att_DB_GetGrpCodsAssociatedToEvent (MYSQL_RES **mysql_res,long AttCod);

View File

@ -629,10 +629,11 @@ TODO: Emilce Barrera Mesa: Podr
TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la hora de poner la foto porque la plataforma es muy exigente respecto al fondo de la imagen.
*/
#define Log_PLATFORM_VERSION "SWAD 22.120.8 (2023-09-09)"
#define Log_PLATFORM_VERSION "SWAD 22.120.9 (2023-09-09)"
#define CSS_FILE "swad22.120.4.css"
#define JS_FILE "swad22.49.js"
/*
Version 22.120.9: Sep 09, 2023 Code refactoring related to hidden-visible in attendance. (337607 lines)
Version 22.120.8: Sep 09, 2023 Code refactoring related to hidden-visible in assignments. (337610 lines)
Version 22.120.7: Sep 09, 2023 Code refactoring related to hidden-visible in agendas. (337619 lines)
Version 22.120.6: Sep 09, 2023 Fixed bug hiding documents. Reported by Francisco José Pelayo Valle. (337628 lines)