swad-core/swad_enrolment.h

156 lines
5.6 KiB
C
Raw Permalink Normal View History

2017-03-30 11:20:06 +02:00
// swad_enrolment.h: enrolment (registration) or removing of users
2014-12-12 18:52:06 +01:00
#ifndef _SWAD_ENR
#define _SWAD_ENR
/*
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.
Copyright (C) 1999-2024 Antonio Ca<EFBFBD>as Vargas
2014-12-12 18:52:06 +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 **********************************/
/*****************************************************************************/
2020-01-08 14:04:25 +01:00
#include "swad_course.h"
2017-03-08 14:12:33 +01:00
#include "swad_notification.h"
2014-12-12 18:52:06 +01:00
#include "swad_user.h"
/*****************************************************************************/
/******************************** Public types *******************************/
/*****************************************************************************/
typedef enum
{
Enr_REPLACE_DATA,
Enr_INSERT_NEW_DATA,
} Enr_ReplaceInsert_t;
typedef enum
{
Enr_SET_ACCEPTED_TO_FALSE,
Enr_SET_ACCEPTED_TO_TRUE,
} Enr_KeepOrSetAccepted_t;
2017-01-29 21:41:08 +01:00
#define Enr_REG_REM_ONE_USR_NUM_ACTIONS 11
2014-12-12 22:39:55 +01:00
typedef enum
{
Enr_REG_REM_ONE_USR_UNKNOWN_ACTION = 0,
Enr_REGISTER_MODIFY_ONE_USR_IN_CRS = 1,
Enr_REGISTER_ONE_DEG_ADMIN = 2,
Enr_REGISTER_ONE_CTR_ADMIN = 3,
Enr_REGISTER_ONE_INS_ADMIN = 4,
Enr_REPORT_USR_AS_POSSIBLE_DUPLICATE = 5,
Enr_REMOVE_ONE_USR_FROM_CRS = 6,
Enr_REMOVE_ONE_DEG_ADMIN = 7,
Enr_REMOVE_ONE_CTR_ADMIN = 8,
Enr_REMOVE_ONE_INS_ADMIN = 9,
Enr_ELIMINATE_ONE_USR_FROM_PLATFORM = 10,
2014-12-12 22:39:55 +01:00
} Enr_RegRemOneUsrAction_t;
typedef enum
{
Enr_REQUEST_REMOVE_USR,
Enr_REMOVE_USR,
} Enr_ReqDelOrDelUsr_t;
2014-12-12 18:52:06 +01:00
/*****************************************************************************/
/****************************** Public prototypes ****************************/
/*****************************************************************************/
2017-05-29 21:34:43 +02:00
void Enr_CheckStdsAndPutButtonToRegisterStdsInCurrentCrs (void);
void Enr_PutButtonInlineToRegisterStds (long CrsCod,
unsigned Level,const Lay_LastItem_t *IsLastItemInLevel,
Lay_Highlight_t Highlight);
2015-11-20 14:44:54 +01:00
2015-01-16 12:11:27 +01:00
void Enr_PutLinkToRequestSignUp (void);
void Enr_ModifyRoleInCurrentCrs (struct Usr_Data *UsrDat,Rol_Role_t NewRole);
void Enr_RegisterUsrInCurrentCrs (struct Usr_Data *UsrDat,Rol_Role_t NewRole,
2014-12-12 20:25:00 +01:00
Enr_KeepOrSetAccepted_t KeepOrSetAccepted);
void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction,void (*FuncPars) (void));
2014-12-12 18:52:06 +01:00
void Enr_ReqAcceptRegisterInCrs (void);
2017-03-30 11:20:06 +02:00
void Enr_GetNotifEnrolment (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
long CrsCod,long UsrCod);
void Enr_UpdateUsrData (struct Usr_Data *UsrDat);
2014-12-31 02:46:20 +01:00
2015-09-14 09:50:55 +02:00
void Enr_ReqAdminStds (void);
2017-05-21 19:25:46 +02:00
void Enr_ReqAdminNonEditingTchs (void);
2015-09-14 09:50:55 +02:00
void Enr_ReqAdminTchs (void);
2014-12-12 20:25:00 +01:00
2015-09-16 00:34:25 +02:00
void Enr_PutLinkToRemOldUsrs (void);
2014-12-12 22:39:55 +01:00
void Enr_AskRemoveOldUsrs (void);
void Enr_RemoveOldUsrs (void);
2014-12-12 18:52:06 +01:00
void Enr_ReceiveAdminStds (void);
void Enr_ReceiveAdminNonEditTchs (void);
void Enr_ReceiveAdminTchs (void);
2015-09-14 09:50:55 +02:00
bool Enr_PutActionsRegRemOneUsr (Usr_MeOrOther_t MeOrOther);
2019-03-10 14:44:12 +01:00
2015-09-14 09:32:27 +02:00
void Enr_PutLinkToAdminSeveralUsrs (Rol_Role_t Role);
2014-12-12 18:52:06 +01:00
void Enr_AskRemAllStdsThisCrs (void);
void Enr_RemAllStdsThisCrs (void);
unsigned Enr_RemAllStdsInCrs (struct Hie_Node *Crs);
2014-12-12 18:52:06 +01:00
void Enr_ReqSignUpInCrs (void);
void Enr_SignUpInCrs (void);
2017-03-30 11:20:06 +02:00
void Enr_GetNotifEnrolmentRequest (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
char **ContentStr,
long ReqCod,Ntf_GetContent_t GetContent);
2014-12-12 18:52:06 +01:00
void Enr_AskIfRejectSignUp (void);
void Enr_RejectSignUp (void);
2017-03-30 11:20:06 +02:00
void Enr_ShowEnrolmentRequests (void);
void Enr_UpdateEnrolmentRequests (void);
2014-12-12 22:39:55 +01:00
2015-09-12 14:12:40 +02:00
void Enr_PutLinkToAdminOneUsr (Act_Action_t NextAction);
2015-09-17 16:54:02 +02:00
void Enr_ReqRegRemOth (void);
2015-09-12 14:12:40 +02:00
void Enr_ReqRegRemStd (void);
void Enr_ReqRegRemTch (void);
2015-09-17 16:54:02 +02:00
void Enr_AskIfRegRemAnotherOth (void);
2015-09-12 14:12:40 +02:00
void Enr_AskIfRegRemAnotherStd (void);
void Enr_AskIfRegRemAnotherTch (void);
2014-12-12 18:52:06 +01:00
void Enr_ReqRemMeFromCrs (void);
void Enr_ReqRemUsrFromCrs (void);
2017-06-04 15:11:41 +02:00
void Enr_RemUsrFromCrs1 (void);
void Enr_RemUsrFromCrs2 (void);
2014-12-12 18:52:06 +01:00
void Enr_AcceptRegisterMeInCrs (void);
2016-12-17 22:20:31 +01:00
void Enr_CreateNewUsr1 (void);
void Enr_CreateNewUsr2 (void);
2016-12-18 19:06:48 +01:00
void Enr_ModifyUsr1 (void);
void Enr_ModifyUsr2 (void);
2017-01-25 18:35:42 +01:00
void Enr_FlushCacheUsrBelongsToCurrentCrs (void);
Usr_Belong_t Enr_CheckIfUsrBelongsToCurrentCrs (const struct Usr_Data *UsrDat);
void Enr_FlushCacheUsrHasAcceptedInCurrentCrs (void);
bool Enr_CheckIfUsrHasAcceptedInCurrentCrs (const struct Usr_Data *UsrDat);
void Enr_FlushCacheUsrSharesAnyOfMyCrs (void);
bool Enr_CheckIfUsrSharesAnyOfMyCrs (struct Usr_Data *UsrDat);
unsigned Enr_GetNumUsrsInCrss (Hie_Level_t Level,long Cod,unsigned Roles);
unsigned Enr_GetCachedNumUsrsInCrss (Hie_Level_t Level,long Cod,unsigned Roles);
unsigned Enr_GetCachedNumUsrsNotBelongingToAnyCrs (void);
double Enr_GetCachedAverageNumUsrsPerCrs (Hie_Level_t Level,long Cod,Rol_Role_t Role);
double Enr_GetCachedAverageNumCrssPerUsr (Hie_Level_t Level,long Cod,Rol_Role_t Role);
2014-12-12 18:52:06 +01:00
#endif