swad-core/swad_degree.h

134 lines
4.8 KiB
C
Raw Normal View History

2014-12-01 23:55:08 +01:00
// swad_degree.h: degrees
#ifndef _SWAD_DEG
#define _SWAD_DEG
/*
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-2023 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 ***********************************/
/*****************************************************************************/
2018-10-31 13:00:40 +01:00
#include <mysql/mysql.h> // To access MySQL databases
2014-12-01 23:55:08 +01:00
#include "swad_action.h"
#include "swad_constant.h"
2021-02-11 22:57:09 +01:00
#include "swad_hierarchy_level.h"
2016-12-13 13:32:19 +01:00
#include "swad_role_type.h"
2014-12-01 23:55:08 +01:00
#include "swad_string.h"
/*****************************************************************************/
/***************************** Public constants ******************************/
/*****************************************************************************/
2017-01-13 01:51:23 +01:00
#define Deg_MAX_YEARS_PER_DEGREE 12 // Max number of academic years per degree
2014-12-01 23:55:08 +01:00
2017-01-13 01:51:23 +01:00
#define Deg_MAX_DEGREES_PER_USR 20 // Used in list of my degrees
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
/******************************* Public types ********************************/
/*****************************************************************************/
2021-02-11 00:58:53 +01:00
struct Deg_Degree
2014-12-01 23:55:08 +01:00
{
2017-03-11 20:59:09 +01:00
long DegCod; // Degree code
2019-04-07 12:17:10 +02:00
long DegTypCod; // Degree type code
long CtrCod; // Center code
Hie_Status_t Status; // Degree status
2017-03-11 20:59:09 +01:00
long RequesterUsrCod; // User code of the person who requested the creation of this degree
2021-02-11 22:57:09 +01:00
char ShrtName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1]; // Short name of degree
char FullName[Cns_HIERARCHY_MAX_BYTES_FULL_NAME + 1]; // Full name of degree
2017-03-07 01:56:41 +01:00
char WWW[Cns_MAX_BYTES_WWW + 1];
2014-12-01 23:55:08 +01:00
};
2016-04-16 15:05:18 +02:00
struct ListDegrees
{
2019-04-04 10:45:15 +02:00
unsigned Num; // Number of degrees
2021-02-11 00:58:53 +01:00
struct Deg_Degree *Lst; // List of degrees
2016-04-16 15:05:18 +02:00
};
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
/***************************** Public prototypes *****************************/
/*****************************************************************************/
void Deg_SeeDegWithPendingCrss (void);
2021-02-11 00:58:53 +01:00
void Deg_DrawDegreeLogoAndNameWithLink (struct Deg_Degree *Deg,Act_Action_t Action,
const char *ClassLogo);
2015-11-19 20:04:41 +01:00
2016-11-14 16:47:46 +01:00
void Deg_WriteSelectorOfDegree (void);
2014-12-01 23:55:08 +01:00
void Deg_ShowDegsOfCurrentCtr (void);
unsigned Deg_ConvStrToYear (const char *StrYear);
void Deg_EditDegrees (void);
2018-11-15 12:52:56 +01:00
void Deg_PutIconToViewDegrees (void);
2016-04-16 15:05:18 +02:00
void Deg_GetListAllDegsWithStds (struct ListDegrees *Degs);
2020-01-05 12:52:03 +01:00
void Deg_GetListDegsInCurrentCtr (void);
2016-04-16 15:05:18 +02:00
void Deg_FreeListDegs (struct ListDegrees *Degs);
2014-12-01 23:55:08 +01:00
2020-05-05 21:49:00 +02:00
void Deg_ReceiveFormReqDeg (void);
void Deg_ReceiveFormNewDeg (void);
2014-12-01 23:55:08 +01:00
void Deg_RemoveDegree (void);
bool Deg_GetDegreeDataByCod (struct Deg_Degree *Deg);
2016-03-20 16:30:52 +01:00
void Deg_RemoveDegreeCompletely (long DegCod);
2014-12-01 23:55:08 +01:00
void Deg_RenameDegreeShort (void);
void Deg_RenameDegreeFull (void);
2021-02-11 00:58:53 +01:00
void Deg_RenameDegree (struct Deg_Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFullName);
2019-04-07 12:17:10 +02:00
void Deg_ChangeDegreeType (void);
2014-12-01 23:55:08 +01:00
void Deg_ChangeDegWWW (void);
void Deg_ChangeDegStatus (void);
2019-04-08 14:52:13 +02:00
void Deg_ContEditAfterChgDeg (void);
2016-03-20 16:30:52 +01:00
2020-05-03 20:58:03 +02:00
unsigned Deg_GetCachedNumDegsInSys (void);
2020-01-07 16:08:13 +01:00
void Deg_FlushCacheNumDegsInCty (void);
unsigned Deg_GetNumDegsInCty (long CtyCod);
2020-05-03 20:58:03 +02:00
unsigned Deg_GetCachedNumDegsInCty (long CtyCod);
2020-01-06 18:43:48 +01:00
void Deg_FlushCacheNumDegsInIns (void);
2014-12-01 23:55:08 +01:00
unsigned Deg_GetNumDegsInIns (long InsCod);
2020-05-03 20:58:03 +02:00
unsigned Deg_GetCachedNumDegsInIns (long InsCod);
2020-01-05 02:18:20 +01:00
void Deg_FlushCacheNumDegsInCtr (void);
2014-12-01 23:55:08 +01:00
unsigned Deg_GetNumDegsInCtr (long CtrCod);
2020-05-03 20:58:03 +02:00
unsigned Deg_GetCachedNumDegsInCtr (long CtrCod);
unsigned Deg_GetCachedNumDegsWithCrss (void);
unsigned Deg_GetCachedNumDegsWithUsrs (Rol_Role_t Role);
2014-12-01 23:55:08 +01:00
2018-10-30 17:47:57 +01:00
void Deg_ListDegsFound (MYSQL_RES **mysql_res,unsigned NumCrss);
2014-12-01 23:55:08 +01:00
void Deg_GetMyDegrees (void);
void Deg_FreeMyDegrees (void);
bool Deg_CheckIfIBelongToDeg (long DegCod);
void Deg_GetUsrMainDeg (long UsrCod,
char ShrtName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1],
Rol_Role_t *MaxRole);
void Deg_FlushCacheUsrBelongsToDeg (void);
bool Deg_CheckIfUsrBelongsToDeg (long UsrCod,long DegCod);
2014-12-01 23:55:08 +01:00
#endif