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

@ -4338,6 +4338,12 @@ void Act_FormStartId (Act_Action_t NextAction,const char *Id)
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 // Id can not be NULL
static void Act_FormStartInternal (Act_Action_t NextAction,bool PutParameterLocationIfNoSesion,const char *Id,const char *Anchor) static void Act_FormStartInternal (Act_Action_t NextAction,bool PutParameterLocationIfNoSesion,const char *Id,const char *Anchor)
{ {

View File

@ -1429,6 +1429,7 @@ void Act_FormStart (Act_Action_t NextAction);
void Act_FormGoToStart (Act_Action_t NextAction); void Act_FormGoToStart (Act_Action_t NextAction);
void Act_FormStartAnchor (Act_Action_t NextAction,const char *Anchor); void Act_FormStartAnchor (Act_Action_t NextAction,const char *Anchor);
void Act_FormStartId (Act_Action_t NextAction,const char *Id); 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_SetParamsForm (char *Params,Act_Action_t NextAction,bool PutParameterLocationIfNoSesion);
void Act_FormEnd (void); void Act_FormEnd (void);
void Act_LinkFormSubmit (const char *Title,const char *LinkStyle); void Act_LinkFormSubmit (const char *Title,const char *LinkStyle);

View File

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

View File

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

View File

@ -126,13 +126,15 @@
/****************************** Public constants *****************************/ /****************************** 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 CSS_FILE "swad15.111.css"
#define JS_FILE "swad15.111.js" #define JS_FILE "swad15.111.js"
// Number of lines (includes comments but not blank lines) has been got with the following command: // 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 // 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. Version 15.111: Jan 14, 2016 Fixed bug in user's timeline.
Code refactoring related with social timeline. (192622 lines) 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) 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); ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL, NULL,
"PHOTO21x28",Pho_ZOOM); "PHOTO21x28",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</a>"); fprintf (Gbl.F.Out,"</a>");
Act_FormEnd (); Act_FormEnd ();
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
@ -1271,7 +1271,7 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL); ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL, NULL,
"PHOTO21x28",Pho_ZOOM); "PHOTO21x28",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/***** Write full name and link *****/ /***** Write full name and link *****/

View File

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

View File

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

View File

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

View File

@ -469,7 +469,7 @@ static void Msg_ShowOneUniqueRecipient (void)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&Gbl.Usrs.Other.UsrDat,PhotoURL); ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&Gbl.Usrs.Other.UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&Gbl.Usrs.Other.UsrDat,ShowPhoto ? PhotoURL : Pho_ShowUsrPhoto (&Gbl.Usrs.Other.UsrDat,ShowPhoto ? PhotoURL :
NULL, NULL,
"PHOTO21x28",Pho_ZOOM); "PHOTO21x28",Pho_ZOOM,NULL);
/****** Write user's IDs ******/ /****** Write user's IDs ******/
fprintf (Gbl.F.Out,"<div class=\"MSG_TO_ONE_RCP %s\">", 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); ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL, NULL,
"PHOTO30x40",Pho_ZOOM); "PHOTO30x40",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/***** Second column with user name (if author has a web page, put a link to it) *****/ /***** 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)); ShowPhoto = (Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL));
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL, NULL,
"PHOTO21x28",Pho_ZOOM); "PHOTO21x28",Pho_ZOOM,NULL);
/***** Write user's name *****/ /***** Write user's name *****/
fprintf (Gbl.F.Out,"</td>" fprintf (Gbl.F.Out,"</td>"
@ -3282,7 +3282,7 @@ static void Msg_WriteMsgTo (Msg_TypeOfMessages_t TypeOfMessages,long MsgCod)
false); false);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL, NULL,
"PHOTO21x28",Pho_ZOOM); "PHOTO21x28",Pho_ZOOM,NULL);
/* Write user's name */ /* Write user's name */
fprintf (Gbl.F.Out,"</td>" fprintf (Gbl.F.Out,"</td>"
@ -3655,7 +3655,7 @@ void Msg_ListBannedUsrs (void)
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL); ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL, NULL,
"PHOTO21x28",Pho_ZOOM); "PHOTO21x28",Pho_ZOOM,NULL);
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Write user's full name */ /* 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>" fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"2\">"); "<td colspan=\"2\">");
// if (PhotoExists) // 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_); Lay_ShowAlert (Lay_INFO,Txt_You_can_send_a_file_with_an_image_in_jpg_format_);
fprintf (Gbl.F.Out,"</td>" fprintf (Gbl.F.Out,"</td>"
"</tr>"); "</tr>");
@ -1027,7 +1027,8 @@ void Pho_UpdatePhotoName (struct UsrData *UsrDat)
/*****************************************************************************/ /*****************************************************************************/
void Pho_ShowUsrPhoto (const struct UsrData *UsrDat,const char *PhotoURL, 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 SpecialFullName [3*(Usr_MAX_BYTES_NAME_SPEC_CHAR+1)+1];
char SpecialShortName[3*(Usr_MAX_BYTES_NAME_SPEC_CHAR+1)+6]; char SpecialShortName[3*(Usr_MAX_BYTES_NAME_SPEC_CHAR+1)+6];
@ -1048,8 +1049,14 @@ void Pho_ShowUsrPhoto (const struct UsrData *UsrDat,const char *PhotoURL,
/***** Start form to go to public profile *****/ /***** Start form to go to public profile *****/
if (PutLinkToPublicProfile) if (PutLinkToPublicProfile)
{ {
if (Id)
Act_FormStartId (ActSeePubPrf,Id);
else
Act_FormStart (ActSeePubPrf); Act_FormStart (ActSeePubPrf);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
if (Id)
Act_LinkFormSubmitId (NULL,NULL,Id);
else
Act_LinkFormSubmit (NULL,NULL); Act_LinkFormSubmit (NULL,NULL);
} }

View File

@ -107,7 +107,8 @@ bool Pho_CheckIfPrivPhotoExists (long UsrCod,char *PathPrivRelPhoto);
bool Pho_RemovePhoto (struct UsrData *UsrDat); bool Pho_RemovePhoto (struct UsrData *UsrDat);
void Pho_UpdatePhotoName (struct UsrData *UsrDat); void Pho_UpdatePhotoName (struct UsrData *UsrDat);
void Pho_ShowUsrPhoto (const struct UsrData *UsrDat,const char *PhotoURL, 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); void Pho_ChangePhotoVisibility (void);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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