Version18.68

This commit is contained in:
Antonio Cañas Vargas 2019-03-07 22:15:47 +01:00
parent dee9c6310a
commit 7f459e65fa
6 changed files with 43 additions and 49 deletions

View File

@ -2669,7 +2669,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
/* ActLstTchAll */{ 578,-1,TabUnk,ActLstTch ,0x3F8,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_BRW_NEW_TAB,NULL ,Usr_ListAllDataTchs ,NULL},
/* ActSeeRecOneStd */{1174,-1,TabUnk,ActLstStd ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Rec_GetUsrAndShowRecOneStdCrs ,NULL},
/* ActSeeRecOneTch */{1175,-1,TabUnk,ActLstTch ,0x3F8,0x3C4,0x3C4,0x3C4,0x3C4,0x3C4,0x3C4,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Rec_GetUsrAndShowRecOneTchCrs ,NULL},
/* ActSeeRecOneTch */{1175,-1,TabUnk,ActLstTch ,0x3F8,0x3C7, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Rec_GetUsrAndShowRecOneTchCrs ,NULL},
/* ActSeeRecSevGst */{1187,-1,TabUnk,ActLstOth ,0x200,0x200,0x200,0x200,0x200,0x200,0x200,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Rec_ListRecordsGstsShow ,NULL},
/* ActSeeRecSevStd */{ 89,-1,TabUnk,ActLstStd ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Rec_ListRecordsStdsShow ,NULL},

View File

@ -375,6 +375,21 @@ Saludos,
Antonio
*/
/* Sugerencias de Atanasio José Rubio Gil (marzo de 2019):
Te escribo por aquí porque no hay notificaciones para los comentarios o posibilidad de seguir hilo. Ahí van dos mejoras chulas. Las otras que se me ocurren son ver sólo posts de estudiantes o mutear anuncios oficiales y hostear las imágenes en un servicio externo (como imgur, que permite subida y enlazado automático) para que no pierdan calidad.
¡Muchas gracias por esta pedazo de plataforma!
Respuesta:
Pues la verdad es que notificaciones de comentarios hay (lo puedes comprobar en Perfil > Ajustes), lo que pasa es que desde que he puesto el timeline nada más entrar, la notificación se marca como vista por el hecho de ver el timeline. Quiero decir, que si estás en otra opción verás la notificación, pero si te acabas de identificar, como lo primero que se hace es ir al timeline, se elimina la notificación. Pensaré a ver si hay alguna solución.
Lo de la calidad de las imágenes es cuestión de aumentarla un poco al comprimirlas, aunque ocuparán más. Lo veré.
Lo de mutear anuncios, en principio prefiero hacer una opción para seguir masivamente a usuarios de asignaturas y que la gente use preferiblemente la opción de ver sólo los mensajes de los que sigues.
*/
// TODO: Eliminar todas las preguntas de test de un golpe
// TODO: URGENTE: Cuando se cree un descriptor nuevo TIENE QUE ESTAR INHABILITADO porque si no los alumnos pueden ver el examen (Miguel Damas)
@ -432,10 +447,13 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 18.67 (2019-03-07)"
#define Log_PLATFORM_VERSION "SWAD 18.68 (2019-03-07)"
#define CSS_FILE "swad18.67.css"
#define JS_FILE "swad18.64.js"
/*
Version 18.68: Mar 07, 2019 Photo is zoomed even in record card.
Teachers record cards are only visible inside courses.
Fixed bug in notifications. (238918 lines)
Version 18.67: Mar 07, 2019 Nickname shown in photo zoom. (238927 lines)
Version 18.66.6: Mar 07, 2019 Number of days printed as months or years in user's figures. (238846 lines)
Version 18.66.5: Mar 06, 2019 Code refactoring in user's figures. (238739 lines)

View File

@ -1807,7 +1807,7 @@ static void For_WriteLinksToGblForums (bool IsLastItemInLevel[1 + For_FORUM_MAX_
Rol_GetRolesInAllCrssIfNotYetGot (&Gbl.Usrs.Me.UsrDat);
ICanSeeTeacherForum = Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM ||
(Gbl.Usrs.Me.UsrDat.Roles.InCrss & ((1 << Rol_NET) |
(1 << Rol_TCH)));
(1 << Rol_TCH)));
/***** Link to forum global *****/
Forum.Type = For_FORUM_GLOBAL_USRS;
@ -1843,7 +1843,7 @@ static void For_WriteLinksToPlatformForums (bool IsLastForum,
Rol_GetRolesInAllCrssIfNotYetGot (&Gbl.Usrs.Me.UsrDat);
ICanSeeTeacherForum = Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM ||
(Gbl.Usrs.Me.UsrDat.Roles.InCrss & ((1 << Rol_NET) |
(1 << Rol_TCH)));
(1 << Rol_TCH)));
/***** Link to forum of users about the platform *****/
Forum.Type = For_FORUM__SWAD__USRS;
@ -3868,7 +3868,7 @@ static void For_RestrictAccess (void)
case For_FORUM__SWAD__TCHS:
Rol_GetRolesInAllCrssIfNotYetGot (&Gbl.Usrs.Me.UsrDat);
ICanSeeForum = (Gbl.Usrs.Me.UsrDat.Roles.InCrss & ((1 << Rol_NET) |
(1 << Rol_TCH)));
(1 << Rol_TCH)));
break;
case For_FORUM_INSTIT_USRS:
MaxRole = Rol_GetMyMaxRoleInIns (Gbl.Forum.ForumSelected.Location);

View File

@ -1327,7 +1327,8 @@ static void Rec_ShowRecordOneTchCrs (void)
Frm_StartForm (ActPrnRecSevTch);
Usr_PutHiddenParUsrCodAll (ActPrnRecSevTch,Gbl.Usrs.Other.UsrDat.EncryptedUsrCod);
Par_PutHiddenParamChar ("ParamOfficeHours",'Y');
Par_PutHiddenParamChar ("ShowOfficeHours",'Y');
Par_PutHiddenParamChar ("ShowOfficeHours",ShowOfficeHours ? 'Y' :
'N');
Rec_ShowLinkToPrintPreviewOfRecords ();
Frm_EndForm ();
@ -1441,7 +1442,7 @@ static void Rec_ListRecordsTchs (Rec_SharedRecordViewType_t TypeOfView)
Par_GetNextStrUntilSeparParamMult (&Ptr,UsrDat.EncryptedUsrCod,
Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64);
Usr_GetUsrCodFromEncryptedUsrCod (&UsrDat);
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // Get from the database the data of the student
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // Get from the database the data of the student
if (Usr_CheckIfUsrBelongsToCurrentCrs (&UsrDat))
{
/* Check if this user has accepted
@ -1488,6 +1489,7 @@ static void Rec_ListRecordsTchs (Rec_SharedRecordViewType_t TypeOfView)
NumUsr++;
}
}
/***** Free memory used for user's data *****/
Usr_UsrDataDestructor (&UsrDat);
@ -2742,7 +2744,7 @@ static void Rec_ShowPhoto (struct UsrData *UsrDat)
fprintf (Gbl.F.Out,"<td rowspan=\"3\" class=\"REC_C3_TOP CENTER_TOP\">");
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO186x248",Pho_NO_ZOOM,false);
"PHOTO186x248",Pho_ZOOM,false);
fprintf (Gbl.F.Out,"</td>");
}
@ -2919,7 +2921,7 @@ static void Rec_ShowRole (struct UsrData *UsrDat,
case Rec_SHA_SIGN_UP_IN_CRS_FORM: // I want to apply for enrolment
/***** Set default role *****/
if (UsrDat->UsrCod == Gbl.CurrentCrs.Crs.RequesterUsrCod || // Creator of the course
(UsrDat->Roles.InCrss & (1 << Rol_TCH))) // Teacher in other courses
(UsrDat->Roles.InCrss & (1 << Rol_TCH))) // Teacher in other courses
DefaultRoleInForm = Rol_TCH; // Request sign up as a teacher
else if ((UsrDat->Roles.InCrss & (1 << Rol_NET))) // Non-editing teacher in other courses
DefaultRoleInForm = Rol_NET; // Request sign up as a non-editing teacher
@ -3027,9 +3029,9 @@ static void Rec_ShowRole (struct UsrData *UsrDat,
{
/***** Set default role *****/
DefaultRoleInForm = (UsrDat->Roles.InCrss & ((1 << Rol_STD) |
(1 << Rol_NET) |
(1 << Rol_TCH))) ? Rol_USR : // If user belongs to any course
Rol_GST; // If user don't belong to any course
(1 << Rol_NET) |
(1 << Rol_TCH))) ? Rol_USR : // If user belongs to any course
Rol_GST; // If user don't belong to any course
/***** Selector of role *****/
fprintf (Gbl.F.Out,"<select id=\"Role\" name=\"Role\">"

View File

@ -4988,7 +4988,7 @@ void Soc_GetNotifSocialPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
}
/***** Copy summary string *****/
Str_LimitLengthHTMLStr (Content,Ntf_MAX_BYTES_SUMMARY);
Str_LimitLengthHTMLStr (Content,Ntf_MAX_CHARS_SUMMARY);
Str_Copy (SummaryStr,Content,
Ntf_MAX_BYTES_SUMMARY);
}
@ -5028,7 +5028,7 @@ void Soc_GetNotifSocialPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
}
/***** Copy summary string *****/
Str_LimitLengthHTMLStr (Content,Ntf_MAX_BYTES_SUMMARY);
Str_LimitLengthHTMLStr (Content,Ntf_MAX_CHARS_SUMMARY);
Str_Copy (SummaryStr,Content,
Ntf_MAX_BYTES_SUMMARY);
break;

View File

@ -304,7 +304,7 @@ void Usr_ResetUsrDataExceptUsrCodAndIDs (struct UsrData *UsrDat)
UsrDat->Roles.InCurrentCrs.Role = Rol_UNK;
UsrDat->Roles.InCurrentCrs.Valid = false;
UsrDat->Roles.InCrss = -1; // < 0 ==> not yet got from database
UsrDat->Accepted = true;
UsrDat->Accepted = false;
UsrDat->Sex = Usr_SEX_UNKNOWN;
UsrDat->Surname1[0] = '\0';
@ -1163,8 +1163,6 @@ bool Usr_CheckIfICanViewRecordStd (const struct UsrData *UsrDat)
bool Usr_CheckIfICanViewRecordTch (struct UsrData *UsrDat)
{
bool ItsMe;
/***** 1. Fast check: Am I logged? *****/
if (!Gbl.Usrs.Me.Logged)
return false;
@ -1173,37 +1171,13 @@ bool Usr_CheckIfICanViewRecordTch (struct UsrData *UsrDat)
if (UsrDat->UsrCod <= 0)
return false;
if (Gbl.CurrentCrs.Crs.CrsCod > 0) // Course selected
{
/***** 3. Fast check: Is he/she a non-editing teacher or a teacher? *****/
if (UsrDat->Roles.InCurrentCrs.Role != Rol_NET &&
UsrDat->Roles.InCurrentCrs.Role != Rol_TCH)
return false;
/***** 3. Fast check: Is it a course selected? *****/
if (Gbl.CurrentCrs.Crs.CrsCod <= 0)
return false;
// He/she is a non-editing teacher or a teacher in this course
}
else // No course selected
{
/***** 3. Fast/slow check: Is he/she a non-editing teacher or a teacher in any course? *****/
Rol_GetRolesInAllCrssIfNotYetGot (UsrDat);
if ((UsrDat->Roles.InCrss & ((1 << Rol_NET) |
(1 << Rol_TCH))) == 0)
return false;
// He/she is a non-editing teacher or a teacher in any course
}
/***** 4. Fast check: It's me? *****/
ItsMe = Usr_ItsMe (UsrDat->UsrCod);
if (ItsMe)
return true;
/***** 5. Fast check: Am I a system admin? *****/
if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
return true;
/***** 6. Slow check: Get if user shares any course with me from database *****/
return Usr_CheckIfUsrSharesAnyOfMyCrs (UsrDat);
/***** 4. Fast check: Is he/she a non-editing teacher or a teacher? *****/
return (UsrDat->Roles.InCurrentCrs.Role == Rol_NET ||
UsrDat->Roles.InCurrentCrs.Role == Rol_TCH);
}
/*****************************************************************************/
@ -1858,7 +1832,7 @@ bool Usr_CheckIfUsrBelongsToIns (long UsrCod,long InsCod)
"SELECT COUNT(DISTINCT centres.InsCod)"
" FROM crs_usr,courses,degrees,centres"
" WHERE crs_usr.UsrCod=%ld"
" AND crs_usr.Accepted='Y'"
" AND crs_usr.Accepted='Y'" // Only if user accepted
" AND crs_usr.CrsCod=courses.CrsCod"
" AND courses.DegCod=degrees.DegCod"
" AND degrees.CtrCod=centres.CtrCod"
@ -1973,7 +1947,7 @@ bool Usr_CheckIfUsrBelongsToCrs (long UsrCod,long CrsCod,
return Gbl.Cache.UsrBelongsToCrs.Belongs;
/***** 3. Slow check: Get if user belongs to course from database *****/
SubQuery = (CountOnlyAcceptedCourses ? " AND crs_usr.Accepted='Y'" :
SubQuery = (CountOnlyAcceptedCourses ? " AND crs_usr.Accepted='Y'" : // Only if user accepted
"");
Gbl.Cache.UsrBelongsToCrs.UsrCod = UsrCod;
Gbl.Cache.UsrBelongsToCrs.CrsCod = CrsCod;