2017-09-15 13:19:27 +02:00
|
|
|
|
// swad_project.h: projects (final degree projects, thesis)
|
|
|
|
|
|
|
|
|
|
#ifndef _SWAD_PRJ
|
|
|
|
|
#define _SWAD_PRJ
|
|
|
|
|
/*
|
|
|
|
|
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.
|
|
|
|
|
Copyright (C) 1999-2017 Antonio Ca<EFBFBD>as Vargas
|
|
|
|
|
|
|
|
|
|
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_file_browser.h"
|
|
|
|
|
#include "swad_notification.h"
|
|
|
|
|
#include "swad_user.h"
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************************** Public types and constants ***********************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2017-09-19 01:12:05 +02:00
|
|
|
|
#define Prj_MAX_CHARS_PROJECT_TITLE (128 - 1) // 127
|
|
|
|
|
#define Prj_MAX_BYTES_PROJECT_TITLE ((Prj_MAX_CHARS_PROJECT_TITLE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
|
2017-09-15 13:19:27 +02:00
|
|
|
|
|
2017-09-17 23:37:03 +02:00
|
|
|
|
#define Prj_NUM_TYPES_PREASSIGNED 2
|
2017-09-15 13:19:27 +02:00
|
|
|
|
typedef enum
|
|
|
|
|
{
|
2017-09-17 23:37:03 +02:00
|
|
|
|
Prj_NOT_PREASSIGNED = 0,
|
|
|
|
|
Prj_PREASSIGNED = 1,
|
|
|
|
|
} Prj_Preassigned_t;
|
2017-09-15 13:19:27 +02:00
|
|
|
|
|
2017-09-23 15:24:22 +02:00
|
|
|
|
// Related with user's roles in a project
|
|
|
|
|
// Don't change these numbers! They are used in database
|
|
|
|
|
#define Prj_NUM_ROLES_IN_PROJECT 4
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
Prj_ROLE_UNK = 0, // Unknown
|
|
|
|
|
Prj_ROLE_STD = 1, // Student
|
|
|
|
|
Prj_ROLE_TUT = 2, // Tutor
|
|
|
|
|
Prj_ROLE_EVA = 3, // Evaluator
|
|
|
|
|
} Prj_RoleInProject_t;
|
|
|
|
|
|
2017-09-15 13:19:27 +02:00
|
|
|
|
struct Project
|
|
|
|
|
{
|
|
|
|
|
long PrjCod;
|
|
|
|
|
bool Hidden;
|
2017-09-19 01:12:05 +02:00
|
|
|
|
Prj_Preassigned_t Preassigned;
|
2017-09-15 13:19:27 +02:00
|
|
|
|
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
|
|
|
|
bool Open;
|
2017-09-17 23:37:03 +02:00
|
|
|
|
char Title[Prj_MAX_BYTES_PROJECT_TITLE + 1];
|
2017-09-22 00:26:14 +02:00
|
|
|
|
long DptCod;
|
2017-09-19 01:12:05 +02:00
|
|
|
|
char *Description;
|
|
|
|
|
char *Knowledge;
|
|
|
|
|
char *Materials;
|
2017-09-18 01:06:51 +02:00
|
|
|
|
char URL[Cns_MAX_BYTES_WWW + 1];
|
2017-09-15 13:19:27 +02:00
|
|
|
|
};
|
|
|
|
|
|
2017-09-23 21:15:17 +02:00
|
|
|
|
#define Prj_NUM_ORDERS 4
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
Prj_ORDER_START_TIME = 0,
|
|
|
|
|
Prj_ORDER_END_TIME = 1,
|
|
|
|
|
Prj_ORDER_TITLE = 2,
|
|
|
|
|
Prj_ORDER_DEPARTMENT = 3,
|
|
|
|
|
} Prj_Order_t;
|
|
|
|
|
#define Prj_ORDER_DEFAULT Prj_ORDER_START_TIME
|
2017-09-15 13:19:27 +02:00
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/***************************** Public prototypes *****************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void Prj_SeeProjects (void);
|
|
|
|
|
void Prj_PrintOneProject (void);
|
|
|
|
|
|
2017-09-20 17:12:34 +02:00
|
|
|
|
void Prj_ReqAddStd (void);
|
|
|
|
|
void Prj_ReqAddTut (void);
|
2017-09-21 21:10:52 +02:00
|
|
|
|
void Prj_ReqAddEva (void);
|
2017-09-20 17:12:34 +02:00
|
|
|
|
|
|
|
|
|
void Prj_AddStd (void);
|
|
|
|
|
void Prj_AddTut (void);
|
2017-09-21 21:10:52 +02:00
|
|
|
|
void Prj_AddEva (void);
|
2017-09-20 17:12:34 +02:00
|
|
|
|
|
2017-09-22 00:56:17 +02:00
|
|
|
|
void Prj_ReqRemStd (void);
|
|
|
|
|
void Prj_ReqRemTut (void);
|
|
|
|
|
void Prj_ReqRemEva (void);
|
|
|
|
|
|
|
|
|
|
void Prj_RemStd (void);
|
|
|
|
|
void Prj_RemTut (void);
|
|
|
|
|
void Prj_RemEva (void);
|
|
|
|
|
|
2017-09-15 13:19:27 +02:00
|
|
|
|
void Prj_PutHiddenParamPrjOrder (void);
|
2017-09-21 00:40:09 +02:00
|
|
|
|
|
|
|
|
|
void Prj_RequestCreatePrj (void);
|
|
|
|
|
void Prj_RequestEditPrj (void);
|
|
|
|
|
|
2017-09-15 13:19:27 +02:00
|
|
|
|
void Prj_GetListProjects (void);
|
|
|
|
|
void Prj_GetDataOfProjectByCod (struct Project *Prj);
|
|
|
|
|
void Prj_FreeListProjects (void);
|
|
|
|
|
|
|
|
|
|
long Prj_GetParamPrjCod (void);
|
|
|
|
|
void Prj_ReqRemProject (void);
|
|
|
|
|
void Prj_RemoveProject (void);
|
|
|
|
|
void Prj_HideProject (void);
|
|
|
|
|
void Prj_ShowProject (void);
|
|
|
|
|
void Prj_RecFormProject (void);
|
|
|
|
|
void Prj_RemoveCrsProjects (long CrsCod);
|
|
|
|
|
unsigned Prj_GetNumProjectsInCrs(long CrsCod);
|
|
|
|
|
|
|
|
|
|
unsigned Prj_GetNumCoursesWithProjects (Sco_Scope_t Scope);
|
2017-09-17 16:58:09 +02:00
|
|
|
|
unsigned Prj_GetNumProjects (Sco_Scope_t Scope);
|
2017-09-15 13:19:27 +02:00
|
|
|
|
|
|
|
|
|
#endif
|