swad-core/swad_classroom.h

102 lines
3.8 KiB
C
Raw Normal View History

2018-12-30 22:55:44 +01:00
// swad_classroom.h: classrooms, laboratories or other classrooms where classes are taught
#ifndef _SWAD_CLA
#define _SWAD_CLA
/*
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.
2019-01-07 21:52:19 +01:00
Copyright (C) 1999-2019 Antonio Ca<EFBFBD>as Vargas
2018-12-30 22:55:44 +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 **********************************/
/*****************************************************************************/
#include "swad_string.h"
/*****************************************************************************/
/************************** Public types and constants ***********************/
/*****************************************************************************/
2019-01-03 11:32:14 +01:00
#define Cla_MAX_CHARS_SHRT_NAME (32 - 1) // 31
#define Cla_MAX_BYTES_SHRT_NAME ((Cla_MAX_CHARS_SHRT_NAME + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 511
2018-12-30 22:55:44 +01:00
2019-01-03 11:32:14 +01:00
#define Cla_MAX_CHARS_FULL_NAME (128 - 1) // 127
#define Cla_MAX_BYTES_FULL_NAME ((Cla_MAX_CHARS_FULL_NAME + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
2018-12-30 22:55:44 +01:00
2019-01-03 11:32:14 +01:00
#define Cla_MAX_CAPACITY 10000 // If capacity of a classroom is greater than this, it is considered infinite
#define Cla_UNLIMITED_CAPACITY INT_MAX // This number can be stored in database as an integer...
// ...and means that a classroom has no limited capacity
2019-01-02 15:10:51 +01:00
2019-01-02 22:34:08 +01:00
#define Cla_MAX_CHARS_LOCATION (128 - 1) // 127
#define Cla_MAX_BYTES_LOCATION ((Cla_MAX_CHARS_LOCATION + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
2018-12-30 22:55:44 +01:00
struct Classroom
{
long ClaCod;
long InsCod;
2019-01-03 11:32:14 +01:00
char ShrtName[Cla_MAX_BYTES_SHRT_NAME + 1];
char FullName[Cla_MAX_BYTES_FULL_NAME + 1];
2019-01-02 22:34:08 +01:00
unsigned Capacity; // Seating capacity (maximum number of people that fit in the room)
char Location[Cla_MAX_BYTES_LOCATION + 1]; // Examples: Ground floor, first floor, basement
2018-12-30 22:55:44 +01:00
};
2019-01-03 15:41:26 +01:00
#define Cla_NUM_ORDERS 4
2018-12-30 22:55:44 +01:00
typedef enum
{
2019-01-03 15:41:26 +01:00
Cla_ORDER_BY_SHRT_NAME = 0,
Cla_ORDER_BY_FULL_NAME = 1,
Cla_ORDER_BY_CAPACITY = 2,
Cla_ORDER_BY_LOCATION = 3,
2018-12-30 22:55:44 +01:00
} Cla_Order_t;
2019-01-03 15:25:18 +01:00
#define Cla_ORDER_DEFAULT Cla_ORDER_BY_LOCATION
2018-12-30 22:55:44 +01:00
2019-01-04 12:53:40 +01:00
/***** Get all data or only short name *****/
typedef enum
{
Cla_ALL_DATA,
Cla_ONLY_SHRT_NAME,
} Cla_WhichData_t;
2018-12-30 22:55:44 +01:00
/*****************************************************************************/
/***************************** Public prototypes *****************************/
/*****************************************************************************/
void Cla_SeeClassrooms (void);
void Cla_EditClassrooms (void);
void Cla_PutIconToViewClassrooms (void);
2019-01-04 12:53:40 +01:00
void Cla_GetListClassrooms (Cla_WhichData_t WhichData);
2018-12-30 22:55:44 +01:00
void Cla_FreeListClassrooms (void);
2019-01-04 12:53:40 +01:00
void Cla_GetListClassroomsInThisCtr (void);
2018-12-30 22:55:44 +01:00
void Cla_GetDataOfClassroomByCod (struct Classroom *Cla);
long Cla_GetParamClaCod (void);
2019-01-03 15:25:18 +01:00
2018-12-30 22:55:44 +01:00
void Cla_RemoveClassroom (void);
2019-01-05 11:51:22 +01:00
void Cla_RemoveAllClassroomsInCtr (long CtrCod);
2018-12-30 22:55:44 +01:00
void Cla_RenameClassroomShort (void);
void Cla_RenameClassroomFull (void);
2019-01-03 15:25:18 +01:00
void Cla_ChangeCapacity (void);
void Cla_ChangeClassroomLocation (void);
2019-04-09 08:58:52 +02:00
void Cla_ContEditAfterChgCla (void);
2019-01-03 15:25:18 +01:00
2018-12-30 22:55:44 +01:00
void Cla_RecFormNewClassroom (void);
#endif