diff --git a/swad_changelog.h b/swad_changelog.h
index 392d6b062..c13e9ea3d 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -212,13 +212,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 16.177.1 (2017-04-13)"
+#define Log_PLATFORM_VERSION "SWAD 16.177.2 (2017-04-14)"
#define CSS_FILE "swad16.177.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.177.2: Apr 14, 2017 Code refactoring in forums. (217604 lines)
Version 16.177.1: Apr 13, 2017 Changes in layout of forums. (217590 lines)
Version 16.177: Apr 13, 2017 Code refactoring related to pagination.
Changes in layout of forums. (217609 lines)
diff --git a/swad_forum.c b/swad_forum.c
index 12e19bb45..962b25a06 100644
--- a/swad_forum.c
+++ b/swad_forum.c
@@ -1897,7 +1897,6 @@ static void For_PutFormWhichForums (void)
- only the forums of current institution/degree/course *****/
Act_FormStart (ActSeeFor);
For_PutParamForumOrder ();
- For_PutParamsForumInsDegCrs ();
fprintf (Gbl.F.Out,"
"
"
");
@@ -3729,43 +3728,56 @@ void For_ShowThrPsts (void)
static void For_GetParamsForum (void)
{
- /***** Get which forums I want to see *****/
- Gbl.Forum.WhichForums = (For_WhichForums_t)
- Par_GetParToUnsignedLong ("WhichForum",
- 0,
- For_NUM_WHICH_FORUMS - 1,
- (unsigned long) For_DEFAULT_WHICH_FORUMS);
+ static bool AlreadyGot = false;
- /***** Get order type *****/
- Gbl.Forum.SelectedOrder = (For_Order_t)
- Par_GetParToUnsignedLong ("Order",
- 0,
- For_NUM_ORDERS - 1,
- (unsigned long) For_DEFAULT_ORDER);
+ if (!AlreadyGot)
+ {
+ /***** Get which forums I want to see *****/
+ Gbl.Forum.WhichForums = (For_WhichForums_t)
+ Par_GetParToUnsignedLong ("WhichForum",
+ 0,
+ For_NUM_WHICH_FORUMS - 1,
+ (unsigned long) For_DEFAULT_WHICH_FORUMS);
- /***** Get parameter with code of institution *****/
- Gbl.Forum.Ins.InsCod = Par_GetParToLong ("ForInsCod");
- Ins_GetDataOfInstitutionByCod (&Gbl.Forum.Ins,Ins_GET_BASIC_DATA);
- if (Gbl.Forum.Ins.InsCod > 0)
- Gbl.Forum.Cod = Gbl.Forum.Ins.InsCod;
+ /***** Get order type *****/
+ Gbl.Forum.SelectedOrder = (For_Order_t)
+ Par_GetParToUnsignedLong ("Order",
+ 0,
+ For_NUM_ORDERS - 1,
+ (unsigned long) For_DEFAULT_ORDER);
- /***** Get parameter with code of institution *****/
- Gbl.Forum.Ctr.CtrCod = Par_GetParToLong ("ForCtrCod");
- Ctr_GetDataOfCentreByCod (&Gbl.Forum.Ctr);
- if (Gbl.Forum.Ctr.CtrCod > 0)
- Gbl.Forum.Cod = Gbl.Forum.Ctr.CtrCod;
+ /***** Get parameter with code of course *****/
+ Gbl.Forum.Crs.CrsCod = Par_GetParToLong ("ForCrsCod");
+ Crs_GetDataOfCourseByCod (&Gbl.Forum.Crs);
+ if (Gbl.Forum.Crs.CrsCod > 0)
+ Gbl.Forum.Cod = Gbl.Forum.Crs.CrsCod;
+ else
+ {
+ /***** Get parameter with code of degree *****/
+ Gbl.Forum.Deg.DegCod = Par_GetParToLong ("ForDegCod");
+ Deg_GetDataOfDegreeByCod (&Gbl.Forum.Deg);
+ if (Gbl.Forum.Deg.DegCod > 0)
+ Gbl.Forum.Cod = Gbl.Forum.Deg.DegCod;
+ else
+ {
+ /***** Get parameter with code of institution *****/
+ Gbl.Forum.Ctr.CtrCod = Par_GetParToLong ("ForCtrCod");
+ Ctr_GetDataOfCentreByCod (&Gbl.Forum.Ctr);
+ if (Gbl.Forum.Ctr.CtrCod > 0)
+ Gbl.Forum.Cod = Gbl.Forum.Ctr.CtrCod;
+ else
+ {
+ /***** Get parameter with code of institution *****/
+ Gbl.Forum.Ins.InsCod = Par_GetParToLong ("ForInsCod");
+ Ins_GetDataOfInstitutionByCod (&Gbl.Forum.Ins,Ins_GET_BASIC_DATA);
+ if (Gbl.Forum.Ins.InsCod > 0)
+ Gbl.Forum.Cod = Gbl.Forum.Ins.InsCod;
+ }
+ }
+ }
- /***** Get parameter with code of degree *****/
- Gbl.Forum.Deg.DegCod = Par_GetParToLong ("ForDegCod");
- Deg_GetDataOfDegreeByCod (&Gbl.Forum.Deg);
- if (Gbl.Forum.Deg.DegCod > 0)
- Gbl.Forum.Cod = Gbl.Forum.Deg.DegCod;
-
- /***** Get parameter with code of course *****/
- Gbl.Forum.Crs.CrsCod = Par_GetParToLong ("ForCrsCod");
- Crs_GetDataOfCourseByCod (&Gbl.Forum.Crs);
- if (Gbl.Forum.Crs.CrsCod > 0)
- Gbl.Forum.Cod = Gbl.Forum.Crs.CrsCod;
+ AlreadyGot = true;
+ }
}
/*****************************************************************************/
diff --git a/swad_group.c b/swad_group.c
index dda8e4517..fa17c7106 100644
--- a/swad_group.c
+++ b/swad_group.c
@@ -4298,13 +4298,11 @@ void Grp_ShowFormToSelWhichGrps (Act_Action_t Action,void (*FuncParams) ())
void Grp_GetParamWhichGrps (void)
{
- static bool FirstTime = true;
+ static bool AlreadyGot = false;
Grp_WhichGroups_t WhichGroupsDefault;
- if (FirstTime)
+ if (!AlreadyGot)
{
- FirstTime = false;
-
/***** Get which grous (my groups or all groups) *****/
/* Set default */
switch (Gbl.Action.Act)
@@ -4334,5 +4332,7 @@ void Grp_GetParamWhichGrps (void)
0,
Grp_NUM_WHICH_GROUPS - 1,
(unsigned long) WhichGroupsDefault);
+
+ AlreadyGot = true;
}
}