diff --git a/swad_changelog.h b/swad_changelog.h index 1bd1edd36..15a35f893 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -252,13 +252,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 17.10.6 (2017-09-25)" +#define Log_PLATFORM_VERSION "SWAD 17.10.7 (2017-09-29)" #define CSS_FILE "swad17.0.css" #define JS_FILE "swad16.206.3.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 17.10.7: Sep 29, 2017 Icons to select which projects to show: only my projects or all projects. (231456 lines) Version 17.10.6: Sep 25, 2017 Fixed bug when receiving projects. (231357 lines) Version 17.10.5: Sep 25, 2017 Removed unused code in projects. (231354 lines) Version 17.10.4: Sep 25, 2017 Changes in form behaviour when editing a project. (231365 lines) @@ -517,7 +518,7 @@ CREATE TABLE IF NOT EXISTS gam_users (GamCod INT NOT NULL,UsrCod INT NOT NULL,UN Version 16.235.1: Jun 04, 2017 Limited length of connected users at right column. (221027 lines) Version 16.235: Jun 04, 2017 Fixed bug in notifications about enrolment as a non-editing teacher. Fixed bugs and code refactoring related to users enrolment. (221018 lines) - 1 change necessary in database: + 2 changes necessary in database: UPDATE usr_data SET NotifNtfEvents = (NotifNtfEvents | ((NotifNtfEvents & 0x100) << 12)) & 0x7FFFFFFF; UPDATE usr_data SET EmailNtfEvents = (EmailNtfEvents | ((EmailNtfEvents & 0x100) << 12)) & 0x7FFFFFFF; diff --git a/swad_global.h b/swad_global.h index 62ac77182..19ec8c556 100644 --- a/swad_global.h +++ b/swad_global.h @@ -460,6 +460,10 @@ struct Globals char PathPriv[PATH_MAX + 1]; // Absolute path to the private directory of the course char PathRelPubl[PATH_MAX + 1]; // Relative path to the public directory of the course char PathURLPubl[PATH_MAX + 1]; // Abolute URL to the public part of the course + struct + { + Prj_WhichProjects_t WhichPrjs; // Show my projects or all projects + } Prjs; struct { unsigned NumGrps; diff --git a/swad_project.c b/swad_project.c index e4d8ff181..dea706b07 100644 --- a/swad_project.c +++ b/swad_project.c @@ -70,6 +70,8 @@ typedef enum /*****************************************************************************/ static void Prj_ShowProjectsInCurrentPage (void); +static void Prj_PutFormToSelectWhichProjecsToShow (void); +static void Prj_ShowFormToSelWhichPrjs (Act_Action_t Action,void (*FuncParams) ()); static void Prj_ShowProjectsHead (bool PrintView); static void Prj_ShowTableAllProjectsHead (void); static bool Prj_CheckIfICanCreateProjects (void); @@ -221,6 +223,9 @@ static void Prj_ShowProjectsInCurrentPage (void) Box_StartBox ("100%",Txt_Projects,Prj_PutIconsListProjects, Hlp_ASSESSMENT_Projects,Box_NOT_CLOSABLE); + /***** Select whether show only my projects or all projects *****/ + Prj_PutFormToSelectWhichProjecsToShow (); + if (Gbl.Prjs.Num) { /***** Allocate memory for the project *****/ @@ -268,6 +273,52 @@ static void Prj_ShowProjectsInCurrentPage (void) Prj_FreeListProjects (); } +/*****************************************************************************/ +/***************** Put form to select which groups to show *******************/ +/*****************************************************************************/ + +static void Prj_PutFormToSelectWhichProjecsToShow (void) + { + fprintf (Gbl.F.Out,"
"); + Prj_ShowFormToSelWhichPrjs (ActSeePrj,Prj_PutParams); + fprintf (Gbl.F.Out,"
"); + } + +/*****************************************************************************/ +/*** Show form to choice whether to show only my projects or all projects ****/ +/*****************************************************************************/ + +static void Prj_ShowFormToSelWhichPrjs (Act_Action_t Action,void (*FuncParams) ()) + { + extern const char *Txt_PROJECT_WHICH_PROJECTS[2]; + Prj_WhichProjects_t WhichPrjs; + + fprintf (Gbl.F.Out,"
"); + for (WhichPrjs = Prj_ONLY_MY_PROJECTS; + WhichPrjs <= Prj_ALL_PROJECTS; + WhichPrjs++) + { + fprintf (Gbl.F.Out,"
", + WhichPrjs == Gbl.CurrentCrs.Prjs.WhichPrjs ? "PREF_ON" : + "PREF_OFF"); + Act_FormStart (Action); + Par_PutHiddenParamUnsigned ("WhichPrjs",(unsigned) WhichPrjs); + if (FuncParams) // Extra parameters depending on the action + FuncParams (); + fprintf (Gbl.F.Out,"", + Gbl.Prefs.IconsURL, + WhichPrjs == Prj_ONLY_MY_PROJECTS ? "myhierarchy64x64.png" : + "hierarchy64x64.png", + Txt_PROJECT_WHICH_PROJECTS[WhichPrjs], + Txt_PROJECT_WHICH_PROJECTS[WhichPrjs]); + Act_FormEnd (); + fprintf (Gbl.F.Out,"
"); + } + fprintf (Gbl.F.Out,"
"); + } + /*****************************************************************************/ /******************* Write header with fields of a project *******************/ /*****************************************************************************/ diff --git a/swad_project.h b/swad_project.h index ac7cfecc2..1df7f84d5 100644 --- a/swad_project.h +++ b/swad_project.h @@ -82,6 +82,14 @@ typedef enum } Prj_Order_t; #define Prj_ORDER_DEFAULT Prj_ORDER_START_TIME +#define Prj_NUM_WHICH_PROJECTS 2 +typedef enum + { + Prj_ONLY_MY_PROJECTS, + Prj_ALL_PROJECTS, + } Prj_WhichProjects_t; +#define Prj_WHICH_PROJECTS_DEFAULT Prj_ONLY_MY_PROJECTS + /*****************************************************************************/ /***************************** Public prototypes *****************************/ /*****************************************************************************/ diff --git a/swad_text.c b/swad_text.c index f38849763..e9055d500 100644 --- a/swad_text.c +++ b/swad_text.c @@ -31165,6 +31165,49 @@ const char *Txt_PROJECT_ROLES_PLURAL_Abc[Prj_NUM_ROLES_IN_PROJECT] = #endif }; +const char *Txt_PROJECT_WHICH_PROJECTS[2] = + { +#if L==1 + "Només els meus grups" +#elif L==2 + "Nur meine Gruppen" +#elif L==3 + "Only my groups" +#elif L==4 + "Solo mis grupos" +#elif L==5 + "Uniquement mes groupes" +#elif L==6 + "Solo mis grupos" // Okoteve traducción +#elif L==7 + "Solo i miei gruppi" +#elif L==8 + "Tylko moje grupy" +#elif L==9 + "Apenas os meus grupos" +#endif + , +#if L==1 + "Tots els grups" +#elif L==2 + "Alle Gruppen" +#elif L==3 + "All groups" +#elif L==4 + "Todos los grupos" +#elif L==5 + "Tous les groupes" +#elif L==6 + "Todos los grupos" // Okoteve traducción +#elif L==7 + "Tutti i gruppi" +#elif L==8 + "Wszystkie grupy" +#elif L==9 + "Todos os grupos" +#endif + }; + const char *Txt_Projects = #if L==1 "Projectes (treballs fi de grau/màster, tesi…)";