diff --git a/js/swad18.58.js b/js/swad18.58.js
index c3a9b368..ec4e136b 100644
--- a/js/swad18.58.js
+++ b/js/swad18.58.js
@@ -710,15 +710,14 @@ function refreshFav (elem,Params) {
}
}
-// Receives and shows fav note area: icon and users who have faved a social note or comment in timeline
+// Receives and shows fav area: icon and users who have faved a social note or comment in timeline
function readAndUpdateFav () {
if (objXMLHttpReqFavSoc.readyState == 4) { // Check if data have been received
if (objXMLHttpReqFavSoc.status == 200)
if (idDivFav) {
- var htmlFav = objXMLHttpReqFavSoc.responseText;
var divFav = document.getElementById(idDivFav); // Access to last click DIV
if (divFav)
- divFav.innerHTML = htmlFav; // Update fav area DIV
+ divFav.innerHTML = objXMLHttpReqFavSoc.responseText; // Update fav area DIV
}
}
}
diff --git a/sql/cambios.sql b/sql/cambios.sql
index 8d627633..ba9f8f6b 100644
--- a/sql/cambios.sql
+++ b/sql/cambios.sql
@@ -12611,3 +12611,8 @@ ORDER BY FavCod LIMIT 7
SELECT UsrCod FROM social_notes_fav WHERE NotCod=278 AND UsrCod<>7 AND UsrCod<>1 ORDER BY FavCod LIMIT 7;
SELECT CAST(~0 AS UNSIGNED);
+
+
+SELECT last_logs.LogCod,last_logs.ActCod,last_logs.Dif,last_logs.Role,last_logs.CtyCod,last_logs.InsCod,last_logs.CtrCod,last_logs.DegCod,actions.Txt FROM (SELECT LogCod,ActCod,UNIX_TIMESTAMP()-UNIX_TIMESTAMP(ClickTime) AS Dif,Role,CtyCod,InsCod,CtrCod,DegCod FROM log_recent ORDER BY LogCod DESC LIMIT 20) AS last_logs LEFT JOIN actions ON last_logs.ActCod=actions.ActCod WHERE actions.Language='es';
+
+
diff --git a/swad_changelog.h b/swad_changelog.h
index e79d683e..bb0c83ba 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -429,10 +429,23 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
-#define Log_PLATFORM_VERSION "SWAD 18.58 (2019-02-24)"
+#define Log_PLATFORM_VERSION "SWAD 18.58.1 (2019-02-24)"
#define CSS_FILE "swad18.57.css"
#define JS_FILE "swad18.58.js"
/*
+ Version 18.58.1: Feb 24, 2019 Code cleaning related to AJAX and timeline.
+ Fixed bug in recent clicks. (237768 lines)
+ 9 changes necessary in database:
+INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1512','es','N','Favorito public. social (global)');
+INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1513','es','N','Deshacer fav. public. social (global)');
+INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1514','es','N','Favorito public. social (usuario)');
+INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1515','es','N','Deshacer fav. public. social (usuario)');
+INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1516','es','N','Favorito coment. social (global)');
+INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1517','es','N','Deshacer fav. coment. social (global)');
+INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1518','es','N','Favorito coment. social (usuario)');
+INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1519','es','N','Deshacer fav. coment. social (usuario)');
+INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1520','es','N','Sugerir lista de usuarios a seguir');
+
Version 18.58: Feb 24, 2019 Favourites in social comments are made in AJAX without reloading page. (237816 lines)
Version 18.57.3: Feb 24, 2019 Changes in social timeline related to AJAX and favourites. (237804 lines)
Version 18.57.2: Feb 24, 2019 Changes in social timeline related to AJAX and favourites. (237827 lines)
diff --git a/swad_form.c b/swad_form.c
index 9a27edf4..561089f5 100644
--- a/swad_form.c
+++ b/swad_form.c
@@ -165,45 +165,47 @@ void Frm_SetParamsForm (char ParamsStr[Frm_MAX_BYTES_PARAMS_STR + 1],Act_Action_
ParamLocation[0] = '\0';
if (NextAction != ActUnk)
+ {
snprintf (ParamAction,sizeof (ParamAction),
"",
Act_GetActCod (NextAction));
- if (Gbl.Session.Id[0])
- snprintf (ParamSession,sizeof (ParamSession),
- "",
- Gbl.Session.Id);
- else if (PutParameterLocationIfNoSesion)
- // Extra parameters necessary when there's no open session
- {
- /* If session is open, course code will be get from session data,
- but if there is not an open session, and next action is known,
- it is necessary to send a parameter with course code */
- if (Gbl.CurrentCrs.Crs.CrsCod > 0)
- // If course selected...
- snprintf (ParamLocation,sizeof (ParamLocation),
- "",
- Gbl.CurrentCrs.Crs.CrsCod);
- else if (Gbl.CurrentDeg.Deg.DegCod > 0)
- // If no course selected, but degree selected...
- snprintf (ParamLocation,sizeof (ParamLocation),
- "",
- Gbl.CurrentDeg.Deg.DegCod);
- else if (Gbl.CurrentCtr.Ctr.CtrCod > 0)
- // If no degree selected, but centre selected...
- snprintf (ParamLocation,sizeof (ParamLocation),
- "",
- Gbl.CurrentCtr.Ctr.CtrCod);
- else if (Gbl.CurrentIns.Ins.InsCod > 0)
- // If no centre selected, but institution selected...
- snprintf (ParamLocation,sizeof (ParamLocation),
- "",
- Gbl.CurrentIns.Ins.InsCod);
- else if (Gbl.CurrentCty.Cty.CtyCod > 0)
- // If no institution selected, but country selected...
- snprintf (ParamLocation,sizeof (ParamLocation),
- "",
- Gbl.CurrentCty.Cty.CtyCod);
+ if (Gbl.Session.Id[0])
+ snprintf (ParamSession,sizeof (ParamSession),
+ "",
+ Gbl.Session.Id);
+ else if (PutParameterLocationIfNoSesion)
+ // Extra parameters necessary when there's no open session
+ {
+ /* If session is open, course code will be get from session data,
+ but if there is not an open session, and next action is known,
+ it is necessary to send a parameter with course code */
+ if (Gbl.CurrentCrs.Crs.CrsCod > 0)
+ // If course selected...
+ snprintf (ParamLocation,sizeof (ParamLocation),
+ "",
+ Gbl.CurrentCrs.Crs.CrsCod);
+ else if (Gbl.CurrentDeg.Deg.DegCod > 0)
+ // If no course selected, but degree selected...
+ snprintf (ParamLocation,sizeof (ParamLocation),
+ "",
+ Gbl.CurrentDeg.Deg.DegCod);
+ else if (Gbl.CurrentCtr.Ctr.CtrCod > 0)
+ // If no degree selected, but centre selected...
+ snprintf (ParamLocation,sizeof (ParamLocation),
+ "",
+ Gbl.CurrentCtr.Ctr.CtrCod);
+ else if (Gbl.CurrentIns.Ins.InsCod > 0)
+ // If no centre selected, but institution selected...
+ snprintf (ParamLocation,sizeof (ParamLocation),
+ "",
+ Gbl.CurrentIns.Ins.InsCod);
+ else if (Gbl.CurrentCty.Cty.CtyCod > 0)
+ // If no institution selected, but country selected...
+ snprintf (ParamLocation,sizeof (ParamLocation),
+ "",
+ Gbl.CurrentCty.Cty.CtyCod);
+ }
}
snprintf (ParamsStr,Frm_MAX_BYTES_PARAMS_STR + 1,
diff --git a/swad_layout.c b/swad_layout.c
index 918c3234..52fd8e3a 100644
--- a/swad_layout.c
+++ b/swad_layout.c
@@ -679,10 +679,6 @@ static void Lay_WriteScriptInit (void)
case ActRcvSocComGbl:
case ActShaSocNotGbl:
case ActUnsSocNotGbl:
- case ActFavSocNotGbl:
- case ActUnfSocNotGbl:
- case ActFavSocComGbl:
- case ActUnfSocComGbl:
case ActReqRemSocPubGbl:
case ActRemSocPubGbl:
case ActReqRemSocComGbl:
@@ -694,7 +690,6 @@ static void Lay_WriteScriptInit (void)
default:
break;
}
- // fprintf (Gbl.F.Out," document.getElementById('whole_page').style.opacity='1';\n");
fprintf (Gbl.F.Out,"}\n"
"\n");
}
@@ -733,10 +728,6 @@ static void Lay_WriteScriptParamsAJAX (void)
case ActRcvSocComGbl:
case ActShaSocNotGbl:
case ActUnsSocNotGbl:
- case ActFavSocNotGbl:
- case ActUnfSocNotGbl:
- case ActFavSocComGbl:
- case ActUnfSocComGbl:
case ActReqRemSocPubGbl:
case ActRemSocPubGbl:
case ActReqRemSocComGbl:
@@ -757,10 +748,6 @@ static void Lay_WriteScriptParamsAJAX (void)
case ActRcvSocComUsr:
case ActShaSocNotUsr:
case ActUnsSocNotUsr:
- case ActFavSocNotUsr:
- case ActUnfSocNotUsr:
- case ActFavSocComUsr:
- case ActUnfSocComUsr:
case ActReqRemSocPubUsr:
case ActRemSocPubUsr:
case ActReqRemSocComUsr:
@@ -1293,25 +1280,9 @@ void Lay_ShowErrorAndExit (const char *Txt)
Lay_WriteEndOfPage ();
}
- if (Gbl.Action.Act == ActFavSocNotGbl ||
- Gbl.Action.Act == ActUnfSocNotGbl)
- DB_QueryINSERT ("can not debug",
- "INSERT INTO debug"
- " (DebugTime,Txt)"
- " VALUES"
- " (NOW(),'antes de Gbl_Cleanup')");
-
/***** Free memory and close all the open files *****/
Gbl_Cleanup ();
- if (Gbl.Action.Act == ActFavSocNotGbl ||
- Gbl.Action.Act == ActUnfSocNotGbl)
- DB_QueryINSERT ("can not debug",
- "INSERT INTO debug"
- " (DebugTime,Txt)"
- " VALUES"
- " (NOW(),'tras Gbl_Cleanup')");
-
/***** Page is generated (except