Version 16.167.9

This commit is contained in:
Antonio Cañas Vargas 2017-03-26 03:23:18 +02:00
parent b6aae8da18
commit 1309702c8c
2 changed files with 16 additions and 17 deletions

View File

@ -1756,7 +1756,7 @@ void Ctr_ChangeCtrInsInConfig (void)
Gbl.CurrentCtr.Ctr.CtrCod, Gbl.CurrentCtr.Ctr.CtrCod,
NewIns.InsCod)) NewIns.InsCod))
{ {
Gbl.Error = true; Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_centre_X_already_exists, sprintf (Gbl.Message,Txt_The_centre_X_already_exists,
Gbl.CurrentCtr.Ctr.ShrtName); Gbl.CurrentCtr.Ctr.ShrtName);
} }
@ -1765,7 +1765,7 @@ void Ctr_ChangeCtrInsInConfig (void)
Gbl.CurrentCtr.Ctr.CtrCod, Gbl.CurrentCtr.Ctr.CtrCod,
NewIns.InsCod)) NewIns.InsCod))
{ {
Gbl.Error = true; Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_centre_X_already_exists, sprintf (Gbl.Message,Txt_The_centre_X_already_exists,
Gbl.CurrentCtr.Ctr.FullName); Gbl.CurrentCtr.Ctr.FullName);
} }
@ -1780,7 +1780,8 @@ void Ctr_ChangeCtrInsInConfig (void)
Hie_InitHierarchy (); Hie_InitHierarchy ();
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
sprintf (Gbl.Message,Txt_The_centre_X_has_been_moved_to_the_institution_Y, Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_centre_X_has_been_moved_to_the_institution_Y,
Gbl.CurrentCtr.Ctr.FullName,NewIns.FullName); Gbl.CurrentCtr.Ctr.FullName,NewIns.FullName);
} }
} }
@ -1793,9 +1794,7 @@ void Ctr_ChangeCtrInsInConfig (void)
void Ctr_ContEditAfterChgCtrInConfig (void) void Ctr_ContEditAfterChgCtrInConfig (void)
{ {
/***** Write error/success message *****/ /***** Write error/success message *****/
Lay_ShowAlert (Gbl.Error ? Lay_WARNING : Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
Lay_SUCCESS,
Gbl.Message);
/***** Show the form again *****/ /***** Show the form again *****/
Ctr_ShowConfiguration (); Ctr_ShowConfiguration ();
@ -1926,7 +1925,7 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/
if (!NewCtrName[0]) if (!NewCtrName[0])
{ {
Gbl.Error = true; Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_centre_X_empty, sprintf (Gbl.Message,Txt_You_can_not_leave_the_name_of_the_centre_X_empty,
CurrentCtrName); CurrentCtrName);
} }
@ -1938,7 +1937,7 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
/***** If degree was in database... *****/ /***** If degree was in database... *****/
if (Ctr_CheckIfCtrNameExistsInIns (ParamName,NewCtrName,Ctr->CtrCod,Gbl.CurrentIns.Ins.InsCod)) if (Ctr_CheckIfCtrNameExistsInIns (ParamName,NewCtrName,Ctr->CtrCod,Gbl.CurrentIns.Ins.InsCod))
{ {
Gbl.Error = true; Gbl.AlertType = Lay_WARNING;
sprintf (Gbl.Message,Txt_The_centre_X_already_exists, sprintf (Gbl.Message,Txt_The_centre_X_already_exists,
NewCtrName); NewCtrName);
} }
@ -1948,6 +1947,7 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
Ctr_UpdateInsNameDB (Ctr->CtrCod,FieldName,NewCtrName); Ctr_UpdateInsNameDB (Ctr->CtrCod,FieldName,NewCtrName);
/* Write message to show the change made */ /* Write message to show the change made */
Gbl.AlertType = Lay_SUCCESS;
sprintf (Gbl.Message,Txt_The_centre_X_has_been_renamed_as_Y, sprintf (Gbl.Message,Txt_The_centre_X_has_been_renamed_as_Y,
CurrentCtrName,NewCtrName); CurrentCtrName,NewCtrName);
@ -1957,8 +1957,11 @@ static void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFull
} }
} }
else // The same name else // The same name
{
Gbl.AlertType = Lay_INFO;
sprintf (Gbl.Message,Txt_The_name_of_the_centre_X_has_not_changed, sprintf (Gbl.Message,Txt_The_name_of_the_centre_X_has_not_changed,
CurrentCtrName); CurrentCtrName);
}
} }
} }
@ -2138,17 +2141,12 @@ void Ctr_ChangeCtrStatus (void)
void Ctr_ContEditAfterChgCtr (void) void Ctr_ContEditAfterChgCtr (void)
{ {
if (Gbl.Error) /***** Write success / warning message *****/
/***** Write error message *****/ Lay_ShowAlert (Gbl.AlertType,Gbl.Message);
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
else
{
/***** Write success message showing the change made *****/
Lay_ShowAlert (Lay_INFO,Gbl.Message);
if (Gbl.AlertType == Lay_SUCCESS)
/***** Put button to go to centre changed *****/ /***** Put button to go to centre changed *****/
Ctr_PutButtonToGoToCtr (&Gbl.Ctrs.EditingCtr); Ctr_PutButtonToGoToCtr (&Gbl.Ctrs.EditingCtr);
}
/***** Show the form again *****/ /***** Show the form again *****/
Ctr_EditCentres (); Ctr_EditCentres ();

View File

@ -209,13 +209,14 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.167.8 (2017-03-26)" #define Log_PLATFORM_VERSION "SWAD 16.167.9 (2017-03-26)"
#define CSS_FILE "swad16.166.css" #define CSS_FILE "swad16.166.css"
#define JS_FILE "swad16.144.js" #define JS_FILE "swad16.144.js"
// Number of lines (includes comments but not blank lines) has been got with the following command: // Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1 // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
/* /*
Version 16.167.9: Mar 26, 2017 Code refactoring in edition of centres. (217680 lines)
Version 16.167.8: Mar 26, 2017 Changes in edition of holidays. (217681 lines) Version 16.167.8: Mar 26, 2017 Changes in edition of holidays. (217681 lines)
Version 16.167.7: Mar 26, 2017 Changes in edition of holidays. (217674 lines) Version 16.167.7: Mar 26, 2017 Changes in edition of holidays. (217674 lines)
Version 16.167.6: Mar 26, 2017 Changes in edition of holidays. (217667 lines) Version 16.167.6: Mar 26, 2017 Changes in edition of holidays. (217667 lines)