Version 23.33.1: Oct 10, 2023 Code refactoring in short and full names. Not finished.

This commit is contained in:
acanas 2023-10-10 10:51:21 +02:00
parent 02b841f014
commit 429668a241
60 changed files with 728 additions and 709 deletions

View File

@ -872,8 +872,8 @@ int swad__loginBySessionKey (struct soap *soap,
loginBySessionKeyOut->userSurname2 = soap_malloc (soap,Usr_MAX_BYTES_FIRSTNAME_OR_SURNAME + 1); loginBySessionKeyOut->userSurname2 = soap_malloc (soap,Usr_MAX_BYTES_FIRSTNAME_OR_SURNAME + 1);
loginBySessionKeyOut->userPhoto = soap_malloc (soap,Cns_MAX_BYTES_WWW + 1); loginBySessionKeyOut->userPhoto = soap_malloc (soap,Cns_MAX_BYTES_WWW + 1);
loginBySessionKeyOut->userBirthday = soap_malloc (soap,Dat_LENGTH_YYYYMMDD + 1); loginBySessionKeyOut->userBirthday = soap_malloc (soap,Dat_LENGTH_YYYYMMDD + 1);
loginBySessionKeyOut->degreeName = soap_malloc (soap,Cns_MAX_BYTES_FULL_NAME + 1); loginBySessionKeyOut->degreeName = soap_malloc (soap,Nam_MAX_BYTES_FULL_NAME + 1);
loginBySessionKeyOut->courseName = soap_malloc (soap,Cns_MAX_BYTES_FULL_NAME + 1); loginBySessionKeyOut->courseName = soap_malloc (soap,Nam_MAX_BYTES_FULL_NAME + 1);
/***** Default values returned on error *****/ /***** Default values returned on error *****/
loginBySessionKeyOut->userCode = -1; loginBySessionKeyOut->userCode = -1;
@ -916,7 +916,7 @@ int swad__loginBySessionKey (struct soap *soap,
Crs_GetCourseDataByCod (&Gbl.Hierarchy.Node[Hie_CRS]); Crs_GetCourseDataByCod (&Gbl.Hierarchy.Node[Hie_CRS]);
loginBySessionKeyOut->courseCode = (int) Gbl.Hierarchy.Node[Hie_CRS].HieCod; loginBySessionKeyOut->courseCode = (int) Gbl.Hierarchy.Node[Hie_CRS].HieCod;
Str_Copy (loginBySessionKeyOut->courseName,Gbl.Hierarchy.Node[Hie_CRS].FullName, Str_Copy (loginBySessionKeyOut->courseName,Gbl.Hierarchy.Node[Hie_CRS].FullName,
Cns_MAX_BYTES_FULL_NAME); Nam_MAX_BYTES_FULL_NAME);
/***** Get user code (row[0]) *****/ /***** Get user code (row[0]) *****/
Gbl.Usrs.Me.UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0]); Gbl.Usrs.Me.UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0]);
@ -927,7 +927,7 @@ int swad__loginBySessionKey (struct soap *soap,
Deg_GetDegreeDataByCod (&Gbl.Hierarchy.Node[Hie_DEG]); Deg_GetDegreeDataByCod (&Gbl.Hierarchy.Node[Hie_DEG]);
loginBySessionKeyOut->degreeCode = (int) Gbl.Hierarchy.Node[Hie_DEG].HieCod; loginBySessionKeyOut->degreeCode = (int) Gbl.Hierarchy.Node[Hie_DEG].HieCod;
Str_Copy (loginBySessionKeyOut->degreeName,Gbl.Hierarchy.Node[Hie_DEG].FullName, Str_Copy (loginBySessionKeyOut->degreeName,Gbl.Hierarchy.Node[Hie_DEG].FullName,
Cns_MAX_BYTES_FULL_NAME); Nam_MAX_BYTES_FULL_NAME);
} }
else else
UsrFound = false; UsrFound = false;
@ -1155,13 +1155,13 @@ int swad__getCourses (struct soap *soap,
/* Get course short name (row[1]) /* Get course short name (row[1])
and course full name (row[2]) */ and course full name (row[2]) */
getCoursesOut->coursesArray.__ptr[NumCrs].courseShortName = getCoursesOut->coursesArray.__ptr[NumCrs].courseShortName =
soap_malloc (soap,Cns_MAX_BYTES_SHRT_NAME + 1); soap_malloc (soap,Nam_MAX_BYTES_SHRT_NAME + 1);
getCoursesOut->coursesArray.__ptr[NumCrs].courseFullName = getCoursesOut->coursesArray.__ptr[NumCrs].courseFullName =
soap_malloc (soap,Cns_MAX_BYTES_FULL_NAME + 1); soap_malloc (soap,Nam_MAX_BYTES_FULL_NAME + 1);
Str_Copy (getCoursesOut->coursesArray.__ptr[NumCrs].courseShortName, Str_Copy (getCoursesOut->coursesArray.__ptr[NumCrs].courseShortName,
row[1],Cns_MAX_BYTES_SHRT_NAME); row[1],Nam_MAX_BYTES_SHRT_NAME);
Str_Copy (getCoursesOut->coursesArray.__ptr[NumCrs].courseFullName, Str_Copy (getCoursesOut->coursesArray.__ptr[NumCrs].courseFullName,
row[2],Cns_MAX_BYTES_FULL_NAME); row[2],Nam_MAX_BYTES_FULL_NAME);
/* Get role (row[3]) */ /* Get role (row[3]) */
if (sscanf (row[3],"%u",&Role) != 1) // Role in this course if (sscanf (row[3],"%u",&Role) != 1) // Role in this course

View File

@ -98,7 +98,7 @@ static void Ban_ShowOrHideBanner (struct Ban_Banner *Ban,
HidVis_HiddenOrVisible_t HiddenOrVisible); HidVis_HiddenOrVisible_t HiddenOrVisible);
static void Ban_RenameBanner (struct Ban_Banner *Ban, static void Ban_RenameBanner (struct Ban_Banner *Ban,
Cns_ShrtOrFullName_t ShrtOrFullName); Nam_ShrtOrFullName_t ShrtOrFullName);
static void Ban_PutFormToCreateBanner (const struct Ban_Banner *Ban); static void Ban_PutFormToCreateBanner (const struct Ban_Banner *Ban);
static void Ban_PutHeadBanners (void); static void Ban_PutHeadBanners (void);
@ -389,15 +389,15 @@ static void Ban_ListBannersForEdition (struct Ban_Banners *Banners)
[HidVis_HIDDEN ] = ActUnhBan, // Hidden ==> action to unhide [HidVis_HIDDEN ] = ActUnhBan, // Hidden ==> action to unhide
[HidVis_VISIBLE] = ActHidBan, // Visible ==> action to hide [HidVis_VISIBLE] = ActHidBan, // Visible ==> action to hide
}; };
static Act_Action_t ActionRename[Cns_NUM_SHRT_FULL_NAMES] = static Act_Action_t ActionRename[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = ActRenBanSho, [Nam_SHRT_NAME] = ActRenBanSho,
[Cns_FULL_NAME] = ActRenBanFul, [Nam_FULL_NAME] = ActRenBanFul,
}; };
unsigned NumBan; unsigned NumBan;
struct Ban_Banner *Ban; struct Ban_Banner *Ban;
char *Anchor = NULL; char *Anchor = NULL;
const char *Names[Cns_NUM_SHRT_FULL_NAMES]; const char *Names[Nam_NUM_SHRT_FULL_NAMES];
/***** Begin table *****/ /***** Begin table *****/
HTM_TABLE_BeginWidePadding (2); HTM_TABLE_BeginWidePadding (2);
@ -444,9 +444,9 @@ static void Ban_ListBannersForEdition (struct Ban_Banners *Banners)
HTM_TD_End (); HTM_TD_End ();
/* Banner short name and full name */ /* Banner short name and full name */
Names[Cns_SHRT_NAME] = Ban->ShrtName; Names[Nam_SHRT_NAME] = Ban->ShrtName;
Names[Cns_FULL_NAME] = Ban->FullName; Names[Nam_FULL_NAME] = Ban->FullName;
Frm_ExistingShortAndFullNames (ActionRename, Nam_ExistingShortAndFullNames (ActionRename,
ParCod_Ban,Banners->BanCodToEdit, ParCod_Ban,Banners->BanCodToEdit,
Names, Names,
true); // Put form true); // Put form
@ -580,7 +580,7 @@ void Ban_RenameBannerShort (void)
Ban_ResetBanner (Ban); Ban_ResetBanner (Ban);
/***** Rename banner *****/ /***** Rename banner *****/
Ban_RenameBanner (Ban,Cns_SHRT_NAME); Ban_RenameBanner (Ban,Nam_SHRT_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -595,7 +595,7 @@ void Ban_RenameBannerFull (void)
Ban_ResetBanner (Ban); Ban_ResetBanner (Ban);
/***** Rename banner *****/ /***** Rename banner *****/
Ban_RenameBanner (Ban,Cns_FULL_NAME); Ban_RenameBanner (Ban,Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -603,27 +603,27 @@ void Ban_RenameBannerFull (void)
/*****************************************************************************/ /*****************************************************************************/
static void Ban_RenameBanner (struct Ban_Banner *Ban, static void Ban_RenameBanner (struct Ban_Banner *Ban,
Cns_ShrtOrFullName_t ShrtOrFullName) Nam_ShrtOrFullName_t ShrtOrFullName)
{ {
extern const char *Cns_ParShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ParShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern unsigned Cns_MaxBytesShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern unsigned Nam_MaxBytesShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_banner_X_already_exists; extern const char *Txt_X_already_exists;
extern const char *Txt_The_banner_X_has_been_renamed_as_Y; extern const char *Txt_The_banner_X_has_been_renamed_as_Y;
extern const char *Txt_The_name_X_has_not_changed; extern const char *Txt_The_name_X_has_not_changed;
char *CurrentName[Cns_NUM_SHRT_FULL_NAMES] = char *CurrentName[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Ban->ShrtName, [Nam_SHRT_NAME] = Ban->ShrtName,
[Cns_FULL_NAME] = Ban->FullName, [Nam_FULL_NAME] = Ban->FullName,
}; };
char NewName[Cns_MAX_BYTES_FULL_NAME + 1]; char NewName[Nam_MAX_BYTES_FULL_NAME + 1];
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Get the code of the banner */ /* Get the code of the banner */
Ban->BanCod = ParCod_GetAndCheckPar (ParCod_Ban); Ban->BanCod = ParCod_GetAndCheckPar (ParCod_Ban);
/* Get the new name for the banner */ /* Get the new name for the banner */
Par_GetParShrtOrFullName (ShrtOrFullName,NewName); Nam_GetParShrtOrFullName (ShrtOrFullName,NewName);
/***** Get banner data from the database *****/ /***** Get banner data from the database *****/
Ban_GetBannerDataByCod (Ban); Ban_GetBannerDataByCod (Ban);
@ -638,14 +638,14 @@ static void Ban_RenameBanner (struct Ban_Banner *Ban,
if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names
{ {
/***** If banner was in database... *****/ /***** If banner was in database... *****/
if (Ban_DB_CheckIfBannerNameExists (Cns_ParShrtOrFullName[ShrtOrFullName], if (Ban_DB_CheckIfBannerNameExists (Nam_ParShrtOrFullName[ShrtOrFullName],
NewName,Ban->BanCod)) NewName,Ban->BanCod,
Ale_CreateAlert (Ale_WARNING,NULL, -1L,0)) // Unused
Txt_The_banner_X_already_exists,NewName); Ale_CreateAlert (Ale_WARNING,NULL,Txt_X_already_exists,NewName);
else else
{ {
/* Update the table changing old name by new name */ /* Update the table changing old name by new name */
Ban_DB_UpdateBanName (Ban->BanCod,Cns_FldShrtOrFullName[ShrtOrFullName],NewName); Ban_DB_UpdateBanName (Ban->BanCod,Nam_FldShrtOrFullName[ShrtOrFullName],NewName);
/* Write message to show the change made */ /* Write message to show the change made */
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,
@ -662,7 +662,7 @@ static void Ban_RenameBanner (struct Ban_Banner *Ban,
/***** Update name *****/ /***** Update name *****/
Str_Copy (CurrentName[ShrtOrFullName],NewName, Str_Copy (CurrentName[ShrtOrFullName],NewName,
Cns_MaxBytesShrtOrFullName[ShrtOrFullName]); Nam_MaxBytesShrtOrFullName[ShrtOrFullName]);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -774,10 +774,10 @@ void Ban_ContEditAfterChgBan (void)
static void Ban_PutFormToCreateBanner (const struct Ban_Banner *Ban) static void Ban_PutFormToCreateBanner (const struct Ban_Banner *Ban)
{ {
const char *Names[Cns_NUM_SHRT_FULL_NAMES] = const char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Ban->ShrtName, [Nam_SHRT_NAME] = Ban->ShrtName,
[Cns_FULL_NAME] = Ban->FullName, [Nam_FULL_NAME] = Ban->FullName,
}; };
/***** Begin form to create *****/ /***** Begin form to create *****/
@ -800,7 +800,7 @@ static void Ban_PutFormToCreateBanner (const struct Ban_Banner *Ban)
HTM_TD_Empty (1); HTM_TD_Empty (1);
/* Banner short name and full name */ /* Banner short name and full name */
Frm_NewShortAndFullNames (Names); Nam_NewShortAndFullNames (Names);
/* Banner image */ /* Banner image */
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
@ -860,25 +860,22 @@ static void Ban_PutHeadBanners (void)
void Ban_ReceiveFormNewBanner (void) void Ban_ReceiveFormNewBanner (void)
{ {
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_banner_X_already_exists;
extern const char *Txt_You_must_specify_the_image_of_the_new_banner; extern const char *Txt_You_must_specify_the_image_of_the_new_banner;
extern const char *Txt_You_must_specify_the_web_address; extern const char *Txt_You_must_specify_the_web_address;
extern const char *Txt_Created_new_banner_X; extern const char *Txt_Created_new_banner_X;
struct Ban_Banner *Ban = Ban_GetEditingBanner (); struct Ban_Banner *Ban = Ban_GetEditingBanner ();
Cns_ShrtOrFullName_t ShrtOrFullName; char *Names[Nam_NUM_SHRT_FULL_NAMES] =
bool Exists;
char *Names[Cns_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Ban->ShrtName, [Nam_SHRT_NAME] = Ban->ShrtName,
[Cns_FULL_NAME] = Ban->FullName, [Nam_FULL_NAME] = Ban->FullName,
}; };
/***** Reset banner *****/ /***** Reset banner *****/
Ban_ResetBanner (Ban); Ban_ResetBanner (Ban);
/***** Get parameters from form *****/ /***** Get parameters from form *****/
Par_GetParsShrtAndFullName (Names); Nam_GetParsShrtAndFullName (Names);
Par_GetParText ("Img",Ban->Img,Ban_MAX_BYTES_IMAGE); Par_GetParText ("Img",Ban->Img,Ban_MAX_BYTES_IMAGE);
Par_GetParText ("WWW",Ban->WWW,Cns_MAX_BYTES_WWW); Par_GetParText ("WWW",Ban->WWW,Cns_MAX_BYTES_WWW);
@ -886,18 +883,8 @@ void Ban_ReceiveFormNewBanner (void)
Ban->FullName[0]) // If there's a banner name Ban->FullName[0]) // If there's a banner name
{ {
/***** If name of banner was in database... *****/ /***** If name of banner was in database... *****/
for (ShrtOrFullName = Cns_SHRT_NAME, Exists = false; if (!Nam_CheckIfNameExists (Ban_DB_CheckIfBannerNameExists,Names,-1L,
ShrtOrFullName <= Cns_FULL_NAME && !Exists; -1L,0)) // Unused
ShrtOrFullName++)
if (Ban_DB_CheckIfBannerNameExists (Cns_FldShrtOrFullName[ShrtOrFullName],
Names[ShrtOrFullName],-1L))
{
Ale_CreateAlert (Ale_WARNING,NULL,
Txt_The_banner_X_already_exists,
Names[ShrtOrFullName]);
Exists = true;
}
if (!Exists)
{ {
if (!Ban->Img[0]) if (!Ban->Img[0])
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
@ -909,7 +896,7 @@ void Ban_ReceiveFormNewBanner (void)
{ {
Ban_DB_CreateBanner (Ban); Ban_DB_CreateBanner (Ban);
Ale_CreateAlert (Ale_SUCCESS,Txt_Created_new_banner_X, Ale_CreateAlert (Ale_SUCCESS,Txt_Created_new_banner_X,
Ban->ShrtName); Names[Nam_FULL_NAME]);
} }
} }
} }

View File

@ -42,8 +42,8 @@ struct Ban_Banner
{ {
long BanCod; long BanCod;
HidVis_HiddenOrVisible_t HiddenOrVisible; HidVis_HiddenOrVisible_t HiddenOrVisible;
char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]; char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1];
char FullName[Cns_MAX_BYTES_FULL_NAME + 1]; char FullName[Nam_MAX_BYTES_FULL_NAME + 1];
char Img[Ban_MAX_BYTES_IMAGE + 1]; char Img[Ban_MAX_BYTES_IMAGE + 1];
char WWW[Cns_MAX_BYTES_WWW + 1]; char WWW[Cns_MAX_BYTES_WWW + 1];
}; };

View File

@ -114,7 +114,10 @@ unsigned Ban_DB_GetBannerDataByCod (MYSQL_RES **mysql_res,long BanCod)
/********************* Check if the name of banner exists ********************/ /********************* Check if the name of banner exists ********************/
/*****************************************************************************/ /*****************************************************************************/
bool Ban_DB_CheckIfBannerNameExists (const char *FldName,const char *Name,long BanCod) // bool Ban_DB_CheckIfBannerNameExists (const char *FldName,const char *Name,long BanCod)
bool Ban_DB_CheckIfBannerNameExists (const char *FldName,const char *Name,long Cod,
__attribute__((unused)) long PrtCod,
__attribute__((unused)) unsigned Year)
{ {
return return
DB_QueryEXISTS ("can not check if the name of a banner already existed", DB_QueryEXISTS ("can not check if the name of a banner already existed",
@ -124,7 +127,7 @@ bool Ban_DB_CheckIfBannerNameExists (const char *FldName,const char *Name,long B
" WHERE %s='%s'" " WHERE %s='%s'"
" AND BanCod<>%ld)", " AND BanCod<>%ld)",
FldName,Name, FldName,Name,
BanCod); Cod);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -39,7 +39,9 @@ unsigned Ban_DB_GetAllBanners (MYSQL_RES **mysql_res);
unsigned Ban_DB_GetVisibleBanners (MYSQL_RES **mysql_res); unsigned Ban_DB_GetVisibleBanners (MYSQL_RES **mysql_res);
unsigned Ban_DB_GetRandomBanners (MYSQL_RES **mysql_res); unsigned Ban_DB_GetRandomBanners (MYSQL_RES **mysql_res);
unsigned Ban_DB_GetBannerDataByCod (MYSQL_RES **mysql_res,long BanCod); unsigned Ban_DB_GetBannerDataByCod (MYSQL_RES **mysql_res,long BanCod);
bool Ban_DB_CheckIfBannerNameExists (const char *FldName,const char *Name,long BanCod); bool Ban_DB_CheckIfBannerNameExists (const char *FldName,const char *Name,long Cod,
__attribute__((unused)) long PrtCod,
__attribute__((unused)) unsigned Year);
void Ban_DB_CreateBanner (const struct Ban_Banner *Ban); void Ban_DB_CreateBanner (const struct Ban_Banner *Ban);
void Ban_DB_HideOrUnhideBanner (long BanCod,HidVis_HiddenOrVisible_t HiddenOrVisible); void Ban_DB_HideOrUnhideBanner (long BanCod,HidVis_HiddenOrVisible_t HiddenOrVisible);

View File

@ -5282,7 +5282,7 @@ static void Brw_WriteCurrentClipboard (void)
struct Prj_Project Prj; struct Prj_Project Prj;
struct Usr_Data UsrDat; struct Usr_Data UsrDat;
char TxtClipboardZone[1024 + char TxtClipboardZone[1024 +
Cns_MAX_BYTES_SHRT_NAME + Nam_MAX_BYTES_SHRT_NAME +
Grp_MAX_BYTES_GROUP_TYPE_NAME + Grp_MAX_BYTES_GROUP_TYPE_NAME +
Grp_MAX_BYTES_GROUP_NAME + Grp_MAX_BYTES_GROUP_NAME +
Usr_MAX_BYTES_FULL_NAME + Usr_MAX_BYTES_FULL_NAME +

View File

@ -74,7 +74,7 @@ static void Bld_GetBuildingDataFromRow (MYSQL_RES *mysql_res,
static void Bld_ListBuildingsForEdition (const struct Bld_Buildings *Buildings); static void Bld_ListBuildingsForEdition (const struct Bld_Buildings *Buildings);
static void Bld_PutParBldCod (void *BldCod); static void Bld_PutParBldCod (void *BldCod);
static void Bld_RenameBuilding (Cns_ShrtOrFullName_t ShrtOrFullName); static void Bld_RenameBuilding (Nam_ShrtOrFullName_t ShrtOrFullName);
static void Bld_PutFormToCreateBuilding (void); static void Bld_PutFormToCreateBuilding (void);
static void Bld_PutHeadBuildings (void); static void Bld_PutHeadBuildings (void);
@ -390,15 +390,15 @@ void Bld_FreeListBuildings (struct Bld_Buildings *Buildings)
static void Bld_ListBuildingsForEdition (const struct Bld_Buildings *Buildings) static void Bld_ListBuildingsForEdition (const struct Bld_Buildings *Buildings)
{ {
static Act_Action_t ActionRename[Cns_NUM_SHRT_FULL_NAMES] = static Act_Action_t ActionRename[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = ActRenBldSho, [Nam_SHRT_NAME] = ActRenBldSho,
[Cns_FULL_NAME] = ActRenBldFul, [Nam_FULL_NAME] = ActRenBldFul,
}; };
unsigned NumBld; unsigned NumBld;
struct Bld_Building *Building; struct Bld_Building *Building;
char *Anchor = NULL; char *Anchor = NULL;
const char *Names[Cns_NUM_SHRT_FULL_NAMES]; const char *Names[Nam_NUM_SHRT_FULL_NAMES];
/***** Begin table *****/ /***** Begin table *****/
HTM_TABLE_BeginWidePadding (2); HTM_TABLE_BeginWidePadding (2);
@ -432,9 +432,9 @@ static void Bld_ListBuildingsForEdition (const struct Bld_Buildings *Buildings)
HTM_TD_End (); HTM_TD_End ();
/* Building short name and full name */ /* Building short name and full name */
Names[Cns_SHRT_NAME] = Building->ShrtName; Names[Nam_SHRT_NAME] = Building->ShrtName;
Names[Cns_FULL_NAME] = Building->FullName; Names[Nam_FULL_NAME] = Building->FullName;
Frm_ExistingShortAndFullNames (ActionRename, Nam_ExistingShortAndFullNames (ActionRename,
ParCod_Bld,Building->BldCod, ParCod_Bld,Building->BldCod,
Names, Names,
true); // Put form true); // Put form
@ -506,7 +506,7 @@ void Bld_RenameBuildingShort (void)
Bld_EditingBuildingConstructor (); Bld_EditingBuildingConstructor ();
/***** Rename building *****/ /***** Rename building *****/
Bld_RenameBuilding (Cns_SHRT_NAME); Bld_RenameBuilding (Nam_SHRT_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -519,34 +519,34 @@ void Bld_RenameBuildingFull (void)
Bld_EditingBuildingConstructor (); Bld_EditingBuildingConstructor ();
/***** Rename building *****/ /***** Rename building *****/
Bld_RenameBuilding (Cns_FULL_NAME); Bld_RenameBuilding (Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
/*********************** Change the name of a building ***********************/ /*********************** Change the name of a building ***********************/
/*****************************************************************************/ /*****************************************************************************/
static void Bld_RenameBuilding (Cns_ShrtOrFullName_t ShrtOrFullName) static void Bld_RenameBuilding (Nam_ShrtOrFullName_t ShrtOrFullName)
{ {
extern const char *Cns_ParShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ParShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern unsigned Cns_MaxBytesShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern unsigned Nam_MaxBytesShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_building_X_already_exists; extern const char *Txt_The_building_X_already_exists;
extern const char *Txt_The_building_X_has_been_renamed_as_Y; extern const char *Txt_The_building_X_has_been_renamed_as_Y;
extern const char *Txt_The_name_X_has_not_changed; extern const char *Txt_The_name_X_has_not_changed;
char *CurrentName[Cns_NUM_SHRT_FULL_NAMES] = char *CurrentName[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Bld_EditingBuilding->ShrtName, [Nam_SHRT_NAME] = Bld_EditingBuilding->ShrtName,
[Cns_FULL_NAME] = Bld_EditingBuilding->FullName, [Nam_FULL_NAME] = Bld_EditingBuilding->FullName,
}; };
char NewName[Cns_MAX_BYTES_FULL_NAME + 1]; char NewName[Nam_MAX_BYTES_FULL_NAME + 1];
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Get the code of the building */ /* Get the code of the building */
Bld_EditingBuilding->BldCod = ParCod_GetAndCheckPar (ParCod_Bld); Bld_EditingBuilding->BldCod = ParCod_GetAndCheckPar (ParCod_Bld);
/* Get the new name for the building */ /* Get the new name for the building */
Par_GetParShrtOrFullName (ShrtOrFullName,NewName); Nam_GetParShrtOrFullName (ShrtOrFullName,NewName);
/***** Get from the database the old names of the building *****/ /***** Get from the database the old names of the building *****/
Bld_GetBuildingDataByCod (Bld_EditingBuilding); Bld_GetBuildingDataByCod (Bld_EditingBuilding);
@ -559,7 +559,7 @@ static void Bld_RenameBuilding (Cns_ShrtOrFullName_t ShrtOrFullName)
if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names
{ {
/***** If building was in database... *****/ /***** If building was in database... *****/
if (Bld_DB_CheckIfBuildingNameExists (Cns_ParShrtOrFullName[ShrtOrFullName], if (Bld_DB_CheckIfBuildingNameExists (Nam_ParShrtOrFullName[ShrtOrFullName],
NewName,Bld_EditingBuilding->BldCod)) NewName,Bld_EditingBuilding->BldCod))
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
Txt_The_building_X_already_exists, Txt_The_building_X_already_exists,
@ -568,7 +568,7 @@ static void Bld_RenameBuilding (Cns_ShrtOrFullName_t ShrtOrFullName)
{ {
/* Update the table changing old name by new name */ /* Update the table changing old name by new name */
Bld_DB_UpdateBuildingName (Bld_EditingBuilding->BldCod, Bld_DB_UpdateBuildingName (Bld_EditingBuilding->BldCod,
Cns_FldShrtOrFullName[ShrtOrFullName], Nam_FldShrtOrFullName[ShrtOrFullName],
NewName); NewName);
/* Write message to show the change made */ /* Write message to show the change made */
@ -587,7 +587,7 @@ static void Bld_RenameBuilding (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Update building name *****/ /***** Update building name *****/
Str_Copy (CurrentName[ShrtOrFullName],NewName, Str_Copy (CurrentName[ShrtOrFullName],NewName,
Cns_MaxBytesShrtOrFullName[ShrtOrFullName]); Nam_MaxBytesShrtOrFullName[ShrtOrFullName]);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -598,7 +598,7 @@ void Bld_ChangeBuildingLocation (void)
{ {
extern const char *Txt_The_location_of_the_building_X_has_changed_to_Y; extern const char *Txt_The_location_of_the_building_X_has_changed_to_Y;
extern const char *Txt_The_location_of_the_building_X_has_not_changed; extern const char *Txt_The_location_of_the_building_X_has_not_changed;
char NewLocation[Cns_MAX_BYTES_FULL_NAME + 1]; char NewLocation[Nam_MAX_BYTES_FULL_NAME + 1];
/***** Building constructor *****/ /***** Building constructor *****/
Bld_EditingBuildingConstructor (); Bld_EditingBuildingConstructor ();
@ -655,10 +655,10 @@ void Bld_ContEditAfterChgBuilding (void)
static void Bld_PutFormToCreateBuilding (void) static void Bld_PutFormToCreateBuilding (void)
{ {
const char *Names[Cns_NUM_SHRT_FULL_NAMES] = const char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Bld_EditingBuilding->ShrtName, [Nam_SHRT_NAME] = Bld_EditingBuilding->ShrtName,
[Cns_FULL_NAME] = Bld_EditingBuilding->FullName, [Nam_FULL_NAME] = Bld_EditingBuilding->FullName,
}; };
/***** Begin form to create *****/ /***** Begin form to create *****/
@ -678,7 +678,7 @@ static void Bld_PutFormToCreateBuilding (void)
HTM_TD_End (); HTM_TD_End ();
/***** Building short name and full name *****/ /***** Building short name and full name *****/
Frm_NewShortAndFullNames (Names); Nam_NewShortAndFullNames (Names);
/***** Building location *****/ /***** Building location *****/
HTM_TD_Begin ("class=\"LM\""); HTM_TD_Begin ("class=\"LM\"");
@ -722,15 +722,15 @@ static void Bld_PutHeadBuildings (void)
void Bld_ReceiveFormNewBuilding (void) void Bld_ReceiveFormNewBuilding (void)
{ {
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_building_X_already_exists; extern const char *Txt_The_building_X_already_exists;
extern const char *Txt_Created_new_building_X; extern const char *Txt_Created_new_building_X;
Cns_ShrtOrFullName_t ShrtOrFullName; Nam_ShrtOrFullName_t ShrtOrFullName;
bool Exists; bool Exists;
char *Names[Cns_NUM_SHRT_FULL_NAMES] = char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Bld_EditingBuilding->ShrtName, [Nam_SHRT_NAME] = Bld_EditingBuilding->ShrtName,
[Cns_FULL_NAME] = Bld_EditingBuilding->FullName, [Nam_FULL_NAME] = Bld_EditingBuilding->FullName,
}; };
/***** Building constructor *****/ /***** Building constructor *****/
@ -738,7 +738,7 @@ void Bld_ReceiveFormNewBuilding (void)
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Get building short name and full name */ /* Get building short name and full name */
Par_GetParsShrtAndFullName (Names); Nam_GetParsShrtAndFullName (Names);
/* Get building location */ /* Get building location */
Par_GetParText ("Location",Bld_EditingBuilding->Location,Bld_MAX_BYTES_LOCATION); Par_GetParText ("Location",Bld_EditingBuilding->Location,Bld_MAX_BYTES_LOCATION);
@ -747,10 +747,10 @@ void Bld_ReceiveFormNewBuilding (void)
Bld_EditingBuilding->FullName[0]) // If there's a building name Bld_EditingBuilding->FullName[0]) // If there's a building name
{ {
/***** If name of building was in database... *****/ /***** If name of building was in database... *****/
for (ShrtOrFullName = Cns_SHRT_NAME, Exists = false; for (ShrtOrFullName = Nam_SHRT_NAME, Exists = false;
ShrtOrFullName <= Cns_FULL_NAME && !Exists; ShrtOrFullName <= Nam_FULL_NAME && !Exists;
ShrtOrFullName++) ShrtOrFullName++)
if (Bld_DB_CheckIfBuildingNameExists (Cns_FldShrtOrFullName[ShrtOrFullName], if (Bld_DB_CheckIfBuildingNameExists (Nam_FldShrtOrFullName[ShrtOrFullName],
Names[ShrtOrFullName],-1L)) Names[ShrtOrFullName],-1L))
{ {
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
@ -761,9 +761,8 @@ void Bld_ReceiveFormNewBuilding (void)
if (!Exists) // Add new building to database if (!Exists) // Add new building to database
{ {
Bld_DB_CreateBuilding (Bld_EditingBuilding); Bld_DB_CreateBuilding (Bld_EditingBuilding);
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,Txt_Created_new_building_X,
Txt_Created_new_building_X, Names[Nam_FULL_NAME]);
Bld_EditingBuilding->FullName);
} }
} }
else // If there is not a building name else // If there is not a building name

View File

@ -41,8 +41,8 @@ struct Bld_Building
{ {
long BldCod; long BldCod;
long InsCod; long InsCod;
char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]; char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1];
char FullName[Cns_MAX_BYTES_FULL_NAME + 1]; char FullName[Nam_MAX_BYTES_FULL_NAME + 1];
char Location[Bld_MAX_BYTES_LOCATION + 1]; // Examples: Campus North, City center char Location[Bld_MAX_BYTES_LOCATION + 1]; // Examples: Campus North, City center
}; };

View File

@ -172,7 +172,7 @@ static long Cfe_GetParsCallsForExams (struct Cfe_CallsForExams *CallsForExams)
ExaCod = ParCod_GetPar (ParCod_Exa); ExaCod = ParCod_GetPar (ParCod_Exa);
/***** Get the name of the course (it is allowed to be different from the official name of the course) *****/ /***** Get the name of the course (it is allowed to be different from the official name of the course) *****/
Par_GetParText ("CrsName",CallsForExams->CallForExam.CrsFullName,Cns_MAX_BYTES_FULL_NAME); Par_GetParText ("CrsName",CallsForExams->CallForExam.CrsFullName,Nam_MAX_BYTES_FULL_NAME);
// If the parameter is not present or is empty, initialize the string to the full name of the current course // If the parameter is not present or is empty, initialize the string to the full name of the current course
if (!CallsForExams->CallForExam.CrsFullName[0]) if (!CallsForExams->CallForExam.CrsFullName[0])
Str_Copy (CallsForExams->CallForExam.CrsFullName, Str_Copy (CallsForExams->CallForExam.CrsFullName,
@ -854,7 +854,7 @@ static void Cfe_ShowCallForExam (struct Cfe_CallsForExams *CallsForExams,
Cfe_TypeViewCallForExam_t TypeViewCallForExam, Cfe_TypeViewCallForExam_t TypeViewCallForExam,
bool HighLight) bool HighLight)
{ {
extern unsigned Cns_MaxCharsShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern unsigned Nam_MaxCharsShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Hlp_ASSESSMENT_Calls_for_exams_new_call; extern const char *Hlp_ASSESSMENT_Calls_for_exams_new_call;
extern const char *Hlp_ASSESSMENT_Calls_for_exams_edit_call; extern const char *Hlp_ASSESSMENT_Calls_for_exams_edit_call;
extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE]; extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE];
@ -1002,7 +1002,7 @@ static void Cfe_ShowCallForExam (struct Cfe_CallsForExams *CallsForExams,
HTM_TD_Begin ("class=\"LB DAT_STRONG_%s\"", HTM_TD_Begin ("class=\"LB DAT_STRONG_%s\"",
The_GetSuffix ()); The_GetSuffix ());
if (TypeViewCallForExam == Cfe_FORM_VIEW) if (TypeViewCallForExam == Cfe_FORM_VIEW)
HTM_INPUT_TEXT ("CrsName",Cns_MaxCharsShrtOrFullName[Cns_FULL_NAME], HTM_INPUT_TEXT ("CrsName",Nam_MaxCharsShrtOrFullName[Nam_FULL_NAME],
CallsForExams->CallForExam.CrsFullName, CallsForExams->CallForExam.CrsFullName,
HTM_DONT_SUBMIT_ON_CHANGE, HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"CrsName\" size=\"30\" class=\"INPUT_%s\"", "id=\"CrsName\" size=\"30\" class=\"INPUT_%s\"",

View File

@ -62,7 +62,7 @@ struct Cfe_CallForExam
{ {
long CrsCod; long CrsCod;
Cfe_Status_t Status; Cfe_Status_t Status;
char CrsFullName[Cns_MAX_BYTES_FULL_NAME + 1]; char CrsFullName[Nam_MAX_BYTES_FULL_NAME + 1];
unsigned Year; // Number of year (0 (N.A.), 1, 2, 3, 4, 5, 6) in the degree unsigned Year; // Number of year (0 (N.A.), 1, 2, 3, 4, 5, 6) in the degree
char Session[Cfe_MAX_BYTES_SESSION + 1]; // Exam session is june, september, etc. char Session[Cfe_MAX_BYTES_SESSION + 1]; // Exam session is june, september, etc.
struct Dat_Date CallDate; struct Dat_Date CallDate;

View File

@ -732,10 +732,10 @@ static void Ctr_ListCentersForEdition (const struct Plc_Places *Places)
{ {
extern const char *Txt_Another_place; extern const char *Txt_Another_place;
extern const char *Txt_CENTER_STATUS[Hie_NUM_STATUS_TXT]; extern const char *Txt_CENTER_STATUS[Hie_NUM_STATUS_TXT];
static Act_Action_t ActionRename[Cns_NUM_SHRT_FULL_NAMES] = static Act_Action_t ActionRename[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = ActRenCtrSho, [Nam_SHRT_NAME] = ActRenCtrSho,
[Cns_FULL_NAME] = ActRenCtrFul, [Nam_FULL_NAME] = ActRenCtrFul,
}; };
unsigned NumCtr; unsigned NumCtr;
struct Hie_Node *Ctr; struct Hie_Node *Ctr;
@ -747,7 +747,7 @@ static void Ctr_ListCentersForEdition (const struct Plc_Places *Places)
unsigned NumDegs; unsigned NumDegs;
unsigned NumUsrsCtr; unsigned NumUsrsCtr;
unsigned NumUsrsInCrssOfCtr; unsigned NumUsrsInCrssOfCtr;
const char *Names[Cns_NUM_SHRT_FULL_NAMES]; const char *Names[Nam_NUM_SHRT_FULL_NAMES];
/***** Initialize structure with user's data *****/ /***** Initialize structure with user's data *****/
Usr_UsrDataConstructor (&UsrDat); Usr_UsrDataConstructor (&UsrDat);
@ -840,9 +840,9 @@ static void Ctr_ListCentersForEdition (const struct Plc_Places *Places)
HTM_TD_End (); HTM_TD_End ();
/* Center short name and full name */ /* Center short name and full name */
Names[Cns_SHRT_NAME] = Ctr->ShrtName; Names[Nam_SHRT_NAME] = Ctr->ShrtName;
Names[Cns_FULL_NAME] = Ctr->FullName; Names[Nam_FULL_NAME] = Ctr->FullName;
Frm_ExistingShortAndFullNames (ActionRename, Nam_ExistingShortAndFullNames (ActionRename,
ParCod_OthHie,Ctr->HieCod, ParCod_OthHie,Ctr->HieCod,
Names, Names,
ICanEdit); // Put form? ICanEdit); // Put form?
@ -1042,7 +1042,7 @@ void Ctr_RenameCenterShort (void)
/***** Rename center *****/ /***** Rename center *****/
Ctr_EditingCtr->HieCod = ParCod_GetAndCheckPar (ParCod_OthHie); Ctr_EditingCtr->HieCod = ParCod_GetAndCheckPar (ParCod_OthHie);
Ctr_RenameCenter (Ctr_EditingCtr,Cns_SHRT_NAME); Ctr_RenameCenter (Ctr_EditingCtr,Nam_SHRT_NAME);
} }
void Ctr_RenameCenterFull (void) void Ctr_RenameCenterFull (void)
@ -1052,31 +1052,31 @@ void Ctr_RenameCenterFull (void)
/***** Rename center *****/ /***** Rename center *****/
Ctr_EditingCtr->HieCod = ParCod_GetAndCheckPar (ParCod_OthHie); Ctr_EditingCtr->HieCod = ParCod_GetAndCheckPar (ParCod_OthHie);
Ctr_RenameCenter (Ctr_EditingCtr,Cns_FULL_NAME); Ctr_RenameCenter (Ctr_EditingCtr,Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
/************************ Change the name of a center ************************/ /************************ Change the name of a center ************************/
/*****************************************************************************/ /*****************************************************************************/
void Ctr_RenameCenter (struct Hie_Node *Ctr,Cns_ShrtOrFullName_t ShrtOrFullName) void Ctr_RenameCenter (struct Hie_Node *Ctr,Nam_ShrtOrFullName_t ShrtOrFullName)
{ {
extern const char *Cns_ParShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ParShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern unsigned Cns_MaxBytesShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern unsigned Nam_MaxBytesShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_center_X_already_exists; extern const char *Txt_The_center_X_already_exists;
extern const char *Txt_The_center_X_has_been_renamed_as_Y; extern const char *Txt_The_center_X_has_been_renamed_as_Y;
extern const char *Txt_The_name_X_has_not_changed; extern const char *Txt_The_name_X_has_not_changed;
char *CurrentName[Cns_NUM_SHRT_FULL_NAMES] = char *CurrentName[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Ctr->ShrtName, [Nam_SHRT_NAME] = Ctr->ShrtName,
[Cns_FULL_NAME] = Ctr->FullName, [Nam_FULL_NAME] = Ctr->FullName,
}; };
char NewName[Cns_MAX_BYTES_FULL_NAME + 1]; char NewName[Nam_MAX_BYTES_FULL_NAME + 1];
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Get the new name for the center */ /* Get the new name for the center */
Par_GetParShrtOrFullName (ShrtOrFullName,NewName); Nam_GetParShrtOrFullName (ShrtOrFullName,NewName);
/***** Get from the database the old names of the center *****/ /***** Get from the database the old names of the center *****/
Ctr_GetCenterDataByCod (Ctr); Ctr_GetCenterDataByCod (Ctr);
@ -1091,7 +1091,7 @@ void Ctr_RenameCenter (struct Hie_Node *Ctr,Cns_ShrtOrFullName_t ShrtOrFullName)
if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names
{ {
/***** If degree was in database... *****/ /***** If degree was in database... *****/
if (Ctr_DB_CheckIfCtrNameExistsInIns (Cns_ParShrtOrFullName[ShrtOrFullName], if (Ctr_DB_CheckIfCtrNameExistsInIns (Nam_ParShrtOrFullName[ShrtOrFullName],
NewName,Ctr->HieCod, NewName,Ctr->HieCod,
Gbl.Hierarchy.Node[Hie_INS].HieCod)) Gbl.Hierarchy.Node[Hie_INS].HieCod))
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
@ -1101,7 +1101,7 @@ void Ctr_RenameCenter (struct Hie_Node *Ctr,Cns_ShrtOrFullName_t ShrtOrFullName)
{ {
/* Update the table changing old name by new name */ /* Update the table changing old name by new name */
Ctr_DB_UpdateCtrName (Ctr->HieCod, Ctr_DB_UpdateCtrName (Ctr->HieCod,
Cns_FldShrtOrFullName[ShrtOrFullName],NewName); Nam_FldShrtOrFullName[ShrtOrFullName],NewName);
/* Write message to show the change made */ /* Write message to show the change made */
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,
@ -1110,7 +1110,7 @@ void Ctr_RenameCenter (struct Hie_Node *Ctr,Cns_ShrtOrFullName_t ShrtOrFullName)
/* Change current center name in order to display it properly */ /* Change current center name in order to display it properly */
Str_Copy (CurrentName[ShrtOrFullName],NewName, Str_Copy (CurrentName[ShrtOrFullName],NewName,
Cns_MaxBytesShrtOrFullName[ShrtOrFullName]); Nam_MaxBytesShrtOrFullName[ShrtOrFullName]);
} }
} }
else // The same name else // The same name
@ -1240,10 +1240,10 @@ static void Ctr_PutFormToCreateCenter (const struct Plc_Places *Places)
Act_Action_t NextAction = ActUnk; Act_Action_t NextAction = ActUnk;
unsigned NumPlc; unsigned NumPlc;
const struct Plc_Place *Plc; const struct Plc_Place *Plc;
const char *Names[Cns_NUM_SHRT_FULL_NAMES] = const char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Ctr_EditingCtr->ShrtName, [Nam_SHRT_NAME] = Ctr_EditingCtr->ShrtName,
[Cns_FULL_NAME] = Ctr_EditingCtr->FullName, [Nam_FULL_NAME] = Ctr_EditingCtr->FullName,
}; };
/***** Set action depending on role *****/ /***** Set action depending on role *****/
@ -1303,7 +1303,7 @@ static void Ctr_PutFormToCreateCenter (const struct Plc_Places *Places)
HTM_TD_End (); HTM_TD_End ();
/***** Center short name and full name *****/ /***** Center short name and full name *****/
Frm_NewShortAndFullNames (Names); Nam_NewShortAndFullNames (Names);
/***** Center WWW *****/ /***** Center WWW *****/
HTM_TD_Begin ("class=\"LM\""); HTM_TD_Begin ("class=\"LM\"");
@ -1475,14 +1475,14 @@ void Ctr_ReceiveFormNewCtr (void)
static void Ctr_ReceiveFormRequestOrCreateCtr (Hie_Status_t Status) static void Ctr_ReceiveFormRequestOrCreateCtr (Hie_Status_t Status)
{ {
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_center_X_already_exists; extern const char *Txt_The_center_X_already_exists;
extern const char *Txt_Created_new_center_X; extern const char *Txt_Created_new_center_X;
Cns_ShrtOrFullName_t ShrtOrFullName; Nam_ShrtOrFullName_t ShrtOrFullName;
char *Names[Cns_NUM_SHRT_FULL_NAMES] = char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Ctr_EditingCtr->ShrtName, [Nam_SHRT_NAME] = Ctr_EditingCtr->ShrtName,
[Cns_FULL_NAME] = Ctr_EditingCtr->FullName, [Nam_FULL_NAME] = Ctr_EditingCtr->FullName,
}; };
bool Exists; bool Exists;
@ -1494,7 +1494,7 @@ static void Ctr_ReceiveFormRequestOrCreateCtr (Hie_Status_t Status)
Ctr_EditingCtr->Specific.PlcCod = ParCod_GetAndCheckParMin (ParCod_Plc,0); // 0 (another place) is allowed here Ctr_EditingCtr->Specific.PlcCod = ParCod_GetAndCheckParMin (ParCod_Plc,0); // 0 (another place) is allowed here
/* Get center short name and full name */ /* Get center short name and full name */
Par_GetParsShrtAndFullName (Names); Nam_GetParsShrtAndFullName (Names);
/* Get center WWW */ /* Get center WWW */
Par_GetParText ("WWW",Ctr_EditingCtr->WWW,Cns_MAX_BYTES_WWW); Par_GetParText ("WWW",Ctr_EditingCtr->WWW,Cns_MAX_BYTES_WWW);
@ -1505,10 +1505,10 @@ static void Ctr_ReceiveFormRequestOrCreateCtr (Hie_Status_t Status)
if (Ctr_EditingCtr->WWW[0]) if (Ctr_EditingCtr->WWW[0])
{ {
/***** If name of center was in database... *****/ /***** If name of center was in database... *****/
for (ShrtOrFullName = Cns_SHRT_NAME, Exists = false; for (ShrtOrFullName = Nam_SHRT_NAME, Exists = false;
ShrtOrFullName <= Cns_FULL_NAME && !Exists; ShrtOrFullName <= Nam_FULL_NAME && !Exists;
ShrtOrFullName++) ShrtOrFullName++)
if (Ctr_DB_CheckIfCtrNameExistsInIns (Cns_FldShrtOrFullName[ShrtOrFullName], if (Ctr_DB_CheckIfCtrNameExistsInIns (Nam_FldShrtOrFullName[ShrtOrFullName],
Names[ShrtOrFullName],-1L, Names[ShrtOrFullName],-1L,
Gbl.Hierarchy.Node[Hie_INS].HieCod)) Gbl.Hierarchy.Node[Hie_INS].HieCod))
{ {
@ -1520,9 +1520,8 @@ static void Ctr_ReceiveFormRequestOrCreateCtr (Hie_Status_t Status)
if (!Exists) // Add new center to database if (!Exists) // Add new center to database
{ {
Ctr_EditingCtr->HieCod = Ctr_DB_CreateCenter (Ctr_EditingCtr,Status); Ctr_EditingCtr->HieCod = Ctr_DB_CreateCenter (Ctr_EditingCtr,Status);
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,Txt_Created_new_center_X,
Txt_Created_new_center_X, Names[Nam_FULL_NAME]);
Ctr_EditingCtr->FullName);
} }
} }
else // If there is not a web else // If there is not a web

View File

@ -57,7 +57,7 @@ void Ctr_RemoveCenter (void);
void Ctr_ChangeCtrPlc (void); void Ctr_ChangeCtrPlc (void);
void Ctr_RenameCenterShort (void); void Ctr_RenameCenterShort (void);
void Ctr_RenameCenterFull (void); void Ctr_RenameCenterFull (void);
void Ctr_RenameCenter (struct Hie_Node *Ctr,Cns_ShrtOrFullName_t ShrtOrFullName); void Ctr_RenameCenter (struct Hie_Node *Ctr,Nam_ShrtOrFullName_t ShrtOrFullName);
void Ctr_ChangeCtrWWW (void); void Ctr_ChangeCtrWWW (void);
void Ctr_ChangeCtrStatus (void); void Ctr_ChangeCtrStatus (void);
void Ctr_ContEditAfterChgCtr (void); void Ctr_ContEditAfterChgCtr (void);

View File

@ -611,7 +611,7 @@ static void CtrCfg_Institution (bool PrintView,bool PutForm)
static void CtrCfg_FullName (bool PutForm) static void CtrCfg_FullName (bool PutForm)
{ {
HieCfg_Name (PutForm,Hie_CTR,Cns_FULL_NAME); HieCfg_Name (PutForm,Hie_CTR,Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -620,7 +620,7 @@ static void CtrCfg_FullName (bool PutForm)
static void CtrCfg_ShrtName (bool PutForm) static void CtrCfg_ShrtName (bool PutForm)
{ {
HieCfg_Name (PutForm,Hie_CTR,Cns_SHRT_NAME); HieCfg_Name (PutForm,Hie_CTR,Nam_SHRT_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1015,16 +1015,16 @@ void CtrCfg_ChangeCtrPhotoAttr (void)
void CtrCfg_ChangeCtrIns (void) void CtrCfg_ChangeCtrIns (void)
{ {
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_center_X_already_exists; extern const char *Txt_The_center_X_already_exists;
extern const char *Txt_The_center_X_has_been_moved_to_the_institution_Y; extern const char *Txt_The_center_X_has_been_moved_to_the_institution_Y;
struct Hie_Node NewIns; struct Hie_Node NewIns;
Cns_ShrtOrFullName_t ShrtOrFullName; Nam_ShrtOrFullName_t ShrtOrFullName;
bool Exists; bool Exists;
char *Name[Cns_NUM_SHRT_FULL_NAMES] = char *Name[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Gbl.Hierarchy.Node[Hie_CTR].ShrtName, [Nam_SHRT_NAME] = Gbl.Hierarchy.Node[Hie_CTR].ShrtName,
[Cns_FULL_NAME] = Gbl.Hierarchy.Node[Hie_CTR].FullName, [Nam_FULL_NAME] = Gbl.Hierarchy.Node[Hie_CTR].FullName,
}; };
/***** Get parameter with institution code *****/ /***** Get parameter with institution code *****/
@ -1037,10 +1037,10 @@ void CtrCfg_ChangeCtrIns (void)
Ins_GetInstitDataByCod (&NewIns); Ins_GetInstitDataByCod (&NewIns);
/***** Check if it already exists a center with the same name in the new institution *****/ /***** Check if it already exists a center with the same name in the new institution *****/
for (ShrtOrFullName = Cns_SHRT_NAME, Exists = false; for (ShrtOrFullName = Nam_SHRT_NAME, Exists = false;
ShrtOrFullName <= Cns_FULL_NAME && !Exists; ShrtOrFullName <= Nam_FULL_NAME && !Exists;
ShrtOrFullName++) ShrtOrFullName++)
if (Ctr_DB_CheckIfCtrNameExistsInIns (Cns_FldShrtOrFullName[ShrtOrFullName], if (Ctr_DB_CheckIfCtrNameExistsInIns (Nam_FldShrtOrFullName[ShrtOrFullName],
Name[ShrtOrFullName], Name[ShrtOrFullName],
Gbl.Hierarchy.Node[Hie_CTR].HieCod, Gbl.Hierarchy.Node[Hie_CTR].HieCod,
NewIns.HieCod)) NewIns.HieCod))
@ -1097,12 +1097,12 @@ void CtrCfg_ChangeCtrPlc (void)
void CtrCfg_RenameCenterShort (void) void CtrCfg_RenameCenterShort (void)
{ {
Ctr_RenameCenter (&Gbl.Hierarchy.Node[Hie_CTR],Cns_SHRT_NAME); Ctr_RenameCenter (&Gbl.Hierarchy.Node[Hie_CTR],Nam_SHRT_NAME);
} }
void CtrCfg_RenameCenterFull (void) void CtrCfg_RenameCenterFull (void)
{ {
Ctr_RenameCenter (&Gbl.Hierarchy.Node[Hie_CTR],Cns_FULL_NAME); Ctr_RenameCenter (&Gbl.Hierarchy.Node[Hie_CTR],Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -260,7 +260,7 @@ long Ctr_DB_GetInsCodOfCenterByCod (long CtrCod)
/*************** Get the short name of a center from its code ****************/ /*************** Get the short name of a center from its code ****************/
/*****************************************************************************/ /*****************************************************************************/
void Ctr_DB_GetShortNameOfCenterByCod (long CtrCod,char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]) void Ctr_DB_GetShortNameOfCenterByCod (long CtrCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1])
{ {
/***** Trivial check: center code should be > 0 *****/ /***** Trivial check: center code should be > 0 *****/
if (CtrCod <= 0) if (CtrCod <= 0)
@ -270,7 +270,7 @@ void Ctr_DB_GetShortNameOfCenterByCod (long CtrCod,char ShrtName[Cns_MAX_BYTES_S
} }
/***** Get the short name of a center from database *****/ /***** Get the short name of a center from database *****/
DB_QuerySELECTString (ShrtName,Cns_MAX_BYTES_SHRT_NAME, DB_QuerySELECTString (ShrtName,Nam_MAX_BYTES_SHRT_NAME,
"can not get the short name of a center", "can not get the short name of a center",
"SELECT ShortName" "SELECT ShortName"
" FROM ctr_centers" " FROM ctr_centers"

View File

@ -48,7 +48,7 @@ unsigned Ctr_DB_GetCtrsWithPendingDegs (MYSQL_RES **mysql_res);
unsigned Ctr_DB_GetCenterDataByCod (MYSQL_RES **mysql_res,long CtrCod); unsigned Ctr_DB_GetCenterDataByCod (MYSQL_RES **mysql_res,long CtrCod);
unsigned Ctr_DB_GetCoordByCod (MYSQL_RES **mysql_res,long CtrCod); unsigned Ctr_DB_GetCoordByCod (MYSQL_RES **mysql_res,long CtrCod);
long Ctr_DB_GetInsCodOfCenterByCod (long CtrCod); long Ctr_DB_GetInsCodOfCenterByCod (long CtrCod);
void Ctr_DB_GetShortNameOfCenterByCod (long CtrCod,char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]); void Ctr_DB_GetShortNameOfCenterByCod (long CtrCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1]);
unsigned Ctr_DB_GetPhotoAttribution (MYSQL_RES **mysql_res,long CtrCod); unsigned Ctr_DB_GetPhotoAttribution (MYSQL_RES **mysql_res,long CtrCod);
bool Ctr_DB_CheckIfCtrNameExistsInIns (const char *FldName,const char *Name, bool Ctr_DB_CheckIfCtrNameExistsInIns (const char *FldName,const char *Name,
long CtrCod,long InsCod); long CtrCod,long InsCod);

View File

@ -632,10 +632,14 @@ TODO: Francisco Javier Fern
Me sale este error, no si por no recordar yo la sintaxis apropiada para mandar a varios destinatarios. ¿No era así? Me sale este error, no si por no recordar yo la sintaxis apropiada para mandar a varios destinatarios. ¿No era así?
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod') "can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
*/ */
#define Log_PLATFORM_VERSION "SWAD 23.33 (2023-10-10)"
#define Log_PLATFORM_VERSION "SWAD 23.33.1 (2023-10-10)"
#define CSS_FILE "swad23.25.2.css" #define CSS_FILE "swad23.25.2.css"
#define JS_FILE "swad22.49.js" #define JS_FILE "swad22.49.js"
/* /*
// TODO: Donde aparezca Txt_X_already_exists cambiar por la función nueva Nam_...
Version 23.33.1: Oct 10, 2023 Code refactoring in short and full names. Not finished. (335930 lines)
Version 23.33: Oct 10, 2023 Code refactoring in short and full names. (335919 lines) Version 23.33: Oct 10, 2023 Code refactoring in short and full names. (335919 lines)
Version 23.32: Oct 10, 2023 Code refactoring in short and full names. (336110 lines) Version 23.32: Oct 10, 2023 Code refactoring in short and full names. (336110 lines)
Version 23.31: Oct 10, 2023 Code refactoring in short and full names. (336169 lines) Version 23.31: Oct 10, 2023 Code refactoring in short and full names. (336169 lines)

View File

@ -301,7 +301,7 @@ void Con_ShowConnectedUsrsBelongingToCurrentCrs (void)
{ {
extern const char *Txt_Connected_users; extern const char *Txt_Connected_users;
extern const char *Txt_from; extern const char *Txt_from;
char CourseName[Cns_MAX_BYTES_SHRT_NAME + 1]; char CourseName[Nam_MAX_BYTES_SHRT_NAME + 1];
struct Con_ConnectedUsrs Usrs; struct Con_ConnectedUsrs Usrs;
/***** Trivial check *****/ /***** Trivial check *****/

View File

@ -31,30 +31,30 @@
/***************************** Public constants ******************************/ /***************************** Public constants ******************************/
/*****************************************************************************/ /*****************************************************************************/
const char *Cns_ParShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES] = const char *Nam_ParShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = "ShortName", [Nam_SHRT_NAME] = "ShortName",
[Cns_FULL_NAME] = "FullName", [Nam_FULL_NAME] = "FullName",
}; };
const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES] = const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = "ShortName", [Nam_SHRT_NAME] = "ShortName",
[Cns_FULL_NAME] = "FullName", [Nam_FULL_NAME] = "FullName",
}; };
unsigned Cns_MaxCharsShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES] = unsigned Nam_MaxCharsShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Cns_MAX_CHARS_SHRT_NAME, [Nam_SHRT_NAME] = Nam_MAX_CHARS_SHRT_NAME,
[Cns_FULL_NAME] = Cns_MAX_CHARS_FULL_NAME, [Nam_FULL_NAME] = Nam_MAX_CHARS_FULL_NAME,
}; };
unsigned Cns_MaxBytesShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES] = unsigned Nam_MaxBytesShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Cns_MAX_BYTES_SHRT_NAME, [Nam_SHRT_NAME] = Nam_MAX_BYTES_SHRT_NAME,
[Cns_FULL_NAME] = Cns_MAX_BYTES_FULL_NAME, [Nam_FULL_NAME] = Nam_MAX_BYTES_FULL_NAME,
}; };
const char *Cns_ClassShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES] = const char *Nam_ClassShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = "INPUT_SHORT_NAME", [Nam_SHRT_NAME] = "INPUT_SHORT_NAME",
[Cns_FULL_NAME] = "INPUT_FULL_NAME", [Nam_FULL_NAME] = "INPUT_FULL_NAME",
}; };
/*****************************************************************************/ /*****************************************************************************/

View File

@ -33,11 +33,11 @@
/***************************** Public constants ******************************/ /***************************** Public constants ******************************/
/*****************************************************************************/ /*****************************************************************************/
#define Cns_MAX_CHARS_SHRT_NAME (32 - 1) // 31 #define Nam_MAX_CHARS_SHRT_NAME (32 - 1) // 31
#define Cns_MAX_BYTES_SHRT_NAME ((Cns_MAX_CHARS_SHRT_NAME + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 511 #define Nam_MAX_BYTES_SHRT_NAME ((Nam_MAX_CHARS_SHRT_NAME + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 511
#define Cns_MAX_CHARS_FULL_NAME (128 - 1) // 127 #define Nam_MAX_CHARS_FULL_NAME (128 - 1) // 127
#define Cns_MAX_BYTES_FULL_NAME ((Cns_MAX_CHARS_FULL_NAME + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047 #define Nam_MAX_BYTES_FULL_NAME ((Nam_MAX_CHARS_FULL_NAME + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
#define Cns_MAX_CHARS_WWW (256 - 1) // 255: max. number of chars of a URL #define Cns_MAX_CHARS_WWW (256 - 1) // 255: max. number of chars of a URL
#define Cns_MAX_BYTES_WWW Cns_MAX_CHARS_WWW // 255 #define Cns_MAX_BYTES_WWW Cns_MAX_CHARS_WWW // 255
@ -112,12 +112,12 @@ typedef enum
} Cns_QuietOrVerbose_t; } Cns_QuietOrVerbose_t;
// Related with names of centers, degrees, courses,... // Related with names of centers, degrees, courses,...
#define Cns_NUM_SHRT_FULL_NAMES 2 #define Nam_NUM_SHRT_FULL_NAMES 2
typedef enum typedef enum
{ {
Cns_SHRT_NAME, Nam_SHRT_NAME,
Cns_FULL_NAME, Nam_FULL_NAME,
} Cns_ShrtOrFullName_t; } Nam_ShrtOrFullName_t;
#define Cns_NUM_DISABLED_ENABLED 2 #define Cns_NUM_DISABLED_ENABLED 2
typedef enum typedef enum

View File

@ -566,8 +566,8 @@ void Crs_WriteSelectorMyCoursesInBreadcrumb (void)
long CrsCod; long CrsCod;
long DegCod; long DegCod;
long LastDegCod; long LastDegCod;
char CrsShortName[Cns_MAX_BYTES_SHRT_NAME + 1]; char CrsShortName[Nam_MAX_BYTES_SHRT_NAME + 1];
char DegShortName[Cns_MAX_BYTES_SHRT_NAME + 1]; char DegShortName[Nam_MAX_BYTES_SHRT_NAME + 1];
/***** Fill the list with the courses I belong to, if not filled *****/ /***** Fill the list with the courses I belong to, if not filled *****/
if (Gbl.Usrs.Me.Logged) if (Gbl.Usrs.Me.Logged)
@ -918,10 +918,10 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year)
{ {
extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE]; extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE];
extern const char *Txt_COURSE_STATUS[Hie_NUM_STATUS_TXT]; extern const char *Txt_COURSE_STATUS[Hie_NUM_STATUS_TXT];
static Act_Action_t ActionRename[Cns_NUM_SHRT_FULL_NAMES] = static Act_Action_t ActionRename[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = ActRenCrsSho, [Nam_SHRT_NAME] = ActRenCrsSho,
[Cns_FULL_NAME] = ActRenCrsFul, [Nam_FULL_NAME] = ActRenCrsFul,
}; };
struct Hie_Node *Crs; struct Hie_Node *Crs;
unsigned YearAux; unsigned YearAux;
@ -929,7 +929,7 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year)
struct Usr_Data UsrDat; struct Usr_Data UsrDat;
bool ICanEdit; bool ICanEdit;
unsigned NumUsrs[Rol_NUM_ROLES]; unsigned NumUsrs[Rol_NUM_ROLES];
const char *Names[Cns_NUM_SHRT_FULL_NAMES]; const char *Names[Nam_NUM_SHRT_FULL_NAMES];
/***** Initialize structure with user's data *****/ /***** Initialize structure with user's data *****/
Usr_UsrDataConstructor (&UsrDat); Usr_UsrDataConstructor (&UsrDat);
@ -1014,9 +1014,9 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year)
HTM_TD_End (); HTM_TD_End ();
/* Course short name and full name */ /* Course short name and full name */
Names[Cns_SHRT_NAME] = Crs->ShrtName; Names[Nam_SHRT_NAME] = Crs->ShrtName;
Names[Cns_FULL_NAME] = Crs->FullName; Names[Nam_FULL_NAME] = Crs->FullName;
Frm_ExistingShortAndFullNames (ActionRename, Nam_ExistingShortAndFullNames (ActionRename,
ParCod_OthHie,Crs->HieCod, ParCod_OthHie,Crs->HieCod,
Names, Names,
ICanEdit); // Put form? ICanEdit); // Put form?
@ -1075,10 +1075,10 @@ static void Crs_PutFormToCreateCourse (void)
extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE]; extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE];
Act_Action_t NextAction = ActUnk; Act_Action_t NextAction = ActUnk;
unsigned Year; unsigned Year;
const char *Names[Cns_NUM_SHRT_FULL_NAMES] = const char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Crs_EditingCrs->ShrtName, [Nam_SHRT_NAME] = Crs_EditingCrs->ShrtName,
[Cns_FULL_NAME] = Crs_EditingCrs->FullName, [Nam_FULL_NAME] = Crs_EditingCrs->FullName,
}; };
/***** Begin form *****/ /***** Begin form *****/
@ -1132,7 +1132,7 @@ static void Crs_PutFormToCreateCourse (void)
HTM_TD_End (); HTM_TD_End ();
/***** Course short name and full name *****/ /***** Course short name and full name *****/
Frm_NewShortAndFullNames (Names); Nam_NewShortAndFullNames (Names);
/***** Current number of teachers in this course *****/ /***** Current number of teachers in this course *****/
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
@ -1248,17 +1248,17 @@ void Crs_ReceiveFormNewCrs (void)
static void Crs_ReceiveFormRequestOrCreateCrs (Hie_Status_t Status) static void Crs_ReceiveFormRequestOrCreateCrs (Hie_Status_t Status)
{ {
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_course_X_already_exists; extern const char *Txt_The_course_X_already_exists;
extern const char *Txt_Created_new_course_X; extern const char *Txt_Created_new_course_X;
extern const char *Txt_The_year_X_is_not_allowed; extern const char *Txt_The_year_X_is_not_allowed;
extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE]; extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE];
Cns_ShrtOrFullName_t ShrtOrFullName; Nam_ShrtOrFullName_t ShrtOrFullName;
bool Exists; bool Exists;
char *Name[Cns_NUM_SHRT_FULL_NAMES] = char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Crs_EditingCrs->ShrtName, [Nam_SHRT_NAME] = Crs_EditingCrs->ShrtName,
[Cns_FULL_NAME] = Crs_EditingCrs->FullName, [Nam_FULL_NAME] = Crs_EditingCrs->FullName,
}; };
/***** Get parameters from form *****/ /***** Get parameters from form *****/
@ -1276,25 +1276,24 @@ static void Crs_ReceiveFormRequestOrCreateCrs (Hie_Status_t Status)
Crs_EditingCrs->FullName[0]) // If there's a course name Crs_EditingCrs->FullName[0]) // If there's a course name
{ {
/***** If name of course was in database... *****/ /***** If name of course was in database... *****/
for (ShrtOrFullName = Cns_SHRT_NAME, Exists = false; for (ShrtOrFullName = Nam_SHRT_NAME, Exists = false;
ShrtOrFullName <= Cns_FULL_NAME && !Exists; ShrtOrFullName <= Nam_FULL_NAME && !Exists;
ShrtOrFullName++) ShrtOrFullName++)
if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg (Cns_FldShrtOrFullName[ShrtOrFullName], if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg (Nam_FldShrtOrFullName[ShrtOrFullName],
Name[ShrtOrFullName], Names[ShrtOrFullName],
-1L,Crs_EditingCrs->PrtCod, -1L,Crs_EditingCrs->PrtCod,
Crs_EditingCrs->Specific.Year)) Crs_EditingCrs->Specific.Year))
{ {
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
Txt_The_course_X_already_exists, Txt_The_course_X_already_exists,
Name[ShrtOrFullName]); Names[ShrtOrFullName]);
Exists = true; Exists = true;
} }
if (!Exists) // Add new requested course to database if (!Exists) // Add new requested course to database
{ {
Crs_DB_CreateCourse (Crs_EditingCrs,Status); Crs_DB_CreateCourse (Crs_EditingCrs,Status);
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,Txt_Created_new_course_X,
Txt_Created_new_course_X, Names[Nam_FULL_NAME]);
Crs_EditingCrs->FullName);
} }
} }
else // If there is not a course name else // If there is not a course name
@ -1313,10 +1312,10 @@ static void Crs_ReceiveFormRequestOrCreateCrs (Hie_Status_t Status)
static void Crs_GetParsNewCourse (struct Hie_Node *Crs) static void Crs_GetParsNewCourse (struct Hie_Node *Crs)
{ {
char YearStr[2 + 1]; char YearStr[2 + 1];
char *Names[Cns_NUM_SHRT_FULL_NAMES] = char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Crs->ShrtName, [Nam_SHRT_NAME] = Crs->ShrtName,
[Cns_FULL_NAME] = Crs->FullName, [Nam_FULL_NAME] = Crs->FullName,
}; };
/***** Get parameters of the course from form *****/ /***** Get parameters of the course from form *****/
@ -1328,7 +1327,7 @@ static void Crs_GetParsNewCourse (struct Hie_Node *Crs)
Par_GetParText ("InsCrsCod",Crs->InstitutionalCod,Hie_MAX_BYTES_INSTITUTIONAL_COD); Par_GetParText ("InsCrsCod",Crs->InstitutionalCod,Hie_MAX_BYTES_INSTITUTIONAL_COD);
/* Get course short name and full name */ /* Get course short name and full name */
Par_GetParsShrtAndFullName (Names); Nam_GetParsShrtAndFullName (Names);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1613,19 +1612,19 @@ void Crs_ChangeInsCrsCod (void)
void Crs_ChangeCrsYear (void) void Crs_ChangeCrsYear (void)
{ {
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_course_X_already_exists_in_year_Y; extern const char *Txt_The_course_X_already_exists_in_year_Y;
extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE]; extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE];
extern const char *Txt_The_year_of_the_course_X_has_changed; extern const char *Txt_The_year_of_the_course_X_has_changed;
extern const char *Txt_The_year_X_is_not_allowed; extern const char *Txt_The_year_X_is_not_allowed;
char YearStr[2 + 1]; char YearStr[2 + 1];
unsigned NewYear; unsigned NewYear;
Cns_ShrtOrFullName_t ShrtOrFullName; Nam_ShrtOrFullName_t ShrtOrFullName;
bool Exists; bool Exists;
char *Name[Cns_NUM_SHRT_FULL_NAMES] = char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Crs_EditingCrs->ShrtName, [Nam_SHRT_NAME] = Crs_EditingCrs->ShrtName,
[Cns_FULL_NAME] = Crs_EditingCrs->FullName, [Nam_FULL_NAME] = Crs_EditingCrs->FullName,
}; };
/***** Course constructor *****/ /***** Course constructor *****/
@ -1647,16 +1646,16 @@ void Crs_ChangeCrsYear (void)
if (NewYear <= Deg_MAX_YEARS_PER_DEGREE) // If year is valid if (NewYear <= Deg_MAX_YEARS_PER_DEGREE) // If year is valid
{ {
/***** If name of course was in database in the new year... *****/ /***** If name of course was in database in the new year... *****/
for (ShrtOrFullName = Cns_SHRT_NAME, Exists = false; for (ShrtOrFullName = Nam_SHRT_NAME, Exists = false;
ShrtOrFullName <= Cns_FULL_NAME && !Exists; ShrtOrFullName <= Nam_FULL_NAME && !Exists;
ShrtOrFullName++) ShrtOrFullName++)
{ {
if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg (Cns_FldShrtOrFullName[ShrtOrFullName], if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg (Nam_FldShrtOrFullName[ShrtOrFullName],
Name[ShrtOrFullName], Names[ShrtOrFullName],
-1L,Crs_EditingCrs->PrtCod,NewYear)) -1L,Crs_EditingCrs->PrtCod,NewYear))
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
Txt_The_course_X_already_exists_in_year_Y, Txt_The_course_X_already_exists_in_year_Y,
Name[ShrtOrFullName],Txt_YEAR_OF_DEGREE[NewYear]); Names[ShrtOrFullName],Txt_YEAR_OF_DEGREE[NewYear]);
Exists = true; Exists = true;
} }
if (!Exists) // Update year in database if (!Exists) // Update year in database
@ -1665,9 +1664,8 @@ void Crs_ChangeCrsYear (void)
Crs_UpdateCrsYear (Crs_EditingCrs,NewYear); Crs_UpdateCrsYear (Crs_EditingCrs,NewYear);
/***** Create message to show the change made *****/ /***** Create message to show the change made *****/
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,Txt_The_year_of_the_course_X_has_changed,
Txt_The_year_of_the_course_X_has_changed, Names[Nam_FULL_NAME]);
Crs_EditingCrs->ShrtName);
} }
} }
else // Year not valid else // Year not valid
@ -1715,7 +1713,7 @@ void Crs_RenameCourseShort (void)
/***** Rename course *****/ /***** Rename course *****/
Crs_EditingCrs->HieCod = ParCod_GetAndCheckPar (ParCod_OthHie); Crs_EditingCrs->HieCod = ParCod_GetAndCheckPar (ParCod_OthHie);
Crs_RenameCourse (Crs_EditingCrs,Cns_SHRT_NAME); Crs_RenameCourse (Crs_EditingCrs,Nam_SHRT_NAME);
} }
void Crs_RenameCourseFull (void) void Crs_RenameCourseFull (void)
@ -1725,31 +1723,31 @@ void Crs_RenameCourseFull (void)
/***** Rename course *****/ /***** Rename course *****/
Crs_EditingCrs->HieCod = ParCod_GetAndCheckPar (ParCod_OthHie); Crs_EditingCrs->HieCod = ParCod_GetAndCheckPar (ParCod_OthHie);
Crs_RenameCourse (Crs_EditingCrs,Cns_FULL_NAME); Crs_RenameCourse (Crs_EditingCrs,Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
/************************ Change the name of a course ************************/ /************************ Change the name of a course ************************/
/*****************************************************************************/ /*****************************************************************************/
void Crs_RenameCourse (struct Hie_Node *Crs,Cns_ShrtOrFullName_t ShrtOrFullName) void Crs_RenameCourse (struct Hie_Node *Crs,Nam_ShrtOrFullName_t ShrtOrFullName)
{ {
extern const char *Cns_ParShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ParShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern unsigned Cns_MaxBytesShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern unsigned Nam_MaxBytesShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_course_X_already_exists; extern const char *Txt_The_course_X_already_exists;
extern const char *Txt_The_course_X_has_been_renamed_as_Y; extern const char *Txt_The_course_X_has_been_renamed_as_Y;
extern const char *Txt_The_name_X_has_not_changed; extern const char *Txt_The_name_X_has_not_changed;
char *CurrentName[Cns_NUM_SHRT_FULL_NAMES] = char *CurrentName[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Crs->ShrtName, [Nam_SHRT_NAME] = Crs->ShrtName,
[Cns_FULL_NAME] = Crs->FullName, [Nam_FULL_NAME] = Crs->FullName,
}; };
char NewName[Cns_MAX_BYTES_FULL_NAME + 1]; char NewName[Nam_MAX_BYTES_FULL_NAME + 1];
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Get the new name for the course */ /* Get the new name for the course */
Par_GetParShrtOrFullName (ShrtOrFullName,NewName); Nam_GetParShrtOrFullName (ShrtOrFullName,NewName);
/***** Get from the database the data of the degree *****/ /***** Get from the database the data of the degree *****/
Crs_GetCourseDataByCod (Crs); Crs_GetCourseDataByCod (Crs);
@ -1764,7 +1762,7 @@ void Crs_RenameCourse (struct Hie_Node *Crs,Cns_ShrtOrFullName_t ShrtOrFullName)
if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names
{ {
/***** If course was in database... *****/ /***** If course was in database... *****/
if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg (Cns_ParShrtOrFullName[ShrtOrFullName], if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg (Nam_ParShrtOrFullName[ShrtOrFullName],
NewName,Crs->HieCod, NewName,Crs->HieCod,
Crs->PrtCod,Crs->Specific.Year)) Crs->PrtCod,Crs->Specific.Year))
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
@ -1774,7 +1772,7 @@ void Crs_RenameCourse (struct Hie_Node *Crs,Cns_ShrtOrFullName_t ShrtOrFullName)
{ {
/* Update the table changing old name by new name */ /* Update the table changing old name by new name */
Crs_DB_UpdateCrsName (Crs->HieCod, Crs_DB_UpdateCrsName (Crs->HieCod,
Cns_FldShrtOrFullName[ShrtOrFullName],NewName); Nam_FldShrtOrFullName[ShrtOrFullName],NewName);
/* Create alert to show the change made */ /* Create alert to show the change made */
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,
@ -1783,7 +1781,7 @@ void Crs_RenameCourse (struct Hie_Node *Crs,Cns_ShrtOrFullName_t ShrtOrFullName)
/* Change current course name in order to display it properly */ /* Change current course name in order to display it properly */
Str_Copy (CurrentName[ShrtOrFullName],NewName, Str_Copy (CurrentName[ShrtOrFullName],NewName,
Cns_MaxBytesShrtOrFullName[ShrtOrFullName]); Nam_MaxBytesShrtOrFullName[ShrtOrFullName]);
} }
} }
else // The same name else // The same name

View File

@ -73,7 +73,7 @@ void Crs_UpdateCrsYear (struct Hie_Node *Crs,unsigned NewYear);
void Crs_RenameCourseShort (void); void Crs_RenameCourseShort (void);
void Crs_RenameCourseFull (void); void Crs_RenameCourseFull (void);
void Crs_RenameCourse (struct Hie_Node *Crs,Cns_ShrtOrFullName_t ShrtOrFullName); void Crs_RenameCourse (struct Hie_Node *Crs,Nam_ShrtOrFullName_t ShrtOrFullName);
void Crs_ChangeCrsStatus (void); void Crs_ChangeCrsStatus (void);
void Crs_ContEditAfterChgCrs (void); void Crs_ContEditAfterChgCrs (void);

View File

@ -271,7 +271,7 @@ static void CrsCfg_Degree (bool PrintView,bool PutForm)
static void CrsCfg_FullName (bool PutForm) static void CrsCfg_FullName (bool PutForm)
{ {
HieCfg_Name (PutForm,Hie_CRS,Cns_FULL_NAME); HieCfg_Name (PutForm,Hie_CRS,Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -280,7 +280,7 @@ static void CrsCfg_FullName (bool PutForm)
static void CrsCfg_ShrtName (bool PutForm) static void CrsCfg_ShrtName (bool PutForm)
{ {
HieCfg_Name (PutForm,Hie_CRS,Cns_SHRT_NAME); HieCfg_Name (PutForm,Hie_CRS,Nam_SHRT_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -458,17 +458,17 @@ static void CrsCfg_Indicators (void)
void CrsCfg_ChangeCrsDeg (void) void CrsCfg_ChangeCrsDeg (void)
{ {
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_In_the_year_X_of_the_degree_Y_already_existed_a_course_with_the_name_Z; extern const char *Txt_In_the_year_X_of_the_degree_Y_already_existed_a_course_with_the_name_Z;
extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE]; extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE];
extern const char *Txt_The_course_X_has_been_moved_to_the_degree_Y; extern const char *Txt_The_course_X_has_been_moved_to_the_degree_Y;
struct Hie_Node NewDeg; struct Hie_Node NewDeg;
Cns_ShrtOrFullName_t ShrtOrFullName; Nam_ShrtOrFullName_t ShrtOrFullName;
bool Exists; bool Exists;
char *Name[Cns_NUM_SHRT_FULL_NAMES] = char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Gbl.Hierarchy.Node[Hie_CRS].ShrtName, [Nam_SHRT_NAME] = Gbl.Hierarchy.Node[Hie_CRS].ShrtName,
[Cns_FULL_NAME] = Gbl.Hierarchy.Node[Hie_CRS].FullName, [Nam_FULL_NAME] = Gbl.Hierarchy.Node[Hie_CRS].FullName,
}; };
/***** Get parameter with degree code *****/ /***** Get parameter with degree code *****/
@ -481,17 +481,17 @@ void CrsCfg_ChangeCrsDeg (void)
Deg_GetDegreeDataByCod (&NewDeg); Deg_GetDegreeDataByCod (&NewDeg);
/***** If name of course was in database in the new degree... *****/ /***** If name of course was in database in the new degree... *****/
for (ShrtOrFullName = Cns_SHRT_NAME, Exists = false; for (ShrtOrFullName = Nam_SHRT_NAME, Exists = false;
ShrtOrFullName <= Cns_FULL_NAME && !Exists; ShrtOrFullName <= Nam_FULL_NAME && !Exists;
ShrtOrFullName++) ShrtOrFullName++)
if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg (Cns_FldShrtOrFullName[ShrtOrFullName], if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg (Nam_FldShrtOrFullName[ShrtOrFullName],
Name[ShrtOrFullName],-1L, Names[ShrtOrFullName],-1L,
NewDeg.HieCod,Gbl.Hierarchy.Node[Hie_CRS].Specific.Year)) NewDeg.HieCod,Gbl.Hierarchy.Node[Hie_CRS].Specific.Year))
{ {
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
Txt_In_the_year_X_of_the_degree_Y_already_existed_a_course_with_the_name_Z, Txt_In_the_year_X_of_the_degree_Y_already_existed_a_course_with_the_name_Z,
Txt_YEAR_OF_DEGREE[Gbl.Hierarchy.Node[Hie_CRS].Specific.Year], Txt_YEAR_OF_DEGREE[Gbl.Hierarchy.Node[Hie_CRS].Specific.Year],
NewDeg.FullName,Name[ShrtOrFullName]); NewDeg.FullName,Names[ShrtOrFullName]);
Exists = true; Exists = true;
} }
if (!Exists) // Update degree in database if (!Exists) // Update degree in database
@ -507,7 +507,7 @@ void CrsCfg_ChangeCrsDeg (void)
/***** Create alert to show the change made *****/ /***** Create alert to show the change made *****/
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,
Txt_The_course_X_has_been_moved_to_the_degree_Y, Txt_The_course_X_has_been_moved_to_the_degree_Y,
Gbl.Hierarchy.Node[Hie_CRS].FullName, Names[Nam_FULL_NAME],
Gbl.Hierarchy.Node[Hie_DEG].FullName); Gbl.Hierarchy.Node[Hie_DEG].FullName);
} }
} }
@ -519,12 +519,12 @@ void CrsCfg_ChangeCrsDeg (void)
void CrsCfg_RenameCourseShort (void) void CrsCfg_RenameCourseShort (void)
{ {
Crs_RenameCourse (&Gbl.Hierarchy.Node[Hie_CRS],Cns_SHRT_NAME); Crs_RenameCourse (&Gbl.Hierarchy.Node[Hie_CRS],Nam_SHRT_NAME);
} }
void CrsCfg_RenameCourseFull (void) void CrsCfg_RenameCourseFull (void)
{ {
Crs_RenameCourse (&Gbl.Hierarchy.Node[Hie_CRS],Cns_FULL_NAME); Crs_RenameCourse (&Gbl.Hierarchy.Node[Hie_CRS],Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -533,19 +533,19 @@ void CrsCfg_RenameCourseFull (void)
void CrsCfg_ChangeCrsYear (void) void CrsCfg_ChangeCrsYear (void)
{ {
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_course_X_already_exists_in_year_Y; extern const char *Txt_The_course_X_already_exists_in_year_Y;
extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE]; extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE];
extern const char *Txt_The_year_of_the_course_X_has_changed; extern const char *Txt_The_year_of_the_course_X_has_changed;
extern const char *Txt_The_year_X_is_not_allowed; extern const char *Txt_The_year_X_is_not_allowed;
char YearStr[2 + 1]; char YearStr[2 + 1];
unsigned NewYear; unsigned NewYear;
Cns_ShrtOrFullName_t ShrtOrFullName; Nam_ShrtOrFullName_t ShrtOrFullName;
bool Exists; bool Exists;
char *Name[Cns_NUM_SHRT_FULL_NAMES] = char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Gbl.Hierarchy.Node[Hie_CRS].ShrtName, [Nam_SHRT_NAME] = Gbl.Hierarchy.Node[Hie_CRS].ShrtName,
[Cns_FULL_NAME] = Gbl.Hierarchy.Node[Hie_CRS].FullName, [Nam_FULL_NAME] = Gbl.Hierarchy.Node[Hie_CRS].FullName,
}; };
/***** Get parameter with year/semester *****/ /***** Get parameter with year/semester *****/
@ -555,16 +555,16 @@ void CrsCfg_ChangeCrsYear (void)
if (NewYear <= Deg_MAX_YEARS_PER_DEGREE) // If year is valid if (NewYear <= Deg_MAX_YEARS_PER_DEGREE) // If year is valid
{ {
/***** If name of course was in database in the new year... *****/ /***** If name of course was in database in the new year... *****/
for (ShrtOrFullName = Cns_SHRT_NAME, Exists = false; for (ShrtOrFullName = Nam_SHRT_NAME, Exists = false;
ShrtOrFullName <= Cns_FULL_NAME && !Exists; ShrtOrFullName <= Nam_FULL_NAME && !Exists;
ShrtOrFullName++) ShrtOrFullName++)
if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg (Cns_FldShrtOrFullName[ShrtOrFullName], if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg (Nam_FldShrtOrFullName[ShrtOrFullName],
Name[ShrtOrFullName],-1L, Names[ShrtOrFullName],-1L,
Gbl.Hierarchy.Node[Hie_CRS].PrtCod,NewYear)) Gbl.Hierarchy.Node[Hie_CRS].PrtCod,NewYear))
{ {
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
Txt_The_course_X_already_exists_in_year_Y, Txt_The_course_X_already_exists_in_year_Y,
Name[ShrtOrFullName],Txt_YEAR_OF_DEGREE[NewYear]); Names[ShrtOrFullName],Txt_YEAR_OF_DEGREE[NewYear]);
Exists = true; Exists = true;
} }
if (!Exists) // Update year in database if (!Exists) // Update year in database
@ -574,8 +574,8 @@ void CrsCfg_ChangeCrsYear (void)
/***** Create alert to show the change made *****/ /***** Create alert to show the change made *****/
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,
Txt_The_year_of_the_course_X_has_changed, Txt_The_year_of_the_course_X_has_changed,
Gbl.Hierarchy.Node[Hie_CRS].ShrtName); Names[Nam_FULL_NAME]);
} }
} }
else // Year not valid else // Year not valid

View File

@ -161,8 +161,8 @@ long Crs_DB_GetCurrentDegCodFromCurrentCrsCod (void)
/*****************************************************************************/ /*****************************************************************************/
void Crs_DB_GetShortNamesByCod (long CrsCod, void Crs_DB_GetShortNamesByCod (long CrsCod,
char CrsShortName[Cns_MAX_BYTES_SHRT_NAME + 1], char CrsShortName[Nam_MAX_BYTES_SHRT_NAME + 1],
char DegShortName[Cns_MAX_BYTES_SHRT_NAME + 1]) char DegShortName[Nam_MAX_BYTES_SHRT_NAME + 1])
{ {
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
@ -185,8 +185,8 @@ void Crs_DB_GetShortNamesByCod (long CrsCod,
{ {
/***** Get the course short name and degree short name *****/ /***** Get the course short name and degree short name *****/
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
Str_Copy (CrsShortName,row[0],Cns_MAX_BYTES_SHRT_NAME); Str_Copy (CrsShortName,row[0],Nam_MAX_BYTES_SHRT_NAME);
Str_Copy (DegShortName,row[1],Cns_MAX_BYTES_SHRT_NAME); Str_Copy (DegShortName,row[1],Nam_MAX_BYTES_SHRT_NAME);
} }
/***** Free structure that stores the query result *****/ /***** Free structure that stores the query result *****/
@ -212,8 +212,8 @@ bool Crs_DB_CheckIfCrsCodExists (long CrsCod)
/********** Check if the name of course exists in existing courses ***********/ /********** Check if the name of course exists in existing courses ***********/
/*****************************************************************************/ /*****************************************************************************/
bool Crs_DB_CheckIfCrsNameExistsInYearOfDeg (const char *FldName,const char *Name,long CrsCod, bool Crs_DB_CheckIfCrsNameExistsInYearOfDeg (const char *FldName,const char *Name,
long DegCod,unsigned Year) long CrsCod,long DegCod,unsigned Year)
{ {
return return
DB_QueryEXISTS ("can not check if the name of a course already existed", DB_QueryEXISTS ("can not check if the name of a course already existed",

View File

@ -43,11 +43,11 @@ unsigned Crs_DB_GetCrssInCurrentDegFull (MYSQL_RES **mysql_res);
unsigned Crs_DB_GetCourseDataByCod (MYSQL_RES **mysql_res,long CrsCod); unsigned Crs_DB_GetCourseDataByCod (MYSQL_RES **mysql_res,long CrsCod);
long Crs_DB_GetCurrentDegCodFromCurrentCrsCod (void); long Crs_DB_GetCurrentDegCodFromCurrentCrsCod (void);
void Crs_DB_GetShortNamesByCod (long CrsCod, void Crs_DB_GetShortNamesByCod (long CrsCod,
char CrsShortName[Cns_MAX_BYTES_SHRT_NAME + 1], char CrsShortName[Nam_MAX_BYTES_SHRT_NAME + 1],
char DegShortName[Cns_MAX_BYTES_SHRT_NAME + 1]); char DegShortName[Nam_MAX_BYTES_SHRT_NAME + 1]);
bool Crs_DB_CheckIfCrsCodExists (long CrsCod); bool Crs_DB_CheckIfCrsCodExists (long CrsCod);
bool Crs_DB_CheckIfCrsNameExistsInYearOfDeg (const char *FldName,const char *Name,long CrsCod, bool Crs_DB_CheckIfCrsNameExistsInYearOfDeg (const char *FldName,const char *Name,
long DegCod,unsigned Year); long CrsCod,long DegCod,unsigned Year);
unsigned Crs_DB_GetCrssOfAUsr (MYSQL_RES **mysql_res,long UsrCod,Rol_Role_t Role); unsigned Crs_DB_GetCrssOfAUsr (MYSQL_RES **mysql_res,long UsrCod,Rol_Role_t Role);
unsigned Crs_DB_GetOldCrss (MYSQL_RES **mysql_res,unsigned long SecondsWithoutAccess); unsigned Crs_DB_GetOldCrss (MYSQL_RES **mysql_res,unsigned long SecondsWithoutAccess);

View File

@ -350,8 +350,8 @@ mysql> DESCRIBE ban_banners;
DB_CreateTable ("CREATE TABLE IF NOT EXISTS ban_banners (" DB_CreateTable ("CREATE TABLE IF NOT EXISTS ban_banners ("
"BanCod INT NOT NULL AUTO_INCREMENT," "BanCod INT NOT NULL AUTO_INCREMENT,"
"Hidden ENUM('N','Y') NOT NULL DEFAULT 'N'," "Hidden ENUM('N','Y') NOT NULL DEFAULT 'N',"
"ShortName VARCHAR(511) NOT NULL," // Cns_MAX_BYTES_SHRT_NAME "ShortName VARCHAR(511) NOT NULL," // Nam_MAX_BYTES_SHRT_NAME
"FullName VARCHAR(2047) NOT NULL," // Cns_MAX_BYTES_FULL_NAME "FullName VARCHAR(2047) NOT NULL," // Nam_MAX_BYTES_FULL_NAME
"Img VARCHAR(255) NOT NULL," // Ban_MAX_BYTES_IMAGE "Img VARCHAR(255) NOT NULL," // Ban_MAX_BYTES_IMAGE
"WWW VARCHAR(255) NOT NULL," // Cns_MAX_BYTES_WWW "WWW VARCHAR(255) NOT NULL," // Cns_MAX_BYTES_WWW
"UNIQUE INDEX(BanCod)," "UNIQUE INDEX(BanCod),"
@ -374,8 +374,8 @@ mysql> DESCRIBE bld_buildings;
DB_CreateTable ("CREATE TABLE IF NOT EXISTS bld_buildings (" DB_CreateTable ("CREATE TABLE IF NOT EXISTS bld_buildings ("
"BldCod INT NOT NULL AUTO_INCREMENT," "BldCod INT NOT NULL AUTO_INCREMENT,"
"CtrCod INT NOT NULL," "CtrCod INT NOT NULL,"
"ShortName VARCHAR(511) NOT NULL," // Cns_MAX_BYTES_SHRT_NAME "ShortName VARCHAR(511) NOT NULL," // Nam_MAX_BYTES_SHRT_NAME
"FullName VARCHAR(2047) NOT NULL," // Cns_MAX_BYTES_FULL_NAME "FullName VARCHAR(2047) NOT NULL," // Nam_MAX_BYTES_FULL_NAME
"Location VARCHAR(2047) NOT NULL," // Bld_MAX_BYTES_LOCATION "Location VARCHAR(2047) NOT NULL," // Bld_MAX_BYTES_LOCATION
"UNIQUE INDEX(BldCod)," "UNIQUE INDEX(BldCod),"
"INDEX(CtrCod))"); "INDEX(CtrCod))");
@ -584,7 +584,7 @@ mysql> DESCRIBE cfe_exams;
"CrsCod INT NOT NULL DEFAULT -1," "CrsCod INT NOT NULL DEFAULT -1,"
"Status TINYINT NOT NULL DEFAULT 0," "Status TINYINT NOT NULL DEFAULT 0,"
"NumNotif INT NOT NULL DEFAULT 0," "NumNotif INT NOT NULL DEFAULT 0,"
"CrsFullName VARCHAR(2047) NOT NULL," // Cns_MAX_BYTES_FULL_NAME "CrsFullName VARCHAR(2047) NOT NULL," // Nam_MAX_BYTES_FULL_NAME
"Year TINYINT NOT NULL," "Year TINYINT NOT NULL,"
"ExamSession VARCHAR(2047) NOT NULL," // Cfe_MAX_BYTES_SESSION "ExamSession VARCHAR(2047) NOT NULL," // Cfe_MAX_BYTES_SESSION
"CallDate DATETIME NOT NULL," "CallDate DATETIME NOT NULL,"
@ -642,8 +642,8 @@ mysql> DESCRIBE crs_courses;
"InsCrsCod CHAR(7) NOT NULL," "InsCrsCod CHAR(7) NOT NULL,"
"Status TINYINT NOT NULL DEFAULT 0," "Status TINYINT NOT NULL DEFAULT 0,"
"RequesterUsrCod INT NOT NULL DEFAULT -1," "RequesterUsrCod INT NOT NULL DEFAULT -1,"
"ShortName VARCHAR(511) COLLATE latin1_spanish_ci NOT NULL," // Cns_MAX_BYTES_SHRT_NAME "ShortName VARCHAR(511) COLLATE latin1_spanish_ci NOT NULL," // Nam_MAX_BYTES_SHRT_NAME
"FullName VARCHAR(2047) COLLATE latin1_spanish_ci NOT NULL," // Cns_MAX_BYTES_FULL_NAME "FullName VARCHAR(2047) COLLATE latin1_spanish_ci NOT NULL," // Nam_MAX_BYTES_FULL_NAME
"NumIndicators INT NOT NULL DEFAULT -1," "NumIndicators INT NOT NULL DEFAULT -1,"
"UNIQUE INDEX(CrsCod)," "UNIQUE INDEX(CrsCod),"
"INDEX(DegCod,Year)," "INDEX(DegCod,Year),"
@ -977,8 +977,8 @@ mysql> DESCRIBE ctr_centers;
"Latitude DOUBLE PRECISION NOT NULL DEFAULT 0," "Latitude DOUBLE PRECISION NOT NULL DEFAULT 0,"
"Longitude DOUBLE PRECISION NOT NULL DEFAULT 0," "Longitude DOUBLE PRECISION NOT NULL DEFAULT 0,"
"Altitude DOUBLE PRECISION NOT NULL DEFAULT 0," "Altitude DOUBLE PRECISION NOT NULL DEFAULT 0,"
"ShortName VARCHAR(511) COLLATE latin1_spanish_ci NOT NULL," // Cns_MAX_BYTES_SHRT_NAME "ShortName VARCHAR(511) COLLATE latin1_spanish_ci NOT NULL," // Nam_MAX_BYTES_SHRT_NAME
"FullName VARCHAR(2047) COLLATE latin1_spanish_ci NOT NULL," // Cns_MAX_BYTES_FULL_NAME "FullName VARCHAR(2047) COLLATE latin1_spanish_ci NOT NULL," // Nam_MAX_BYTES_FULL_NAME
"WWW VARCHAR(255) NOT NULL," // Cns_MAX_BYTES_WWW "WWW VARCHAR(255) NOT NULL," // Cns_MAX_BYTES_WWW
"PhotoAttribution TEXT NOT NULL," // Med_MAX_BYTES_ATTRIBUTION "PhotoAttribution TEXT NOT NULL," // Med_MAX_BYTES_ATTRIBUTION
"UNIQUE INDEX(CtrCod)," "UNIQUE INDEX(CtrCod),"
@ -1093,8 +1093,8 @@ mysql> DESCRIBE deg_degrees;
"DegTypCod INT NOT NULL," "DegTypCod INT NOT NULL,"
"Status TINYINT NOT NULL DEFAULT 0," "Status TINYINT NOT NULL DEFAULT 0,"
"RequesterUsrCod INT NOT NULL DEFAULT -1," "RequesterUsrCod INT NOT NULL DEFAULT -1,"
"ShortName VARCHAR(511) COLLATE latin1_spanish_ci NOT NULL," // Cns_MAX_BYTES_SHRT_NAME "ShortName VARCHAR(511) COLLATE latin1_spanish_ci NOT NULL," // Nam_MAX_BYTES_SHRT_NAME
"FullName VARCHAR(2047) COLLATE latin1_spanish_ci NOT NULL," // Cns_MAX_BYTES_FULL_NAME "FullName VARCHAR(2047) COLLATE latin1_spanish_ci NOT NULL," // Nam_MAX_BYTES_FULL_NAME
"WWW VARCHAR(255) NOT NULL," // Cns_MAX_BYTES_WWW "WWW VARCHAR(255) NOT NULL," // Cns_MAX_BYTES_WWW
"UNIQUE INDEX(DegCod)," "UNIQUE INDEX(DegCod),"
"INDEX(CtrCod)," "INDEX(CtrCod),"
@ -1118,8 +1118,8 @@ mysql> DESCRIBE dpt_departments;
DB_CreateTable ("CREATE TABLE IF NOT EXISTS dpt_departments (" DB_CreateTable ("CREATE TABLE IF NOT EXISTS dpt_departments ("
"DptCod INT NOT NULL AUTO_INCREMENT," "DptCod INT NOT NULL AUTO_INCREMENT,"
"InsCod INT NOT NULL," "InsCod INT NOT NULL,"
"ShortName VARCHAR(511) NOT NULL," // Cns_MAX_BYTES_SHRT_NAME "ShortName VARCHAR(511) NOT NULL," // Nam_MAX_BYTES_SHRT_NAME
"FullName VARCHAR(2047) NOT NULL," // Cns_MAX_BYTES_FULL_NAME "FullName VARCHAR(2047) NOT NULL," // Nam_MAX_BYTES_FULL_NAME
"WWW VARCHAR(255) NOT NULL," // Cns_MAX_BYTES_WWW "WWW VARCHAR(255) NOT NULL," // Cns_MAX_BYTES_WWW
"UNIQUE INDEX(DptCod)," "UNIQUE INDEX(DptCod),"
"INDEX(InsCod))"); "INDEX(InsCod))");
@ -1852,8 +1852,8 @@ mysql> DESCRIBE ins_instits;
"CtyCod INT NOT NULL," "CtyCod INT NOT NULL,"
"Status TINYINT NOT NULL DEFAULT 0," "Status TINYINT NOT NULL DEFAULT 0,"
"RequesterUsrCod INT NOT NULL DEFAULT -1," "RequesterUsrCod INT NOT NULL DEFAULT -1,"
"ShortName VARCHAR(511) COLLATE latin1_spanish_ci NOT NULL," // Cns_MAX_BYTES_SHRT_NAME "ShortName VARCHAR(511) COLLATE latin1_spanish_ci NOT NULL," // Nam_MAX_BYTES_SHRT_NAME
"FullName VARCHAR(2047) COLLATE latin1_spanish_ci NOT NULL," // Cns_MAX_BYTES_FULL_NAME "FullName VARCHAR(2047) COLLATE latin1_spanish_ci NOT NULL," // Nam_MAX_BYTES_FULL_NAME
"WWW VARCHAR(255) NOT NULL," // Cns_MAX_BYTES_WWW "WWW VARCHAR(255) NOT NULL," // Cns_MAX_BYTES_WWW
"UNIQUE INDEX(InsCod)," "UNIQUE INDEX(InsCod),"
"INDEX(CtyCod)," "INDEX(CtyCod),"
@ -1874,8 +1874,8 @@ mysql> DESCRIBE lnk_links;
*/ */
DB_CreateTable ("CREATE TABLE IF NOT EXISTS lnk_links (" DB_CreateTable ("CREATE TABLE IF NOT EXISTS lnk_links ("
"LnkCod INT NOT NULL AUTO_INCREMENT," "LnkCod INT NOT NULL AUTO_INCREMENT,"
"ShortName VARCHAR(511) NOT NULL," // Cns_MAX_BYTES_SHRT_NAME "ShortName VARCHAR(511) NOT NULL," // Nam_MAX_BYTES_SHRT_NAME
"FullName VARCHAR(2047) NOT NULL," // Cns_MAX_BYTES_FULL_NAME "FullName VARCHAR(2047) NOT NULL," // Nam_MAX_BYTES_FULL_NAME
"WWW VARCHAR(255) NOT NULL," // Cns_MAX_BYTES_WWW "WWW VARCHAR(255) NOT NULL," // Cns_MAX_BYTES_WWW
"UNIQUE INDEX(LnkCod))"); "UNIQUE INDEX(LnkCod))");
@ -2434,8 +2434,8 @@ mysql> DESCRIBE plc_places;
DB_CreateTable ("CREATE TABLE IF NOT EXISTS plc_places (" DB_CreateTable ("CREATE TABLE IF NOT EXISTS plc_places ("
"PlcCod INT NOT NULL AUTO_INCREMENT," "PlcCod INT NOT NULL AUTO_INCREMENT,"
"InsCod INT NOT NULL," "InsCod INT NOT NULL,"
"ShortName VARCHAR(511) NOT NULL," // Cns_MAX_BYTES_SHRT_NAME "ShortName VARCHAR(511) NOT NULL," // Nam_MAX_BYTES_SHRT_NAME
"FullName VARCHAR(2047) NOT NULL," // Cns_MAX_BYTES_FULL_NAME "FullName VARCHAR(2047) NOT NULL," // Nam_MAX_BYTES_FULL_NAME
"UNIQUE INDEX(PlcCod)," "UNIQUE INDEX(PlcCod),"
"INDEX(InsCod))"); "INDEX(InsCod))");
@ -2719,8 +2719,8 @@ mysql> DESCRIBE roo_rooms;
"'toilets'," "'toilets',"
"'virtual'," "'virtual',"
"'yard') NOT NULL DEFAULT 'no_type'," "'yard') NOT NULL DEFAULT 'no_type',"
"ShortName VARCHAR(511) NOT NULL," // Cns_MAX_BYTES_SHRT_NAME "ShortName VARCHAR(511) NOT NULL," // Nam_MAX_BYTES_SHRT_NAME
"FullName VARCHAR(2047) NOT NULL," // Cns_MAX_BYTES_FULL_NAME "FullName VARCHAR(2047) NOT NULL," // Nam_MAX_BYTES_FULL_NAME
"Capacity INT NOT NULL," "Capacity INT NOT NULL,"
"UNIQUE INDEX(RooCod)," "UNIQUE INDEX(RooCod),"
"INDEX(CtrCod,BldCod,Floor))"); "INDEX(CtrCod,BldCod,Floor))");

View File

@ -317,10 +317,10 @@ void Deg_ShowDegsOfCurrentCtr (void)
static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes) static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
{ {
extern const char *Txt_DEGREE_STATUS[Hie_NUM_STATUS_TXT]; extern const char *Txt_DEGREE_STATUS[Hie_NUM_STATUS_TXT];
static Act_Action_t ActionRename[Cns_NUM_SHRT_FULL_NAMES] = static Act_Action_t ActionRename[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = ActRenDegSho, [Nam_SHRT_NAME] = ActRenDegSho,
[Cns_FULL_NAME] = ActRenDegFul, [Nam_FULL_NAME] = ActRenDegFul,
}; };
unsigned NumDeg; unsigned NumDeg;
struct Hie_Node *Deg; struct Hie_Node *Deg;
@ -331,7 +331,7 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
bool ICanEdit; bool ICanEdit;
unsigned NumCrss; unsigned NumCrss;
unsigned NumUsrsInCrssOfDeg; unsigned NumUsrsInCrssOfDeg;
const char *Names[Cns_NUM_SHRT_FULL_NAMES]; const char *Names[Nam_NUM_SHRT_FULL_NAMES];
/***** Initialize structure with user's data *****/ /***** Initialize structure with user's data *****/
Usr_UsrDataConstructor (&UsrDat); Usr_UsrDataConstructor (&UsrDat);
@ -385,9 +385,9 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
HTM_TD_End (); HTM_TD_End ();
/* Degree short name and full name */ /* Degree short name and full name */
Names[Cns_SHRT_NAME] = Deg->ShrtName; Names[Nam_SHRT_NAME] = Deg->ShrtName;
Names[Cns_FULL_NAME] = Deg->FullName; Names[Nam_FULL_NAME] = Deg->FullName;
Frm_ExistingShortAndFullNames (ActionRename, Nam_ExistingShortAndFullNames (ActionRename,
ParCod_OthHie,Deg->HieCod, ParCod_OthHie,Deg->HieCod,
Names, Names,
ICanEdit); // Put form? ICanEdit); // Put form?
@ -509,10 +509,10 @@ static void Deg_PutFormToCreateDegree (const struct DegTyp_DegTypes *DegTypes)
Act_Action_t NextAction = ActUnk; Act_Action_t NextAction = ActUnk;
unsigned NumDegTyp; unsigned NumDegTyp;
struct DegTyp_DegreeType *DegTyp; struct DegTyp_DegreeType *DegTyp;
const char *Names[Cns_NUM_SHRT_FULL_NAMES] = const char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Deg_EditingDeg->ShrtName, [Nam_SHRT_NAME] = Deg_EditingDeg->ShrtName,
[Cns_FULL_NAME] = Deg_EditingDeg->FullName, [Nam_FULL_NAME] = Deg_EditingDeg->FullName,
}; };
/***** Set action depending on role *****/ /***** Set action depending on role *****/
@ -548,7 +548,7 @@ static void Deg_PutFormToCreateDegree (const struct DegTyp_DegTypes *DegTypes)
HTM_TD_End (); HTM_TD_End ();
/***** Degree short name and full name *****/ /***** Degree short name and full name *****/
Frm_NewShortAndFullNames (Names); Nam_NewShortAndFullNames (Names);
/***** Degree type *****/ /***** Degree type *****/
HTM_TD_Begin ("class=\"LM\""); HTM_TD_Begin ("class=\"LM\"");
@ -1045,15 +1045,15 @@ void Deg_ReceiveFormNewDeg (void)
static void Deg_ReceiveFormRequestOrCreateDeg (Hie_Status_t Status) static void Deg_ReceiveFormRequestOrCreateDeg (Hie_Status_t Status)
{ {
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_degree_X_already_exists; extern const char *Txt_The_degree_X_already_exists;
extern const char *Txt_Created_new_degree_X; extern const char *Txt_Created_new_degree_X;
Cns_ShrtOrFullName_t ShrtOrFullName; Nam_ShrtOrFullName_t ShrtOrFullName;
bool Exists; bool Exists;
char *Names[Cns_NUM_SHRT_FULL_NAMES] = char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Deg_EditingDeg->ShrtName, [Nam_SHRT_NAME] = Deg_EditingDeg->ShrtName,
[Cns_FULL_NAME] = Deg_EditingDeg->FullName, [Nam_FULL_NAME] = Deg_EditingDeg->FullName,
}; };
/***** Get parameters from form *****/ /***** Get parameters from form *****/
@ -1061,7 +1061,7 @@ static void Deg_ReceiveFormRequestOrCreateDeg (Hie_Status_t Status)
Deg_EditingDeg->PrtCod = Gbl.Hierarchy.Node[Hie_CTR].HieCod; Deg_EditingDeg->PrtCod = Gbl.Hierarchy.Node[Hie_CTR].HieCod;
/* Get degree short name and full name */ /* Get degree short name and full name */
Par_GetParsShrtAndFullName (Names); Nam_GetParsShrtAndFullName (Names);
/* Get degree type */ /* Get degree type */
Deg_EditingDeg->Specific.TypCod = ParCod_GetAndCheckPar (ParCod_OthDegTyp); Deg_EditingDeg->Specific.TypCod = ParCod_GetAndCheckPar (ParCod_OthDegTyp);
@ -1075,10 +1075,10 @@ static void Deg_ReceiveFormRequestOrCreateDeg (Hie_Status_t Status)
if (Deg_EditingDeg->WWW[0]) if (Deg_EditingDeg->WWW[0])
{ {
/***** If name of degree was in database... *****/ /***** If name of degree was in database... *****/
for (ShrtOrFullName = Cns_SHRT_NAME, Exists = false; for (ShrtOrFullName = Nam_SHRT_NAME, Exists = false;
ShrtOrFullName <= Cns_FULL_NAME && !Exists; ShrtOrFullName <= Nam_FULL_NAME && !Exists;
ShrtOrFullName++) ShrtOrFullName++)
if (Deg_DB_CheckIfDegNameExistsInCtr (Cns_FldShrtOrFullName[ShrtOrFullName], if (Deg_DB_CheckIfDegNameExistsInCtr (Nam_FldShrtOrFullName[ShrtOrFullName],
Names[ShrtOrFullName], Names[ShrtOrFullName],
-1L,Deg_EditingDeg->PrtCod)) -1L,Deg_EditingDeg->PrtCod))
{ {
@ -1090,9 +1090,8 @@ static void Deg_ReceiveFormRequestOrCreateDeg (Hie_Status_t Status)
if (!Exists) // Add new degree to database if (!Exists) // Add new degree to database
{ {
Deg_DB_CreateDegree (Deg_EditingDeg,Status); Deg_DB_CreateDegree (Deg_EditingDeg,Status);
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,Txt_Created_new_degree_X,
Txt_Created_new_degree_X, Names[Nam_FULL_NAME]);
Deg_EditingDeg->FullName);
} }
} }
else // If there is not a degree logo or web else // If there is not a degree logo or web
@ -1281,7 +1280,7 @@ void Deg_RenameDegreeShort (void)
/***** Rename degree *****/ /***** Rename degree *****/
Deg_EditingDeg->HieCod = ParCod_GetAndCheckPar (ParCod_OthHie); Deg_EditingDeg->HieCod = ParCod_GetAndCheckPar (ParCod_OthHie);
Deg_RenameDegree (Deg_EditingDeg,Cns_SHRT_NAME); Deg_RenameDegree (Deg_EditingDeg,Nam_SHRT_NAME);
} }
void Deg_RenameDegreeFull (void) void Deg_RenameDegreeFull (void)
@ -1291,31 +1290,31 @@ void Deg_RenameDegreeFull (void)
/***** Rename degree *****/ /***** Rename degree *****/
Deg_EditingDeg->HieCod = ParCod_GetAndCheckPar (ParCod_OthHie); Deg_EditingDeg->HieCod = ParCod_GetAndCheckPar (ParCod_OthHie);
Deg_RenameDegree (Deg_EditingDeg,Cns_FULL_NAME); Deg_RenameDegree (Deg_EditingDeg,Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
/************************ Change the name of a degree ************************/ /************************ Change the name of a degree ************************/
/*****************************************************************************/ /*****************************************************************************/
void Deg_RenameDegree (struct Hie_Node *Deg,Cns_ShrtOrFullName_t ShrtOrFullName) void Deg_RenameDegree (struct Hie_Node *Deg,Nam_ShrtOrFullName_t ShrtOrFullName)
{ {
extern const char *Cns_ParShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ParShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern unsigned Cns_MaxBytesShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern unsigned Nam_MaxBytesShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_degree_X_already_exists; extern const char *Txt_The_degree_X_already_exists;
extern const char *Txt_The_degree_X_has_been_renamed_as_Y; extern const char *Txt_The_degree_X_has_been_renamed_as_Y;
extern const char *Txt_The_name_X_has_not_changed; extern const char *Txt_The_name_X_has_not_changed;
char *CurrentName[Cns_NUM_SHRT_FULL_NAMES] = char *CurrentName[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Deg->ShrtName, [Nam_SHRT_NAME] = Deg->ShrtName,
[Cns_FULL_NAME] = Deg->FullName, [Nam_FULL_NAME] = Deg->FullName,
}; };
char NewName[Cns_MAX_BYTES_FULL_NAME + 1]; char NewName[Nam_MAX_BYTES_FULL_NAME + 1];
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Get the new name for the degree */ /* Get the new name for the degree */
Par_GetParShrtOrFullName (ShrtOrFullName,NewName); Nam_GetParShrtOrFullName (ShrtOrFullName,NewName);
/***** Get data of degree *****/ /***** Get data of degree *****/
Deg_GetDegreeDataByCod (Deg); Deg_GetDegreeDataByCod (Deg);
@ -1328,7 +1327,7 @@ void Deg_RenameDegree (struct Hie_Node *Deg,Cns_ShrtOrFullName_t ShrtOrFullName)
if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names
{ {
/***** If degree was in database... *****/ /***** If degree was in database... *****/
if (Deg_DB_CheckIfDegNameExistsInCtr (Cns_ParShrtOrFullName[ShrtOrFullName], if (Deg_DB_CheckIfDegNameExistsInCtr (Nam_ParShrtOrFullName[ShrtOrFullName],
NewName,Deg->HieCod,Deg->PrtCod)) NewName,Deg->HieCod,Deg->PrtCod))
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
Txt_The_degree_X_already_exists,NewName); Txt_The_degree_X_already_exists,NewName);
@ -1336,7 +1335,7 @@ void Deg_RenameDegree (struct Hie_Node *Deg,Cns_ShrtOrFullName_t ShrtOrFullName)
{ {
/* Update the table changing old name by new name */ /* Update the table changing old name by new name */
Deg_DB_UpdateDegNameDB (Deg->HieCod, Deg_DB_UpdateDegNameDB (Deg->HieCod,
Cns_FldShrtOrFullName[ShrtOrFullName],NewName); Nam_FldShrtOrFullName[ShrtOrFullName],NewName);
/* Write message to show the change made */ /* Write message to show the change made */
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,
@ -1345,7 +1344,7 @@ void Deg_RenameDegree (struct Hie_Node *Deg,Cns_ShrtOrFullName_t ShrtOrFullName)
/* Change current degree name in order to display it properly */ /* Change current degree name in order to display it properly */
Str_Copy (CurrentName[ShrtOrFullName],NewName, Str_Copy (CurrentName[ShrtOrFullName],NewName,
Cns_MaxBytesShrtOrFullName[ShrtOrFullName]); Nam_MaxBytesShrtOrFullName[ShrtOrFullName]);
} }
} }
else // The same name else // The same name
@ -1619,7 +1618,7 @@ static void Deg_EditingDegreeDestructor (void)
/*****************************************************************************/ /*****************************************************************************/
void Deg_GetUsrMainDeg (long UsrCod, void Deg_GetUsrMainDeg (long UsrCod,
char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1], char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1],
Rol_Role_t *MaxRole) Rol_Role_t *MaxRole)
{ {
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
@ -1631,7 +1630,7 @@ void Deg_GetUsrMainDeg (long UsrCod,
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
/* Get degree name (row[0]) */ /* Get degree name (row[0]) */
Str_Copy (ShrtName,row[0],Cns_MAX_BYTES_SHRT_NAME); Str_Copy (ShrtName,row[0],Nam_MAX_BYTES_SHRT_NAME);
/* Get maximum role (row[1]) */ /* Get maximum role (row[1]) */
*MaxRole = Rol_ConvertUnsignedStrToRole (row[1]); *MaxRole = Rol_ConvertUnsignedStrToRole (row[1]);

View File

@ -73,7 +73,7 @@ bool Deg_GetDegreeDataByCod (struct Hie_Node *Deg);
void Deg_RemoveDegreeCompletely (long DegCod); void Deg_RemoveDegreeCompletely (long DegCod);
void Deg_RenameDegreeShort (void); void Deg_RenameDegreeShort (void);
void Deg_RenameDegreeFull (void); void Deg_RenameDegreeFull (void);
void Deg_RenameDegree (struct Hie_Node *Deg,Cns_ShrtOrFullName_t ShrtOrFullName); void Deg_RenameDegree (struct Hie_Node *Deg,Nam_ShrtOrFullName_t ShrtOrFullName);
void Deg_ChangeDegreeType (void); void Deg_ChangeDegreeType (void);
void Deg_ChangeDegWWW (void); void Deg_ChangeDegWWW (void);
void Deg_ChangeDegStatus (void); void Deg_ChangeDegStatus (void);
@ -84,7 +84,7 @@ unsigned Deg_GetCachedNumDegsWithUsrs (Rol_Role_t Role);
void Deg_ListDegsFound (MYSQL_RES **mysql_res,unsigned NumCrss); void Deg_ListDegsFound (MYSQL_RES **mysql_res,unsigned NumCrss);
void Deg_GetUsrMainDeg (long UsrCod, void Deg_GetUsrMainDeg (long UsrCod,
char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1], char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1],
Rol_Role_t *MaxRole); Rol_Role_t *MaxRole);
#endif #endif

View File

@ -266,7 +266,7 @@ static void DegCfg_Center (bool PrintView,bool PutForm)
static void DegCfg_FullName (bool PutForm) static void DegCfg_FullName (bool PutForm)
{ {
HieCfg_Name (PutForm,Hie_DEG,Cns_FULL_NAME); HieCfg_Name (PutForm,Hie_DEG,Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -275,7 +275,7 @@ static void DegCfg_FullName (bool PutForm)
static void DegCfg_ShrtName (bool PutForm) static void DegCfg_ShrtName (bool PutForm)
{ {
HieCfg_Name (PutForm,Hie_DEG,Cns_SHRT_NAME); HieCfg_Name (PutForm,Hie_DEG,Nam_SHRT_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -348,16 +348,16 @@ static void DegCfg_NumCrss (void)
void DegCfg_ChangeDegCtr (void) void DegCfg_ChangeDegCtr (void)
{ {
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_degree_X_already_exists; extern const char *Txt_The_degree_X_already_exists;
extern const char *Txt_The_degree_X_has_been_moved_to_the_center_Y; extern const char *Txt_The_degree_X_has_been_moved_to_the_center_Y;
struct Hie_Node NewCtr; struct Hie_Node NewCtr;
Cns_ShrtOrFullName_t ShrtOrFullName; Nam_ShrtOrFullName_t ShrtOrFullName;
bool Exists; bool Exists;
char *Name[Cns_NUM_SHRT_FULL_NAMES] = char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Gbl.Hierarchy.Node[Hie_DEG].ShrtName, [Nam_SHRT_NAME] = Gbl.Hierarchy.Node[Hie_DEG].ShrtName,
[Cns_FULL_NAME] = Gbl.Hierarchy.Node[Hie_DEG].FullName, [Nam_FULL_NAME] = Gbl.Hierarchy.Node[Hie_DEG].FullName,
}; };
/***** Get parameter with center code *****/ /***** Get parameter with center code *****/
@ -370,16 +370,16 @@ void DegCfg_ChangeDegCtr (void)
Ctr_GetCenterDataByCod (&NewCtr); Ctr_GetCenterDataByCod (&NewCtr);
/***** Check if it already exists a degree with the same name in the new center *****/ /***** Check if it already exists a degree with the same name in the new center *****/
for (ShrtOrFullName = Cns_SHRT_NAME, Exists = false; for (ShrtOrFullName = Nam_SHRT_NAME, Exists = false;
ShrtOrFullName <= Cns_FULL_NAME && !Exists; ShrtOrFullName <= Nam_FULL_NAME && !Exists;
ShrtOrFullName++) ShrtOrFullName++)
if (Deg_DB_CheckIfDegNameExistsInCtr (Cns_FldShrtOrFullName[ShrtOrFullName], if (Deg_DB_CheckIfDegNameExistsInCtr (Nam_FldShrtOrFullName[ShrtOrFullName],
Name[ShrtOrFullName], Names[ShrtOrFullName],
Gbl.Hierarchy.Node[Hie_DEG].HieCod, Gbl.Hierarchy.Node[Hie_DEG].HieCod,
NewCtr.HieCod)) NewCtr.HieCod))
{ {
Ale_CreateAlert (Ale_WARNING,Txt_The_degree_X_already_exists, Ale_CreateAlert (Ale_WARNING,Txt_The_degree_X_already_exists,
Name[ShrtOrFullName]); Names[ShrtOrFullName]);
Exists = true; Exists = true;
} }
if (Exists) if (Exists)
@ -395,7 +395,7 @@ void DegCfg_ChangeDegCtr (void)
/***** Create alert to show the change made *****/ /***** Create alert to show the change made *****/
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,
Txt_The_degree_X_has_been_moved_to_the_center_Y, Txt_The_degree_X_has_been_moved_to_the_center_Y,
Gbl.Hierarchy.Node[Hie_DEG].FullName, Names[Nam_FULL_NAME],
Gbl.Hierarchy.Node[Hie_CTR].FullName); Gbl.Hierarchy.Node[Hie_CTR].FullName);
} }
} }
@ -407,12 +407,12 @@ void DegCfg_ChangeDegCtr (void)
void DegCfg_RenameDegreeShort (void) void DegCfg_RenameDegreeShort (void)
{ {
Deg_RenameDegree (&Gbl.Hierarchy.Node[Hie_DEG],Cns_SHRT_NAME); Deg_RenameDegree (&Gbl.Hierarchy.Node[Hie_DEG],Nam_SHRT_NAME);
} }
void DegCfg_RenameDegreeFull (void) void DegCfg_RenameDegreeFull (void)
{ {
Deg_RenameDegree (&Gbl.Hierarchy.Node[Hie_DEG],Cns_FULL_NAME); Deg_RenameDegree (&Gbl.Hierarchy.Node[Hie_DEG],Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -339,7 +339,7 @@ long Deg_DB_GetCtrCodOfDegreeByCod (long DegCod)
/************* Get the short name of a degree from its code ******************/ /************* Get the short name of a degree from its code ******************/
/*****************************************************************************/ /*****************************************************************************/
void Deg_DB_GetShortNameOfDegreeByCod (long DegCod,char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]) void Deg_DB_GetShortNameOfDegreeByCod (long DegCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1])
{ {
/***** Trivial check: degree code should be > 0 *****/ /***** Trivial check: degree code should be > 0 *****/
if (DegCod <= 0) if (DegCod <= 0)
@ -349,7 +349,7 @@ void Deg_DB_GetShortNameOfDegreeByCod (long DegCod,char ShrtName[Cns_MAX_BYTES_S
} }
/***** Get the short name of a degree from database *****/ /***** Get the short name of a degree from database *****/
DB_QuerySELECTString (ShrtName,Cns_MAX_BYTES_SHRT_NAME, DB_QuerySELECTString (ShrtName,Nam_MAX_BYTES_SHRT_NAME,
"can not get the short name of a degree", "can not get the short name of a degree",
"SELECT ShortName" "SELECT ShortName"
" FROM deg_degrees" " FROM deg_degrees"
@ -689,7 +689,7 @@ void Deg_DB_UpdateDegTypName (long DegTypCod,
/*****************************************************************************/ /*****************************************************************************/
void Deg_DB_UpdateDegNameDB (long DegCod,const char *FldName, void Deg_DB_UpdateDegNameDB (long DegCod,const char *FldName,
const char NewDegName[Cns_MAX_BYTES_FULL_NAME + 1]) const char NewDegName[Nam_MAX_BYTES_FULL_NAME + 1])
{ {
DB_QueryUPDATE ("can not update the name of a degree", DB_QueryUPDATE ("can not update the name of a degree",
"UPDATE deg_degrees" "UPDATE deg_degrees"

View File

@ -47,7 +47,7 @@ void Deg_DB_GetDegTypeNameByCod (struct DegTyp_DegreeType *DegTyp);
unsigned Deg_DB_GetDegreeDataByCod (MYSQL_RES **mysql_res,long DegCod); unsigned Deg_DB_GetDegreeDataByCod (MYSQL_RES **mysql_res,long DegCod);
long Deg_DB_GetInsCodOfDegreeByCod (long DegCod); long Deg_DB_GetInsCodOfDegreeByCod (long DegCod);
long Deg_DB_GetCtrCodOfDegreeByCod (long DegCod); long Deg_DB_GetCtrCodOfDegreeByCod (long DegCod);
void Deg_DB_GetShortNameOfDegreeByCod (long DegCod,char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]); void Deg_DB_GetShortNameOfDegreeByCod (long DegCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1]);
bool Deg_DB_CheckIfDegreeTypeNameExists (const char *DegTypName,long DegTypCod); bool Deg_DB_CheckIfDegreeTypeNameExists (const char *DegTypName,long DegTypCod);
unsigned Deg_DB_GetNumDegsOfType (long DegTypCod); unsigned Deg_DB_GetNumDegsOfType (long DegTypCod);
unsigned Deg_DB_GetDegsOfType (MYSQL_RES **mysql_res,long DegTypCod); unsigned Deg_DB_GetDegsOfType (MYSQL_RES **mysql_res,long DegTypCod);
@ -74,7 +74,7 @@ unsigned Deg_DB_GetNumDegsInCtr (long CtrCod);
void Deg_DB_UpdateDegTypName (long DegTypCod, void Deg_DB_UpdateDegTypName (long DegTypCod,
const char NewNameDegTyp[DegTyp_MAX_BYTES_DEGREE_TYPE_NAME + 1]); const char NewNameDegTyp[DegTyp_MAX_BYTES_DEGREE_TYPE_NAME + 1]);
void Deg_DB_UpdateDegNameDB (long DegCod,const char *FldName, void Deg_DB_UpdateDegNameDB (long DegCod,const char *FldName,
const char NewDegName[Cns_MAX_BYTES_FULL_NAME + 1]); const char NewDegName[Nam_MAX_BYTES_FULL_NAME + 1]);
void Deg_DB_UpdateDegCtr (long DegCod,long NewCtrCod); void Deg_DB_UpdateDegCtr (long DegCod,long NewCtrCod);
void Deg_DB_UpdateDegTyp (long DegCod,long NewDegTypCod); void Deg_DB_UpdateDegTyp (long DegCod,long NewDegTypCod);
void Deg_DB_UpdateDegWWW (long DegCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1]); void Deg_DB_UpdateDegWWW (long DegCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1]);

View File

@ -91,7 +91,7 @@ static void Dpt_GetDepartmentDataFromRow (MYSQL_RES *mysql_res,
static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departments); static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departments);
static void Dpt_PutParDptCod (void *DptCod); static void Dpt_PutParDptCod (void *DptCod);
static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName); static void Dpt_RenameDepartment (Nam_ShrtOrFullName_t ShrtOrFullName);
static void Dpt_PutFormToCreateDepartment (void); static void Dpt_PutFormToCreateDepartment (void);
static void Dpt_PutHeadDepartments (void); static void Dpt_PutHeadDepartments (void);
@ -465,16 +465,16 @@ static void Dpt_GetDepartmentDataFromRow (MYSQL_RES *mysql_res,
static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departments) static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departments)
{ {
extern const char *Txt_Another_institution; extern const char *Txt_Another_institution;
static Act_Action_t ActionRename[Cns_NUM_SHRT_FULL_NAMES] = static Act_Action_t ActionRename[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = ActRenDptSho, [Nam_SHRT_NAME] = ActRenDptSho,
[Cns_FULL_NAME] = ActRenDptFul, [Nam_FULL_NAME] = ActRenDptFul,
}; };
unsigned NumDpt; unsigned NumDpt;
struct Dpt_Department *Dpt; struct Dpt_Department *Dpt;
unsigned NumIns; unsigned NumIns;
struct Hie_Node *Ins; struct Hie_Node *Ins;
const char *Names[Cns_NUM_SHRT_FULL_NAMES]; const char *Names[Nam_NUM_SHRT_FULL_NAMES];
/***** Begin table *****/ /***** Begin table *****/
HTM_TABLE_BeginPadding (2); HTM_TABLE_BeginPadding (2);
@ -534,9 +534,9 @@ static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departm
HTM_TD_End (); HTM_TD_End ();
/* Department short name and full name */ /* Department short name and full name */
Names[Cns_SHRT_NAME] = Dpt->ShrtName; Names[Nam_SHRT_NAME] = Dpt->ShrtName;
Names[Cns_FULL_NAME] = Dpt->FullName; Names[Nam_FULL_NAME] = Dpt->FullName;
Frm_ExistingShortAndFullNames (ActionRename, Nam_ExistingShortAndFullNames (ActionRename,
ParCod_Dpt,Dpt->DptCod, ParCod_Dpt,Dpt->DptCod,
Names, Names,
true); // Put form true); // Put form
@ -648,7 +648,7 @@ void Dpt_RenameDepartShort (void)
Dpt_EditingDepartmentConstructor (); Dpt_EditingDepartmentConstructor ();
/***** Rename department *****/ /***** Rename department *****/
Dpt_RenameDepartment (Cns_SHRT_NAME); Dpt_RenameDepartment (Nam_SHRT_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -661,34 +661,34 @@ void Dpt_RenameDepartFull (void)
Dpt_EditingDepartmentConstructor (); Dpt_EditingDepartmentConstructor ();
/***** Rename department *****/ /***** Rename department *****/
Dpt_RenameDepartment (Cns_FULL_NAME); Dpt_RenameDepartment (Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
/************************ Change the name of a degree ************************/ /************************ Change the name of a degree ************************/
/*****************************************************************************/ /*****************************************************************************/
static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName) static void Dpt_RenameDepartment (Nam_ShrtOrFullName_t ShrtOrFullName)
{ {
extern const char *Cns_ParShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ParShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern unsigned Cns_MaxBytesShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern unsigned Nam_MaxBytesShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_department_X_already_exists; extern const char *Txt_The_department_X_already_exists;
extern const char *Txt_The_department_X_has_been_renamed_as_Y; extern const char *Txt_The_department_X_has_been_renamed_as_Y;
extern const char *Txt_The_name_X_has_not_changed; extern const char *Txt_The_name_X_has_not_changed;
char *CurrentName[Cns_NUM_SHRT_FULL_NAMES] = char *CurrentName[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Dpt_EditingDpt->ShrtName, [Nam_SHRT_NAME] = Dpt_EditingDpt->ShrtName,
[Cns_FULL_NAME] = Dpt_EditingDpt->FullName, [Nam_FULL_NAME] = Dpt_EditingDpt->FullName,
}; };
char NewName[Cns_MAX_BYTES_FULL_NAME + 1]; char NewName[Nam_MAX_BYTES_FULL_NAME + 1];
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Get the code of the department */ /* Get the code of the department */
Dpt_EditingDpt->DptCod = ParCod_GetAndCheckPar (ParCod_Dpt); Dpt_EditingDpt->DptCod = ParCod_GetAndCheckPar (ParCod_Dpt);
/* Get the new name for the department */ /* Get the new name for the department */
Par_GetParShrtOrFullName (ShrtOrFullName,NewName); Nam_GetParShrtOrFullName (ShrtOrFullName,NewName);
/***** Get from the database the old names of the department *****/ /***** Get from the database the old names of the department *****/
Dpt_GetDepartmentDataByCod (Dpt_EditingDpt); Dpt_GetDepartmentDataByCod (Dpt_EditingDpt);
@ -701,7 +701,7 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName)
if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names
{ {
/***** If degree was in database... *****/ /***** If degree was in database... *****/
if (Dpt_DB_CheckIfDepartmentNameExists (Cns_ParShrtOrFullName[ShrtOrFullName], if (Dpt_DB_CheckIfDepartmentNameExists (Nam_ParShrtOrFullName[ShrtOrFullName],
NewName,Dpt_EditingDpt->DptCod)) NewName,Dpt_EditingDpt->DptCod))
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
Txt_The_department_X_already_exists, Txt_The_department_X_already_exists,
@ -710,7 +710,7 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName)
{ {
/* Update the table changing old name by new name */ /* Update the table changing old name by new name */
Dpt_DB_UpdateDptName (Dpt_EditingDpt->DptCod, Dpt_DB_UpdateDptName (Dpt_EditingDpt->DptCod,
Cns_FldShrtOrFullName[ShrtOrFullName],NewName); Nam_FldShrtOrFullName[ShrtOrFullName],NewName);
/* Write message to show the change made */ /* Write message to show the change made */
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,
@ -728,7 +728,7 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Update name *****/ /***** Update name *****/
Str_Copy (CurrentName[ShrtOrFullName],NewName, Str_Copy (CurrentName[ShrtOrFullName],NewName,
Cns_MaxBytesShrtOrFullName[ShrtOrFullName]); Nam_MaxBytesShrtOrFullName[ShrtOrFullName]);
} }
/******************************************************************************/ /******************************************************************************/
@ -796,10 +796,10 @@ static void Dpt_PutFormToCreateDepartment (void)
extern const char *Txt_Another_institution; extern const char *Txt_Another_institution;
unsigned NumIns; unsigned NumIns;
const struct Hie_Node *Ins; const struct Hie_Node *Ins;
const char *Names[Cns_NUM_SHRT_FULL_NAMES] = const char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Dpt_EditingDpt->ShrtName, [Nam_SHRT_NAME] = Dpt_EditingDpt->ShrtName,
[Cns_FULL_NAME] = Dpt_EditingDpt->FullName, [Nam_FULL_NAME] = Dpt_EditingDpt->FullName,
}; };
/***** Begin form to create *****/ /***** Begin form to create *****/
@ -844,7 +844,7 @@ static void Dpt_PutFormToCreateDepartment (void)
HTM_TD_End (); HTM_TD_End ();
/***** Department short name and full name *****/ /***** Department short name and full name *****/
Frm_NewShortAndFullNames (Names); Nam_NewShortAndFullNames (Names);
/***** Department WWW *****/ /***** Department WWW *****/
HTM_TD_Begin ("class=\"LM\""); HTM_TD_Begin ("class=\"LM\"");
@ -895,15 +895,15 @@ static void Dpt_PutHeadDepartments (void)
void Dpt_ReceiveFormNewDpt (void) void Dpt_ReceiveFormNewDpt (void)
{ {
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_department_X_already_exists; extern const char *Txt_The_department_X_already_exists;
extern const char *Txt_Created_new_department_X; extern const char *Txt_Created_new_department_X;
Cns_ShrtOrFullName_t ShrtOrFullName; Nam_ShrtOrFullName_t ShrtOrFullName;
bool Exists; bool Exists;
char *Names[Cns_NUM_SHRT_FULL_NAMES] = char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Dpt_EditingDpt->ShrtName, [Nam_SHRT_NAME] = Dpt_EditingDpt->ShrtName,
[Cns_FULL_NAME] = Dpt_EditingDpt->FullName, [Nam_FULL_NAME] = Dpt_EditingDpt->FullName,
}; };
/***** Department constructor *****/ /***** Department constructor *****/
@ -914,7 +914,7 @@ void Dpt_ReceiveFormNewDpt (void)
Dpt_EditingDpt->InsCod = ParCod_GetAndCheckPar (ParCod_OthIns); Dpt_EditingDpt->InsCod = ParCod_GetAndCheckPar (ParCod_OthIns);
/* Get department short name and full name */ /* Get department short name and full name */
Par_GetParsShrtAndFullName (Names); Nam_GetParsShrtAndFullName (Names);
/* Get department WWW */ /* Get department WWW */
Par_GetParText ("WWW",Dpt_EditingDpt->WWW,Cns_MAX_BYTES_WWW); Par_GetParText ("WWW",Dpt_EditingDpt->WWW,Cns_MAX_BYTES_WWW);
@ -925,10 +925,10 @@ void Dpt_ReceiveFormNewDpt (void)
if (Dpt_EditingDpt->WWW[0]) if (Dpt_EditingDpt->WWW[0])
{ {
/***** If name of department was in database... *****/ /***** If name of department was in database... *****/
for (ShrtOrFullName = Cns_SHRT_NAME, Exists = false; for (ShrtOrFullName = Nam_SHRT_NAME, Exists = false;
ShrtOrFullName <= Cns_FULL_NAME && !Exists; ShrtOrFullName <= Nam_FULL_NAME && !Exists;
ShrtOrFullName++) ShrtOrFullName++)
if (Dpt_DB_CheckIfDepartmentNameExists (Cns_FldShrtOrFullName[ShrtOrFullName], if (Dpt_DB_CheckIfDepartmentNameExists (Nam_FldShrtOrFullName[ShrtOrFullName],
Names[ShrtOrFullName],-1L)) Names[ShrtOrFullName],-1L))
{ {
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
@ -939,9 +939,8 @@ void Dpt_ReceiveFormNewDpt (void)
if (!Exists) // Add new department to database if (!Exists) // Add new department to database
{ {
Dpt_DB_CreateDepartment (Dpt_EditingDpt); Dpt_DB_CreateDepartment (Dpt_EditingDpt);
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,Txt_Created_new_department_X,
Txt_Created_new_department_X, Names[Nam_FULL_NAME]);
Dpt_EditingDpt->FullName);
} }
} }
else // If there is not a web else // If there is not a web

View File

@ -37,8 +37,8 @@ struct Dpt_Department
{ {
long DptCod; long DptCod;
long InsCod; long InsCod;
char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]; char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1];
char FullName[Cns_MAX_BYTES_FULL_NAME + 1]; char FullName[Nam_MAX_BYTES_FULL_NAME + 1];
char WWW[Cns_MAX_BYTES_WWW + 1]; char WWW[Cns_MAX_BYTES_WWW + 1];
unsigned NumTchs; // Non-editing teachers and teachers unsigned NumTchs; // Non-editing teachers and teachers
}; };

View File

@ -30,6 +30,7 @@
#include <stdlib.h> // For free #include <stdlib.h> // For free
#include "swad_action_list.h" #include "swad_action_list.h"
#include "swad_alert.h"
#include "swad_error.h" #include "swad_error.h"
#include "swad_form.h" #include "swad_form.h"
#include "swad_global.h" #include "swad_global.h"
@ -357,42 +358,42 @@ void Frm_LabelColumn (const char *TDClass,const char *Id,const char *Label)
/************************ Write short and full names *************************/ /************************ Write short and full names *************************/
/*****************************************************************************/ /*****************************************************************************/
void Frm_NewShortAndFullNames (const char *Names[Cns_NUM_SHRT_FULL_NAMES]) void Nam_NewShortAndFullNames (const char *Names[Nam_NUM_SHRT_FULL_NAMES])
{ {
extern const char *Cns_ParShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ParShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern unsigned Cns_MaxCharsShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern unsigned Nam_MaxCharsShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Cns_ClassShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ClassShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
Cns_ShrtOrFullName_t ShrtOrFullName; Nam_ShrtOrFullName_t ShrtOrFullName;
for (ShrtOrFullName = Cns_SHRT_NAME; for (ShrtOrFullName = Nam_SHRT_NAME;
ShrtOrFullName <= Cns_FULL_NAME; ShrtOrFullName <= Nam_FULL_NAME;
ShrtOrFullName++) ShrtOrFullName++)
{ {
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
HTM_INPUT_TEXT (Cns_ParShrtOrFullName[ShrtOrFullName], HTM_INPUT_TEXT (Nam_ParShrtOrFullName[ShrtOrFullName],
Cns_MaxCharsShrtOrFullName[ShrtOrFullName], Nam_MaxCharsShrtOrFullName[ShrtOrFullName],
Names[ShrtOrFullName], Names[ShrtOrFullName],
HTM_DONT_SUBMIT_ON_CHANGE, HTM_DONT_SUBMIT_ON_CHANGE,
"class=\"%s INPUT_%s\"" "class=\"%s INPUT_%s\""
" required=\"required\"", " required=\"required\"",
Cns_ClassShrtOrFullName[ShrtOrFullName], Nam_ClassShrtOrFullName[ShrtOrFullName],
The_GetSuffix ()); The_GetSuffix ());
HTM_TD_End (); HTM_TD_End ();
} }
} }
void Frm_ExistingShortAndFullNames (Act_Action_t ActionRename[Cns_NUM_SHRT_FULL_NAMES], void Nam_ExistingShortAndFullNames (Act_Action_t ActionRename[Nam_NUM_SHRT_FULL_NAMES],
ParCod_Param_t ParCod,long Cod, ParCod_Param_t ParCod,long Cod,
const char *Names[Cns_NUM_SHRT_FULL_NAMES], const char *Names[Nam_NUM_SHRT_FULL_NAMES],
bool PutForm) bool PutForm)
{ {
extern const char *Cns_ParShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ParShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern unsigned Cns_MaxCharsShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern unsigned Nam_MaxCharsShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Cns_ClassShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ClassShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
Cns_ShrtOrFullName_t ShrtOrFullName; Nam_ShrtOrFullName_t ShrtOrFullName;
for (ShrtOrFullName = Cns_SHRT_NAME; for (ShrtOrFullName = Nam_SHRT_NAME;
ShrtOrFullName <= Cns_FULL_NAME; ShrtOrFullName <= Nam_FULL_NAME;
ShrtOrFullName++) ShrtOrFullName++)
{ {
HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ());
@ -400,13 +401,13 @@ void Frm_ExistingShortAndFullNames (Act_Action_t ActionRename[Cns_NUM_SHRT_FULL_
{ {
Frm_BeginForm (ActionRename[ShrtOrFullName]); Frm_BeginForm (ActionRename[ShrtOrFullName]);
ParCod_PutPar (ParCod,Cod); ParCod_PutPar (ParCod,Cod);
HTM_INPUT_TEXT (Cns_ParShrtOrFullName[ShrtOrFullName], HTM_INPUT_TEXT (Nam_ParShrtOrFullName[ShrtOrFullName],
Cns_MaxCharsShrtOrFullName[ShrtOrFullName], Nam_MaxCharsShrtOrFullName[ShrtOrFullName],
Names[ShrtOrFullName], Names[ShrtOrFullName],
HTM_SUBMIT_ON_CHANGE, HTM_SUBMIT_ON_CHANGE,
"class=\"%s INPUT_%s\"" "class=\"%s INPUT_%s\""
" required=\"required\"", " required=\"required\"",
Cns_ClassShrtOrFullName[ShrtOrFullName], Nam_ClassShrtOrFullName[ShrtOrFullName],
The_GetSuffix ()); The_GetSuffix ());
Frm_EndForm (); Frm_EndForm ();
} }
@ -415,3 +416,30 @@ void Frm_ExistingShortAndFullNames (Act_Action_t ActionRename[Cns_NUM_SHRT_FULL_
HTM_TD_End (); HTM_TD_End ();
} }
} }
/*****************************************************************************/
/****************** Check if a short or full name exists *********************/
/*****************************************************************************/
bool Nam_CheckIfNameExists (bool (*FuncToCheck) (const char *FldName,const char *Name,
long Cod,long PrtCod,unsigned Year),
char *Names[Nam_NUM_SHRT_FULL_NAMES],
long Cod,long PrtCod,unsigned Year)
{
extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_X_already_exists;
Nam_ShrtOrFullName_t ShrtOrFullName;
for (ShrtOrFullName = Nam_SHRT_NAME;
ShrtOrFullName <= Nam_FULL_NAME;
ShrtOrFullName++)
if (FuncToCheck (Nam_FldShrtOrFullName[ShrtOrFullName],
Names[ShrtOrFullName],Cod,PrtCod,Year))
{
Ale_CreateAlert (Ale_WARNING,NULL,Txt_X_already_exists,
Names[ShrtOrFullName]);
return true; // Exists
}
return false; // Does not exist
}

View File

@ -79,10 +79,15 @@ void Frm_FreeAnchorStr (char **Anchor);
void Frm_LabelColumn (const char *TDClass,const char *Id,const char *Label); void Frm_LabelColumn (const char *TDClass,const char *Id,const char *Label);
void Frm_NewShortAndFullNames (const char *Names[Cns_NUM_SHRT_FULL_NAMES]); void Nam_NewShortAndFullNames (const char *Names[Nam_NUM_SHRT_FULL_NAMES]);
void Frm_ExistingShortAndFullNames (Act_Action_t ActionRename[Cns_NUM_SHRT_FULL_NAMES], void Nam_ExistingShortAndFullNames (Act_Action_t ActionRename[Nam_NUM_SHRT_FULL_NAMES],
ParCod_Param_t ParCod,long Cod, ParCod_Param_t ParCod,long Cod,
const char *Names[Cns_NUM_SHRT_FULL_NAMES], const char *Names[Nam_NUM_SHRT_FULL_NAMES],
bool PutForm); bool PutForm);
bool Nam_CheckIfNameExists (bool (*FuncToCheck) (const char *FldName,const char *Name,
long Cod,long PrtCod,unsigned Year),
char *Names[Nam_NUM_SHRT_FULL_NAMES],
long Cod,long PrtCod,unsigned Year);
#endif #endif

View File

@ -249,8 +249,8 @@ struct Globals
struct struct
{ {
long HieCod; long HieCod;
char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]; char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1];
char CtyName[Cns_MAX_BYTES_FULL_NAME + 1]; char CtyName[Nam_MAX_BYTES_FULL_NAME + 1];
bool Valid; bool Valid;
} InstitutionShrtNameAndCty; } InstitutionShrtNameAndCty;
struct struct

View File

@ -67,7 +67,7 @@ struct GroupData
struct struct
{ {
long RooCod; // Room code long RooCod; // Room code
char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]; // Room short name char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1]; // Room short name
} Room; } Room;
unsigned MaxStudents; unsigned MaxStudents;
int Vacant; int Vacant;
@ -83,7 +83,7 @@ struct Group
struct struct
{ {
long RooCod; // Room code long RooCod; // Room code
char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]; // Room short name char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1]; // Room short name
} Room; } Room;
unsigned NumUsrs[Rol_NUM_ROLES]; // Number of users in the group unsigned NumUsrs[Rol_NUM_ROLES]; // Number of users in the group
unsigned MaxStudents; // Maximum number of students in the group unsigned MaxStudents; // Maximum number of students in the group

View File

@ -85,37 +85,37 @@ void HieCfg_Title (bool PutLink,Hie_Level_t Level)
/******************* Show short/full name in configuration *******************/ /******************* Show short/full name in configuration *******************/
/*****************************************************************************/ /*****************************************************************************/
void HieCfg_Name (bool PutForm,Hie_Level_t Level,Cns_ShrtOrFullName_t ShrtOrFullName) void HieCfg_Name (bool PutForm,Hie_Level_t Level,Nam_ShrtOrFullName_t ShrtOrFullName)
{ {
extern const char *Cns_ParShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ParShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern unsigned Cns_MaxCharsShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern unsigned Nam_MaxCharsShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Cns_ClassShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ClassShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char **Hie_TxtLevel[Hie_NUM_LEVELS]; extern const char **Hie_TxtLevel[Hie_NUM_LEVELS];
extern const char *Txt_Short_name; extern const char *Txt_Short_name;
static Act_Action_t Action[Hie_NUM_LEVELS][Cns_NUM_SHRT_FULL_NAMES] = static Act_Action_t Action[Hie_NUM_LEVELS][Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Hie_INS][Cns_SHRT_NAME] = ActRenInsShoCfg, [Hie_INS][Nam_SHRT_NAME] = ActRenInsShoCfg,
[Hie_INS][Cns_FULL_NAME] = ActRenInsFulCfg, [Hie_INS][Nam_FULL_NAME] = ActRenInsFulCfg,
[Hie_CTR][Cns_SHRT_NAME] = ActRenCtrShoCfg, [Hie_CTR][Nam_SHRT_NAME] = ActRenCtrShoCfg,
[Hie_CTR][Cns_FULL_NAME] = ActRenCtrFulCfg, [Hie_CTR][Nam_FULL_NAME] = ActRenCtrFulCfg,
[Hie_DEG][Cns_SHRT_NAME] = ActRenDegShoCfg, [Hie_DEG][Nam_SHRT_NAME] = ActRenDegShoCfg,
[Hie_DEG][Cns_FULL_NAME] = ActRenDegFulCfg, [Hie_DEG][Nam_FULL_NAME] = ActRenDegFulCfg,
[Hie_CRS][Cns_SHRT_NAME] = ActRenCrsShoCfg, [Hie_CRS][Nam_SHRT_NAME] = ActRenCrsShoCfg,
[Hie_CRS][Cns_FULL_NAME] = ActRenCrsFulCfg, [Hie_CRS][Nam_FULL_NAME] = ActRenCrsFulCfg,
}; };
char *Name[Cns_NUM_SHRT_FULL_NAMES] = char *Name[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Gbl.Hierarchy.Node[Level].ShrtName, [Nam_SHRT_NAME] = Gbl.Hierarchy.Node[Level].ShrtName,
[Cns_FULL_NAME] = Gbl.Hierarchy.Node[Level].FullName, [Nam_FULL_NAME] = Gbl.Hierarchy.Node[Level].FullName,
}; };
/***** Full name *****/ /***** Full name *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
/* Label */ /* Label */
Frm_LabelColumn ("RT",PutForm ? Cns_ParShrtOrFullName[ShrtOrFullName] : Frm_LabelColumn ("RT",PutForm ? Nam_ParShrtOrFullName[ShrtOrFullName] :
NULL, NULL,
ShrtOrFullName == Cns_SHRT_NAME ? Txt_Short_name : ShrtOrFullName == Nam_SHRT_NAME ? Txt_Short_name :
*Hie_TxtLevel[Level]); *Hie_TxtLevel[Level]);
/* Data */ /* Data */
@ -124,15 +124,15 @@ void HieCfg_Name (bool PutForm,Hie_Level_t Level,Cns_ShrtOrFullName_t ShrtOrFull
{ {
/* Form to change full name */ /* Form to change full name */
Frm_BeginForm (Action[Level][ShrtOrFullName]); Frm_BeginForm (Action[Level][ShrtOrFullName]);
HTM_INPUT_TEXT (Cns_ParShrtOrFullName[ShrtOrFullName], HTM_INPUT_TEXT (Nam_ParShrtOrFullName[ShrtOrFullName],
Cns_MaxCharsShrtOrFullName[ShrtOrFullName], Nam_MaxCharsShrtOrFullName[ShrtOrFullName],
Name[ShrtOrFullName], Name[ShrtOrFullName],
HTM_SUBMIT_ON_CHANGE, HTM_SUBMIT_ON_CHANGE,
"id=\"%s\"" "id=\"%s\""
" class=\"%s INPUT_%s\"" " class=\"%s INPUT_%s\""
" required=\"required\"", " required=\"required\"",
Cns_ParShrtOrFullName[ShrtOrFullName], Nam_ParShrtOrFullName[ShrtOrFullName],
Cns_ClassShrtOrFullName[ShrtOrFullName], Nam_ClassShrtOrFullName[ShrtOrFullName],
The_GetSuffix ()); The_GetSuffix ());
Frm_EndForm (); Frm_EndForm ();
} }

View File

@ -34,7 +34,7 @@
/*****************************************************************************/ /*****************************************************************************/
void HieCfg_Title (bool PutLink,Hie_Level_t LogoScope); void HieCfg_Title (bool PutLink,Hie_Level_t LogoScope);
void HieCfg_Name (bool PutForm,Hie_Level_t Level,Cns_ShrtOrFullName_t ShrtOrFullName); void HieCfg_Name (bool PutForm,Hie_Level_t Level,Nam_ShrtOrFullName_t ShrtOrFullName);
void HieCfg_WWW (bool PrintView,bool PutForm,Act_Action_t NextAction, void HieCfg_WWW (bool PrintView,bool PutForm,Act_Action_t NextAction,
const char WWW[Cns_MAX_BYTES_WWW + 1]); const char WWW[Cns_MAX_BYTES_WWW + 1]);
void HieCfg_Shortcut (bool PrintView,ParCod_Param_t ParCode,long HieCod); void HieCfg_Shortcut (bool PrintView,ParCod_Param_t ParCode,long HieCod);

View File

@ -92,8 +92,8 @@ struct Hie_Node
Hie_Status_t Status; // Node status Hie_Status_t Status; // Node status
long RequesterUsrCod; // User code of the person who requested the creation of this node long RequesterUsrCod; // User code of the person who requested the creation of this node
char InstitutionalCod[Hie_MAX_BYTES_INSTITUTIONAL_COD + 1]; // Institutional code of the node char InstitutionalCod[Hie_MAX_BYTES_INSTITUTIONAL_COD + 1]; // Institutional code of the node
char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]; // Short name of the node char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1]; // Short name of the node
char FullName[Cns_MAX_BYTES_FULL_NAME + 1]; // Full name of the node char FullName[Nam_MAX_BYTES_FULL_NAME + 1]; // Full name of the node
char WWW[Cns_MAX_BYTES_WWW + 1]; char WWW[Cns_MAX_BYTES_WWW + 1];
struct struct
{ {

View File

@ -55,7 +55,7 @@ struct Hld_Holiday
{ {
long HldCod; long HldCod;
long PlcCod; long PlcCod;
char PlaceFullName[Cns_MAX_BYTES_FULL_NAME + 1]; char PlaceFullName[Nam_MAX_BYTES_FULL_NAME + 1];
Hld_HolidayType_t HldTyp; Hld_HolidayType_t HldTyp;
struct Dat_Date StartDate; struct Dat_Date StartDate;
struct Dat_Date EndDate; struct Dat_Date EndDate;

View File

@ -638,7 +638,7 @@ void Ins_GetFullListOfInstitutions (long CtyCod)
void Ins_WriteInstitutionNameAndCty (long InsCod) void Ins_WriteInstitutionNameAndCty (long InsCod)
{ {
struct Hie_Node Ins; struct Hie_Node Ins;
char CtyName[Cns_MAX_BYTES_FULL_NAME + 1]; char CtyName[Nam_MAX_BYTES_FULL_NAME + 1];
/***** Get institution short name and country name *****/ /***** Get institution short name and country name *****/
Ins.HieCod = InsCod; Ins.HieCod = InsCod;
@ -746,7 +746,7 @@ void Ins_FlushCacheFullNameAndCtyOfInstitution (void)
} }
void Ins_GetShrtNameAndCtyOfInstitution (struct Hie_Node *Ins, void Ins_GetShrtNameAndCtyOfInstitution (struct Hie_Node *Ins,
char CtyName[Cns_MAX_BYTES_FULL_NAME + 1]) char CtyName[Nam_MAX_BYTES_FULL_NAME + 1])
{ {
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
@ -766,7 +766,7 @@ void Ins_GetShrtNameAndCtyOfInstitution (struct Hie_Node *Ins,
Str_Copy (Ins->ShrtName,Gbl.Cache.InstitutionShrtNameAndCty.ShrtName, Str_Copy (Ins->ShrtName,Gbl.Cache.InstitutionShrtNameAndCty.ShrtName,
sizeof (Ins->ShrtName) - 1); sizeof (Ins->ShrtName) - 1);
Str_Copy (CtyName,Gbl.Cache.InstitutionShrtNameAndCty.CtyName, Str_Copy (CtyName,Gbl.Cache.InstitutionShrtNameAndCty.CtyName,
Cns_MAX_BYTES_FULL_NAME); Nam_MAX_BYTES_FULL_NAME);
return; return;
} }
@ -796,7 +796,7 @@ void Ins_GetShrtNameAndCtyOfInstitution (struct Hie_Node *Ins,
Str_Copy (Ins->ShrtName,Gbl.Cache.InstitutionShrtNameAndCty.ShrtName, Str_Copy (Ins->ShrtName,Gbl.Cache.InstitutionShrtNameAndCty.ShrtName,
sizeof (Ins->ShrtName) - 1); sizeof (Ins->ShrtName) - 1);
Str_Copy (CtyName ,Gbl.Cache.InstitutionShrtNameAndCty.CtyName , Str_Copy (CtyName ,Gbl.Cache.InstitutionShrtNameAndCty.CtyName ,
Cns_MAX_BYTES_FULL_NAME); Nam_MAX_BYTES_FULL_NAME);
Gbl.Cache.InstitutionShrtNameAndCty.Valid = true; Gbl.Cache.InstitutionShrtNameAndCty.Valid = true;
} }
@ -877,10 +877,10 @@ void Ins_WriteSelectorOfInstitution (void)
static void Ins_ListInstitutionsForEdition (void) static void Ins_ListInstitutionsForEdition (void)
{ {
extern const char *Txt_INSTITUTION_STATUS[Hie_NUM_STATUS_TXT]; extern const char *Txt_INSTITUTION_STATUS[Hie_NUM_STATUS_TXT];
static Act_Action_t ActionRename[Cns_NUM_SHRT_FULL_NAMES] = static Act_Action_t ActionRename[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = ActRenInsSho, [Nam_SHRT_NAME] = ActRenInsSho,
[Cns_FULL_NAME] = ActRenInsFul, [Nam_FULL_NAME] = ActRenInsFul,
}; };
unsigned NumIns; unsigned NumIns;
struct Hie_Node *Ins; struct Hie_Node *Ins;
@ -890,7 +890,7 @@ static void Ins_ListInstitutionsForEdition (void)
unsigned NumCtrs; unsigned NumCtrs;
unsigned NumUsrsIns; unsigned NumUsrsIns;
unsigned NumUsrsInCrssOfIns; unsigned NumUsrsInCrssOfIns;
const char *Names[Cns_NUM_SHRT_FULL_NAMES]; const char *Names[Nam_NUM_SHRT_FULL_NAMES];
/***** Initialize structure with user's data *****/ /***** Initialize structure with user's data *****/
Usr_UsrDataConstructor (&UsrDat); Usr_UsrDataConstructor (&UsrDat);
@ -947,9 +947,9 @@ static void Ins_ListInstitutionsForEdition (void)
HTM_TD_End (); HTM_TD_End ();
/* Institution short name and full name */ /* Institution short name and full name */
Names[Cns_SHRT_NAME] = Ins->ShrtName; Names[Nam_SHRT_NAME] = Ins->ShrtName;
Names[Cns_FULL_NAME] = Ins->FullName; Names[Nam_FULL_NAME] = Ins->FullName;
Frm_ExistingShortAndFullNames (ActionRename, Nam_ExistingShortAndFullNames (ActionRename,
ParCod_OthHie,Ins->HieCod, ParCod_OthHie,Ins->HieCod,
Names, Names,
ICanEdit); // Put form? ICanEdit); // Put form?
@ -1123,7 +1123,7 @@ void Ins_RenameInsShort (void)
/***** Rename institution *****/ /***** Rename institution *****/
Ins_EditingIns->HieCod = ParCod_GetAndCheckPar (ParCod_OthHie); Ins_EditingIns->HieCod = ParCod_GetAndCheckPar (ParCod_OthHie);
Ins_RenameInstitution (Ins_EditingIns,Cns_SHRT_NAME); Ins_RenameInstitution (Ins_EditingIns,Nam_SHRT_NAME);
} }
void Ins_RenameInsFull (void) void Ins_RenameInsFull (void)
@ -1133,30 +1133,30 @@ void Ins_RenameInsFull (void)
/***** Rename institution *****/ /***** Rename institution *****/
Ins_EditingIns->HieCod = ParCod_GetAndCheckPar (ParCod_OthHie); Ins_EditingIns->HieCod = ParCod_GetAndCheckPar (ParCod_OthHie);
Ins_RenameInstitution (Ins_EditingIns,Cns_FULL_NAME); Ins_RenameInstitution (Ins_EditingIns,Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
/******************** Change the name of an institution **********************/ /******************** Change the name of an institution **********************/
/*****************************************************************************/ /*****************************************************************************/
void Ins_RenameInstitution (struct Hie_Node *Ins,Cns_ShrtOrFullName_t ShrtOrFullName) void Ins_RenameInstitution (struct Hie_Node *Ins,Nam_ShrtOrFullName_t ShrtOrFullName)
{ {
extern const char *Cns_ParShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ParShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern unsigned Cns_MaxBytesShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern unsigned Nam_MaxBytesShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_institution_X_already_exists; extern const char *Txt_The_institution_X_already_exists;
extern const char *Txt_The_institution_X_has_been_renamed_as_Y; extern const char *Txt_The_institution_X_has_been_renamed_as_Y;
extern const char *Txt_The_name_X_has_not_changed; extern const char *Txt_The_name_X_has_not_changed;
char *CurrentName[Cns_NUM_SHRT_FULL_NAMES] = char *CurrentName[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Ins->ShrtName, [Nam_SHRT_NAME] = Ins->ShrtName,
[Cns_FULL_NAME] = Ins->FullName, [Nam_FULL_NAME] = Ins->FullName,
}; };
char NewName[Cns_MAX_BYTES_FULL_NAME + 1]; char NewName[Nam_MAX_BYTES_FULL_NAME + 1];
/***** Get the new name for the institution from form *****/ /***** Get the new name for the institution from form *****/
Par_GetParShrtOrFullName (ShrtOrFullName,NewName); Nam_GetParShrtOrFullName (ShrtOrFullName,NewName);
/***** Get from the database the old names of the institution *****/ /***** Get from the database the old names of the institution *****/
Ins_GetInstitDataByCod (Ins); Ins_GetInstitDataByCod (Ins);
@ -1169,7 +1169,7 @@ void Ins_RenameInstitution (struct Hie_Node *Ins,Cns_ShrtOrFullName_t ShrtOrFull
if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names
{ {
/***** If institution was in database... *****/ /***** If institution was in database... *****/
if (Ins_DB_CheckIfInsNameExistsInCty (Cns_ParShrtOrFullName[ShrtOrFullName], if (Ins_DB_CheckIfInsNameExistsInCty (Nam_ParShrtOrFullName[ShrtOrFullName],
NewName,Ins->HieCod, NewName,Ins->HieCod,
Gbl.Hierarchy.Node[Hie_CTY].HieCod)) Gbl.Hierarchy.Node[Hie_CTY].HieCod))
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
@ -1179,7 +1179,7 @@ void Ins_RenameInstitution (struct Hie_Node *Ins,Cns_ShrtOrFullName_t ShrtOrFull
{ {
/* Update the table changing old name by new name */ /* Update the table changing old name by new name */
Ins_UpdateInsNameDB (Ins->HieCod, Ins_UpdateInsNameDB (Ins->HieCod,
Cns_FldShrtOrFullName[ShrtOrFullName],NewName); Nam_FldShrtOrFullName[ShrtOrFullName],NewName);
/* Create message to show the change made */ /* Create message to show the change made */
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,
@ -1188,7 +1188,7 @@ void Ins_RenameInstitution (struct Hie_Node *Ins,Cns_ShrtOrFullName_t ShrtOrFull
/* Change current institution name in order to display it properly */ /* Change current institution name in order to display it properly */
Str_Copy (CurrentName[ShrtOrFullName],NewName, Str_Copy (CurrentName[ShrtOrFullName],NewName,
Cns_MaxBytesShrtOrFullName[ShrtOrFullName]); Nam_MaxBytesShrtOrFullName[ShrtOrFullName]);
} }
} }
else // The same name else // The same name
@ -1331,10 +1331,10 @@ static void Ins_ShowAlertAndButtonToGoToIns (void)
static void Ins_PutFormToCreateInstitution (void) static void Ins_PutFormToCreateInstitution (void)
{ {
Act_Action_t NextAction = ActUnk; Act_Action_t NextAction = ActUnk;
const char *Names[Cns_NUM_SHRT_FULL_NAMES] = const char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Ins_EditingIns->ShrtName, [Nam_SHRT_NAME] = Ins_EditingIns->ShrtName,
[Cns_FULL_NAME] = Ins_EditingIns->FullName, [Nam_FULL_NAME] = Ins_EditingIns->FullName,
}; };
/***** Set action depending on role *****/ /***** Set action depending on role *****/
@ -1370,7 +1370,7 @@ static void Ins_PutFormToCreateInstitution (void)
HTM_TD_End (); HTM_TD_End ();
/***** Institution short name and full name *****/ /***** Institution short name and full name *****/
Frm_NewShortAndFullNames (Names); Nam_NewShortAndFullNames (Names);
/***** Institution WWW *****/ /***** Institution WWW *****/
HTM_TD_Begin ("class=\"LM\""); HTM_TD_Begin ("class=\"LM\"");
@ -1479,17 +1479,17 @@ void Ins_ReceiveFormNewIns (void)
static void Ins_ReceiveFormRequestOrCreateIns (Hie_Status_t Status) static void Ins_ReceiveFormRequestOrCreateIns (Hie_Status_t Status)
{ {
extern const char *Cns_ParShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ParShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern unsigned Cns_MaxBytesShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern unsigned Nam_MaxBytesShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_institution_X_already_exists; extern const char *Txt_The_institution_X_already_exists;
extern const char *Txt_Created_new_institution_X; extern const char *Txt_Created_new_institution_X;
Cns_ShrtOrFullName_t ShrtOrFullName; Nam_ShrtOrFullName_t ShrtOrFullName;
bool Exists; bool Exists;
char *Names[Cns_NUM_SHRT_FULL_NAMES] = char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Ins_EditingIns->ShrtName, [Nam_SHRT_NAME] = Ins_EditingIns->ShrtName,
[Cns_FULL_NAME] = Ins_EditingIns->FullName, [Nam_FULL_NAME] = Ins_EditingIns->FullName,
}; };
/***** Get parameters from form *****/ /***** Get parameters from form *****/
@ -1497,7 +1497,7 @@ static void Ins_ReceiveFormRequestOrCreateIns (Hie_Status_t Status)
Ins_EditingIns->PrtCod = Gbl.Hierarchy.Node[Hie_CTY].HieCod; Ins_EditingIns->PrtCod = Gbl.Hierarchy.Node[Hie_CTY].HieCod;
/* Get institution short name, full name and WWW */ /* Get institution short name, full name and WWW */
Par_GetParsShrtAndFullName (Names); Nam_GetParsShrtAndFullName (Names);
/* Get institution URL */ /* Get institution URL */
Par_GetParText ("WWW",Ins_EditingIns->WWW,Cns_MAX_BYTES_WWW); Par_GetParText ("WWW",Ins_EditingIns->WWW,Cns_MAX_BYTES_WWW);
@ -1508,10 +1508,10 @@ static void Ins_ReceiveFormRequestOrCreateIns (Hie_Status_t Status)
if (Ins_EditingIns->WWW[0]) if (Ins_EditingIns->WWW[0])
{ {
/***** If name of institution was in database... *****/ /***** If name of institution was in database... *****/
for (ShrtOrFullName = Cns_SHRT_NAME, Exists = false; for (ShrtOrFullName = Nam_SHRT_NAME, Exists = false;
ShrtOrFullName <= Cns_FULL_NAME && !Exists; ShrtOrFullName <= Nam_FULL_NAME && !Exists;
ShrtOrFullName++) ShrtOrFullName++)
if (Ins_DB_CheckIfInsNameExistsInCty (Cns_FldShrtOrFullName[ShrtOrFullName], if (Ins_DB_CheckIfInsNameExistsInCty (Nam_FldShrtOrFullName[ShrtOrFullName],
Names[ShrtOrFullName], Names[ShrtOrFullName],
-1L,Gbl.Hierarchy.Node[Hie_CTY].HieCod)) -1L,Gbl.Hierarchy.Node[Hie_CTY].HieCod))
{ {
@ -1523,9 +1523,8 @@ static void Ins_ReceiveFormRequestOrCreateIns (Hie_Status_t Status)
if (!Exists) // Add new institution to database if (!Exists) // Add new institution to database
{ {
Ins_EditingIns->HieCod = Ins_DB_CreateInstitution (Ins_EditingIns,Status); Ins_EditingIns->HieCod = Ins_DB_CreateInstitution (Ins_EditingIns,Status);
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,Txt_Created_new_institution_X,
Txt_Created_new_institution_X, Names[Nam_FULL_NAME]);
Ins_EditingIns->FullName);
} }
} }
else // If there is not a web else // If there is not a web

View File

@ -51,14 +51,14 @@ void Ins_WriteInstitutionNameAndCty (long InsCod);
bool Ins_GetInstitDataByCod (struct Hie_Node *Ins); bool Ins_GetInstitDataByCod (struct Hie_Node *Ins);
void Ins_FlushCacheFullNameAndCtyOfInstitution (void); void Ins_FlushCacheFullNameAndCtyOfInstitution (void);
void Ins_GetShrtNameAndCtyOfInstitution (struct Hie_Node *Ins, void Ins_GetShrtNameAndCtyOfInstitution (struct Hie_Node *Ins,
char CtyName[Cns_MAX_BYTES_FULL_NAME + 1]); char CtyName[Nam_MAX_BYTES_FULL_NAME + 1]);
void Ins_WriteSelectorOfInstitution (void); void Ins_WriteSelectorOfInstitution (void);
void Ins_RemoveInstitution (void); void Ins_RemoveInstitution (void);
void Ins_RenameInsShort (void); void Ins_RenameInsShort (void);
void Ins_RenameInsFull (void); void Ins_RenameInsFull (void);
void Ins_RenameInstitution (struct Hie_Node *Ins,Cns_ShrtOrFullName_t ShrtOrFullName); void Ins_RenameInstitution (struct Hie_Node *Ins,Nam_ShrtOrFullName_t ShrtOrFullName);
void Ins_ChangeInsWWW (void); void Ins_ChangeInsWWW (void);
void Ins_ChangeInsStatus (void); void Ins_ChangeInsStatus (void);
void Ins_ContEditAfterChgIns (void); void Ins_ContEditAfterChgIns (void);

View File

@ -368,7 +368,7 @@ static void InsCfg_Country (bool PrintView,bool PutForm)
static void InsCfg_FullName (bool PutForm) static void InsCfg_FullName (bool PutForm)
{ {
HieCfg_Name (PutForm,Hie_INS,Cns_FULL_NAME); HieCfg_Name (PutForm,Hie_INS,Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -377,7 +377,7 @@ static void InsCfg_FullName (bool PutForm)
static void InsCfg_ShrtName (bool PutForm) static void InsCfg_ShrtName (bool PutForm)
{ {
HieCfg_Name (PutForm,Hie_INS,Cns_SHRT_NAME); HieCfg_Name (PutForm,Hie_INS,Nam_SHRT_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -533,16 +533,16 @@ void InsCfg_RemoveLogo (void)
void InsCfg_ChangeInsCty (void) void InsCfg_ChangeInsCty (void)
{ {
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_institution_X_already_exists; extern const char *Txt_The_institution_X_already_exists;
extern const char *Txt_The_country_of_the_institution_X_has_changed_to_Y; extern const char *Txt_The_country_of_the_institution_X_has_changed_to_Y;
struct Hie_Node NewCty; struct Hie_Node NewCty;
Cns_ShrtOrFullName_t ShrtOrFullName; Nam_ShrtOrFullName_t ShrtOrFullName;
bool Exists; bool Exists;
char *Name[Cns_NUM_SHRT_FULL_NAMES] = char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Gbl.Hierarchy.Node[Hie_INS].ShrtName, [Nam_SHRT_NAME] = Gbl.Hierarchy.Node[Hie_INS].ShrtName,
[Cns_FULL_NAME] = Gbl.Hierarchy.Node[Hie_INS].FullName, [Nam_FULL_NAME] = Gbl.Hierarchy.Node[Hie_INS].FullName,
}; };
/***** Get the new country code for the institution *****/ /***** Get the new country code for the institution *****/
@ -555,16 +555,16 @@ void InsCfg_ChangeInsCty (void)
Cty_GetBasicCountryDataByCod (&NewCty); Cty_GetBasicCountryDataByCod (&NewCty);
/***** Check if it already exists an institution with the same name in the new country *****/ /***** Check if it already exists an institution with the same name in the new country *****/
for (ShrtOrFullName = Cns_SHRT_NAME, Exists = false; for (ShrtOrFullName = Nam_SHRT_NAME, Exists = false;
ShrtOrFullName <= Cns_FULL_NAME && !Exists; ShrtOrFullName <= Nam_FULL_NAME && !Exists;
ShrtOrFullName++) ShrtOrFullName++)
if (Ins_DB_CheckIfInsNameExistsInCty (Cns_FldShrtOrFullName[ShrtOrFullName], if (Ins_DB_CheckIfInsNameExistsInCty (Nam_FldShrtOrFullName[ShrtOrFullName],
Name[ShrtOrFullName], Names[ShrtOrFullName],
-1L,NewCty.HieCod)) -1L,NewCty.HieCod))
{ {
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
Txt_The_institution_X_already_exists, Txt_The_institution_X_already_exists,
Name[ShrtOrFullName]); Names[ShrtOrFullName]);
Exists = true; Exists = true;
} }
if (!Exists) if (!Exists)
@ -580,7 +580,7 @@ void InsCfg_ChangeInsCty (void)
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,
Txt_The_country_of_the_institution_X_has_changed_to_Y, Txt_The_country_of_the_institution_X_has_changed_to_Y,
Gbl.Hierarchy.Node[Hie_INS].FullName,NewCty.FullName); Names[Nam_FULL_NAME],NewCty.FullName);
} }
} }
} }
@ -592,13 +592,13 @@ void InsCfg_ChangeInsCty (void)
void InsCfg_RenameInsShort (void) void InsCfg_RenameInsShort (void)
{ {
/***** Rename institution *****/ /***** Rename institution *****/
Ins_RenameInstitution (&Gbl.Hierarchy.Node[Hie_INS],Cns_SHRT_NAME); Ins_RenameInstitution (&Gbl.Hierarchy.Node[Hie_INS],Nam_SHRT_NAME);
} }
void InsCfg_RenameInsFull (void) void InsCfg_RenameInsFull (void)
{ {
/***** Rename institution *****/ /***** Rename institution *****/
Ins_RenameInstitution (&Gbl.Hierarchy.Node[Hie_INS],Cns_FULL_NAME); Ins_RenameInstitution (&Gbl.Hierarchy.Node[Hie_INS],Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -148,7 +148,7 @@ unsigned Ins_DB_GetInsDataByCod (MYSQL_RES **mysql_res,long InsCod)
/*********** Get the short name of an institution from its code **************/ /*********** Get the short name of an institution from its code **************/
/*****************************************************************************/ /*****************************************************************************/
void Ins_DB_GetInsShrtName (long InsCod,char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]) void Ins_DB_GetInsShrtName (long InsCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1])
{ {
/***** Trivial check: institution code should be > 0 *****/ /***** Trivial check: institution code should be > 0 *****/
if (InsCod <= 0) if (InsCod <= 0)
@ -158,7 +158,7 @@ void Ins_DB_GetInsShrtName (long InsCod,char ShrtName[Cns_MAX_BYTES_SHRT_NAME +
} }
/***** Get short name of institution from database *****/ /***** Get short name of institution from database *****/
DB_QuerySELECTString (ShrtName,Cns_MAX_BYTES_SHRT_NAME, DB_QuerySELECTString (ShrtName,Nam_MAX_BYTES_SHRT_NAME,
"can not get the short name of an institution", "can not get the short name of an institution",
"SELECT ShortName" "SELECT ShortName"
" FROM ins_instits" " FROM ins_instits"

View File

@ -44,7 +44,7 @@ void Ins_DB_UpdateInsName (long InsCod,const char *FldName,const char *NewName);
void Ins_DB_UpdateInsWWW (long InsCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1]); void Ins_DB_UpdateInsWWW (long InsCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1]);
unsigned Ins_DB_GetInsDataByCod (MYSQL_RES **mysql_res,long InsCod); unsigned Ins_DB_GetInsDataByCod (MYSQL_RES **mysql_res,long InsCod);
void Ins_DB_GetInsShrtName (long InsCod,char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]); void Ins_DB_GetInsShrtName (long InsCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1]);
unsigned Ins_DB_GetInsShrtNameAndCty (MYSQL_RES **mysql_res,long InsCod); unsigned Ins_DB_GetInsShrtNameAndCty (MYSQL_RES **mysql_res,long InsCod);
bool Ins_DB_CheckIfInsNameExistsInCty (const char *FldName, bool Ins_DB_CheckIfInsNameExistsInCty (const char *FldName,
const char *Name, const char *Name,

View File

@ -96,7 +96,7 @@ static void Lnk_FreeListLinks (struct Lnk_Links *Links);
static void Lnk_ListLinksForEdition (const struct Lnk_Links *Links); static void Lnk_ListLinksForEdition (const struct Lnk_Links *Links);
static void Lnk_PutParLnkCod (void *LnkCod); static void Lnk_PutParLnkCod (void *LnkCod);
static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName); static void Lnk_RenameLink (Nam_ShrtOrFullName_t ShrtOrFullName);
static void Lnk_PutFormToCreateLink (void); static void Lnk_PutFormToCreateLink (void);
static void Lnk_PutHeadLinks (void); static void Lnk_PutHeadLinks (void);
@ -397,14 +397,14 @@ static void Lnk_FreeListLinks (struct Lnk_Links *Links)
static void Lnk_ListLinksForEdition (const struct Lnk_Links *Links) static void Lnk_ListLinksForEdition (const struct Lnk_Links *Links)
{ {
static Act_Action_t ActionRename[Cns_NUM_SHRT_FULL_NAMES] = static Act_Action_t ActionRename[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = ActRenLnkSho, [Nam_SHRT_NAME] = ActRenLnkSho,
[Cns_FULL_NAME] = ActRenLnkFul, [Nam_FULL_NAME] = ActRenLnkFul,
}; };
unsigned NumLnk; unsigned NumLnk;
struct Lnk_Link *Lnk; struct Lnk_Link *Lnk;
const char *Names[Cns_NUM_SHRT_FULL_NAMES]; const char *Names[Nam_NUM_SHRT_FULL_NAMES];
/***** Begin table *****/ /***** Begin table *****/
HTM_TABLE_BeginWidePadding (2); HTM_TABLE_BeginWidePadding (2);
@ -433,9 +433,9 @@ static void Lnk_ListLinksForEdition (const struct Lnk_Links *Links)
HTM_TD_End (); HTM_TD_End ();
/* Link short name and full name */ /* Link short name and full name */
Names[Cns_SHRT_NAME] = Lnk->ShrtName; Names[Nam_SHRT_NAME] = Lnk->ShrtName;
Names[Cns_FULL_NAME] = Lnk->FullName; Names[Nam_FULL_NAME] = Lnk->FullName;
Frm_ExistingShortAndFullNames (ActionRename, Nam_ExistingShortAndFullNames (ActionRename,
ParCod_Lnk,Lnk->LnkCod, ParCod_Lnk,Lnk->LnkCod,
Names, Names,
true); // Put form true); // Put form
@ -504,7 +504,7 @@ void Lnk_RenameLinkShort (void)
Lnk_EditingLinkConstructor (); Lnk_EditingLinkConstructor ();
/***** Rename link *****/ /***** Rename link *****/
Lnk_RenameLink (Cns_SHRT_NAME); Lnk_RenameLink (Nam_SHRT_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -517,34 +517,34 @@ void Lnk_RenameLinkFull (void)
Lnk_EditingLinkConstructor (); Lnk_EditingLinkConstructor ();
/***** Rename link *****/ /***** Rename link *****/
Lnk_RenameLink (Cns_FULL_NAME); Lnk_RenameLink (Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
/************************ Change the name of a link **************************/ /************************ Change the name of a link **************************/
/*****************************************************************************/ /*****************************************************************************/
static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName) static void Lnk_RenameLink (Nam_ShrtOrFullName_t ShrtOrFullName)
{ {
extern const char *Cns_ParShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ParShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern unsigned Cns_MaxBytesShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern unsigned Nam_MaxBytesShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_link_X_already_exists; extern const char *Txt_The_link_X_already_exists;
extern const char *Txt_The_link_X_has_been_renamed_as_Y; extern const char *Txt_The_link_X_has_been_renamed_as_Y;
extern const char *Txt_The_name_X_has_not_changed; extern const char *Txt_The_name_X_has_not_changed;
char *CurrentName[Cns_NUM_SHRT_FULL_NAMES] = char *CurrentName[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Lnk_EditingLnk->ShrtName, [Nam_SHRT_NAME] = Lnk_EditingLnk->ShrtName,
[Cns_FULL_NAME] = Lnk_EditingLnk->FullName, [Nam_FULL_NAME] = Lnk_EditingLnk->FullName,
}; };
char NewName[Cns_MAX_BYTES_FULL_NAME + 1]; char NewName[Nam_MAX_BYTES_FULL_NAME + 1];
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Get the code of the link */ /* Get the code of the link */
Lnk_EditingLnk->LnkCod = ParCod_GetAndCheckPar (ParCod_Lnk); Lnk_EditingLnk->LnkCod = ParCod_GetAndCheckPar (ParCod_Lnk);
/* Get the new name for the link */ /* Get the new name for the link */
Par_GetParShrtOrFullName (ShrtOrFullName,NewName); Nam_GetParShrtOrFullName (ShrtOrFullName,NewName);
/***** Get link data from the database *****/ /***** Get link data from the database *****/
Lnk_GetLinkDataByCod (Lnk_EditingLnk); Lnk_GetLinkDataByCod (Lnk_EditingLnk);
@ -557,7 +557,7 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName)
if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names
{ {
/***** If link was in database... *****/ /***** If link was in database... *****/
if (Lnk_DB_CheckIfLinkNameExists (Cns_ParShrtOrFullName[ShrtOrFullName], if (Lnk_DB_CheckIfLinkNameExists (Nam_ParShrtOrFullName[ShrtOrFullName],
NewName,Lnk_EditingLnk->LnkCod)) NewName,Lnk_EditingLnk->LnkCod))
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
Txt_The_link_X_already_exists, Txt_The_link_X_already_exists,
@ -566,7 +566,7 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName)
{ {
/* Update the table changing old name by new name */ /* Update the table changing old name by new name */
Lnk_DB_UpdateLnkName (Lnk_EditingLnk->LnkCod, Lnk_DB_UpdateLnkName (Lnk_EditingLnk->LnkCod,
Cns_FldShrtOrFullName[ShrtOrFullName],NewName); Nam_FldShrtOrFullName[ShrtOrFullName],NewName);
/* Write message to show the change made */ /* Write message to show the change made */
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,
@ -584,7 +584,7 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Update name *****/ /***** Update name *****/
Str_Copy (CurrentName[ShrtOrFullName],NewName, Str_Copy (CurrentName[ShrtOrFullName],NewName,
Cns_MaxBytesShrtOrFullName[ShrtOrFullName]); Nam_MaxBytesShrtOrFullName[ShrtOrFullName]);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -649,10 +649,10 @@ void Lnk_ContEditAfterChgLnk (void)
static void Lnk_PutFormToCreateLink (void) static void Lnk_PutFormToCreateLink (void)
{ {
const char *Names[Cns_NUM_SHRT_FULL_NAMES] = const char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Lnk_EditingLnk->ShrtName, [Nam_SHRT_NAME] = Lnk_EditingLnk->ShrtName,
[Cns_FULL_NAME] = Lnk_EditingLnk->FullName, [Nam_FULL_NAME] = Lnk_EditingLnk->FullName,
}; };
/***** Begin form to create *****/ /***** Begin form to create *****/
@ -672,7 +672,7 @@ static void Lnk_PutFormToCreateLink (void)
HTM_TD_End (); HTM_TD_End ();
/***** Link short name and full name *****/ /***** Link short name and full name *****/
Frm_NewShortAndFullNames (Names); Nam_NewShortAndFullNames (Names);
/***** Link WWW *****/ /***** Link WWW *****/
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
@ -714,18 +714,18 @@ static void Lnk_PutHeadLinks (void)
void Lnk_ReceiveFormNewLink (void) void Lnk_ReceiveFormNewLink (void)
{ {
extern const char *Cns_ParShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ParShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern unsigned Cns_MaxBytesShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern unsigned Nam_MaxBytesShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_link_X_already_exists; extern const char *Txt_The_link_X_already_exists;
extern const char *Txt_You_must_specify_the_web_address; extern const char *Txt_You_must_specify_the_web_address;
extern const char *Txt_Created_new_link_X; extern const char *Txt_Created_new_link_X;
Cns_ShrtOrFullName_t ShrtOrFullName; Nam_ShrtOrFullName_t ShrtOrFullName;
bool Exists; bool Exists;
char *Names[Cns_NUM_SHRT_FULL_NAMES] = char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Lnk_EditingLnk->ShrtName, [Nam_SHRT_NAME] = Lnk_EditingLnk->ShrtName,
[Cns_FULL_NAME] = Lnk_EditingLnk->FullName, [Nam_FULL_NAME] = Lnk_EditingLnk->FullName,
}; };
/***** Link constructor *****/ /***** Link constructor *****/
@ -733,7 +733,7 @@ void Lnk_ReceiveFormNewLink (void)
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Get link short name and full name */ /* Get link short name and full name */
Par_GetParsShrtAndFullName (Names); Nam_GetParsShrtAndFullName (Names);
/* Get link URL */ /* Get link URL */
Par_GetParText ("WWW",Lnk_EditingLnk->WWW,Cns_MAX_BYTES_WWW); Par_GetParText ("WWW",Lnk_EditingLnk->WWW,Cns_MAX_BYTES_WWW);
@ -742,10 +742,10 @@ void Lnk_ReceiveFormNewLink (void)
Lnk_EditingLnk->FullName[0]) // If there's a link name Lnk_EditingLnk->FullName[0]) // If there's a link name
{ {
/***** If name of link was in database... *****/ /***** If name of link was in database... *****/
for (ShrtOrFullName = Cns_SHRT_NAME, Exists = false; for (ShrtOrFullName = Nam_SHRT_NAME, Exists = false;
ShrtOrFullName <= Cns_FULL_NAME && !Exists; ShrtOrFullName <= Nam_FULL_NAME && !Exists;
ShrtOrFullName++) ShrtOrFullName++)
if (Lnk_DB_CheckIfLinkNameExists (Cns_FldShrtOrFullName[ShrtOrFullName], if (Lnk_DB_CheckIfLinkNameExists (Nam_FldShrtOrFullName[ShrtOrFullName],
Names[ShrtOrFullName],-1L)) Names[ShrtOrFullName],-1L))
{ {
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
@ -761,9 +761,8 @@ void Lnk_ReceiveFormNewLink (void)
else // Add new link to database else // Add new link to database
{ {
Lnk_DB_CreateLink (Lnk_EditingLnk); Lnk_DB_CreateLink (Lnk_EditingLnk);
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,Txt_Created_new_link_X,
Txt_Created_new_link_X, Names[Nam_FULL_NAME]);
Lnk_EditingLnk->ShrtName);
} }
} }
} }

View File

@ -30,8 +30,8 @@
struct Lnk_Link struct Lnk_Link
{ {
long LnkCod; long LnkCod;
char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]; char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1];
char FullName[Cns_MAX_BYTES_FULL_NAME + 1]; char FullName[Nam_MAX_BYTES_FULL_NAME + 1];
char WWW[Cns_MAX_BYTES_WWW + 1]; char WWW[Cns_MAX_BYTES_WWW + 1];
}; };

View File

@ -91,7 +91,7 @@ static void Mai_FreeListMailDomains (struct Mai_Mails *Mails);
static void Mai_ListMailDomainsForEdition (const struct Mai_Mails *Mails); static void Mai_ListMailDomainsForEdition (const struct Mai_Mails *Mails);
static void Mai_PutParMaiCod (void *MaiCod); static void Mai_PutParMaiCod (void *MaiCod);
static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName); static void Mai_RenameMailDomain (Nam_ShrtOrFullName_t ShrtOrFullName);
static void Mai_PutFormToCreateMailDomain (void); static void Mai_PutFormToCreateMailDomain (void);
static void Mai_PutHeadMailDomains (void); static void Mai_PutHeadMailDomains (void);
@ -565,7 +565,7 @@ void Mai_RenameMailDomainShort (void)
Mai_EditingMailDomainConstructor (); Mai_EditingMailDomainConstructor ();
/***** Rename mail domain *****/ /***** Rename mail domain *****/
Mai_RenameMailDomain (Cns_SHRT_NAME); Mai_RenameMailDomain (Nam_SHRT_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -578,37 +578,37 @@ void Mai_RenameMailDomainFull (void)
Mai_EditingMailDomainConstructor (); Mai_EditingMailDomainConstructor ();
/***** Rename mail domain *****/ /***** Rename mail domain *****/
Mai_RenameMailDomain (Cns_FULL_NAME); Mai_RenameMailDomain (Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
/************************* Change the name of a mail *************************/ /************************* Change the name of a mail *************************/
/*****************************************************************************/ /*****************************************************************************/
static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName) static void Mai_RenameMailDomain (Nam_ShrtOrFullName_t ShrtOrFullName)
{ {
extern const char *Txt_The_email_domain_X_already_exists; extern const char *Txt_The_email_domain_X_already_exists;
extern const char *Txt_The_email_domain_X_has_been_renamed_as_Y; extern const char *Txt_The_email_domain_X_has_been_renamed_as_Y;
extern const char *Txt_The_email_domain_X_has_not_changed; extern const char *Txt_The_email_domain_X_has_not_changed;
static const char *ParName[Cns_NUM_SHRT_FULL_NAMES] = static const char *ParName[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = "Domain", [Nam_SHRT_NAME] = "Domain",
[Cns_FULL_NAME] = "Info", [Nam_FULL_NAME] = "Info",
}; };
static const char *FldName[Cns_NUM_SHRT_FULL_NAMES] = static const char *FldName[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = "Domain", [Nam_SHRT_NAME] = "Domain",
[Cns_FULL_NAME] = "Info", [Nam_FULL_NAME] = "Info",
}; };
static unsigned MaxBytes[Cns_NUM_SHRT_FULL_NAMES] = static unsigned MaxBytes[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Cns_MAX_BYTES_EMAIL_ADDRESS, [Nam_SHRT_NAME] = Cns_MAX_BYTES_EMAIL_ADDRESS,
[Cns_FULL_NAME] = Mai_MAX_BYTES_MAIL_INFO, [Nam_FULL_NAME] = Mai_MAX_BYTES_MAIL_INFO,
}; };
char *CurrentName[Cns_NUM_SHRT_FULL_NAMES] = char *CurrentName[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Mai_EditingMai->Domain, [Nam_SHRT_NAME] = Mai_EditingMai->Domain,
[Cns_FULL_NAME] = Mai_EditingMai->Info, [Nam_FULL_NAME] = Mai_EditingMai->Info,
}; };
char NewName[Mai_MAX_BYTES_MAIL_INFO + 1]; char NewName[Mai_MAX_BYTES_MAIL_INFO + 1];

View File

@ -63,7 +63,7 @@ typedef enum
struct Msg_Course struct Msg_Course
{ {
long CrsCod; long CrsCod;
char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]; char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1];
}; // Distinct courses in my messages sent or received }; // Distinct courses in my messages sent or received
struct Msg_Messages struct Msg_Messages
@ -72,7 +72,7 @@ struct Msg_Messages
unsigned NumMsgs; unsigned NumMsgs;
char Subject[Cns_MAX_BYTES_SUBJECT + 1]; char Subject[Cns_MAX_BYTES_SUBJECT + 1];
long FilterCrsCod; // Show only messages sent from this course code long FilterCrsCod; // Show only messages sent from this course code
char FilterCrsShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]; char FilterCrsShrtName[Nam_MAX_BYTES_SHRT_NAME + 1];
char FilterFromTo[Usr_MAX_BYTES_FULL_NAME + 1]; // Show only messages from/to these users char FilterFromTo[Usr_MAX_BYTES_FULL_NAME + 1]; // Show only messages from/to these users
char FilterContent[Msg_MAX_BYTES_FILTER_CONTENT + 1]; // Show only messages that match this content char FilterContent[Msg_MAX_BYTES_FILTER_CONTENT + 1]; // Show only messages that match this content
bool ShowOnlyUnreadMsgs; // Show only unread messages (this option is applicable only for received messages) bool ShowOnlyUnreadMsgs; // Show only unread messages (this option is applicable only for received messages)

View File

@ -912,23 +912,23 @@ unsigned Par_GetParText (const char *ParName,char *ParValue,size_t MaxBytes)
/************************ Get short name and full name ***********************/ /************************ Get short name and full name ***********************/
/*****************************************************************************/ /*****************************************************************************/
void Par_GetParsShrtAndFullName (char *Names[Cns_NUM_SHRT_FULL_NAMES]) void Nam_GetParsShrtAndFullName (char *Names[Nam_NUM_SHRT_FULL_NAMES])
{ {
Cns_ShrtOrFullName_t ShrtOrFullName; Nam_ShrtOrFullName_t ShrtOrFullName;
for (ShrtOrFullName = Cns_SHRT_NAME; for (ShrtOrFullName = Nam_SHRT_NAME;
ShrtOrFullName <= Cns_FULL_NAME; ShrtOrFullName <= Nam_FULL_NAME;
ShrtOrFullName++) ShrtOrFullName++)
Par_GetParShrtOrFullName (ShrtOrFullName,Names[ShrtOrFullName]); Nam_GetParShrtOrFullName (ShrtOrFullName,Names[ShrtOrFullName]);
} }
void Par_GetParShrtOrFullName (Cns_ShrtOrFullName_t ShrtOrFullName,char *Name) void Nam_GetParShrtOrFullName (Nam_ShrtOrFullName_t ShrtOrFullName,char *Name)
{ {
extern const char *Cns_ParShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ParShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern unsigned Cns_MaxBytesShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern unsigned Nam_MaxBytesShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
Par_GetParText (Cns_ParShrtOrFullName[ShrtOrFullName],Name, Par_GetParText (Nam_ParShrtOrFullName[ShrtOrFullName],Name,
Cns_MaxBytesShrtOrFullName[ShrtOrFullName]); Nam_MaxBytesShrtOrFullName[ShrtOrFullName]);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -82,8 +82,8 @@ void Par_GetMainPars (void);
//------------------------------ Get parameters ------------------------------- //------------------------------ Get parameters -------------------------------
unsigned Par_GetParText (const char *ParName,char *ParValue,size_t MaxBytes); unsigned Par_GetParText (const char *ParName,char *ParValue,size_t MaxBytes);
void Par_GetParsShrtAndFullName (char *Names[Cns_NUM_SHRT_FULL_NAMES]); void Nam_GetParsShrtAndFullName (char *Names[Nam_NUM_SHRT_FULL_NAMES]);
void Par_GetParShrtOrFullName (Cns_ShrtOrFullName_t ShrtOrFullName,char *Name); void Nam_GetParShrtOrFullName (Nam_ShrtOrFullName_t ShrtOrFullName,char *Name);
unsigned long Par_GetParUnsignedLong (const char *ParName, unsigned long Par_GetParUnsignedLong (const char *ParName,
unsigned long Min, unsigned long Min,
unsigned long Max, unsigned long Max,

View File

@ -1072,9 +1072,9 @@ void Pho_BuildHTMLUsrPhoto (const struct Usr_Data *UsrDat,const char *PhotoURL,
bool PutZoomCode = (Zoom == Pho_ZOOM) && // Make zoom bool PutZoomCode = (Zoom == Pho_ZOOM) && // Make zoom
BrowserTabIs1stTab; // Only in main browser tab (or AJAX) BrowserTabIs1stTab; // Only in main browser tab (or AJAX)
char IdCaption[Frm_MAX_BYTES_ID + 1]; char IdCaption[Frm_MAX_BYTES_ID + 1];
char CtyName[Cns_MAX_BYTES_FULL_NAME + 1]; char CtyName[Nam_MAX_BYTES_FULL_NAME + 1];
struct Hie_Node Ins; struct Hie_Node Ins;
char MainDegreeShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]; char MainDegreeShrtName[Nam_MAX_BYTES_SHRT_NAME + 1];
Rol_Role_t MaxRole; // Maximum user's role in his/her main degree Rol_Role_t MaxRole; // Maximum user's role in his/her main degree
struct struct
{ {
@ -2368,7 +2368,7 @@ static void Pho_ShowDegreeAvgPhotoAndStat (const struct Hie_Node *Deg,
unsigned PhotoHeight; unsigned PhotoHeight;
char PathRelAvgPhoto[PATH_MAX + 1]; char PathRelAvgPhoto[PATH_MAX + 1];
char PhotoURL[Cns_MAX_BYTES_WWW + 1]; char PhotoURL[Cns_MAX_BYTES_WWW + 1];
char PhotoCaption[1024 + Cns_MAX_BYTES_SHRT_NAME]; char PhotoCaption[1024 + Nam_MAX_BYTES_SHRT_NAME];
bool ShowDegPhoto; bool ShowDegPhoto;
char IdCaption[Frm_MAX_BYTES_ID + 1]; char IdCaption[Frm_MAX_BYTES_ID + 1];

View File

@ -83,7 +83,7 @@ static void Plc_GetPlaceDataFromRow (MYSQL_RES *mysql_res,struct Plc_Place *Plc)
static void Plc_ListPlacesForEdition (const struct Plc_Places *Places); static void Plc_ListPlacesForEdition (const struct Plc_Places *Places);
static void Plc_PutParPlcCod (void *PlcCod); static void Plc_PutParPlcCod (void *PlcCod);
static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName); static void Plc_RenamePlace (Nam_ShrtOrFullName_t ShrtOrFullName);
static void Plc_PutFormToCreatePlace (void); static void Plc_PutFormToCreatePlace (void);
static void Plc_PutHeadPlaces (void); static void Plc_PutHeadPlaces (void);
@ -445,14 +445,14 @@ void Plc_FreeListPlaces (struct Plc_Places *Places)
static void Plc_ListPlacesForEdition (const struct Plc_Places *Places) static void Plc_ListPlacesForEdition (const struct Plc_Places *Places)
{ {
static Act_Action_t ActionRename[Cns_NUM_SHRT_FULL_NAMES] = static Act_Action_t ActionRename[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = ActRenPlcSho, [Nam_SHRT_NAME] = ActRenPlcSho,
[Cns_FULL_NAME] = ActRenPlcFul, [Nam_FULL_NAME] = ActRenPlcFul,
}; };
unsigned NumPlc; unsigned NumPlc;
struct Plc_Place *Plc; struct Plc_Place *Plc;
const char *Names[Cns_NUM_SHRT_FULL_NAMES]; const char *Names[Nam_NUM_SHRT_FULL_NAMES];
/***** Begin table *****/ /***** Begin table *****/
HTM_TABLE_BeginWidePadding (2); HTM_TABLE_BeginWidePadding (2);
@ -484,9 +484,9 @@ static void Plc_ListPlacesForEdition (const struct Plc_Places *Places)
HTM_TD_End (); HTM_TD_End ();
/* Place short name and full name */ /* Place short name and full name */
Names[Cns_SHRT_NAME] = Plc->ShrtName; Names[Nam_SHRT_NAME] = Plc->ShrtName;
Names[Cns_FULL_NAME] = Plc->FullName; Names[Nam_FULL_NAME] = Plc->FullName;
Frm_ExistingShortAndFullNames (ActionRename, Nam_ExistingShortAndFullNames (ActionRename,
ParCod_Plc,Plc->PlcCod, ParCod_Plc,Plc->PlcCod,
Names, Names,
true); // Put form true); // Put form
@ -557,7 +557,7 @@ void Plc_RenamePlaceShort (void)
Plc_EditingPlaceConstructor (); Plc_EditingPlaceConstructor ();
/***** Rename place *****/ /***** Rename place *****/
Plc_RenamePlace (Cns_SHRT_NAME); Plc_RenamePlace (Nam_SHRT_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -570,34 +570,34 @@ void Plc_RenamePlaceFull (void)
Plc_EditingPlaceConstructor (); Plc_EditingPlaceConstructor ();
/***** Rename place *****/ /***** Rename place *****/
Plc_RenamePlace (Cns_FULL_NAME); Plc_RenamePlace (Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
/************************ Change the name of a place *************************/ /************************ Change the name of a place *************************/
/*****************************************************************************/ /*****************************************************************************/
static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName) static void Plc_RenamePlace (Nam_ShrtOrFullName_t ShrtOrFullName)
{ {
extern const char *Cns_ParShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ParShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern unsigned Cns_MaxBytesShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern unsigned Nam_MaxBytesShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_place_X_already_exists; extern const char *Txt_The_place_X_already_exists;
extern const char *Txt_The_place_X_has_been_renamed_as_Y; extern const char *Txt_The_place_X_has_been_renamed_as_Y;
extern const char *Txt_The_name_X_has_not_changed; extern const char *Txt_The_name_X_has_not_changed;
char *CurrentName[Cns_NUM_SHRT_FULL_NAMES] = char *CurrentName[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Plc_EditingPlc->ShrtName, [Nam_SHRT_NAME] = Plc_EditingPlc->ShrtName,
[Cns_FULL_NAME] = Plc_EditingPlc->FullName, [Nam_FULL_NAME] = Plc_EditingPlc->FullName,
}; };
char NewName[Cns_MAX_BYTES_FULL_NAME + 1]; char NewName[Nam_MAX_BYTES_FULL_NAME + 1];
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Get the code of the place */ /* Get the code of the place */
Plc_EditingPlc->PlcCod = ParCod_GetAndCheckPar (ParCod_Plc); Plc_EditingPlc->PlcCod = ParCod_GetAndCheckPar (ParCod_Plc);
/* Get the new name for the place */ /* Get the new name for the place */
Par_GetParShrtOrFullName (ShrtOrFullName,NewName); Nam_GetParShrtOrFullName (ShrtOrFullName,NewName);
/***** Get place old names from database *****/ /***** Get place old names from database *****/
Plc_GetPlaceDataByCod (Plc_EditingPlc); Plc_GetPlaceDataByCod (Plc_EditingPlc);
@ -610,7 +610,7 @@ static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName)
if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names
{ {
/***** If place was in database... *****/ /***** If place was in database... *****/
if (Plc_DB_CheckIfPlaceNameExists (Cns_ParShrtOrFullName[ShrtOrFullName], if (Plc_DB_CheckIfPlaceNameExists (Nam_ParShrtOrFullName[ShrtOrFullName],
NewName,Plc_EditingPlc->PlcCod)) NewName,Plc_EditingPlc->PlcCod))
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
Txt_The_place_X_already_exists, Txt_The_place_X_already_exists,
@ -619,7 +619,7 @@ static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName)
{ {
/* Update the table changing old name by new name */ /* Update the table changing old name by new name */
Plc_DB_UpdatePlcName (Plc_EditingPlc->PlcCod, Plc_DB_UpdatePlcName (Plc_EditingPlc->PlcCod,
Cns_FldShrtOrFullName[ShrtOrFullName],NewName); Nam_FldShrtOrFullName[ShrtOrFullName],NewName);
/* Write message to show the change made */ /* Write message to show the change made */
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,
@ -637,7 +637,7 @@ static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Update place name *****/ /***** Update place name *****/
Str_Copy (CurrentName[ShrtOrFullName],NewName, Str_Copy (CurrentName[ShrtOrFullName],NewName,
Cns_MaxBytesShrtOrFullName[ShrtOrFullName]); Nam_MaxBytesShrtOrFullName[ShrtOrFullName]);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -662,10 +662,10 @@ void Plc_ContEditAfterChgPlc (void)
static void Plc_PutFormToCreatePlace (void) static void Plc_PutFormToCreatePlace (void)
{ {
const char *Names[Cns_NUM_SHRT_FULL_NAMES] = const char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Plc_EditingPlc->ShrtName, [Nam_SHRT_NAME] = Plc_EditingPlc->ShrtName,
[Cns_FULL_NAME] = Plc_EditingPlc->FullName, [Nam_FULL_NAME] = Plc_EditingPlc->FullName,
}; };
/***** Begin form to create *****/ /***** Begin form to create *****/
@ -685,7 +685,7 @@ static void Plc_PutFormToCreatePlace (void)
HTM_TD_End (); HTM_TD_End ();
/***** Place short name and full name *****/ /***** Place short name and full name *****/
Frm_NewShortAndFullNames (Names); Nam_NewShortAndFullNames (Names);
/***** Number of centers *****/ /***** Number of centers *****/
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
@ -724,15 +724,15 @@ static void Plc_PutHeadPlaces (void)
void Plc_ReceiveFormNewPlace (void) void Plc_ReceiveFormNewPlace (void)
{ {
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_place_X_already_exists; extern const char *Txt_The_place_X_already_exists;
extern const char *Txt_Created_new_place_X; extern const char *Txt_Created_new_place_X;
Cns_ShrtOrFullName_t ShrtOrFullName; Nam_ShrtOrFullName_t ShrtOrFullName;
bool Exists; bool Exists;
char *Names[Cns_NUM_SHRT_FULL_NAMES] = char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Plc_EditingPlc->ShrtName, [Nam_SHRT_NAME] = Plc_EditingPlc->ShrtName,
[Cns_FULL_NAME] = Plc_EditingPlc->FullName, [Nam_FULL_NAME] = Plc_EditingPlc->FullName,
}; };
/***** Place constructor *****/ /***** Place constructor *****/
@ -740,16 +740,16 @@ void Plc_ReceiveFormNewPlace (void)
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Get place short name and full name */ /* Get place short name and full name */
Par_GetParsShrtAndFullName (Names); Nam_GetParsShrtAndFullName (Names);
if (Plc_EditingPlc->ShrtName[0] && if (Plc_EditingPlc->ShrtName[0] &&
Plc_EditingPlc->FullName[0]) // If there's a place name Plc_EditingPlc->FullName[0]) // If there's a place name
{ {
/***** If name of place was in database... *****/ /***** If name of place was in database... *****/
for (ShrtOrFullName = Cns_SHRT_NAME, Exists = false; for (ShrtOrFullName = Nam_SHRT_NAME, Exists = false;
ShrtOrFullName <= Cns_FULL_NAME && !Exists; ShrtOrFullName <= Nam_FULL_NAME && !Exists;
ShrtOrFullName++) ShrtOrFullName++)
if (Plc_DB_CheckIfPlaceNameExists (Cns_FldShrtOrFullName[ShrtOrFullName], if (Plc_DB_CheckIfPlaceNameExists (Nam_FldShrtOrFullName[ShrtOrFullName],
Names[ShrtOrFullName],-1L)) Names[ShrtOrFullName],-1L))
{ {
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
@ -761,7 +761,7 @@ void Plc_ReceiveFormNewPlace (void)
{ {
Plc_DB_CreatePlace (Plc_EditingPlc); Plc_DB_CreatePlace (Plc_EditingPlc);
Ale_CreateAlert (Ale_SUCCESS,NULL,Txt_Created_new_place_X, Ale_CreateAlert (Ale_SUCCESS,NULL,Txt_Created_new_place_X,
Plc_EditingPlc->FullName); Names[Nam_FULL_NAME]);
} }
} }
else // If there is not a place name else // If there is not a place name

View File

@ -37,8 +37,8 @@ struct Plc_Place
{ {
long PlcCod; long PlcCod;
long InsCod; long InsCod;
char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]; char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1];
char FullName[Cns_MAX_BYTES_FULL_NAME + 1]; char FullName[Nam_MAX_BYTES_FULL_NAME + 1];
unsigned NumCtrs; unsigned NumCtrs;
}; };

View File

@ -484,7 +484,7 @@ static void Rep_WriteSectionUsrInfo (void)
extern const char *Txt_Email; extern const char *Txt_Email;
extern const char *Txt_Country; extern const char *Txt_Country;
extern const char *Txt_Institution; extern const char *Txt_Institution;
char CtyName[Cns_MAX_BYTES_FULL_NAME + 1]; char CtyName[Nam_MAX_BYTES_FULL_NAME + 1];
struct Hie_Node Ins; struct Hie_Node Ins;
/***** Begin section *****/ /***** Begin section *****/

View File

@ -122,7 +122,7 @@ static void Roo_PutSelectorType (Roo_RoomType_t RoomType,
static int Roo_GetParFloor (void); static int Roo_GetParFloor (void);
static Roo_RoomType_t Roo_GetParType (void); static Roo_RoomType_t Roo_GetParType (void);
static void Roo_RenameRoom (Cns_ShrtOrFullName_t ShrtOrFullName); static void Roo_RenameRoom (Nam_ShrtOrFullName_t ShrtOrFullName);
static void Roo_WriteCapacity (char Str[Cns_MAX_DECIMAL_DIGITS_UINT + 1],unsigned Capacity); static void Roo_WriteCapacity (char Str[Cns_MAX_DECIMAL_DIGITS_UINT + 1],unsigned Capacity);
@ -628,16 +628,16 @@ void Roo_FreeListRooms (struct Roo_Rooms *Rooms)
static void Roo_ListRoomsForEdition (const struct Bld_Buildings *Buildings, static void Roo_ListRoomsForEdition (const struct Bld_Buildings *Buildings,
const struct Roo_Rooms *Rooms) const struct Roo_Rooms *Rooms)
{ {
static Act_Action_t ActionRename[Cns_NUM_SHRT_FULL_NAMES] = static Act_Action_t ActionRename[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = ActRenRooSho, [Nam_SHRT_NAME] = ActRenRooSho,
[Cns_FULL_NAME] = ActRenRooFul, [Nam_FULL_NAME] = ActRenRooFul,
}; };
unsigned NumRoom; unsigned NumRoom;
struct Roo_Room *Room; struct Roo_Room *Room;
char *Anchor = NULL; char *Anchor = NULL;
char StrCapacity[Cns_MAX_DECIMAL_DIGITS_UINT + 1]; char StrCapacity[Cns_MAX_DECIMAL_DIGITS_UINT + 1];
const char *Names[Cns_NUM_SHRT_FULL_NAMES]; const char *Names[Nam_NUM_SHRT_FULL_NAMES];
HTM_TABLE_BeginWidePadding (2); HTM_TABLE_BeginWidePadding (2);
@ -699,9 +699,9 @@ static void Roo_ListRoomsForEdition (const struct Bld_Buildings *Buildings,
HTM_TD_End (); HTM_TD_End ();
/* Room short name and full name */ /* Room short name and full name */
Names[Cns_SHRT_NAME] = Room->ShrtName; Names[Nam_SHRT_NAME] = Room->ShrtName;
Names[Cns_FULL_NAME] = Room->FullName; Names[Nam_FULL_NAME] = Room->FullName;
Frm_ExistingShortAndFullNames (ActionRename, Nam_ExistingShortAndFullNames (ActionRename,
ParCod_Roo,Room->RooCod, ParCod_Roo,Room->RooCod,
Names, Names,
true); // Put form true); // Put form
@ -1024,7 +1024,7 @@ void Roo_RenameRoomShort (void)
Roo_EditingRoomConstructor (); Roo_EditingRoomConstructor ();
/***** Rename room *****/ /***** Rename room *****/
Roo_RenameRoom (Cns_SHRT_NAME); Roo_RenameRoom (Nam_SHRT_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1037,34 +1037,34 @@ void Roo_RenameRoomFull (void)
Roo_EditingRoomConstructor (); Roo_EditingRoomConstructor ();
/***** Rename room *****/ /***** Rename room *****/
Roo_RenameRoom (Cns_FULL_NAME); Roo_RenameRoom (Nam_FULL_NAME);
} }
/*****************************************************************************/ /*****************************************************************************/
/************************* Change the name of a room *************************/ /************************* Change the name of a room *************************/
/*****************************************************************************/ /*****************************************************************************/
static void Roo_RenameRoom (Cns_ShrtOrFullName_t ShrtOrFullName) static void Roo_RenameRoom (Nam_ShrtOrFullName_t ShrtOrFullName)
{ {
extern const char *Cns_ParShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_ParShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern unsigned Cns_MaxBytesShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern unsigned Nam_MaxBytesShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_room_X_already_exists; extern const char *Txt_The_room_X_already_exists;
extern const char *Txt_The_room_X_has_been_renamed_as_Y; extern const char *Txt_The_room_X_has_been_renamed_as_Y;
extern const char *Txt_The_name_X_has_not_changed; extern const char *Txt_The_name_X_has_not_changed;
char *CurrentName[Cns_NUM_SHRT_FULL_NAMES] = char *CurrentName[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Roo_EditingRoom->ShrtName, [Nam_SHRT_NAME] = Roo_EditingRoom->ShrtName,
[Cns_FULL_NAME] = Roo_EditingRoom->FullName, [Nam_FULL_NAME] = Roo_EditingRoom->FullName,
}; };
char NewName[Cns_MAX_BYTES_FULL_NAME + 1]; char NewName[Nam_MAX_BYTES_FULL_NAME + 1];
/***** Get parameters from form *****/ /***** Get parameters from form *****/
/* Get room code */ /* Get room code */
Roo_EditingRoom->RooCod = ParCod_GetAndCheckPar (ParCod_Roo); Roo_EditingRoom->RooCod = ParCod_GetAndCheckPar (ParCod_Roo);
/* Get the new name for the room */ /* Get the new name for the room */
Par_GetParShrtOrFullName (ShrtOrFullName,NewName); Nam_GetParShrtOrFullName (ShrtOrFullName,NewName);
/***** Get from the database the old names of the room *****/ /***** Get from the database the old names of the room *****/
Roo_GetRoomDataByCod (Roo_EditingRoom); Roo_GetRoomDataByCod (Roo_EditingRoom);
@ -1077,10 +1077,9 @@ static void Roo_RenameRoom (Cns_ShrtOrFullName_t ShrtOrFullName)
if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names if (strcmp (CurrentName[ShrtOrFullName],NewName)) // Different names
{ {
/***** If room was in database... *****/ /***** If room was in database... *****/
if (Roo_DB_CheckIfRoomNameExists (Gbl.Hierarchy.Node[Hie_CTR].HieCod, if (Roo_DB_CheckIfRoomNameExists (Nam_ParShrtOrFullName[ShrtOrFullName],
Roo_EditingRoom->RooCod, NewName,Roo_EditingRoom->RooCod,
Cns_ParShrtOrFullName[ShrtOrFullName], Gbl.Hierarchy.Node[Hie_CTR].HieCod))
NewName))
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
Txt_The_room_X_already_exists, Txt_The_room_X_already_exists,
NewName); NewName);
@ -1088,7 +1087,7 @@ static void Roo_RenameRoom (Cns_ShrtOrFullName_t ShrtOrFullName)
{ {
/* Update the table changing old name by new name */ /* Update the table changing old name by new name */
Roo_DB_UpdateRoomName (Roo_EditingRoom->RooCod, Roo_DB_UpdateRoomName (Roo_EditingRoom->RooCod,
Cns_FldShrtOrFullName[ShrtOrFullName],NewName); Nam_FldShrtOrFullName[ShrtOrFullName],NewName);
/* Write message to show the change made */ /* Write message to show the change made */
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,
@ -1106,7 +1105,7 @@ static void Roo_RenameRoom (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Update room name *****/ /***** Update room name *****/
Str_Copy (CurrentName[ShrtOrFullName],NewName, Str_Copy (CurrentName[ShrtOrFullName],NewName,
Cns_MaxBytesShrtOrFullName[ShrtOrFullName]); Nam_MaxBytesShrtOrFullName[ShrtOrFullName]);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1198,10 +1197,10 @@ static void Roo_PutFormToCreateRoom (const struct Bld_Buildings *Buildings)
{ {
char StrCapacity[Cns_MAX_DECIMAL_DIGITS_UINT + 1]; char StrCapacity[Cns_MAX_DECIMAL_DIGITS_UINT + 1];
char MACstr[MAC_LENGTH_MAC_ADDRESS + 1]; // MAC address in xx:xx:xx:xx:xx:xx format char MACstr[MAC_LENGTH_MAC_ADDRESS + 1]; // MAC address in xx:xx:xx:xx:xx:xx format
const char *Names[Cns_NUM_SHRT_FULL_NAMES] = const char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Roo_EditingRoom->ShrtName, [Nam_SHRT_NAME] = Roo_EditingRoom->ShrtName,
[Cns_FULL_NAME] = Roo_EditingRoom->FullName, [Nam_FULL_NAME] = Roo_EditingRoom->FullName,
}; };
/***** Begin form to create *****/ /***** Begin form to create *****/
@ -1241,7 +1240,7 @@ static void Roo_PutFormToCreateRoom (const struct Bld_Buildings *Buildings)
HTM_TD_End (); HTM_TD_End ();
/***** Room short name and full name *****/ /***** Room short name and full name *****/
Frm_NewShortAndFullNames (Names); Nam_NewShortAndFullNames (Names);
/***** Seating capacity *****/ /***** Seating capacity *****/
HTM_TD_Begin ("class=\"LM\""); HTM_TD_Begin ("class=\"LM\"");
@ -1301,15 +1300,15 @@ static void Roo_PutHeadRooms (void)
void Roo_ReceiveFormNewRoom (void) void Roo_ReceiveFormNewRoom (void)
{ {
extern const char *Cns_FldShrtOrFullName[Cns_NUM_SHRT_FULL_NAMES]; extern const char *Nam_FldShrtOrFullName[Nam_NUM_SHRT_FULL_NAMES];
extern const char *Txt_The_room_X_already_exists; extern const char *Txt_The_room_X_already_exists;
extern const char *Txt_Created_new_room_X; extern const char *Txt_Created_new_room_X;
Cns_ShrtOrFullName_t ShrtOrFullName; Nam_ShrtOrFullName_t ShrtOrFullName;
bool Exists; bool Exists;
char *Names[Cns_NUM_SHRT_FULL_NAMES] = char *Names[Nam_NUM_SHRT_FULL_NAMES] =
{ {
[Cns_SHRT_NAME] = Roo_EditingRoom->ShrtName, [Nam_SHRT_NAME] = Roo_EditingRoom->ShrtName,
[Cns_FULL_NAME] = Roo_EditingRoom->FullName, [Nam_FULL_NAME] = Roo_EditingRoom->FullName,
}; };
/***** Room constructor *****/ /***** Room constructor *****/
@ -1322,7 +1321,7 @@ void Roo_ReceiveFormNewRoom (void)
Roo_EditingRoom->Type = Roo_GetParType (); Roo_EditingRoom->Type = Roo_GetParType ();
/* Get room short name and full name */ /* Get room short name and full name */
Par_GetParsShrtAndFullName (Names); Nam_GetParsShrtAndFullName (Names);
/* Get seating capacity */ /* Get seating capacity */
Roo_EditingRoom->Capacity = (unsigned) Roo_EditingRoom->Capacity = (unsigned)
@ -1338,12 +1337,12 @@ void Roo_ReceiveFormNewRoom (void)
Roo_EditingRoom->FullName[0]) // If there's a room name Roo_EditingRoom->FullName[0]) // If there's a room name
{ {
/***** If name of room was in database... *****/ /***** If name of room was in database... *****/
for (ShrtOrFullName = Cns_SHRT_NAME, Exists = false; for (ShrtOrFullName = Nam_SHRT_NAME, Exists = false;
ShrtOrFullName <= Cns_FULL_NAME && !Exists; ShrtOrFullName <= Nam_FULL_NAME && !Exists;
ShrtOrFullName++) ShrtOrFullName++)
if (Roo_DB_CheckIfRoomNameExists (Gbl.Hierarchy.Node[Hie_CTR].HieCod,-1L, if (Roo_DB_CheckIfRoomNameExists (Nam_FldShrtOrFullName[ShrtOrFullName],
Cns_FldShrtOrFullName[ShrtOrFullName], Names[ShrtOrFullName],-1L,
Names[ShrtOrFullName])) Gbl.Hierarchy.Node[Hie_CTR].HieCod))
{ {
Ale_CreateAlert (Ale_WARNING,NULL, Ale_CreateAlert (Ale_WARNING,NULL,
Txt_The_room_X_already_exists,Names[ShrtOrFullName]); Txt_The_room_X_already_exists,Names[ShrtOrFullName]);
@ -1352,9 +1351,8 @@ void Roo_ReceiveFormNewRoom (void)
if (!Exists) // Add new room to database if (!Exists) // Add new room to database
{ {
Roo_CreateRoom (Roo_EditingRoom); Roo_CreateRoom (Roo_EditingRoom);
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,Txt_Created_new_room_X,
Txt_Created_new_room_X, Names[Nam_FULL_NAME]);
Roo_EditingRoom->FullName);
} }
} }
else // If there is not a room name else // If there is not a room name

View File

@ -73,11 +73,11 @@ struct Roo_Room
long RooCod; // Room code long RooCod; // Room code
long CtrCod; // Center code long CtrCod; // Center code
long BldCod; // Building code long BldCod; // Building code
char BldShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]; // Building short name char BldShrtName[Nam_MAX_BYTES_SHRT_NAME + 1]; // Building short name
int Floor; // Room floor int Floor; // Room floor
Roo_RoomType_t Type; // Room type Roo_RoomType_t Type; // Room type
char ShrtName[Cns_MAX_BYTES_SHRT_NAME + 1]; // Room short name char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1]; // Room short name
char FullName[Cns_MAX_BYTES_FULL_NAME + 1]; // Room full name char FullName[Nam_MAX_BYTES_FULL_NAME + 1]; // Room full name
unsigned Capacity; // Room seating capacity unsigned Capacity; // Room seating capacity
// (maximum people who fit in the room) // (maximum people who fit in the room)
unsigned long long MACnum; unsigned long long MACnum;

View File

@ -263,8 +263,8 @@ unsigned Roo_DB_GetListRooms (MYSQL_RES **mysql_res,
/********************** Check if the name of room exists *********************/ /********************** Check if the name of room exists *********************/
/*****************************************************************************/ /*****************************************************************************/
bool Roo_DB_CheckIfRoomNameExists (long CtrCod,long RooCod, bool Roo_DB_CheckIfRoomNameExists (const char *FldName,const char *Name,
const char *FldName,const char *Name) long RooCod,long CtrCod)
{ {
return return
DB_QueryEXISTS ("can not check if the name of a room already existed", DB_QueryEXISTS ("can not check if the name of a room already existed",

View File

@ -41,8 +41,8 @@ unsigned Roo_DB_GetListRooms (MYSQL_RES **mysql_res,
long CtrCod, long CtrCod,
Roo_WhichData_t WhichData, Roo_WhichData_t WhichData,
Roo_Order_t SelectedOrder); Roo_Order_t SelectedOrder);
bool Roo_DB_CheckIfRoomNameExists (long CtrCod,long RooCod, bool Roo_DB_CheckIfRoomNameExists (const char *FldName,const char *Name,
const char *FldName,const char *Name); long RooCod,long CtrCod);
unsigned Roo_DB_GetRoomDataByCod (MYSQL_RES **mysql_res,long RooCod); unsigned Roo_DB_GetRoomDataByCod (MYSQL_RES **mysql_res,long RooCod);
unsigned Roo_DB_GetMACAddresses (MYSQL_RES **mysql_res,long RooCod); unsigned Roo_DB_GetMACAddresses (MYSQL_RES **mysql_res,long RooCod);

View File

@ -1879,6 +1879,29 @@ const char *Txt_Already_existed_an_exam_with_the_title_X = // Warning: it is ver
"Already existed an exam with the title <strong>%s</strong>."; // Çeviri lazim! "Already existed an exam with the title <strong>%s</strong>."; // Çeviri lazim!
#endif #endif
const char *Txt_X_already_exists = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"<strong>%s</strong> ja existeix.";
#elif L==2 // de
"<strong>%s</strong> wurde bereits eingegeben.";
#elif L==3 // en
"<strong>%s</strong> already exists.";
#elif L==4 // es
"<strong>%s</strong> ya existe.";
#elif L==5 // fr
"<strong>%s</strong> existe d&eacute;j&grave;.";
#elif L==6 // gn
"<strong>%s</strong> ya existe."; // Okoteve traducción
#elif L==7 // it
"<strong>%s</strong> gi&agrave; esiste.";
#elif L==8 // pl
"<strong>%s</strong> ju&zdot; istnieje.";
#elif L==9 // pt
"<strong>%s</strong> j&aacute; existe.";
#elif L==10 // tr
"<strong>%s</strong> already exists."; // Çeviri lazim!
#endif
const char *Txt_Altitude = const char *Txt_Altitude =
#if L==1 // ca #if L==1 // ca
"Altitud"; "Altitud";
@ -46794,29 +46817,6 @@ const char *Txt_The_assignment_has_been_modified =
"&Ouml;dev de&gbreve;i&scedil;tirildi."; "&Ouml;dev de&gbreve;i&scedil;tirildi.";
#endif #endif
const char *Txt_The_banner_X_already_exists = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"El banner <strong>%s</strong> ja existeix.";
#elif L==2 // de
"Der Werbebanner <strong>%s</strong> wurde bereits eingegeben.";
#elif L==3 // en
"The banner <strong>%s</strong> already exists.";
#elif L==4 // es
"El banner <strong>%s</strong> ya existe.";
#elif L==5 // fr
"La banni&egrave;re <strong>%s</strong> existe d&eacute;j&grave;.";
#elif L==6 // gn
"El banner <strong>%s</strong> ya existe."; // Okoteve traducción
#elif L==7 // it
"Il banner <strong>%s</strong> gi&agrave; esiste.";
#elif L==8 // pl
"Baner <strong>%s</strong> ju&zdot; istnieje.";
#elif L==9 // pt
"O banner <strong>%s</strong> j&aacute; existe.";
#elif L==10 // tr
"The banner <strong>%s</strong> already exists."; // Çeviri lazim!
#endif
const char *Txt_The_banner_X_has_been_renamed_as_Y = // Warning: it is very important to include two %s in the following sentences const char *Txt_The_banner_X_has_been_renamed_as_Y = // Warning: it is very important to include two %s in the following sentences
#if L==1 // ca #if L==1 // ca
"El banner <strong>%s</strong> ha passat a anomenar-se <strong>%s</strong>."; "El banner <strong>%s</strong> ha passat a anomenar-se <strong>%s</strong>.";