From 06b2fa44af095d019e5bc038affab3a7390c31ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sat, 25 Mar 2017 18:52:50 +0100 Subject: [PATCH] Version 16.166.2 --- swad_calendar.c | 13 ++++++++++--- swad_changelog.h | 3 ++- swad_holiday.c | 24 +++++++++++++++++------- swad_holiday.h | 1 + swad_text.c | 21 --------------------- 5 files changed, 30 insertions(+), 32 deletions(-) diff --git a/swad_calendar.c b/swad_calendar.c index 5b609ed2e..6b89b1370 100644 --- a/swad_calendar.c +++ b/swad_calendar.c @@ -259,9 +259,6 @@ void Cal_DrawCalendarCty (void) void Cal_DrawCalendarIns (void) { - /***** Link to view and edit holidays *****/ - Hld_PutLinkToHolidays (); - Cal_DrawCalendar (ActSeeCalIns,ActChgCalIns1stDay,Cal_PutIconToPrintCalendarIns,false); } @@ -301,6 +298,16 @@ static void Cal_DrawCalendar (Act_Action_t ActionSeeCalendar, Hld_GetListHolidays (); } + /***** Link to view / edit holidays *****/ + if (ActionSeeCalendar == ActSeeCalIns && // Only for institutions + !PrintView) // Not print view + { + if (Gbl.Hlds.Num) // There are holidays + Hld_PutLinkToHolidays (); + else if (Gbl.Usrs.Me.LoggedRole >= Rol_INS_ADM) // Institution admin or system admin + Hld_PutLinkToCreateHoliday (); + } + /***** Start frame *****/ Lay_StartRoundFrame (NULL,NULL, FunctionToDrawContextualIcons, diff --git a/swad_changelog.h b/swad_changelog.h index bc4813825..6d4eca7c4 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -209,13 +209,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.166.1 (2017-03-24)" +#define Log_PLATFORM_VERSION "SWAD 16.166.2 (2017-03-24)" #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.166.2: Mar 25, 2017 Contextual link to edit holidays in calendar. (217628 lines) Version 16.166.1: Mar 25, 2017 Contextual link to holidays in calendar. (217630 lines) Version 16.166: Mar 24, 2017 Changes in layout related with institutional links. Fixed bug in swad.sql reported by user "proxa" in GitHub. (217613 lines) diff --git a/swad_holiday.c b/swad_holiday.c index dc3783e0c..5cb1645a9 100644 --- a/swad_holiday.c +++ b/swad_holiday.c @@ -72,7 +72,7 @@ static void Hld_PutHeadHolidays (void); static void Hld_CreateHoliday (struct Holiday *Hld); /*****************************************************************************/ -/****************** Put a link to view and edit holidays *********************/ +/************************ Put a link to view holidays ************************/ /*****************************************************************************/ void Hld_PutLinkToHolidays (void) @@ -87,6 +87,22 @@ void Hld_PutLinkToHolidays (void) fprintf (Gbl.F.Out,""); } +/*****************************************************************************/ +/********************* Put a link to create a holiday ************************/ +/*****************************************************************************/ + +void Hld_PutLinkToCreateHoliday (void) + { + extern const char *Txt_Create_holiday; + + fprintf (Gbl.F.Out,"
"); + Lay_PutContextualLink (ActEdiHld,NULL, + "edit64x64.png", + Txt_Create_holiday,Txt_Create_holiday, + NULL); + fprintf (Gbl.F.Out,"
"); + } + /*****************************************************************************/ /*************************** List all the holidays ***************************/ /*****************************************************************************/ @@ -224,18 +240,12 @@ static void Hld_PutIconToEditHlds (void) void Hld_EditHolidays (void) { - extern const char *Txt_There_are_no_holidays; - /***** Get list of places *****/ Plc_GetListPlaces (); /***** Get list of holidays *****/ Hld_GetListHolidays (); - if (!Gbl.Hlds.Num) - /***** Help message *****/ - Lay_ShowAlert (Lay_INFO,Txt_There_are_no_holidays); - /***** Put a form to create a new holiday *****/ Hld_PutFormToCreateHoliday (); diff --git a/swad_holiday.h b/swad_holiday.h index 89b08d2aa..cac65f5ed 100644 --- a/swad_holiday.h +++ b/swad_holiday.h @@ -75,6 +75,7 @@ typedef enum /*****************************************************************************/ void Hld_PutLinkToHolidays (void); +void Hld_PutLinkToCreateHoliday (void); void Hld_SeeHolidays (void); void Hld_EditHolidays (void); diff --git a/swad_text.c b/swad_text.c index e1b941798..0791a97d9 100644 --- a/swad_text.c +++ b/swad_text.c @@ -46998,27 +46998,6 @@ const char *Txt_There_are_no_email_domains = "There are no email domains for notifications."; // Necessita de tradução #endif -const char *Txt_There_are_no_holidays = -#if L==1 - "No existen días festivos."; // Necessita traduccio -#elif L==2 - "There are no holidays."; // Need Übersetzung -#elif L==3 - "There are no holidays."; -#elif L==4 - "No existen días festivos."; -#elif L==5 - "There are no holidays."; // Besoin de traduction -#elif L==6 - "No existen días festivos."; // Okoteve traducción -#elif L==7 - "Non ci sono festività."; -#elif L==8 - "There are no holidays."; // Potrzebujesz tlumaczenie -#elif L==9 - "There are no holidays."; // Necessita de tradução -#endif - const char *Txt_There_are_no_links = #if L==1 "No existen enlaces."; // Necessita traduccio