From 3263490ff1b75d234be81622436363ffe1ae52bf Mon Sep 17 00:00:00 2001 From: acanas Date: Sat, 15 Oct 2022 10:58:23 +0200 Subject: [PATCH] Version 22.47.1: Oct 15, 2022 Removed unused code. --- swad_attendance.c | 9 +++------ swad_browser.c | 9 +++------ swad_changelog.h | 3 ++- swad_connected.c | 26 ++------------------------ swad_enrolment.c | 3 +-- swad_exam_result.c | 3 +-- swad_follow.c | 6 ++---- swad_form.c | 21 --------------------- swad_form.h | 3 --- swad_global.h | 1 - swad_match_result.c | 3 +-- swad_message.c | 15 +++++---------- swad_photo.c | 22 +++++++--------------- swad_photo.h | 6 ++---- swad_profile.c | 3 +-- swad_project.c | 3 +-- swad_record.c | 3 +-- swad_statistic.c | 3 +-- swad_test_print.c | 3 +-- swad_timeline_comment.c | 4 +--- swad_timeline_form.c | 3 --- swad_timeline_note.c | 17 +++-------------- swad_timeline_note.h | 2 +- swad_timeline_post.c | 2 +- swad_timeline_user.c | 3 +-- swad_user.c | 26 +++++++++----------------- 26 files changed, 50 insertions(+), 152 deletions(-) diff --git a/swad_attendance.c b/swad_attendance.c index 927905b7..65b1481f 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -1783,8 +1783,7 @@ static void Att_WriteRowUsrToCallTheRoll (unsigned NumUsr, { HTM_TD_Begin ("class=\"%s LT\"",The_GetColorRows ()); Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); } @@ -2993,8 +2992,7 @@ static void Att_WriteRowUsrSeveralAttEvents (const struct Att_Events *Events, { HTM_TD_Begin ("class=\"LM %s\"",The_GetColorRows ()); Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); } @@ -3165,8 +3163,7 @@ static void Att_ListAttEventsForAStd (struct Att_Events *Events, HTM_TD_Begin ("colspan=\"2\" class=\"RM %s\"", The_GetColorRows ()); Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); HTM_TD_Begin ("class=\"LM %s\"",The_GetColorRows ()); diff --git a/swad_browser.c b/swad_browser.c index 4e31673b..eb8f3808 100644 --- a/swad_browser.c +++ b/swad_browser.c @@ -3235,8 +3235,7 @@ static void Brw_ShowDataOwnerAsgWrk (struct Usr_Data *UsrDat) /***** Show user's photo *****/ HTM_TD_Begin ("class=\"OWNER_WORKS_PHOTO\""); Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); /***** Begin form to send a message to this user *****/ @@ -5473,8 +5472,7 @@ static void Brw_WriteFileOrFolderPublisher (unsigned Level,long UsrCod) if (ShowUsr) /***** Show photo *****/ Pho_ShowUsrPhotoIfAllowed (&UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); else Ico_PutIcon ("usr_bl.jpg",Ico_UNCHANGED,Txt_Unknown_or_without_photo, ClassPhoto[Gbl.Prefs.PhotoShape]); @@ -8026,8 +8024,7 @@ void Brw_ShowFileMetadata (void) { /* Show photo */ Pho_ShowUsrPhotoIfAllowed (&PublisherUsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); /* Write name */ HTM_NBSP (); diff --git a/swad_changelog.h b/swad_changelog.h index 6166d549..e81bf101 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -606,10 +606,11 @@ TODO: Fix bug: error al enviar un mensaje a dos recipientes, error on duplicate TODO: Attach pdf files in multimedia. */ -#define Log_PLATFORM_VERSION "SWAD 22.47 (2022-10-15)" +#define Log_PLATFORM_VERSION "SWAD 22.47.1 (2022-10-15)" #define CSS_FILE "swad22.46.css" #define JS_FILE "swad21.100.js" /* + Version 22.47.1: Oct 15, 2022 Removed unused code. (333126 lines) Version 22.47: Oct 15, 2022 Code optimization related to forms. (333227 lines) Version 22.46.3: Oct 15, 2022 Code refactoring submiting forms. (333211 lines) Version 22.46.2: Oct 14, 2022 Changes in anchors behavior in project listing. (333228 lines) diff --git a/swad_connected.c b/swad_connected.c index 3e1d5ddb..accfd7fe 100644 --- a/swad_connected.c +++ b/swad_connected.c @@ -174,11 +174,6 @@ void Con_ShowGlobalConnectedUsrs (void) /***** Number of sessions *****/ /* Link to view more details about connected users */ - /* - Frm_BeginFormUnique (ActLstCon); // Must be unique because - // the list of connected users - // is dynamically updated via AJAX - */ Frm_BeginForm (ActLstCon); HTM_BUTTON_Submit_Begin (Txt_Connected_users,"class=\"BT_LINK\""); @@ -329,11 +324,6 @@ void Con_ShowConnectedUsrsBelongingToCurrentCrs (void) /***** Number of connected users who belong to course *****/ /* Link to view more details about connected users */ - /* - Frm_BeginFormUnique (ActLstCon); // Must be unique because - // the list of connected users - // is dynamically updated via AJAX - */ Frm_BeginForm (ActLstCon); HTM_BUTTON_Submit_Begin (Txt_Connected_users,"class=\"BT_LINK\""); Str_Copy (CourseName,Gbl.Hierarchy.Crs.ShrtName,sizeof (CourseName) - 1); @@ -420,11 +410,6 @@ static void Con_ShowConnectedUsrsWithARoleBelongingToCurrentCrsOnRightColumn (Ro { HTM_TR_Begin (NULL); HTM_TD_Begin ("colspan=\"3\" class=\"CM\""); - /* - Frm_BeginFormUnique (ActLstCon); // Must be unique because - // the list of connected users - // is dynamically updated via AJAX - */ Frm_BeginForm (ActLstCon); Sco_PutParamScope ("ScopeCon",HieLvl_CRS); HTM_INPUT_IMAGE (Cfg_URL_ICON_PUBLIC,"ellipsis-h.svg", @@ -605,8 +590,7 @@ static void Con_WriteRowConnectedUsrOnRightColumn (Rol_Role_t Role) /***** Show photo *****/ HTM_TD_Begin ("class=\"CON_PHOTO %s\"",The_GetColorRows ()); Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - true); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); /***** Write full name and link *****/ @@ -615,11 +599,6 @@ static void Con_WriteRowConnectedUsrOnRightColumn (Rol_Role_t Role) HTM_TD_Begin ("class=\"%s %s\"",ClassTxt,The_GetColorRows ()); if (!NextAction[Role]) Err_WrongRoleExit (); - /* - Frm_BeginFormUnique (NextAction[Role]); // The form must be unique because - // the list of connected users - // is dynamically updated via AJAX - */ Frm_BeginForm (NextAction[Role]); Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); @@ -715,8 +694,7 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R /***** Show photo *****/ HTM_TD_Begin ("class=\"CON_PHOTO %s\"",The_GetColorRows ()); Pho_ShowUsrPhotoIfAllowed (&UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); /***** Write full name and link *****/ diff --git a/swad_enrolment.c b/swad_enrolment.c index f1d0120b..47bb8293 100644 --- a/swad_enrolment.c +++ b/swad_enrolment.c @@ -2245,8 +2245,7 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected) HTM_TD_Begin ("class=\"CT DAT_%s\" style=\"width:22px;\"", The_GetSuffix ()); Pho_ShowUsrPhotoIfAllowed (&UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); /***** User name *****/ diff --git a/swad_exam_result.c b/swad_exam_result.c index 30a6a090..2794b6e7 100644 --- a/swad_exam_result.c +++ b/swad_exam_result.c @@ -1554,8 +1554,7 @@ void ExaRes_ShowExamResultUser (struct Usr_Data *UsrDat) HTM_TxtF (", %s",UsrDat->FrstName); HTM_BR (); Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); /***** Row end *****/ diff --git a/swad_follow.c b/swad_follow.c index faa1c78a..7bfd8173 100644 --- a/swad_follow.c +++ b/swad_follow.c @@ -610,8 +610,7 @@ static void Fol_ShowFollowedOrFollower (struct Usr_Data *UsrDat) HTM_TD_Begin ("class=\"FOLLOW_PHOTO\""); if (Visible) Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); /***** Show user's name and icon to follow/unfollow *****/ @@ -673,8 +672,7 @@ static void Fol_WriteRowUsrToFollowOnRightColumn (struct Usr_Data *UsrDat) HTM_TD_Begin ("class=\"CON_PHOTO %s\"",The_GetColorRows ()); if (Visible) Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); /***** User's name *****/ diff --git a/swad_form.c b/swad_form.c index c9c6fee8..208fb0df 100644 --- a/swad_form.c +++ b/swad_form.c @@ -80,28 +80,7 @@ void Frm_BeginFormAnchorOnSubmit (Act_Action_t NextAction,const char *Anchor,con snprintf (Gbl.Form.Id,sizeof (Gbl.Form.Id),"form_%d",Gbl.Form.Num); Frm_BeginFormInternal (NextAction,true,Gbl.Form.Id,Anchor,OnSubmit); // Do put now parameter location (if no open session) } -/* -void Frm_BeginFormUnique (Act_Action_t NextAction) - { - Frm_BeginFormUniqueAnchor (NextAction,NULL); - } -void Frm_BeginFormUniqueAnchor (Act_Action_t NextAction,const char *Anchor) - { - Gbl.Form.Num++; // Initialized to -1. The first time it is incremented, it will be equal to 0 - snprintf (Gbl.Form.UniqueId,sizeof (Gbl.Form.UniqueId),"form_%s_%d", - Gbl.UniqueNameEncrypted,Gbl.Form.Num); - Frm_BeginFormInternal (NextAction,true,Gbl.Form.UniqueId,Anchor,NULL); // Do put now parameter location (if no open session) - } - -void Frm_BeginFormUniqueAnchorOnSubmit (Act_Action_t NextAction,const char *Anchor,const char *OnSubmit) - { - Gbl.Form.Num++; // Initialized to -1. The first time it is incremented, it will be equal to 0 - snprintf (Gbl.Form.UniqueId,sizeof (Gbl.Form.UniqueId),"form_%s_%d", - Gbl.UniqueNameEncrypted,Gbl.Form.Num); - Frm_BeginFormInternal (NextAction,true,Gbl.Form.UniqueId,Anchor,OnSubmit); // Do put now parameter location (if no open session) - } -*/ void Frm_BeginFormId (Act_Action_t NextAction,const char *Id) { Gbl.Form.Num++; // Initialized to -1. The first time it is incremented, it will be equal to 0 diff --git a/swad_form.h b/swad_form.h index d9b3b98d..ec7552c8 100644 --- a/swad_form.h +++ b/swad_form.h @@ -50,10 +50,7 @@ void Frm_BeginFormGoTo (Act_Action_t NextAction); void Frm_BeginForm (Act_Action_t NextAction); void Frm_BeginFormOnSubmit (Act_Action_t NextAction,const char *OnSubmit); void Frm_BeginFormAnchorOnSubmit (Act_Action_t NextAction,const char *Anchor,const char *OnSubmit); -// void Frm_BeginFormUnique (Act_Action_t NextAction); void Frm_BeginFormAnchor (Act_Action_t NextAction,const char *Anchor); -// void Frm_BeginFormUniqueAnchor (Act_Action_t NextAction,const char *Anchor); -// void Frm_BeginFormUniqueAnchorOnSubmit (Act_Action_t NextAction,const char *Anchor,const char *OnSubmit); void Frm_BeginFormId (Act_Action_t NextAction,const char *Id); void Frm_BeginFormNoAction (void); void Frm_SetParamsForm (char ParamsStr[Frm_MAX_BYTES_PARAMS_STR],Act_Action_t NextAction, diff --git a/swad_global.h b/swad_global.h index 785f5976..b1c8096c 100644 --- a/swad_global.h +++ b/swad_global.h @@ -79,7 +79,6 @@ struct Globals { int Num; // Number of form, used in form submit links char Id[32]; // Identifier string used in forms - // char UniqueId[32 + Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64 + 10 + 1]; // Unique identifier string used in forms bool Inside; // Set to true inside a form to avoid nested forms } Form; struct diff --git a/swad_match_result.c b/swad_match_result.c index 2b81916c..e30835e5 100644 --- a/swad_match_result.c +++ b/swad_match_result.c @@ -1155,8 +1155,7 @@ void MchRes_ShowOneMchResult (void) HTM_TxtF (", %s",UsrDat->FrstName); HTM_BR (); Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_message.c b/swad_message.c index 9f202330..69ff7448 100644 --- a/swad_message.c +++ b/swad_message.c @@ -492,8 +492,7 @@ static void Msg_ShowOneUniqueRecipient (void) /***** Show user's photo *****/ Pho_ShowUsrPhotoIfAllowed (&Gbl.Usrs.Other.UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); /****** Write user's IDs ******/ HTM_DIV_Begin ("class=\"MSG_TO_ONE_RCP %s_%s\"", @@ -2328,8 +2327,7 @@ void Msg_WriteMsgAuthor (struct Usr_Data *UsrDat,bool Enabled) HTM_TD_Begin ("class=\"CT\" style=\"width:30px;\""); if (WriteAuthor) Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); else Ico_PutIcon ("usr_bl.jpg",Ico_UNCHANGED,Txt_Unknown_or_without_photo, ClassPhoto[Gbl.Prefs.PhotoShape]); @@ -2470,8 +2468,7 @@ static void Msg_WriteMsgFrom (struct Msg_Messages *Messages, /***** Put user's photo *****/ HTM_TD_Begin ("class=\"CM\" style=\"width:30px;\""); Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); /***** Write user's name *****/ @@ -2614,8 +2611,7 @@ static void Msg_WriteMsgTo (struct Msg_Messages *Messages,long MsgCod) false); Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : NULL, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); /* Write user's name */ @@ -2921,8 +2917,7 @@ void Msg_ListBannedUsrs (void) /* Show photo */ HTM_TD_Begin ("class=\"LM\" style=\"width:30px;\""); Pho_ShowUsrPhotoIfAllowed (&UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); /* Write user's full name */ diff --git a/swad_photo.c b/swad_photo.c index e3250204..d197db0a 100644 --- a/swad_photo.c +++ b/swad_photo.c @@ -416,8 +416,7 @@ void Pho_ReqRemoveMyPhoto (void) /* Show current photo */ Pho_ShowUsrPhoto (&Gbl.Usrs.Me.UsrDat,Gbl.Usrs.Me.PhotoURL, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_NO_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_NO_ZOOM); /* End alert */ Ale_ShowAlertAndButton2 (ActRemMyPho,NULL,NULL, @@ -505,8 +504,7 @@ void Pho_ReqRemoveUsrPhoto (void) /* Show current photo */ Pho_ShowUsrPhoto (&Gbl.Usrs.Other.UsrDat,PhotoURL, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_NO_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_NO_ZOOM); /* End alert */ Ale_ShowAlertAndButton2 (NextAction[Gbl.Usrs.Other.UsrDat.Roles.InCurrentCrs],NULL,NULL, @@ -942,15 +940,14 @@ unsigned Pho_UpdateMyClicksWithoutPhoto (void) /*****************************************************************************/ void Pho_ShowUsrPhotoIfAllowed (struct Usr_Data *UsrDat, - const char *ClassPhoto,Pho_Zoom_t Zoom, - bool FormUnique) + const char *ClassPhoto,Pho_Zoom_t Zoom) { char PhotoURL[PATH_MAX + 1]; bool ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (UsrDat,PhotoURL); Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : NULL, - ClassPhoto,Zoom,FormUnique); + ClassPhoto,Zoom); } /*****************************************************************************/ @@ -1247,8 +1244,7 @@ void Pho_BuildHTMLUsrPhoto (const struct Usr_Data *UsrDat,const char *PhotoURL, /*****************************************************************************/ void Pho_ShowUsrPhoto (const struct Usr_Data *UsrDat,const char *PhotoURL, - const char *ClassPhoto,Pho_Zoom_t Zoom, - bool FormUnique) + const char *ClassPhoto,Pho_Zoom_t Zoom) { Act_BrowserTab_t BrowserTab = Act_GetBrowserTab (Gbl.Action.Act); bool BrowserTabIs1stTab = (BrowserTab == Act_BRW_1ST_TAB || @@ -1262,12 +1258,8 @@ void Pho_ShowUsrPhoto (const struct Usr_Data *UsrDat,const char *PhotoURL, /***** Begin form to go to public profile *****/ if (PutLinkToPublicProfile) { - if (FormUnique) - // Frm_BeginFormUnique (ActSeeOthPubPrf); - Frm_BeginForm (ActSeeOthPubPrf); - else - Frm_BeginForm (ActSeeOthPubPrf); - Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); + Frm_BeginForm (ActSeeOthPubPrf); + Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); HTM_BUTTON_Submit_Begin (NULL,"class=\"BT_LINK\""); } diff --git a/swad_photo.h b/swad_photo.h index 629b73d6..fe97af0d 100644 --- a/swad_photo.h +++ b/swad_photo.h @@ -116,8 +116,7 @@ void Pho_UpdateUsrPhoto2 (void); unsigned Pho_UpdateMyClicksWithoutPhoto (void); void Pho_ShowUsrPhotoIfAllowed (struct Usr_Data *UsrDat, - const char *ClassPhoto,Pho_Zoom_t Zoom, - bool FormUnique); + const char *ClassPhoto,Pho_Zoom_t Zoom); bool Pho_ShowingUsrPhotoIsAllowed (struct Usr_Data *UsrDat, char PhotoURL[PATH_MAX + 1]); bool Pho_BuildLinkToPhoto (const struct Usr_Data *UsrDat,char PhotoURL[PATH_MAX + 1]); @@ -127,8 +126,7 @@ void Pho_BuildHTMLUsrPhoto (const struct Usr_Data *UsrDat,const char *PhotoURL, char **ImgStr, char **CaptionStr); void Pho_ShowUsrPhoto (const struct Usr_Data *UsrDat,const char *PhotoURL, - const char *ClassPhoto,Pho_Zoom_t Zoom, - bool FormUnique); + const char *ClassPhoto,Pho_Zoom_t Zoom); bool Pho_RemovePhoto (struct Usr_Data *UsrDat); void Pho_UpdatePhotoName (struct Usr_Data *UsrDat); diff --git a/swad_profile.c b/swad_profile.c index fafce12c..0f5aa603 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -1329,8 +1329,7 @@ static void Prf_ShowUsrInRanking (struct Usr_Data *UsrDat,unsigned Rank,bool Its if (Visible) /***** User's photo *****/ Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); /***** Put form to go to public profile *****/ diff --git a/swad_project.c b/swad_project.c index 5f3298e5..705b0f29 100644 --- a/swad_project.c +++ b/swad_project.c @@ -2042,8 +2042,7 @@ static void Prj_ShowProjectMembersWithARole (struct Prj_Projects *Projects, /* Put user's photo */ HTM_TD_Begin ("class=\"PRJ_MEMBER_PHO\""); Pho_ShowUsrPhotoIfAllowed (&Gbl.Usrs.Other.UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); /* Write user's name */ diff --git a/swad_record.c b/swad_record.c index bb3034b2..8db0478b 100644 --- a/swad_record.c +++ b/swad_record.c @@ -2585,8 +2585,7 @@ static void Rec_ShowPhoto (struct Usr_Data *UsrDat) /***** User's photo *****/ HTM_TD_Begin ("rowspan=\"3\" class=\"REC_C3_TOP CT\""); Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); } diff --git a/swad_statistic.c b/swad_statistic.c index 9014ab94..ea791560 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -1375,8 +1375,7 @@ static void Sta_ShowNumHitsPerUsr (Sta_CountType_t CountType, /* Show the photo */ HTM_TD_Begin ("class=\"CT %s\"",The_GetColorRows ()); Pho_ShowUsrPhotoIfAllowed (&UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); /* Write the user's ID if user is a student in current course */ diff --git a/swad_test_print.c b/swad_test_print.c index ca54a74a..bea2bbde 100644 --- a/swad_test_print.c +++ b/swad_test_print.c @@ -2275,8 +2275,7 @@ void TstPrn_ShowOnePrint (void) HTM_TxtF (", %s",Gbl.Usrs.Other.UsrDat.FrstName); HTM_BR (); Pho_ShowUsrPhotoIfAllowed (&Gbl.Usrs.Other.UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_timeline_comment.c b/swad_timeline_comment.c index 00ac1fc8..1f958f52 100644 --- a/swad_timeline_comment.c +++ b/swad_timeline_comment.c @@ -199,8 +199,7 @@ static void TmlCom_ShowAuthorPhoto (struct Usr_Data *UsrDat) /* Author's photo */ Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - true); // Use unique id + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); /* End container */ HTM_DIV_End (); @@ -617,7 +616,6 @@ static void TmlCom_WriteAuthorName (const struct Usr_Data *UsrDat) // Author /***** Show user's name inside form to go to user's public profile *****/ /* Begin form */ - // Frm_BeginFormUnique (ActSeeOthPubPrf); Frm_BeginForm (ActSeeOthPubPrf); Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); diff --git a/swad_timeline_form.c b/swad_timeline_form.c index d32ffb50..4ee9cb5b 100644 --- a/swad_timeline_form.c +++ b/swad_timeline_form.c @@ -224,7 +224,6 @@ void TmlFrm_FormFavSha (const struct Tml_Form *Form) ParamStr, Gbl.Usrs.Other.UsrDat.EnUsrCod) < 0) Err_NotEnoughMemoryExit (); - // Frm_BeginFormUniqueAnchorOnSubmit (ActUnk,"timeline",OnSubmit); Frm_BeginFormAnchorOnSubmit (ActUnk,"timeline",OnSubmit); free (OnSubmit); Ico_PutIconLink (Form->Icon,Form->Color, @@ -239,7 +238,6 @@ void TmlFrm_FormFavSha (const struct Tml_Form *Form) Gbl.Session.Id, ParamStr) < 0) Err_NotEnoughMemoryExit (); - // Frm_BeginFormUniqueAnchorOnSubmit (ActUnk,NULL,OnSubmit); Frm_BeginFormAnchorOnSubmit (ActUnk,NULL,OnSubmit); free (OnSubmit); Ico_PutIconLink (Form->Icon,Form->Color, @@ -301,7 +299,6 @@ void TmlFrm_FormToShowHiddenComms (long NotCod, Err_NotEnoughMemoryExit (); Anchor = NULL; } - // Frm_BeginFormUniqueAnchorOnSubmit (ActUnk,Anchor,OnSubmit); Frm_BeginFormAnchorOnSubmit (ActUnk,Anchor,OnSubmit); free (OnSubmit); diff --git a/swad_timeline_note.c b/swad_timeline_note.c index 085f4dd0..19e306b3 100644 --- a/swad_timeline_note.c +++ b/swad_timeline_note.c @@ -273,7 +273,7 @@ static void TmlNot_WriteNote (const struct Tml_Timeline *Timeline, Usr_DONT_GET_ROLE_IN_CURRENT_CRS); /***** Left top: author's photo *****/ - TmlNot_ShowAuthorPhoto (&UsrDat,true); // Use unique id + TmlNot_ShowAuthorPhoto (&UsrDat); /***** Right top: author's name, time, and content *****/ TmlNot_WriteAuthorTimeAndContent (Not,&UsrDat); @@ -289,7 +289,7 @@ static void TmlNot_WriteNote (const struct Tml_Timeline *Timeline, /*********************** Show photo of author of a note **********************/ /*****************************************************************************/ -void TmlNot_ShowAuthorPhoto (struct Usr_Data *UsrDat,bool FormUnique) +void TmlNot_ShowAuthorPhoto (struct Usr_Data *UsrDat) { static const char *ClassPhoto[PhoSha_NUM_SHAPES] = { @@ -304,8 +304,7 @@ void TmlNot_ShowAuthorPhoto (struct Usr_Data *UsrDat,bool FormUnique) /***** Photo *****/ Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - FormUnique); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); /***** End container *****/ HTM_DIV_End (); @@ -352,7 +351,6 @@ void TmlNot_WriteAuthorName (const struct Usr_Data *UsrDat, /***** Show user's name inside form to go to user's public profile *****/ /* Begin form */ - // Frm_BeginFormUnique (ActSeeOthPubPrf); Frm_BeginForm (ActSeeOthPubPrf); Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); @@ -624,7 +622,6 @@ static void TmlNot_PutFormGoToAction (const struct TmlNot_Note *Not, { case TmlNot_INS_DOC_PUB_FILE: case TmlNot_INS_SHA_PUB_FILE: - // Frm_BeginFormUnique (Tml_DefaultActions[Not->Type]); Frm_BeginForm (Tml_DefaultActions[Not->Type]); Brw_PutHiddenParamFilCod (Not->Cod); if (Not->HieCod != Gbl.Hierarchy.Ins.InsCod) // Not the current institution @@ -632,7 +629,6 @@ static void TmlNot_PutFormGoToAction (const struct TmlNot_Note *Not, break; case TmlNot_CTR_DOC_PUB_FILE: case TmlNot_CTR_SHA_PUB_FILE: - // Frm_BeginFormUnique (Tml_DefaultActions[Not->Type]); Frm_BeginForm (Tml_DefaultActions[Not->Type]); Brw_PutHiddenParamFilCod (Not->Cod); if (Not->HieCod != Gbl.Hierarchy.Ctr.CtrCod) // Not the current center @@ -640,7 +636,6 @@ static void TmlNot_PutFormGoToAction (const struct TmlNot_Note *Not, break; case TmlNot_DEG_DOC_PUB_FILE: case TmlNot_DEG_SHA_PUB_FILE: - // Frm_BeginFormUnique (Tml_DefaultActions[Not->Type]); Frm_BeginForm (Tml_DefaultActions[Not->Type]); Brw_PutHiddenParamFilCod (Not->Cod); if (Not->HieCod != Gbl.Hierarchy.Deg.DegCod) // Not the current degree @@ -648,7 +643,6 @@ static void TmlNot_PutFormGoToAction (const struct TmlNot_Note *Not, break; case TmlNot_CRS_DOC_PUB_FILE: case TmlNot_CRS_SHA_PUB_FILE: - // Frm_BeginFormUnique (Tml_DefaultActions[Not->Type]); Frm_BeginForm (Tml_DefaultActions[Not->Type]); Brw_PutHiddenParamFilCod (Not->Cod); if (Not->HieCod != Gbl.Hierarchy.Crs.CrsCod) // Not the current course @@ -656,8 +650,6 @@ static void TmlNot_PutFormGoToAction (const struct TmlNot_Note *Not, break; case TmlNot_CALL_FOR_EXAM: Frm_SetAnchorStr (Not->Cod,&Anchor); - // Frm_BeginFormUniqueAnchor (Tml_DefaultActions[Not->Type], - // Anchor); // Locate on this specific exam Frm_BeginFormAnchor (Tml_DefaultActions[Not->Type], Anchor); // Locate on this specific exam Frm_FreeAnchorStr (Anchor); @@ -668,7 +660,6 @@ static void TmlNot_PutFormGoToAction (const struct TmlNot_Note *Not, case TmlNot_POST: // Not applicable return; case TmlNot_FORUM_POST: - // Frm_BeginFormUnique (For_ActionsSeeFor[Forums->Forum.Type]); Frm_BeginForm (For_ActionsSeeFor[Forums->Forum.Type]); For_PutAllHiddenParamsForum (1, // Page of threads = first 1, // Page of posts = first @@ -682,8 +673,6 @@ static void TmlNot_PutFormGoToAction (const struct TmlNot_Note *Not, break; case TmlNot_NOTICE: Frm_SetAnchorStr (Not->Cod,&Anchor); - // Frm_BeginFormUniqueAnchor (Tml_DefaultActions[Not->Type], - // Anchor); Frm_BeginFormAnchor (Tml_DefaultActions[Not->Type],Anchor); Frm_FreeAnchorStr (Anchor); Not_PutHiddenParamNotCod (Not->Cod); diff --git a/swad_timeline_note.h b/swad_timeline_note.h index 4cb22b04..529b6faf 100644 --- a/swad_timeline_note.h +++ b/swad_timeline_note.h @@ -93,7 +93,7 @@ void TmlNot_CheckAndWriteNoteWithTopMsg (const struct Tml_Timeline *Timeline, const struct TmlNot_Note *Not, Tml_TopMessage_t TopMessage, long PublisherCod); -void TmlNot_ShowAuthorPhoto (struct Usr_Data *UsrDat,bool FormUnique); +void TmlNot_ShowAuthorPhoto (struct Usr_Data *UsrDat); void TmlNot_WriteAuthorName (const struct Usr_Data *UsrDat, const char *Class); diff --git a/swad_timeline_post.c b/swad_timeline_post.c index 6ac76786..d2a6c037 100644 --- a/swad_timeline_post.c +++ b/swad_timeline_post.c @@ -159,7 +159,7 @@ void TmlPst_PutPhotoAndFormToWriteNewPost (struct Tml_Timeline *Timeline) HTM_LI_Begin ("class=\"Tml_WIDTH\""); /***** Left: write author's photo (my photo) *****/ - TmlNot_ShowAuthorPhoto (&Gbl.Usrs.Me.UsrDat,false); // Don't use unique id + TmlNot_ShowAuthorPhoto (&Gbl.Usrs.Me.UsrDat); /***** Right: author's name, time, textarea *****/ TmlPst_PutFormToWriteNewPost (Timeline); diff --git a/swad_timeline_user.c b/swad_timeline_user.c index fab12745..22487c7b 100644 --- a/swad_timeline_user.c +++ b/swad_timeline_user.c @@ -225,8 +225,7 @@ static void TmlUsr_ListSharersOrFavers (MYSQL_RES **mysql_res, /* User's photo */ Pho_ShowUsrPhotoIfAllowed (&UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - true); // Use unique id + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); /* End container */ HTM_DIV_End (); diff --git a/swad_user.c b/swad_user.c index caf5cc8b..446d1a95 100644 --- a/swad_user.c +++ b/swad_user.c @@ -1384,8 +1384,7 @@ void Usr_WriteLoggedUsrHead (void) /***** Show my photo *****/ Pho_ShowUsrPhotoIfAllowed (&Gbl.Usrs.Me.UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); /***** User's name *****/ if (Gbl.Usrs.Me.UsrDat.FrstName[0]) @@ -2208,8 +2207,7 @@ void Usr_WriteRowUsrMainData (unsigned NumUsr,struct Usr_Data *UsrDat, /***** Show user's photo *****/ HTM_TD_Begin ("class=\"CM %s\"",BgColor); Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); } @@ -2260,8 +2258,7 @@ static void Usr_WriteRowGstAllData (struct Usr_Data *UsrDat) /***** Show guest's photo *****/ HTM_TD_Begin ("class=\"%s LM\"",The_GetColorRows ()); Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_NO_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_NO_ZOOM); HTM_TD_End (); } @@ -2355,8 +2352,7 @@ static void Usr_WriteRowStdAllData (struct Usr_Data *UsrDat,char *GroupNames) /***** Show student's photo *****/ HTM_TD_Begin ("class=\"LM %s\"",The_GetColorRows ()); Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_NO_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_NO_ZOOM); HTM_TD_End (); } @@ -2465,8 +2461,7 @@ static void Usr_WriteRowTchAllData (struct Usr_Data *UsrDat) /***** Show teacher's photo *****/ HTM_TD_Begin ("class=\"LM %s\"",The_GetColorRows ()); Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_NO_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_NO_ZOOM); HTM_TD_End (); } @@ -2550,8 +2545,7 @@ static void Usr_WriteRowAdmData (unsigned NumUsr,struct Usr_Data *UsrDat) /***** Show administrator's photo *****/ HTM_TD_Begin ("class=\"LM %s\"",The_GetColorRows ()); Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); } @@ -6162,8 +6156,7 @@ static void Usr_DrawClassPhoto (Usr_ClassPhotoType_t ClassPhotoType, /***** Show photo *****/ Pho_ShowUsrPhotoIfAllowed (&UsrDat, - ClassPhoto[ClassPhotoType][Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[ClassPhotoType][Gbl.Prefs.PhotoShape],Pho_ZOOM); /***** Photo foot *****/ HTM_DIV_Begin ("class=\"CLASSPHOTO_CAPTION CLASSPHOTO_%s\"", @@ -6357,7 +6350,7 @@ void Usr_WriteAuthor1Line (long UsrCod,bool Hidden) /***** Show photo *****/ Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : NULL, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM,false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); /***** Write name *****/ HTM_DIV_Begin ("class=\"AUTHOR_1_LINE %s_%s\"", @@ -6398,8 +6391,7 @@ void Usr_ShowTableCellWithUsrData (struct Usr_Data *UsrDat,unsigned NumRows) else HTM_TD_Begin ("class=\"LT LINE_BOTTOM %s\"",The_GetColorRows ()); Pho_ShowUsrPhotoIfAllowed (UsrDat, - ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM, - false); + ClassPhoto[Gbl.Prefs.PhotoShape],Pho_ZOOM); HTM_TD_End (); /***** User's IDs and name *****/