2021-10-11 23:37:14 +02:00
|
|
|
|
// swad_project_database.h: projects (final degree projects, thesis), operations with database
|
|
|
|
|
|
|
|
|
|
#ifndef _SWAD_PRJ_DB
|
|
|
|
|
#define _SWAD_PRJ_DB
|
|
|
|
|
/*
|
|
|
|
|
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
|
2021-10-11 23:37:14 +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/>.
|
|
|
|
|
*/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/********************************* Headers ***********************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2023-09-22 14:47:56 +02:00
|
|
|
|
#include "swad_hierarchy_type.h"
|
2023-04-18 22:13:37 +02:00
|
|
|
|
#include "swad_project.h"
|
2021-10-11 23:37:14 +02:00
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/***************************** Public prototypes *****************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void Prj_DB_LockProjectEdition (long PrjCod);
|
|
|
|
|
void Prj_DB_UnlockProjectEdition (long PrjCod);
|
|
|
|
|
long Prj_DB_CreateProject (const struct Prj_Project *Prj);
|
|
|
|
|
void Prj_DB_UpdateProject (const struct Prj_Project *Prj);
|
|
|
|
|
void Prj_DB_AddUsrToPrj (long PrjCod,Prj_RoleInProject_t RoleInProject,long UsrCod);
|
2023-09-10 15:20:25 +02:00
|
|
|
|
void Prj_DB_HideOrUnhideProject (long PrjCod,
|
|
|
|
|
HidVis_HiddenOrVisible_t HiddenOrVisible);
|
2022-10-13 16:49:55 +02:00
|
|
|
|
void Prj_DB_UpdateReview (const struct Prj_Project *Prj);
|
2021-10-11 23:37:14 +02:00
|
|
|
|
|
|
|
|
|
unsigned Prj_DB_GetListProjects (MYSQL_RES **mysql_res,
|
|
|
|
|
const struct Prj_Projects *Projects,
|
|
|
|
|
const char *UsrsSubQuery); // NULL if no users
|
2023-03-23 09:35:20 +01:00
|
|
|
|
unsigned Prj_DB_GetProjectDataByCod (MYSQL_RES **mysql_res,long PrjCod);
|
2023-04-06 22:39:26 +02:00
|
|
|
|
void Prj_DB_GetProjectTitle (long PrjCod,char *Title,size_t TitleSize);
|
2021-10-11 23:37:14 +02:00
|
|
|
|
unsigned Prj_DB_GetPrjDataToCheckFaults (MYSQL_RES **mysql_res,long PrjCod);
|
|
|
|
|
unsigned Prj_DB_GetNumUsrsInPrj (long PrjCod,Prj_RoleInProject_t RoleInProject);
|
|
|
|
|
unsigned Prj_DB_GetUsrsInPrj (MYSQL_RES **mysql_res,
|
|
|
|
|
long PrjCod,Prj_RoleInProject_t RoleInProject);
|
|
|
|
|
unsigned Prj_DB_GetMyRolesInPrj (MYSQL_RES **mysql_res,long PrjCod);
|
|
|
|
|
long Prj_DB_GetCrsOfPrj (long PrjCod);
|
2023-09-22 14:47:56 +02:00
|
|
|
|
unsigned Prj_DB_GetNumCoursesWithProjects (Hie_Level_t Level);
|
|
|
|
|
unsigned Prj_DB_GetNumProjects (Hie_Level_t Level);
|
2021-10-11 23:37:14 +02:00
|
|
|
|
|
|
|
|
|
void Prj_DB_RemoveUsrFromPrj (long PrjCod,Prj_RoleInProject_t RoleInPrj,long UsrCod);
|
|
|
|
|
void Prj_DB_RemoveUsrFromProjects (long UsrCod);
|
|
|
|
|
void Prj_DB_RemoveUsrsFromPrj (long PrjCod);
|
|
|
|
|
void Prj_DB_RemoveUsrsFromCrsPrjs (long CrsCod);
|
|
|
|
|
void Prj_DB_RemoveConfigOfCrsPrjs (long CrsCod);
|
2023-05-03 11:02:06 +02:00
|
|
|
|
void Prj_DB_RemoveRubricsOfCrsPrjs (long CrsCod);
|
2021-10-11 23:37:14 +02:00
|
|
|
|
void Prj_DB_RemovePrj (long PrjCod);
|
|
|
|
|
void Prj_DB_RemoveCrsPrjs (long CrsCod);
|
|
|
|
|
|
2023-04-13 14:25:52 +02:00
|
|
|
|
//----------------------------- Configuration ---------------------------------
|
|
|
|
|
|
2023-05-17 15:28:15 +02:00
|
|
|
|
void Prj_DB_UpdateNETCanCreate (const struct Prj_Projects *Projects);
|
2023-05-19 23:00:30 +02:00
|
|
|
|
void Prj_DB_UpdateRubrics (PrjCfg_RubricType_t RubricType,
|
2023-05-17 15:28:15 +02:00
|
|
|
|
const struct PrgCfg_ListRubCods *ListRubCods);
|
2023-04-13 14:25:52 +02:00
|
|
|
|
unsigned Prj_DB_GetConfig (MYSQL_RES **mysql_res);
|
2023-05-17 15:28:15 +02:00
|
|
|
|
unsigned Prj_DB_GetRubricsOfType (MYSQL_RES **mysql_res,
|
|
|
|
|
PrjCfg_RubricType_t RubricType);
|
|
|
|
|
PrjCfg_RubricType_t Prj_DB_GetWichRubricFromRubCod (long RubCod);
|
2023-04-13 14:25:52 +02:00
|
|
|
|
|
2021-10-11 23:37:14 +02:00
|
|
|
|
#endif
|