2014-12-01 23:55:08 +01:00
|
|
|
|
// swad_attendance.h: control of attendance
|
|
|
|
|
|
|
|
|
|
#ifndef _SWAD_ATT
|
|
|
|
|
#define _SWAD_ATT
|
|
|
|
|
/*
|
|
|
|
|
SWAD (Shared Workspace At a Distance),
|
|
|
|
|
is a web platform developed at the University of Granada (Spain),
|
|
|
|
|
and used to support university teaching.
|
|
|
|
|
|
|
|
|
|
This file is part of SWAD core.
|
2024-02-07 00:40:28 +01:00
|
|
|
|
Copyright (C) 1999-2024 Antonio Ca<EFBFBD>as Vargas
|
2014-12-01 23:55:08 +01:00
|
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU Affero General Public License as
|
|
|
|
|
published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/********************************* Headers ***********************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "swad_date.h"
|
|
|
|
|
#include "swad_user.h"
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************************** Public types and constants ***********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2017-03-08 14:12:33 +01:00
|
|
|
|
#define Att_MAX_CHARS_ATTENDANCE_EVENT_TITLE (128 - 1) // 127
|
|
|
|
|
#define Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE ((Att_MAX_CHARS_ATTENDANCE_EVENT_TITLE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
|
2014-12-01 23:55:08 +01:00
|
|
|
|
|
2020-04-10 19:14:08 +02:00
|
|
|
|
#define Att_NUM_ORDERS_NEWEST_OLDEST 2
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
Att_NEWEST_FIRST,
|
|
|
|
|
Att_OLDEST_FIRST,
|
|
|
|
|
} Att_OrderNewestOldest_t;
|
|
|
|
|
|
2021-09-18 18:22:26 +02:00
|
|
|
|
#define Att_ORDER_DEFAULT Dat_STR_TIME
|
2020-04-10 19:14:08 +02:00
|
|
|
|
|
2020-04-06 16:00:06 +02:00
|
|
|
|
struct Att_Event
|
2014-12-01 23:55:08 +01:00
|
|
|
|
{
|
2017-01-17 14:52:13 +01:00
|
|
|
|
/* Fields stored in database */
|
2014-12-01 23:55:08 +01:00
|
|
|
|
long AttCod;
|
|
|
|
|
long CrsCod;
|
2023-06-06 22:18:31 +02:00
|
|
|
|
HidVis_HiddenOrVisible_t HiddenOrVisible;
|
2014-12-01 23:55:08 +01:00
|
|
|
|
long UsrCod;
|
2021-10-20 16:46:34 +02:00
|
|
|
|
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
2024-04-13 21:33:16 +02:00
|
|
|
|
CloOpe_ClosedOrOpen_t ClosedOrOpen;
|
2014-12-01 23:55:08 +01:00
|
|
|
|
bool CommentTchVisible;
|
2023-03-22 11:00:48 +01:00
|
|
|
|
char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1];
|
2017-01-17 14:52:13 +01:00
|
|
|
|
|
2022-10-03 16:50:49 +02:00
|
|
|
|
/* Field computed, not associated to the event in database */
|
2014-12-01 23:55:08 +01:00
|
|
|
|
unsigned NumStdsTotal; // Number total of students who have assisted to the event
|
|
|
|
|
};
|
|
|
|
|
|
2020-04-10 19:14:08 +02:00
|
|
|
|
struct Att_Events
|
2014-12-01 23:55:08 +01:00
|
|
|
|
{
|
2022-10-03 16:50:49 +02:00
|
|
|
|
bool LstIsRead; // Is the list already read from database, or it needs to be read?
|
|
|
|
|
unsigned Num; // Number of attendance events
|
|
|
|
|
struct
|
|
|
|
|
{
|
|
|
|
|
long AttCod; // Attendance event code
|
|
|
|
|
unsigned NumStdsFromList; // Number of students (taken from a list) who has assisted to the event
|
|
|
|
|
bool Selected; // I have selected this attendance event
|
|
|
|
|
} *Lst; // List of attendance events
|
2020-04-10 19:14:08 +02:00
|
|
|
|
Dat_StartEndTime_t SelectedOrder;
|
2022-10-03 16:50:49 +02:00
|
|
|
|
struct Att_Event Event; // Selected/current event
|
2020-04-10 19:14:08 +02:00
|
|
|
|
bool ShowDetails;
|
|
|
|
|
char *StrAttCodsSelected;
|
|
|
|
|
unsigned CurrentPage;
|
|
|
|
|
};
|
2014-12-01 23:55:08 +01:00
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/***************************** Public prototypes *****************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2023-03-23 09:35:20 +01:00
|
|
|
|
void Att_SeeEvents (void);
|
2022-10-03 16:50:49 +02:00
|
|
|
|
|
2024-04-19 12:00:30 +02:00
|
|
|
|
Usr_Can_t Att_CheckIfICanEditEvents (void);
|
2022-10-03 16:50:49 +02:00
|
|
|
|
|
2023-03-23 09:35:20 +01:00
|
|
|
|
void Att_ReqCreatOrEditEvent (void);
|
|
|
|
|
bool Att_GetEventDataByCod (struct Att_Event *Event);
|
|
|
|
|
void Att_GetEventDataFromRow (MYSQL_ROW row,struct Att_Event *Event);
|
2016-09-06 18:29:13 +02:00
|
|
|
|
|
2023-03-23 09:35:20 +01:00
|
|
|
|
void Att_AskRemEvent (void);
|
|
|
|
|
void Att_GetAndRemEvent (void);
|
|
|
|
|
void Att_RemoveEventFromDB (long AttCod);
|
2016-09-06 18:29:13 +02:00
|
|
|
|
|
2023-03-23 09:35:20 +01:00
|
|
|
|
void Att_HideEvent (void);
|
|
|
|
|
void Att_UnhideEvent (void);
|
2024-03-20 09:39:04 +01:00
|
|
|
|
void Att_ReceiveEvent (void);
|
2023-03-23 09:35:20 +01:00
|
|
|
|
void Att_CreateEvent (struct Att_Event *Event,const char *Description);
|
|
|
|
|
void Att_UpdateEvent (struct Att_Event *Event,const char *Description);
|
2016-09-06 18:29:13 +02:00
|
|
|
|
|
2024-02-09 00:22:59 +01:00
|
|
|
|
void Att_RemoveCrsEvents (long HieCod);
|
2016-09-06 18:29:13 +02:00
|
|
|
|
|
2023-09-22 14:47:56 +02:00
|
|
|
|
unsigned Att_GetNumEvents (Hie_Level_t Level,unsigned *NumNotif);
|
2014-12-01 23:55:08 +01:00
|
|
|
|
|
2023-03-23 09:35:20 +01:00
|
|
|
|
void Att_SeeOneEvent (void);
|
2014-12-01 23:55:08 +01:00
|
|
|
|
|
2023-03-10 00:13:55 +01:00
|
|
|
|
void Att_PutParsCodGrps (long AttCod);
|
2022-09-24 18:53:31 +02:00
|
|
|
|
|
2023-03-23 09:35:20 +01:00
|
|
|
|
void Att_RegisterMeAsStdInEvent (void);
|
|
|
|
|
void Att_RegisterStudentsInEvent (void);
|
2014-12-01 23:55:08 +01:00
|
|
|
|
|
2020-04-13 16:39:15 +02:00
|
|
|
|
void Att_ReqListUsrsAttendanceCrs (void);
|
2019-11-14 17:53:50 +01:00
|
|
|
|
void Att_ListMyAttendanceCrs (void);
|
|
|
|
|
void Att_PrintMyAttendanceCrs (void);
|
|
|
|
|
void Att_ListUsrsAttendanceCrs (void);
|
|
|
|
|
void Att_PrintUsrsAttendanceCrs (void);
|
2014-12-01 23:55:08 +01:00
|
|
|
|
|
|
|
|
|
#endif
|