Version 15.112

This commit is contained in:
Antonio Cañas Vargas 2016-01-14 02:43:46 +01:00
parent f1fdffd9cd
commit e100e4ba3f
19 changed files with 129 additions and 73 deletions

View File

@ -4335,7 +4335,13 @@ void Act_FormStartAnchor (Act_Action_t NextAction,const char *Anchor)
void Act_FormStartId (Act_Action_t NextAction,const char *Id)
{
Gbl.NumForm++; // Initialized to -1. The first time it is incremented, it will be equal to 0
Act_FormStartInternal (NextAction,true,Id,NULL); // Do put now parameter location (if no open session)
Act_FormStartInternal (NextAction,true,Id,NULL); // Do put now parameter location (if no open session)
}
void Act_FormStartIdAnchor (Act_Action_t NextAction,const char *Id,const char *Anchor)
{
Gbl.NumForm++; // Initialized to -1. The first time it is incremented, it will be equal to 0
Act_FormStartInternal (NextAction,true,Id,Anchor); // Do put now parameter location (if no open session)
}
// Id can not be NULL

View File

@ -1429,6 +1429,7 @@ void Act_FormStart (Act_Action_t NextAction);
void Act_FormGoToStart (Act_Action_t NextAction);
void Act_FormStartAnchor (Act_Action_t NextAction,const char *Anchor);
void Act_FormStartId (Act_Action_t NextAction,const char *Id);
void Act_FormStartIdAnchor (Act_Action_t NextAction,const char *Id,const char *Anchor);
void Act_SetParamsForm (char *Params,Act_Action_t NextAction,bool PutParameterLocationIfNoSesion);
void Act_FormEnd (void);
void Act_LinkFormSubmit (const char *Title,const char *LinkStyle);

View File

@ -375,7 +375,7 @@ static void Asg_WriteAsgAuthor (struct Assignment *Asg)
/***** Show photo *****/
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO15x20",Pho_ZOOM);
"PHOTO15x20",Pho_ZOOM,NULL);
/***** Write name *****/
strcpy (FirstName,UsrDat.FirstName);

View File

@ -414,7 +414,7 @@ static void Att_WriteAttEventAuthor (struct AttendanceEvent *Att)
/***** Show photo *****/
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO15x20",Pho_ZOOM);
"PHOTO15x20",Pho_ZOOM,NULL);
/***** Write name *****/
strcpy (FirstName,UsrDat.FirstName);
@ -1973,7 +1973,7 @@ static void Att_WriteRowStdToCallTheRoll (unsigned NumStd,struct UsrData *UsrDat
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO45x60",Pho_ZOOM);
"PHOTO45x60",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>");
}
@ -3188,7 +3188,7 @@ static void Att_WriteRowStdSeveralAttEvents (unsigned NumStd,struct UsrData *Usr
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO21x28",Pho_ZOOM);
"PHOTO21x28",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>");
}
@ -3326,7 +3326,7 @@ static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO21x28",Pho_ZOOM);
"PHOTO21x28",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>");
/***** Write user's ID ******/

View File

@ -126,13 +126,15 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.111 (2016-01-14)"
#define Log_PLATFORM_VERSION "SWAD 15.112 (2016-01-14)"
#define CSS_FILE "swad15.111.css"
#define JS_FILE "swad15.111.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 15.112: Jan 14, 2016 Fixed bugs in user's timeline.
All forms in social timeline must have unique identifiers. (192676 lines)
Version 15.111: Jan 14, 2016 Fixed bug in user's timeline.
Code refactoring related with social timeline. (192622 lines)
Version 15.110.18:Jan 13, 2016 Optimization in query to get initial recent timeline. (192564 lines)

View File

@ -1079,7 +1079,7 @@ static void Con_WriteRowConnectedUsrOnRightColumn (Rol_Role_t Role)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO21x28",Pho_ZOOM);
"PHOTO21x28",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</a>");
Act_FormEnd ();
fprintf (Gbl.F.Out,"</td>");
@ -1271,7 +1271,7 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO21x28",Pho_ZOOM);
"PHOTO21x28",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>");
/***** Write full name and link *****/

View File

@ -2785,7 +2785,7 @@ void Enr_ShowEnrollmentRequests (void)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO21x28",Pho_ZOOM);
"PHOTO21x28",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>");
/***** User name *****/

View File

@ -3213,7 +3213,7 @@ static void Brw_ShowDataOwnerAsgWrk (struct UsrData *UsrDat)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO93x124",Pho_ZOOM);
"PHOTO93x124",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>");
/***** Start form to send a message to this user *****/
@ -5958,7 +5958,7 @@ static void Brw_WriteFileOrFolderPublisher (unsigned Level,unsigned long UsrCod)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO15x20B",Pho_ZOOM);
"PHOTO15x20B",Pho_ZOOM,NULL);
}
else
fprintf (Gbl.F.Out,"<img src=\"%s/usr_bl.jpg\""
@ -9051,7 +9051,7 @@ void Brw_ShowFileMetadata (void)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&PublisherUsrDat,PhotoURL);
Pho_ShowUsrPhoto (&PublisherUsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO15x20",Pho_ZOOM);
"PHOTO15x20",Pho_ZOOM,NULL);
/* Write name */
fprintf (Gbl.F.Out,"%s",

View File

@ -488,7 +488,7 @@ static void Fol_ShowFollowedOrFollower (const struct UsrData *UsrDat)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO45x60",Pho_ZOOM);
"PHOTO45x60",Pho_ZOOM,NULL);
}
fprintf (Gbl.F.Out,"</td>");

View File

@ -469,7 +469,7 @@ static void Msg_ShowOneUniqueRecipient (void)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&Gbl.Usrs.Other.UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&Gbl.Usrs.Other.UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO21x28",Pho_ZOOM);
"PHOTO21x28",Pho_ZOOM,NULL);
/****** Write user's IDs ******/
fprintf (Gbl.F.Out,"<div class=\"MSG_TO_ONE_RCP %s\">",
@ -2973,7 +2973,7 @@ void Msg_WriteMsgAuthor (struct UsrData *UsrDat,
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO30x40",Pho_ZOOM);
"PHOTO30x40",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>");
/***** Second column with user name (if author has a web page, put a link to it) *****/
@ -3136,7 +3136,7 @@ static void Msg_WriteMsgFrom (struct UsrData *UsrDat,bool Deleted)
ShowPhoto = (Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL));
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO21x28",Pho_ZOOM);
"PHOTO21x28",Pho_ZOOM,NULL);
/***** Write user's name *****/
fprintf (Gbl.F.Out,"</td>"
@ -3282,7 +3282,7 @@ static void Msg_WriteMsgTo (Msg_TypeOfMessages_t TypeOfMessages,long MsgCod)
false);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO21x28",Pho_ZOOM);
"PHOTO21x28",Pho_ZOOM,NULL);
/* Write user's name */
fprintf (Gbl.F.Out,"</td>"
@ -3655,7 +3655,7 @@ void Msg_ListBannedUsrs (void)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO21x28",Pho_ZOOM);
"PHOTO21x28",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>");
/* Write user's full name */

View File

@ -312,7 +312,7 @@ void Pho_ReqPhoto (const struct UsrData *UsrDat,bool PhotoExists,const char *Pho
fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"2\">");
// if (PhotoExists)
Pho_ShowUsrPhoto (UsrDat,PhotoURL,"PHOTO186x248",Pho_NO_ZOOM);
Pho_ShowUsrPhoto (UsrDat,PhotoURL,"PHOTO186x248",Pho_NO_ZOOM,NULL);
Lay_ShowAlert (Lay_INFO,Txt_You_can_send_a_file_with_an_image_in_jpg_format_);
fprintf (Gbl.F.Out,"</td>"
"</tr>");
@ -1027,7 +1027,8 @@ void Pho_UpdatePhotoName (struct UsrData *UsrDat)
/*****************************************************************************/
void Pho_ShowUsrPhoto (const struct UsrData *UsrDat,const char *PhotoURL,
const char *ClassPhoto,Pho_Zoom_t Zoom)
const char *ClassPhoto,Pho_Zoom_t Zoom,
const char *Id)
{
char SpecialFullName [3*(Usr_MAX_BYTES_NAME_SPEC_CHAR+1)+1];
char SpecialShortName[3*(Usr_MAX_BYTES_NAME_SPEC_CHAR+1)+6];
@ -1048,9 +1049,15 @@ void Pho_ShowUsrPhoto (const struct UsrData *UsrDat,const char *PhotoURL,
/***** Start form to go to public profile *****/
if (PutLinkToPublicProfile)
{
Act_FormStart (ActSeePubPrf);
if (Id)
Act_FormStartId (ActSeePubPrf,Id);
else
Act_FormStart (ActSeePubPrf);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
Act_LinkFormSubmit (NULL,NULL);
if (Id)
Act_LinkFormSubmitId (NULL,NULL,Id);
else
Act_LinkFormSubmit (NULL,NULL);
}
/***** Start image *****/

View File

@ -107,7 +107,8 @@ bool Pho_CheckIfPrivPhotoExists (long UsrCod,char *PathPrivRelPhoto);
bool Pho_RemovePhoto (struct UsrData *UsrDat);
void Pho_UpdatePhotoName (struct UsrData *UsrDat);
void Pho_ShowUsrPhoto (const struct UsrData *UsrDat,const char *PhotoURL,
const char *ClassPhoto,Pho_Zoom_t Zoom);
const char *ClassPhoto,Pho_Zoom_t Zoom,
const char *Id);
void Pho_ChangePhotoVisibility (void);

View File

@ -1447,7 +1447,7 @@ void Prf_ShowUsrInRanking (const struct UsrData *UsrDat,unsigned Rank)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO30x40",Pho_ZOOM);
"PHOTO30x40",Pho_ZOOM,NULL);
}
fprintf (Gbl.F.Out,"</td>"

View File

@ -2136,7 +2136,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
Rec_C3_TOP);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO186x248",Pho_NO_ZOOM);
"PHOTO186x248",Pho_NO_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>"
"</tr>");

View File

@ -857,6 +857,7 @@ static void Soc_PutLinkToViewOldPublishings (void)
/*****************************************************************************/
/***************************** Write social note *****************************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
const struct SocialPublishing *SocPub,
@ -868,7 +869,6 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
extern const char *Txt_Degree;
extern const char *Txt_Centre;
extern const char *Txt_Institution;
char IdNewComment[Soc_MAX_LENGTH_ID];
struct UsrData UsrDat;
bool IAmTheAuthor = false;
bool IAmAPublisherOfThisSocNot = false;
@ -881,6 +881,8 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
char ForumName[512];
char SummaryStr[Cns_MAX_BYTES_TEXT+1];
unsigned NumComments;
char IdNewComment[Soc_MAX_LENGTH_ID];
char IdForm[Soc_MAX_LENGTH_ID];
/***** Start frame ****/
if (ShowNoteAlone)
@ -927,10 +929,11 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
/***** Left: write author's photo *****/
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_LEFT_PHOTO\">");
Soc_SetUniqueId (IdForm);
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO45x60",Pho_ZOOM);
"PHOTO45x60",Pho_ZOOM,IdForm);
fprintf (Gbl.F.Out,"</div>");
/***** Right: author's name, time, summary and buttons *****/
@ -1110,6 +1113,7 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot,
/*****************************************************************************/
/*************** Write sharer/commenter if distinct to author ****************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void Soc_WriteTopPublisher (const struct SocialPublishing *SocPub)
{
@ -1117,6 +1121,7 @@ static void Soc_WriteTopPublisher (const struct SocialPublishing *SocPub)
extern const char *Txt_SOCIAL_USER_has_shared;
extern const char *Txt_SOCIAL_USER_has_commented;
struct UsrData UsrDat;
char IdForm[Soc_MAX_LENGTH_ID];
if (SocPub)
if (SocPub->PubType == Soc_PUB_SHARED_NOTE ||
@ -1132,9 +1137,10 @@ static void Soc_WriteTopPublisher (const struct SocialPublishing *SocPub)
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_TOP_CONTAINER SOCIAL_TOP_PUBLISHER\">");
/***** Show user's name inside form to go to user's public profile *****/
Act_FormStart (ActSeePubPrf);
Soc_SetUniqueId (IdForm);
Act_FormStartId (ActSeePubPrf,IdForm);
Usr_PutParamUsrCodEncrypted (UsrDat.EncryptedUsrCod);
Act_LinkFormSubmit (Txt_View_public_profile,"SOCIAL_TOP_PUBLISHER");
Act_LinkFormSubmitId (Txt_View_public_profile,"SOCIAL_TOP_PUBLISHER",IdForm);
Str_LimitLengthHTMLStr (UsrDat.FullName,40);
fprintf (Gbl.F.Out,"%s</a>",UsrDat.FullName);
Act_FormEnd ();
@ -1155,25 +1161,29 @@ static void Soc_WriteTopPublisher (const struct SocialPublishing *SocPub)
/*****************************************************************************/
/************ Write name and nickname of autor of a social note **************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void Soc_WriteAuthorNote (struct UsrData *UsrDat)
{
extern const char *Txt_View_public_profile;
char IdForm[Soc_MAX_LENGTH_ID];
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_RIGHT_AUTHOR\">");
/***** Show user's name inside form to go to user's public profile *****/
Act_FormStart (ActSeePubPrf);
Soc_SetUniqueId (IdForm);
Act_FormStartId (ActSeePubPrf,IdForm);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
Act_LinkFormSubmit (Txt_View_public_profile,"DAT_N_BOLD");
Act_LinkFormSubmitId (Txt_View_public_profile,"DAT_N_BOLD",IdForm);
Str_LimitLengthHTMLStr (UsrDat->FullName,16);
fprintf (Gbl.F.Out,"%s</a>",UsrDat->FullName);
Act_FormEnd ();
/***** Show user's nickname inside form to go to user's public profile *****/
Act_FormStart (ActSeePubPrf);
Soc_SetUniqueId (IdForm);
Act_FormStartId (ActSeePubPrf,IdForm);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
Act_LinkFormSubmit (Txt_View_public_profile,"DAT_LIGHT");
Act_LinkFormSubmitId (Txt_View_public_profile,"DAT_LIGHT",IdForm);
fprintf (Gbl.F.Out," @%s</a>",UsrDat->Nickname);
Act_FormEnd ();
@ -1247,6 +1257,7 @@ static void Soc_GetAndWriteSocialPost (long PstCod)
/*****************************************************************************/
/********* Put form to go to an action depending on the social note **********/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void Soc_PutFormGoToAction (const struct SocialNote *SocNot)
{
@ -1255,6 +1266,7 @@ static void Soc_PutFormGoToAction (const struct SocialNote *SocNot)
extern const char *Txt_SOCIAL_NOTE[Soc_NUM_NOTE_TYPES];
extern const char *Txt_not_available;
char Class[64];
char IdForm[Soc_MAX_LENGTH_ID];
if (SocNot->Unavailable || // File/notice... pointer by this social note is unavailable
Gbl.InsideForm) // Inside another form
@ -1268,39 +1280,41 @@ static void Soc_PutFormGoToAction (const struct SocialNote *SocNot)
}
else // Not inside another form
{
Soc_SetUniqueId (IdForm);
/***** Parameters depending on the type of note *****/
switch (SocNot->NoteType)
{
case Soc_NOTE_INS_DOC_PUB_FILE:
case Soc_NOTE_INS_SHA_PUB_FILE:
Act_FormStart (Soc_DefaultActions[SocNot->NoteType]);
Act_FormStartId (Soc_DefaultActions[SocNot->NoteType],IdForm);
Brw_PutHiddenParamFilCod (SocNot->Cod);
if (SocNot->HieCod != Gbl.CurrentIns.Ins.InsCod) // Not the current institution
Ins_PutParamInsCod (SocNot->HieCod); // Go to another institution
break;
case Soc_NOTE_CTR_DOC_PUB_FILE:
case Soc_NOTE_CTR_SHA_PUB_FILE:
Act_FormStart (Soc_DefaultActions[SocNot->NoteType]);
Act_FormStartId (Soc_DefaultActions[SocNot->NoteType],IdForm);
Brw_PutHiddenParamFilCod (SocNot->Cod);
if (SocNot->HieCod != Gbl.CurrentCtr.Ctr.CtrCod) // Not the current centre
Ctr_PutParamCtrCod (SocNot->HieCod); // Go to another centre
break;
case Soc_NOTE_DEG_DOC_PUB_FILE:
case Soc_NOTE_DEG_SHA_PUB_FILE:
Act_FormStart (Soc_DefaultActions[SocNot->NoteType]);
Act_FormStartId (Soc_DefaultActions[SocNot->NoteType],IdForm);
Brw_PutHiddenParamFilCod (SocNot->Cod);
if (SocNot->HieCod != Gbl.CurrentDeg.Deg.DegCod) // Not the current degree
Deg_PutParamDegCod (SocNot->HieCod); // Go to another degree
break;
case Soc_NOTE_CRS_DOC_PUB_FILE:
case Soc_NOTE_CRS_SHA_PUB_FILE:
Act_FormStart (Soc_DefaultActions[SocNot->NoteType]);
Act_FormStartId (Soc_DefaultActions[SocNot->NoteType],IdForm);
Brw_PutHiddenParamFilCod (SocNot->Cod);
if (SocNot->HieCod != Gbl.CurrentCrs.Crs.CrsCod) // Not the current course
Crs_PutParamCrsCod (SocNot->HieCod); // Go to another course
break;
case Soc_NOTE_EXAM_ANNOUNCEMENT:
Act_FormStart (Soc_DefaultActions[SocNot->NoteType]);
Act_FormStartId (Soc_DefaultActions[SocNot->NoteType],IdForm);
Not_PutHiddenParamNotCod (SocNot->Cod);
if (SocNot->HieCod != Gbl.CurrentCrs.Crs.CrsCod) // Not the current course
Crs_PutParamCrsCod (SocNot->HieCod); // Go to another course
@ -1308,13 +1322,13 @@ static void Soc_PutFormGoToAction (const struct SocialNote *SocNot)
case Soc_NOTE_SOCIAL_POST: // Not applicable
return;
case Soc_NOTE_FORUM_POST:
Act_FormStart (For_ActionsSeeFor[Gbl.Forum.ForumType]);
Act_FormStartId (For_ActionsSeeFor[Gbl.Forum.ForumType],IdForm);
For_PutAllHiddenParamsForum ();
if (SocNot->HieCod != Gbl.CurrentCrs.Crs.CrsCod) // Not the current course
Crs_PutParamCrsCod (SocNot->HieCod); // Go to another course
break;
case Soc_NOTE_NOTICE:
Act_FormStart (Soc_DefaultActions[SocNot->NoteType]);
Act_FormStartId (Soc_DefaultActions[SocNot->NoteType],IdForm);
Not_PutHiddenParamNotCod (SocNot->Cod);
if (SocNot->HieCod != Gbl.CurrentCrs.Crs.CrsCod) // Not the current course
Crs_PutParamCrsCod (SocNot->HieCod); // Go to another course
@ -1325,8 +1339,8 @@ static void Soc_PutFormGoToAction (const struct SocialNote *SocNot)
/***** Link and end form *****/
sprintf (Class,"%s ICON_HIGHLIGHT",The_ClassFormBold[Gbl.Prefs.Theme]);
Act_LinkFormSubmit (Txt_SOCIAL_NOTE[SocNot->NoteType],
Class);
Act_LinkFormSubmitId (Txt_SOCIAL_NOTE[SocNot->NoteType],
Class,IdForm);
fprintf (Gbl.F.Out,"<img src=\"%s/%s\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON20x20\" />"
@ -1622,7 +1636,7 @@ static void Soc_PutHiddenFormToWriteNewPost (void)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&Gbl.Usrs.Me.UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&Gbl.Usrs.Me.UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO45x60",Pho_ZOOM);
"PHOTO45x60",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</div>");
/***** Right: author's name, time, summary and buttons *****/
@ -1764,11 +1778,13 @@ static void Soc_PutIconToToggleCommentSocialNote (const char UniqueId[Soc_MAX_LE
/*****************************************************************************/
/******************* Form to comment a social publishing *********************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void Soc_PutHiddenFormToWriteNewCommentToSocialNote (long NotCod,
const char UniqueId[Soc_MAX_LENGTH_ID])
{
extern const char *Txt_Send_comment;
char IdForm[Soc_MAX_LENGTH_ID];
/***** Start container *****/
fprintf (Gbl.F.Out,"<div id=\"%s\""
@ -1777,13 +1793,14 @@ static void Soc_PutHiddenFormToWriteNewCommentToSocialNote (long NotCod,
UniqueId);
/***** Start form to write the post *****/
Soc_SetUniqueId (IdForm);
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
{
Act_FormStartAnchor (ActRcvSocComUsr,"timeline");
Act_FormStartIdAnchor (ActRcvSocComUsr,IdForm,"timeline");
Usr_PutParamOtherUsrCodEncrypted ();
}
else
Act_FormStart (ActRcvSocComGbl);
Act_FormStartId (ActRcvSocComGbl,IdForm);
Soc_PutHiddenParamNotCod (NotCod);
fprintf (Gbl.F.Out,"<textarea name=\"Comment\" cols=\"45\" rows=\"3\">"
"</textarea>");
@ -1818,6 +1835,7 @@ static unsigned long Soc_GetNumCommentsInSocialNote (long NotCod)
/*****************************************************************************/
/******************* Form to comment a social publishing *********************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void Soc_WriteCommentsInSocialNote (long NotCod,
const char IdNewComment[Soc_MAX_LENGTH_ID])
@ -1878,6 +1896,7 @@ static void Soc_WriteCommentsInSocialNote (long NotCod,
/*****************************************************************************/
/**************************** Write social comment ***************************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void Soc_WriteSocialComment (struct SocialComment *SocCom,
bool ShowCommentAlone) // Social comment is shown alone, not in a list
@ -1891,6 +1910,7 @@ static void Soc_WriteSocialComment (struct SocialComment *SocCom,
bool IAmTheAuthor;
bool ShowPhoto = false;
char PhotoURL[PATH_MAX+1];
char IdForm[Soc_MAX_LENGTH_ID];
if (ShowCommentAlone)
{
@ -1922,10 +1942,11 @@ static void Soc_WriteSocialComment (struct SocialComment *SocCom,
/***** Left: write author's photo *****/
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_COMMENT_PHOTO\">");
Soc_SetUniqueId (IdForm);
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO30x40",Pho_ZOOM);
"PHOTO30x40",Pho_ZOOM,IdForm);
fprintf (Gbl.F.Out,"</div>");
/***** Right: author's name, time, summary and buttons *****/
@ -1964,25 +1985,29 @@ static void Soc_WriteSocialComment (struct SocialComment *SocCom,
/*****************************************************************************/
/****** Write name and nickname of autor of a comment to a social note *******/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void Soc_WriteAuthorComment (struct UsrData *UsrDat)
{
extern const char *Txt_View_public_profile;
char IdForm[Soc_MAX_LENGTH_ID];
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_COMMENT_RIGHT_AUTHOR\">");
/***** Show user's name inside form to go to user's public profile *****/
Act_FormStart (ActSeePubPrf);
Soc_SetUniqueId (IdForm);
Act_FormStartId (ActSeePubPrf,IdForm);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
Act_LinkFormSubmit (Txt_View_public_profile,"DAT_BOLD");
Act_LinkFormSubmitId (Txt_View_public_profile,"DAT_BOLD",IdForm);
Str_LimitLengthHTMLStr (UsrDat->FullName,12);
fprintf (Gbl.F.Out,"%s</a>",UsrDat->FullName);
Act_FormEnd ();
/***** Show user's nickname inside form to go to user's public profile *****/
Act_FormStart (ActSeePubPrf);
Soc_SetUniqueId (IdForm);
Act_FormStartId (ActSeePubPrf,IdForm);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
Act_LinkFormSubmit (Txt_View_public_profile,"DAT_LIGHT");
Act_LinkFormSubmitId (Txt_View_public_profile,"DAT_LIGHT",IdForm);
fprintf (Gbl.F.Out," @%s</a>",UsrDat->Nickname);
Act_FormEnd ();
@ -1992,19 +2017,22 @@ static void Soc_WriteAuthorComment (struct UsrData *UsrDat)
/*****************************************************************************/
/********************** Form to remove social comment ************************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void Soc_PutFormToRemoveComment (long ComCod)
{
extern const char *Txt_Remove;
char IdForm[Soc_MAX_LENGTH_ID];
/***** Form to remove social publishing *****/
Soc_SetUniqueId (IdForm);
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
{
Act_FormStartAnchor (ActReqRemSocComUsr,"timeline");
Act_FormStartIdAnchor (ActReqRemSocComUsr,IdForm,"timeline");
Usr_PutParamOtherUsrCodEncrypted ();
}
else
Act_FormStart (ActReqRemSocComGbl);
Act_FormStartId (ActReqRemSocComGbl,IdForm);
Soc_PutHiddenParamComCod (ComCod);
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_ICON_REMOVE ICON_HIGHLIGHT\">"
"<input type=\"image\""
@ -2045,19 +2073,22 @@ static void Soc_PutDisabledIconShare (unsigned NumShared)
/*****************************************************************************/
/************************* Form to share social note *************************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void Soc_PutFormToShareSocialNote (long NotCod)
{
extern const char *Txt_Share;
char IdForm[Soc_MAX_LENGTH_ID];
/***** Form to share social note *****/
Soc_SetUniqueId (IdForm);
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
{
Act_FormStartAnchor (ActShaSocNotUsr,"timeline");
Act_FormStartIdAnchor (ActShaSocNotUsr,IdForm,"timeline");
Usr_PutParamOtherUsrCodEncrypted ();
}
else
Act_FormStart (ActShaSocNotGbl);
Act_FormStartId (ActShaSocNotGbl,IdForm);
Soc_PutHiddenParamNotCod (NotCod);
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_ICON_SHARE ICON_HIGHLIGHT\">"
"<input type=\"image\""
@ -2074,19 +2105,22 @@ static void Soc_PutFormToShareSocialNote (long NotCod)
/*****************************************************************************/
/************ Form to unshare (stop sharing) social publishing ***************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void Soc_PutFormToUnshareSocialPublishing (long NotCod)
{
extern const char *Txt_Unshare;
char IdForm[Soc_MAX_LENGTH_ID];
/***** Form to share social publishing *****/
Soc_SetUniqueId (IdForm);
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
{
Act_FormStartAnchor (ActUnsSocPubUsr,"timeline");
Act_FormStartIdAnchor (ActUnsSocPubUsr,IdForm,"timeline");
Usr_PutParamOtherUsrCodEncrypted ();
}
else
Act_FormStart (ActUnsSocPubGbl);
Act_FormStartId (ActUnsSocPubGbl,IdForm);
Soc_PutHiddenParamNotCod (NotCod);
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_ICON_SHARE ICON_HIGHLIGHT\">"
"<input type=\"image\""
@ -2102,19 +2136,21 @@ static void Soc_PutFormToUnshareSocialPublishing (long NotCod)
/*****************************************************************************/
/******************** Form to remove social publishing ***********************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void Soc_PutFormToRemoveSocialPublishing (long NotCod)
{
extern const char *Txt_Remove;
char IdForm[Soc_MAX_LENGTH_ID];
/***** Form to remove social publishing *****/
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
{
Act_FormStartAnchor (ActReqRemSocPubUsr,"timeline");
Act_FormStartIdAnchor (ActReqRemSocPubUsr,IdForm,"timeline");
Usr_PutParamOtherUsrCodEncrypted ();
}
else
Act_FormStart (ActReqRemSocPubGbl);
Act_FormStartId (ActReqRemSocPubGbl,IdForm);
Soc_PutHiddenParamNotCod (NotCod);
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_ICON_REMOVE ICON_HIGHLIGHT\">"
"<input type=\"image\""
@ -2915,6 +2951,7 @@ static void Soc_UpdateNumTimesANoteHasBeenShared (struct SocialNote *SocNot)
/*****************************************************************************/
/**************** Show users who have shared this social note ****************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void Soc_ShowUsrsWhoHaveSharedSocialNote (const struct SocialNote *SocNot)
{
@ -2927,6 +2964,7 @@ static void Soc_ShowUsrsWhoHaveSharedSocialNote (const struct SocialNote *SocNot
struct UsrData UsrDat;
bool ShowPhoto;
char PhotoURL[PATH_MAX+1];
char IdForm[Soc_MAX_LENGTH_ID];
/* Show number of users who have shared this social note */
fprintf (Gbl.F.Out,"<span class=\"SOCIAL_NUM_SHARES\"> %u</span>",
@ -2966,10 +3004,11 @@ static void Soc_ShowUsrsWhoHaveSharedSocialNote (const struct SocialNote *SocNot
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat))
{
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_SHARER\">");
Soc_SetUniqueId (IdForm);
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO18x24",Pho_ZOOM);
"PHOTO18x24",Pho_ZOOM,IdForm);
fprintf (Gbl.F.Out,"</div>");
NumUsrsShown++;

View File

@ -1808,7 +1808,7 @@ static void Sta_ShowNumHitsPerUsr (unsigned long NumRows,
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO15x20",Pho_ZOOM);
"PHOTO15x20",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>");
/* Write the user's ID if user is a student in current course */

View File

@ -569,7 +569,7 @@ static void Svy_WriteAuthor (struct Survey *Svy)
/***** Show photo *****/
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO15x20",Pho_ZOOM);
"PHOTO15x20",Pho_ZOOM,NULL);
/***** Write name *****/
strcpy (FirstName,UsrDat.FirstName);

View File

@ -6461,7 +6461,7 @@ static void Tst_ShowDataUsr (struct UsrData *UsrDat,unsigned NumExams)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO45x60",Pho_ZOOM);
"PHOTO45x60",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>");
/***** Start form to go to user's record card *****/
@ -6597,7 +6597,7 @@ void Tst_ShowOneTestExam (void)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&Gbl.Usrs.Other.UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&Gbl.Usrs.Other.UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO45x60",Pho_ZOOM);
"PHOTO45x60",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>"
"</tr>");

View File

@ -1651,7 +1651,7 @@ void Usr_WriteLoggedUsrHead (void)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&Gbl.Usrs.Me.UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&Gbl.Usrs.Me.UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO18x24",Pho_ZOOM);
"PHOTO18x24",Pho_ZOOM,NULL);
/***** User's name *****/
fprintf (Gbl.F.Out,"<span class=\"%s\">&nbsp;",
@ -2705,7 +2705,7 @@ static void Usr_WriteRowGstMainData (unsigned NumUsr,struct UsrData *UsrDat)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO21x28",Pho_ZOOM);
"PHOTO21x28",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>");
}
@ -2807,7 +2807,7 @@ void Usr_WriteRowStdMainData (unsigned NumUsr,struct UsrData *UsrDat,bool PutChe
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO21x28",Pho_ZOOM);
"PHOTO21x28",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>");
}
@ -2861,7 +2861,7 @@ static void Usr_WriteRowGstAllData (struct UsrData *UsrDat)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO21x28",Pho_NO_ZOOM);
"PHOTO21x28",Pho_NO_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>");
}
@ -2963,7 +2963,7 @@ void Usr_WriteRowStdAllData (struct UsrData *UsrDat,char *GroupNames)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO21x28",Pho_NO_ZOOM);
"PHOTO21x28",Pho_NO_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>");
}
@ -3118,7 +3118,7 @@ static void Usr_WriteRowTchMainData (unsigned NumUsr,struct UsrData *UsrDat,bool
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO21x28",Pho_ZOOM);
"PHOTO21x28",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>");
}
@ -3174,7 +3174,7 @@ void Usr_WriteRowTchAllData (struct UsrData *UsrDat)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO21x28",Pho_NO_ZOOM);
"PHOTO21x28",Pho_NO_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>");
}
@ -3252,7 +3252,7 @@ void Usr_WriteRowAdmData (unsigned NumUsr,struct UsrData *UsrDat)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO21x28",Pho_ZOOM);
"PHOTO21x28",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>");
}
@ -7311,7 +7311,7 @@ static void Usr_DrawClassPhoto (Usr_ClassPhotoType_t ClassPhotoType,
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
ClassPhoto,Pho_ZOOM);
ClassPhoto,Pho_ZOOM,NULL);
/***** Photo foot *****/
fprintf (Gbl.F.Out,"<br />");