diff --git a/swad_centre.c b/swad_centre.c index de3296011..fbc11c8f0 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -1626,6 +1626,7 @@ void Ctr_ChangeCentrePlace (void) { extern const char *Txt_The_place_of_the_centre_has_changed; struct Centre *Ctr; + long NewPlcCod; char Query[512]; Ctr = &Gbl.Ctrs.EditingCtr; @@ -1636,12 +1637,16 @@ void Ctr_ChangeCentrePlace (void) Lay_ShowErrorAndExit ("Code of centre is missing."); /* Get parameter with centre code */ - Ctr->PlcCod = Plc_GetParamPlcCod (); + NewPlcCod = Plc_GetParamPlcCod (); + + /***** Get data of centre from database *****/ + Ctr_GetDataOfCentreByCod (Ctr); /***** Update place in table of centres *****/ sprintf (Query,"UPDATE centres SET PlcCod='%ld' WHERE CtrCod='%ld'", - Ctr->PlcCod,Ctr->CtrCod); + NewPlcCod,Ctr->CtrCod); DB_QueryUPDATE (Query,"can not update the place of a centre"); + Ctr->PlcCod = NewPlcCod; /***** Write message to show the change made *****/ Lay_ShowAlert (Lay_SUCCESS,Txt_The_place_of_the_centre_has_changed); diff --git a/swad_changelog.h b/swad_changelog.h index 54ba104dd..a1a55e835 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -123,13 +123,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.144.1 (2016-03-03)" +#define Log_PLATFORM_VERSION "SWAD 15.144.2 (2016-03-05)" #define CSS_FILE "swad15.137.2.css" #define JS_FILE "swad15.131.3.js" // 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 /* + Version 15.144.2: Mar 05, 2016 Fixed minor bugs in edition of centres. (195761 lines) Version 15.144.1: Mar 03, 2016 Fixed bugs related to last chages made. (195756 lines) Version 15.144: Mar 03, 2016 Direct login always available. (195755 lines) 3 changes necessary in database: diff --git a/swad_config.h b/swad_config.h index 0f49783ec..1907cf9d4 100644 --- a/swad_config.h +++ b/swad_config.h @@ -28,8 +28,8 @@ /** Uncomment one of the following installations of SWAD or create your own **/ /*****************************************************************************/ -//#define LOCALHOST_UBUNTU // Comment this line if not applicable -#define OPENSWAD_ORG // Comment this line if not applicable +#define LOCALHOST_UBUNTU // Comment this line if not applicable +//#define OPENSWAD_ORG // Comment this line if not applicable //#define SWAD_UGR_ES // Comment this line if not applicable //#define WWW_CEVUNA_UNA_PY // Comment this line if not applicable