From cc423944b73dc28fc17e60e4f6baaaefbfff98c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sat, 22 Oct 2016 17:31:18 +0200 Subject: [PATCH] Version 16.31.1 --- swad_changelog.h | 3 ++- swad_institution.c | 22 ++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 38dea67c4..cd34e7952 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -150,13 +150,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.31 (2016-10-22)" +#define Log_PLATFORM_VERSION "SWAD 16.31.1 (2016-10-22)" #define CSS_FILE "swad16.25.css" #define JS_FILE "swad15.238.1.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 16.31.1: Oct 22, 2016 Code optimization in renaming of institution. (205104 lines) Version 16.31: Oct 22, 2016 New form in institution configuration to change full name. (205097 lines) 1 change necessary in database: INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1591','es','N','Cambiar nombre completo ins.'); diff --git a/swad_institution.c b/swad_institution.c index 2ae73e156..3c8c6b6f2 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -76,6 +76,7 @@ static bool Ins_CheckIfICanEdit (struct Institution *Ins); static Ins_StatusTxt_t Ins_GetStatusTxtFromStatusBits (Ins_Status_t Status); static Ins_Status_t Ins_GetStatusBitsFromStatusTxt (Ins_StatusTxt_t StatusTxt); static void Ins_PutParamOtherInsCod (long InsCod); +static void Ins_GetInsCodFromForm (void); static void Ins_RenameInstitution (struct Institution *Ins,Cns_ShortOrFullName_t ShortOrFullName); static bool Ins_CheckIfInsNameExistsInCty (const char *FieldName,const char *Name,long InsCod,long CtyCod); static void Ins_UpdateInsNameDB (long InsCod,const char *FieldName,const char *NewInsName); @@ -1535,10 +1536,7 @@ void Ins_RemoveInstitution (void) void Ins_RenameInsShort (void) { - /* Get the code of the institution */ - if ((Gbl.Inss.EditingIns.InsCod = Ins_GetParamOtherInsCod ()) < 0) - Lay_ShowErrorAndExit ("Code of institution is missing."); - + Ins_GetInsCodFromForm (); Ins_RenameInstitution (&Gbl.Inss.EditingIns,Cns_SHORT_NAME); } @@ -1548,10 +1546,7 @@ void Ins_RenameInsShort (void) void Ins_RenameInsFull (void) { - /* Get the code of the institution */ - if ((Gbl.Inss.EditingIns.InsCod = Ins_GetParamOtherInsCod ()) < 0) - Lay_ShowErrorAndExit ("Code of institution is missing."); - + Ins_GetInsCodFromForm (); Ins_RenameInstitution (&Gbl.Inss.EditingIns,Cns_FULL_NAME); } @@ -1560,6 +1555,17 @@ void Ins_RenameInsFullInConfig (void) Ins_RenameInstitution (&Gbl.CurrentIns.Ins,Cns_FULL_NAME); } +/*****************************************************************************/ +/********************** Get the code of the institution **********************/ +/*****************************************************************************/ + +static void Ins_GetInsCodFromForm (void) + { + /***** Get the code of the institution *****/ + if ((Gbl.Inss.EditingIns.InsCod = Ins_GetParamOtherInsCod ()) < 0) + Lay_ShowErrorAndExit ("Code of institution is missing."); + } + /*****************************************************************************/ /******************** Change the name of an institution **********************/ /*****************************************************************************/