swad-core/swad_country.h

97 lines
3.9 KiB
C
Raw Permalink Normal View History

2014-12-01 23:55:08 +01:00
// swad_country.h: countries
#ifndef _SWAD_CTY
#define _SWAD_CTY
/*
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-2024 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-30 14:47:31 +01:00
#include <mysql/mysql.h> // To access MySQL databases
2015-10-16 02:24:29 +02:00
#include <stdbool.h> // For boolean type
2014-12-01 23:55:08 +01:00
#include "swad_action.h"
#include "swad_hierarchy_type.h"
2019-04-04 10:45:15 +02:00
#include "swad_institution.h"
2018-12-08 16:43:13 +01:00
#include "swad_language.h"
2016-12-13 13:32:19 +01:00
#include "swad_role_type.h"
#include "swad_user.h"
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
/************************** Public types and constants ***********************/
/*****************************************************************************/
2017-03-10 02:40:01 +01:00
#define Cty_MAX_CHARS_NAME (48 - 1) // 47
#define Cty_MAX_BYTES_NAME ((Cty_MAX_CHARS_NAME + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 767
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
/***************************** Public prototypes *****************************/
/*****************************************************************************/
void Cty_SeeCtyWithPendingInss (void);
void Cty_ListCountries (void);
void Cty_ListCountries1 (void);
void Cty_ListCountries2 (void);
2015-11-11 21:14:33 +01:00
Usr_Can_t Cty_CheckIfICanEditCountries (void);
2019-12-29 19:07:59 +01:00
void Cty_DrawCountryMapAndNameWithLink (struct Hie_Node *Cty,Act_Action_t Action,
2017-03-04 19:46:46 +01:00
const char *ClassContainer,
const char *ClassMap);
void Cty_DrawCountryMap (const struct Hie_Node *Cty,const char *Class);
bool Cty_CheckIfCountryPhotoExists (const struct Hie_Node *Cty);
2015-11-11 21:14:33 +01:00
2014-12-01 23:55:08 +01:00
void Cty_WriteScriptGoogleGeochart (void);
void Cty_PutParCtyOrder (void);
2014-12-01 23:55:08 +01:00
void Cty_EditCountries (void);
2020-01-07 22:07:06 +01:00
void Cty_GetBasicListOfCountries (void);
2015-07-25 20:20:07 +02:00
void Cty_WriteSelectorOfCountry (void);
void Cty_WriteCountryName (long CtyCod);
bool Cty_GetCountrDataByCod (struct Hie_Node *Node);
void Cty_GetNamesAndWWWsByCod (struct Hie_Node *Cty,
char NameInSeveralLanguages[1 + Lan_NUM_LANGUAGES][Cty_MAX_BYTES_NAME + 1],
char WWWInSeveralLanguages [1 + Lan_NUM_LANGUAGES][WWW_MAX_BYTES_WWW + 1]);
2017-06-20 14:43:26 +02:00
void Cty_FlushCacheCountryName (void);
void Cty_GetCountryNameInLanguage (long CtyCod,Lan_Language_t Language,
char CtyName[Cty_MAX_BYTES_NAME + 1]);
2014-12-01 23:55:08 +01:00
void Cty_RemoveCountry (void);
void Cty_RenameCountry (void);
void Cty_ChangeCtyWWW (void);
2019-04-08 21:10:12 +02:00
void Cty_ContEditAfterChgCty (void);
void Cty_ReceiveNewCountry (void);
2014-12-01 23:55:08 +01:00
unsigned Cty_GetCachedNumCtysWithUsrs (Rol_Role_t Role);
2014-12-01 23:55:08 +01:00
2018-10-30 14:47:31 +01:00
void Cty_ListCtysFound (MYSQL_RES **mysql_res,unsigned NumCtys);
2017-02-28 00:59:01 +01:00
void Cty_FlushCacheNumUsrsWhoDontClaimToBelongToAnyCty (void);
unsigned Cty_GetCachedNumUsrsWhoDontClaimToBelongToAnyCty (void);
unsigned Cty_GetNumUsrsWhoDontClaimToBelongToAnyCty (void);
void Cty_FlushCacheNumUsrsWhoClaimToBelongToAnotherCty (void);
unsigned Cty_GetCachedNumUsrsWhoClaimToBelongToAnotherCty (void);
unsigned Cty_GetNumUsrsWhoClaimToBelongToAnotherCty (void);
2014-12-01 23:55:08 +01:00
#endif