// swad_report.c: report on my use of the platform /* SWAD (Shared Workspace At a Distance), is a web platform developed at the University of Granada (Spain), and used to support university teaching. This file is part of SWAD core. Copyright (C) 1999-2016 Antonio Caņas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General 3 License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ /*****************************************************************************/ /*********************************** Headers *********************************/ /*****************************************************************************/ // #include // For boolean type // #include // For sprintf // #include // For string functions #include "swad_global.h" #include "swad_profile.h" /*****************************************************************************/ /****************************** Public constants *****************************/ /*****************************************************************************/ /*****************************************************************************/ /***************************** Private constants *****************************/ /*****************************************************************************/ /*****************************************************************************/ /****************************** Internal types *******************************/ /*****************************************************************************/ typedef enum { Rep_SEE, Rep_PRINT, } Rep_SeeOrPrint_t; /*****************************************************************************/ /************** External global variables from others modules ****************/ /*****************************************************************************/ extern struct Globals Gbl; /*****************************************************************************/ /************************* Internal global variables *************************/ /*****************************************************************************/ /*****************************************************************************/ /***************************** Private prototypes ****************************/ /*****************************************************************************/ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint); static void Rep_PutIconToPrintMyUsageReport (void); /*****************************************************************************/ /********* Show my usage report (report on my use of the platform) ***********/ /*****************************************************************************/ void Rep_ShowMyUsageReport (void) { Rep_ShowOrPrintMyUsageReport (false); } void Rep_PrintMyUsageReport (void) { Rep_ShowOrPrintMyUsageReport (true); } static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint) { extern const char *Txt_Report_of_use_of_the_platform; /***** Start frame and table *****/ Lay_StartRoundFrame ("100%",Txt_Report_of_use_of_the_platform, SeeOrPrint == Rep_SEE ? Rep_PutIconToPrintMyUsageReport : NULL); /***** Common record *****/ Rec_ShowSharedUsrRecord (Rec_RECORD_PUBLIC,&Gbl.Usrs.Me.UsrDat); /***** Show details of user's profile *****/ Prf_ShowDetailsUserProfile (&Gbl.Usrs.Me.UsrDat); /***** List my courses *****/ Crs_GetAndWriteCrssOfAUsr (&Gbl.Usrs.Me.UsrDat,Rol_TEACHER); Crs_GetAndWriteCrssOfAUsr (&Gbl.Usrs.Me.UsrDat,Rol_STUDENT); /***** End table and frame *****/ Lay_EndRoundFrame (); } /*****************************************************************************/ /********************* Put icon to print my usage report *********************/ /*****************************************************************************/ static void Rep_PutIconToPrintMyUsageReport (void) { extern const char *Txt_Print; Lay_PutContextualLink (ActPrnMyUsgRep,NULL, "print64x64.png", Txt_Print,NULL, NULL); }