diff --git a/swad_API.c b/swad_API.c index 1ff9b390..2019351a 100644 --- a/swad_API.c +++ b/swad_API.c @@ -637,7 +637,7 @@ static bool API_GetSomeUsrDataFromUsrCod (struct UsrData *UsrDat,long CrsCod) ID_GetListIDsFromUsrCod (UsrDat); /***** Get user's nickname *****/ - Nck_GetNicknameFromUsrCod (UsrDat->UsrCod,UsrDat->Nickname); + Nck_DB_GetNicknameFromUsrCod (UsrDat->UsrCod,UsrDat->Nickname); /***** Get user's role *****/ if (CrsCod > 0) @@ -722,7 +722,7 @@ int swad__createAccount (struct soap *soap, true); // I am creating my own account /***** Save nickname *****/ - Nck_UpdateNickInDB (Gbl.Usrs.Me.UsrDat.UsrCod,NewNickWithoutArr); + Nck_DB_UpdateNick (Gbl.Usrs.Me.UsrDat.UsrCod,NewNickWithoutArr); Str_Copy (Gbl.Usrs.Me.UsrDat.Nickname,NewNickWithoutArr, sizeof (Gbl.Usrs.Me.UsrDat.Nickname) - 1); @@ -1919,7 +1919,7 @@ static void API_CopyListUsers (struct soap *soap, ICanSeeUsrID = ID_ICanSeeOtherUsrIDs (&UsrDat); /* Get nickname */ - Nck_GetNicknameFromUsrCod (UsrDat.UsrCod,UsrDat.Nickname); + Nck_DB_GetNicknameFromUsrCod (UsrDat.UsrCod,UsrDat.Nickname); /* Copy user's data into output structure */ API_CopyUsrData (soap, diff --git a/swad_ID.c b/swad_ID.c index 22e2156b..90f98430 100644 --- a/swad_ID.c +++ b/swad_ID.c @@ -497,7 +497,7 @@ static void ID_PutLinkToConfirmID (struct UsrData *UsrDat,unsigned NumID, NextAction = ActCnfID_Oth; break; } - Frm_StartFormAnchor (NextAction,Anchor); + Frm_BeginFormAnchor (NextAction,Anchor); if (Gbl.Action.Original != ActUnk) { Par_PutHiddenParamLong (NULL,"OriginalActCod", @@ -705,7 +705,7 @@ static void ID_ShowFormChangeUsrID (bool ItsMe,bool IShouldFillInID) /* Data */ HTM_TD_Begin ("class=\"REC_C2_BOT LT DAT\""); if (ItsMe) - Frm_StartFormAnchor (ActChgMyID,ID_ID_SECTION_ID); + Frm_BeginFormAnchor (ActChgMyID,ID_ID_SECTION_ID); else { switch (UsrDat->Roles.InCurrentCrs) @@ -721,7 +721,7 @@ static void ID_ShowFormChangeUsrID (bool ItsMe,bool IShouldFillInID) NextAction = ActNewID_Oth; break; } - Frm_StartFormAnchor (NextAction,ID_ID_SECTION_ID); + Frm_BeginFormAnchor (NextAction,ID_ID_SECTION_ID); Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); } HTM_INPUT_TEXT ("NewID",ID_MAX_BYTES_USR_ID, diff --git a/swad_MAC.c b/swad_MAC.c index baee5f3f..c527ed8a 100644 --- a/swad_MAC.c +++ b/swad_MAC.c @@ -86,7 +86,7 @@ static void MAC_PutFormToEditMACAddress (Act_Action_t NextAction,const char *Anc void (*FuncParams) (void *Args),void *Args) { /* Form to enter a new MAC address */ - Frm_StartFormAnchor (NextAction,Anchor); + Frm_BeginFormAnchor (NextAction,Anchor); FuncParams (Args); HTM_INPUT_TEXT ("NewMAC",MAC_LENGTH_MAC_ADDRESS,((struct MAC_Params *) Args)->MACstr, HTM_SUBMIT_ON_CHANGE, diff --git a/swad_MFU.c b/swad_MFU.c index 9317ecea..3ca2aaba 100644 --- a/swad_MFU.c +++ b/swad_MFU.c @@ -223,39 +223,47 @@ void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions) Box_BoxBegin (NULL,Txt_My_frequent_actions, NULL,NULL, Hlp_ANALYTICS_Frequent,Box_NOT_CLOSABLE); - HTM_DIV_Begin ("id=\"MFU_actions_big\""); - /***** Write list of frequently used actions *****/ - HTM_UL_Begin ("class=\"LIST_LEFT\""); - for (NumAct = 0; - NumAct < ListMFUActions->NumActions; - NumAct++) - { - Action = ListMFUActions->Actions[NumAct]; + /***** Begin container *****/ + HTM_DIV_Begin ("id=\"MFU_actions_big\""); - if ((Title = Act_GetTitleAction (Action)) != NULL) - { - /* Action string */ - Str_Copy (TabStr,Txt_TABS_TXT[Act_GetTab (Act_GetSuperAction (Action))], - sizeof (TabStr) - 1); - Str_Copy (MenuStr,Title,sizeof (MenuStr) - 1); - snprintf (TabMenuStr,sizeof (TabMenuStr),"%s > %s",TabStr,MenuStr); + /***** Begin list of frequently used actions *****/ + HTM_UL_Begin ("class=\"LIST_LEFT\""); - /* Icon and text */ - HTM_LI_Begin ("class=\"ICO_HIGHLIGHT\""); - Frm_BeginForm (Action); - HTM_BUTTON_SUBMIT_Begin (TabMenuStr,The_ClassFormLinkInBoxNoWrap[Gbl.Prefs.Theme],NULL); - HTM_IMG (Gbl.Prefs.URLIconSet,Act_GetIcon (Action),MenuStr, - NULL); - HTM_TxtF (" %s",TabMenuStr); - HTM_BUTTON_End (); - Frm_EndForm (); - HTM_LI_End (); - } - } + for (NumAct = 0; + NumAct < ListMFUActions->NumActions; + NumAct++) + { + Action = ListMFUActions->Actions[NumAct]; + + if ((Title = Act_GetTitleAction (Action)) != NULL) + { + /* Action string */ + Str_Copy (TabStr,Txt_TABS_TXT[Act_GetTab (Act_GetSuperAction (Action))], + sizeof (TabStr) - 1); + Str_Copy (MenuStr,Title,sizeof (MenuStr) - 1); + snprintf (TabMenuStr,sizeof (TabMenuStr),"%s > %s",TabStr,MenuStr); + + /* Icon and text */ + HTM_LI_Begin ("class=\"ICO_HIGHLIGHT\""); + Frm_BeginForm (Action); + HTM_BUTTON_SUBMIT_Begin (TabMenuStr,The_ClassFormLinkInBoxNoWrap[Gbl.Prefs.Theme],NULL); + HTM_IMG (Gbl.Prefs.URLIconSet,Act_GetIcon (Action),MenuStr, + NULL); + HTM_TxtF (" %s",TabMenuStr); + HTM_BUTTON_End (); + Frm_EndForm (); + HTM_LI_End (); + } + } + + /***** End list of frequently used actions *****/ + HTM_UL_End (); + + /***** End container *****/ + HTM_DIV_End (); /***** End box *****/ - HTM_DIV_End (); Box_BoxEnd (); } @@ -277,41 +285,45 @@ void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions) /***** Start div and link *****/ HTM_DIV_Begin ("id=\"MFU_actions\""); - Frm_BeginForm (ActMFUAct); - HTM_BUTTON_SUBMIT_Begin (Txt_My_frequent_actions,"BT_LINK MFU_TITLE",NULL); - HTM_TxtF ("%s",Txt_Frequent_ACTIONS); - HTM_BUTTON_End (); - Frm_EndForm (); - /***** Write list of frequently used actions *****/ - HTM_UL_Begin (NULL); - for (NumAct = 0; - NumAct < ListMFUActions->NumActions; - NumAct++) - { - Action = ListMFUActions->Actions[NumAct]; - - if ((Title = Act_GetTitleAction (Action)) != NULL) - { - /* Action string */ - Str_Copy (TabStr,Txt_TABS_TXT[Act_GetTab (Act_GetSuperAction (Action))], - sizeof (TabStr) - 1); - Str_Copy (MenuStr,Title,sizeof (MenuStr) - 1); - snprintf (TabMenuStr,sizeof (TabMenuStr),"%s > %s",TabStr,MenuStr); - - /* Icon and text */ - HTM_LI_Begin ("class=\"ICO_HIGHLIGHT\""); - Frm_BeginForm (Action); - HTM_BUTTON_SUBMIT_Begin (TabMenuStr,"BT_LINK",NULL); - HTM_IMG (Gbl.Prefs.URLIconSet,Act_GetIcon (Action),MenuStr, - NULL); - HTM_TxtF (" %s",MenuStr); + Frm_BeginForm (ActMFUAct); + HTM_BUTTON_SUBMIT_Begin (Txt_My_frequent_actions,"BT_LINK MFU_TITLE",NULL); + HTM_TxtF ("%s",Txt_Frequent_ACTIONS); HTM_BUTTON_End (); - Frm_EndForm (); - HTM_LI_End (); - } - } - HTM_UL_End (); + Frm_EndForm (); + + /***** Begin list of frequently used actions *****/ + HTM_UL_Begin (NULL); + + for (NumAct = 0; + NumAct < ListMFUActions->NumActions; + NumAct++) + { + Action = ListMFUActions->Actions[NumAct]; + + if ((Title = Act_GetTitleAction (Action)) != NULL) + { + /* Action string */ + Str_Copy (TabStr,Txt_TABS_TXT[Act_GetTab (Act_GetSuperAction (Action))], + sizeof (TabStr) - 1); + Str_Copy (MenuStr,Title,sizeof (MenuStr) - 1); + snprintf (TabMenuStr,sizeof (TabMenuStr),"%s > %s",TabStr,MenuStr); + + /* Icon and text */ + HTM_LI_Begin ("class=\"ICO_HIGHLIGHT\""); + Frm_BeginForm (Action); + HTM_BUTTON_SUBMIT_Begin (TabMenuStr,"BT_LINK",NULL); + HTM_IMG (Gbl.Prefs.URLIconSet,Act_GetIcon (Action),MenuStr, + NULL); + HTM_TxtF (" %s",MenuStr); + HTM_BUTTON_End (); + Frm_EndForm (); + HTM_LI_End (); + } + } + + /***** End list of frequently used actions *****/ + HTM_UL_End (); /***** End div *****/ HTM_DIV_End (); diff --git a/swad_account.c b/swad_account.c index e2d6fa25..749c3700 100644 --- a/swad_account.c +++ b/swad_account.c @@ -471,7 +471,7 @@ void Acc_ShowFormChgMyAccount (void) /***** Get current user's nickname and email address It's necessary because current nickname or email could be just updated *****/ - Nck_GetNicknameFromUsrCod (Gbl.Usrs.Me.UsrDat.UsrCod,Gbl.Usrs.Me.UsrDat.Nickname); + Nck_DB_GetNicknameFromUsrCod (Gbl.Usrs.Me.UsrDat.UsrCod,Gbl.Usrs.Me.UsrDat.Nickname); Mai_GetEmailFromUsrCod (&Gbl.Usrs.Me.UsrDat); /***** Check nickname, email and ID *****/ @@ -529,7 +529,7 @@ void Acc_ShowFormChgOtherUsrAccount (void) { /***** Get user's nickname and email address It's necessary because nickname or email could be just updated *****/ - Nck_GetNicknameFromUsrCod (Gbl.Usrs.Other.UsrDat.UsrCod,Gbl.Usrs.Other.UsrDat.Nickname); + Nck_DB_GetNicknameFromUsrCod (Gbl.Usrs.Other.UsrDat.UsrCod,Gbl.Usrs.Other.UsrDat.Nickname); Mai_GetEmailFromUsrCod (&Gbl.Usrs.Other.UsrDat); /***** Show user's record *****/ @@ -610,7 +610,7 @@ bool Acc_CreateMyNewAccountAndLogIn (void) true); // I am creating my own account /***** Save nickname *****/ - Nck_UpdateNickInDB (Gbl.Usrs.Me.UsrDat.UsrCod,NewNickWithoutArr); + Nck_DB_UpdateNick (Gbl.Usrs.Me.UsrDat.UsrCod,NewNickWithoutArr); Str_Copy (Gbl.Usrs.Me.UsrDat.Nickname,NewNickWithoutArr, sizeof (Gbl.Usrs.Me.UsrDat.Nickname) - 1); diff --git a/swad_assignment.c b/swad_assignment.c index e25a180f..e727a50f 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -993,7 +993,7 @@ void Asg_RemoveAssignment (void) Asg_DB_RemoveAssignment (Asg.AsgCod); /***** Mark possible notifications as removed *****/ - Ntf_MarkNotifAsRemoved (Ntf_EVENT_ASSIGNMENT,Asg.AsgCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_ASSIGNMENT,Asg.AsgCod); /***** Write message to show the change made *****/ Ale_ShowAlert (Ale_SUCCESS,Txt_Assignment_X_removed, diff --git a/swad_attendance.c b/swad_attendance.c index 60711aa0..41418bf9 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -2626,7 +2626,7 @@ static void Att_PutButtonToShowDetails (const struct Att_Events *Events) /***** Button to show more details *****/ /* Begin form */ - Frm_StartFormAnchor (Gbl.Action.Act,Att_ATTENDANCE_DETAILS_ID); + Frm_BeginFormAnchor (Gbl.Action.Act,Att_ATTENDANCE_DETAILS_ID); Par_PutHiddenParamChar ("ShowDetails",'Y'); Grp_PutParamsCodGrps (); Usr_PutHiddenParSelectedUsrsCods (&Gbl.Usrs.Selected); @@ -2684,7 +2684,7 @@ static void Att_ListEventsToSelect (const struct Att_Events *Events, depending on the events selected *****/ if (NormalView) { - Frm_StartFormAnchor (Gbl.Action.Act,Att_ATTENDANCE_TABLE_ID); + Frm_BeginFormAnchor (Gbl.Action.Act,Att_ATTENDANCE_TABLE_ID); Grp_PutParamsCodGrps (); Usr_PutHiddenParSelectedUsrsCods (&Gbl.Usrs.Selected); } diff --git a/swad_building.c b/swad_building.c index b67fd179..52a9e17a 100644 --- a/swad_building.c +++ b/swad_building.c @@ -448,7 +448,7 @@ static void Bld_ListBuildingsForEdition (const struct Bld_Buildings *Buildings) /* Building short name */ HTM_TD_Begin ("class=\"LM\""); - Frm_StartFormAnchor (ActRenBldSho,Anchor); + Frm_BeginFormAnchor (ActRenBldSho,Anchor); Bld_PutParamBldCod (&Building->BldCod); HTM_INPUT_TEXT ("ShortName",Bld_MAX_CHARS_SHRT_NAME,Building->ShrtName, HTM_SUBMIT_ON_CHANGE, @@ -458,7 +458,7 @@ static void Bld_ListBuildingsForEdition (const struct Bld_Buildings *Buildings) /* Building full name */ HTM_TD_Begin ("class=\"LM\""); - Frm_StartFormAnchor (ActRenBldFul,Anchor); + Frm_BeginFormAnchor (ActRenBldFul,Anchor); Bld_PutParamBldCod (&Building->BldCod); HTM_INPUT_TEXT ("FullName",Bld_MAX_CHARS_FULL_NAME,Building->FullName, HTM_SUBMIT_ON_CHANGE, @@ -468,7 +468,7 @@ static void Bld_ListBuildingsForEdition (const struct Bld_Buildings *Buildings) /* Building location */ HTM_TD_Begin ("class=\"LM\""); - Frm_StartFormAnchor (ActRenBldLoc,Anchor); + Frm_BeginFormAnchor (ActRenBldLoc,Anchor); Bld_PutParamBldCod (&Building->BldCod); HTM_INPUT_TEXT ("Location",Bld_MAX_CHARS_LOCATION,Building->Location, HTM_SUBMIT_ON_CHANGE, diff --git a/swad_call_for_exam.c b/swad_call_for_exam.c index 86274dbc..6ee1a9e0 100644 --- a/swad_call_for_exam.c +++ b/swad_call_for_exam.c @@ -465,7 +465,7 @@ void Cfe_RemoveCallForExam1 (void) Cfe_DB_MarkACallForExamAsDeleted (ExaCod); /***** Mark possible notifications as removed *****/ - Ntf_MarkNotifAsRemoved (Ntf_EVENT_CALL_FOR_EXAM,ExaCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_CALL_FOR_EXAM,ExaCod); /***** Mark possible social note as unavailable *****/ Tml_DB_MarkNoteAsUnavailable (TL_NOTE_CALL_FOR_EXAM,ExaCod); @@ -983,7 +983,7 @@ static void Cfe_ShowCallForExam (struct Cfe_CallsForExams *CallsForExams, if (TypeViewCallForExam == Cfe_FORM_VIEW) { /***** Begin form *****/ - Frm_StartFormAnchor (ActRcvCfe,Anchor); + Frm_BeginFormAnchor (ActRcvCfe,Anchor); if (ExaCod > 0) // Existing call for exam Cfe_PutHiddenParamExaCod (ExaCod); } diff --git a/swad_changelog.h b/swad_changelog.h index 207a50ce..69f5dbd4 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -602,13 +602,14 @@ TODO: FIX BUG, URGENT! En las fechas como par TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo. */ -#define Log_PLATFORM_VERSION "SWAD 20.94.9 (2021-06-28)" +#define Log_PLATFORM_VERSION "SWAD 20.94.10 (2021-06-29)" #define CSS_FILE "swad20.45.css" #define JS_FILE "swad20.69.1.js" /* TODO: Rename CENTRE to CENTER in help wiki. TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams + Version 20.94.10: Jun 29, 2021 Code refactoring related to HTML output. (313860 lines) Version 20.94.9: Jun 29, 2021 Query moved from module swad_menu to module swad_setting. (313848 lines) Version 20.94.8: Jun 29, 2021 Queries moved to module swad_group_database. (313834 lines) Version 20.94.7: Jun 28, 2021 Queries moved to module swad_group_database. (313782 lines) diff --git a/swad_cookie.c b/swad_cookie.c index b8b1d954..ea901b1e 100644 --- a/swad_cookie.c +++ b/swad_cookie.c @@ -76,7 +76,7 @@ void Coo_EditMyPrefsOnCookies (void) /***** Edit my preference about cookies *****/ /* Begin form */ - Frm_StartFormAnchor (ActChgCooPrf,Coo_COOKIES_ID); + Frm_BeginFormAnchor (ActChgCooPrf,Coo_COOKIES_ID); /* Begin container */ HTM_DIV_Begin ("class=\"%s\"", diff --git a/swad_enrolment.c b/swad_enrolment.c index dbb18261..4d2f677a 100644 --- a/swad_enrolment.c +++ b/swad_enrolment.c @@ -321,7 +321,7 @@ static void Enr_NotifyAfterEnrolment (struct UsrData *UsrDat,Rol_Role_t NewRole) NotifyByEmail = CreateNotif && !ItsMe && (UsrDat->NtfEvents.SendEmail & (1 << NotifyEvent)); if (CreateNotif) - Ntf_StoreNotifyEventToOneUser (NotifyEvent,UsrDat,-1L, + Ntf_DB_StoreNotifyEventToOneUser (NotifyEvent,UsrDat,-1L, (Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL : 0), Gbl.Hierarchy.Ins.InsCod, @@ -2371,7 +2371,7 @@ static void Enr_RemUsrEnrolmentRequestInCrs (long UsrCod,long CrsCod) { /***** Mark possible notifications as removed Important: do this before removing the request *****/ - Ntf_MarkNotifAsRemoved (Ntf_EVENT_ENROLMENT_REQUEST,ReqCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_ENROLMENT_REQUEST,ReqCod); /***** Remove enrolment request *****/ Enr_DB_RemRequest (ReqCod); diff --git a/swad_exam_result.c b/swad_exam_result.c index c00baa11..2e5ee31b 100644 --- a/swad_exam_result.c +++ b/swad_exam_result.c @@ -634,7 +634,7 @@ static void ExaRes_ListExamsToSelect (struct Exa_Exams *Exams) /***** Begin form to update the results depending on the exams selected *****/ - Frm_StartFormAnchor (Gbl.Action.Act,ExaRes_RESULTS_TABLE_ID); + Frm_BeginFormAnchor (Gbl.Action.Act,ExaRes_RESULTS_TABLE_ID); Grp_PutParamsCodGrps (); Usr_PutHiddenParSelectedUsrsCods (&Gbl.Usrs.Selected); diff --git a/swad_exam_session.c b/swad_exam_session.c index 00cf83cf..9be97d38 100644 --- a/swad_exam_session.c +++ b/swad_exam_session.c @@ -1424,7 +1424,7 @@ void ExaSes_PutButtonNewSession (struct Exa_Exams *Exams,long ExaCod) extern const char *Txt_New_session; Exams->ExaCod = ExaCod; - Frm_StartFormAnchor (ActReqNewExaSes,ExaSes_NEW_SESSION_SECTION_ID); + Frm_BeginFormAnchor (ActReqNewExaSes,ExaSes_NEW_SESSION_SECTION_ID); Exa_PutParams (Exams); Btn_PutConfirmButton (Txt_New_session); Frm_EndForm (); diff --git a/swad_exam_set.c b/swad_exam_set.c index e2a2898e..394d7f1e 100644 --- a/swad_exam_set.c +++ b/swad_exam_set.c @@ -1102,7 +1102,7 @@ static void ExaSet_ListOneOrMoreSetsForEdition (struct Exa_Exams *Exams, HTM_ARTICLE_Begin (Anchor); if (ICanEditSets) { - Frm_StartFormAnchor (ActChgTitExaSet,Anchor); + Frm_BeginFormAnchor (ActChgTitExaSet,Anchor); ExaSet_PutParamsOneSet (Exams); HTM_INPUT_TEXT ("Title",ExaSet_MAX_CHARS_TITLE,Set.Title, HTM_SUBMIT_ON_CHANGE, @@ -1130,7 +1130,7 @@ static void ExaSet_ListOneOrMoreSetsForEdition (struct Exa_Exams *Exams, HTM_TD_Begin ("class=\"RT COLOR%u\"",Gbl.RowEvenOdd); if (ICanEditSets) { - Frm_StartFormAnchor (ActChgNumQstExaSet,Anchor); + Frm_BeginFormAnchor (ActChgNumQstExaSet,Anchor); ExaSet_PutParamsOneSet (Exams); HTM_INPUT_LONG ("NumQstsToPrint",0,UINT_MAX,(long) Set.NumQstsToPrint, HTM_SUBMIT_ON_CHANGE,false, diff --git a/swad_file_browser.c b/swad_file_browser.c index e6a9c875..a48a81ce 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -9829,24 +9829,24 @@ void Brw_ShowFileMetadata (void) case Brw_SHOW_DOC_GRP: case Brw_ADMI_DOC_CRS: case Brw_ADMI_DOC_GRP: - Ntf_MarkNotifAsRemoved (Ntf_EVENT_DOCUMENT_FILE, + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_DOCUMENT_FILE, FileMetadata.FilCod); break; case Brw_ADMI_TCH_CRS: case Brw_ADMI_TCH_GRP: - Ntf_MarkNotifAsRemoved (Ntf_EVENT_TEACHERS_FILE, + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TEACHERS_FILE, FileMetadata.FilCod); break; case Brw_ADMI_SHR_CRS: case Brw_ADMI_SHR_GRP: - Ntf_MarkNotifAsRemoved (Ntf_EVENT_SHARED_FILE, + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_SHARED_FILE, FileMetadata.FilCod); break; case Brw_SHOW_MRK_CRS: case Brw_SHOW_MRK_GRP: case Brw_ADMI_MRK_CRS: case Brw_ADMI_MRK_GRP: - Ntf_MarkNotifAsRemoved (Ntf_EVENT_MARKS_FILE, + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_MARKS_FILE, FileMetadata.FilCod); break; default: @@ -9988,24 +9988,24 @@ void Brw_DownloadFile (void) case Brw_SHOW_DOC_GRP: case Brw_ADMI_DOC_CRS: case Brw_ADMI_DOC_GRP: - Ntf_MarkNotifAsRemoved (Ntf_EVENT_DOCUMENT_FILE, + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_DOCUMENT_FILE, FileMetadata.FilCod); break; case Brw_ADMI_TCH_CRS: case Brw_ADMI_TCH_GRP: - Ntf_MarkNotifAsRemoved (Ntf_EVENT_TEACHERS_FILE, + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TEACHERS_FILE, FileMetadata.FilCod); break; case Brw_ADMI_SHR_CRS: case Brw_ADMI_SHR_GRP: - Ntf_MarkNotifAsRemoved (Ntf_EVENT_SHARED_FILE, + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_SHARED_FILE, FileMetadata.FilCod); break; case Brw_SHOW_MRK_CRS: case Brw_SHOW_MRK_GRP: case Brw_ADMI_MRK_CRS: case Brw_ADMI_MRK_GRP: - Ntf_MarkNotifAsRemoved (Ntf_EVENT_MARKS_FILE, + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_MARKS_FILE, FileMetadata.FilCod); break; default: @@ -11750,7 +11750,7 @@ void Brw_RemoveGrpZones (long CrsCod,long GrpCod) char PathGrpFileZones[PATH_MAX + 1]; /***** Set notifications about files in this group zone as removed *****/ - Ntf_MarkNotifFilesInGroupAsRemoved (GrpCod); + Ntf_DB_MarkNotifFilesInGroupAsRemoved (GrpCod); /***** Remove files in the group from database *****/ Brw_RemoveGrpFilesFromDB (GrpCod); diff --git a/swad_follow.c b/swad_follow.c index 1f86aa09..6ca5e0ad 100644 --- a/swad_follow.c +++ b/swad_follow.c @@ -410,7 +410,7 @@ static void Fol_ShowNumberOfFollowingOrFollowers (const struct UsrData *UsrDat, if (NumUsrs) { /* Form to list users */ - Frm_StartFormAnchor (Action,Fol_FOLLOW_SECTION_ID); + Frm_BeginFormAnchor (Action,Fol_FOLLOW_SECTION_ID); Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); HTM_BUTTON_SUBMIT_Begin (Title, (Gbl.Action.Act == Action) ? "BT_LINK FOLLOW_NUM_B" : @@ -436,7 +436,7 @@ static void Fol_ShowNumberOfFollowingOrFollowers (const struct UsrData *UsrDat, if (NumUsrs) { /* Form to list users */ - Frm_StartFormAnchor (Action,Fol_FOLLOW_SECTION_ID); + Frm_BeginFormAnchor (Action,Fol_FOLLOW_SECTION_ID); Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); HTM_BUTTON_SUBMIT_Begin (Title, (Gbl.Action.Act == Action) ? The_ClassFormLinkOutBoxBold[Gbl.Prefs.Theme] : @@ -1123,7 +1123,7 @@ static void Fol_FollowUsr (struct UsrData *UsrDat) If this followed wants to receive notifications by email, activate the sending of a notification *****/ if (CreateNotif) - Ntf_StoreNotifyEventToOneUser (Ntf_EVENT_FOLLOWER,UsrDat,Gbl.Usrs.Me.UsrDat.UsrCod, + Ntf_DB_StoreNotifyEventToOneUser (Ntf_EVENT_FOLLOWER,UsrDat,Gbl.Usrs.Me.UsrDat.UsrCod, (Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL : 0), Gbl.Hierarchy.Ins.InsCod, diff --git a/swad_form.c b/swad_form.c index 382e1878..ab094ad9 100644 --- a/swad_form.c +++ b/swad_form.c @@ -68,7 +68,7 @@ void Frm_BeginForm (Act_Action_t NextAction) Frm_BeginFormAnchorOnSubmit (NextAction,NULL,NULL); } -void Frm_StartFormAnchor (Act_Action_t NextAction,const char *Anchor) +void Frm_BeginFormAnchor (Act_Action_t NextAction,const char *Anchor) { Frm_BeginFormAnchorOnSubmit (NextAction,Anchor,NULL); } diff --git a/swad_form.h b/swad_form.h index 269238fe..b6d10710 100644 --- a/swad_form.h +++ b/swad_form.h @@ -55,7 +55,7 @@ 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_StartFormAnchor (Act_Action_t NextAction,const char *Anchor); +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); diff --git a/swad_forum.c b/swad_forum.c index 6a2639aa..76654f72 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -1299,7 +1299,7 @@ static void For_ShowAForumPost (struct For_Forums *Forums, if (ICanModerateForum) { - Frm_StartFormAnchor (Enabled ? For_ActionsDisPstFor[Forums->Forum.Type] : + Frm_BeginFormAnchor (Enabled ? For_ActionsDisPstFor[Forums->Forum.Type] : For_ActionsEnbPstFor[Forums->Forum.Type], For_FORUM_POSTS_SECTION_ID); For_PutParamsForum (Forums); @@ -2104,7 +2104,7 @@ static void For_WriteLinkToForum (const struct For_Forums *Forums, Ico_PutIcon ("paste.svg",Txt_Copy_not_allowed,"CONTEXT_OPT ICO_HIDDEN ICO16x16"); else { - Frm_StartFormAnchor (For_ActionsPasThrFor[Forum->Type], + Frm_BeginFormAnchor (For_ActionsPasThrFor[Forum->Type], For_FORUM_THREADS_SECTION_ID); For_PutAllHiddenParamsForum (1, // Page of threads = first 1, // Page of posts = first @@ -2119,7 +2119,7 @@ static void For_WriteLinkToForum (const struct For_Forums *Forums, } /***** Write link to forum *****/ - Frm_StartFormAnchor (For_ActionsSeeFor[Forum->Type], + Frm_BeginFormAnchor (For_ActionsSeeFor[Forum->Type], For_FORUM_THREADS_SECTION_ID); For_PutAllHiddenParamsForum (1, // Page of threads = first 1, // Page of posts = first @@ -2557,7 +2557,7 @@ static void For_ShowForumThreadsHighlightingOneThread (struct For_Forums *Forums { HTM_TH_Begin (1,2,"CM"); - Frm_StartFormAnchor (For_ActionsSeeFor[Forums->Forum.Type], + Frm_BeginFormAnchor (For_ActionsSeeFor[Forums->Forum.Type], For_FORUM_THREADS_SECTION_ID); For_PutAllHiddenParamsForum (Forums->CurrentPageThrs, // Page of threads = current 1, // Page of posts = first @@ -3574,7 +3574,7 @@ static void For_ListForumThrs (struct For_Forums *Forums, if (ICanMoveThreads) { HTM_BR (); - Frm_StartFormAnchor (For_ActionsCutThrFor[Forums->Forum.Type], + Frm_BeginFormAnchor (For_ActionsCutThrFor[Forums->Forum.Type], For_FORUM_THREADS_SECTION_ID); For_PutAllHiddenParamsForum (Forums->CurrentPageThrs, // Page of threads = current 1, // Page of posts = first @@ -4057,13 +4057,13 @@ static void For_WriteFormForumPst (struct For_Forums *Forums, /***** Begin form *****/ if (IsReply) // Form to write a reply to a post of an existing thread { - Frm_StartFormAnchor (For_ActionsRecRepFor[Forums->Forum.Type], + Frm_BeginFormAnchor (For_ActionsRecRepFor[Forums->Forum.Type], For_FORUM_POSTS_SECTION_ID); For_PutAllHiddenParamsNewPost (Forums); } else // Form to write the first post of a new thread { - Frm_StartFormAnchor (For_ActionsRecThrFor[Forums->Forum.Type], + Frm_BeginFormAnchor (For_ActionsRecThrFor[Forums->Forum.Type], For_FORUM_POSTS_SECTION_ID); For_PutAllHiddenParamsNewThread (Forums); } @@ -4304,8 +4304,8 @@ void For_RemovePost (void) Med_MediaDestructor (&Media); /***** Mark possible notifications as removed *****/ - Ntf_MarkNotifAsRemoved (Ntf_EVENT_FORUM_POST_COURSE,Forums.PstCod); - Ntf_MarkNotifAsRemoved (Ntf_EVENT_FORUM_REPLY ,Forums.PstCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_FORUM_POST_COURSE,Forums.PstCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_FORUM_REPLY ,Forums.PstCod); /***** Mark possible social note as unavailable *****/ switch (Forums.Forum.Type) // Only if forum is public for any logged user diff --git a/swad_game.c b/swad_game.c index afc1757b..21ed7317 100644 --- a/swad_game.c +++ b/swad_game.c @@ -2581,7 +2581,7 @@ void Gam_PutButtonNewMatch (struct Gam_Games *Games,long GamCod) { extern const char *Txt_New_match; - Frm_StartFormAnchor (ActReqNewMch,Mch_NEW_MATCH_SECTION_ID); + Frm_BeginFormAnchor (ActReqNewMch,Mch_NEW_MATCH_SECTION_ID); Games->GamCod = GamCod; Gam_PutParams (Games); diff --git a/swad_group.c b/swad_group.c index a49dfdba..4cc57cfa 100644 --- a/swad_group.c +++ b/swad_group.c @@ -388,7 +388,7 @@ void Grp_ShowFormToSelectSeveralGroups (void (*FuncParams) (void *Args),void *Ar /***** Begin form to update the students listed depending on the groups selected *****/ - Frm_StartFormAnchor (Gbl.Action.Act, // Repeat current action + Frm_BeginFormAnchor (Gbl.Action.Act, // Repeat current action Usr_USER_LIST_SECTION_ID); Usr_PutParamsPrefsAboutUsrList (); if (FuncParams) @@ -1265,7 +1265,7 @@ static void Grp_ListGroupTypesForEdition (void) /* Name of group type */ HTM_TD_Begin ("class=\"LM\""); - Frm_StartFormAnchor (ActRenGrpTyp,Grp_GROUP_TYPES_SECTION_ID); + Frm_BeginFormAnchor (ActRenGrpTyp,Grp_GROUP_TYPES_SECTION_ID); Grp_PutParamGrpTypCod (&Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod); HTM_INPUT_TEXT ("GrpTypName",Grp_MAX_CHARS_GROUP_TYPE_NAME, Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypName, @@ -1276,7 +1276,7 @@ static void Grp_ListGroupTypesForEdition (void) /* Is it mandatory to register in any group? */ HTM_TD_Begin ("class=\"CM\""); - Frm_StartFormAnchor (ActChgMdtGrpTyp,Grp_GROUP_TYPES_SECTION_ID); + Frm_BeginFormAnchor (ActChgMdtGrpTyp,Grp_GROUP_TYPES_SECTION_ID); Grp_PutParamGrpTypCod (&Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod); HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE, "name=\"MandatoryEnrolment\"" @@ -1293,7 +1293,7 @@ static void Grp_ListGroupTypesForEdition (void) /* Is it possible to register in multiple groups? */ HTM_TD_Begin ("class=\"CM\""); - Frm_StartFormAnchor (ActChgMulGrpTyp,Grp_GROUP_TYPES_SECTION_ID); + Frm_BeginFormAnchor (ActChgMulGrpTyp,Grp_GROUP_TYPES_SECTION_ID); Grp_PutParamGrpTypCod (&Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod); HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE, "name=\"MultipleEnrolment\"" @@ -1310,7 +1310,7 @@ static void Grp_ListGroupTypesForEdition (void) /* Open time */ HTM_TD_Begin ("class=\"LM\""); - Frm_StartFormAnchor (ActChgTimGrpTyp,Grp_GROUP_TYPES_SECTION_ID); + Frm_BeginFormAnchor (ActChgTimGrpTyp,Grp_GROUP_TYPES_SECTION_ID); Grp_PutParamGrpTypCod (&Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod); HTM_TABLE_BeginCenterPadding (2); HTM_TR_Begin (NULL); @@ -1460,7 +1460,7 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms) /***** Icon to open/close group *****/ HTM_TD_Begin ("class=\"BM\""); - Frm_StartFormAnchor (Grp->Open ? ActCloGrp : + Frm_BeginFormAnchor (Grp->Open ? ActCloGrp : ActOpeGrp, Grp_GROUPS_SECTION_ID); Grp_PutParamGrpCod (&Grp->GrpCod); @@ -1475,7 +1475,7 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms) /***** Icon to activate file zones for this group *****/ HTM_TD_Begin ("class=\"BM\""); - Frm_StartFormAnchor (Grp->FileZones ? ActDisFilZonGrp : + Frm_BeginFormAnchor (Grp->FileZones ? ActDisFilZonGrp : ActEnaFilZonGrp, Grp_GROUPS_SECTION_ID); Grp_PutParamGrpCod (&Grp->GrpCod); @@ -1491,7 +1491,7 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms) /***** Group type *****/ /* Start selector */ HTM_TD_Begin ("class=\"CM\""); - Frm_StartFormAnchor (ActChgGrpTyp,Grp_GROUPS_SECTION_ID); + Frm_BeginFormAnchor (ActChgGrpTyp,Grp_GROUPS_SECTION_ID); Grp_PutParamGrpCod (&Grp->GrpCod); HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE, "name=\"GrpTypCod\" style=\"width:100px;\""); @@ -1514,7 +1514,7 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms) /***** Group name *****/ HTM_TD_Begin ("class=\"CM\""); - Frm_StartFormAnchor (ActRenGrp,Grp_GROUPS_SECTION_ID); + Frm_BeginFormAnchor (ActRenGrp,Grp_GROUPS_SECTION_ID); Grp_PutParamGrpCod (&Grp->GrpCod); HTM_INPUT_TEXT ("GrpName",Grp_MAX_CHARS_GROUP_NAME,Grp->GrpName, HTM_SUBMIT_ON_CHANGE, @@ -1525,7 +1525,7 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms) /***** Room *****/ /* Start selector */ HTM_TD_Begin ("class=\"CM\""); - Frm_StartFormAnchor (ActChgGrpRoo,Grp_GROUPS_SECTION_ID); + Frm_BeginFormAnchor (ActChgGrpRoo,Grp_GROUPS_SECTION_ID); Grp_PutParamGrpCod (&Grp->GrpCod); HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE, "name=\"RooCod\" style=\"width:100px;\""); @@ -1565,7 +1565,7 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms) /***** Maximum number of students of the group (row[3]) *****/ HTM_TD_Begin ("class=\"CM\""); - Frm_StartFormAnchor (ActChgMaxStdGrp,Grp_GROUPS_SECTION_ID); + Frm_BeginFormAnchor (ActChgMaxStdGrp,Grp_GROUPS_SECTION_ID); Grp_PutParamGrpCod (&Grp->GrpCod); Grp_WriteMaxStds (StrMaxStudents,Grp->MaxStudents); HTM_INPUT_TEXT ("MaxStudents",Cns_MAX_DECIMAL_DIGITS_UINT,StrMaxStudents, @@ -2415,7 +2415,7 @@ static void Grp_PutFormToCreateGroupType (void) HTM_SECTION_Begin (Grp_NEW_GROUP_TYPE_SECTION_ID); /***** Begin form *****/ - Frm_StartFormAnchor (ActNewGrpTyp,Grp_GROUP_TYPES_SECTION_ID); + Frm_BeginFormAnchor (ActNewGrpTyp,Grp_GROUP_TYPES_SECTION_ID); /***** Begin box *****/ Box_BoxTableBegin (NULL,Txt_New_type_of_group, @@ -2530,7 +2530,7 @@ static void Grp_PutFormToCreateGroup (const struct Roo_Rooms *Rooms) HTM_SECTION_Begin (Grp_NEW_GROUP_SECTION_ID); /***** Begin form *****/ - Frm_StartFormAnchor (ActNewGrp,Grp_GROUPS_SECTION_ID); + Frm_BeginFormAnchor (ActNewGrp,Grp_GROUPS_SECTION_ID); /***** Begin box and table *****/ Box_BoxTableBegin (NULL,Txt_New_group, diff --git a/swad_indicator.c b/swad_indicator.c index 4edd770d..eb8a10e5 100644 --- a/swad_indicator.c +++ b/swad_indicator.c @@ -1453,7 +1453,7 @@ void Ind_ComputeAndStoreIndicatorsCrs (long CrsCod,int NumIndicatorsFromDB, /***** Indicator #3: information about online tutoring *****/ IndicatorsCrs->NumThreads = For_DB_GetNumTotalThrsInForumsOfType (For_FORUM_COURSE_USRS,-1L,-1L,-1L,-1L,CrsCod); IndicatorsCrs->NumPosts = For_GetNumTotalPstsInForumsOfType (For_FORUM_COURSE_USRS,-1L,-1L,-1L,-1L,CrsCod,&(IndicatorsCrs->NumUsrsToBeNotifiedByEMail)); - IndicatorsCrs->NumMsgsSentByTchs = Msg_GetNumMsgsSentByTchsCrs (CrsCod); + IndicatorsCrs->NumMsgsSentByTchs = Msg_DB_GetNumMsgsSentByTchsCrs (CrsCod); IndicatorsCrs->ThereIsOnlineTutoring = (IndicatorsCrs->NumThreads != 0) || (IndicatorsCrs->NumPosts != 0) || (IndicatorsCrs->NumMsgsSentByTchs != 0); diff --git a/swad_layout.c b/swad_layout.c index 3c477c15..8416b343 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -1233,7 +1233,7 @@ void Lay_PutContextualLinkOnlyIcon (Act_Action_t NextAction,const char *Anchor, const char *Title) { /***** Begin form *****/ - Frm_StartFormAnchor (NextAction,Anchor); + Frm_BeginFormAnchor (NextAction,Anchor); if (FuncParams) FuncParams (Args); @@ -1260,7 +1260,7 @@ void Lay_PutContextualLinkIconText (Act_Action_t NextAction,const char *Anchor, // jumping to the next line on narrow screens /***** Begin form *****/ - Frm_StartFormAnchor (NextAction,Anchor); + Frm_BeginFormAnchor (NextAction,Anchor); if (FuncParams) FuncParams (Args); @@ -1294,7 +1294,7 @@ void Lay_PutContextualLinkIconTextOnSubmit (Act_Action_t NextAction,const char * // jumping to the next line on narrow screens /***** Begin form *****/ - Frm_StartFormAnchor (NextAction,Anchor); + Frm_BeginFormAnchor (NextAction,Anchor); if (FuncParams) FuncParams (Args); diff --git a/swad_mail.c b/swad_mail.c index 2c0487bb..aee2b2c0 100644 --- a/swad_mail.c +++ b/swad_mail.c @@ -1323,7 +1323,7 @@ static void Mai_ShowFormChangeUsrEmail (bool ItsMe, { HTM_BR (); if (ItsMe) - Frm_StartFormAnchor (ActChgMyMai,Mai_EMAIL_SECTION_ID); + Frm_BeginFormAnchor (ActChgMyMai,Mai_EMAIL_SECTION_ID); else { switch (UsrDat->Roles.InCurrentCrs) @@ -1339,7 +1339,7 @@ static void Mai_ShowFormChangeUsrEmail (bool ItsMe, NextAction = ActNewMaiOth; break; } - Frm_StartFormAnchor (NextAction,Mai_EMAIL_SECTION_ID); + Frm_BeginFormAnchor (NextAction,Mai_EMAIL_SECTION_ID); Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); } Par_PutHiddenParamString (NULL,"NewEmail",row[0]); @@ -1369,7 +1369,7 @@ static void Mai_ShowFormChangeUsrEmail (bool ItsMe, /* Data */ HTM_TD_Begin ("class=\"REC_C2_BOT LT DAT\""); if (ItsMe) - Frm_StartFormAnchor (ActChgMyMai,Mai_EMAIL_SECTION_ID); + Frm_BeginFormAnchor (ActChgMyMai,Mai_EMAIL_SECTION_ID); else { switch (UsrDat->Roles.InCurrentCrs) @@ -1385,7 +1385,7 @@ static void Mai_ShowFormChangeUsrEmail (bool ItsMe, NextAction = ActNewMaiOth; break; } - Frm_StartFormAnchor (NextAction,Mai_EMAIL_SECTION_ID); + Frm_BeginFormAnchor (NextAction,Mai_EMAIL_SECTION_ID); Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); } HTM_INPUT_EMAIL ("NewEmail",Cns_MAX_CHARS_EMAIL_ADDRESS,Gbl.Usrs.Me.UsrDat.Email, diff --git a/swad_match.c b/swad_match.c index 24964263..8c520c34 100644 --- a/swad_match.c +++ b/swad_match.c @@ -1460,7 +1460,7 @@ static void Mch_PutFormExistingMatch (struct Gam_Games *Games, extern const char *Txt_Save_changes; /***** Begin form *****/ - Frm_StartFormAnchor (ActChgMch,Anchor); + Frm_BeginFormAnchor (ActChgMch,Anchor); Mch_PutParamsEdit (Games); /***** Begin box and table *****/ diff --git a/swad_match_result.c b/swad_match_result.c index b9b723c0..b6591e8d 100644 --- a/swad_match_result.c +++ b/swad_match_result.c @@ -594,7 +594,7 @@ static void MchRes_ListGamesToSelect (struct Gam_Games *Games) /***** Begin form to update the results depending on the games selected *****/ - Frm_StartFormAnchor (Gbl.Action.Act,MchRes_RESULTS_TABLE_ID); + Frm_BeginFormAnchor (Gbl.Action.Act,MchRes_RESULTS_TABLE_ID); Grp_PutParamsCodGrps (); Usr_PutHiddenParSelectedUsrsCods (&Gbl.Usrs.Selected); diff --git a/swad_message.c b/swad_message.c index 52007d16..165c07de 100644 --- a/swad_message.c +++ b/swad_message.c @@ -97,7 +97,7 @@ static void Msg_PutFormMsgUsrs (struct Msg_Messages *Messages, char Content[Cns_MAX_BYTES_LONG_TEXT + 1]); static void Msg_ShowSentOrReceivedMessages (struct Msg_Messages *Messages); -static unsigned Msg_GetNumUsrsBannedByMe (void); +static unsigned Msg_DB_GetNumUsrsBannedByMe (void); static void Msg_PutLinkToViewBannedUsers(void); static unsigned Msg_GetSentOrReceivedMsgs (const struct Msg_Messages *Messages, long UsrCod, @@ -118,7 +118,7 @@ static void Msg_ShowFormToShowOnlyUnreadMessages (const struct Msg_Messages *Mes static bool Msg_GetParamOnlyUnreadMsgs (void); static void Msg_ShowASentOrReceivedMessage (struct Msg_Messages *Messages, long MsgNum,long MsgCod); -static bool Msg_GetStatusOfSentMsg (long MsgCod); +static bool Msg_DB_GetStatusOfSentMsg (long MsgCod); static void Msg_GetStatusOfReceivedMsg (long MsgCod,bool *Open,bool *Replied,bool *Expanded); static long Msg_GetParamMsgCod (void); static void Msg_PutLinkToShowMorePotentialRecipients (const struct Msg_Messages *Messages); @@ -144,8 +144,8 @@ static void Msg_MakeFilterFromToSubquery (const struct Msg_Messages *Messages, static void Msg_ExpandSentMsg (long MsgCod); static void Msg_ExpandReceivedMsg (long MsgCod); -static void Msg_ContractSentMsg (long MsgCod); -static void Msg_ContractReceivedMsg (long MsgCod); +static void Msg_DB_ContractSentMsg (long MsgCod); +static void Msg_DB_ContractReceivedMsg (long MsgCod); static long Msg_InsertNewMsg (const char *Subject,const char *Content, struct Med_Media *Media); @@ -153,14 +153,13 @@ static long Msg_InsertNewMsg (const char *Subject,const char *Content, static unsigned long Msg_DelSomeRecOrSntMsgsUsr (const struct Msg_Messages *Messages, long UsrCod, const char *FilterFromToSubquery); -static void Msg_InsertReceivedMsgIntoDB (long MsgCod,long UsrCod, - bool NotifyByEmail); -static void Msg_SetReceivedMsgAsReplied (long MsgCod); +static void Msg_DB_InsertReceivedMsg (long MsgCod,long UsrCod,bool NotifyByEmail); +static void Msg_DB_SetReceivedMsgAsReplied (long MsgCod); static void Msg_MoveReceivedMsgToDeleted (long MsgCod,long UsrCod); static void Msg_MoveSentMsgToDeleted (long MsgCod); static void Msg_MoveMsgContentToDeleted (long MsgCod); -static bool Msg_CheckIfSentMsgIsDeleted (long MsgCod); -static bool Msg_CheckIfReceivedMsgIsDeletedForAllItsRecipients (long MsgCod); +static bool Msg_DB_CheckIfSentMsgIsDeleted (long MsgCod); +static bool Msg_DB_CheckIfReceivedMsgIsDeletedForAllItsRecipients (long MsgCod); static unsigned Msg_GetNumUnreadMsgs (const struct Msg_Messages *Messages, const char *FilterFromToSubquery); @@ -168,7 +167,7 @@ static void Msg_GetMsgSntData (long MsgCod,long *CrsCod,long *UsrCod, time_t *CreatTimeUTC, char Subject[Cns_MAX_BYTES_SUBJECT + 1], bool *Deleted); -static void Msg_GetMsgSubject (long MsgCod,char Subject[Cns_MAX_BYTES_SUBJECT + 1]); +static void Msg_DB_GetMsgSubject (long MsgCod,char Subject[Cns_MAX_BYTES_SUBJECT + 1]); static void Msg_GetMsgContent (long MsgCod,char Content[Cns_MAX_BYTES_LONG_TEXT + 1], struct Med_Media *Media); @@ -298,109 +297,109 @@ static void Msg_PutFormMsgUsrs (struct Msg_Messages *Messages, Msg_PutIconsListMsgs,Messages, Hlp_COMMUNICATION_Messages_write,Box_NOT_CLOSABLE); - if (Messages->ShowOnlyOneRecipient) - /***** Form to show several potential recipients *****/ - Msg_PutLinkToShowMorePotentialRecipients (Messages); - else - { - /***** Get list of users belonging to the current course *****/ - if (GetUsrsInCrs) + if (Messages->ShowOnlyOneRecipient) + /***** Form to show several potential recipients *****/ + Msg_PutLinkToShowMorePotentialRecipients (Messages); + else { - /***** Form to select groups *****/ - Grp_ShowFormToSelectSeveralGroups (Msg_PutParamsWriteMsg,Messages, - Grp_MY_GROUPS); - - /***** Begin section with user list *****/ - HTM_SECTION_Begin (Usr_USER_LIST_SECTION_ID); - - if (NumUsrsInCrs) + /***** Get list of users belonging to the current course *****/ + if (GetUsrsInCrs) { - /***** Form to select type of list used for select several users *****/ - Usr_ShowFormsToSelectUsrListType (Msg_PutParamsWriteMsg,Messages); + /***** Form to select groups *****/ + Grp_ShowFormToSelectSeveralGroups (Msg_PutParamsWriteMsg,Messages, + Grp_MY_GROUPS); - /***** Put link to register students *****/ - Enr_CheckStdsAndPutButtonToRegisterStdsInCurrentCrs (); + /***** Begin section with user list *****/ + HTM_SECTION_Begin (Usr_USER_LIST_SECTION_ID); - /***** Check if it's a big list *****/ - ShowUsrsInCrs = Usr_GetIfShowBigList (NumUsrsInCrs, - Msg_PutParamsWriteMsg,Messages, - "CopyMessageToHiddenFields();"); + if (NumUsrsInCrs) + { + /***** Form to select type of list used for select several users *****/ + Usr_ShowFormsToSelectUsrListType (Msg_PutParamsWriteMsg,Messages); - if (ShowUsrsInCrs) - /***** Get lists of selected users *****/ - Usr_GetListsSelectedEncryptedUsrsCods (&Gbl.Usrs.Selected); + /***** Put link to register students *****/ + Enr_CheckStdsAndPutButtonToRegisterStdsInCurrentCrs (); + + /***** Check if it's a big list *****/ + ShowUsrsInCrs = Usr_GetIfShowBigList (NumUsrsInCrs, + Msg_PutParamsWriteMsg,Messages, + "CopyMessageToHiddenFields();"); + + if (ShowUsrsInCrs) + /***** Get lists of selected users *****/ + Usr_GetListsSelectedEncryptedUsrsCods (&Gbl.Usrs.Selected); + } + + /***** End section with user list *****/ + HTM_SECTION_End (); } - /***** End section with user list *****/ - HTM_SECTION_End (); - } - - /***** Get list of users' IDs or nicknames written explicitely *****/ - Usr_GetListMsgRecipientsWrittenExplicitelyBySender (false); - } - - /***** Begin form to select recipients and write the message *****/ - Frm_BeginForm (ActRcvMsgUsr); - if (Messages->Reply.IsReply) - { - Par_PutHiddenParamChar ("IsReply",'Y'); - Msg_PutHiddenParamMsgCod (Messages->Reply.OriginalMsgCod); - } - if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) - { - Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod); - if (Messages->ShowOnlyOneRecipient) - Par_PutHiddenParamChar ("ShowOnlyOneRecipient",'Y'); - } - - /***** Begin table *****/ - HTM_TABLE_BeginCenterPadding (2); - - /***** "To:" section (recipients) *****/ - HTM_TR_Begin (NULL); - - HTM_TD_Begin ("class=\"%s RT\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtColon (Txt_MSG_To); - HTM_TD_End (); - - HTM_TD_Begin ("class=\"LT\""); - if (Messages->ShowOnlyOneRecipient) - /***** Show only one user as recipient *****/ - Msg_ShowOneUniqueRecipient (); - else - { - /***** Show potential recipients *****/ - HTM_TABLE_BeginWide (); - if (ShowUsrsInCrs) - { - Usr_ListUsersToSelect (Rol_TCH,&Gbl.Usrs.Selected); // All teachers in course - Usr_ListUsersToSelect (Rol_NET,&Gbl.Usrs.Selected); // All non-editing teachers in course - Usr_ListUsersToSelect (Rol_STD,&Gbl.Usrs.Selected); // All students in selected groups + /***** Get list of users' IDs or nicknames written explicitely *****/ + Usr_GetListMsgRecipientsWrittenExplicitelyBySender (false); } - Msg_WriteFormUsrsIDsOrNicksOtherRecipients (); // Other users (nicknames) + + /***** Begin form to select recipients and write the message *****/ + Frm_BeginForm (ActRcvMsgUsr); + if (Messages->Reply.IsReply) + { + Par_PutHiddenParamChar ("IsReply",'Y'); + Msg_PutHiddenParamMsgCod (Messages->Reply.OriginalMsgCod); + } + if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) + { + Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod); + if (Messages->ShowOnlyOneRecipient) + Par_PutHiddenParamChar ("ShowOnlyOneRecipient",'Y'); + } + + /***** Begin table *****/ + HTM_TABLE_BeginCenterPadding (2); + + /***** "To:" section (recipients) *****/ + HTM_TR_Begin (NULL); + + HTM_TD_Begin ("class=\"%s RT\"",The_ClassFormInBox[Gbl.Prefs.Theme]); + HTM_TxtColon (Txt_MSG_To); + HTM_TD_End (); + + HTM_TD_Begin ("class=\"LT\""); + if (Messages->ShowOnlyOneRecipient) + /***** Show only one user as recipient *****/ + Msg_ShowOneUniqueRecipient (); + else + { + /***** Show potential recipients *****/ + HTM_TABLE_BeginWide (); + if (ShowUsrsInCrs) + { + Usr_ListUsersToSelect (Rol_TCH,&Gbl.Usrs.Selected); // All teachers in course + Usr_ListUsersToSelect (Rol_NET,&Gbl.Usrs.Selected); // All non-editing teachers in course + Usr_ListUsersToSelect (Rol_STD,&Gbl.Usrs.Selected); // All students in selected groups + } + Msg_WriteFormUsrsIDsOrNicksOtherRecipients (); // Other users (nicknames) + HTM_TABLE_End (); + } + HTM_TD_End (); + + HTM_TR_End (); + + /***** Subject and content sections *****/ + Msg_WriteFormSubjectAndContentMsgToUsrs (Messages,Content); + + /***** End table *****/ HTM_TABLE_End (); - } - HTM_TD_End (); - HTM_TR_End (); + /***** Help for text editor and send button *****/ + Lay_HelpPlainEditor (); - /***** Subject and content sections *****/ - Msg_WriteFormSubjectAndContentMsgToUsrs (Messages,Content); + /***** Attached image (optional) *****/ + Med_PutMediaUploader (-1,"MSG_MED_INPUT"); - /***** End table *****/ - HTM_TABLE_End (); + /***** Send button *****/ + Btn_PutCreateButton (Txt_Send_message); - /***** Help for text editor and send button *****/ - Lay_HelpPlainEditor (); - - /***** Attached image (optional) *****/ - Med_PutMediaUploader (-1,"MSG_MED_INPUT"); - - /***** Send button *****/ - Btn_PutCreateButton (Txt_Send_message); - - /***** End form *****/ - Frm_EndForm (); + /***** End form *****/ + Frm_EndForm (); /***** End box *****/ Box_BoxEnd (); @@ -547,36 +546,32 @@ static void Msg_WriteFormUsrsIDsOrNicksOtherRecipients (void) /***** Title *****/ HTM_TR_Begin (NULL); - - HTM_TH_Begin (1,ColSpan,"LM LIGHT_BLUE"); - HTM_LABEL_Begin ("for=\"OtherRecipients\""); - HTM_TxtColon (StdsAndTchsWritten ? Txt_Other_recipients : - Txt_Recipients); - HTM_LABEL_End (); - HTM_TH_End (); - + HTM_TH_Begin (1,ColSpan,"LM LIGHT_BLUE"); + HTM_LABEL_Begin ("for=\"OtherRecipients\""); + HTM_TxtColon (StdsAndTchsWritten ? Txt_Other_recipients : + Txt_Recipients); + HTM_LABEL_End (); + HTM_TH_End (); HTM_TR_End (); /***** Textarea with users' @nicknames, emails or IDs *****/ HTM_TR_Begin (NULL); - - HTM_TD_Begin ("colspan=\"%u\" class=\"LM\"",ColSpan); - HTM_TEXTAREA_Begin ("id=\"OtherRecipients\" name=\"OtherRecipients\"" - " class=\"MSG_RECIPIENTS\" rows=\"2\" placeholder=\"%s\"", - Txt_nicks_emails_or_IDs_separated_by_commas); - if (Gbl.Usrs.ListOtherRecipients[0]) - HTM_Txt (Gbl.Usrs.ListOtherRecipients); - else if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) // If there is a recipient - // and there's no list of explicit recipients, - // write @nickname of original sender - { - Nck_GetNicknameFromUsrCod (Gbl.Usrs.Other.UsrDat.UsrCod,Nickname); - if (Nickname[0]) - HTM_TxtF ("@%s",Nickname); - } - HTM_TEXTAREA_End (); - HTM_TD_End (); - + HTM_TD_Begin ("colspan=\"%u\" class=\"LM\"",ColSpan); + HTM_TEXTAREA_Begin ("id=\"OtherRecipients\" name=\"OtherRecipients\"" + " class=\"MSG_RECIPIENTS\" rows=\"2\" placeholder=\"%s\"", + Txt_nicks_emails_or_IDs_separated_by_commas); + if (Gbl.Usrs.ListOtherRecipients[0]) + HTM_Txt (Gbl.Usrs.ListOtherRecipients); + else if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) // If there is a recipient + // and there's no list of explicit recipients, + // write @nickname of original sender + { + Nck_DB_GetNicknameFromUsrCod (Gbl.Usrs.Other.UsrDat.UsrCod,Nickname); + if (Nickname[0]) + HTM_TxtF ("@%s",Nickname); + } + HTM_TEXTAREA_End (); + HTM_TD_End (); HTM_TR_End (); } @@ -602,101 +597,101 @@ static void Msg_WriteFormSubjectAndContentMsgToUsrs (struct Msg_Messages *Messag /***** Message subject *****/ HTM_TR_Begin (NULL); - /* Label */ - Frm_LabelColumn ("RT","MsgSubject",Txt_MSG_Subject); + /* Label */ + Frm_LabelColumn ("RT","MsgSubject",Txt_MSG_Subject); - /* Data */ - HTM_TD_Begin ("class=\"LT\""); - HTM_TEXTAREA_Begin ("id=\"MsgSubject\" name=\"Subject\"" - " class=\"MSG_SUBJECT\" rows=\"2\""); + /* Data */ + HTM_TD_Begin ("class=\"LT\""); + HTM_TEXTAREA_Begin ("id=\"MsgSubject\" name=\"Subject\"" + " class=\"MSG_SUBJECT\" rows=\"2\""); - /* If message is a reply ==> get original message */ - if (MsgCod > 0) // It's a reply - { - if (!SubjectAndContentComeFromForm) + /* If message is a reply ==> get original message */ + if (MsgCod > 0) // It's a reply { - /* Get subject and content of message from database */ - if (DB_QuerySELECT (&mysql_res,"can not get message content", - "SELECT Subject," // row[0] - "Content" // row[1] - " FROM msg_content" - " WHERE MsgCod=%ld", - MsgCod) != 1) - Err_WrongMessageExit (); + if (!SubjectAndContentComeFromForm) + { + /* Get subject and content of message from database */ + if (DB_QuerySELECT (&mysql_res,"can not get message content", + "SELECT Subject," // row[0] + "Content" // row[1] + " FROM msg_content" + " WHERE MsgCod=%ld", + MsgCod) != 1) + Err_WrongMessageExit (); - row = mysql_fetch_row (mysql_res); + row = mysql_fetch_row (mysql_res); - /* Get subject (row[0]) and content (row[1]) */ - Str_Copy (Messages->Subject,row[0],sizeof (Messages->Subject) - 1); - Str_Copy (Content ,row[1],Cns_MAX_BYTES_LONG_TEXT); + /* Get subject (row[0]) and content (row[1]) */ + Str_Copy (Messages->Subject,row[0],sizeof (Messages->Subject) - 1); + Str_Copy (Content ,row[1],Cns_MAX_BYTES_LONG_TEXT); - /* Free structure that stores the query result */ - DB_FreeMySQLResult (&mysql_res); + /* Free structure that stores the query result */ + DB_FreeMySQLResult (&mysql_res); + } + + /* Write subject */ + if (!SubjectAndContentComeFromForm) + HTM_Txt ("Re: "); + HTM_Txt (Messages->Subject); + + HTM_TEXTAREA_End (); + HTM_TD_End (); + HTM_TR_End (); + + /***** Message content *****/ + HTM_TR_Begin (NULL); + + /* Label */ + Frm_LabelColumn ("RT","MsgContent",Txt_MSG_Content); + + /* Data */ + HTM_TD_Begin ("class=\"LT\""); + HTM_TEXTAREA_Begin ("id=\"MsgContent\" name=\"Content\"" + " class=\"MSG_CONTENT\" rows=\"20\""); + + /* Begin textarea with a '\n', that will be not visible in textarea. + When Content is "\nLorem ipsum" (a white line before "Lorem ipsum"), + if we don't put the initial '\n' ==> the form will be sent starting + by "Lorem", without the white line */ + HTM_Txt ("\n"); + + if (!SubjectAndContentComeFromForm) + HTM_TxtF ("\n\n----- %s -----\n",Txt_Original_message); + + Msg_WriteMsgContent (Content,Cns_MAX_BYTES_LONG_TEXT,false,true); + HTM_TEXTAREA_End (); + HTM_TD_End (); + } + else // It's not a reply + { + /* End message subject */ + HTM_Txt (Messages->Subject); + + HTM_TEXTAREA_End (); + HTM_TD_End (); + + HTM_TR_End (); + + /***** Message content *****/ + HTM_TR_Begin (NULL); + + /* Label */ + Frm_LabelColumn ("RT","MsgContent",Txt_MSG_Content); + + /* Data */ + HTM_TD_Begin ("class=\"LT\""); + HTM_TEXTAREA_Begin ("id=\"MsgContent\" name=\"Content\"" + " class=\"MSG_CONTENT\" rows=\"20\""); + + /* Begin textarea with a '\n', that will be not visible in textarea. + When Content is "\nLorem ipsum" (a white line before "Lorem ipsum"), + if we don't put the initial '\n' ==> the form will be sent starting + by "Lorem", without the white line */ + HTM_TxtF ("\n%s",Content); + HTM_TEXTAREA_End (); + HTM_TD_End (); } - /* Write subject */ - if (!SubjectAndContentComeFromForm) - HTM_Txt ("Re: "); - HTM_Txt (Messages->Subject); - - HTM_TEXTAREA_End (); - HTM_TD_End (); - - HTM_TR_End (); - - /***** Message content *****/ - HTM_TR_Begin (NULL); - - /* Label */ - Frm_LabelColumn ("RT","MsgContent",Txt_MSG_Content); - - /* Data */ - HTM_TD_Begin ("class=\"LT\""); - HTM_TEXTAREA_Begin ("id=\"MsgContent\" name=\"Content\"" - " class=\"MSG_CONTENT\" rows=\"20\""); - - /* Start textarea with a '\n', that will be not visible in textarea. - When Content is "\nLorem ipsum" (a white line before "Lorem ipsum"), - if we don't put the initial '\n' ==> the form will be sent starting - by "Lorem", without the white line */ - HTM_Txt ("\n"); - - if (!SubjectAndContentComeFromForm) - HTM_TxtF ("\n\n----- %s -----\n",Txt_Original_message); - - Msg_WriteMsgContent (Content,Cns_MAX_BYTES_LONG_TEXT,false,true); - } - else // It's not a reply - { - /* End message subject */ - HTM_Txt (Messages->Subject); - - HTM_TEXTAREA_End (); - HTM_TD_End (); - - HTM_TR_End (); - - /***** Message content *****/ - HTM_TR_Begin (NULL); - - /* Label */ - Frm_LabelColumn ("RT","MsgContent",Txt_MSG_Content); - - /* Data */ - HTM_TD_Begin ("class=\"LT\""); - HTM_TEXTAREA_Begin ("id=\"MsgContent\" name=\"Content\"" - " class=\"MSG_CONTENT\" rows=\"20\""); - - /* Start textarea with a '\n', that will be not visible in textarea. - When Content is "\nLorem ipsum" (a white line before "Lorem ipsum"), - if we don't put the initial '\n' ==> the form will be sent starting - by "Lorem", without the white line */ - HTM_TxtF ("\n%s",Content); - } - - HTM_TEXTAREA_End (); - HTM_TD_End (); - HTM_TR_End (); } @@ -840,7 +835,7 @@ void Msg_RecMsgFromUsr (void) Usr_DONT_GET_ROLE_IN_CURRENT_CRS)) { /***** Check if recipient has banned me *****/ - RecipientHasBannedMe = Msg_CheckIfUsrIsBanned (Gbl.Usrs.Me.UsrDat.UsrCod,UsrDstData.UsrCod); + RecipientHasBannedMe = Msg_DB_CheckIfUsrIsBanned (Gbl.Usrs.Me.UsrDat.UsrCod,UsrDstData.UsrCod); if (RecipientHasBannedMe) /***** Show an alert indicating that the message has not been sent successfully *****/ @@ -868,13 +863,13 @@ void Msg_RecMsgFromUsr (void) /***** Create the received message for this recipient and increment number of new messages received by this recipient *****/ - Msg_InsertReceivedMsgIntoDB (NewMsgCod,UsrDstData.UsrCod,NotifyByEmail); + Msg_DB_InsertReceivedMsg (NewMsgCod,UsrDstData.UsrCod,NotifyByEmail); /***** Create notification for this recipient. If this recipient wants to receive notifications by -mail, activate the sending of a notification *****/ if (CreateNotif) - Ntf_StoreNotifyEventToOneUser (Ntf_EVENT_MESSAGE,&UsrDstData,NewMsgCod, + Ntf_DB_StoreNotifyEventToOneUser (Ntf_EVENT_MESSAGE,&UsrDstData,NewMsgCod, (Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL : 0), Gbl.Hierarchy.Ins.InsCod, @@ -913,7 +908,7 @@ void Msg_RecMsgFromUsr (void) /***** Update received message setting Replied field to true *****/ if (Replied) - Msg_SetReceivedMsgAsReplied (OriginalMsgCod); + Msg_DB_SetReceivedMsgAsReplied (OriginalMsgCod); /***** Write final message *****/ if (NumRecipients) @@ -1294,7 +1289,7 @@ void Msg_ConSntMsg (void) Err_WrongMessageExit (); /***** Contract the message *****/ - Msg_ContractSentMsg (MsgCod); + Msg_DB_ContractSentMsg (MsgCod); /***** Show again the messages *****/ Msg_ShowSntMsgs (); @@ -1313,7 +1308,7 @@ void Msg_ConRecMsg (void) Err_WrongMessageExit (); /***** Contract the message *****/ - Msg_ContractReceivedMsg (MsgCod); + Msg_DB_ContractReceivedMsg (MsgCod); /***** Show again the messages *****/ Msg_ShowRecMsgs (); @@ -1374,7 +1369,7 @@ static void Msg_ExpandReceivedMsg (long MsgCod) /************************** Contract a sent message **************************/ /*****************************************************************************/ -static void Msg_ContractSentMsg (long MsgCod) +static void Msg_DB_ContractSentMsg (long MsgCod) { /***** Contract message in sent message table *****/ DB_QueryUPDATE ("can not contract a sent message", @@ -1390,7 +1385,7 @@ static void Msg_ContractSentMsg (long MsgCod) /************************ Contract a received message ************************/ /*****************************************************************************/ -static void Msg_ContractReceivedMsg (long MsgCod) +static void Msg_DB_ContractReceivedMsg (long MsgCod) { /***** Contract message in received message table *****/ DB_QueryUPDATE ("can not contract a received message", @@ -1406,7 +1401,7 @@ static void Msg_ContractReceivedMsg (long MsgCod) /********************** Mark a received message as open **********************/ /*****************************************************************************/ -void Msg_SetReceivedMsgAsOpen (long MsgCod,long UsrCod) +void Msg_DB_SetReceivedMsgAsOpen (long MsgCod,long UsrCod) { /***** Mark message as read by user *****/ DB_QueryUPDATE ("can not mark a received message as open", @@ -1554,8 +1549,7 @@ void Msg_DelAllRecAndSntMsgsUsr (long UsrCod) /**** Insert a message y su destinatario in the table of messages received ***/ /*****************************************************************************/ -static void Msg_InsertReceivedMsgIntoDB (long MsgCod,long UsrCod, - bool NotifyByEmail) +static void Msg_DB_InsertReceivedMsg (long MsgCod,long UsrCod,bool NotifyByEmail) { /***** Insert message received in the database *****/ DB_QueryINSERT ("can not create received message", @@ -1573,7 +1567,7 @@ static void Msg_InsertReceivedMsgIntoDB (long MsgCod,long UsrCod, /******** Update received message by setting Replied field to true ***********/ /*****************************************************************************/ -static void Msg_SetReceivedMsgAsReplied (long MsgCod) +static void Msg_DB_SetReceivedMsgAsReplied (long MsgCod) { /***** Update received message by setting Replied field to true *****/ DB_QueryUPDATE ("can not update a received message", @@ -1616,8 +1610,8 @@ static void Msg_MoveReceivedMsgToDeleted (long MsgCod,long UsrCod) UsrCod); /***** If message content is not longer necessary, move it to msg_content_deleted *****/ - if (Msg_CheckIfSentMsgIsDeleted (MsgCod)) - if (Msg_CheckIfReceivedMsgIsDeletedForAllItsRecipients (MsgCod)) + if (Msg_DB_CheckIfSentMsgIsDeleted (MsgCod)) + if (Msg_DB_CheckIfReceivedMsgIsDeletedForAllItsRecipients (MsgCod)) Msg_MoveMsgContentToDeleted (MsgCod); /***** Mark possible notifications as removed *****/ @@ -1650,7 +1644,7 @@ static void Msg_MoveSentMsgToDeleted (long MsgCod) MsgCod); /***** If message content is not longer necessary, move it to msg_content_deleted *****/ - if (Msg_CheckIfReceivedMsgIsDeletedForAllItsRecipients (MsgCod)) + if (Msg_DB_CheckIfReceivedMsgIsDeletedForAllItsRecipients (MsgCod)) Msg_MoveMsgContentToDeleted (MsgCod); } @@ -1723,7 +1717,7 @@ void Msg_MoveUnusedMsgsContentToDeleted (void) /******************** Check if a sent message is deleted *********************/ /*****************************************************************************/ -static bool Msg_CheckIfSentMsgIsDeleted (long MsgCod) +static bool Msg_DB_CheckIfSentMsgIsDeleted (long MsgCod) { /***** Get if the message code is in table of sent messages not deleted *****/ return (DB_QueryCOUNT ("can not check if a sent message is deleted", @@ -1739,7 +1733,7 @@ static bool Msg_CheckIfSentMsgIsDeleted (long MsgCod) /***** Check if a received message has been deleted by all its recipients ****/ /*****************************************************************************/ -static bool Msg_CheckIfReceivedMsgIsDeletedForAllItsRecipients (long MsgCod) +static bool Msg_DB_CheckIfReceivedMsgIsDeletedForAllItsRecipients (long MsgCod) { /***** Get if the message code is in table of received messages not deleted *****/ return (DB_QueryCOUNT ("can not check if a received message" @@ -1868,11 +1862,11 @@ void Msg_ShowRecMsgs (void) /***** Reset messages context *****/ Msg_ResetMessages (&Messages); - if (Msg_GetNumUsrsBannedByMe ()) + if (Msg_DB_GetNumUsrsBannedByMe ()) { /***** Contextual menu *****/ Mnu_ContextMenuBegin (); - Msg_PutLinkToViewBannedUsers (); // View banned users + Msg_PutLinkToViewBannedUsers (); // View banned users Mnu_ContextMenuEnd (); } @@ -1969,95 +1963,95 @@ static void Msg_ShowSentOrReceivedMessages (struct Msg_Messages *Messages) Help[Messages->TypeOfMessages],Box_NOT_CLOSABLE); free (NumMsgsStr); - /***** Filter messages *****/ - /* Begin box with filter */ - Box_BoxBegin (NULL,Txt_Filter, - NULL,NULL, - HelpFilter[Messages->TypeOfMessages],Box_CLOSABLE); + /***** Filter messages *****/ + /* Begin box with filter */ + Box_BoxBegin (NULL,Txt_Filter, + NULL,NULL, + HelpFilter[Messages->TypeOfMessages],Box_CLOSABLE); - /* Form to see messages again */ - Frm_BeginForm (ActionSee[Messages->TypeOfMessages]); + /* Form to see messages again */ + Frm_BeginForm (ActionSee[Messages->TypeOfMessages]); - HTM_DIV_Begin ("class=\"CM\""); - Msg_ShowFormSelectCourseSentOrRecMsgs (Messages); - if (Messages->TypeOfMessages == Msg_RECEIVED) - Msg_ShowFormToShowOnlyUnreadMessages (Messages); - HTM_DIV_End (); - Msg_ShowFormToFilterMsgs (Messages); + HTM_DIV_Begin ("class=\"CM\""); + Msg_ShowFormSelectCourseSentOrRecMsgs (Messages); + if (Messages->TypeOfMessages == Msg_RECEIVED) + Msg_ShowFormToShowOnlyUnreadMessages (Messages); + HTM_DIV_End (); - /***** Contextual menu *****/ - Mnu_ContextMenuBegin (); - HTM_BUTTON_Animated_Begin (Txt_Update_messages, - The_ClassFormLinkInBoxBold[Gbl.Prefs.Theme], - NULL); - Ico_PutCalculateIconWithText (Txt_Update_messages); // Animated icon to update messages - HTM_BUTTON_End (); - Mnu_ContextMenuEnd (); + Msg_ShowFormToFilterMsgs (Messages); - Frm_EndForm (); + /***** Contextual menu *****/ + Mnu_ContextMenuBegin (); + HTM_BUTTON_Animated_Begin (Txt_Update_messages, + The_ClassFormLinkInBoxBold[Gbl.Prefs.Theme], + NULL); + Ico_PutCalculateIconWithText (Txt_Update_messages); // Animated icon to update messages + HTM_BUTTON_End (); + Mnu_ContextMenuEnd (); - /* End box */ - Box_BoxEnd (); + Frm_EndForm (); + /* End box */ + Box_BoxEnd (); - if (Messages->NumMsgs) // If there are messages... - { - if (Gbl.Action.Act == ActExpRcvMsg) // Expanding a message, perhaps it is the result of following a link - // from a notification of received message, so show the page where the message is inside - { - /***** Get the page where the expanded message is inside *****/ - for (NumRow = 0; - NumRow < NumRows; - NumRow++) - { - row = mysql_fetch_row (mysql_res); - if (sscanf (row[0],"%ld",&MsgCod) != 1) - Err_WrongMessageExit (); + if (Messages->NumMsgs) // If there are messages... + { + if (Gbl.Action.Act == ActExpRcvMsg) // Expanding a message, perhaps it is the result of following a link + // from a notification of received message, so show the page where the message is inside + { + /***** Get the page where the expanded message is inside *****/ + for (NumRow = 0; + NumRow < NumRows; + NumRow++) + { + row = mysql_fetch_row (mysql_res); + if (sscanf (row[0],"%ld",&MsgCod) != 1) + Err_WrongMessageExit (); - if (MsgCod == Messages->ExpandedMsgCod) // Expanded message found - { - Messages->CurrentPage = (unsigned) (NumRow / Pag_ITEMS_PER_PAGE) + 1; - break; - } - } - } + if (MsgCod == Messages->ExpandedMsgCod) // Expanded message found + { + Messages->CurrentPage = (unsigned) (NumRow / Pag_ITEMS_PER_PAGE) + 1; + break; + } + } + } - /***** Compute variables related to pagination *****/ - Pagination.NumItems = Messages->NumMsgs; - Pagination.CurrentPage = (int) Messages->CurrentPage; - Pag_CalculatePagination (&Pagination); - Messages->CurrentPage = (unsigned) Pagination.CurrentPage; + /***** Compute variables related to pagination *****/ + Pagination.NumItems = Messages->NumMsgs; + Pagination.CurrentPage = (int) Messages->CurrentPage; + Pag_CalculatePagination (&Pagination); + Messages->CurrentPage = (unsigned) Pagination.CurrentPage; - /***** Save my current page in order to show it next time I'll view my received/sent messages *****/ - Pag_SaveLastPageMsgIntoSession (WhatPaginate[Messages->TypeOfMessages], - Messages->CurrentPage); + /***** Save my current page in order to show it next time I'll view my received/sent messages *****/ + Pag_SaveLastPageMsgIntoSession (WhatPaginate[Messages->TypeOfMessages], + Messages->CurrentPage); - /***** Write links to pages *****/ - Pag_WriteLinksToPagesCentered (WhatPaginate[Messages->TypeOfMessages],&Pagination, - Messages,-1L); + /***** Write links to pages *****/ + Pag_WriteLinksToPagesCentered (WhatPaginate[Messages->TypeOfMessages],&Pagination, + Messages,-1L); - /***** Show received / sent messages in this page *****/ - HTM_TABLE_BeginWidePadding (2); + /***** Show received / sent messages in this page *****/ + HTM_TABLE_BeginWidePadding (2); - mysql_data_seek (mysql_res,(my_ulonglong) (Pagination.FirstItemVisible - 1)); - for (NumRow = Pagination.FirstItemVisible; - NumRow <= Pagination.LastItemVisible; - NumRow++) - { - row = mysql_fetch_row (mysql_res); + mysql_data_seek (mysql_res,(my_ulonglong) (Pagination.FirstItemVisible - 1)); + for (NumRow = Pagination.FirstItemVisible; + NumRow <= Pagination.LastItemVisible; + NumRow++) + { + row = mysql_fetch_row (mysql_res); - if (sscanf (row[0],"%ld",&MsgCod) != 1) - Err_WrongMessageExit (); - NumMsg = NumRows - NumRow + 1; - Msg_ShowASentOrReceivedMessage (Messages,NumMsg,MsgCod); - } + if (sscanf (row[0],"%ld",&MsgCod) != 1) + Err_WrongMessageExit (); + NumMsg = NumRows - NumRow + 1; + Msg_ShowASentOrReceivedMessage (Messages,NumMsg,MsgCod); + } - HTM_TABLE_End (); + HTM_TABLE_End (); - /***** Write again links to pages *****/ - Pag_WriteLinksToPagesCentered (WhatPaginate[Messages->TypeOfMessages],&Pagination, - Messages,-1L); - } + /***** Write again links to pages *****/ + Pag_WriteLinksToPagesCentered (WhatPaginate[Messages->TypeOfMessages],&Pagination, + Messages,-1L); + } /***** End box *****/ Box_BoxEnd (); @@ -2070,7 +2064,7 @@ static void Msg_ShowSentOrReceivedMessages (struct Msg_Messages *Messages) /********************* Get number of user I have banned **********************/ /*****************************************************************************/ -static unsigned Msg_GetNumUsrsBannedByMe (void) +static unsigned Msg_DB_GetNumUsrsBannedByMe (void) { /***** Get number of users I have banned *****/ return (unsigned) @@ -2306,7 +2300,7 @@ static unsigned Msg_GetSentOrReceivedMsgs (const struct Msg_Messages *Messages, /**** Get the number of unique messages sent by any teacher from a course ****/ /*****************************************************************************/ -unsigned Msg_GetNumMsgsSentByTchsCrs (long CrsCod) +unsigned Msg_DB_GetNumMsgsSentByTchsCrs (long CrsCod) { /***** Get the number of unique messages sent by any teacher from this course *****/ return (unsigned) @@ -2327,7 +2321,7 @@ unsigned Msg_GetNumMsgsSentByTchsCrs (long CrsCod) /************** Get the number of unique messages sent by a user *************/ /*****************************************************************************/ -unsigned Msg_GetNumMsgsSentByUsr (long UsrCod) +unsigned Msg_DB_GetNumMsgsSentByUsr (long UsrCod) { /***** Get the number of unique messages sent by any teacher from this course *****/ return (unsigned) @@ -2971,21 +2965,21 @@ static void Msg_ShowFormSelectCourseSentOrRecMsgs (const struct Msg_Messages *Me /***** Course selection *****/ HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtF ("%s ",TxtSelector[Messages->TypeOfMessages]); - HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE, - "name=\"FilterCrsCod\""); - HTM_OPTION (HTM_Type_STRING,"", - Messages->FilterCrsCod < 0,false, - "%s",Txt_any_course); + HTM_TxtF ("%s ",TxtSelector[Messages->TypeOfMessages]); + HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE, + "name=\"FilterCrsCod\""); + HTM_OPTION (HTM_Type_STRING,"", + Messages->FilterCrsCod < 0,false, + "%s",Txt_any_course); - /***** Write an option for each origin course *****/ - for (NumOriginCrs = 0; - NumOriginCrs < Messages->NumCourses; - NumOriginCrs++) - HTM_OPTION (HTM_Type_LONG,&Messages->Courses[NumOriginCrs].CrsCod, - Messages->Courses[NumOriginCrs].CrsCod == Messages->FilterCrsCod,false, - "%s",Messages->Courses[NumOriginCrs].ShrtName); - HTM_SELECT_End (); + /***** Write an option for each origin course *****/ + for (NumOriginCrs = 0; + NumOriginCrs < Messages->NumCourses; + NumOriginCrs++) + HTM_OPTION (HTM_Type_LONG,&Messages->Courses[NumOriginCrs].CrsCod, + Messages->Courses[NumOriginCrs].CrsCod == Messages->FilterCrsCod,false, + "%s",Messages->Courses[NumOriginCrs].ShrtName); + HTM_SELECT_End (); HTM_LABEL_End (); } @@ -3009,29 +3003,29 @@ static void Msg_ShowFormToFilterMsgs (const struct Msg_Messages *Messages) /***** Begin table *****/ HTM_TABLE_BeginCenterPadding (2); - HTM_TR_Begin (NULL); + HTM_TR_Begin (NULL); - /***** Filter authors/recipients *****/ - HTM_TD_Begin ("class=\"LM\""); - HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtColonNBSP (TxtFromTo[Messages->TypeOfMessages]); - HTM_INPUT_SEARCH ("FilterFromTo",Usr_MAX_CHARS_FIRSTNAME_OR_SURNAME * 3, - Messages->FilterFromTo, - "size=\"20\""); - HTM_LABEL_End (); - HTM_TD_End (); + /***** Filter authors/recipients *****/ + HTM_TD_Begin ("class=\"LM\""); + HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); + HTM_TxtColonNBSP (TxtFromTo[Messages->TypeOfMessages]); + HTM_INPUT_SEARCH ("FilterFromTo",Usr_MAX_CHARS_FIRSTNAME_OR_SURNAME * 3, + Messages->FilterFromTo, + "size=\"20\""); + HTM_LABEL_End (); + HTM_TD_End (); - /***** Filter message content *****/ - HTM_TD_Begin ("class=\"LM\""); - HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtColonNBSP (Txt_MSG_Content); - HTM_INPUT_SEARCH ("FilterContent",Msg_MAX_CHARS_FILTER_CONTENT, - Messages->FilterContent, - "size=\"20\""); - HTM_LABEL_End (); - HTM_TD_End (); + /***** Filter message content *****/ + HTM_TD_Begin ("class=\"LM\""); + HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); + HTM_TxtColonNBSP (Txt_MSG_Content); + HTM_INPUT_SEARCH ("FilterContent",Msg_MAX_CHARS_FILTER_CONTENT, + Messages->FilterContent, + "size=\"20\""); + HTM_LABEL_End (); + HTM_TD_End (); - HTM_TR_End (); + HTM_TR_End (); /***** End table *****/ HTM_TABLE_End (); @@ -3048,11 +3042,11 @@ static void Msg_ShowFormToShowOnlyUnreadMessages (const struct Msg_Messages *Mes /***** Put checkbox to select whether to show only unread (received) messages *****/ HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_INPUT_CHECKBOX ("OnlyUnreadMsgs",HTM_DONT_SUBMIT_ON_CHANGE, - "value=\"Y\"%s", - Messages->ShowOnlyUnreadMsgs ? " checked=\"checked\"" : - ""); - HTM_Txt (Txt_only_unread_messages); + HTM_INPUT_CHECKBOX ("OnlyUnreadMsgs",HTM_DONT_SUBMIT_ON_CHANGE, + "value=\"Y\"%s", + Messages->ShowOnlyUnreadMsgs ? " checked=\"checked\"" : + ""); + HTM_Txt (Txt_only_unread_messages); HTM_LABEL_End (); } @@ -3125,14 +3119,14 @@ static void Msg_GetMsgSntData (long MsgCod,long *CrsCod,long *UsrCod, DB_FreeMySQLResult (&mysql_res); /***** Get subject of message from database *****/ - Msg_GetMsgSubject (MsgCod,Subject); + Msg_DB_GetMsgSubject (MsgCod,Subject); } /*****************************************************************************/ /************************ Get the subject of a message ***********************/ /*****************************************************************************/ -static void Msg_GetMsgSubject (long MsgCod,char Subject[Cns_MAX_BYTES_SUBJECT + 1]) +static void Msg_DB_GetMsgSubject (long MsgCod,char Subject[Cns_MAX_BYTES_SUBJECT + 1]) { /***** Get subject of message from database *****/ DB_QuerySELECTString (Subject,Cns_MAX_BYTES_SUBJECT, @@ -3180,7 +3174,7 @@ static void Msg_GetMsgContent (long MsgCod,char Content[Cns_MAX_BYTES_LONG_TEXT /********************** Get if a sent message is expanded ********************/ /*****************************************************************************/ -static bool Msg_GetStatusOfSentMsg (long MsgCod) +static bool Msg_DB_GetStatusOfSentMsg (long MsgCod) { char StrExpanded[1 + 1]; @@ -3223,13 +3217,11 @@ static void Msg_GetStatusOfReceivedMsg (long MsgCod,bool *Open,bool *Replied,boo /***** Get number of rows *****/ row = mysql_fetch_row (mysql_res); - /***** Get if message has been read by me *****/ + /***** Get if message has been read by me (row[0]), + if message has been replied (row[1]), and + if message is expanded (row[2]) *****/ *Open = (row[0][0] == 'Y'); - - /***** Get if message has been replied *****/ *Replied = (row[1][0] == 'Y'); - - /***** Get if message is expanded *****/ *Expanded = (row[2][0] == 'Y'); /***** Free structure that stores the query result *****/ @@ -3280,7 +3272,7 @@ static void Msg_ShowASentOrReceivedMessage (struct Msg_Messages *Messages, Msg_GetStatusOfReceivedMsg (MsgCod,&Open,&Replied,&Expanded); break; case Msg_SENT: - Expanded = Msg_GetStatusOfSentMsg (MsgCod); + Expanded = Msg_DB_GetStatusOfSentMsg (MsgCod); break; default: break; @@ -3481,7 +3473,7 @@ void Msg_WriteMsgNumber (unsigned long MsgNum,bool NewMsg) HTM_TD_Begin ("class=\"%s CT\" style=\"width:45px;\"", NewMsg ? "MSG_TIT_BG_NEW" : "MSG_TIT_BG"); - HTM_TxtF ("%lu:",MsgNum); + HTM_TxtF ("%lu:",MsgNum); HTM_TD_End (); } @@ -3501,28 +3493,30 @@ static void Msg_WriteSentOrReceivedMsgSubject (struct Msg_Messages *Messages, HTM_TD_Begin ("class=\"%s LT\"",Open ? "MSG_TIT_BG" : "MSG_TIT_BG_NEW"); - /***** Begin form to expand/contract the message *****/ - Frm_BeginForm (Messages->TypeOfMessages == Msg_RECEIVED ? (Expanded ? ActConRcvMsg : - ActExpRcvMsg) : - (Expanded ? ActConSntMsg : - ActExpSntMsg)); - Messages->MsgCod = MsgCod; // Message to be contracted/expanded - Msg_PutHiddenParamsOneMsg (Messages); - HTM_BUTTON_SUBMIT_Begin (Expanded ? Txt_Hide_message : - Txt_See_message, - Open ? "BT_LINK LT MSG_TIT" : - "BT_LINK LT MSG_TIT_NEW", - NULL); + /***** Begin form to expand/contract the message *****/ + Frm_BeginForm (Messages->TypeOfMessages == Msg_RECEIVED ? (Expanded ? ActConRcvMsg : + ActExpRcvMsg) : + (Expanded ? ActConSntMsg : + ActExpSntMsg)); + Messages->MsgCod = MsgCod; // Message to be contracted/expanded + Msg_PutHiddenParamsOneMsg (Messages); - /***** Write subject *****/ - if (Subject[0]) - HTM_Txt (Subject); - else - HTM_TxtF ("[%s]",Txt_no_subject); + HTM_BUTTON_SUBMIT_Begin (Expanded ? Txt_Hide_message : + Txt_See_message, + Open ? "BT_LINK LT MSG_TIT" : + "BT_LINK LT MSG_TIT_NEW", + NULL); - /***** End form to expand the message *****/ - HTM_BUTTON_End (); - Frm_EndForm (); + /***** Write subject *****/ + if (Subject[0]) + HTM_Txt (Subject); + else + HTM_TxtF ("[%s]",Txt_no_subject); + + /***** End form to expand the message *****/ + HTM_BUTTON_End (); + + Frm_EndForm (); /***** End cell *****/ HTM_TD_End (); @@ -3623,15 +3617,15 @@ static bool Msg_WriteCrsOrgMsg (long CrsCod) /* Write course, including link */ Frm_BeginFormGoTo (ActSeeCrsInf); Crs_PutParamCrsCod (Crs.CrsCod); - HTM_DIV_Begin ("class=\"AUTHOR_TXT\""); - HTM_Txt ("("); - HTM_BUTTON_SUBMIT_Begin (Hie_BuildGoToMsg (Crs.FullName), - "BT_LINK AUTHOR_TXT",NULL); - Hie_FreeGoToMsg (); - HTM_Txt (Crs.ShrtName); - HTM_BUTTON_End (); - HTM_Txt (")"); - HTM_DIV_End (); + HTM_DIV_Begin ("class=\"AUTHOR_TXT\""); + HTM_Txt ("("); + HTM_BUTTON_SUBMIT_Begin (Hie_BuildGoToMsg (Crs.FullName), + "BT_LINK AUTHOR_TXT",NULL); + Hie_FreeGoToMsg (); + HTM_Txt (Crs.ShrtName); + HTM_BUTTON_End (); + HTM_Txt (")"); + HTM_DIV_End (); Frm_EndForm (); } } @@ -3639,7 +3633,7 @@ static bool Msg_WriteCrsOrgMsg (long CrsCod) if (!ThereIsOrgCrs) // It's an old message without origin source specified, or is a message sent from none course { HTM_DIV_Begin ("class=\"AUTHOR_TXT\""); - HTM_TxtF ("(%s)",Txt_no_course_of_origin); + HTM_TxtF ("(%s)",Txt_no_course_of_origin); HTM_DIV_End (); } @@ -3659,7 +3653,7 @@ static void Msg_WriteFormToReply (long MsgCod,long CrsCod, extern const char *Txt_Go_to_course_and_reply; extern const char *Txt_Go_to_course_and_reply_again; - /***** Form start and parameters *****/ + /***** Begin form and parameters *****/ if (FromThisCrs) Frm_BeginForm (ActReqMsgUsr); else // Not the current course ==> go to another course @@ -3673,12 +3667,14 @@ static void Msg_WriteFormToReply (long MsgCod,long CrsCod, Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); Par_PutHiddenParamChar ("ShowOnlyOneRecipient",'Y'); - /****** Link and form end *****/ - Ico_PutIconLink ("reply.svg", - FromThisCrs ? (Replied ? Txt_Reply_again : - Txt_Reply) : - (Replied ? Txt_Go_to_course_and_reply_again : - Txt_Go_to_course_and_reply)); + /****** Link *****/ + Ico_PutIconLink ("reply.svg", + FromThisCrs ? (Replied ? Txt_Reply_again : + Txt_Reply) : + (Replied ? Txt_Go_to_course_and_reply_again : + Txt_Go_to_course_and_reply)); + + /****** End form *****/ Frm_EndForm (); } @@ -3718,7 +3714,7 @@ static void Msg_WriteMsgFrom (struct Msg_Messages *Messages, if (Act_GetSuperAction (Gbl.Action.Act) == ActSeeRcvMsg) { HTM_NBSP (); - if (Msg_CheckIfUsrIsBanned (UsrDat->UsrCod,Gbl.Usrs.Me.UsrDat.UsrCod)) + if (Msg_DB_CheckIfUsrIsBanned (UsrDat->UsrCod,Gbl.Usrs.Me.UsrDat.UsrCod)) // Sender is banned Msg_PutFormToUnbanSender (Messages,UsrDat); else @@ -3824,112 +3820,112 @@ static void Msg_WriteMsgTo (struct Msg_Messages *Messages,long MsgCod) /***** Begin table *****/ HTM_TABLE_Begin (NULL); - /***** How many recipients will be shown? *****/ - if (NumRecipientsKnown <= Msg_MAX_RECIPIENTS_TO_SHOW) - NumRecipientsToShow = NumRecipientsKnown; - else // A lot of recipients - /***** Get parameter that indicates if I want to see all recipients *****/ - NumRecipientsToShow = Par_GetParToBool ("SeeAllRcpts") ? NumRecipientsKnown : - Msg_DEF_RECIPIENTS_TO_SHOW; + /***** How many recipients will be shown? *****/ + if (NumRecipientsKnown <= Msg_MAX_RECIPIENTS_TO_SHOW) + NumRecipientsToShow = NumRecipientsKnown; + else // A lot of recipients + /***** Get parameter that indicates if I want to see all recipients *****/ + NumRecipientsToShow = Par_GetParToBool ("SeeAllRcpts") ? NumRecipientsKnown : + Msg_DEF_RECIPIENTS_TO_SHOW; - /***** Initialize structure with user's data *****/ - Usr_UsrDataConstructor (&UsrDat); + /***** Initialize structure with user's data *****/ + Usr_UsrDataConstructor (&UsrDat); - /***** Write known recipients *****/ - for (NumRcp = 0; - NumRcp < NumRecipientsToShow; - NumRcp++) - { - /* Get user's code */ - row = mysql_fetch_row (mysql_res); - UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0]); + /***** Write known recipients *****/ + for (NumRcp = 0; + NumRcp < NumRecipientsToShow; + NumRcp++) + { + /* Get user's code */ + row = mysql_fetch_row (mysql_res); + UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0]); - /* Get if message has been deleted by recipient */ - Deleted = (row[1][0] == 'Y'); + /* Get if message has been deleted by recipient */ + Deleted = (row[1][0] == 'Y'); - /* Get if message has been read by recipient */ - OpenByDst = (row[2][0] == 'Y'); + /* Get if message has been read by recipient */ + OpenByDst = (row[2][0] == 'Y'); - /* Get user's data */ - UsrValid = Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat, - Usr_DONT_GET_PREFS, - Usr_DONT_GET_ROLE_IN_CURRENT_CRS); + /* Get user's data */ + UsrValid = Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat, + Usr_DONT_GET_PREFS, + Usr_DONT_GET_ROLE_IN_CURRENT_CRS); - /* Put an icon to show if user has read the message */ - Title = OpenByDst ? (Deleted ? Txt_MSG_Open_and_deleted : - Txt_MSG_Open) : - (Deleted ? Txt_MSG_Deleted_without_opening : - Txt_MSG_Unopened); - HTM_TR_Begin (NULL); + /* Put an icon to show if user has read the message */ + Title = OpenByDst ? (Deleted ? Txt_MSG_Open_and_deleted : + Txt_MSG_Open) : + (Deleted ? Txt_MSG_Deleted_without_opening : + Txt_MSG_Unopened); + HTM_TR_Begin (NULL); - HTM_TD_Begin ("class=\"LM\" style=\"width:20px;\""); - Ico_PutIcon (OpenByDst ? (Deleted ? "envelope-open-text-red.svg" : - "envelope-open-text.svg") : - (Deleted ? "envelope-red.svg" : - "envelope.svg"), - Title,"ICO16x16"); - HTM_TD_End (); + HTM_TD_Begin ("class=\"LM\" style=\"width:20px;\""); + Ico_PutIcon (OpenByDst ? (Deleted ? "envelope-open-text-red.svg" : + "envelope-open-text.svg") : + (Deleted ? "envelope-red.svg" : + "envelope.svg"), + Title,"ICO16x16"); + HTM_TD_End (); - /* Put user's photo */ - HTM_TD_Begin ("class=\"CT\" style=\"width:30px;\""); - ShowPhoto = (UsrValid ? Pho_ShowingUsrPhotoIsAllowed (&UsrDat,PhotoURL) : - false); - Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : - NULL, - "PHOTO21x28",Pho_ZOOM,false); - HTM_TD_End (); + /* Put user's photo */ + HTM_TD_Begin ("class=\"CT\" style=\"width:30px;\""); + ShowPhoto = (UsrValid ? Pho_ShowingUsrPhotoIsAllowed (&UsrDat,PhotoURL) : + false); + Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : + NULL, + "PHOTO21x28",Pho_ZOOM,false); + HTM_TD_End (); - /* Write user's name */ - HTM_TD_Begin ("class=\"%s LM\"",OpenByDst ? "AUTHOR_TXT" : - "AUTHOR_TXT_NEW"); - if (UsrValid) - HTM_Txt (UsrDat.FullName); - else - HTM_TxtF ("[%s]",Txt_unknown_recipient); // User not found, likely a user who has been removed - HTM_TD_End (); + /* Write user's name */ + HTM_TD_Begin ("class=\"%s LM\"",OpenByDst ? "AUTHOR_TXT" : + "AUTHOR_TXT_NEW"); + if (UsrValid) + HTM_Txt (UsrDat.FullName); + else + HTM_TxtF ("[%s]",Txt_unknown_recipient); // User not found, likely a user who has been removed + HTM_TD_End (); - HTM_TR_End (); - } + HTM_TR_End (); + } - /***** If any recipients are unknown *****/ - if ((NumRecipientsUnknown = NumRecipientsTotal - NumRecipientsKnown)) - { - /***** Begin form to show all the users *****/ - HTM_TR_Begin (NULL); + /***** If any recipients are unknown *****/ + if ((NumRecipientsUnknown = NumRecipientsTotal - NumRecipientsKnown)) + { + /***** Begin form to show all the users *****/ + HTM_TR_Begin (NULL); - HTM_TD_Begin ("colspan=\"3\" class=\"AUTHOR_TXT LM\""); - HTM_TxtF ("[%u %s]", - NumRecipientsUnknown, - (NumRecipientsUnknown == 1) ? Txt_unknown_recipient : - Txt_unknown_recipients); - HTM_TD_End (); + HTM_TD_Begin ("colspan=\"3\" class=\"AUTHOR_TXT LM\""); + HTM_TxtF ("[%u %s]", + NumRecipientsUnknown, + (NumRecipientsUnknown == 1) ? Txt_unknown_recipient : + Txt_unknown_recipients); + HTM_TD_End (); - HTM_TR_End (); - } + HTM_TR_End (); + } - /***** If any known recipient is not listed *****/ - if (NumRecipientsToShow < NumRecipientsKnown) - { - /***** Begin form to show all the users *****/ - HTM_TR_Begin (NULL); + /***** If any known recipient is not listed *****/ + if (NumRecipientsToShow < NumRecipientsKnown) + { + /***** Begin form to show all the users *****/ + HTM_TR_Begin (NULL); - HTM_TD_Begin ("colspan=\"3\" class=\"AUTHOR_TXT LM\""); - Frm_BeginForm (ActionSee[Messages->TypeOfMessages]); - Messages->MsgCod = MsgCod; // Message to be expanded with all recipients visible - Msg_PutHiddenParamsOneMsg (Messages); - Par_PutHiddenParamChar ("SeeAllRcpts",'Y'); - HTM_BUTTON_SUBMIT_Begin (Txt_View_all_recipients,"BT_LINK AUTHOR_TXT",NULL); - HTM_TxtF (Txt_and_X_other_recipients, - NumRecipientsKnown - NumRecipientsToShow); - HTM_BUTTON_End (); - Frm_EndForm (); - HTM_TD_End (); + HTM_TD_Begin ("colspan=\"3\" class=\"AUTHOR_TXT LM\""); + Frm_BeginForm (ActionSee[Messages->TypeOfMessages]); + Messages->MsgCod = MsgCod; // Message to be expanded with all recipients visible + Msg_PutHiddenParamsOneMsg (Messages); + Par_PutHiddenParamChar ("SeeAllRcpts",'Y'); + HTM_BUTTON_SUBMIT_Begin (Txt_View_all_recipients,"BT_LINK AUTHOR_TXT",NULL); + HTM_TxtF (Txt_and_X_other_recipients, + NumRecipientsKnown - NumRecipientsToShow); + HTM_BUTTON_End (); + Frm_EndForm (); + HTM_TD_End (); - HTM_TR_End (); - } + HTM_TR_End (); + } - /***** Free memory used for user's data *****/ - Usr_UsrDataDestructor (&UsrDat); + /***** Free memory used for user's data *****/ + Usr_UsrDataDestructor (&UsrDat); /***** End table *****/ HTM_TABLE_End (); @@ -3953,14 +3949,14 @@ void Msg_WriteMsgDate (time_t TimeUTC,const char *ClassBackground) if (asprintf (&Id,"msg_date_%u",UniqueId) < 0) Err_NotEnoughMemoryExit (); - /***** Start cell *****/ + /***** Begin cell *****/ HTM_TD_Begin ("id=\"%s\" class=\"%s RT\" style=\"width:106px;\"", Id,ClassBackground); - /***** Write date and time *****/ - Dat_WriteLocalDateHMSFromUTC (Id,TimeUTC, - Gbl.Prefs.DateFormat,Dat_SEPARATOR_COMMA, - true,true,false,0x6); + /***** Write date and time *****/ + Dat_WriteLocalDateHMSFromUTC (Id,TimeUTC, + Gbl.Prefs.DateFormat,Dat_SEPARATOR_COMMA, + true,true,false,0x6); /***** End cell *****/ HTM_TD_End (); @@ -4018,7 +4014,7 @@ static void Msg_PutFormToBanSender (struct Msg_Messages *Messages, Messages->CurrentPage); Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); Msg_PutHiddenParamsMsgsFilters (Messages); - Ico_PutIconLink ("unlock.svg",Txt_Sender_permitted_click_to_ban_him); + Ico_PutIconLink ("unlock.svg",Txt_Sender_permitted_click_to_ban_him); Frm_EndForm (); } @@ -4036,7 +4032,7 @@ static void Msg_PutFormToUnbanSender (struct Msg_Messages *Messages, Messages->CurrentPage); Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); Msg_PutHiddenParamsMsgsFilters (Messages); - Ico_PutIconLink ("lock.svg",Txt_Sender_banned_click_to_unban_him); + Ico_PutIconLink ("lock.svg",Txt_Sender_banned_click_to_unban_him); Frm_EndForm (); } @@ -4134,7 +4130,7 @@ static void Msg_UnbanSender (void) /**************** Chech if a user is banned by another user ******************/ /*****************************************************************************/ -bool Msg_CheckIfUsrIsBanned (long FromUsrCod,long ToUsrCod) +bool Msg_DB_CheckIfUsrIsBanned (long FromUsrCod,long ToUsrCod) { /***** Get if FromUsrCod is banned by ToUsrCod *****/ return (DB_QueryCOUNT ("can not check if a user is banned", diff --git a/swad_message.h b/swad_message.h index df8e1920..3c76adfe 100644 --- a/swad_message.h +++ b/swad_message.h @@ -101,7 +101,7 @@ void Msg_ExpSntMsg (void); void Msg_ExpRecMsg (void); void Msg_ConSntMsg (void); void Msg_ConRecMsg (void); -void Msg_SetReceivedMsgAsOpen (long MsgCod,long UsrCod); +void Msg_DB_SetReceivedMsgAsOpen (long MsgCod,long UsrCod); void Msg_DelAllRecAndSntMsgsUsr (long UsrCod); void Msg_MoveUnusedMsgsContentToDeleted (void); @@ -109,8 +109,8 @@ void Msg_MoveUnusedMsgsContentToDeleted (void); void Msg_ShowSntMsgs (void); void Msg_ShowRecMsgs (void); -unsigned Msg_GetNumMsgsSentByTchsCrs (long CrsCod); -unsigned Msg_GetNumMsgsSentByUsr (long UsrCod); +unsigned Msg_DB_GetNumMsgsSentByTchsCrs (long CrsCod); +unsigned Msg_DB_GetNumMsgsSentByUsr (long UsrCod); unsigned Msg_GetNumMsgsSent (HieLvl_Level_t Scope,Msg_Status_t MsgStatus); unsigned Msg_GetNumMsgsReceived (HieLvl_Level_t Scope,Msg_Status_t MsgStatus); @@ -128,7 +128,7 @@ void Msg_PutHiddenParamMsgCod (long MsgCod); void Msg_BanSenderWhenShowingMsgs (void); void Msg_UnbanSenderWhenShowingMsgs (void); void Msg_UnbanSenderWhenListingUsrs (void); -bool Msg_CheckIfUsrIsBanned (long FromUsrCod,long ToUsrCod); +bool Msg_DB_CheckIfUsrIsBanned (long FromUsrCod,long ToUsrCod); void Msg_DB_RemoveUsrFromBanned (long UsrCod); void Msg_ListBannedUsrs (void); diff --git a/swad_network.c b/swad_network.c index 05552493..ea495c9e 100644 --- a/swad_network.c +++ b/swad_network.c @@ -214,30 +214,30 @@ void Net_ShowWebsAndSocialNets (const struct UsrData *UsrDat) /***** Begin container *****/ HTM_DIV_Begin ("class=\"REC_WEBS\""); - /***** Show link to public profile *****/ - Net_ShowAWebOrSocialNet (Prf_GetURLPublicProfile (URL,UsrDat->Nickname), - "swad64x64.png",Cfg_PLATFORM_SHORT_NAME); + /***** Show link to public profile *****/ + Net_ShowAWebOrSocialNet (Prf_GetURLPublicProfile (URL,UsrDat->Nickname), + "swad64x64.png",Cfg_PLATFORM_SHORT_NAME); - /***** Show the rest of webs / social networks *****/ - for (NumURL = (Net_WebsAndSocialNetworks_t) 0; - NumURL <= (Net_WebsAndSocialNetworks_t) (Net_NUM_WEBS_AND_SOCIAL_NETWORKS - 1); - NumURL++) - { - /***** Check if exists the web / social network for this user *****/ - DB_QuerySELECTString (URL,sizeof (URL) - 1, - "can not get user's web / social network", - "SELECT URL" // row[0] - " FROM usr_webs" - " WHERE UsrCod=%ld" - " AND Web='%s'", - UsrDat->UsrCod, - Net_WebsAndSocialNetworksDB[NumURL]); - if (URL[0]) - /* Show the web / social network */ - Net_ShowAWebOrSocialNet (URL, - Net_WebsAndSocialNetworksIcons[NumURL], - Net_WebsAndSocialNetworksTitle[NumURL]); - } + /***** Show the rest of webs / social networks *****/ + for (NumURL = (Net_WebsAndSocialNetworks_t) 0; + NumURL <= (Net_WebsAndSocialNetworks_t) (Net_NUM_WEBS_AND_SOCIAL_NETWORKS - 1); + NumURL++) + { + /***** Check if exists the web / social network for this user *****/ + DB_QuerySELECTString (URL,sizeof (URL) - 1, + "can not get user's web / social network", + "SELECT URL" // row[0] + " FROM usr_webs" + " WHERE UsrCod=%ld" + " AND Web='%s'", + UsrDat->UsrCod, + Net_WebsAndSocialNetworksDB[NumURL]); + if (URL[0]) + /* Show the web / social network */ + Net_ShowAWebOrSocialNet (URL, + Net_WebsAndSocialNetworksIcons[NumURL], + Net_WebsAndSocialNetworksTitle[NumURL]); + } /***** End container *****/ HTM_DIV_End (); @@ -252,9 +252,9 @@ static void Net_ShowAWebOrSocialNet (const char *URL, { /***** Write link and icon *****/ HTM_DIV_Begin ("class=\"ICO_HIGHLIGHT\" style=\"display:inline;\""); - HTM_A_Begin ("href=\"%s\" target=\"_blank\" title=\"%s\"",URL,Title); - Ico_PutIcon (Icon,Title,"ICO16x16"); - HTM_A_End (); + HTM_A_Begin ("href=\"%s\" target=\"_blank\" title=\"%s\"",URL,Title); + Ico_PutIcon (Icon,Title,"ICO16x16"); + HTM_A_End (); HTM_DIV_End (); } @@ -276,65 +276,65 @@ void Net_ShowFormMyWebsAndSocialNets (void) /***** Begin section *****/ HTM_SECTION_Begin (Net_MY_WEBS_ID); - /***** Begin box *****/ - snprintf (StrRecordWidth,sizeof (StrRecordWidth),"%upx",Rec_RECORD_WIDTH); - Box_BoxBegin (StrRecordWidth,Txt_Webs_social_networks, - Net_PutIconsWebsSocialNetworks,NULL, - Hlp_PROFILE_Webs,Box_NOT_CLOSABLE); + /***** Begin box *****/ + snprintf (StrRecordWidth,sizeof (StrRecordWidth),"%upx",Rec_RECORD_WIDTH); + Box_BoxBegin (StrRecordWidth,Txt_Webs_social_networks, + Net_PutIconsWebsSocialNetworks,NULL, + Hlp_PROFILE_Webs,Box_NOT_CLOSABLE); - /***** Begin table *****/ - HTM_TABLE_BeginPadding (2); + /***** Begin form *****/ + Frm_BeginFormAnchor (ActChgMyNet,Net_MY_WEBS_ID); - /***** Begin form *****/ - Frm_StartFormAnchor (ActChgMyNet,Net_MY_WEBS_ID); + /***** Begin table *****/ + HTM_TABLE_BeginPadding (2); - /***** List webs and social networks *****/ - for (NumURL = (Net_WebsAndSocialNetworks_t) 0; - NumURL <= (Net_WebsAndSocialNetworks_t) (Net_NUM_WEBS_AND_SOCIAL_NETWORKS - 1); - NumURL++) - { - /***** Get user's web / social network from database *****/ - DB_QuerySELECTString (URL,sizeof (URL) - 1, - "can not get user's web / social network", - "SELECT URL" // row[0] - " FROM usr_webs" - " WHERE UsrCod=%ld" - " AND Web='%s'", - Gbl.Usrs.Me.UsrDat.UsrCod, - Net_WebsAndSocialNetworksDB[NumURL]); + /***** List webs and social networks *****/ + for (NumURL = (Net_WebsAndSocialNetworks_t) 0; + NumURL <= (Net_WebsAndSocialNetworks_t) (Net_NUM_WEBS_AND_SOCIAL_NETWORKS - 1); + NumURL++) + { + /***** Get user's web / social network from database *****/ + DB_QuerySELECTString (URL,sizeof (URL) - 1, + "can not get user's web / social network", + "SELECT URL" // row[0] + " FROM usr_webs" + " WHERE UsrCod=%ld" + " AND Web='%s'", + Gbl.Usrs.Me.UsrDat.UsrCod, + Net_WebsAndSocialNetworksDB[NumURL]); - /***** Row for this web / social network *****/ - snprintf (StrName,sizeof (StrName),"URL%u",(unsigned) NumURL); - HTM_TR_Begin (NULL); + /***** Row for this web / social network *****/ + snprintf (StrName,sizeof (StrName),"URL%u",(unsigned) NumURL); + HTM_TR_Begin (NULL); - HTM_TD_Begin ("class=\"REC_C1_BOT LM\""); - HTM_LABEL_Begin ("for=\"%s\" class=\"%s\"", - StrName,The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_IMG (Cfg_URL_ICON_PUBLIC,Net_WebsAndSocialNetworksIcons[NumURL],Net_WebsAndSocialNetworksTitle[NumURL], - "class=\"CONTEXT_ICO_16x16\" style=\"margin-right:6px;\""); - HTM_TxtColon (Net_WebsAndSocialNetworksTitle[NumURL]); - HTM_LABEL_End (); - HTM_TD_End (); + HTM_TD_Begin ("class=\"REC_C1_BOT LM\""); + HTM_LABEL_Begin ("for=\"%s\" class=\"%s\"", + StrName,The_ClassFormInBox[Gbl.Prefs.Theme]); + HTM_IMG (Cfg_URL_ICON_PUBLIC,Net_WebsAndSocialNetworksIcons[NumURL],Net_WebsAndSocialNetworksTitle[NumURL], + "class=\"CONTEXT_ICO_16x16\" style=\"margin-right:6px;\""); + HTM_TxtColon (Net_WebsAndSocialNetworksTitle[NumURL]); + HTM_LABEL_End (); + HTM_TD_End (); - HTM_TD_Begin ("class=\"REC_C2_BOT LM\""); - HTM_INPUT_URL (StrName,URL,HTM_DONT_SUBMIT_ON_CHANGE, - "id=\"%s\" class=\"REC_C2_BOT_INPUT\"",StrName); - HTM_TD_End (); + HTM_TD_Begin ("class=\"REC_C2_BOT LM\""); + HTM_INPUT_URL (StrName,URL,HTM_DONT_SUBMIT_ON_CHANGE, + "id=\"%s\" class=\"REC_C2_BOT_INPUT\"",StrName); + HTM_TD_End (); - HTM_TR_End (); - } + HTM_TR_End (); + } - /***** End table *****/ - HTM_TABLE_End (); + /***** End table *****/ + HTM_TABLE_End (); - /***** Confirm button *****/ - Btn_PutConfirmButton (Txt_Save_changes); + /***** Confirm button *****/ + Btn_PutConfirmButton (Txt_Save_changes); - /***** End form *****/ - Frm_EndForm (); + /***** End form *****/ + Frm_EndForm (); - /***** End box *****/ - Box_BoxEnd (); + /***** End box *****/ + Box_BoxEnd (); /***** End section *****/ HTM_SECTION_End (); @@ -545,57 +545,55 @@ void Net_ShowWebAndSocialNetworksStats (void) NULL,NULL, Hlp_ANALYTICS_Figures_webs_social_networks,Box_NOT_CLOSABLE,2); - /***** Write heading *****/ - HTM_TR_Begin (NULL); + /***** Write heading *****/ + HTM_TR_Begin (NULL); + HTM_TH (1,1,"LM",Txt_Web_social_network); + HTM_TH (1,1,"RM",Txt_Number_of_users); + HTM_TH (1,1,"RM",Txt_PERCENT_of_users); + HTM_TR_End (); - HTM_TH (1,1,"LM",Txt_Web_social_network); - HTM_TH (1,1,"RM",Txt_Number_of_users); - HTM_TH (1,1,"RM",Txt_PERCENT_of_users); - - HTM_TR_End (); - - /***** For each web / social network... *****/ - for (NumRow = 0; - NumRow < NumRows; - NumRow++) - { - /* Get row */ - row = mysql_fetch_row (mysql_res); - - /* Get web / social network (row[0]) */ - Str_Copy (NetName,row[0],sizeof (NetName) - 1); - for (Web = (Net_WebsAndSocialNetworks_t) 0; - Web <= (Net_WebsAndSocialNetworks_t) (Net_NUM_WEBS_AND_SOCIAL_NETWORKS - 1); - Web++) - if (!strcmp (Net_WebsAndSocialNetworksDB[Web],NetName)) - break; - if (Web < Net_NUM_WEBS_AND_SOCIAL_NETWORKS) + /***** For each web / social network... *****/ + for (NumRow = 0; + NumRow < NumRows; + NumRow++) { - /* Get number of users (row[1]) */ - if (sscanf (row[1],"%u",&NumUsrs) != 1) - Err_ShowErrorAndExit ("Error when getting number of files."); + /* Get row */ + row = mysql_fetch_row (mysql_res); - HTM_TR_Begin (NULL); + /* Get web / social network (row[0]) */ + Str_Copy (NetName,row[0],sizeof (NetName) - 1); + for (Web = (Net_WebsAndSocialNetworks_t) 0; + Web <= (Net_WebsAndSocialNetworks_t) (Net_NUM_WEBS_AND_SOCIAL_NETWORKS - 1); + Web++) + if (!strcmp (Net_WebsAndSocialNetworksDB[Web],NetName)) + break; + if (Web < Net_NUM_WEBS_AND_SOCIAL_NETWORKS) + { + /* Get number of users (row[1]) */ + if (sscanf (row[1],"%u",&NumUsrs) != 1) + Err_ShowErrorAndExit ("Error when getting number of files."); - HTM_TD_Begin ("class=\"DAT LM\""); - HTM_IMG (Cfg_URL_ICON_PUBLIC,Net_WebsAndSocialNetworksIcons[Web],Net_WebsAndSocialNetworksTitle[Web], - "class=\"CONTEXT_ICO_16x16\" style=\"margin-right:6px;\""); - HTM_Txt (Net_WebsAndSocialNetworksTitle[Web]); - HTM_TD_End (); + HTM_TR_Begin (NULL); - HTM_TD_Begin ("class=\"DAT RM\""); - HTM_Unsigned (NumUsrs); - HTM_TD_End (); + HTM_TD_Begin ("class=\"DAT LM\""); + HTM_IMG (Cfg_URL_ICON_PUBLIC,Net_WebsAndSocialNetworksIcons[Web],Net_WebsAndSocialNetworksTitle[Web], + "class=\"CONTEXT_ICO_16x16\" style=\"margin-right:6px;\""); + HTM_Txt (Net_WebsAndSocialNetworksTitle[Web]); + HTM_TD_End (); - HTM_TD_Begin ("class=\"DAT RM\""); - HTM_Percentage (NumUsrsTotal ? 100.0 * (double) NumUsrs / - (double) NumUsrsTotal : - 0.0); - HTM_TD_End (); + HTM_TD_Begin ("class=\"DAT RM\""); + HTM_Unsigned (NumUsrs); + HTM_TD_End (); - HTM_TR_End (); + HTM_TD_Begin ("class=\"DAT RM\""); + HTM_Percentage (NumUsrsTotal ? 100.0 * (double) NumUsrs / + (double) NumUsrsTotal : + 0.0); + HTM_TD_End (); + + HTM_TR_End (); + } } - } /***** End table and box *****/ Box_BoxTableEnd (); diff --git a/swad_nickname.c b/swad_nickname.c index 90de5b94..7f36b046 100644 --- a/swad_nickname.c +++ b/swad_nickname.c @@ -66,7 +66,7 @@ static void Nck_ShowFormChangeUsrNickname (bool ItsMe, static void Nck_PutParamsRemoveMyNick (void *Nick); static void Nck_PutParamsRemoveOtherNick (void *Nick); -static void Nck_RemoveNicknameFromDB (long UsrCod,const char *Nickname); +static void Nck_DB_RemoveNickname (long UsrCod,const char *Nickname); static void Nck_UpdateUsrNick (struct UsrData *UsrDat); @@ -112,8 +112,8 @@ bool Nck_CheckIfNickWithArrIsValid (const char *NickWithArr) /************* Get nickname of a user from his/her user's code ***************/ /*****************************************************************************/ -void Nck_GetNicknameFromUsrCod (long UsrCod, - char Nickname[Nck_MAX_BYTES_NICK_WITHOUT_ARROBA + 1]) +void Nck_DB_GetNicknameFromUsrCod (long UsrCod, + char Nickname[Nck_MAX_BYTES_NICK_WITHOUT_ARROBA + 1]) { /***** Get current (last updated) user's nickname from database *****/ DB_QuerySELECTString (Nickname,Nck_MAX_BYTES_NICK_WITHOUT_ARROBA, @@ -207,181 +207,181 @@ static void Nck_ShowFormChangeUsrNickname (bool ItsMe, /***** Begin section *****/ HTM_SECTION_Begin (Nck_NICKNAME_SECTION_ID); - /***** Get my nicknames *****/ - NumNicks = (unsigned) - DB_QuerySELECT (&mysql_res,"can not get nicknames of a user", - "SELECT Nickname" // row[0] - " FROM usr_nicknames" - " WHERE UsrCod=%ld" - " ORDER BY CreatTime DESC", - UsrDat->UsrCod); + /***** Get my nicknames *****/ + NumNicks = (unsigned) + DB_QuerySELECT (&mysql_res,"can not get nicknames of a user", + "SELECT Nickname" // row[0] + " FROM usr_nicknames" + " WHERE UsrCod=%ld" + " ORDER BY CreatTime DESC", + UsrDat->UsrCod); - /***** Begin box *****/ - snprintf (StrRecordWidth,sizeof (StrRecordWidth),"%upx",Rec_RECORD_WIDTH); - Box_BoxBegin (StrRecordWidth,Txt_Nickname, - Acc_PutLinkToRemoveMyAccount,NULL, - Hlp_PROFILE_Account,Box_NOT_CLOSABLE); + /***** Begin box *****/ + snprintf (StrRecordWidth,sizeof (StrRecordWidth),"%upx",Rec_RECORD_WIDTH); + Box_BoxBegin (StrRecordWidth,Txt_Nickname, + Acc_PutLinkToRemoveMyAccount,NULL, + Hlp_PROFILE_Account,Box_NOT_CLOSABLE); - /***** Show possible alerts *****/ - Ale_ShowAlerts (Nck_NICKNAME_SECTION_ID); + /***** Show possible alerts *****/ + Ale_ShowAlerts (Nck_NICKNAME_SECTION_ID); - /***** Help message *****/ - if (IMustFillNickname) - Ale_ShowAlert (Ale_WARNING,Txt_Before_going_to_any_other_option_you_must_fill_your_nickname); + /***** Help message *****/ + if (IMustFillNickname) + Ale_ShowAlert (Ale_WARNING,Txt_Before_going_to_any_other_option_you_must_fill_your_nickname); - /***** Begin table *****/ - HTM_TABLE_BeginWidePadding (2); + /***** Begin table *****/ + HTM_TABLE_BeginWidePadding (2); - /***** List nicknames *****/ - for (NumNick = 1; - NumNick <= NumNicks; - NumNick++) - { - /* Get nickname */ - row = mysql_fetch_row (mysql_res); - - if (NumNick == 1) - { - /* The first nickname is the current one */ - HTM_TR_Begin (NULL); - - /* Label */ - Frm_LabelColumn ("REC_C1_BOT RT",NULL,Txt_Current_nickname); - - /* Data */ - HTM_TD_Begin ("class=\"REC_C2_BOT LT USR_ID\""); - } - else // NumNick >= 2 - { - if (NumNick == 2) - { - HTM_TR_Begin (NULL); - - /* Label */ - Frm_LabelColumn ("REC_C1_BOT RT",NULL,Txt_Other_nicknames); - - /* Data */ - HTM_TD_Begin ("class=\"REC_C2_BOT LT DAT\""); - } - - /* Form to remove old nickname */ - if (ItsMe) - Ico_PutContextualIconToRemove (ActRemMyNck,Nck_NICKNAME_SECTION_ID, - Nck_PutParamsRemoveMyNick,row[0]); - else - { - switch (UsrDat->Roles.InCurrentCrs) + /***** List nicknames *****/ + for (NumNick = 1; + NumNick <= NumNicks; + NumNick++) { - case Rol_STD: - NextAction = ActRemOldNicStd; - break; - case Rol_NET: - case Rol_TCH: - NextAction = ActRemOldNicTch; - break; - default: // Guest, user or admin - NextAction = ActRemOldNicOth; - break; + /* Get nickname */ + row = mysql_fetch_row (mysql_res); + + if (NumNick == 1) + { + /* The first nickname is the current one */ + HTM_TR_Begin (NULL); + + /* Label */ + Frm_LabelColumn ("REC_C1_BOT RT",NULL,Txt_Current_nickname); + + /* Data */ + HTM_TD_Begin ("class=\"REC_C2_BOT LT USR_ID\""); + } + else // NumNick >= 2 + { + if (NumNick == 2) + { + HTM_TR_Begin (NULL); + + /* Label */ + Frm_LabelColumn ("REC_C1_BOT RT",NULL,Txt_Other_nicknames); + + /* Data */ + HTM_TD_Begin ("class=\"REC_C2_BOT LT DAT\""); + } + + /* Form to remove old nickname */ + if (ItsMe) + Ico_PutContextualIconToRemove (ActRemMyNck,Nck_NICKNAME_SECTION_ID, + Nck_PutParamsRemoveMyNick,row[0]); + else + { + switch (UsrDat->Roles.InCurrentCrs) + { + case Rol_STD: + NextAction = ActRemOldNicStd; + break; + case Rol_NET: + case Rol_TCH: + NextAction = ActRemOldNicTch; + break; + default: // Guest, user or admin + NextAction = ActRemOldNicOth; + break; + } + Ico_PutContextualIconToRemove (NextAction,Nck_NICKNAME_SECTION_ID, + Nck_PutParamsRemoveOtherNick,row[0]); + } + } + + /* Nickname */ + HTM_TxtF ("@%s",row[0]); + + /* Link to QR code */ + if (NumNick == 1 && UsrDat->Nickname[0]) + QR_PutLinkToPrintQRCode (ActPrnUsrQR, + Usr_PutParamMyUsrCodEncrypted,Gbl.Usrs.Me.UsrDat.EnUsrCod); + + /* Form to change the nickname */ + if (NumNick > 1) + { + HTM_BR (); + if (ItsMe) + Frm_BeginFormAnchor (ActChgMyNck,Nck_NICKNAME_SECTION_ID); + else + { + switch (UsrDat->Roles.InCurrentCrs) + { + case Rol_STD: + NextAction = ActChgNicStd; + break; + case Rol_NET: + case Rol_TCH: + NextAction = ActChgNicTch; + break; + default: // Guest, user or admin + NextAction = ActChgNicOth; + break; + } + Frm_BeginFormAnchor (NextAction,Nck_NICKNAME_SECTION_ID); + Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); + } + + snprintf (NickWithArr,sizeof (NickWithArr),"@%s",row[0]); + Par_PutHiddenParamString (NULL,"NewNick",NickWithArr); // Nickname + Btn_PutConfirmButtonInline (Txt_Use_this_nickname); + Frm_EndForm (); + } + + if (NumNick == 1 || + NumNick == NumNicks) + { + HTM_TD_End (); + HTM_TR_End (); + } + else + HTM_BR (); } - Ico_PutContextualIconToRemove (NextAction,Nck_NICKNAME_SECTION_ID, - Nck_PutParamsRemoveOtherNick,row[0]); - } - } - /* Nickname */ - HTM_TxtF ("@%s",row[0]); + /***** Form to enter new nickname *****/ + HTM_TR_Begin (NULL); - /* Link to QR code */ - if (NumNick == 1 && UsrDat->Nickname[0]) - QR_PutLinkToPrintQRCode (ActPrnUsrQR, - Usr_PutParamMyUsrCodEncrypted,Gbl.Usrs.Me.UsrDat.EnUsrCod); + /* Label */ + Frm_LabelColumn ("REC_C1_BOT RT","NewNick", + NumNicks ? Txt_New_nickname : // A new nickname + Txt_Nickname); // The first nickname - /* Form to change the nickname */ - if (NumNick > 1) - { - HTM_BR (); - if (ItsMe) - Frm_StartFormAnchor (ActChgMyNck,Nck_NICKNAME_SECTION_ID); - else - { - switch (UsrDat->Roles.InCurrentCrs) - { - case Rol_STD: - NextAction = ActChgNicStd; - break; - case Rol_NET: - case Rol_TCH: - NextAction = ActChgNicTch; - break; - default: // Guest, user or admin - NextAction = ActChgNicOth; - break; - } - Frm_StartFormAnchor (NextAction,Nck_NICKNAME_SECTION_ID); - Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); - } + /* Data */ + HTM_TD_Begin ("class=\"REC_C2_BOT LT DAT\""); + if (ItsMe) + Frm_BeginFormAnchor (ActChgMyNck,Nck_NICKNAME_SECTION_ID); + else + { + switch (UsrDat->Roles.InCurrentCrs) + { + case Rol_STD: + NextAction = ActChgNicStd; + break; + case Rol_NET: + case Rol_TCH: + NextAction = ActChgNicTch; + break; + default: // Guest, user or admin + NextAction = ActChgNicOth; + break; + } + Frm_BeginFormAnchor (NextAction,Nck_NICKNAME_SECTION_ID); + Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); + } + snprintf (NickWithArr,sizeof (NickWithArr),"@%s", + Gbl.Usrs.Me.UsrDat.Nickname); + HTM_INPUT_TEXT ("NewNick",1 + Nck_MAX_CHARS_NICK_WITHOUT_ARROBA, + NickWithArr,HTM_DONT_SUBMIT_ON_CHANGE, + "id=\"NewNick\" size=\"18\""); + HTM_BR (); + Btn_PutCreateButtonInline (NumNicks ? Txt_Change_nickname : // I already have a nickname + Txt_Save_changes); // I have no nickname yet); + Frm_EndForm (); + HTM_TD_End (); - snprintf (NickWithArr,sizeof (NickWithArr),"@%s",row[0]); - Par_PutHiddenParamString (NULL,"NewNick",NickWithArr); // Nickname - Btn_PutConfirmButtonInline (Txt_Use_this_nickname); - Frm_EndForm (); - } + HTM_TR_End (); - if (NumNick == 1 || - NumNick == NumNicks) - { - HTM_TD_End (); - HTM_TR_End (); - } - else - HTM_BR (); - } - - /***** Form to enter new nickname *****/ - HTM_TR_Begin (NULL); - - /* Label */ - Frm_LabelColumn ("REC_C1_BOT RT","NewNick", - NumNicks ? Txt_New_nickname : // A new nickname - Txt_Nickname); // The first nickname - - /* Data */ - HTM_TD_Begin ("class=\"REC_C2_BOT LT DAT\""); - if (ItsMe) - Frm_StartFormAnchor (ActChgMyNck,Nck_NICKNAME_SECTION_ID); - else - { - switch (UsrDat->Roles.InCurrentCrs) - { - case Rol_STD: - NextAction = ActChgNicStd; - break; - case Rol_NET: - case Rol_TCH: - NextAction = ActChgNicTch; - break; - default: // Guest, user or admin - NextAction = ActChgNicOth; - break; - } - Frm_StartFormAnchor (NextAction,Nck_NICKNAME_SECTION_ID); - Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); - } - snprintf (NickWithArr,sizeof (NickWithArr),"@%s", - Gbl.Usrs.Me.UsrDat.Nickname); - HTM_INPUT_TEXT ("NewNick",1 + Nck_MAX_CHARS_NICK_WITHOUT_ARROBA, - NickWithArr,HTM_DONT_SUBMIT_ON_CHANGE, - "id=\"NewNick\" size=\"18\""); - HTM_BR (); - Btn_PutCreateButtonInline (NumNicks ? Txt_Change_nickname : // I already have a nickname - Txt_Save_changes); // I have no nickname yet); - Frm_EndForm (); - HTM_TD_End (); - - HTM_TR_End (); - - /***** End table and box *****/ - Box_BoxTableEnd (); + /***** End table and box *****/ + Box_BoxTableEnd (); /***** End section *****/ HTM_SECTION_End (); @@ -419,7 +419,7 @@ void Nck_RemoveMyNick (void) if (strcasecmp (NickWithoutArr,Gbl.Usrs.Me.UsrDat.Nickname)) // Only if not my current nickname { /***** Remove one of my old nicknames *****/ - Nck_RemoveNicknameFromDB (Gbl.Usrs.Me.UsrDat.UsrCod,NickWithoutArr); + Nck_DB_RemoveNickname (Gbl.Usrs.Me.UsrDat.UsrCod,NickWithoutArr); /***** Show message *****/ Ale_CreateAlert (Ale_SUCCESS,Nck_NICKNAME_SECTION_ID, @@ -453,7 +453,7 @@ void Nck_RemoveOtherUsrNick (void) Nck_MAX_BYTES_NICK_WITHOUT_ARROBA); /***** Remove one of the old nicknames *****/ - Nck_RemoveNicknameFromDB (Gbl.Usrs.Other.UsrDat.UsrCod,NickWithoutArr); + Nck_DB_RemoveNickname (Gbl.Usrs.Other.UsrDat.UsrCod,NickWithoutArr); /***** Show message *****/ Ale_CreateAlert (Ale_SUCCESS,Nck_NICKNAME_SECTION_ID, @@ -474,7 +474,7 @@ void Nck_RemoveOtherUsrNick (void) /********************** Remove a nickname from database **********************/ /*****************************************************************************/ -static void Nck_RemoveNicknameFromDB (long UsrCod,const char *Nickname) +static void Nck_DB_RemoveNickname (long UsrCod,const char *Nickname) { /***** Remove a nickname *****/ DB_QueryREPLACE ("can not remove a nickname", @@ -587,7 +587,7 @@ static void Nck_UpdateUsrNick (struct UsrData *UsrDat) { // Now we know the new nickname is not already in database // and is diffent to the current one - Nck_UpdateNickInDB (UsrDat->UsrCod,NewNickWithoutArr); + Nck_DB_UpdateNick (UsrDat->UsrCod,NewNickWithoutArr); Str_Copy (UsrDat->Nickname,NewNickWithoutArr,sizeof (UsrDat->Nickname) - 1); Ale_CreateAlert (Ale_SUCCESS,Nck_NICKNAME_SECTION_ID, @@ -607,7 +607,7 @@ static void Nck_UpdateUsrNick (struct UsrData *UsrDat) /******************* Update user's nickname in database **********************/ /*****************************************************************************/ -void Nck_UpdateNickInDB (long UsrCod,const char *NewNickname) +void Nck_DB_UpdateNick (long UsrCod,const char *NewNickname) { /***** Update user's nickname in database *****/ DB_QueryREPLACE ("can not update nickname", diff --git a/swad_nickname.h b/swad_nickname.h index ccc7c497..9a99053e 100644 --- a/swad_nickname.h +++ b/swad_nickname.h @@ -48,8 +48,8 @@ bool Nck_CheckIfNickWithArrIsValid (const char *NickWithArr); -void Nck_GetNicknameFromUsrCod (long UsrCod, - char Nickname[Nck_MAX_BYTES_NICK_WITHOUT_ARROBA + 1]); +void Nck_DB_GetNicknameFromUsrCod (long UsrCod, + char Nickname[Nck_MAX_BYTES_NICK_WITHOUT_ARROBA + 1]); long Nck_GetUsrCodFromNickname (const char *Nickname); void Nck_ShowFormChangeMyNickname (bool IMustFillNickname); @@ -62,6 +62,6 @@ void Nck_DB_RemoveUsrNicknames (long UsrCod); void Nck_UpdateMyNick (void); void Nck_UpdateOtherUsrNick (void); -void Nck_UpdateNickInDB (long UsrCod,const char *NewNickname); +void Nck_DB_UpdateNick (long UsrCod,const char *NewNickname); #endif diff --git a/swad_notice.c b/swad_notice.c index 9d2677df..decfb22d 100644 --- a/swad_notice.c +++ b/swad_notice.c @@ -86,8 +86,9 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing, const char *Content, long UsrCod, Not_Status_t Status); -static long Not_InsertNoticeInDB (const char *Content); -static void Not_UpdateNumUsrsNotifiedByEMailAboutNotice (long NotCod,unsigned NumUsrsToBeNotifiedByEMail); +static long Not_DB_InsertNotice (const char *Content); +static void Not_DB_UpdateNumUsrsNotifiedByEMailAboutNotice (long NotCod, + unsigned NumUsrsToBeNotifiedByEMail); static void Not_PutParams (void *NotCod); static long Not_GetParamNotCod (void); @@ -109,18 +110,18 @@ void Not_ShowFormNotice (void) /***** Begin form *****/ Frm_BeginForm (ActRcvNot); - /***** Begin box *****/ - Box_BoxBegin (NULL,Txt_New_notice, - NULL,NULL, - Hlp_COMMUNICATION_Notices,Box_NOT_CLOSABLE); + /***** Begin box *****/ + Box_BoxBegin (NULL,Txt_New_notice, + NULL,NULL, + Hlp_COMMUNICATION_Notices,Box_NOT_CLOSABLE); - /***** Message body *****/ - HTM_TEXTAREA_Begin ("name=\"Content\" cols=\"30\" rows=\"10\"" - " autofocus=\"autofocus\" required=\"required\""); - HTM_TEXTAREA_End (); + /***** Message body *****/ + HTM_TEXTAREA_Begin ("name=\"Content\" cols=\"30\" rows=\"10\"" + " autofocus=\"autofocus\" required=\"required\""); + HTM_TEXTAREA_End (); - /***** Send button and end box *****/ - Box_BoxWithButtonEnd (Btn_CREATE_BUTTON,Txt_Create_notice); + /***** Send button and end box *****/ + Box_BoxWithButtonEnd (Btn_CREATE_BUTTON,Txt_Create_notice); /***** End form *****/ Frm_EndForm (); @@ -146,7 +147,7 @@ void Not_ReceiveNotice (void) Str_TO_RIGOROUS_HTML,true); /***** Create a new notice in database *****/ - NotCod = Not_InsertNoticeInDB (Content); + NotCod = Not_DB_InsertNotice (Content); /***** Update RSS of current course *****/ RSS_UpdateRSSFileForACrs (&Gbl.Hierarchy.Crs); @@ -156,7 +157,7 @@ void Not_ReceiveNotice (void) /***** Notify by email about the new notice *****/ if ((NumUsrsToBeNotifiedByEMail = Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_NOTICE,NotCod))) - Not_UpdateNumUsrsNotifiedByEMailAboutNotice (NotCod,NumUsrsToBeNotifiedByEMail); + Not_DB_UpdateNumUsrsNotifiedByEMailAboutNotice (NotCod,NumUsrsToBeNotifiedByEMail); /***** Create a new social note about the new notice *****/ Tml_Not_StoreAndPublishNote (TL_NOTE_NOTICE,NotCod); @@ -170,7 +171,7 @@ void Not_ReceiveNotice (void) /*****************************************************************************/ // Return the code of the new inserted notice -static long Not_InsertNoticeInDB (const char *Content) +static long Not_DB_InsertNotice (const char *Content) { /***** Insert notice in the database *****/ return @@ -189,7 +190,8 @@ static long Not_InsertNoticeInDB (const char *Content) /*********** Update number of users notified in table of notices *************/ /*****************************************************************************/ -static void Not_UpdateNumUsrsNotifiedByEMailAboutNotice (long NotCod,unsigned NumUsrsToBeNotifiedByEMail) +static void Not_DB_UpdateNumUsrsNotifiedByEMailAboutNotice (long NotCod, + unsigned NumUsrsToBeNotifiedByEMail) { /***** Update number of users notified *****/ DB_QueryUPDATE ("can not update the number of notifications of a notice", @@ -359,7 +361,7 @@ void Not_RemoveNotice (void) Gbl.Hierarchy.Crs.CrsCod); /***** Mark possible notifications as removed *****/ - Ntf_MarkNotifAsRemoved (Ntf_EVENT_NOTICE,NotCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_NOTICE,NotCod); /***** Mark possible social note as unavailable *****/ Tml_DB_MarkNoteAsUnavailable (TL_NOTE_NOTICE,NotCod); @@ -570,7 +572,7 @@ static void Not_PutButtonToAddNewNotice (void) extern const char *Txt_New_notice; Frm_BeginForm (ActWriNot); - Btn_PutConfirmButton (Txt_New_notice); + Btn_PutConfirmButton (Txt_New_notice); Frm_EndForm (); } @@ -687,89 +689,89 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing, HTM_DIV_Begin ("class=\"%s %s\"", ContainerClass[Status],ContainerWidthClass[TypeNoticesListing]); - /***** Write the date in the top part of the yellow note *****/ - /* Write symbol to indicate if notice is obsolete or active */ - if (TypeNoticesListing == Not_LIST_FULL_NOTICES) - if (Not_CheckIfICanEditNotices ()) + /***** Write the date in the top part of the yellow note *****/ + /* Write symbol to indicate if notice is obsolete or active */ + if (TypeNoticesListing == Not_LIST_FULL_NOTICES) + if (Not_CheckIfICanEditNotices ()) + { + /***** Put form to remove announcement *****/ + Ico_PutContextualIconToRemove (ActReqRemNot,NULL, + Not_PutParams,&NotCod); + + /***** Put form to change the status of the notice *****/ + switch (Status) + { + case Not_ACTIVE_NOTICE: + Ico_PutContextualIconToHide (ActHidNot,NULL, + Not_PutParams,&NotCod); + break; + case Not_OBSOLETE_NOTICE: + Ico_PutContextualIconToUnhide (ActRevNot,NULL, + Not_PutParams,&NotCod); + break; + } + Frm_EndForm (); + } + + /* Write the date */ + UniqueId++; + HTM_DIV_Begin ("class=\"%s\"",DateClass[Status]); + if (TypeNoticesListing == Not_LIST_BRIEF_NOTICES) + { + /* Form to view full notice */ + Frm_BeginFormAnchor (ActSeeOneNot,Anchor); + Not_PutHiddenParamNotCod (NotCod); + HTM_BUTTON_SUBMIT_Begin (Txt_See_full_notice,"BT_LINK RT",NULL); + } + if (asprintf (&Id,"not_date_%u",UniqueId) < 0) + Err_NotEnoughMemoryExit (); + HTM_SPAN_Begin ("id=\"%s\"",Id); + HTM_SPAN_End (); + if (TypeNoticesListing == Not_LIST_BRIEF_NOTICES) + { + HTM_BUTTON_End (); + Frm_EndForm (); + } + Dat_WriteLocalDateHMSFromUTC (Id,TimeUTC, + Gbl.Prefs.DateFormat,Dat_SEPARATOR_BREAK, + true,true,false,0x6); + free (Id); + HTM_DIV_End (); + + /***** Write the content of the notice *****/ + if (TypeNoticesListing == Not_LIST_BRIEF_NOTICES) { - /***** Put form to remove announcement *****/ - Ico_PutContextualIconToRemove (ActReqRemNot,NULL, - Not_PutParams,&NotCod); + HTM_DIV_Begin ("class=\"NOTICE_TEXT_BRIEF\""); + HTM_Txt (Content); + HTM_DIV_End (); - /***** Put form to change the status of the notice *****/ - switch (Status) - { - case Not_ACTIVE_NOTICE: - Ico_PutContextualIconToHide (ActHidNot,NULL, - Not_PutParams,&NotCod); - break; - case Not_OBSOLETE_NOTICE: - Ico_PutContextualIconToUnhide (ActRevNot,NULL, - Not_PutParams,&NotCod); - break; - } - Frm_EndForm (); - } + /* Put form to view full notice */ + HTM_DIV_Begin ("class=\"CM\""); + Lay_PutContextualLinkOnlyIcon (ActSeeOneNot,Anchor, + Not_PutParams,&NotCod, + "ellipsis-h.svg", + Txt_See_full_notice); + HTM_DIV_End (); + } + else + { + HTM_DIV_Begin ("class=\"%s\"",TextClass[Status]); + HTM_Txt (Content); + HTM_DIV_End (); + } - /* Write the date */ - UniqueId++; - HTM_DIV_Begin ("class=\"%s\"",DateClass[Status]); - if (TypeNoticesListing == Not_LIST_BRIEF_NOTICES) - { - /* Form to view full notice */ - Frm_StartFormAnchor (ActSeeOneNot,Anchor); - Not_PutHiddenParamNotCod (NotCod); - HTM_BUTTON_SUBMIT_Begin (Txt_See_full_notice,"BT_LINK RT",NULL); - } - if (asprintf (&Id,"not_date_%u",UniqueId) < 0) - Err_NotEnoughMemoryExit (); - HTM_SPAN_Begin ("id=\"%s\"",Id); - HTM_SPAN_End (); - if (TypeNoticesListing == Not_LIST_BRIEF_NOTICES) - { - HTM_BUTTON_End (); - Frm_EndForm (); - } - Dat_WriteLocalDateHMSFromUTC (Id,TimeUTC, - Gbl.Prefs.DateFormat,Dat_SEPARATOR_BREAK, - true,true,false,0x6); - free (Id); - HTM_DIV_End (); - - /***** Write the content of the notice *****/ - if (TypeNoticesListing == Not_LIST_BRIEF_NOTICES) - { - HTM_DIV_Begin ("class=\"NOTICE_TEXT_BRIEF\""); - HTM_Txt (Content); + /***** Write the author *****/ + HTM_DIV_Begin ("class=\"NOTICE_AUTHOR %s\"", // Limited width + AuthorClass[Status]); + Usr_UsrDataConstructor (&UsrDat); + UsrDat.UsrCod = UsrCod; + if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat, // Get author's data from database + Usr_DONT_GET_PREFS, + Usr_DONT_GET_ROLE_IN_CURRENT_CRS)) + Usr_WriteFirstNameBRSurnames (&UsrDat); + Usr_UsrDataDestructor (&UsrDat); HTM_DIV_End (); - /* Put form to view full notice */ - HTM_DIV_Begin ("class=\"CM\""); - Lay_PutContextualLinkOnlyIcon (ActSeeOneNot,Anchor, - Not_PutParams,&NotCod, - "ellipsis-h.svg", - Txt_See_full_notice); - HTM_DIV_End (); - } - else - { - HTM_DIV_Begin ("class=\"%s\"",TextClass[Status]); - HTM_Txt (Content); - HTM_DIV_End (); - } - - /***** Write the author *****/ - HTM_DIV_Begin ("class=\"NOTICE_AUTHOR %s\"", // Limited width - AuthorClass[Status]); - Usr_UsrDataConstructor (&UsrDat); - UsrDat.UsrCod = UsrCod; - if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat, // Get author's data from database - Usr_DONT_GET_PREFS, - Usr_DONT_GET_ROLE_IN_CURRENT_CRS)) - Usr_WriteFirstNameBRSurnames (&UsrDat); - Usr_UsrDataDestructor (&UsrDat); - HTM_DIV_End (); - /***** End yellow note *****/ HTM_DIV_End (); diff --git a/swad_notification.c b/swad_notification.c index edc691ca..57aeab10 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -280,7 +280,7 @@ static bool Ntf_StartFormGoToAction (Ntf_NotifyEvent_t NotifyEvent, const struct For_Forums *Forums); static void Ntf_PutHiddenParamNotifyEvent (Ntf_NotifyEvent_t NotifyEvent); -static void Ntf_UpdateMyLastAccessToNotifications (void); +static void Ntf_DB_UpdateMyLastAccessToNotifications (void); static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsigned *NumNotif,unsigned *NumMails); static void Ntf_GetNumNotifSent (long DegCod,long CrsCod, Ntf_NotifyEvent_t NotifyEvent, @@ -388,237 +388,237 @@ void Ntf_ShowMyNotifications (void) Ntf_PutIconsNotif,NULL, Hlp_START_Notifications,Box_NOT_CLOSABLE); - /***** List my notifications *****/ - if (NumNotifications) // Notifications found - { - /***** Initialize structure with user's data *****/ - Usr_UsrDataConstructor (&UsrDat); - - /***** Begin table *****/ - HTM_TABLE_BeginWideMarginPadding (2); - HTM_TR_Begin (NULL); - - HTM_TH (1,2,"LM",Txt_Event); - HTM_TH (1,1,"LM",Txt_MSG_From); - HTM_TH (1,1,"LM",Txt_Location); - HTM_TH (1,1,"CM",Txt_Date); - HTM_TH (1,1,"LM",Txt_Email); - - HTM_TR_End (); - - /***** List notifications one by one *****/ - for (NumNotif = 0; - NumNotif < NumNotifications; - NumNotif++) + /***** List my notifications *****/ + if (NumNotifications) // Notifications found { - /***** Get next notification *****/ - row = mysql_fetch_row (mysql_res); + /***** Initialize structure with user's data *****/ + Usr_UsrDataConstructor (&UsrDat); - /* Get event type (row[0]) */ - NotifyEvent = Ntf_GetNotifyEventFromStr (row[0]); + /***** Begin table *****/ + HTM_TABLE_BeginWideMarginPadding (2); - /* Get (from) user code (row[1]) */ - UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[1]); - Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat, // Get user's data from database - Usr_DONT_GET_PREFS, - Usr_DONT_GET_ROLE_IN_CURRENT_CRS); + /***** Heading *****/ + HTM_TR_Begin (NULL); + HTM_TH (1,2,"LM",Txt_Event); + HTM_TH (1,1,"LM",Txt_MSG_From); + HTM_TH (1,1,"LM",Txt_Location); + HTM_TH (1,1,"CM",Txt_Date); + HTM_TH (1,1,"LM",Txt_Email); + HTM_TR_End (); - /* Get institution code (row[2]) */ - Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[2]); - Ins_GetDataOfInstitutionByCod (&Hie.Ins); + /***** List notifications one by one *****/ + for (NumNotif = 0; + NumNotif < NumNotifications; + NumNotif++) + { + /***** Get next notification *****/ + row = mysql_fetch_row (mysql_res); - /* Get center code (row[3]) */ - Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[3]); - Ctr_GetDataOfCenterByCod (&Hie.Ctr); + /* Get event type (row[0]) */ + NotifyEvent = Ntf_GetNotifyEventFromStr (row[0]); - /* Get degree code (row[4]) */ - Hie.Deg.DegCod = Str_ConvertStrCodToLongCod (row[4]); - Deg_GetDataOfDegreeByCod (&Hie.Deg); + /* Get (from) user code (row[1]) */ + UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[1]); + Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat, // Get user's data from database + Usr_DONT_GET_PREFS, + Usr_DONT_GET_ROLE_IN_CURRENT_CRS); - /* Get course code (row[5]) */ - Hie.Crs.CrsCod = Str_ConvertStrCodToLongCod (row[5]); - Crs_GetDataOfCourseByCod (&Hie.Crs); + /* Get institution code (row[2]) */ + Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[2]); + Ins_GetDataOfInstitutionByCod (&Hie.Ins); - /* Get message/post/... code (row[6]) */ - Cod = Str_ConvertStrCodToLongCod (row[6]); + /* Get center code (row[3]) */ + Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[3]); + Ctr_GetDataOfCenterByCod (&Hie.Ctr); - /* Get forum type of the post */ - if (NotifyEvent == Ntf_EVENT_FORUM_POST_COURSE || - NotifyEvent == Ntf_EVENT_FORUM_REPLY) - { - For_ResetForums (&Forums); - For_GetForumTypeAndLocationOfAPost (Cod,&Forums.Forum); - For_SetForumName (&Forums.Forum, - ForumName,Gbl.Prefs.Language,false); // Set forum name in recipient's language - } + /* Get degree code (row[4]) */ + Hie.Deg.DegCod = Str_ConvertStrCodToLongCod (row[4]); + Deg_GetDataOfDegreeByCod (&Hie.Deg); - /* Get time of the event (row[7]) */ - DateTimeUTC = Dat_GetUNIXTimeFromStr (row[7]); + /* Get course code (row[5]) */ + Hie.Crs.CrsCod = Str_ConvertStrCodToLongCod (row[5]); + Crs_GetDataOfCourseByCod (&Hie.Crs); - /* Get status (row[8]) */ - if (sscanf (row[8],"%u",&Status) != 1) - Err_WrongStatusExit (); - StatusTxt = Ntf_GetStatusTxtFromStatusBits (Status); + /* Get message/post/... code (row[6]) */ + Cod = Str_ConvertStrCodToLongCod (row[6]); - if (Status & Ntf_STATUS_BIT_REMOVED) // The source of the notification was removed - { - ClassBackground = "MSG_TIT_BG_REM"; - ClassText = "MSG_TIT_REM"; - ClassLink = "BT_LINK MSG_TIT_REM"; - ClassAuthorBg = "MSG_AUT_BG_REM"; - PutLink = false; - } - else if (Status & Ntf_STATUS_BIT_READ) // I have already seen the source of the notification - { - ClassBackground = "MSG_TIT_BG"; - ClassText = "MSG_TIT"; - ClassLink = "BT_LINK LT MSG_TIT"; - ClassAuthorBg = "MSG_AUT_BG"; - PutLink = true; - } - else // I have not seen the source of the notification - { - ClassBackground = "MSG_TIT_BG_NEW"; - ClassText = "MSG_TIT_NEW"; - ClassLink = "BT_LINK LT MSG_TIT_NEW"; - ClassAuthorBg = "MSG_AUT_BG_NEW"; - PutLink = true; - } + /* Get forum type of the post */ + if (NotifyEvent == Ntf_EVENT_FORUM_POST_COURSE || + NotifyEvent == Ntf_EVENT_FORUM_REPLY) + { + For_ResetForums (&Forums); + For_GetForumTypeAndLocationOfAPost (Cod,&Forums.Forum); + For_SetForumName (&Forums.Forum, + ForumName,Gbl.Prefs.Language,false); // Set forum name in recipient's language + } - /***** Write row for this notification *****/ - /* Write event icon */ - HTM_TR_Begin (NULL); + /* Get time of the event (row[7]) */ + DateTimeUTC = Dat_GetUNIXTimeFromStr (row[7]); - HTM_TD_Begin ("class=\"%s LT\" style=\"width:25px;\"",ClassBackground); - if (PutLink) - PutLink = Ntf_StartFormGoToAction (NotifyEvent,Hie.Crs.CrsCod,&UsrDat,Cod,&Forums); + /* Get status (row[8]) */ + if (sscanf (row[8],"%u",&Status) != 1) + Err_WrongStatusExit (); + StatusTxt = Ntf_GetStatusTxtFromStatusBits (Status); - if (PutLink) - { - Ico_PutIconLink (Ntf_Icons[NotifyEvent], - Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent]); - Frm_EndForm (); - } - else - Ico_PutIconOff (Ntf_Icons[NotifyEvent], - Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent]); - HTM_TD_End (); + if (Status & Ntf_STATUS_BIT_REMOVED) // The source of the notification was removed + { + ClassBackground = "MSG_TIT_BG_REM"; + ClassText = "MSG_TIT_REM"; + ClassLink = "BT_LINK MSG_TIT_REM"; + ClassAuthorBg = "MSG_AUT_BG_REM"; + PutLink = false; + } + else if (Status & Ntf_STATUS_BIT_READ) // I have already seen the source of the notification + { + ClassBackground = "MSG_TIT_BG"; + ClassText = "MSG_TIT"; + ClassLink = "BT_LINK LT MSG_TIT"; + ClassAuthorBg = "MSG_AUT_BG"; + PutLink = true; + } + else // I have not seen the source of the notification + { + ClassBackground = "MSG_TIT_BG_NEW"; + ClassText = "MSG_TIT_NEW"; + ClassLink = "BT_LINK LT MSG_TIT_NEW"; + ClassAuthorBg = "MSG_AUT_BG_NEW"; + PutLink = true; + } - /* Write event type */ - HTM_TD_Begin ("class=\"%s LT\"",ClassBackground); - if (PutLink) - { - PutLink = Ntf_StartFormGoToAction (NotifyEvent,Hie.Crs.CrsCod,&UsrDat,Cod,&Forums); - HTM_BUTTON_SUBMIT_Begin (Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent],ClassLink,NULL); - HTM_Txt (Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent]); - HTM_BUTTON_End (); - Frm_EndForm (); - } - else - { - HTM_SPAN_Begin ("class=\"%s\"",ClassText); - HTM_Txt (Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent]); - HTM_SPAN_End (); - } - HTM_TD_End (); + /***** Write row for this notification *****/ + /* Write event icon */ + HTM_TR_Begin (NULL); - /* Write user (from) */ - HTM_TD_Begin ("class=\"%s LT\"",ClassAuthorBg); - Msg_WriteMsgAuthor (&UsrDat,true,NULL); - HTM_TD_End (); + HTM_TD_Begin ("class=\"%s LT\" style=\"width:25px;\"",ClassBackground); + if (PutLink) + PutLink = Ntf_StartFormGoToAction (NotifyEvent,Hie.Crs.CrsCod,&UsrDat,Cod,&Forums); - /* Write location */ - HTM_TD_Begin ("class=\"%s LT\"",ClassBackground); - if (NotifyEvent == Ntf_EVENT_FORUM_POST_COURSE || - NotifyEvent == Ntf_EVENT_FORUM_REPLY) - { - if (PutLink) - PutLink = Ntf_StartFormGoToAction (NotifyEvent,Hie.Crs.CrsCod,&UsrDat,Cod,&Forums); + if (PutLink) + { + Ico_PutIconLink (Ntf_Icons[NotifyEvent], + Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent]); + Frm_EndForm (); + } + else + Ico_PutIconOff (Ntf_Icons[NotifyEvent], + Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent]); + HTM_TD_End (); - if (PutLink) - HTM_BUTTON_SUBMIT_Begin (Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent],ClassLink,NULL); - else - HTM_SPAN_Begin ("class=\"%s\"",ClassText); - HTM_TxtF ("%s: %s",Txt_Forum,ForumName); - if (PutLink) - { - HTM_BUTTON_End (); - Frm_EndForm (); - } - else - HTM_SPAN_End (); - } - else - { - if (PutLink) - PutLink = Ntf_StartFormGoToAction (NotifyEvent,Hie.Crs.CrsCod,&UsrDat,Cod,&Forums); + /* Write event type */ + HTM_TD_Begin ("class=\"%s LT\"",ClassBackground); + if (PutLink) + { + PutLink = Ntf_StartFormGoToAction (NotifyEvent,Hie.Crs.CrsCod,&UsrDat,Cod,&Forums); + HTM_BUTTON_SUBMIT_Begin (Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent],ClassLink,NULL); + HTM_Txt (Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent]); + HTM_BUTTON_End (); + Frm_EndForm (); + } + else + { + HTM_SPAN_Begin ("class=\"%s\"",ClassText); + HTM_Txt (Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent]); + HTM_SPAN_End (); + } + HTM_TD_End (); - if (PutLink) - HTM_BUTTON_SUBMIT_Begin (Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent],ClassLink,NULL); - else - HTM_SPAN_Begin ("class=\"%s\"",ClassText); + /* Write user (from) */ + HTM_TD_Begin ("class=\"%s LT\"",ClassAuthorBg); + Msg_WriteMsgAuthor (&UsrDat,true,NULL); + HTM_TD_End (); - if (Hie.Crs.CrsCod > 0) - HTM_TxtF ("%s: %s",Txt_Course,Hie.Crs.ShrtName); - else if (Hie.Deg.DegCod > 0) - HTM_TxtF ("%s: %s",Txt_Degree,Hie.Deg.ShrtName); - else if (Hie.Ctr.CtrCod > 0) - HTM_TxtF ("%s: %s",Txt_Center,Hie.Ctr.ShrtName); - else if (Hie.Ins.InsCod > 0) - HTM_TxtF ("%s: %s",Txt_Institution,Hie.Ins.ShrtName); - else - HTM_Hyphen (); + /* Write location */ + HTM_TD_Begin ("class=\"%s LT\"",ClassBackground); + if (NotifyEvent == Ntf_EVENT_FORUM_POST_COURSE || + NotifyEvent == Ntf_EVENT_FORUM_REPLY) + { + if (PutLink) + PutLink = Ntf_StartFormGoToAction (NotifyEvent,Hie.Crs.CrsCod,&UsrDat,Cod,&Forums); - if (PutLink) - { - HTM_BUTTON_End (); - Frm_EndForm (); - } - else - HTM_SPAN_End (); - } - HTM_TD_End (); + if (PutLink) + HTM_BUTTON_SUBMIT_Begin (Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent],ClassLink,NULL); + else + HTM_SPAN_Begin ("class=\"%s\"",ClassText); + HTM_TxtF ("%s: %s",Txt_Forum,ForumName); + if (PutLink) + { + HTM_BUTTON_End (); + Frm_EndForm (); + } + else + HTM_SPAN_End (); + } + else + { + if (PutLink) + PutLink = Ntf_StartFormGoToAction (NotifyEvent,Hie.Crs.CrsCod,&UsrDat,Cod,&Forums); - /* Write date and time */ - Msg_WriteMsgDate (DateTimeUTC,ClassBackground); + if (PutLink) + HTM_BUTTON_SUBMIT_Begin (Txt_NOTIFY_EVENTS_SINGULAR[NotifyEvent],ClassLink,NULL); + else + HTM_SPAN_Begin ("class=\"%s\"",ClassText); - /* Write status (sent by email / pending to be sent by email) */ - HTM_TD_Begin ("class=\"%s LT\"",ClassBackground); - HTM_Txt (Txt_NOTIFICATION_STATUS[StatusTxt]); - HTM_TD_End (); + if (Hie.Crs.CrsCod > 0) + HTM_TxtF ("%s: %s",Txt_Course,Hie.Crs.ShrtName); + else if (Hie.Deg.DegCod > 0) + HTM_TxtF ("%s: %s",Txt_Degree,Hie.Deg.ShrtName); + else if (Hie.Ctr.CtrCod > 0) + HTM_TxtF ("%s: %s",Txt_Center,Hie.Ctr.ShrtName); + else if (Hie.Ins.InsCod > 0) + HTM_TxtF ("%s: %s",Txt_Institution,Hie.Ins.ShrtName); + else + HTM_Hyphen (); - HTM_TR_End (); + if (PutLink) + { + HTM_BUTTON_End (); + Frm_EndForm (); + } + else + HTM_SPAN_End (); + } + HTM_TD_End (); - /***** Write content of the event *****/ - if (PutLink) - { - ContentStr = NULL; + /* Write date and time */ + Msg_WriteMsgDate (DateTimeUTC,ClassBackground); - Ntf_GetNotifSummaryAndContent (SummaryStr,&ContentStr,NotifyEvent, - Cod,Hie.Crs.CrsCod,Gbl.Usrs.Me.UsrDat.UsrCod, - false); - HTM_TR_Begin (NULL); + /* Write status (sent by email / pending to be sent by email) */ + HTM_TD_Begin ("class=\"%s LT\"",ClassBackground); + HTM_Txt (Txt_NOTIFICATION_STATUS[StatusTxt]); + HTM_TD_End (); - HTM_TD_Begin ("colspan=\"2\""); - HTM_TD_End (); + HTM_TR_End (); - HTM_TD_Begin ("colspan=\"4\" class=\"DAT LT\" style=\"padding-bottom:12px;\""); - HTM_Txt (SummaryStr); - HTM_TD_End (); + /***** Write content of the event *****/ + if (PutLink) + { + ContentStr = NULL; - HTM_TR_End (); - } - } + Ntf_GetNotifSummaryAndContent (SummaryStr,&ContentStr,NotifyEvent, + Cod,Hie.Crs.CrsCod,Gbl.Usrs.Me.UsrDat.UsrCod, + false); + HTM_TR_Begin (NULL); - /***** End table *****/ - HTM_TABLE_End (); + HTM_TD_Begin ("colspan=\"2\""); + HTM_TD_End (); - /***** Free memory used for user's data *****/ - Usr_UsrDataDestructor (&UsrDat); - } - else - Ale_ShowAlert (Ale_INFO,AllNotifications ? Txt_You_have_no_notifications : - Txt_You_have_no_unread_notifications); + HTM_TD_Begin ("colspan=\"4\" class=\"DAT LT\" style=\"padding-bottom:12px;\""); + HTM_Txt (SummaryStr); + HTM_TD_End (); + + HTM_TR_End (); + } + } + + /***** End table *****/ + HTM_TABLE_End (); + + /***** Free memory used for user's data *****/ + Usr_UsrDataDestructor (&UsrDat); + } + else + Ale_ShowAlert (Ale_INFO,AllNotifications ? Txt_You_have_no_notifications : + Txt_You_have_no_unread_notifications); /***** End box *****/ Box_BoxEnd (); @@ -627,7 +627,7 @@ void Ntf_ShowMyNotifications (void) DB_FreeMySQLResult (&mysql_res); /***** Reset to 0 the number of new notifications *****/ - Ntf_UpdateMyLastAccessToNotifications (); + Ntf_DB_UpdateMyLastAccessToNotifications (); } /*****************************************************************************/ @@ -905,7 +905,7 @@ void Ntf_GetNotifSummaryAndContent (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], Msg_GetNotifMessage (SummaryStr,ContentStr,Cod,GetContent); if (Gbl.WebService.IsWebService) /* Set the message as open by me, because I can read it in an extern application */ - Msg_SetReceivedMsgAsOpen (Cod,UsrCod); + Msg_DB_SetReceivedMsgAsOpen (Cod,UsrCod); break; case Ntf_EVENT_SURVEY: Svy_GetNotifSurvey (SummaryStr,ContentStr,Cod,GetContent); @@ -963,7 +963,7 @@ void Ntf_MarkNotifAsSeen (Ntf_NotifyEvent_t NotifyEvent,long Cod,long CrsCod,lon /******************* Set possible notifications as removed *******************/ /*****************************************************************************/ -void Ntf_MarkNotifAsRemoved (Ntf_NotifyEvent_t NotifyEvent,long Cod) +void Ntf_DB_MarkNotifAsRemoved (Ntf_NotifyEvent_t NotifyEvent,long Cod) { /***** Set notification as removed *****/ DB_QueryUPDATE ("can not set notification(s) as removed", @@ -1089,7 +1089,7 @@ void Ntf_MarkNotifOneFileAsRemoved (const char *Path) default: return; } - Ntf_MarkNotifAsRemoved (NotifyEvent,FilCod); + Ntf_DB_MarkNotifAsRemoved (NotifyEvent,FilCod); } break; default: @@ -1164,7 +1164,7 @@ void Ntf_MarkNotifChildrenOfFolderAsRemoved (const char *Path) /******* Set all possible notifications of files in a group as removed *******/ /*****************************************************************************/ -void Ntf_MarkNotifFilesInGroupAsRemoved (long GrpCod) +void Ntf_DB_MarkNotifFilesInGroupAsRemoved (long GrpCod) { /***** Set notifications as removed *****/ DB_QueryUPDATE ("can not set notification(s) as removed", @@ -1513,14 +1513,14 @@ unsigned Ntf_StoreNotifyEventsToAllUsrs (Ntf_NotifyEvent_t NotifyEvent,long Cod) { if ((UsrDat.NtfEvents.SendEmail & NotifyEventMask)) // Send notification by email { - Ntf_StoreNotifyEventToOneUser (NotifyEvent,&UsrDat,Cod, + Ntf_DB_StoreNotifyEventToOneUser (NotifyEvent,&UsrDat,Cod, (Ntf_Status_t) Ntf_STATUS_BIT_EMAIL, InsCod,CtrCod,DegCod,CrsCod); NumUsrsToBeNotifiedByEMail++; } else // Don't send notification by email - Ntf_StoreNotifyEventToOneUser (NotifyEvent,&UsrDat,Cod,(Ntf_Status_t) 0, - InsCod,CtrCod,DegCod,CrsCod); + Ntf_DB_StoreNotifyEventToOneUser (NotifyEvent,&UsrDat,Cod,(Ntf_Status_t) 0, + InsCod,CtrCod,DegCod,CrsCod); } } @@ -1538,10 +1538,10 @@ unsigned Ntf_StoreNotifyEventsToAllUsrs (Ntf_NotifyEvent_t NotifyEvent,long Cod) /************** Store a notify event to one user into database ***************/ /*****************************************************************************/ -void Ntf_StoreNotifyEventToOneUser (Ntf_NotifyEvent_t NotifyEvent, - struct UsrData *UsrDat, - long Cod,Ntf_Status_t Status, - long InsCod,long CtrCod,long DegCod,long CrsCod) +void Ntf_DB_StoreNotifyEventToOneUser (Ntf_NotifyEvent_t NotifyEvent, + struct UsrData *UsrDat, + long Cod,Ntf_Status_t Status, + long InsCod,long CtrCod,long DegCod,long CrsCod) { /***** Store notify event *****/ DB_QueryINSERT ("can not create new notification event", @@ -1566,7 +1566,7 @@ void Ntf_StoreNotifyEventToOneUser (Ntf_NotifyEvent_t NotifyEvent, /*************** Reset my number of new notifications to 0 *******************/ /*****************************************************************************/ -static void Ntf_UpdateMyLastAccessToNotifications (void) +static void Ntf_DB_UpdateMyLastAccessToNotifications (void) { /***** Reset to 0 my number of new notifications *****/ DB_QueryUPDATE ("can not update last access to notifications", @@ -2004,70 +2004,68 @@ void Ntf_PutFormChangeNotifSentByEMail (void) /***** Begin section with settings on privacy *****/ HTM_SECTION_Begin (Ntf_NOTIFICATIONS_ID); - /***** Begin box *****/ - Box_BoxBegin (NULL,Txt_Notifications, - Ntf_PutIconsNotif,NULL, - Hlp_PROFILE_Settings_notifications,Box_NOT_CLOSABLE); + /***** Begin box *****/ + Box_BoxBegin (NULL,Txt_Notifications, + Ntf_PutIconsNotif,NULL, + Hlp_PROFILE_Settings_notifications,Box_NOT_CLOSABLE); - /***** Begin form *****/ - Frm_BeginForm (ActChgNtfPrf); + /***** Begin form *****/ + Frm_BeginForm (ActChgNtfPrf); - /***** Warning if I can not receive email notifications *****/ - if (!Mai_CheckIfUsrCanReceiveEmailNotif (&Gbl.Usrs.Me.UsrDat)) - Mai_WriteWarningEmailNotifications (); + /***** Warning if I can not receive email notifications *****/ + if (!Mai_CheckIfUsrCanReceiveEmailNotif (&Gbl.Usrs.Me.UsrDat)) + Mai_WriteWarningEmailNotifications (); - /***** List of notifications *****/ - HTM_TABLE_BeginCenterPadding (2); - HTM_TR_Begin (NULL); + /***** List of notifications *****/ + HTM_TABLE_BeginCenterPadding (2); - HTM_TH_Empty (1); + HTM_TR_Begin (NULL); + HTM_TH_Empty (1); + HTM_TH (1,1,"CM",Txt_Create_BR_notification); + HTM_TH (1,1,"CM",Txt_Notify_me_BR_by_email); + HTM_TR_End (); - HTM_TH (1,1,"CM",Txt_Create_BR_notification); - HTM_TH (1,1,"CM",Txt_Notify_me_BR_by_email); + /***** Checkbox to activate internal notifications and email notifications + about events *****/ + for (NotifyEvent = (Ntf_NotifyEvent_t) 1; + NotifyEvent <= (Ntf_NotifyEvent_t) (Ntf_NUM_NOTIFY_EVENTS - 1); + NotifyEvent++) // O is reserved for Ntf_EVENT_UNKNOWN + { + HTM_TR_Begin (NULL); - HTM_TR_End (); + HTM_TD_Begin ("class=\"%s RM\"",The_ClassFormInBox[Gbl.Prefs.Theme]); + HTM_TxtColon (Txt_NOTIFY_EVENTS_PLURAL[NotifyEvent]); + HTM_TD_End (); - /***** Checkbox to activate internal notifications and email notifications - about events *****/ - for (NotifyEvent = (Ntf_NotifyEvent_t) 1; - NotifyEvent <= (Ntf_NotifyEvent_t) (Ntf_NUM_NOTIFY_EVENTS - 1); - NotifyEvent++) // O is reserved for Ntf_EVENT_UNKNOWN - { - HTM_TR_Begin (NULL); + HTM_TD_Begin ("class=\"CM\""); + HTM_INPUT_CHECKBOX (Ntf_ParamNotifMeAboutNotifyEvents[NotifyEvent],HTM_DONT_SUBMIT_ON_CHANGE, + "value=\"Y\"%s", + (Gbl.Usrs.Me.UsrDat.NtfEvents.CreateNotif & + (1 << NotifyEvent)) ? " checked=\"checked\"" : + ""); + HTM_TD_End (); - HTM_TD_Begin ("class=\"%s RM\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_TxtColon (Txt_NOTIFY_EVENTS_PLURAL[NotifyEvent]); - HTM_TD_End (); + HTM_TD_Begin ("class=\"CM\""); + HTM_INPUT_CHECKBOX (Ntf_ParamEmailMeAboutNotifyEvents[NotifyEvent],HTM_DONT_SUBMIT_ON_CHANGE, + "value=\"Y\"%s", + (Gbl.Usrs.Me.UsrDat.NtfEvents.SendEmail & + (1 << NotifyEvent)) ? " checked=\"checked\"" : + ""); + HTM_TD_End (); - HTM_TD_Begin ("class=\"CM\""); - HTM_INPUT_CHECKBOX (Ntf_ParamNotifMeAboutNotifyEvents[NotifyEvent],HTM_DONT_SUBMIT_ON_CHANGE, - "value=\"Y\"%s", - (Gbl.Usrs.Me.UsrDat.NtfEvents.CreateNotif & - (1 << NotifyEvent)) ? " checked=\"checked\"" : - ""); - HTM_TD_End (); + HTM_TR_End (); + } - HTM_TD_Begin ("class=\"CM\""); - HTM_INPUT_CHECKBOX (Ntf_ParamEmailMeAboutNotifyEvents[NotifyEvent],HTM_DONT_SUBMIT_ON_CHANGE, - "value=\"Y\"%s", - (Gbl.Usrs.Me.UsrDat.NtfEvents.SendEmail & - (1 << NotifyEvent)) ? " checked=\"checked\"" : - ""); - HTM_TD_End (); + HTM_TABLE_End (); - HTM_TR_End (); - } + /***** Button to save changes *****/ + Btn_PutConfirmButton (Txt_Save_changes); - HTM_TABLE_End (); + /***** End form *****/ + Frm_EndForm (); - /***** Button to save changes *****/ - Btn_PutConfirmButton (Txt_Save_changes); - - /***** End form *****/ - Frm_EndForm (); - - /***** End box *****/ - Box_BoxEnd (); + /***** End box *****/ + Box_BoxEnd (); /***** End section with settings about notifications *****/ HTM_SECTION_End (); @@ -2147,30 +2145,34 @@ void Ntf_WriteNumberOfNewNtfs (void) /***** Begin form *****/ Frm_BeginFormId (ActSeeNewNtf,"form_ntf"); - HTM_BUTTON_SUBMIT_Begin (Txt_See_notifications,The_ClassNotif[Gbl.Prefs.Theme],NULL); - /***** Number of unseen notifications *****/ - HTM_SPAN_Begin ("id=\"notif_all\""); - HTM_TxtF ("%u %s",NumUnseenNtfs, - NumUnseenNtfs == 1 ? Txt_notification : - Txt_notifications); - HTM_SPAN_End (); + /***** Begin link *****/ + HTM_BUTTON_SUBMIT_Begin (Txt_See_notifications,The_ClassNotif[Gbl.Prefs.Theme],NULL); - /***** Icon and number of new notifications *****/ - if (NumNewNtfs) - { - HTM_BR (); - HTM_IMG (Gbl.Prefs.URLTheme,"bell.svg",Txt_Notifications, - "class=\"ICO16x16\""); - HTM_TxtF (" %u",NumNewNtfs); - HTM_SPAN_Begin ("id=\"notif_new\""); - HTM_TxtF (" %s",NumNewNtfs == 1 ? Txt_NOTIF_new_SINGULAR : - Txt_NOTIF_new_PLURAL); - HTM_SPAN_End (); - } + /***** Number of unseen notifications *****/ + HTM_SPAN_Begin ("id=\"notif_all\""); + HTM_TxtF ("%u %s",NumUnseenNtfs, + NumUnseenNtfs == 1 ? Txt_notification : + Txt_notifications); + HTM_SPAN_End (); + + /***** Icon and number of new notifications *****/ + if (NumNewNtfs) + { + HTM_BR (); + HTM_IMG (Gbl.Prefs.URLTheme,"bell.svg",Txt_Notifications, + "class=\"ICO16x16\""); + HTM_TxtF (" %u",NumNewNtfs); + HTM_SPAN_Begin ("id=\"notif_new\""); + HTM_TxtF (" %s",NumNewNtfs == 1 ? Txt_NOTIF_new_SINGULAR : + Txt_NOTIF_new_PLURAL); + HTM_SPAN_End (); + } + + /***** End link *****/ + HTM_BUTTON_End (); /***** End form *****/ - HTM_BUTTON_End (); Frm_EndForm (); } diff --git a/swad_notification.h b/swad_notification.h index e453a74a..1d476511 100644 --- a/swad_notification.h +++ b/swad_notification.h @@ -122,17 +122,17 @@ void Ntf_GetNotifSummaryAndContent (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], long Cod,long CrsCod,long UsrCod, bool GetContent); void Ntf_MarkNotifAsSeen (Ntf_NotifyEvent_t NotifyEvent,long Cod,long CrsCod,long ToUsrCod); -void Ntf_MarkNotifAsRemoved (Ntf_NotifyEvent_t NotifyEvent,long Cod); +void Ntf_DB_MarkNotifAsRemoved (Ntf_NotifyEvent_t NotifyEvent,long Cod); void Ntf_MarkNotifToOneUsrAsRemoved (Ntf_NotifyEvent_t NotifyEvent,long Cod,long ToUsrCod); void Ntf_MarkNotifInCrsAsRemoved (long ToUsrCod,long CrsCod); void Ntf_MarkNotifOneFileAsRemoved (const char *Path); void Ntf_MarkNotifChildrenOfFolderAsRemoved (const char *Path); -void Ntf_MarkNotifFilesInGroupAsRemoved (long GrpCod); +void Ntf_DB_MarkNotifFilesInGroupAsRemoved (long GrpCod); unsigned Ntf_StoreNotifyEventsToAllUsrs (Ntf_NotifyEvent_t NotifyEvent,long Cod); -void Ntf_StoreNotifyEventToOneUser (Ntf_NotifyEvent_t NotifyEvent, - struct UsrData *UsrDat, - long Cod,Ntf_Status_t Status, - long InsCod,long CtrCod,long DegCod,long CrsCod); +void Ntf_DB_StoreNotifyEventToOneUser (Ntf_NotifyEvent_t NotifyEvent, + struct UsrData *UsrDat, + long Cod,Ntf_Status_t Status, + long InsCod,long CtrCod,long DegCod,long CrsCod); void Ntf_SendPendingNotifByEMailToAllUsrs (void); Ntf_NotifyEvent_t Ntf_GetNotifyEventFromStr (const char *Str); void Ntf_MarkAllNotifAsSeen (void); diff --git a/swad_pagination.c b/swad_pagination.c index 55513ca5..fad0481f 100644 --- a/swad_pagination.c +++ b/swad_pagination.c @@ -178,49 +178,49 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, switch (WhatPaginate) { case Pag_ASSIGNMENTS: - Frm_StartFormAnchor (ActSeeAsg,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAsg,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,1); Dat_PutHiddenParamOrder (((struct Asg_Assignments *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_PROJECTS: - Frm_StartFormAnchor (ActSeePrj,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeePrj,Pagination->Anchor); Prj_PutParams (&((struct Prj_Projects *) Context)->Filter, ((struct Prj_Projects *) Context)->SelectedOrder, 1, Cod); break; case Pag_EXAMS: - Frm_StartFormAnchor (ActSeeAllExa,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAllExa,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,1); Dat_PutHiddenParamOrder (((struct Exa_Exams *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_GAMES: - Frm_StartFormAnchor (ActSeeAllGam,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAllGam,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,1); Dat_PutHiddenParamOrder (((struct Gam_Games *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_SURVEYS: - Frm_StartFormAnchor (ActSeeAllSvy,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAllSvy,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,1); Dat_PutHiddenParamOrder (((struct Svy_Surveys *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_ATT_EVENTS: - Frm_StartFormAnchor (ActSeeAtt,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAtt,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,1); Dat_PutHiddenParamOrder (((struct Att_Events *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_THREADS_FORUM: - Frm_StartFormAnchor (For_ActionsSeeFor[((struct For_Forums *) Context)->Forum.Type], + Frm_BeginFormAnchor (For_ActionsSeeFor[((struct For_Forums *) Context)->Forum.Type], Pagination->Anchor); For_PutAllHiddenParamsForum (1, // Page of threads = first 1, // Page of posts = first @@ -231,7 +231,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, -1L); break; case Pag_POSTS_FORUM: - Frm_StartFormAnchor (For_ActionsSeePstFor[((struct For_Forums *) Context)->Forum.Type], + Frm_BeginFormAnchor (For_ActionsSeePstFor[((struct For_Forums *) Context)->Forum.Type], Pagination->Anchor); For_PutAllHiddenParamsForum (((struct For_Forums *) Context)->CurrentPageThrs, // Page of threads = current 1, // Page of posts = first @@ -242,17 +242,17 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, -1L); break; case Pag_MESSAGES_RECEIVED: - Frm_StartFormAnchor (ActSeeRcvMsg,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeRcvMsg,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,1); Msg_PutHiddenParamsMsgsFilters ((struct Msg_Messages *) Context); break; case Pag_MESSAGES_SENT: - Frm_StartFormAnchor (ActSeeSntMsg,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeSntMsg,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,1); Msg_PutHiddenParamsMsgsFilters ((struct Msg_Messages *) Context); break; case Pag_MY_AGENDA: - Frm_StartFormAnchor (ActSeeMyAgd,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeMyAgd,Pagination->Anchor); Agd_PutParamsMyAgenda (((struct Agd_Agenda *) Context)->Past__FutureEvents, ((struct Agd_Agenda *) Context)->PrivatPublicEvents, ((struct Agd_Agenda *) Context)->HiddenVisiblEvents, @@ -261,7 +261,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, Cod); break; case Pag_ANOTHER_AGENDA: - Frm_StartFormAnchor (ActSeeUsrAgd,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeUsrAgd,Pagination->Anchor); Agd_PutHiddenParamEventsOrder (((struct Agd_Agenda *) Context)->SelectedOrder); Pag_PutHiddenParamPagNum (WhatPaginate,1); Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod); @@ -305,49 +305,49 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, switch (WhatPaginate) { case Pag_ASSIGNMENTS: - Frm_StartFormAnchor (ActSeeAsg,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAsg,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,1); Dat_PutHiddenParamOrder (((struct Asg_Assignments *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_PROJECTS: - Frm_StartFormAnchor (ActSeePrj,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeePrj,Pagination->Anchor); Prj_PutParams (&((struct Prj_Projects *) Context)->Filter, ((struct Prj_Projects *) Context)->SelectedOrder, 1, Cod); break; case Pag_EXAMS: - Frm_StartFormAnchor (ActSeeAllExa,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAllExa,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,1); Dat_PutHiddenParamOrder (((struct Exa_Exams *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_GAMES: - Frm_StartFormAnchor (ActSeeAllGam,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAllGam,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,1); Dat_PutHiddenParamOrder (((struct Gam_Games *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_SURVEYS: - Frm_StartFormAnchor (ActSeeAllSvy,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAllSvy,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,1); Dat_PutHiddenParamOrder (((struct Svy_Surveys *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_ATT_EVENTS: - Frm_StartFormAnchor (ActSeeAtt,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAtt,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,1); Dat_PutHiddenParamOrder (((struct Att_Events *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_THREADS_FORUM: - Frm_StartFormAnchor (For_ActionsSeeFor[((struct For_Forums *) Context)->Forum.Type], + Frm_BeginFormAnchor (For_ActionsSeeFor[((struct For_Forums *) Context)->Forum.Type], Pagination->Anchor); For_PutAllHiddenParamsForum (1, // Page of threads = first 1, // Page of posts = first @@ -358,7 +358,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, -1L); break; case Pag_POSTS_FORUM: - Frm_StartFormAnchor (For_ActionsSeePstFor[((struct For_Forums *) Context)->Forum.Type], + Frm_BeginFormAnchor (For_ActionsSeePstFor[((struct For_Forums *) Context)->Forum.Type], Pagination->Anchor); For_PutAllHiddenParamsForum (((struct For_Forums *) Context)->CurrentPageThrs, // Page of threads = current 1, // Page of posts = first @@ -369,17 +369,17 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, -1L); break; case Pag_MESSAGES_RECEIVED: - Frm_StartFormAnchor (ActSeeRcvMsg,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeRcvMsg,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,1); Msg_PutHiddenParamsMsgsFilters ((struct Msg_Messages *) Context); break; case Pag_MESSAGES_SENT: - Frm_StartFormAnchor (ActSeeSntMsg,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeSntMsg,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,1); Msg_PutHiddenParamsMsgsFilters ((struct Msg_Messages *) Context); break; case Pag_MY_AGENDA: - Frm_StartFormAnchor (ActSeeMyAgd,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeMyAgd,Pagination->Anchor); Agd_PutParamsMyAgenda (((struct Agd_Agenda *) Context)->Past__FutureEvents, ((struct Agd_Agenda *) Context)->PrivatPublicEvents, ((struct Agd_Agenda *) Context)->HiddenVisiblEvents, @@ -388,7 +388,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, Cod); break; case Pag_ANOTHER_AGENDA: - Frm_StartFormAnchor (ActSeeUsrAgd,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeUsrAgd,Pagination->Anchor); Agd_PutHiddenParamEventsOrder (((struct Agd_Agenda *) Context)->SelectedOrder); Pag_PutHiddenParamPagNum (WhatPaginate,1); Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod); @@ -418,49 +418,49 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, switch (WhatPaginate) { case Pag_ASSIGNMENTS: - Frm_StartFormAnchor (ActSeeAsg,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAsg,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->LeftPage); Dat_PutHiddenParamOrder (((struct Asg_Assignments *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_PROJECTS: - Frm_StartFormAnchor (ActSeePrj,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeePrj,Pagination->Anchor); Prj_PutParams (&((struct Prj_Projects *) Context)->Filter, ((struct Prj_Projects *) Context)->SelectedOrder, Pagination->LeftPage, Cod); break; case Pag_EXAMS: - Frm_StartFormAnchor (ActSeeAllExa,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAllExa,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->LeftPage); Dat_PutHiddenParamOrder (((struct Exa_Exams *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_GAMES: - Frm_StartFormAnchor (ActSeeAllGam,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAllGam,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->LeftPage); Dat_PutHiddenParamOrder (((struct Gam_Games *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_SURVEYS: - Frm_StartFormAnchor (ActSeeAllSvy,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAllSvy,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->LeftPage); Dat_PutHiddenParamOrder (((struct Svy_Surveys *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_ATT_EVENTS: - Frm_StartFormAnchor (ActSeeAtt,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAtt,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->LeftPage); Dat_PutHiddenParamOrder (((struct Att_Events *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_THREADS_FORUM: - Frm_StartFormAnchor (For_ActionsSeeFor[((struct For_Forums *) Context)->Forum.Type], + Frm_BeginFormAnchor (For_ActionsSeeFor[((struct For_Forums *) Context)->Forum.Type], Pagination->Anchor); For_PutAllHiddenParamsForum (Pagination->LeftPage, // Page of threads = left 1, // Page of posts = first @@ -471,7 +471,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, -1L); break; case Pag_POSTS_FORUM: - Frm_StartFormAnchor (For_ActionsSeePstFor[((struct For_Forums *) Context)->Forum.Type], + Frm_BeginFormAnchor (For_ActionsSeePstFor[((struct For_Forums *) Context)->Forum.Type], Pagination->Anchor); For_PutAllHiddenParamsForum (((struct For_Forums *) Context)->CurrentPageThrs, // Page of threads = current Pagination->LeftPage, // Page of posts = left @@ -482,17 +482,17 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, -1L); break; case Pag_MESSAGES_RECEIVED: - Frm_StartFormAnchor (ActSeeRcvMsg,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeRcvMsg,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->LeftPage); Msg_PutHiddenParamsMsgsFilters ((struct Msg_Messages *) Context); break; case Pag_MESSAGES_SENT: - Frm_StartFormAnchor (ActSeeSntMsg,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeSntMsg,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->LeftPage); Msg_PutHiddenParamsMsgsFilters ((struct Msg_Messages *) Context); break; case Pag_MY_AGENDA: - Frm_StartFormAnchor (ActSeeMyAgd,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeMyAgd,Pagination->Anchor); Agd_PutParamsMyAgenda (((struct Agd_Agenda *) Context)->Past__FutureEvents, ((struct Agd_Agenda *) Context)->PrivatPublicEvents, ((struct Agd_Agenda *) Context)->HiddenVisiblEvents, @@ -501,7 +501,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, Cod); break; case Pag_ANOTHER_AGENDA: - Frm_StartFormAnchor (ActSeeUsrAgd,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeUsrAgd,Pagination->Anchor); Agd_PutHiddenParamEventsOrder (((struct Agd_Agenda *) Context)->SelectedOrder); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->LeftPage); Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod); @@ -543,49 +543,49 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, switch (WhatPaginate) { case Pag_ASSIGNMENTS: - Frm_StartFormAnchor (ActSeeAsg,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAsg,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,NumPage); Dat_PutHiddenParamOrder (((struct Asg_Assignments *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_PROJECTS: - Frm_StartFormAnchor (ActSeePrj,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeePrj,Pagination->Anchor); Prj_PutParams (&((struct Prj_Projects *) Context)->Filter, ((struct Prj_Projects *) Context)->SelectedOrder, NumPage, Cod); break; case Pag_EXAMS: - Frm_StartFormAnchor (ActSeeAllExa,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAllExa,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,NumPage); Dat_PutHiddenParamOrder (((struct Exa_Exams *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_GAMES: - Frm_StartFormAnchor (ActSeeAllGam,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAllGam,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,NumPage); Dat_PutHiddenParamOrder (((struct Gam_Games *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_SURVEYS: - Frm_StartFormAnchor (ActSeeAllSvy,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAllSvy,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,NumPage); Dat_PutHiddenParamOrder (((struct Svy_Surveys *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_ATT_EVENTS: - Frm_StartFormAnchor (ActSeeAtt,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAtt,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,NumPage); Dat_PutHiddenParamOrder (((struct Att_Events *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_THREADS_FORUM: - Frm_StartFormAnchor (For_ActionsSeeFor[((struct For_Forums *) Context)->Forum.Type], + Frm_BeginFormAnchor (For_ActionsSeeFor[((struct For_Forums *) Context)->Forum.Type], Pagination->Anchor); For_PutAllHiddenParamsForum (NumPage, // Page of threads = number of page 1, // Page of posts = first @@ -596,7 +596,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, -1L); break; case Pag_POSTS_FORUM: - Frm_StartFormAnchor (For_ActionsSeePstFor[((struct For_Forums *) Context)->Forum.Type], + Frm_BeginFormAnchor (For_ActionsSeePstFor[((struct For_Forums *) Context)->Forum.Type], Pagination->Anchor); For_PutAllHiddenParamsForum (((struct For_Forums *) Context)->CurrentPageThrs, // Page of threads = current NumPage, // Page of posts = number of page @@ -607,17 +607,17 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, -1L); break; case Pag_MESSAGES_RECEIVED: - Frm_StartFormAnchor (ActSeeRcvMsg,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeRcvMsg,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,NumPage); Msg_PutHiddenParamsMsgsFilters ((struct Msg_Messages *) Context); break; case Pag_MESSAGES_SENT: - Frm_StartFormAnchor (ActSeeSntMsg,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeSntMsg,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,NumPage); Msg_PutHiddenParamsMsgsFilters ((struct Msg_Messages *) Context); break; case Pag_MY_AGENDA: - Frm_StartFormAnchor (ActSeeMyAgd,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeMyAgd,Pagination->Anchor); Agd_PutParamsMyAgenda (((struct Agd_Agenda *) Context)->Past__FutureEvents, ((struct Agd_Agenda *) Context)->PrivatPublicEvents, ((struct Agd_Agenda *) Context)->HiddenVisiblEvents, @@ -626,7 +626,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, Cod); break; case Pag_ANOTHER_AGENDA: - Frm_StartFormAnchor (ActSeeUsrAgd,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeUsrAgd,Pagination->Anchor); Agd_PutHiddenParamEventsOrder (((struct Agd_Agenda *) Context)->SelectedOrder); Pag_PutHiddenParamPagNum (WhatPaginate,NumPage); Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod); @@ -655,49 +655,49 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, switch (WhatPaginate) { case Pag_ASSIGNMENTS: - Frm_StartFormAnchor (ActSeeAsg,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAsg,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->RightPage); Dat_PutHiddenParamOrder (((struct Asg_Assignments *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_PROJECTS: - Frm_StartFormAnchor (ActSeePrj,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeePrj,Pagination->Anchor); Prj_PutParams (&((struct Prj_Projects *) Context)->Filter, ((struct Prj_Projects *) Context)->SelectedOrder, Pagination->RightPage, Cod); break; case Pag_EXAMS: - Frm_StartFormAnchor (ActSeeAllExa,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAllExa,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->RightPage); Dat_PutHiddenParamOrder (((struct Exa_Exams *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_GAMES: - Frm_StartFormAnchor (ActSeeAllGam,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAllGam,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->RightPage); Dat_PutHiddenParamOrder (((struct Gam_Games *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_SURVEYS: - Frm_StartFormAnchor (ActSeeAllSvy,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAllSvy,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->RightPage); Dat_PutHiddenParamOrder (((struct Svy_Surveys *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_ATT_EVENTS: - Frm_StartFormAnchor (ActSeeAtt,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAtt,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->RightPage); Dat_PutHiddenParamOrder (((struct Att_Events *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_THREADS_FORUM: - Frm_StartFormAnchor (For_ActionsSeeFor[((struct For_Forums *) Context)->Forum.Type], + Frm_BeginFormAnchor (For_ActionsSeeFor[((struct For_Forums *) Context)->Forum.Type], Pagination->Anchor); For_PutAllHiddenParamsForum (Pagination->RightPage, // Page of threads = right 1, // Page of posts = first @@ -708,7 +708,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, -1L); break; case Pag_POSTS_FORUM: - Frm_StartFormAnchor (For_ActionsSeePstFor[((struct For_Forums *) Context)->Forum.Type], + Frm_BeginFormAnchor (For_ActionsSeePstFor[((struct For_Forums *) Context)->Forum.Type], Pagination->Anchor); For_PutAllHiddenParamsForum (((struct For_Forums *) Context)->CurrentPageThrs, // Page of threads = current Pagination->RightPage, // Page of posts = right @@ -719,17 +719,17 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, -1L); break; case Pag_MESSAGES_RECEIVED: - Frm_StartFormAnchor (ActSeeRcvMsg,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeRcvMsg,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->RightPage); Msg_PutHiddenParamsMsgsFilters ((struct Msg_Messages *) Context); break; case Pag_MESSAGES_SENT: - Frm_StartFormAnchor (ActSeeSntMsg,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeSntMsg,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->RightPage); Msg_PutHiddenParamsMsgsFilters ((struct Msg_Messages *) Context); break; case Pag_MY_AGENDA: - Frm_StartFormAnchor (ActSeeMyAgd,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeMyAgd,Pagination->Anchor); Agd_PutParamsMyAgenda (((struct Agd_Agenda *) Context)->Past__FutureEvents, ((struct Agd_Agenda *) Context)->PrivatPublicEvents, ((struct Agd_Agenda *) Context)->HiddenVisiblEvents, @@ -738,7 +738,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, Cod); break; case Pag_ANOTHER_AGENDA: - Frm_StartFormAnchor (ActSeeUsrAgd,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeUsrAgd,Pagination->Anchor); Agd_PutHiddenParamEventsOrder (((struct Agd_Agenda *) Context)->SelectedOrder); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->RightPage); Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod); @@ -768,49 +768,49 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, switch (WhatPaginate) { case Pag_ASSIGNMENTS: - Frm_StartFormAnchor (ActSeeAsg,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAsg,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->NumPags); Dat_PutHiddenParamOrder (((struct Asg_Assignments *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_PROJECTS: - Frm_StartFormAnchor (ActSeePrj,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeePrj,Pagination->Anchor); Prj_PutParams (&((struct Prj_Projects *) Context)->Filter, ((struct Prj_Projects *) Context)->SelectedOrder, Pagination->NumPags, Cod); break; case Pag_EXAMS: - Frm_StartFormAnchor (ActSeeAllExa,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAllExa,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->NumPags); Dat_PutHiddenParamOrder (((struct Exa_Exams *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_GAMES: - Frm_StartFormAnchor (ActSeeAllGam,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAllGam,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->NumPags); Dat_PutHiddenParamOrder (((struct Gam_Games *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_SURVEYS: - Frm_StartFormAnchor (ActSeeAllSvy,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAllSvy,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->NumPags); Dat_PutHiddenParamOrder (((struct Svy_Surveys *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_ATT_EVENTS: - Frm_StartFormAnchor (ActSeeAtt,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeAtt,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->NumPags); Dat_PutHiddenParamOrder (((struct Att_Events *) Context)->SelectedOrder); WhichGroups = Grp_GetParamWhichGroups (); Grp_PutParamWhichGroups (&WhichGroups); break; case Pag_THREADS_FORUM: - Frm_StartFormAnchor (For_ActionsSeeFor[((struct For_Forums *) Context)->Forum.Type], + Frm_BeginFormAnchor (For_ActionsSeeFor[((struct For_Forums *) Context)->Forum.Type], Pagination->Anchor); For_PutAllHiddenParamsForum (Pagination->NumPags, // Page of threads = last 1, // Page of posts = first @@ -821,7 +821,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, -1L); break; case Pag_POSTS_FORUM: - Frm_StartFormAnchor (For_ActionsSeePstFor[((struct For_Forums *) Context)->Forum.Type], + Frm_BeginFormAnchor (For_ActionsSeePstFor[((struct For_Forums *) Context)->Forum.Type], Pagination->Anchor); For_PutAllHiddenParamsForum (((struct For_Forums *) Context)->CurrentPageThrs, // Page of threads = current Pagination->NumPags, // Page of posts = last @@ -832,17 +832,17 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, -1L); break; case Pag_MESSAGES_RECEIVED: - Frm_StartFormAnchor (ActSeeRcvMsg,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeRcvMsg,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->NumPags); Msg_PutHiddenParamsMsgsFilters ((struct Msg_Messages *) Context); break; case Pag_MESSAGES_SENT: - Frm_StartFormAnchor (ActSeeSntMsg,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeSntMsg,Pagination->Anchor); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->NumPags); Msg_PutHiddenParamsMsgsFilters ((struct Msg_Messages *) Context); break; case Pag_MY_AGENDA: - Frm_StartFormAnchor (ActSeeMyAgd,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeMyAgd,Pagination->Anchor); Agd_PutParamsMyAgenda (((struct Agd_Agenda *) Context)->Past__FutureEvents, ((struct Agd_Agenda *) Context)->PrivatPublicEvents, ((struct Agd_Agenda *) Context)->HiddenVisiblEvents, @@ -851,7 +851,7 @@ void Pag_WriteLinksToPages (Pag_WhatPaginate_t WhatPaginate, Cod); break; case Pag_ANOTHER_AGENDA: - Frm_StartFormAnchor (ActSeeUsrAgd,Pagination->Anchor); + Frm_BeginFormAnchor (ActSeeUsrAgd,Pagination->Anchor); Agd_PutHiddenParamEventsOrder (((struct Agd_Agenda *) Context)->SelectedOrder); Pag_PutHiddenParamPagNum (WhatPaginate,Pagination->NumPags); Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod); diff --git a/swad_password.c b/swad_password.c index bd466aab..23a86962 100644 --- a/swad_password.c +++ b/swad_password.c @@ -669,7 +669,7 @@ void Pwd_ShowFormChgMyPwd (void) HTM_SECTION_Begin (Pwd_PASSWORD_SECTION_ID); /***** Begin form *****/ - Frm_StartFormAnchor (ActChgMyPwd,Pwd_PASSWORD_SECTION_ID); + Frm_BeginFormAnchor (ActChgMyPwd,Pwd_PASSWORD_SECTION_ID); /***** Begin box *****/ snprintf (StrRecordWidth,sizeof (StrRecordWidth),"%upx",Rec_RECORD_WIDTH); @@ -833,7 +833,7 @@ void Pwd_ShowFormChgOtherUsrPwd (void) NextAction = ActChgPwdOth; break; } - Frm_StartFormAnchor (NextAction,Pwd_PASSWORD_SECTION_ID); + Frm_BeginFormAnchor (NextAction,Pwd_PASSWORD_SECTION_ID); Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod); /* New password */ diff --git a/swad_privacy.c b/swad_privacy.c index 0e2273ba..3994a32d 100644 --- a/swad_privacy.c +++ b/swad_privacy.c @@ -166,7 +166,7 @@ static void Pri_PutFormVisibility (const char *TxtLabel, /***** Form with list of options *****/ HTM_TD_Begin ("class=\"LT\""); if (Action != ActUnk) - Frm_StartFormAnchor (Action,Pri_PRIVACY_ID); + Frm_BeginFormAnchor (Action,Pri_PRIVACY_ID); HTM_UL_Begin ("class=\"PRI_LIST LIST_LEFT\""); for (Visibility = Pri_VISIBILITY_USER; Visibility <= Pri_VISIBILITY_WORLD; diff --git a/swad_profile.c b/swad_profile.c index cc9254f3..cd7734b9 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -1235,7 +1235,7 @@ static void Prf_GetNumMessagesSentAndStoreAsUsrFigure (long UsrCod) Prf_ResetUsrFigures (&UsrFigures); /***** Get number of messages sent from database *****/ - UsrFigures.NumMsgSnt = (int) Msg_GetNumMsgsSentByUsr (UsrCod); + UsrFigures.NumMsgSnt = (int) Msg_DB_GetNumMsgsSentByUsr (UsrCod); /***** Update number of messages sent in user's figures *****/ if (Prf_CheckIfUsrFiguresExists (UsrCod)) diff --git a/swad_program.c b/swad_program.c index f150fbb7..b0423252 100644 --- a/swad_program.c +++ b/swad_program.c @@ -399,7 +399,7 @@ static void Prg_PutButtonToCreateNewItem (void) extern const char *Txt_New_item; long ItmCod = -1L; - Frm_StartFormAnchor (ActFrmNewPrgItm,"item_form"); + Frm_BeginFormAnchor (ActFrmNewPrgItm,"item_form"); Prg_PutParams (&ItmCod); Btn_PutConfirmButton (Txt_New_item); Frm_EndForm (); @@ -1828,7 +1828,7 @@ static void Prg_ShowFormToCreateItem (long ParentItmCod) Ale_ShowAlerts (NULL); /***** Begin form *****/ - Frm_StartFormAnchor (ActNewPrgItm,"prg_highlighted"); + Frm_BeginFormAnchor (ActNewPrgItm,"prg_highlighted"); Prg_PutParamItmCod (ParentItem.Hierarchy.ItmCod); /***** Begin box and table *****/ @@ -1872,7 +1872,7 @@ static void Prg_ShowFormToChangeItem (long ItmCod) Ale_ShowAlerts (NULL); /***** Begin form *****/ - Frm_StartFormAnchor (ActChgPrgItm,"prg_highlighted"); + Frm_BeginFormAnchor (ActChgPrgItm,"prg_highlighted"); Prg_PutParamItmCod (Item.Hierarchy.ItmCod); /***** Begin box and table *****/ diff --git a/swad_record.c b/swad_record.c index d70da06c..71ad8a32 100644 --- a/swad_record.c +++ b/swad_record.c @@ -1721,7 +1721,7 @@ static void Rec_ShowCrsRecord (Rec_CourseRecordViewType_t TypeOfView, TypeOfView == Rec_CRS_LIST_SEVERAL_RECORDS) { ICanEdit = true; - Frm_StartFormAnchor (ActRcvRecOthUsr,Anchor); + Frm_BeginFormAnchor (ActRcvRecOthUsr,Anchor); Par_PutHiddenParamLong (NULL,"OriginalActCod", Act_GetActCod (ActSeeRecSevStd)); // Original action, used to know where we came from Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); @@ -2620,7 +2620,7 @@ static void Rec_PutIconsCommands (__attribute__((unused)) void *Args) Rec_PutParamUsrCodEncrypted,NULL); /***** Button to send a message *****/ - RecipientHasBannedMe = Msg_CheckIfUsrIsBanned (Gbl.Usrs.Me.UsrDat.UsrCod, // From: + RecipientHasBannedMe = Msg_DB_CheckIfUsrIsBanned (Gbl.Usrs.Me.UsrDat.UsrCod, // From: Gbl.Record.UsrDat->UsrCod); // To: if (!RecipientHasBannedMe) Lay_PutContextualLinkOnlyIcon (ActReqMsgUsr,NULL, @@ -3896,7 +3896,7 @@ static void Rec_ShowFormMyInsCtrDpt (bool IAmATeacher) HTM_TD_Begin ("class=\"REC_C2_BOT LM\""); /* Begin form to select the country of my institution */ - Frm_StartFormAnchor (ActChgCtyMyIns,Rec_MY_INS_CTR_DPT_ID); + Frm_BeginFormAnchor (ActChgCtyMyIns,Rec_MY_INS_CTR_DPT_ID); HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE, "id=\"InsCtyCod\" name=\"OthCtyCod\"" " class=\"REC_C2_BOT_INPUT\""); @@ -3933,7 +3933,7 @@ static void Rec_ShowFormMyInsCtrDpt (bool IAmATeacher) Ins_GetBasicListOfInstitutions (Gbl.Usrs.Me.UsrDat.InsCtyCod); /* Begin form to select institution */ - Frm_StartFormAnchor (ActChgMyIns,Rec_MY_INS_CTR_DPT_ID); + Frm_BeginFormAnchor (ActChgMyIns,Rec_MY_INS_CTR_DPT_ID); HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE, "id=\"OthInsCod\" name=\"OthInsCod\"" " class=\"REC_C2_BOT_INPUT\""); @@ -3974,7 +3974,7 @@ static void Rec_ShowFormMyInsCtrDpt (bool IAmATeacher) Ctr_GetBasicListOfCenters (Gbl.Usrs.Me.UsrDat.InsCod); /* Begin form to select center */ - Frm_StartFormAnchor (ActChgMyCtr,Rec_MY_INS_CTR_DPT_ID); + Frm_BeginFormAnchor (ActChgMyCtr,Rec_MY_INS_CTR_DPT_ID); HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE, "id=\"OthCtrCod\" name=\"OthCtrCod\"" " class=\"REC_C2_BOT_INPUT\""); @@ -4006,7 +4006,7 @@ static void Rec_ShowFormMyInsCtrDpt (bool IAmATeacher) /* Data */ HTM_TD_Begin ("class=\"REC_C2_BOT LM\""); - Frm_StartFormAnchor (ActChgMyDpt,Rec_MY_INS_CTR_DPT_ID); + Frm_BeginFormAnchor (ActChgMyDpt,Rec_MY_INS_CTR_DPT_ID); Dpt_WriteSelectorDepartment (Gbl.Usrs.Me.UsrDat.InsCod, // Departments in my institution Gbl.Usrs.Me.UsrDat.Tch.DptCod, // Selected department "REC_C2_BOT_INPUT", // Selector class @@ -4026,7 +4026,7 @@ static void Rec_ShowFormMyInsCtrDpt (bool IAmATeacher) /* Data */ HTM_TD_Begin ("class=\"REC_C2_BOT LM\""); - Frm_StartFormAnchor (ActChgMyOff,Rec_MY_INS_CTR_DPT_ID); + Frm_BeginFormAnchor (ActChgMyOff,Rec_MY_INS_CTR_DPT_ID); HTM_INPUT_TEXT ("Office",Usr_MAX_CHARS_ADDRESS,Gbl.Usrs.Me.UsrDat.Tch.Office, HTM_SUBMIT_ON_CHANGE, "id=\"Office\" class=\"REC_C2_BOT_INPUT\""); @@ -4043,7 +4043,7 @@ static void Rec_ShowFormMyInsCtrDpt (bool IAmATeacher) /* Data */ HTM_TD_Begin ("class=\"REC_C2_BOT LM\""); - Frm_StartFormAnchor (ActChgMyOffPho,Rec_MY_INS_CTR_DPT_ID); + Frm_BeginFormAnchor (ActChgMyOffPho,Rec_MY_INS_CTR_DPT_ID); HTM_INPUT_TEL ("OfficePhone",Gbl.Usrs.Me.UsrDat.Tch.OfficePhone, HTM_SUBMIT_ON_CHANGE, "id=\"OfficePhone\" class=\"REC_C2_BOT_INPUT\""); diff --git a/swad_room.c b/swad_room.c index 2f06e76a..cb917d8d 100644 --- a/swad_room.c +++ b/swad_room.c @@ -814,7 +814,7 @@ static void Roo_ListRoomsForEdition (const struct Bld_Buildings *Buildings, /* Building */ HTM_TD_Begin ("class=\"CT\""); - Frm_StartFormAnchor (ActChgRooBld,Anchor); + Frm_BeginFormAnchor (ActChgRooBld,Anchor); Roo_PutParamRooCod (&Room->RooCod); Roo_PutSelectorBuilding (Room->BldCod,Buildings, HTM_SUBMIT_ON_CHANGE); @@ -823,7 +823,7 @@ static void Roo_ListRoomsForEdition (const struct Bld_Buildings *Buildings, /* Floor */ HTM_TD_Begin ("class=\"LT\""); - Frm_StartFormAnchor (ActChgRooFlo,Anchor); + Frm_BeginFormAnchor (ActChgRooFlo,Anchor); Roo_PutParamRooCod (&Room->RooCod); HTM_INPUT_LONG ("Floor",(long) INT_MIN,(long) INT_MAX,(long) Room->Floor, HTM_SUBMIT_ON_CHANGE,false, @@ -833,7 +833,7 @@ static void Roo_ListRoomsForEdition (const struct Bld_Buildings *Buildings, /* Room type */ HTM_TD_Begin ("class=\"CT\""); - Frm_StartFormAnchor (ActChgRooTyp,Anchor); + Frm_BeginFormAnchor (ActChgRooTyp,Anchor); Roo_PutParamRooCod (&Room->RooCod); Roo_PutSelectorType (Room->Type, HTM_SUBMIT_ON_CHANGE); @@ -842,7 +842,7 @@ static void Roo_ListRoomsForEdition (const struct Bld_Buildings *Buildings, /* Room short name */ HTM_TD_Begin ("class=\"LT\""); - Frm_StartFormAnchor (ActRenRooSho,Anchor); + Frm_BeginFormAnchor (ActRenRooSho,Anchor); Roo_PutParamRooCod (&Room->RooCod); HTM_INPUT_TEXT ("ShortName",Roo_MAX_CHARS_SHRT_NAME,Room->ShrtName, HTM_SUBMIT_ON_CHANGE, @@ -852,7 +852,7 @@ static void Roo_ListRoomsForEdition (const struct Bld_Buildings *Buildings, /* Room full name */ HTM_TD_Begin ("class=\"LT\""); - Frm_StartFormAnchor (ActRenRooFul,Anchor); + Frm_BeginFormAnchor (ActRenRooFul,Anchor); Roo_PutParamRooCod (&Room->RooCod); HTM_INPUT_TEXT ("FullName",Roo_MAX_CHARS_FULL_NAME,Room->FullName, HTM_SUBMIT_ON_CHANGE, @@ -862,7 +862,7 @@ static void Roo_ListRoomsForEdition (const struct Bld_Buildings *Buildings, /* Seating capacity */ HTM_TD_Begin ("class=\"LT\""); - Frm_StartFormAnchor (ActChgRooMaxUsr,Anchor); + Frm_BeginFormAnchor (ActChgRooMaxUsr,Anchor); Roo_PutParamRooCod (&Room->RooCod); Roo_WriteCapacity (StrCapacity,Room->Capacity); HTM_INPUT_TEXT ("Capacity",Cns_MAX_DECIMAL_DIGITS_UINT,StrCapacity, diff --git a/swad_statistic.c b/swad_statistic.c index f564aae4..14fe46d2 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -309,7 +309,7 @@ static void Sta_PutFormCrsHits (struct Sta_Stats *Stats) Enr_CheckStdsAndPutButtonToRegisterStdsInCurrentCrs (); /***** Begin form *****/ - Frm_StartFormAnchor (ActSeeAccCrs,Sta_STAT_RESULTS_SECTION_ID); + Frm_BeginFormAnchor (ActSeeAccCrs,Sta_STAT_RESULTS_SECTION_ID); Grp_PutParamsCodGrps (); Par_PutHiddenParamLong (NULL,"FirstRow",0); @@ -499,7 +499,7 @@ static void Sta_PutFormGblHits (struct Sta_Stats *Stats) Mnu_ContextMenuEnd (); /***** Begin form *****/ - Frm_StartFormAnchor (ActSeeAccGbl,Sta_STAT_RESULTS_SECTION_ID); + Frm_BeginFormAnchor (ActSeeAccGbl,Sta_STAT_RESULTS_SECTION_ID); /***** Begin box and table *****/ Box_BoxTableBegin (NULL,Txt_Statistics_of_all_visits, @@ -1628,7 +1628,7 @@ static void Sta_ShowDetailedAccessesList (const struct Sta_Stats *Stats, /* Put link to jump to previous page (older clicks) */ if (FirstRow > 1) { - Frm_StartFormAnchor (ActSeeAccCrs,Sta_STAT_RESULTS_SECTION_ID); + Frm_BeginFormAnchor (ActSeeAccCrs,Sta_STAT_RESULTS_SECTION_ID); Dat_WriteParamsIniEndDates (); Par_PutHiddenParamUnsigned (NULL,"GroupedBy",(unsigned) Sta_CLICKS_CRS_DETAILED_LIST); Par_PutHiddenParamUnsigned (NULL,"StatAct" ,(unsigned) Stats->NumAction); @@ -1666,7 +1666,7 @@ static void Sta_ShowDetailedAccessesList (const struct Sta_Stats *Stats, /* Put link to jump to next page (more recent clicks) */ if (LastRow < NumHits) { - Frm_StartFormAnchor (ActSeeAccCrs,Sta_STAT_RESULTS_SECTION_ID); + Frm_BeginFormAnchor (ActSeeAccCrs,Sta_STAT_RESULTS_SECTION_ID); Dat_WriteParamsIniEndDates (); Par_PutHiddenParamUnsigned (NULL,"GroupedBy",(unsigned) Sta_CLICKS_CRS_DETAILED_LIST); Par_PutHiddenParamUnsigned (NULL,"StatAct" ,(unsigned) Stats->NumAction); @@ -2092,7 +2092,7 @@ static void Sta_ShowDistrAccessesPerDayAndHour (const struct Sta_Stats *Stats, HTM_TD_Begin ("colspan=\"26\" class=\"CM\""); - Frm_StartFormAnchor (Gbl.Action.Act,Sta_STAT_RESULTS_SECTION_ID); + Frm_BeginFormAnchor (Gbl.Action.Act,Sta_STAT_RESULTS_SECTION_ID); Dat_WriteParamsIniEndDates (); Par_PutHiddenParamUnsigned (NULL,"GroupedBy",(unsigned) Stats->ClicksGroupedBy); Par_PutHiddenParamUnsigned (NULL,"CountType",(unsigned) Stats->CountType); diff --git a/swad_string.c b/swad_string.c index 4ded24f2..aeb39bbc 100644 --- a/swad_string.c +++ b/swad_string.c @@ -756,7 +756,7 @@ void Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (long PubCod,const char *T if (CreateNotif) { NotifyByEmail = (UsrDat.NtfEvents.SendEmail & (1 << Ntf_EVENT_TL_MENTION)); - Ntf_StoreNotifyEventToOneUser (Ntf_EVENT_TL_MENTION,&UsrDat,PubCod, + Ntf_DB_StoreNotifyEventToOneUser (Ntf_EVENT_TL_MENTION,&UsrDat,PubCod, (Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL : 0), Gbl.Hierarchy.Ins.InsCod, diff --git a/swad_survey.c b/swad_survey.c index ab385536..0f61461c 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -1653,7 +1653,7 @@ void Svy_RemoveSurvey (void) Svy.SvyCod); /***** Mark possible notifications as removed *****/ - Ntf_MarkNotifAsRemoved (Ntf_EVENT_SURVEY,Svy.SvyCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_SURVEY,Svy.SvyCod); /***** Write message to show the change made *****/ Ale_ShowAlert (Ale_SUCCESS,Txt_Survey_X_removed, diff --git a/swad_timeline_comment.c b/swad_timeline_comment.c index edd4ba66..66bbc1d5 100644 --- a/swad_timeline_comment.c +++ b/swad_timeline_comment.c @@ -1007,9 +1007,9 @@ void Tml_Com_RemoveCommMediaAndDBEntries (long PubCod) Med_RemoveMedia (Tml_DB_GetMedCodFromComm (PubCod)); /***** Mark possible notifications on this comment as removed *****/ - Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_COMMENT,PubCod); - Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV ,PubCod); - Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_MENTION,PubCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_COMMENT,PubCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV ,PubCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_MENTION,PubCod); /***** Remove favs for this comment *****/ Tml_DB_RemoveCommFavs (PubCod); diff --git a/swad_timeline_favourite.c b/swad_timeline_favourite.c index aeed1293..d659b0ea 100644 --- a/swad_timeline_favourite.c +++ b/swad_timeline_favourite.c @@ -194,7 +194,7 @@ static void Tml_Fav_UnfNote (struct Tml_Not_Note *Not) /***** Mark possible notifications on this note as removed *****/ OriginalPubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod); if (OriginalPubCod > 0) - Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV,OriginalPubCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV,OriginalPubCod); } /*****************************************************************************/ @@ -345,7 +345,7 @@ static void Tml_Fav_UnfComm (struct Tml_Com_Comment *Com) Com->PubCod,Com->UsrCod); /***** Mark possible notifications on this comment as removed *****/ - Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV,Com->PubCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV,Com->PubCod); /***** Free image *****/ Med_MediaDestructor (&Com->Content.Media); diff --git a/swad_timeline_form.c b/swad_timeline_form.c index c3b7b850..1e2c2b41 100644 --- a/swad_timeline_form.c +++ b/swad_timeline_form.c @@ -188,7 +188,7 @@ void Tml_Frm_BeginForm (const struct Tml_Timeline *Timeline, if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) { /***** Begin form in user timeline *****/ - Frm_StartFormAnchor (Tml_Frm_ActionUsr[Action],"timeline"); + Frm_BeginFormAnchor (Tml_Frm_ActionUsr[Action],"timeline"); Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod); } else diff --git a/swad_timeline_note.c b/swad_timeline_note.c index 456f3dd8..af59d92a 100644 --- a/swad_timeline_note.c +++ b/swad_timeline_note.c @@ -1287,9 +1287,9 @@ static void Tml_Not_RemoveNoteMediaAndDBEntries (struct Tml_Not_Note *Not) PubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod); if (PubCod > 0) { - Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV ,PubCod); - Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_SHARE ,PubCod); - Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_MENTION,PubCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV ,PubCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_SHARE ,PubCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_MENTION,PubCod); } /***** Remove favs for this note *****/ diff --git a/swad_timeline_notification.c b/swad_timeline_notification.c index da1f764d..8db58d75 100644 --- a/swad_timeline_notification.c +++ b/swad_timeline_notification.c @@ -86,7 +86,7 @@ void Tml_Ntf_CreateNotifToAuthor (long AuthorCod,long PubCod, If this author wants to receive notifications by email, activate the sending of a notification *****/ if (CreateNotif) - Ntf_StoreNotifyEventToOneUser (NotifyEvent,&UsrDat,PubCod, + Ntf_DB_StoreNotifyEventToOneUser (NotifyEvent,&UsrDat,PubCod, (Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL : 0), Gbl.Hierarchy.Ins.InsCod, diff --git a/swad_timeline_share.c b/swad_timeline_share.c index c6b395cd..c1644a85 100644 --- a/swad_timeline_share.c +++ b/swad_timeline_share.c @@ -192,5 +192,5 @@ static void Tml_Sha_UnsNote (struct Tml_Not_Note *Not) /***** Mark possible notifications on this note as removed *****/ OriginalPubCod = Tml_DB_GetPubCodOfOriginalNote (Not->NotCod); if (OriginalPubCod > 0) - Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_SHARE,OriginalPubCod); + Ntf_DB_MarkNotifAsRemoved (Ntf_EVENT_TL_SHARE,OriginalPubCod); } diff --git a/swad_user.c b/swad_user.c index 2b0a754d..28877f31 100644 --- a/swad_user.c +++ b/swad_user.c @@ -731,7 +731,7 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat, DB_FreeMySQLResult (&mysql_res); /***** Get nickname and email *****/ - Nck_GetNicknameFromUsrCod (UsrDat->UsrCod,UsrDat->Nickname); + Nck_DB_GetNicknameFromUsrCod (UsrDat->UsrCod,UsrDat->Nickname); Mai_GetEmailFromUsrCod (UsrDat); } @@ -6388,7 +6388,7 @@ void Usr_ShowFormsToSelectUsrListType (void (*FuncParams) (void *Args),void *Arg Usr_LIST_AS_CLASS_PHOTO); /* Number of columns in the class photo */ - Frm_StartFormAnchor (Gbl.Action.Act, // Repeat current action + Frm_BeginFormAnchor (Gbl.Action.Act, // Repeat current action Usr_USER_LIST_SECTION_ID); Grp_PutParamsCodGrps (); Usr_PutParamUsrListType (Usr_LIST_AS_CLASS_PHOTO); @@ -6407,7 +6407,7 @@ void Usr_ShowFormsToSelectUsrListType (void (*FuncParams) (void *Args),void *Arg Usr_LIST_AS_LISTING); /* See the photos in list? */ - Frm_StartFormAnchor (Gbl.Action.Act, // Repeat current action + Frm_BeginFormAnchor (Gbl.Action.Act, // Repeat current action Usr_USER_LIST_SECTION_ID); Grp_PutParamsCodGrps (); Usr_PutParamUsrListType (Usr_LIST_AS_LISTING); @@ -6432,7 +6432,7 @@ static void Usr_FormToSelectUsrListType (void (*FuncParams) (void *Args),void *A extern const char *Txt_USR_LIST_TYPES[Usr_NUM_USR_LIST_TYPES]; /***** Begin form *****/ - Frm_StartFormAnchor (Gbl.Action.Act, // Repeat current action + Frm_BeginFormAnchor (Gbl.Action.Act, // Repeat current action Usr_USER_LIST_SECTION_ID); Grp_PutParamsCodGrps (); Usr_PutParamUsrListType (ListType);