Version 18.46.2

This commit is contained in:
Antonio Cañas Vargas 2019-02-16 00:03:58 +01:00
parent 2dc4c6df2f
commit f3afcaa930
4 changed files with 85 additions and 143 deletions

View File

@ -225,7 +225,7 @@ void Ctr_SeeCtrWithPendingDegs (void)
Box_EndBoxTable ();
}
else
Ale_ShowA_old (Ale_INFO,Txt_There_are_no_centres_with_requests_for_degrees_to_be_confirmed);
Ale_ShowA_fmt (Ale_INFO,Txt_There_are_no_centres_with_requests_for_degrees_to_be_confirmed);
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
@ -816,7 +816,7 @@ static void Ctr_ListCentres (void)
Tbl_EndTable ();
}
else // No centres created in the current institution
Ale_ShowA_old (Ale_INFO,Txt_No_centres);
Ale_ShowA_fmt (Ale_INFO,Txt_No_centres);
/***** Button to create centre *****/
if (Ctr_CheckIfICanCreateCentres ())
@ -1766,7 +1766,7 @@ void Ctr_RemoveCentre (void)
if (Ctr.Degs.Num ||
Ctr.NumUsrsWhoClaimToBelongToCtr ||
Ctr.NumUsrs) // Centre has degrees or users ==> don't remove
Ale_ShowA_old (Ale_WARNING,Txt_To_remove_a_centre_you_must_first_remove_all_degrees_and_teachers_in_the_centre);
Ale_ShowA_fmt (Ale_WARNING,Txt_To_remove_a_centre_you_must_first_remove_all_degrees_and_teachers_in_the_centre);
else // Centre has no teachers ==> remove it
{
/***** Remove all the threads and posts in forums of the centre *****/
@ -1795,10 +1795,8 @@ void Ctr_RemoveCentre (void)
Ctr.CtrCod);
/***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_Centre_X_removed,
Ctr.FullName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_SUCCESS,Txt_Centre_X_removed,
Ctr.FullName);
}
/***** Show the form again *****/
@ -1830,8 +1828,8 @@ void Ctr_ChangeCtrInsInConfig (void)
Gbl.CurrentCtr.Ctr.CtrCod,
NewIns.InsCod))
{
Gbl.Alert.Type = Ale_WARNING;
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Gbl.AlertToShowLater.Type = Ale_WARNING;
snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt),
Txt_The_centre_X_already_exists,
Gbl.CurrentCtr.Ctr.ShrtName);
}
@ -1840,8 +1838,8 @@ void Ctr_ChangeCtrInsInConfig (void)
Gbl.CurrentCtr.Ctr.CtrCod,
NewIns.InsCod))
{
Gbl.Alert.Type = Ale_WARNING;
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Gbl.AlertToShowLater.Type = Ale_WARNING;
snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt),
Txt_The_centre_X_already_exists,
Gbl.CurrentCtr.Ctr.FullName);
}
@ -1856,8 +1854,8 @@ void Ctr_ChangeCtrInsInConfig (void)
Hie_InitHierarchy ();
/***** Write message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS;
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Gbl.AlertToShowLater.Type = Ale_SUCCESS;
snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt),
Txt_The_centre_X_has_been_moved_to_the_institution_Y,
Gbl.CurrentCtr.Ctr.FullName,NewIns.FullName);
}
@ -1913,8 +1911,8 @@ void Ctr_ChangeCtrPlc (void)
/***** Write message to show the change made
and put button to go to centre changed *****/
Gbl.Alert.Type = Ale_SUCCESS;
Str_Copy (Gbl.Alert.Txt,Txt_The_place_of_the_centre_has_changed,
Gbl.AlertToShowLater.Type = Ale_SUCCESS;
Str_Copy (Gbl.AlertToShowLater.Txt,Txt_The_place_of_the_centre_has_changed,
Ale_MAX_BYTES_ALERT);
Ctr_ShowAlertAndButtonToGoToCtr ();
@ -1935,7 +1933,7 @@ void Ctr_ChangeCtrPlcInConfig (void)
Gbl.CurrentCtr.Ctr.PlcCod = NewPlcCod;
/***** Write message to show the change made *****/
Ale_ShowA_old (Ale_SUCCESS,Txt_The_place_of_the_centre_has_changed);
Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_place_of_the_centre_has_changed);
/***** Show the form again *****/
Ctr_ShowConfiguration ();
@ -2024,8 +2022,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
/***** Check if new name is empty *****/
if (!NewCtrName[0])
{
Gbl.Alert.Type = Ale_WARNING;
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Gbl.AlertToShowLater.Type = Ale_WARNING;
snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt),
Txt_You_can_not_leave_the_name_of_the_centre_X_empty,
CurrentCtrName);
}
@ -2038,8 +2036,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
/***** If degree was in database... *****/
if (Ctr_CheckIfCtrNameExistsInIns (ParamName,NewCtrName,Ctr->CtrCod,Gbl.CurrentIns.Ins.InsCod))
{
Gbl.Alert.Type = Ale_WARNING;
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Gbl.AlertToShowLater.Type = Ale_WARNING;
snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt),
Txt_The_centre_X_already_exists,NewCtrName);
}
else
@ -2048,8 +2046,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
Ctr_UpdateInsNameDB (Ctr->CtrCod,FieldName,NewCtrName);
/* Write message to show the change made */
Gbl.Alert.Type = Ale_SUCCESS;
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Gbl.AlertToShowLater.Type = Ale_SUCCESS;
snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt),
Txt_The_centre_X_has_been_renamed_as_Y,
CurrentCtrName,NewCtrName);
@ -2060,8 +2058,8 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
}
else // The same name
{
Gbl.Alert.Type = Ale_INFO;
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Gbl.AlertToShowLater.Type = Ale_INFO;
snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt),
Txt_The_name_of_the_centre_X_has_not_changed,
CurrentCtrName);
}
@ -2123,14 +2121,14 @@ void Ctr_ChangeCtrWWW (void)
/***** Write message to show the change made
and put button to go to centre changed *****/
Gbl.Alert.Type = Ale_SUCCESS;
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Gbl.AlertToShowLater.Type = Ale_SUCCESS;
snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_new_web_address_is_X,
NewWWW);
Ctr_ShowAlertAndButtonToGoToCtr ();
}
else
Ale_ShowA_old (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty);
Ale_ShowA_fmt (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty);
/***** Show the form again *****/
Ctr_EditCentres ();
@ -2155,13 +2153,11 @@ void Ctr_ChangeCtrWWWInConfig (void)
Cns_MAX_BYTES_WWW);
/***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_new_web_address_is_X,
NewWWW);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_new_web_address_is_X,
NewWWW);
}
else
Ale_ShowA_old (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty);
Ale_ShowA_fmt (Ale_WARNING,Txt_You_can_not_leave_the_web_address_empty);
/***** Show the form again *****/
Ctr_ShowConfiguration ();
@ -2215,8 +2211,8 @@ void Ctr_ChangeCtrStatus (void)
/***** Write message to show the change made
and put button to go to centre changed *****/
Gbl.Alert.Type = Ale_SUCCESS;
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Gbl.AlertToShowLater.Type = Ale_SUCCESS;
snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_status_of_the_centre_X_has_changed,
Gbl.Ctrs.EditingCtr.ShrtName);
Ctr_ShowAlertAndButtonToGoToCtr ();
@ -2263,7 +2259,7 @@ static void Ctr_ShowAlertAndButtonToGoToCtr (void)
}
else
/***** Alert *****/
Ale_ShowA_old (Gbl.Alert.Type,Gbl.Alert.Txt);
Ale_ShowA_new (Gbl.AlertToShowLater.Type,Gbl.AlertToShowLater.Txt);
}
static void Ctr_PutParamGoToCtr (void)
@ -2319,16 +2315,14 @@ void Ctr_RequestPhoto (void)
NULL,Box_NOT_CLOSABLE);
/***** Write help message *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
"%s: %s<br />"
"%s: %u&times;%u %s",
Txt_Recommended_aspect_ratio,
Ctr_RECOMMENDED_ASPECT_RATIO,
Txt_Recommended_resolution,
Ctr_PHOTO_SAVED_MAX_WIDTH,
Ctr_PHOTO_SAVED_MAX_HEIGHT,
Txt_XxY_pixels_or_higher);
Ale_ShowA_old (Ale_INFO,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_INFO,"%s: %s<br />"
"%s: %u&times;%u %s",
Txt_Recommended_aspect_ratio,
Ctr_RECOMMENDED_ASPECT_RATIO,
Txt_Recommended_resolution,
Ctr_PHOTO_SAVED_MAX_WIDTH,
Ctr_PHOTO_SAVED_MAX_HEIGHT,
Txt_XxY_pixels_or_higher);
/***** Upload photo *****/
fprintf (Gbl.F.Out,"<label class=\"%s\">"
@ -2380,7 +2374,7 @@ void Ctr_ReceivePhoto (void)
WrongType = true;
if (WrongType)
{
Ale_ShowA_old (Ale_WARNING,Txt_Wrong_file_type);
Ale_ShowA_fmt (Ale_WARNING,Txt_Wrong_file_type);
return;
}
@ -2400,14 +2394,14 @@ void Ctr_ReceivePhoto (void)
/* Get filename extension */
if ((PtrExtension = strrchr (FileNameImgSrc,(int) '.')) == NULL)
{
Ale_ShowA_old (Ale_WARNING,Txt_Wrong_file_type);
Ale_ShowA_fmt (Ale_WARNING,Txt_Wrong_file_type);
return;
}
LengthExtension = strlen (PtrExtension);
if (LengthExtension < Fil_MIN_BYTES_FILE_EXTENSION ||
LengthExtension > Fil_MAX_BYTES_FILE_EXTENSION)
{
Ale_ShowA_old (Ale_WARNING,Txt_Wrong_file_type);
Ale_ShowA_fmt (Ale_WARNING,Txt_Wrong_file_type);
return;
}
@ -2418,7 +2412,7 @@ void Ctr_ReceivePhoto (void)
Gbl.UniqueNameEncrypted,PtrExtension);
if (!Fil_EndReceptionOfFile (FileNameImgTmp,Param))
{
Ale_ShowA_old (Ale_WARNING,"Error copying file.");
Ale_ShowA_fmt (Ale_WARNING,"Error copying file.");
return;
}
@ -2773,7 +2767,7 @@ static void Ctr_RecFormRequestOrCreateCtr (unsigned Status)
/* Get place */
if ((Gbl.Ctrs.EditingCtr.PlcCod = Plc_GetParamPlcCod ()) < 0) // 0 is reserved for "other place"
Ale_ShowA_old (Ale_ERROR,"Wrong place.");
Ale_ShowA_fmt (Ale_ERROR,"Wrong place.");
/* Get centre short name */
Par_GetParToText ("ShortName",Gbl.Ctrs.EditingCtr.ShrtName,Hie_MAX_BYTES_SHRT_NAME);
@ -2791,27 +2785,19 @@ static void Ctr_RecFormRequestOrCreateCtr (unsigned Status)
{
/***** If name of centre was in database... *****/
if (Ctr_CheckIfCtrNameExistsInIns ("ShortName",Gbl.Ctrs.EditingCtr.ShrtName,-1L,Gbl.CurrentIns.Ins.InsCod))
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_centre_X_already_exists,
Gbl.Ctrs.EditingCtr.ShrtName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowA_fmt (Ale_WARNING,Txt_The_centre_X_already_exists,
Gbl.Ctrs.EditingCtr.ShrtName);
else if (Ctr_CheckIfCtrNameExistsInIns ("FullName",Gbl.Ctrs.EditingCtr.FullName,-1L,Gbl.CurrentIns.Ins.InsCod))
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_centre_X_already_exists,
Gbl.Ctrs.EditingCtr.FullName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowA_fmt (Ale_WARNING,Txt_The_centre_X_already_exists,
Gbl.Ctrs.EditingCtr.FullName);
else // Add new centre to database
Ctr_CreateCentre (Status);
}
else // If there is not a web
Ale_ShowA_old (Ale_WARNING,Txt_You_must_specify_the_web_address_of_the_new_centre);
Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_specify_the_web_address_of_the_new_centre);
}
else // If there is not a centre name
Ale_ShowA_old (Ale_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_centre);
Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_centre);
/***** Show the form again *****/
Ctr_EditCentres ();
@ -2845,8 +2831,8 @@ static void Ctr_CreateCentre (unsigned Status)
/***** Write message to show the change made
and put button to go to centre created *****/
Gbl.Alert.Type = Ale_SUCCESS;
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Gbl.AlertToShowLater.Type = Ale_SUCCESS;
snprintf (Gbl.AlertToShowLater.Txt,sizeof (Gbl.AlertToShowLater.Txt),
Txt_Created_new_centre_X,
Gbl.Ctrs.EditingCtr.FullName);
Ctr_ShowAlertAndButtonToGoToCtr ();

View File

@ -402,10 +402,11 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 18.46.1 (2019-02-15)"
#define Log_PLATFORM_VERSION "SWAD 18.46.2 (2019-02-16)"
#define CSS_FILE "swad18.41.1.css"
#define JS_FILE "swad18.32.1.js"
/*
Version 18.46.2: Feb 16, 2019 Refactoring code related to alerts. (238298 lines)
Version 18.46.1: Feb 15, 2019 Refactoring code related to alerts. (238355 lines)
Version 18.46: Feb 15, 2019 Removed unused code related to tabs.
Fixed bug in actions related to login.

View File

@ -82,16 +82,14 @@ void Cht_ShowChatRooms (void)
extern const char *Txt_Unfortunately_Firefox_and_Chrome_no_longer_allow_Java_to_run_;
/***** Help message about software needed to use the whiteboard/chat *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_To_use_chat_you_must_have_installed_the_software_X_and_add_Y_,
Cfg_JAVA_URL,Cfg_JAVA_NAME,
Cfg_PLATFORM_SERVER);
Ale_ShowA_old (Ale_INFO,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_INFO,Txt_To_use_chat_you_must_have_installed_the_software_X_and_add_Y_,
Cfg_JAVA_URL,Cfg_JAVA_NAME,
Cfg_PLATFORM_SERVER);
/***** List available chat rooms *****/
Cht_ShowListOfAvailableChatRooms ();
Ale_ShowA_old (Ale_WARNING,Txt_Unfortunately_Firefox_and_Chrome_no_longer_allow_Java_to_run_);
Ale_ShowA_fmt (Ale_WARNING,Txt_Unfortunately_Firefox_and_Chrome_no_longer_allow_Java_to_run_);
if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
Cht_ShowListOfChatRoomsWithUsrs ();

View File

@ -583,10 +583,8 @@ void Cla_RemoveClassroom (void)
Cla->ClaCod);
/***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_Classroom_X_removed,
Cla->FullName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_SUCCESS,Txt_Classroom_X_removed,
Cla->FullName);
/***** Show the form again *****/
Cla_EditClassrooms ();
@ -670,12 +668,8 @@ static void Cla_RenameClassroom (Cns_ShrtOrFullName_t ShrtOrFullName)
/***** Check if new name is empty *****/
if (!NewClaName[0])
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_You_can_not_leave_the_name_of_the_classroom_X_empty,
CurrentClaName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowA_fmt (Ale_WARNING,Txt_You_can_not_leave_the_name_of_the_classroom_X_empty,
CurrentClaName);
else
{
/***** Check if old and new names are the same
@ -684,31 +678,21 @@ static void Cla_RenameClassroom (Cns_ShrtOrFullName_t ShrtOrFullName)
{
/***** If classroom was in database... *****/
if (Cla_CheckIfClassroomNameExists (ParamName,NewClaName,Cla->ClaCod))
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_classroom_X_already_exists,
NewClaName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowA_fmt (Ale_WARNING,Txt_The_classroom_X_already_exists,
NewClaName);
else
{
/* Update the table changing old name by new name */
Cla_UpdateClaNameDB (Cla->ClaCod,FieldName,NewClaName);
/* Write message to show the change made */
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_classroom_X_has_been_renamed_as_Y,
CurrentClaName,NewClaName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_classroom_X_has_been_renamed_as_Y,
CurrentClaName,NewClaName);
}
}
else // The same name
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_name_of_the_classroom_X_has_not_changed,
CurrentClaName);
Ale_ShowA_old (Ale_INFO,Gbl.Alert.Txt);
}
Ale_ShowA_fmt (Ale_INFO,Txt_The_name_of_the_classroom_X_has_not_changed,
CurrentClaName);
}
/***** Show the form again *****/
@ -778,13 +762,9 @@ void Cla_ChangeCapacity (void)
/***** Check if the old capacity equals the new one
(this happens when return is pressed without changes) *****/
if (Cla->Capacity == NewCapacity)
{
/***** Message to show no changes made *****/
Gbl.Alert.Type = Ale_INFO;
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_capacity_of_classroom_X_has_not_changed,
Cla->FullName);
}
Ale_ShowA_fmt (Ale_INFO,Txt_The_capacity_of_classroom_X_has_not_changed,
Cla->FullName);
else
{
/***** Update the table of groups changing the old capacity to the new *****/
@ -794,17 +774,13 @@ void Cla_ChangeCapacity (void)
Cla->Capacity = NewCapacity;
/***** Message to show the change made *****/
Gbl.Alert.Type = Ale_SUCCESS;
if (NewCapacity > Grp_MAX_STUDENTS_IN_A_GROUP)
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_classroom_X_does_not_have_a_limited_capacity_now,
Cla->FullName);
Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_classroom_X_does_not_have_a_limited_capacity_now,
Cla->FullName);
else
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_capacity_of_classroom_X_is_now_Y,
Cla->FullName,NewCapacity);
Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_capacity_of_classroom_X_is_now_Y,
Cla->FullName,NewCapacity);
}
Ale_ShowA_old (Gbl.Alert.Type,Gbl.Alert.Txt);
/***** Show the form again *****/
Cla_EditClassrooms ();
@ -854,21 +830,12 @@ void Cla_ChangeClassroomLocation (void)
Cla_MAX_BYTES_LOCATION);
/* Write message to show the change made */
Gbl.Alert.Type = Ale_SUCCESS;
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_location_of_the_classroom_X_has_changed_to_Y,
Cla->FullName,NewLocation);
Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_location_of_the_classroom_X_has_changed_to_Y,
Cla->FullName,NewLocation);
}
else // The same location
{
Gbl.Alert.Type = Ale_INFO;
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_location_of_the_classroom_X_has_not_changed,
Cla->FullName);
}
/***** Write message to show the change made *****/
Ale_ShowA_old (Gbl.Alert.Type,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_INFO,Txt_The_location_of_the_classroom_X_has_not_changed,
Cla->FullName);
/***** Show the form again *****/
Cla_EditClassrooms ();
@ -1016,24 +983,16 @@ void Cla_RecFormNewClassroom (void)
{
/***** If name of classroom was in database... *****/
if (Cla_CheckIfClassroomNameExists ("ShortName",Cla->ShrtName,-1L))
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_classroom_X_already_exists,
Cla->ShrtName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowA_fmt (Ale_WARNING,Txt_The_classroom_X_already_exists,
Cla->ShrtName);
else if (Cla_CheckIfClassroomNameExists ("FullName",Cla->FullName,-1L))
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_classroom_X_already_exists,
Cla->FullName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowA_fmt (Ale_WARNING,Txt_The_classroom_X_already_exists,
Cla->FullName);
else // Add new classroom to database
Cla_CreateClassroom (Cla);
}
else // If there is not a classroom name
Ale_ShowA_old (Ale_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_classroom);
Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_specify_the_short_name_and_the_full_name_of_the_new_classroom);
/***** Show the form again *****/
Cla_EditClassrooms ();
@ -1057,8 +1016,6 @@ static void Cla_CreateClassroom (struct Classroom *Cla)
Cla->ShrtName,Cla->FullName,Cla->Capacity,Cla->Location);
/***** Write success message *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_Created_new_classroom_X,
Cla->FullName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_SUCCESS,Txt_Created_new_classroom_X,
Cla->FullName);
}