diff --git a/css/swad18.33.css b/css/swad18.41.css similarity index 99% rename from css/swad18.33.css rename to css/swad18.41.css index b164af17f..364c05267 100644 --- a/css/swad18.33.css +++ b/css/swad18.41.css @@ -2701,6 +2701,21 @@ a:hover img.CENTRE_PHOTO_SHOW text-overflow:ellipsis; } +/********************************* Attendance ********************************/ +.ATT_CHECK + { + display:inline-block; + font-size:16pt; + color:darkgreen; + } +.ATT_CROSS + { + display:inline-block; + font-size:16pt; + color:darkred; + opacity:0.2; + } + /**************************** Enrolment requests *****************************/ .REQUESTER_NAME { @@ -3074,8 +3089,10 @@ a:hover img.CENTRE_PHOTO_SHOW .BT {width:20px; text-align:center; vertical-align:top;} .BT0 {width:20px; text-align:center; vertical-align:top; background-color:#F4F2EA;} .BT1 {width:20px; text-align:center; vertical-align:top; background-color:#FBFAF7;} + .BM {width:20px; text-align:center; vertical-align:middle;} .BM_SEL {width:20px; text-align:center; vertical-align:middle; background-color:#C0FF40;} + .BM0 {width:20px; text-align:center; vertical-align:middle; background-color:#F4F2EA;} .BM1 {width:20px; text-align:center; vertical-align:middle; background-color:#FBFAF7;} diff --git a/swad_attendance.c b/swad_attendance.c index f524d85ea..681dcaddb 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -148,6 +148,7 @@ static void Att_ListStdsAttendanceTable (Att_TypeOfView_t TypeOfView, long *LstSelectedUsrCods); static void Att_WriteTableHeadSeveralAttEvents (void); static void Att_WriteRowStdSeveralAttEvents (unsigned NumStd,struct UsrData *UsrDat); +static void Att_PutCheckOrCross (bool Present); static void Att_ListStdsWithAttEventsDetails (unsigned NumStdsInList, long *LstSelectedUsrCods); static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat); @@ -2044,8 +2045,6 @@ static void Att_WriteRowStdToCallTheRoll (unsigned NumStd, struct UsrData *UsrDat, struct AttendanceEvent *Att) { - extern const char *Txt_Present; - extern const char *Txt_Absent; bool Present; char PhotoURL[PATH_MAX + 1]; bool ShowPhoto; @@ -2085,26 +2084,17 @@ static void Att_WriteRowStdToCallTheRoll (unsigned NumStd, break; } - /***** Check if this student is already registered in the current event *****/ + /***** Check if this student is already present in the current event *****/ Present = Att_CheckIfUsrIsPresentInAttEventAndGetComments (Att->AttCod,UsrDat->UsrCod,CommentStd,CommentTch); - /***** Icon to show if the user is already registered *****/ + /***** Icon to show if the user is already present *****/ fprintf (Gbl.F.Out,"" "" - "" - "", - Gbl.RowEvenOdd,NumStd, - Gbl.Prefs.URLIcons, - Present ? "check-square.svg" : - "square.svg", - Present ? Txt_Present : - Txt_Absent, - Present ? Txt_Present : - Txt_Absent); + "" + ""); /***** Checkbox to select user *****/ fprintf (Gbl.F.Out,"" @@ -3431,8 +3421,6 @@ static void Att_WriteTableHeadSeveralAttEvents (void) static void Att_WriteRowStdSeveralAttEvents (unsigned NumStd,struct UsrData *UsrDat) { - extern const char *Txt_Present; - extern const char *Txt_Absent; char PhotoURL[PATH_MAX + 1]; bool ShowPhoto; unsigned NumAttEvent; @@ -3482,29 +3470,22 @@ static void Att_WriteRowStdSeveralAttEvents (unsigned NumStd,struct UsrData *Usr fprintf (Gbl.F.Out,", %s", UsrDat->FirstName); - /***** Icon to show if the user is already registered *****/ + /***** Check/cross to show if the user is present/absent *****/ for (NumAttEvent = 0, NumTimesPresent = 0; NumAttEvent < Gbl.AttEvents.Num; NumAttEvent++) if (Gbl.AttEvents.Lst[NumAttEvent].Selected) { - /***** Check if this student is already registered in the current event *****/ + /* Check if this student is already registered in the current event */ // Here it is not necessary to get comments - Present = Att_CheckIfUsrIsPresentInAttEvent (Gbl.AttEvents.Lst[NumAttEvent].AttCod,UsrDat->UsrCod); + Present = Att_CheckIfUsrIsPresentInAttEvent (Gbl.AttEvents.Lst[NumAttEvent].AttCod, + UsrDat->UsrCod); - fprintf (Gbl.F.Out,"" - "\"%s\"" - "", - Gbl.RowEvenOdd, - Gbl.Prefs.URLIcons, - Present ? "check-square.svg" : - "square.svg", - Present ? Txt_Present : - Txt_Absent, - Present ? Txt_Present : - Txt_Absent); + /* Write check or cross */ + fprintf (Gbl.F.Out,"", + Gbl.RowEvenOdd); + Att_PutCheckOrCross (Present); + fprintf (Gbl.F.Out,""); if (Present) NumTimesPresent++; @@ -3521,6 +3502,29 @@ static void Att_WriteRowStdSeveralAttEvents (unsigned NumStd,struct UsrData *Usr Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd; } +/*****************************************************************************/ +/*********************** Put check or cross character ************************/ +/*****************************************************************************/ + +static void Att_PutCheckOrCross (bool Present) + { + extern const char *Txt_Present; + extern const char *Txt_Absent; + + fprintf (Gbl.F.Out,"
" + "✓", + Txt_Present); + else + fprintf (Gbl.F.Out,"ATT_CROSS\" title=\"%s\">" + "✗", + Txt_Absent); + + fprintf (Gbl.F.Out,"
"); + } + /*****************************************************************************/ /**************** List the students with details and comments ****************/ /*****************************************************************************/ @@ -3573,8 +3577,6 @@ static void Att_ListStdsWithAttEventsDetails (unsigned NumStdsInList, static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat) { extern const char *Txt_Today; - extern const char *Txt_Present; - extern const char *Txt_Absent; extern const char *Txt_Student_comment; extern const char *Txt_Teachers_comment; char PhotoURL[PATH_MAX + 1]; @@ -3652,31 +3654,22 @@ static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat) /***** Write a row for this event *****/ fprintf (Gbl.F.Out,"" "" - "" + "" "%u:" "" - "" - "\"%s\"" - " %s" + "", + Gbl.RowEvenOdd, + Gbl.RowEvenOdd, + NumAttEvent + 1, + Gbl.RowEvenOdd); + Att_PutCheckOrCross (Present); + fprintf (Gbl.F.Out," %s" "" "" "", - Gbl.RowEvenOdd, - Gbl.RowEvenOdd, - NumAttEvent + 1, - Gbl.RowEvenOdd, - Gbl.Prefs.URLIcons, - Present ? "check-square.svg" : - "square.svg", - Present ? Txt_Present : - Txt_Absent, - Present ? Txt_Present : - Txt_Absent, UniqueId, Gbl.AttEvents.Lst[NumAttEvent].Title, UniqueId,Gbl.AttEvents.Lst[NumAttEvent].TimeUTC[Att_START_TIME], diff --git a/swad_changelog.h b/swad_changelog.h index 1361c2a45..0a0ae4e31 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -356,8 +356,6 @@ Buenos d // TODO: Sale de vez en cuando un mensaje "Can not get information about a file or folder.", por ejemplo en el timeline. -// TODO: Tabla de asistencia con símbolos tip ok como entidades HTML - // TODO: Pedro Villar Castro: // Al asignar un TFG a alumnos, no escribir el DNI del alumno, sino escogerlo de una lista de entre los alumnos inscritos en la asignatura. @@ -386,10 +384,11 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.40.1 (2019-02-13)" -#define CSS_FILE "swad18.33.css" +#define Log_PLATFORM_VERSION "SWAD 18.41 (2019-02-13)" +#define CSS_FILE "swad18.41.css" #define JS_FILE "swad18.32.1.js" /* + Version 18.41: Feb 13, 2019 Changes in attendance marks for present/absent. (239203 lines) Version 18.40.1: Feb 13, 2019 Code refactorization in firewall. (239201 lines) Version 18.40: Feb 13, 2019 New table for banned IPs to mitigate DoS attacks. (239198 lines) 2 changes necessary in database: