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,"