Version 18.46.3

This commit is contained in:
Antonio Cañas Vargas 2019-02-16 00:15:59 +01:00
parent f3afcaa930
commit 0af8aea203
5 changed files with 58 additions and 113 deletions

View File

@ -402,10 +402,11 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 18.46.2 (2019-02-16)"
#define Log_PLATFORM_VERSION "SWAD 18.46.3 (2019-02-16)"
#define CSS_FILE "swad18.41.1.css"
#define JS_FILE "swad18.32.1.js"
/*
Version 18.46.3: Feb 16, 2019 Refactoring code related to alerts. (238243 lines)
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.

View File

@ -197,7 +197,7 @@ void Cty_SeeCtyWithPendingInss (void)
Box_EndBoxTable ();
}
else
Ale_ShowA_old (Ale_INFO,Txt_There_are_no_countries_with_requests_for_institutions_to_be_confirmed);
Ale_ShowA_fmt (Ale_INFO,Txt_There_are_no_countries_with_requests_for_institutions_to_be_confirmed);
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
@ -1740,7 +1740,7 @@ void Cty_RemoveCountry (void)
if (Cty.NumInss ||
Cty.NumUsrsWhoClaimToBelongToCty ||
Cty.NumUsrs) // Country has institutions or users ==> don't remove
Ale_ShowA_old (Ale_WARNING,Txt_You_can_not_remove_a_country_with_institutions_or_users);
Ale_ShowA_fmt (Ale_WARNING,Txt_You_can_not_remove_a_country_with_institutions_or_users);
else // Country has no users ==> remove it
{
/***** Remove surveys of the country *****/
@ -1755,10 +1755,8 @@ void Cty_RemoveCountry (void)
Cty_FlushCacheCountryName ();
/***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_Country_X_removed,
Cty.Name[Gbl.Prefs.Language]);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_SUCCESS,Txt_Country_X_removed,
Cty.Name[Gbl.Prefs.Language]);
}
/***** Show the form again *****/
@ -1797,12 +1795,8 @@ void Cty_RenameCountry (void)
/***** Check if new name is empty *****/
if (!NewCtyName[0])
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_You_can_not_leave_the_name_of_the_country_X_empty,
Cty->Name[Language]);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowA_fmt (Ale_WARNING,Txt_You_can_not_leave_the_name_of_the_country_X_empty,
Cty->Name[Language]);
else
{
/***** Check if old and new names are the same
@ -1811,12 +1805,8 @@ void Cty_RenameCountry (void)
{
/***** If country was in database... *****/
if (Cty_CheckIfCountryNameExists (Language,NewCtyName,Cty->CtyCod))
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_country_X_already_exists,
NewCtyName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowA_fmt (Ale_WARNING,Txt_The_country_X_already_exists,
NewCtyName);
else
{
/* Update the table changing old name by new name */
@ -1826,10 +1816,8 @@ void Cty_RenameCountry (void)
Cty_UpdateCtyNameDB (Cty->CtyCod,FieldName,NewCtyName);
/* Write message to show the change made */
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_country_X_has_been_renamed_as_Y,
Cty->Name[Language],NewCtyName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_country_X_has_been_renamed_as_Y,
Cty->Name[Language],NewCtyName);
/* Update country name */
Str_Copy (Cty->Name[Language],NewCtyName,
@ -1837,12 +1825,8 @@ void Cty_RenameCountry (void)
}
}
else // The same name
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_name_of_the_country_X_has_not_changed,
Cty->Name[Language]);
Ale_ShowA_old (Ale_INFO,Gbl.Alert.Txt);
}
Ale_ShowA_fmt (Ale_INFO,Txt_The_name_of_the_country_X_has_not_changed,
Cty->Name[Language]);
}
/***** Show the form again *****/
@ -1943,10 +1927,8 @@ void Cty_ChangeCtyWWW (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);
/***** Show the form again *****/
Cty_EditCountries ();
@ -2149,15 +2131,13 @@ void Cty_RecFormNewCountry (void)
/* Get numeric country code */
if ((Cty->CtyCod = Cty_GetParamOtherCtyCod ()) < 0)
{
Ale_ShowA_old (Ale_WARNING,Txt_You_must_specify_the_numerical_code_of_the_new_country);
Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_specify_the_numerical_code_of_the_new_country);
CreateCountry = false;
}
else if (Cty_CheckIfNumericCountryCodeExists (Cty->CtyCod))
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_numerical_code_X_already_exists,
Cty->CtyCod);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_WARNING,Txt_The_numerical_code_X_already_exists,
Cty->CtyCod);
CreateCountry = false;
}
else // Numeric code correct
@ -2171,20 +2151,16 @@ void Cty_RecFormNewCountry (void)
if (Cty->Alpha2[i] < 'A' ||
Cty->Alpha2[i] > 'Z')
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_alphabetical_code_X_is_not_correct,
Cty->Alpha2);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_WARNING,Txt_The_alphabetical_code_X_is_not_correct,
Cty->Alpha2);
CreateCountry = false;
}
if (CreateCountry)
{
if (Cty_CheckIfAlpha2CountryCodeExists (Cty->Alpha2))
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_alphabetical_code_X_already_exists,
Cty->Alpha2);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_WARNING,Txt_The_alphabetical_code_X_already_exists,
Cty->Alpha2);
CreateCountry = false;
}
else // Alphabetic code correct
@ -2204,17 +2180,15 @@ void Cty_RecFormNewCountry (void)
/***** If name of country was in database... *****/
if (Cty_CheckIfCountryNameExists (Lan,Cty->Name[Lan],-1L))
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_country_X_already_exists,
Cty->Name[Lan]);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_WARNING,Txt_The_country_X_already_exists,
Cty->Name[Lan]);
CreateCountry = false;
break;
}
}
else // If there is not a country name
{
Ale_ShowA_old (Ale_WARNING,Txt_You_must_specify_the_name_of_the_new_country_in_all_languages);
Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_specify_the_name_of_the_new_country_in_all_languages);
CreateCountry = false;
break;
}
@ -2297,10 +2271,8 @@ static void Cty_CreateCountry (struct Country *Cty)
Cty->CtyCod,Cty->Alpha2,SubQueryNam2,SubQueryWWW2);
/***** Write success message *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_Created_new_country_X,
Cty->Name);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_SUCCESS,Txt_Created_new_country_X,
Cty->Name);
}
/*****************************************************************************/

View File

@ -1164,7 +1164,7 @@ static void Crs_ListCourses (void)
Tbl_EndTable ();
}
else // No courses created in the current degree
Ale_ShowA_old (Ale_INFO,Txt_No_courses);
Ale_ShowA_fmt (Ale_INFO,Txt_No_courses);
/***** Button to create course *****/
if (Crs_CheckIfICanCreateCourses ())
@ -1998,21 +1998,19 @@ void Crs_RemoveCourse (void)
{
/***** Check if this course has users *****/
if (Crs.NumUsrs[Rol_UNK]) // Course has users ==> don't remove
Ale_ShowA_old (Ale_WARNING,Txt_To_remove_a_course_you_must_first_remove_all_users_in_the_course);
Ale_ShowA_fmt (Ale_WARNING,Txt_To_remove_a_course_you_must_first_remove_all_users_in_the_course);
else // Course has no users ==> remove it
{
/***** Remove course *****/
Crs_RemoveCourseCompletely (Crs.CrsCod);
/***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_Course_X_removed,
Crs.FullName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_SUCCESS,Txt_Course_X_removed,
Crs.FullName);
}
}
else
Ale_ShowA_old (Ale_WARNING,Txt_You_dont_have_permission_to_edit_this_course);
Ale_ShowA_fmt (Ale_WARNING,Txt_You_dont_have_permission_to_edit_this_course);
/***** Show the form again *****/
Crs_EditCourses ();
@ -3470,12 +3468,10 @@ void Crs_RemoveOldCrss (void)
SecondsWithoutAccess);
if (NumCrss)
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_Eliminating_X_courses_whithout_users_and_with_more_than_Y_months_without_access,
NumCrss,
MonthsWithoutAccess,
Cfg_PLATFORM_SHORT_NAME);
Ale_ShowA_old (Ale_INFO,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_INFO,Txt_Eliminating_X_courses_whithout_users_and_with_more_than_Y_months_without_access,
NumCrss,
MonthsWithoutAccess,
Cfg_PLATFORM_SHORT_NAME);
/***** Remove courses *****/
for (NumCrs = 0;
@ -3493,8 +3489,6 @@ void Crs_RemoveOldCrss (void)
}
/***** Write end message *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_X_courses_have_been_eliminated,
NumCrssRemoved);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_SUCCESS,Txt_X_courses_have_been_eliminated,
NumCrssRemoved);
}

View File

@ -88,7 +88,7 @@ void DB_CreateTablesIfNotExist (void)
extern const char *Txt_Created_tables_in_the_database_that_did_not_exist;
/***** Information message *****/
Ale_ShowA_old (Ale_INFO,Txt_Creating_database_tables_if_they_do_not_exist);
Ale_ShowA_fmt (Ale_INFO,Txt_Creating_database_tables_if_they_do_not_exist);
fprintf (Gbl.F.Out,"<ol>");
/***** Table IP_prefs *****/
@ -3086,7 +3086,7 @@ mysql> DESCRIBE ws_keys;
/***** Show success message *****/
fprintf (Gbl.F.Out,"</ol>");
Ale_ShowA_old (Ale_SUCCESS,Txt_Created_tables_in_the_database_that_did_not_exist);
Ale_ShowA_fmt (Ale_SUCCESS,Txt_Created_tables_in_the_database_that_did_not_exist);
}
/*****************************************************************************/

View File

@ -218,7 +218,7 @@ static void DT_ListDegreeTypes (Act_Action_t NextAction,DT_Order_t SelectedOrder
Tbl_EndTable ();
}
else // No degree types created
Ale_ShowA_old (Ale_INFO,Txt_No_types_of_degree);
Ale_ShowA_fmt (Ale_INFO,Txt_No_types_of_degree);
/***** Button to create degree type *****/
if (DT_CheckIfICanCreateDegreeTypes ())
@ -567,10 +567,8 @@ static void DT_CreateDegreeType (struct DegreeType *DegTyp)
DegTyp->DegTypName);
/***** Write success message *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_Created_new_type_of_degree_X,
DegTyp->DegTypName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_SUCCESS,Txt_Created_new_type_of_degree_X,
DegTyp->DegTypName);
}
/*****************************************************************************/
@ -741,17 +739,13 @@ void DT_RecFormNewDegreeType (void)
{
/***** If name of degree type was in database... *****/
if (DT_CheckIfDegreeTypeNameExists (DegTyp->DegTypName,-1L))
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_type_of_degree_X_already_exists,
DegTyp->DegTypName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowA_fmt (Ale_WARNING,Txt_The_type_of_degree_X_already_exists,
DegTyp->DegTypName);
else // Add new degree type to database
DT_CreateDegreeType (DegTyp);
}
else // If there is not a degree type name
Ale_ShowA_old (Ale_WARNING,Txt_You_must_specify_the_name_of_the_new_type_of_degree);
Ale_ShowA_fmt (Ale_WARNING,Txt_You_must_specify_the_name_of_the_new_type_of_degree);
/***** Show the form again *****/
DT_EditDegreeTypes ();
@ -776,17 +770,15 @@ void DT_RemoveDegreeType (void)
/***** Check if this degree type has degrees *****/
if (DegTyp.NumDegs) // Degree type has degrees => don't remove
Ale_ShowA_old (Ale_WARNING,Txt_To_remove_a_type_of_degree_you_must_first_remove_all_degrees_of_that_type);
Ale_ShowA_fmt (Ale_WARNING,Txt_To_remove_a_type_of_degree_you_must_first_remove_all_degrees_of_that_type);
else // Degree type has no degrees => remove it
{
/***** Remove degree type *****/
DT_RemoveDegreeTypeCompletely (DegTyp.DegTypCod);
/***** Write message to show the change made *****/
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_Type_of_degree_X_removed,
DegTyp.DegTypName);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_SUCCESS,Txt_Type_of_degree_X_removed,
DegTyp.DegTypName);
}
/***** Show the form again *****/
@ -954,12 +946,8 @@ void DT_RenameDegreeType (void)
/***** Check if new name is empty *****/
if (!NewNameDegTyp[0])
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_You_can_not_leave_the_name_of_the_type_of_degree_X_empty,
DegTyp->DegTypName);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowA_fmt (Ale_WARNING,Txt_You_can_not_leave_the_name_of_the_type_of_degree_X_empty,
DegTyp->DegTypName);
else
{
/***** Check if old and new names are the same
@ -968,12 +956,8 @@ void DT_RenameDegreeType (void)
{
/***** If degree type was in database... *****/
if (DT_CheckIfDegreeTypeNameExists (NewNameDegTyp,DegTyp->DegTypCod))
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_type_of_degree_X_already_exists,
NewNameDegTyp);
Ale_ShowA_old (Ale_WARNING,Gbl.Alert.Txt);
}
Ale_ShowA_fmt (Ale_WARNING,Txt_The_type_of_degree_X_already_exists,
NewNameDegTyp);
else
{
/* Update the table changing old name by new name */
@ -983,19 +967,13 @@ void DT_RenameDegreeType (void)
NewNameDegTyp,DegTyp->DegTypCod);
/* Write message to show the change made */
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_type_of_degree_X_has_been_renamed_as_Y,
DegTyp->DegTypName,NewNameDegTyp);
Ale_ShowA_old (Ale_SUCCESS,Gbl.Alert.Txt);
Ale_ShowA_fmt (Ale_SUCCESS,Txt_The_type_of_degree_X_has_been_renamed_as_Y,
DegTyp->DegTypName,NewNameDegTyp);
}
}
else // The same name
{
snprintf (Gbl.Alert.Txt,sizeof (Gbl.Alert.Txt),
Txt_The_name_of_the_type_of_degree_X_has_not_changed,
NewNameDegTyp);
Ale_ShowA_old (Ale_INFO,Gbl.Alert.Txt);
}
Ale_ShowA_fmt (Ale_INFO,Txt_The_name_of_the_type_of_degree_X_has_not_changed,
NewNameDegTyp);
}
/***** Show the form again *****/