swad-core/swad_agenda.h

114 lines
3.4 KiB
C
Raw Normal View History

2016-07-07 00:21:10 +02:00
// swad_agenda.h: user's agenda (personal organizer)
#ifndef _SWAD_AGD
#define _SWAD_AGD
/*
SWAD (Shared Workspace At a Distance in Spanish),
is a web platform developed at the University of Granada (Spain),
and used to support university teaching.
This file is part of SWAD core.
2017-01-13 01:51:23 +01:00
Copyright (C) 1999-2017 Antonio Ca<EFBFBD>as Vargas
2016-07-07 00:21:10 +02: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/>.
*/
/*****************************************************************************/
2016-11-30 22:49:48 +01:00
/********************************* Headers ***********************************/
2016-07-07 00:21:10 +02:00
/*****************************************************************************/
2016-11-30 22:49:48 +01:00
#include "swad_date.h"
#include "swad_user.h"
2016-07-07 00:21:10 +02:00
/*****************************************************************************/
2016-11-30 22:49:48 +01:00
/************************** Public types and constants ***********************/
2016-07-07 00:21:10 +02:00
/*****************************************************************************/
2017-03-08 14:12:33 +01:00
#define Agd_MAX_CHARS_EVENT (128 - 1) // 127
#define Agd_MAX_BYTES_EVENT ((Agd_MAX_CHARS_EVENT + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
2016-11-30 22:49:48 +01:00
2017-03-08 20:31:49 +01:00
#define Agd_MAX_CHARS_LOCATION (128 - 1) // 127
#define Agd_MAX_BYTES_LOCATION ((Agd_MAX_CHARS_LOCATION + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
2016-12-02 10:45:53 +01:00
#define Agd_NUM_DATES 2
2016-11-30 22:49:48 +01:00
typedef enum
{
2016-12-02 10:45:53 +01:00
Agd_START_TIME = 0,
Agd_END_TIME = 1,
} Agd_StartOrEndTime_t;
2016-11-30 22:49:48 +01:00
2016-12-01 00:53:50 +01:00
struct AgendaEvent
2016-11-30 22:49:48 +01:00
{
2016-12-01 00:53:50 +01:00
long AgdCod;
2016-11-30 22:49:48 +01:00
long UsrCod;
2016-12-03 19:22:06 +01:00
bool Public;
bool Hidden;
2016-12-02 10:45:53 +01:00
time_t TimeUTC[Agd_NUM_DATES];
Dat_TimeStatus_t TimeStatus;
2017-03-07 01:56:41 +01:00
char Event[Agd_MAX_BYTES_EVENT + 1];
char Location[Agd_MAX_BYTES_LOCATION + 1];
2016-11-30 22:49:48 +01:00
};
2016-12-03 23:13:49 +01:00
typedef enum
{
Agd_ALL_EVENTS,
Agd_ONLY_PUBLIC_EVENTS,
} Agd_WhichEvents_t;
2016-11-30 22:49:48 +01:00
2017-01-29 21:41:08 +01:00
#define Agd_NUM_ORDERS 2
2016-11-30 22:49:48 +01:00
typedef enum
{
2016-12-02 10:45:53 +01:00
Agd_ORDER_BY_START_DATE = 0,
Agd_ORDER_BY_END_DATE = 1,
} Agd_Order_t;
2017-01-29 12:42:19 +01:00
#define Agd_ORDER_DEFAULT Agd_ORDER_BY_START_DATE
2016-07-07 00:21:10 +02:00
/*****************************************************************************/
2016-11-30 22:49:48 +01:00
/***************************** Public prototypes *****************************/
2016-07-07 00:21:10 +02:00
/*****************************************************************************/
2016-12-04 04:22:36 +01:00
void Agd_PutFormLogInToShowUsrAgenda (void);
2016-12-05 13:26:12 +01:00
void Agd_PutParamAgd (void);
2016-12-02 00:24:16 +01:00
void Agd_ShowMyAgenda (void);
2016-12-06 21:08:28 +01:00
void Agd_ShowMyPublicAgenda (void);
2016-12-06 21:26:02 +01:00
void Agd_ShowUsrAgenda (void);
void Agd_ShowOtherAgendaAfterLogIn (void);
2016-12-02 00:24:16 +01:00
2017-01-29 12:42:19 +01:00
void Agd_PutHiddenParamEventsOrder (void);
2016-12-01 00:53:50 +01:00
void Agd_RequestCreatOrEditEvent (void);
void Agd_FreeListEvents (void);
long Agd_GetParamAgdCod (void);
2016-12-03 19:22:06 +01:00
2016-12-01 00:53:50 +01:00
void Agd_AskRemEvent (void);
void Agd_RemoveEvent (void);
2016-12-03 19:22:06 +01:00
void Agd_HideEvent (void);
2016-12-06 19:14:58 +01:00
void Agd_UnhideEvent (void);
2016-12-03 19:22:06 +01:00
void Agd_MakeEventPrivate (void);
void Agd_MakeEventPublic (void);
2016-12-01 00:53:50 +01:00
void Agd_RecFormEvent (void);
2016-12-03 19:22:06 +01:00
2016-12-01 00:53:50 +01:00
void Agd_RemoveUsrEvents (long UsrCod);
unsigned Agd_GetNumEventsFromUsr (long UsrCod);
unsigned Agd_GetNumUsrsWithEvents (Sco_Scope_t Scope);
unsigned Agd_GetNumEvents (Sco_Scope_t Scope);
2016-07-07 00:21:10 +02:00
2016-12-07 00:41:36 +01:00
void Agd_PrintAgdQRCode (void);
2016-07-07 00:21:10 +02:00
#endif