From 81b1f363895916a8845992d5a9d823747d35a276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 27 Mar 2017 10:13:34 +0200 Subject: [PATCH] Version 16.171.1 --- swad_banner.c | 61 ++++++++++++++++++++++++++++++++++++------------ swad_changelog.h | 3 ++- swad_link.c | 8 ++++--- swad_text.c | 44 +++++++++++++++++++++++++++++++++- 4 files changed, 96 insertions(+), 20 deletions(-) diff --git a/swad_banner.c b/swad_banner.c index c8815cab7..403ceffbd 100644 --- a/swad_banner.c +++ b/swad_banner.c @@ -59,6 +59,7 @@ extern struct Globals Gbl; /***************************** Private prototypes ****************************/ /*****************************************************************************/ +static void Ban_WriteListOfBanners (void); static void Ban_PutFormToEditBanners (void); static void Ban_GetListBanners (const char *Query); static void Ban_ListBannersForEdition (void); @@ -88,14 +89,16 @@ void Ban_PutLinkToViewBanners (void) } /*****************************************************************************/ -/*************************** List all the banners ****************************/ +/***************************** List all banners ******************************/ /*****************************************************************************/ void Ban_SeeBanners (void) { extern const char *Hlp_SYSTEM_Banners; extern const char *Txt_Banners; - unsigned NumBan; + extern const char *Txt_No_banners; + extern const char *Txt_Create_another_banner; + extern const char *Txt_Create_banner; /***** Get list of banners *****/ Ban_GetListBanners ("SELECT BanCod,Hidden,ShortName,FullName,Img,WWW" @@ -103,24 +106,55 @@ void Ban_SeeBanners (void) " WHERE Hidden='N'" " ORDER BY ShortName"); - /***** Frame head *****/ - Lay_StartRoundFrameTable (NULL,Txt_Banners, - Ban_PutFormToEditBanners,Hlp_SYSTEM_Banners,2); + /***** Start frame *****/ + Lay_StartRoundFrame (NULL,Txt_Banners, + Ban_PutFormToEditBanners,Hlp_SYSTEM_Banners); + + /***** Write all frames *****/ + if (Gbl.Banners.Num) // There are banners + Ban_WriteListOfBanners (); + else // No banners created + Lay_ShowAlert (Lay_INFO,Txt_No_banners); + + /***** Button to create banner *****/ + if (Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM) + { + Act_FormStart (ActEdiBan); + Lay_PutConfirmButton (Gbl.Banners.Num ? Txt_Create_another_banner : + Txt_Create_banner); + Act_FormEnd (); + } + + /***** End frame *****/ + Lay_EndRoundFrame (); + + /***** Free list of banners *****/ + Ban_FreeListBanners (); + } + +/*****************************************************************************/ +/*************************** Write list of banners ***************************/ +/*****************************************************************************/ + +static void Ban_WriteListOfBanners (void) + { + unsigned NumBan; + + /***** List start *****/ + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ diff --git a/swad_changelog.h b/swad_changelog.h index 7ee460088..84eff6977 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -211,13 +211,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.171 (2017-03-27)" +#define Log_PLATFORM_VERSION "SWAD 16.171.1 (2017-03-27)" #define CSS_FILE "swad16.166.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.171.1: Mar 27, 2017 Code refactoring in banners. (217602 lines) Version 16.171: Mar 27, 2017 Action to remove old courses removed from main menu. (217534 lines) Version 16.170.2: Mar 27, 2017 Link to remove old courses from Hierarchy. (217573 lines) Version 16.170.1: Mar 27, 2017 Pending is renamed as Hierarchy. (217554 lines) diff --git a/swad_link.c b/swad_link.c index a924b7bab..14d028a00 100644 --- a/swad_link.c +++ b/swad_link.c @@ -98,12 +98,13 @@ void Lnk_SeeLinks (void) /***** Get list of links *****/ Lnk_GetListLinks (); - /***** Write all the links *****/ + /***** Start frame *****/ Lay_StartRoundFrame (NULL,Txt_Links, Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM ? Lnk_PutIconToEditLinks : NULL, Hlp_SYSTEM_Links); + /***** Write all links *****/ if (Gbl.Links.Num) // There are links Lnk_WriteListOfLinks (); else // No links created @@ -113,11 +114,12 @@ void Lnk_SeeLinks (void) if (Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM) { Act_FormStart (ActEdiLnk); - Lay_PutConfirmButton (Gbl.CurrentCtr.Ctr.Degs.Num ? Txt_Create_another_link : - Txt_Create_link); + Lay_PutConfirmButton (Gbl.Links.Num ? Txt_Create_another_link : + Txt_Create_link); Act_FormEnd (); } + /***** End frame *****/ Lay_EndRoundFrame (); /***** Free list of links *****/ diff --git a/swad_text.c b/swad_text.c index dc830832c..44bbb0dfd 100644 --- a/swad_text.c +++ b/swad_text.c @@ -6092,6 +6092,27 @@ const char *Txt_Create_announcement = "Criar anúncio"; #endif +const char *Txt_Create_another_banner = +#if L==1 + "Crear un altre banner"; +#elif L==2 + "Erstellen Sie ein anderes Werbebanner"; +#elif L==3 + "Create another banner"; +#elif L==4 + "Crear otro banner"; +#elif L==5 + "Créer un autre banniére"; +#elif L==6 + "Crear otro banner"; // Okoteve traducción +#elif L==7 + "Crea un altro banner"; +#elif L==8 + "Tworzenie inny banner"; +#elif L==9 + "Criar um outro banner"; +#endif + const char *Txt_Create_another_centre = #if L==1 "Crear un altre centre"; @@ -6262,7 +6283,7 @@ const char *Txt_Create_assignment = const char *Txt_Create_banner = #if L==1 - "Crear banner"; // Necessita traduccio + "Crear banner"; #elif L==2 "Werbebanner erstellen"; #elif L==3 @@ -24789,6 +24810,27 @@ const char *Txt_No_assignments = "Não há atividades."; #endif +const char *Txt_No_banners = +#if L==1 + "No hi ha banners."; +#elif L==2 + "Keine Werbebanners."; +#elif L==3 + "No banners."; +#elif L==4 + "No hay banners."; +#elif L==5 + "Il n'y a pas de banniéres."; +#elif L==6 + "No hay banners."; // Okoteve traducción +#elif L==7 + "Non ci sono banners."; +#elif L==8 + "Brak banners."; +#elif L==9 + "Não há banners."; +#endif + const char *Txt_no_course_of_origin = // Means: "message sent from any course" #if L==1 "sin asignatura de origen"; // Necessita traduccio