swad-core/swad_department.h

89 lines
3.2 KiB
C
Raw Normal View History

2014-12-01 23:55:08 +01:00
// swad_department.h: departments
#ifndef _SWAD_DPT
#define _SWAD_DPT
/*
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 ***********************************/
/*****************************************************************************/
2021-02-11 22:57:09 +01:00
#include "swad_constant.h"
2017-03-08 14:12:33 +01:00
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
/************************** Public types and constants ***********************/
/*****************************************************************************/
2020-04-13 20:50:47 +02:00
struct Dpt_Department
2014-12-01 23:55:08 +01:00
{
long DptCod;
long InsCod;
2021-02-11 22:57:09 +01:00
char ShrtName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1];
char FullName[Cns_HIERARCHY_MAX_BYTES_FULL_NAME + 1];
2017-03-07 01:56:41 +01:00
char WWW[Cns_MAX_BYTES_WWW + 1];
2017-05-25 19:57:34 +02:00
unsigned NumTchs; // Non-editing teachers and teachers
2014-12-01 23:55:08 +01:00
};
2017-01-29 21:41:08 +01:00
#define Dpt_NUM_ORDERS 2
2014-12-01 23:55:08 +01:00
typedef enum
{
Dpt_ORDER_BY_DEPARTMENT = 0,
Dpt_ORDER_BY_NUM_TCHS = 1,
2017-01-29 12:42:19 +01:00
} Dpt_Order_t;
#define Dpt_ORDER_DEFAULT Dpt_ORDER_BY_DEPARTMENT
2014-12-01 23:55:08 +01:00
2020-04-13 20:50:47 +02:00
struct Dpt_Departments
{
unsigned Num; // Number of departments
struct Dpt_Department *Lst; // List of departments
Dpt_Order_t SelectedOrder;
};
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
/***************************** Public prototypes *****************************/
/*****************************************************************************/
void Dpt_SeeAllDepts (void);
2014-12-01 23:55:08 +01:00
void Dpt_EditDepartments (void);
2020-04-13 20:50:47 +02:00
void Dpt_FreeListDepartments (struct Dpt_Departments *Departments);
void Dpt_GetDepartmentDataByCod (struct Dpt_Department *Dpt);
2014-12-01 23:55:08 +01:00
void Dpt_RemoveDepartment (void);
void Dpt_ChangeDepartIns (void);
void Dpt_RenameDepartShort (void);
void Dpt_RenameDepartFull (void);
void Dpt_ChangeDptWWW (void);
2019-04-08 23:34:58 +02:00
void Dpt_ContEditAfterChgDpt (void);
2020-05-05 21:49:00 +02:00
void Dpt_ReceiveFormNewDpt (void);
2014-12-01 23:55:08 +01:00
unsigned Dpt_GetTotalNumberOfDepartments (void);
2020-01-06 18:27:43 +01:00
void Dpt_FlushCacheNumDptsInIns (void);
2017-05-31 22:51:40 +02:00
unsigned Dpt_GetNumDptsInIns (long InsCod);
2014-12-01 23:55:08 +01:00
2017-10-10 10:46:35 +02:00
void Dpt_WriteSelectorDepartment (long InsCod,long DptCod,
const char *ParName,
2020-04-13 20:50:47 +02:00
const char *SelectClass,
long FirstOption,
2017-10-10 10:46:35 +02:00
const char *TextWhenNoDptSelected,
HTM_SubmitOnChange_t SubmitOnChange);
2014-12-01 23:55:08 +01:00
#endif