diff --git a/swad_action.c b/swad_action.c index 1f1c8dad6..0bf87ebca 100644 --- a/swad_action.c +++ b/swad_action.c @@ -163,7 +163,6 @@ Country: 68. ActReqIns Request the creation of a request for a new institution (a teacher makes the petition to an administrator) 69. ActNewIns Request the creation of an institution 70. ActRemIns Remove institution - 71. ActChgInsCty Change country of institution 72. ActRenInsSho Change short name of institution 73. ActRenInsFul Change full name of institution 74. ActChgInsWWW Change web of institution @@ -1507,7 +1506,6 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActReqIns */{1210,-1,TabCty,ActSeeIns ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Ins_RecFormReqIns ,NULL}, /* ActNewIns */{ 698,-1,TabCty,ActSeeIns ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Ins_RecFormNewIns ,NULL}, /* ActRemIns */{ 759,-1,TabCty,ActSeeIns ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Ins_RemoveInstitution ,NULL}, - /* ActChgInsCty */{ 865,-1,TabCty,ActSeeIns ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Ins_ChangeInsCty ,NULL}, /* ActRenInsSho */{ 702,-1,TabCty,ActSeeIns ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,Ins_RenameInsShort ,Ins_ContEditAfterChgIns ,NULL}, /* ActRenInsFul */{ 701,-1,TabCty,ActSeeIns ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,Ins_RenameInsFull ,Ins_ContEditAfterChgIns ,NULL}, /* ActChgInsWWW */{ 700,-1,TabCty,ActSeeIns ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Ins_ChangeInsWWW ,NULL}, @@ -3715,7 +3713,7 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq ActSeeCty, // #862 ActEdiCty, // #863 ActNewCty, // #864 - ActChgInsCty, // #865 + -1, // #865 (obsolete action) ActRenCty, // #866 ActReqDelThrCrsUsr, // #867 ActDelThrForCrsUsr, // #868 diff --git a/swad_action.h b/swad_action.h index 57f11079e..d9ac5e451 100644 --- a/swad_action.h +++ b/swad_action.h @@ -55,7 +55,7 @@ typedef enum typedef int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action -#define Act_NUM_ACTIONS (1+9+51+15+90+70+67+247+186+155+172+36+30+86) +#define Act_NUM_ACTIONS (1+9+51+14+90+70+67+247+186+155+172+36+30+86) #define Act_MAX_ACTION_COD 1590 @@ -160,11 +160,10 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica #define ActReqIns (ActChgPlgIP+ 8) #define ActNewIns (ActChgPlgIP+ 9) #define ActRemIns (ActChgPlgIP+ 10) -#define ActChgInsCty (ActChgPlgIP+ 11) -#define ActRenInsSho (ActChgPlgIP+ 12) -#define ActRenInsFul (ActChgPlgIP+ 13) -#define ActChgInsWWW (ActChgPlgIP+ 14) -#define ActChgInsSta (ActChgPlgIP+ 15) +#define ActRenInsSho (ActChgPlgIP+ 11) +#define ActRenInsFul (ActChgPlgIP+ 12) +#define ActChgInsWWW (ActChgPlgIP+ 13) +#define ActChgInsSta (ActChgPlgIP+ 14) /*****************************************************************************/ /****************************** Institution tab ******************************/ diff --git a/swad_changelog.h b/swad_changelog.h index 7eb92e0ec..177068c3b 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -150,13 +150,17 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.29 (2016-10-20)" +#define Log_PLATFORM_VERSION "SWAD 16.30 (2016-10-20)" #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.30: Oct 20, 2016 Removed country in edition of institutions. (? lines) + 1 change necessary in database: +UPDATE actions SET Obsolete='Y' WHERE ActCod='865'; + Version 16.29: Oct 20, 2016 Removed institution in edition of centres. (205159 lines) 1 change necessary in database: UPDATE actions SET Obsolete='Y' WHERE ActCod='720'; diff --git a/swad_institution.c b/swad_institution.c index 260fa96dd..65cb7a710 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -1202,11 +1202,9 @@ void Ins_WriteSelectorOfInstitution (void) static void Ins_ListInstitutionsForEdition (void) { extern const char *Txt_Institutions_of_COUNTRY_X; - extern const char *Txt_Another_country; extern const char *Txt_INSTITUTION_STATUS[Ins_NUM_STATUS_TXT]; unsigned NumIns; struct Institution *Ins; - unsigned NumCty; char WWW[Ins_MAX_LENGTH_WWW_ON_SCREEN+1]; struct UsrData UsrDat; bool ICanEdit; @@ -1260,36 +1258,6 @@ static void Ins_ListInstitutionsForEdition (void) Log_DrawLogo (Sco_SCOPE_INS,Ins->InsCod,Ins->ShortName,20,NULL,true); fprintf (Gbl.F.Out,""); - /* Country */ - fprintf (Gbl.F.Out,""); - if (Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM) - { - Act_FormStart (ActChgInsCty); - Ins_PutParamOtherInsCod (Ins->InsCod); - fprintf (Gbl.F.Out,""); - Act_FormEnd (); - } - else - fprintf (Gbl.F.Out,"%s",Gbl.CurrentCty.Cty.Name[Gbl.Prefs.Language]); - fprintf (Gbl.F.Out,""); - /* Institution short name */ fprintf (Gbl.F.Out,""); if (ICanEdit) @@ -1756,70 +1724,6 @@ void Ins_ContEditAfterChgInsInConfig (void) Ins_ShowConfiguration (); } -/*****************************************************************************/ -/******************* Change the country of a institution *********************/ -/*****************************************************************************/ - -void Ins_ChangeInsCty (void) - { - extern const char *Txt_The_institution_X_already_exists; - extern const char *Txt_The_country_of_the_institution_X_has_changed_to_Y; - struct Institution *Ins; - struct Country NewCty; - - Ins = &Gbl.Inss.EditingIns; - - /***** Get parameters from form *****/ - /* Get the code of the institution */ - if ((Ins->InsCod = Ins_GetParamOtherInsCod ()) < 0) - Lay_ShowErrorAndExit ("Code of institution is missing."); - - /* Get the new country code for the institution */ - if ((NewCty.CtyCod = Cty_GetParamOtherCtyCod ()) < 0) - Lay_ShowErrorAndExit ("Code of country is missing."); - - /***** Get data of the institution from database *****/ - Ins_GetDataOfInstitutionByCod (Ins,Ins_GET_BASIC_DATA); - - /***** Get data of the country from database *****/ - Cty_GetDataOfCountryByCod (&NewCty,Cty_GET_BASIC_DATA); - - /***** Check if country has changed *****/ - if (NewCty.CtyCod != Ins->CtyCod) - { - /***** Check if it already exists an institution with the same name in the new country *****/ - if (Ins_CheckIfInsNameExistsInCty ("ShortName",Ins->ShortName,-1L,NewCty.CtyCod)) - { - sprintf (Gbl.Message,Txt_The_institution_X_already_exists, - Ins->ShortName); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); - } - else if (Ins_CheckIfInsNameExistsInCty ("FullName",Ins->FullName,-1L,NewCty.CtyCod)) - { - sprintf (Gbl.Message,Txt_The_institution_X_already_exists, - Ins->FullName); - Lay_ShowAlert (Lay_WARNING,Gbl.Message); - } - else - { - /***** Update the table changing the country of the institution *****/ - Ins_UpdateInsCtyDB (Ins->InsCod,NewCty.CtyCod); - Ins->CtyCod = NewCty.CtyCod; - - /***** Write message to show the change made *****/ - sprintf (Gbl.Message,Txt_The_country_of_the_institution_X_has_changed_to_Y, - Ins->FullName,NewCty.Name[Gbl.Prefs.Language]); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); - - /***** Put button to go to institution changed *****/ - Ins_PutButtonToGoToIns (Ins); - } - } - - /***** Show the form again *****/ - Ins_EditInstitutions (); - } - /*****************************************************************************/ /****************** Update country in table of institutions ******************/ /*****************************************************************************/ @@ -2045,18 +1949,6 @@ static void Ins_PutFormToCreateInstitution (void) Log_DrawLogo (Sco_SCOPE_INS,-1L,"",20,NULL,true); fprintf (Gbl.F.Out,""); - /***** Country *****/ - fprintf (Gbl.F.Out,"" - "" - "", - Gbl.CurrentCty.Cty.CtyCod, - Gbl.CurrentCty.Cty.Name[Gbl.Prefs.Language]); - /***** Institution short name *****/ fprintf (Gbl.F.Out,"" "" "%s" "" - "" - "%s" - "" "" "%s" "" @@ -2172,7 +2060,6 @@ static void Ins_PutHeadInstitutionsForEdition (void) "" "", Txt_Code, - Txt_Country, Txt_Short_name_of_the_institution, Txt_Full_name_of_the_institution, Txt_WWW, diff --git a/swad_institution.h b/swad_institution.h index a20e3eda2..c056d5a1f 100644 --- a/swad_institution.h +++ b/swad_institution.h @@ -114,7 +114,6 @@ void Ins_RenameInsShort (void); void Ins_RenameInsFull (void); void Ins_ChangeInsCtyInConfig (void); void Ins_ContEditAfterChgInsInConfig (void); -void Ins_ChangeInsCty (void); void Ins_ChangeInsWWW (void); void Ins_ChangeInsStatus (void); void Ins_ContEditAfterChgIns (void);