diff --git a/swad_changelog.h b/swad_changelog.h index c1999d15e..6eef4e289 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -194,19 +194,18 @@ // TODO: Un administrador de institución, ¿debería poder cambiar la contraseña de un usuario de esa institución? No lo tengo claro. -// TODO: Poner botón de crear lugares si no se ha creado ningún lugar - /*****************************************************************************/ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.144.2 (2017-03-01)" +#define Log_PLATFORM_VERSION "SWAD 16.144.3 (2017-03-01)" #define CSS_FILE "swad16.144.css" #define JS_FILE "swad16.144.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.144.3: Mar 01, 2017 Button to create a new place when no places have been created. (213334 lines) Version 16.144.2: Mar 01, 2017 Button to create a new group when no groups have been created. (213300 lines) Version 16.144.1: Mar 01, 2017 Zoom photo even if user has no photo. Country name is cached. (213290 lines) diff --git a/swad_place.c b/swad_place.c index 402ddd4be..0403a6aa6 100644 --- a/swad_place.c +++ b/swad_place.c @@ -80,13 +80,18 @@ void Plc_SeePlaces (void) extern const char *Txt_PLACES_ORDER[2]; extern const char *Txt_Other_places; extern const char *Txt_Place_unspecified; + extern const char *Txt_Create_another_place; + extern const char *Txt_Create_place; Plc_Order_t Order; unsigned NumPlc; unsigned NumCtrsWithPlc = 0; unsigned NumCtrsInOtherPlcs; + bool ICanEdit; if (Gbl.CurrentIns.Ins.InsCod > 0) { + ICanEdit = (Gbl.Usrs.Me.LoggedRole >= Rol_INS_ADM); + /***** Get parameter with the type of order in the list of places *****/ Plc_GetParamPlcOrder (); @@ -94,11 +99,12 @@ void Plc_SeePlaces (void) Plc_GetListPlaces (); /***** Table head *****/ - Lay_StartRoundFrameTable (NULL,Txt_Places, - Gbl.Usrs.Me.LoggedRole >= Rol_INS_ADM ? Plc_PutIconToEditPlaces : - NULL, - Hlp_INSTITUTION_Places,2); - fprintf (Gbl.F.Out,""); + Lay_StartRoundFrame (NULL,Txt_Places, + ICanEdit ? Plc_PutIconToEditPlaces : + NULL, + Hlp_INSTITUTION_Places); + fprintf (Gbl.F.Out,"" + ""); for (Order = Plc_ORDER_BY_PLACE; Order <= Plc_ORDER_BY_NUM_CTRS; Order++) @@ -170,8 +176,19 @@ void Plc_SeePlaces (void) Ctr_GetNumCtrsInIns (Gbl.CurrentIns.Ins.InsCod) - NumCtrsWithPlc); + fprintf (Gbl.F.Out,"
"); + + /***** Button to create place *****/ + if (ICanEdit) + { + Act_FormStart (ActEdiPlc); + Lay_PutConfirmButton (Gbl.Plcs.Num ? Txt_Create_another_place : + Txt_Create_place); + Act_FormEnd (); + } + /***** End table *****/ - Lay_EndRoundFrameTable (); + Lay_EndRoundFrame (); /***** Free list of places *****/ Plc_FreeListPlaces (); diff --git a/swad_text.c b/swad_text.c index fc904f441..fa0dcda80 100644 --- a/swad_text.c +++ b/swad_text.c @@ -6033,6 +6033,27 @@ const char *Txt_Create_another_institution = "Criar uma outra institução"; #endif +const char *Txt_Create_another_place = +#if L==1 + "Crear un altre lloc"; +#elif L==2 + "Erstellen Sie einen anderen Standort"; +#elif L==3 + "Create another place"; +#elif L==4 + "Crear otro lugar"; +#elif L==5 + "Créer un autre emplacement"; +#elif L==6 + "Crear otro lugar"; // Okoteve traducción +#elif L==7 + "Crea una altra localit`"; +#elif L==8 + "Tworzenie innego miejsca"; +#elif L==9 + "Criar uma outra localização"; +#endif + const char *Txt_Create_assignment = #if L==1 "Crear actividad"; // Necessita traduccio @@ -6413,7 +6434,7 @@ const char *Txt_Create_password = const char *Txt_Create_place = #if L==1 - "Crear lugar"; // Necessita traduccio + "Crear lloc"; #elif L==2 "Standort eingeben"; #elif L==3