diff --git a/icon/pie64x64.gif b/icon/pie64x64.gif new file mode 100644 index 000000000..847966c54 Binary files /dev/null and b/icon/pie64x64.gif differ diff --git a/swad_changelog.h b/swad_changelog.h index f90d56227..00fb256ea 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -156,13 +156,16 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.47 (2016-11-06)" +#define Log_PLATFORM_VERSION "SWAD 16.47.1 (2016-11-06)" #define CSS_FILE "swad16.32.1.css" #define JS_FILE "swad16.46.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.47.1: Nov 06, 2016 Icon in list of notices to show figure (statistics). (206129 lines) +Copy icon/pie64x64.gif to icon directory + Version 16.47: Nov 06, 2016 New functions to put a contextual icon to show a figure (statistics). (206113 lines) Version 16.46.10: Nov 06, 2016 Code refactoring in statistics. (206080 lines) Version 16.46.9: Nov 06, 2016 Fixed bug in figures (statistics). (206064 lines) diff --git a/swad_global.h b/swad_global.h index ddf52d248..f1580702a 100644 --- a/swad_global.h +++ b/swad_global.h @@ -463,6 +463,7 @@ struct Globals struct { long HighlightNotCod; // Notice code of a notice to be highlighted + bool ICanEdit; } Notices; } CurrentCrs; struct diff --git a/swad_notice.c b/swad_notice.c index 5b2de2601..72f611d5b 100644 --- a/swad_notice.c +++ b/swad_notice.c @@ -66,6 +66,7 @@ const unsigned Not_MaxCharsURLOnScreen[Not_NUM_TYPES_LISTING] = /***************************** Private prototypes ****************************/ /*****************************************************************************/ +static void Not_PutIconsNotices (void); static void Not_PutIconToAddNewNotice (void); static void Not_PutButtonToAddNewNotice (void); static void Not_GetDataAndShowNotice (long NotCod,bool ICanEdit); @@ -395,11 +396,11 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing,bool ICanEdit) /***** Start frame *****/ sprintf (StrWidth,"%upx", Not_ContainerWidth[Not_LIST_FULL_NOTICES] + 50); + Gbl.CurrentCrs.Notices.ICanEdit = ICanEdit; Lay_StartRoundFrame (StrWidth, Gbl.CurrentCrs.Notices.HighlightNotCod > 0 ? Txt_All_notices : Txt_Notices, - ICanEdit ? Not_PutIconToAddNewNotice : - NULL); + Not_PutIconsNotices); if (!NumNotices) Lay_ShowAlert (Lay_INFO,Txt_No_notices); } @@ -483,6 +484,21 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing,bool ICanEdit) } } +/*****************************************************************************/ +/***************** Put conteextual icons in list of notices ******************/ +/*****************************************************************************/ + +static void Not_PutIconsNotices (void) + { + /***** Put icon to add a new notice *****/ + if (Gbl.CurrentCrs.Notices.ICanEdit) + Not_PutIconToAddNewNotice (); + + /***** Put icon to show a figure *****/ + Gbl.Stat.FigureType = Sta_NOTICES; + Sta_PutIconToShowFigure (); + } + /*****************************************************************************/ /*********************** Put icon to add a new notice ************************/ /*****************************************************************************/