From fc87db628caf435caa1ab921c3e1394c57d3c81a Mon Sep 17 00:00:00 2001 From: acanas Date: Thu, 23 Mar 2023 09:35:20 +0100 Subject: [PATCH] Version 22.78.5: Mar 22, 2023 Code refactoring in banners. --- swad_API.c | 70 ++++---- swad_account.c | 2 +- swad_action_list.c | 24 +-- swad_agenda.c | 22 +-- swad_agenda_database.c | 4 +- swad_agenda_database.h | 4 +- swad_assignment.c | 22 +-- swad_assignment.h | 4 +- swad_assignment_database.c | 6 +- swad_assignment_database.h | 6 +- swad_attendance.c | 324 +++++++++++++++++------------------ swad_attendance.h | 36 ++-- swad_attendance_database.c | 88 +++++----- swad_attendance_database.h | 72 ++++---- swad_attendance_resource.c | 8 +- swad_attendance_resource.h | 4 +- swad_banner.c | 16 +- swad_banner.h | 2 +- swad_banner_database.c | 2 +- swad_banner_database.h | 2 +- swad_browser.c | 104 +++++------ swad_building.c | 91 +++++----- swad_building.h | 2 +- swad_building_database.c | 9 +- swad_building_database.h | 2 +- swad_call_for_exam.c | 8 +- swad_center.c | 20 +-- swad_center.h | 2 +- swad_center_config.c | 4 +- swad_center_database.c | 2 +- swad_center_database.h | 2 +- swad_changelog.h | 3 +- swad_chat.c | 8 +- swad_country.c | 14 +- swad_country.h | 2 +- swad_country_config.c | 4 +- swad_country_database.c | 2 +- swad_country_database.h | 2 +- swad_course.c | 30 ++-- swad_course.h | 2 +- swad_course_config.c | 2 +- swad_course_database.c | 2 +- swad_course_database.h | 2 +- swad_degree.c | 21 ++- swad_degree.h | 2 +- swad_degree_config.c | 2 +- swad_degree_database.c | 2 +- swad_degree_database.h | 2 +- swad_degree_type.c | 6 +- swad_degree_type.h | 2 +- swad_department.c | 14 +- swad_department.h | 2 +- swad_department_database.c | 2 +- swad_department_database.h | 2 +- swad_enrolment.c | 6 +- swad_exam.c | 18 +- swad_exam.h | 4 +- swad_exam_database.c | 12 +- swad_exam_database.h | 12 +- swad_exam_print.c | 40 ++--- swad_exam_print.h | 4 +- swad_exam_result.c | 24 +-- swad_exam_session.c | 20 +-- swad_exam_session.h | 2 +- swad_exam_set.c | 22 +-- swad_exam_set.h | 2 +- swad_forum.c | 16 +- swad_game.c | 36 ++-- swad_game.h | 3 +- swad_game_database.c | 2 +- swad_game_database.h | 2 +- swad_group.c | 46 ++--- swad_group.h | 2 +- swad_group_database.c | 4 +- swad_group_database.h | 4 +- swad_hierarchy.c | 16 +- swad_holiday.c | 18 +- swad_holiday_database.c | 2 +- swad_holiday_database.h | 2 +- swad_institution.c | 20 +-- swad_institution.h | 2 +- swad_institution_config.c | 4 +- swad_institution_database.c | 6 +- swad_institution_database.h | 6 +- swad_layout.c | 6 +- swad_link.c | 18 +- swad_link.h | 2 +- swad_link_database.c | 2 +- swad_link_database.h | 2 +- swad_log.c | 2 +- swad_mail.c | 8 +- swad_mail.h | 2 +- swad_mail_database.c | 2 +- swad_mail_database.h | 2 +- swad_mark.c | 2 +- swad_mark_database.c | 2 +- swad_mark_database.h | 2 +- swad_match.c | 32 ++-- swad_match.h | 2 +- swad_match_database.c | 2 +- swad_match_database.h | 2 +- swad_match_result.c | 18 +- swad_message.c | 4 +- swad_notice.c | 2 +- swad_notice_database.c | 2 +- swad_notice_database.h | 2 +- swad_notification.c | 16 +- swad_photo.c | 6 +- swad_place.c | 8 +- swad_place.h | 2 +- swad_place_database.c | 2 +- swad_place_database.h | 2 +- swad_plugin.c | 18 +- swad_plugin.h | 2 +- swad_plugin_database.c | 2 +- swad_plugin_database.h | 2 +- swad_program.c | 30 ++-- swad_program_database.c | 4 +- swad_program_database.h | 4 +- swad_program_resource.c | 32 ++-- swad_program_resource.h | 2 +- swad_project.c | 38 ++-- swad_project.h | 2 +- swad_project_database.c | 2 +- swad_project_database.h | 2 +- swad_question.c | 2 +- swad_question_database.c | 2 +- swad_question_database.h | 2 +- swad_record.c | 12 +- swad_report.c | 6 +- swad_room.c | 26 +-- swad_room_database.c | 2 +- swad_room_database.h | 2 +- swad_rubric.c | 18 +- swad_rubric.h | 4 +- swad_rubric_criteria.c | 10 +- swad_rubric_criteria.h | 2 +- swad_rubric_database.c | 4 +- swad_rubric_database.h | 4 +- swad_statistic.c | 14 +- swad_survey.c | 24 +-- swad_survey.h | 4 +- swad_survey_database.c | 2 +- swad_survey_database.h | 2 +- swad_system_config.c | 4 +- swad_test.c | 2 +- swad_timeline.c | 2 +- swad_timeline_comment.c | 10 +- swad_timeline_comment.h | 2 +- swad_timeline_database.c | 6 +- swad_timeline_database.h | 6 +- swad_timeline_favourite.c | 12 +- swad_timeline_note.c | 18 +- swad_timeline_note.h | 2 +- swad_timeline_notification.c | 8 +- swad_timeline_publication.c | 8 +- swad_timeline_publication.h | 2 +- swad_timeline_share.c | 6 +- swad_timetable.c | 4 +- swad_user.c | 18 +- 160 files changed, 1001 insertions(+), 996 deletions(-) diff --git a/swad_API.c b/swad_API.c index f7b461df..841947cb 100644 --- a/swad_API.c +++ b/swad_API.c @@ -298,11 +298,11 @@ static bool API_WriteRowFileBrowser (FILE *XML,unsigned Level, const char *FileName); static void API_IndentXMLLine (FILE *XML,unsigned Level); -static void API_GetDataOfLocation (struct soap *soap, - struct swad__location *location, - time_t *CheckInTime, - MYSQL_RES **mysql_res, - unsigned NumLocs); +static void API_GetLocationData (struct soap *soap, + struct swad__location *location, + time_t *CheckInTime, + MYSQL_RES **mysql_res, + unsigned NumLocs); static void API_ResetLocation (struct soap *soap, struct swad__location *location); @@ -914,7 +914,7 @@ int swad__loginBySessionKey (struct soap *soap, /***** Get course (row[2]) *****/ Gbl.Hierarchy.Crs.CrsCod = Str_ConvertStrCodToLongCod (row[2]); - Crs_GetDataOfCourseByCod (&Gbl.Hierarchy.Crs); + Crs_GetCourseDataByCod (&Gbl.Hierarchy.Crs); loginBySessionKeyOut->courseCode = (int) Gbl.Hierarchy.Crs.CrsCod; Str_Copy (loginBySessionKeyOut->courseName,Gbl.Hierarchy.Crs.FullName, Cns_HIERARCHY_MAX_BYTES_FULL_NAME); @@ -925,7 +925,7 @@ int swad__loginBySessionKey (struct soap *soap, /***** Get degree (row[1]) *****/ Gbl.Hierarchy.Deg.DegCod = Str_ConvertStrCodToLongCod (row[1]); - Deg_GetDataOfDegreeByCod (&Gbl.Hierarchy.Deg); + Deg_GetDegreeDataByCod (&Gbl.Hierarchy.Deg); loginBySessionKeyOut->degreeCode = (int) Gbl.Hierarchy.Deg.DegCod; Str_Copy (loginBySessionKeyOut->degreeName,Gbl.Hierarchy.Deg.FullName, Cns_HIERARCHY_MAX_BYTES_FULL_NAME); @@ -2286,7 +2286,7 @@ int swad__getAttendanceEvents (struct soap *soap, "Requester must be a teacher"); /***** Query list of attendance events *****/ - NumAttEvents = Att_DB_GetDataOfAllAttEvents (&mysql_res,courseCode); + NumAttEvents = Att_DB_GetAllEventsData (&mysql_res,courseCode); getAttendanceEventsOut->eventsArray.__size = getAttendanceEventsOut->numEvents = (int) NumAttEvents; @@ -2307,7 +2307,7 @@ int swad__getAttendanceEvents (struct soap *soap, row = mysql_fetch_row (mysql_res); /* Get attendance event (except Txt) */ - Att_GetAttendanceEventDataFromRow (row,&Event); + Att_GetEventDataFromRow (row,&Event); getAttendanceEventsOut->eventsArray.__ptr[NumAttEvent].attendanceEventCode = (int) Event.AttCod; getAttendanceEventsOut->eventsArray.__ptr[NumAttEvent].hidden = Event.Hidden ? 1 : @@ -2472,7 +2472,7 @@ int swad__sendAttendanceEvent (struct soap *soap, /* Course code */ if (Event.AttCod > 0) // The event already exists { - Att_GetDataOfAttEventByCod (&Event); + Att_GetEventDataByCod (&Event); if (Event.CrsCod != (long) courseCode) return soap_receiver_fault (soap, "Request forbidden", @@ -2512,9 +2512,9 @@ int swad__sendAttendanceEvent (struct soap *soap, /***** Create or update attendance event *****/ if (ItsANewAttEvent) - Att_CreateAttEvent (&Event,text); // Add new attendance event to database + Att_CreateEvent (&Event,text); // Add new attendance event to database else - Att_UpdateAttEvent (&Event,text); // Modify existing attendance event + Att_UpdateEvent (&Event,text); // Modify existing attendance event /***** Free memory for list of selected groups *****/ Grp_FreeListCodSelectedGrps (); @@ -2555,7 +2555,7 @@ int swad__removeAttendanceEvent (struct soap *soap, /* Course code */ if (Event.AttCod > 0) // The event already exists { - Att_GetDataOfAttEventByCod (&Event); + Att_GetEventDataByCod (&Event); Gbl.Hierarchy.Crs.CrsCod = Event.CrsCod; } else @@ -2584,7 +2584,7 @@ int swad__removeAttendanceEvent (struct soap *soap, "Requester must be a teacher"); /***** Remove the attendance event from database *****/ - Att_RemoveAttEventFromDB (Event.AttCod); + Att_RemoveEventFromDB (Event.AttCod); removeAttendanceEventOut->attendanceEventCode = Event.AttCod; @@ -2663,7 +2663,7 @@ int swad__getAttendanceUsers (struct soap *soap, /***** Get course of this attendance event *****/ Event.AttCod = (long) attendanceEventCode; - Att_GetDataOfAttEventByCod (&Event); + Att_GetEventDataByCod (&Event); Gbl.Hierarchy.Crs.CrsCod = Event.CrsCod; /***** Get some of my data *****/ @@ -2685,7 +2685,7 @@ int swad__getAttendanceUsers (struct soap *soap, "AttCod", Event.AttCod); - NumUsrs = Att_DB_GetListUsrsInAttEvent (&mysql_res,Event.AttCod,AttEventIsAsociatedToGrps); + NumUsrs = Att_DB_GetListUsrsInEvent (&mysql_res,Event.AttCod,AttEventIsAsociatedToGrps); getAttendanceUsersOut->numUsers = getAttendanceUsersOut->usersArray.__size = (int) NumUsrs; @@ -2810,7 +2810,7 @@ int swad__sendAttendanceUsers (struct soap *soap, /***** Get course of this attendance event *****/ Event.AttCod = (long) attendanceEventCode; - if (!Att_GetDataOfAttEventByCod (&Event)) + if (!Att_GetEventDataByCod (&Event)) return SOAP_OK; // return with success = 0 Gbl.Hierarchy.Crs.CrsCod = Event.CrsCod; @@ -2833,7 +2833,7 @@ int swad__sendAttendanceUsers (struct soap *soap, /***** Purge absent users without comments from table *****/ if (setOthersAsAbsent) - Att_DB_RemoveUsrsAbsentWithoutCommentsFromAttEvent (Event.AttCod); + Att_DB_RemoveUsrsAbsentWithoutCommentsFromEvent (Event.AttCod); sendAttendanceUsersOut->success = 1; @@ -2931,7 +2931,7 @@ int swad__getNotifications (struct soap *soap, /* Get course (row[7]) */ Hie.Crs.CrsCod = Str_ConvertStrCodToLongCod (row[7]); - Crs_GetDataOfCourseByCod (&Hie.Crs); + Crs_GetCourseDataByCod (&Hie.Crs); /* Get user's code of the user who caused the event (row[3]) */ Gbl.Usrs.Other.UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[3]); @@ -2979,15 +2979,15 @@ int swad__getNotifications (struct soap *soap, /* Get institution (row[4]) */ Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[4]); - Ins_GetDataOfInstitByCod (&Hie.Ins); + Ins_GetInstitDataByCod (&Hie.Ins); /* Get center (row[5]) */ Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[5]); - Ctr_GetDataOfCenterByCod (&Hie.Ctr); + Ctr_GetCenterDataByCod (&Hie.Ctr); /* Get degree (row[6]) */ Hie.Deg.DegCod = Str_ConvertStrCodToLongCod (row[6]); - Deg_GetDataOfDegreeByCod (&Hie.Deg); + Deg_GetDegreeDataByCod (&Hie.Deg); /* Get message/post/... code (row[8]) */ Cod = Str_ConvertStrCodToLongCod (row[8]); @@ -3952,7 +3952,7 @@ int swad__getTrivialQuestion (struct soap *soap, if (QstCod > 0) { /***** Get answer from database *****/ - NumAnss = Qst_DB_GetDataOfAnswers (&mysql_res,QstCod, + NumAnss = Qst_DB_GetAnswersData (&mysql_res,QstCod, false); // Don't shuffle getTrivialQuestionOut->answersArray.__size = (int) NumAnss; @@ -4209,7 +4209,7 @@ int swad__getMatches (struct soap *soap, return soap_sender_fault (soap, "Bad game code", "Game code must be a integer greater than 0"); - Gam_GetDataOfGameByCod (&Game); + Gam_GetGameDataByCod (&Game); /***** Get some of my data *****/ if (!API_GetSomeUsrDataFromUsrCod (&Gbl.Usrs.Me.UsrDat,Gbl.Hierarchy.Crs.CrsCod)) @@ -4370,14 +4370,14 @@ int swad__getMatchStatus (struct soap *soap, return soap_sender_fault (soap, "Bad game code", "Game code must be a integer greater than 0"); - Gam_GetDataOfGameByCod (&Game); + Gam_GetGameDataByCod (&Game); /***** Get match data from database *****/ if (Match.MchCod <= 0) return soap_sender_fault (soap, "Bad match code", "Match code must be a integer greater than 0"); - Mch_GetDataOfMatchByCod (&Match); + Mch_GetMatchDataByCod (&Match); /* Check that match belongs to game */ if (Match.GamCod != Game.GamCod) @@ -4492,14 +4492,14 @@ int swad__answerMatchQuestion (struct soap *soap, return soap_sender_fault (soap, "Bad game code", "Game code must be a integer greater than 0"); - Gam_GetDataOfGameByCod (&Game); + Gam_GetGameDataByCod (&Game); /***** Get match data from database *****/ if (Match.MchCod <= 0) return soap_sender_fault (soap, "Bad match code", "Match code must be a integer greater than 0"); - Mch_GetDataOfMatchByCod (&Match); + Mch_GetMatchDataByCod (&Match); /***** Check that match belongs to game *****/ if (Match.GamCod != Game.GamCod) @@ -5184,7 +5184,7 @@ int swad__getLocation (struct soap *soap, /***** Get location *****/ NumLocs = Roo_DB_GetLocationByMAC (&mysql_res,MACnum); - API_GetDataOfLocation (soap, + API_GetLocationData (soap, &(getLocationOut->location), NULL, // Don't get check in time &mysql_res,NumLocs); @@ -5271,7 +5271,7 @@ int swad__getLastLocation (struct soap *soap, { /***** Get list of locations *****/ NumLocs = Roo_DB_GetUsrLastLocation (&mysql_res,(long) userCode); - API_GetDataOfLocation (soap, + API_GetLocationData (soap, &(getLastLocationOut->location), &(getLastLocationOut->checkinTime), // Get check in time &mysql_res,NumLocs); @@ -5290,11 +5290,11 @@ int swad__getLastLocation (struct soap *soap, /************************* Get assignment data *******************************/ /*****************************************************************************/ -static void API_GetDataOfLocation (struct soap *soap, - struct swad__location *location, - time_t *CheckInTime, - MYSQL_RES **mysql_res, - unsigned NumLocs) +static void API_GetLocationData (struct soap *soap, + struct swad__location *location, + time_t *CheckInTime, + MYSQL_RES **mysql_res, + unsigned NumLocs) { MYSQL_ROW row; size_t Length; diff --git a/swad_account.c b/swad_account.c index 54c3b787..3e9f088f 100644 --- a/swad_account.c +++ b/swad_account.c @@ -977,7 +977,7 @@ void Acc_CompletelyEliminateAccount (struct Usr_Data *UsrDat, Prj_RemoveUsrFromProjects (UsrDat->UsrCod); /***** Remove user from all attendance events *****/ - Att_DB_RemoveUsrFromAllAttEvents (UsrDat->UsrCod); + Att_DB_RemoveUsrFromAllEvents (UsrDat->UsrCod); /***** Remove user from all groups of all courses *****/ Grp_RemUsrFromAllGrps (UsrDat->UsrCod); diff --git a/swad_action_list.c b/swad_action_list.c index 5adf9eec..b28ef728 100644 --- a/swad_action_list.c +++ b/swad_action_list.c @@ -1344,7 +1344,7 @@ const struct Act_Actions ActLst_Actions[ActLst_NUM_ACTIONS] = [ActLstStd ] = { 678, 1,TabUsr,ActLstStd ,0x3F8,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Usr_SeeStudents ,"users" }, [ActLstTch ] = { 679, 2,TabUsr,ActLstTch ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Usr_SeeTeachers ,"user-tie" }, [ActLstOth ] = {1186, 3,TabUsr,ActLstOth ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Usr_ListDataAdms ,"user-friends" }, - [ActSeeAtt ] = { 861, 4,TabUsr,ActSeeAtt ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_SeeAttEvents ,"calendar-check" }, + [ActSeeAtt ] = { 861, 4,TabUsr,ActSeeAtt ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_SeeEvents ,"calendar-check" }, [ActReqSignUp ] = {1054, 5,TabUsr,ActReqSignUp , 0,0x006, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Enr_ReqSignUpInCrs ,"hand-point-up" }, [ActSeeSignUpReq ] = {1057, 6,TabUsr,ActSeeSignUpReq ,0x3E0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Enr_ShowEnrolmentRequests ,"hand-point-up" }, [ActLstCon ] = { 995, 7,TabUsr,ActLstCon ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Con_ShowConnectedUsrs ,"user-clock" }, @@ -1421,18 +1421,18 @@ const struct Act_Actions ActLst_Actions[ActLst_NUM_ACTIONS] = [ActPrnLstMyAtt ] = {1474,-1,TabUnk,ActSeeAtt ,0x008, 0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,NULL ,Att_PrintMyAttendanceCrs ,NULL}, [ActSeeLstUsrAtt ] = {1074,-1,TabUnk,ActSeeAtt ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_ListUsrsAttendanceCrs ,NULL}, [ActPrnLstUsrAtt ] = {1075,-1,TabUnk,ActSeeAtt ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,NULL ,Att_PrintUsrsAttendanceCrs ,NULL}, - [ActFrmNewAtt ] = {1063,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_ReqCreatOrEditAttEvent ,NULL}, - [ActEdiOneAtt ] = {1064,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_ReqCreatOrEditAttEvent ,NULL}, - [ActNewAtt ] = {1065,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_ReceiveFormAttEvent ,NULL}, - [ActChgAtt ] = {1066,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_ReceiveFormAttEvent ,NULL}, - [ActReqRemAtt ] = {1067,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_AskRemAttEvent ,NULL}, - [ActRemAtt ] = {1068,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_GetAndRemAttEvent ,NULL}, - [ActHidAtt ] = {1069,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_HideAttEvent ,NULL}, - [ActUnhAtt ] = {1070,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_UnhideAttEvent ,NULL}, - [ActSeeOneAtt ] = {1071,-1,TabUnk,ActSeeAtt ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_SeeOneAttEvent ,NULL}, + [ActFrmNewAtt ] = {1063,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_ReqCreatOrEditEvent ,NULL}, + [ActEdiOneAtt ] = {1064,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_ReqCreatOrEditEvent ,NULL}, + [ActNewAtt ] = {1065,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_ReceiveFormEvent ,NULL}, + [ActChgAtt ] = {1066,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_ReceiveFormEvent ,NULL}, + [ActReqRemAtt ] = {1067,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_AskRemEvent ,NULL}, + [ActRemAtt ] = {1068,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_GetAndRemEvent ,NULL}, + [ActHidAtt ] = {1069,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_HideEvent ,NULL}, + [ActUnhAtt ] = {1070,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_UnhideEvent ,NULL}, + [ActSeeOneAtt ] = {1071,-1,TabUnk,ActSeeAtt ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_SeeOneEvent ,NULL}, [ActReqLnkAtt ] = {1938,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,AttRsc_GetLinkToEvent ,NULL}, - [ActRecAttStd ] = {1072,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_RegisterStudentsInAttEvent ,NULL}, - [ActRecAttMe ] = {1076,-1,TabUnk,ActSeeAtt ,0x008, 0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_RegisterMeAsStdInAttEvent ,NULL}, + [ActRecAttStd ] = {1072,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_RegisterStudentsInEvent ,NULL}, + [ActRecAttMe ] = {1076,-1,TabUnk,ActSeeAtt ,0x008, 0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_RegisterMeAsStdInEvent ,NULL}, [ActSignUp ] = {1056,-1,TabUnk,ActReqSignUp , 0,0x006, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Enr_SignUpInCrs ,NULL}, [ActUpdSignUpReq ] = {1522,-1,TabUnk,ActSeeSignUpReq ,0x3E0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,0x3C0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Enr_UpdateEnrolmentRequests ,NULL}, diff --git a/swad_agenda.c b/swad_agenda.c index f9e7b90c..79302675 100644 --- a/swad_agenda.c +++ b/swad_agenda.c @@ -115,7 +115,7 @@ static void Agd_GetPars (struct Agd_Agenda *Agenda, static void Agd_GetListEvents (struct Agd_Agenda *Agenda, Agd_AgendaType_t AgendaType); -static void Agd_GetDataOfEventByCod (struct Agd_Event *AgdEvent); +static void Agd_GetventDataByCod (struct Agd_Event *AgdEvent); static void Agd_FreeListEvents (struct Agd_Agenda *Agenda); @@ -789,7 +789,7 @@ static void Agd_ShowOneEvent (struct Agd_Agenda *Agenda, AgdEvent.UsrCod = Gbl.Usrs.Other.UsrDat.UsrCod; break; } - Agd_GetDataOfEventByCod (&AgdEvent); + Agd_GetventDataByCod (&AgdEvent); /***** Set anchor string *****/ Frm_SetAnchorStr (AgdEvent.AgdCod,&Anchor); @@ -1079,13 +1079,13 @@ static void Agd_GetListEvents (struct Agd_Agenda *Agenda, /*********************** Get event data using its code ***********************/ /*****************************************************************************/ -static void Agd_GetDataOfEventByCod (struct Agd_Event *AgdEvent) +static void Agd_GetventDataByCod (struct Agd_Event *AgdEvent) { MYSQL_RES *mysql_res; MYSQL_ROW row; /***** Get data of event from database *****/ - if (Agd_DB_GetDataOfEventByCod (&mysql_res,AgdEvent)) // Event found... + if (Agd_DB_GetEventDataByCod (&mysql_res,AgdEvent)) // Event found... { /* Get row: row[0] AgdCod @@ -1176,7 +1176,7 @@ void Agd_AskRemEvent (void) /***** Get data of the event from database *****/ AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; - Agd_GetDataOfEventByCod (&AgdEvent); + Agd_GetventDataByCod (&AgdEvent); /***** Show question and button to remove event *****/ Agenda.AgdCodToEdit = AgdEvent.AgdCod; @@ -1211,7 +1211,7 @@ void Agd_RemoveEvent (void) /***** Get data of the event from database *****/ AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; - Agd_GetDataOfEventByCod (&AgdEvent); + Agd_GetventDataByCod (&AgdEvent); /***** Remove event *****/ Agd_DB_RemoveEvent (&AgdEvent); @@ -1244,7 +1244,7 @@ void Agd_HideEvent (void) /***** Get data of the event from database *****/ AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; - Agd_GetDataOfEventByCod (&AgdEvent); + Agd_GetventDataByCod (&AgdEvent); /***** Hide event *****/ Agd_DB_HideOrUnhideEvent (AgdEvent.AgdCod,AgdEvent.UsrCod,true); @@ -1273,7 +1273,7 @@ void Agd_UnhideEvent (void) /***** Get data of the event from database *****/ AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; - Agd_GetDataOfEventByCod (&AgdEvent); + Agd_GetventDataByCod (&AgdEvent); /***** Unhide event *****/ Agd_DB_HideOrUnhideEvent (AgdEvent.AgdCod,AgdEvent.UsrCod,false); @@ -1303,7 +1303,7 @@ void Agd_MakeEventPrivate (void) /***** Get data of the event from database *****/ AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; - Agd_GetDataOfEventByCod (&AgdEvent); + Agd_GetventDataByCod (&AgdEvent); /***** Make event private *****/ Agd_DB_MakeEventPrivate (&AgdEvent); @@ -1337,7 +1337,7 @@ void Agd_MakeEventPublic (void) /***** Get data of the event from database *****/ AgdEvent.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; - Agd_GetDataOfEventByCod (&AgdEvent); + Agd_GetventDataByCod (&AgdEvent); /***** Make event public *****/ Agd_DB_MakeEventPublic (&AgdEvent); @@ -1399,7 +1399,7 @@ void Agd_ReqCreatOrEditEvent (void) else { /* Get data of the event from database */ - Agd_GetDataOfEventByCod (&AgdEvent); + Agd_GetventDataByCod (&AgdEvent); /* Get text of the event from database */ Agd_DB_GetEventTxt (&AgdEvent,Txt); diff --git a/swad_agenda_database.c b/swad_agenda_database.c index c0f70dd3..256d5a82 100644 --- a/swad_agenda_database.c +++ b/swad_agenda_database.c @@ -172,8 +172,8 @@ unsigned Agd_DB_GetListEvents (MYSQL_RES **mysql_res, /*********************** Get event data using its code ***********************/ /*****************************************************************************/ -unsigned Agd_DB_GetDataOfEventByCod (MYSQL_RES **mysql_res, - const struct Agd_Event *AgdEvent) +unsigned Agd_DB_GetEventDataByCod (MYSQL_RES **mysql_res, + const struct Agd_Event *AgdEvent) { /***** Get data of event from database *****/ return (unsigned) diff --git a/swad_agenda_database.h b/swad_agenda_database.h index 16c93f2d..1f25ca13 100644 --- a/swad_agenda_database.h +++ b/swad_agenda_database.h @@ -39,8 +39,8 @@ unsigned Agd_DB_GetListEvents (MYSQL_RES **mysql_res, const struct Agd_Agenda *Agenda, Agd_AgendaType_t AgendaType); -unsigned Agd_DB_GetDataOfEventByCod (MYSQL_RES **mysql_res, - const struct Agd_Event *AgdEvent); +unsigned Agd_DB_GetEventDataByCod (MYSQL_RES **mysql_res, + const struct Agd_Event *AgdEvent); void Agd_DB_GetEventTxt (const struct Agd_Event *AgdEvent, char Txt[Cns_MAX_BYTES_TEXT + 1]); diff --git a/swad_assignment.c b/swad_assignment.c index 404d26ff..a9f57523 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -493,7 +493,7 @@ static void Asg_ShowAssignmentRow (struct Asg_Assignments *Assignments, char Txt[Cns_MAX_BYTES_TEXT + 1]; /***** Get data of this assignment *****/ - Asg_GetDataOfAssignmentByCod (&Assignments->Asg); + Asg_GetAssignmentDataByCod (&Assignments->Asg); /***** Set anchor string *****/ Frm_SetAnchorStr (Assignments->Asg.AsgCod,&Anchor); @@ -824,7 +824,7 @@ static void Asg_GetListAssignments (struct Asg_Assignments *Assignments) /******************* Get assignment data using its code **********************/ /*****************************************************************************/ -void Asg_GetDataOfAssignmentByCod (struct Asg_Assignment *Asg) +void Asg_GetAssignmentDataByCod (struct Asg_Assignment *Asg) { MYSQL_RES *mysql_res; unsigned NumAsgs; @@ -832,7 +832,7 @@ void Asg_GetDataOfAssignmentByCod (struct Asg_Assignment *Asg) if (Asg->AsgCod > 0) { /***** Build query *****/ - NumAsgs = Asg_DB_GetDataOfAssignmentByCod (&mysql_res,Asg->AsgCod); + NumAsgs = Asg_DB_GetAssignmentDataByCod (&mysql_res,Asg->AsgCod); /***** Get data of assignment *****/ Asg_GetAssignmentDataFromRow (&mysql_res,Asg,NumAsgs); @@ -849,7 +849,7 @@ void Asg_GetDataOfAssignmentByCod (struct Asg_Assignment *Asg) /*************** Get assignment data using its folder name *******************/ /*****************************************************************************/ -void Asg_GetDataOfAssignmentByFolder (struct Asg_Assignment *Asg) +void Asg_GetAssignmentDataByFolder (struct Asg_Assignment *Asg) { MYSQL_RES *mysql_res; unsigned NumAsgs; @@ -857,7 +857,7 @@ void Asg_GetDataOfAssignmentByFolder (struct Asg_Assignment *Asg) if (Asg->Folder[0]) { /***** Query database *****/ - NumAsgs = Asg_DB_GetDataOfAssignmentByFolder (&mysql_res,Asg->Folder); + NumAsgs = Asg_DB_GetAssignmentDataByFolder (&mysql_res,Asg->Folder); /***** Get data of assignment *****/ Asg_GetAssignmentDataFromRow (&mysql_res,Asg,NumAsgs); @@ -1025,7 +1025,7 @@ void Asg_ReqRemAssignment (void) Assignments.Asg.AsgCod = ParCod_GetAndCheckPar (ParCod_Asg); /***** Get data of the assignment from database *****/ - Asg_GetDataOfAssignmentByCod (&Assignments.Asg); + Asg_GetAssignmentDataByCod (&Assignments.Asg); /***** Show question and button to remove the assignment *****/ Ale_ShowAlertAndButton (ActRemAsg,NULL,NULL, @@ -1059,7 +1059,7 @@ void Asg_RemoveAssignment (void) Assignments.Asg.AsgCod = ParCod_GetAndCheckPar (ParCod_Asg); /***** Get data of the assignment from database *****/ - Asg_GetDataOfAssignmentByCod (&Assignments.Asg); // Inside this function, the course is checked to be the current one + Asg_GetAssignmentDataByCod (&Assignments.Asg); // Inside this function, the course is checked to be the current one /***** Remove all folders associated to this assignment *****/ if (Assignments.Asg.Folder[0]) @@ -1102,7 +1102,7 @@ void Asg_HideAssignment (void) Assignments.Asg.AsgCod = ParCod_GetAndCheckPar (ParCod_Asg); /***** Get data of the assignment from database *****/ - Asg_GetDataOfAssignmentByCod (&Assignments.Asg); + Asg_GetAssignmentDataByCod (&Assignments.Asg); /***** Hide assignment *****/ Asg_DB_HideOrUnhideAssignment (Assignments.Asg.AsgCod,true); @@ -1131,7 +1131,7 @@ void Asg_UnhideAssignment (void) Assignments.Asg.AsgCod = ParCod_GetAndCheckPar (ParCod_Asg); /***** Get data of the assignment from database *****/ - Asg_GetDataOfAssignmentByCod (&Assignments.Asg); + Asg_GetAssignmentDataByCod (&Assignments.Asg); /***** Unhide assignment *****/ Asg_DB_HideOrUnhideAssignment (Assignments.Asg.AsgCod,false); @@ -1197,7 +1197,7 @@ void Asg_ReqCreatOrEditAsg (void) else { /* Get data of the assignment from database */ - Asg_GetDataOfAssignmentByCod (&Assignments.Asg); + Asg_GetAssignmentDataByCod (&Assignments.Asg); /* Get text of the assignment from database */ Asg_DB_GetAssignmentTxtByCod (Assignments.Asg.AsgCod,Txt); @@ -1411,7 +1411,7 @@ void Asg_ReceiveFormAssignment (void) { /***** Get data of the old (current) assignment from database *****/ OldAsg.AsgCod = Assignments.Asg.AsgCod; - Asg_GetDataOfAssignmentByCod (&OldAsg); + Asg_GetAssignmentDataByCod (&OldAsg); } /***** Get start/end date-times *****/ diff --git a/swad_assignment.h b/swad_assignment.h index 59dbfb6e..1cc434a9 100644 --- a/swad_assignment.h +++ b/swad_assignment.h @@ -91,8 +91,8 @@ void Asg_ShowOneAssignmentInBox (struct Asg_Assignments *Assignments); Dat_StartEndTime_t Asg_GetParAsgOrder (void); void Asg_ReqCreatOrEditAsg (void); -void Asg_GetDataOfAssignmentByCod (struct Asg_Assignment *Asg); -void Asg_GetDataOfAssignmentByFolder (struct Asg_Assignment *Asg); +void Asg_GetAssignmentDataByCod (struct Asg_Assignment *Asg); +void Asg_GetAssignmentDataByFolder (struct Asg_Assignment *Asg); void Asg_GetNotifAssignment (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], char **ContentStr, diff --git a/swad_assignment_database.c b/swad_assignment_database.c index d2bd1345..6bfe6766 100644 --- a/swad_assignment_database.c +++ b/swad_assignment_database.c @@ -136,7 +136,7 @@ unsigned Asg_DB_GetListAssignmentsAllGrps (MYSQL_RES **mysql_res, /******************* Get assignment data using its code **********************/ /*****************************************************************************/ -unsigned Asg_DB_GetDataOfAssignmentByCod (MYSQL_RES **mysql_res,long AsgCod) +unsigned Asg_DB_GetAssignmentDataByCod (MYSQL_RES **mysql_res,long AsgCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get assignment data", @@ -159,8 +159,8 @@ unsigned Asg_DB_GetDataOfAssignmentByCod (MYSQL_RES **mysql_res,long AsgCod) /**************** Get assignment data using its folder name ******************/ /*****************************************************************************/ -unsigned Asg_DB_GetDataOfAssignmentByFolder (MYSQL_RES **mysql_res, - const char Folder[Brw_MAX_BYTES_FOLDER + 1]) +unsigned Asg_DB_GetAssignmentDataByFolder (MYSQL_RES **mysql_res, + const char Folder[Brw_MAX_BYTES_FOLDER + 1]) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get assignment data", diff --git a/swad_assignment_database.h b/swad_assignment_database.h index ec9b57fe..fb686b34 100644 --- a/swad_assignment_database.h +++ b/swad_assignment_database.h @@ -42,9 +42,9 @@ unsigned Asg_DB_GetListAssignmentsMyGrps (MYSQL_RES **mysql_res, unsigned Asg_DB_GetListAssignmentsAllGrps (MYSQL_RES **mysql_res, Dat_StartEndTime_t SelectedOrder); -unsigned Asg_DB_GetDataOfAssignmentByCod (MYSQL_RES **mysql_res,long AsgCod); -unsigned Asg_DB_GetDataOfAssignmentByFolder (MYSQL_RES **mysql_res, - const char Folder[Brw_MAX_BYTES_FOLDER + 1]); +unsigned Asg_DB_GetAssignmentDataByCod (MYSQL_RES **mysql_res,long AsgCod); +unsigned Asg_DB_GetAssignmentDataByFolder (MYSQL_RES **mysql_res, + const char Folder[Brw_MAX_BYTES_FOLDER + 1]); unsigned Asg_DB_GetAssignmentTitleAndTxtByCod (MYSQL_RES **mysql_res,long AsgCod); void Asg_DB_GetAssignmentTitleByCod (long AsgCod,char Title[Asg_MAX_BYTES_ASSIGNMENT_TITLE + 1]); void Asg_DB_GetAssignmentTxtByCod (long AsgCod,char Txt[Cns_MAX_BYTES_TEXT + 1]); diff --git a/swad_attendance.c b/swad_attendance.c index f7082648..9ca7b457 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -85,52 +85,52 @@ typedef enum static void Att_ResetEvents (struct Att_Events *Events); -static void Att_ShowAllAttEvents (struct Att_Events *Events); +static void Att_ShowAllEvents (struct Att_Events *Events); static void Att_ParsWhichGroupsToShow (void *Events); -static void Att_PutIconsInListOfAttEvents (void *Events); -static void Att_PutIconToCreateNewAttEvent (struct Att_Events *Events); -static void Att_PutButtonToCreateNewAttEvent (struct Att_Events *Events); -static void Att_PutParsToCreateNewAttEvent (void *Events); +static void Att_PutIconsInListOfEvents (void *Events); +static void Att_PutIconToCreateNewEvent (struct Att_Events *Events); +static void Att_PutButtonToCreateNewEvent (struct Att_Events *Events); +static void Att_PutParsToCreateNewEvent (void *Events); static void Att_PutParsToListUsrsAttendance (void *Events); -static void Att_ShowOneAttEventRow (struct Att_Events *Events, - bool ShowOnlyThisAttEventComplete); -static void Att_WriteAttEventAuthor (struct Att_Event *Event); +static void Att_ShowOneEventRow (struct Att_Events *Events, + bool ShowOnlyThisAttEventComplete); +static void Att_WriteEventAuthor (struct Att_Event *Event); static Dat_StartEndTime_t Att_GetParAttOrder (void); -static void Att_PutFormsToRemEditOneAttEvent (struct Att_Events *Events, - const char *Anchor); +static void Att_PutFormsToRemEditOneEvent (struct Att_Events *Events, + const char *Anchor); static void Att_PutPars (void *Events); -static void Att_GetListAttEvents (struct Att_Events *Events, - Att_OrderNewestOldest_t OrderNewestOldest); -static void Att_GetDataOfAttEventByCodAndCheckCrs (struct Att_Event *Event); -static void Att_ResetAttendanceEvent (struct Att_Event *Event); +static void Att_GetListEvents (struct Att_Events *Events, + Att_OrderNewestOldest_t OrderNewestOldest); +static void Att_GetEventDataByCodAndCheckCrs (struct Att_Event *Event); +static void Att_ResetEvent (struct Att_Event *Event); -static void Att_FreeListAttEvents (struct Att_Events *Events); +static void Att_FreeListEvents (struct Att_Events *Events); static void Att_PutParAttCod (void *Events); -static void Att_ShowLstGrpsToEditAttEvent (long AttCod); +static void Att_ShowLstGrpsToEditEvent (long AttCod); static void Att_CreateGroups (long AttCod); -static void Att_GetAndWriteNamesOfGrpsAssociatedToAttEvent (struct Att_Event *Event); +static void Att_GetAndWriteNamesOfGrpsAssociatedToEvent (struct Att_Event *Event); static void Att_ShowEvent (struct Att_Events *Events); -static void Att_PutIconsOneAtt (void *Events); +static void Att_PutIconsOneEvent (void *Events); -static void Att_ListAttOnlyMeAsStudent (struct Att_Event *Event); -static void Att_ListAttStudents (struct Att_Events *Events); +static void Att_ListEventOnlyMeAsStudent (struct Att_Event *Event); +static void Att_ListEventStudents (struct Att_Events *Events); static void Att_WriteRowUsrToCallTheRoll (unsigned NumUsr, struct Usr_Data *UsrDat, struct Att_Event *Event); -static void Att_PutLinkAttEvent (struct Att_Event *Event, - const char *Title,const char *Txt); -static unsigned Att_GetNumUsrsFromAListWhoAreInAttEvent (long AttCod, - long LstSelectedUsrCods[], - unsigned NumUsrsInList); -static bool Att_CheckIfUsrIsPresentInAttEvent (long AttCod,long UsrCod); -static bool Att_CheckIfUsrIsPresentInAttEventAndGetComments (long AttCod,long UsrCod, - char CommentStd[Cns_MAX_BYTES_TEXT + 1], - char CommentTch[Cns_MAX_BYTES_TEXT + 1]); +static void Att_PutLinkEvent (struct Att_Event *Event, + const char *Title,const char *Txt); +static unsigned Att_GetNumUsrsFromAListWhoAreInEvent (long AttCod, + long LstSelectedUsrCods[], + unsigned NumUsrsInList); +static bool Att_CheckIfUsrIsPresentInEvent (long AttCod,long UsrCod); +static bool Att_CheckIfUsrIsPresentInEventAndGetComments (long AttCod,long UsrCod, + char CommentStd[Cns_MAX_BYTES_TEXT + 1], + char CommentTch[Cns_MAX_BYTES_TEXT + 1]); static void Att_ReqListOrPrintUsrsAttendanceCrs (void *TypeOfView); static void Att_ListOrPrintMyAttendanceCrs (Att_TypeOfView_t TypeOfView); @@ -183,7 +183,7 @@ static void Att_ResetEvents (struct Att_Events *Events) /************************ List all attendance events *************************/ /*****************************************************************************/ -void Att_SeeAttEvents (void) +void Att_SeeEvents (void) { struct Att_Events Events; @@ -196,17 +196,17 @@ void Att_SeeAttEvents (void) Events.CurrentPage = Pag_GetParPagNum (Pag_ATT_EVENTS); /***** Get list of attendance events *****/ - Att_GetListAttEvents (&Events,Att_NEWEST_FIRST); + Att_GetListEvents (&Events,Att_NEWEST_FIRST); /***** Show all attendance events *****/ - Att_ShowAllAttEvents (&Events); + Att_ShowAllEvents (&Events); } /*****************************************************************************/ /************************* Show all attendance events ************************/ /*****************************************************************************/ -static void Att_ShowAllAttEvents (struct Att_Events *Events) +static void Att_ShowAllEvents (struct Att_Events *Events) { extern const char *Hlp_USERS_Attendance; extern const char *Txt_Events; @@ -230,7 +230,7 @@ static void Att_ShowAllAttEvents (struct Att_Events *Events) /***** Begin box *****/ Box_BoxBegin ("100%",Txt_Events, - Att_PutIconsInListOfAttEvents,Events, + Att_PutIconsInListOfEvents,Events, Hlp_USERS_Attendance,Box_NOT_CLOSABLE); /***** Select whether show only my groups or all groups *****/ @@ -294,11 +294,11 @@ static void Att_ShowAllAttEvents (struct Att_Events *Events) { /***** Get data of this attendance event *****/ Events->Event.AttCod = Events->Lst[NumAttEvent - 1].AttCod; - Att_GetDataOfAttEventByCodAndCheckCrs (&Events->Event); - Events->Event.NumStdsTotal = Att_DB_GetNumStdsTotalWhoAreInAttEvent (Events->Event.AttCod); + Att_GetEventDataByCodAndCheckCrs (&Events->Event); + Events->Event.NumStdsTotal = Att_DB_GetNumStdsTotalWhoAreInEvent (Events->Event.AttCod); /***** Show one attendance event *****/ - Att_ShowOneAttEventRow (Events, + Att_ShowOneEventRow (Events, false); // Don't show only this event } @@ -314,13 +314,13 @@ static void Att_ShowAllAttEvents (struct Att_Events *Events) /***** Button to create a new attendance event *****/ if (ICanEdit) - Att_PutButtonToCreateNewAttEvent (Events); + Att_PutButtonToCreateNewEvent (Events); /***** End box *****/ Box_BoxEnd (); /***** Free list of attendance events *****/ - Att_FreeListAttEvents (Events); + Att_FreeListEvents (Events); } /*****************************************************************************/ @@ -340,7 +340,7 @@ static void Att_ParsWhichGroupsToShow (void *Events) /************* Put contextual icons in list of attendance events *************/ /*****************************************************************************/ -static void Att_PutIconsInListOfAttEvents (void *Events) +static void Att_PutIconsInListOfEvents (void *Events) { bool ICanEdit; @@ -350,7 +350,7 @@ static void Att_PutIconsInListOfAttEvents (void *Events) ICanEdit = (Gbl.Usrs.Me.Role.Logged == Rol_TCH || Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); if (ICanEdit) - Att_PutIconToCreateNewAttEvent ((struct Att_Events *) Events); + Att_PutIconToCreateNewEvent ((struct Att_Events *) Events); /***** Put icon to show attendance list *****/ if (((struct Att_Events *) Events)->Num) @@ -385,23 +385,23 @@ static void Att_PutIconsInListOfAttEvents (void *Events) /**************** Put icon to create a new attendance event ******************/ /*****************************************************************************/ -static void Att_PutIconToCreateNewAttEvent (struct Att_Events *Events) +static void Att_PutIconToCreateNewEvent (struct Att_Events *Events) { Ico_PutContextualIconToAdd (ActFrmNewAtt,NULL, - Att_PutParsToCreateNewAttEvent,Events); + Att_PutParsToCreateNewEvent,Events); } /*****************************************************************************/ /**************** Put button to create a new attendance event ****************/ /*****************************************************************************/ -static void Att_PutButtonToCreateNewAttEvent (struct Att_Events *Events) +static void Att_PutButtonToCreateNewEvent (struct Att_Events *Events) { extern const char *Txt_New_event; /***** Begin form *****/ Frm_BeginForm (ActFrmNewAtt); - Att_PutParsToCreateNewAttEvent (Events); + Att_PutParsToCreateNewEvent (Events); /***** Button to create new event *****/ Btn_PutConfirmButton (Txt_New_event); @@ -414,7 +414,7 @@ static void Att_PutButtonToCreateNewAttEvent (struct Att_Events *Events) /************** Put parameters to create a new attendance event **************/ /*****************************************************************************/ -static void Att_PutParsToCreateNewAttEvent (void *Events) +static void Att_PutParsToCreateNewEvent (void *Events) { Grp_WhichGroups_t WhichGroups; @@ -449,8 +449,8 @@ static void Att_PutParsToListUsrsAttendance (void *Events) /*****************************************************************************/ // Only Event->AttCod must be filled -static void Att_ShowOneAttEventRow (struct Att_Events *Events, - bool ShowOnlyThisAttEventComplete) +static void Att_ShowOneEventRow (struct Att_Events *Events, + bool ShowOnlyThisAttEventComplete) { extern const char *Txt_View_event; char *Anchor = NULL; @@ -470,7 +470,7 @@ static void Att_ShowOneAttEventRow (struct Att_Events *Events, { HTM_TD_Begin ("rowspan=\"2\" class=\"CONTEXT_COL %s\"", The_GetColorRows ()); - Att_PutFormsToRemEditOneAttEvent (Events,Anchor); + Att_PutFormsToRemEditOneEvent (Events,Anchor); HTM_TD_End (); } @@ -512,7 +512,7 @@ static void Att_ShowOneAttEventRow (struct Att_Events *Events, else HTM_TD_Begin ("class=\"LT %s\"",The_GetColorRows ()); HTM_ARTICLE_Begin (Anchor); - Att_PutLinkAttEvent (&Events->Event,Txt_View_event,Events->Event.Title); + Att_PutLinkEvent (&Events->Event,Txt_View_event,Events->Event.Title); HTM_ARTICLE_End (); HTM_TD_End (); @@ -539,11 +539,11 @@ static void Att_ShowOneAttEventRow (struct Att_Events *Events, HTM_TD_Begin ("colspan=\"2\" class=\"LT\""); else HTM_TD_Begin ("colspan=\"2\" class=\"LT %s\"",The_GetColorRows ()); - Att_WriteAttEventAuthor (&Events->Event); + Att_WriteEventAuthor (&Events->Event); HTM_TD_End (); /* Text of the attendance event */ - Att_DB_GetAttEventDescription (Events->Event.AttCod,Description); + Att_DB_GetEventDescription (Events->Event.AttCod,Description); Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML, Description,Cns_MAX_BYTES_TEXT,false); // Convert from HTML to recpectful HTML ALn_InsertLinks (Description,Cns_MAX_BYTES_TEXT,60); // Insert links @@ -552,7 +552,7 @@ static void Att_ShowOneAttEventRow (struct Att_Events *Events, else HTM_TD_Begin ("colspan=\"2\" class=\"LT %s\"",The_GetColorRows ()); if (Gbl.Crs.Grps.NumGrps) - Att_GetAndWriteNamesOfGrpsAssociatedToAttEvent (&Events->Event); + Att_GetAndWriteNamesOfGrpsAssociatedToEvent (&Events->Event); HTM_DIV_Begin ("class=\"%s_%s\"", Events->Event.Hidden ? "DAT_LIGHT" : @@ -573,7 +573,7 @@ static void Att_ShowOneAttEventRow (struct Att_Events *Events, /****************** Write the author of an attendance event ******************/ /*****************************************************************************/ -static void Att_WriteAttEventAuthor (struct Att_Event *Event) +static void Att_WriteEventAuthor (struct Att_Event *Event) { Usr_WriteAuthor1Line (Event->UsrCod,Event->Hidden); } @@ -595,8 +595,8 @@ static Dat_StartEndTime_t Att_GetParAttOrder (void) /************** Put a link (form) to edit one attendance event ***************/ /*****************************************************************************/ -static void Att_PutFormsToRemEditOneAttEvent (struct Att_Events *Events, - const char *Anchor) +static void Att_PutFormsToRemEditOneEvent (struct Att_Events *Events, + const char *Anchor) { static Act_Action_t ActionHideUnhide[2] = { @@ -604,7 +604,7 @@ static void Att_PutFormsToRemEditOneAttEvent (struct Att_Events *Events, [true ] = ActUnhAtt, // Hidden ==> action to unhide }; - if (Att_CheckIfICanEditAttEvents ()) + if (Att_CheckIfICanEditEvents ()) { /***** Icon to remove attendance event *****/ Ico_PutContextualIconToRemove (ActReqRemAtt,NULL, @@ -631,7 +631,7 @@ static void Att_PutFormsToRemEditOneAttEvent (struct Att_Events *Events, /******************* Check if I can edit calls for exams *********************/ /*****************************************************************************/ -bool Att_CheckIfICanEditAttEvents (void) +bool Att_CheckIfICanEditEvents (void) { static const bool ICanEditAttEvents[Rol_NUM_ROLES] = { @@ -664,8 +664,8 @@ static void Att_PutPars (void *Events) /************************ List all attendance events *************************/ /*****************************************************************************/ -static void Att_GetListAttEvents (struct Att_Events *Events, - Att_OrderNewestOldest_t OrderNewestOldest) +static void Att_GetListEvents (struct Att_Events *Events, + Att_OrderNewestOldest_t OrderNewestOldest) { extern unsigned (*Att_DB_GetListAttEvents[Grp_NUM_WHICH_GROUPS]) (MYSQL_RES **mysql_res, Dat_StartEndTime_t SelectedOrder, @@ -674,7 +674,7 @@ static void Att_GetListAttEvents (struct Att_Events *Events, unsigned NumAttEvent; if (Events->LstIsRead) - Att_FreeListAttEvents (Events); + Att_FreeListEvents (Events); /***** Get list of attendance events from database *****/ Events->Num = Att_DB_GetListAttEvents[Gbl.Crs.Grps.WhichGrps] (&mysql_res, @@ -708,9 +708,9 @@ static void Att_GetListAttEvents (struct Att_Events *Events, /********* Get attendance event data using its code and check course *********/ /*****************************************************************************/ -static void Att_GetDataOfAttEventByCodAndCheckCrs (struct Att_Event *Event) +static void Att_GetEventDataByCodAndCheckCrs (struct Att_Event *Event) { - if (Att_GetDataOfAttEventByCod (Event)) + if (Att_GetEventDataByCod (Event)) { if (Event->CrsCod != Gbl.Hierarchy.Crs.CrsCod) Err_WrongEventExit (); @@ -725,7 +725,7 @@ static void Att_GetDataOfAttEventByCodAndCheckCrs (struct Att_Event *Event) // Returns true if attendance event exists // This function can be called from web service, so do not display messages -bool Att_GetDataOfAttEventByCod (struct Att_Event *Event) +bool Att_GetEventDataByCod (struct Att_Event *Event) { MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -733,12 +733,12 @@ bool Att_GetDataOfAttEventByCod (struct Att_Event *Event) bool Found = false; /***** Reset attendance event data *****/ - Att_ResetAttendanceEvent (Event); + Att_ResetEvent (Event); if (Event->AttCod > 0) { /***** Build query *****/ - NumAttEvents = Att_DB_GetDataOfAttEventByCod (&mysql_res,Event->AttCod); + NumAttEvents = Att_DB_GetEventDataByCod (&mysql_res,Event->AttCod); /***** Get data of attendance event from database *****/ if ((Found = (NumAttEvents != 0))) // Attendance event found... @@ -747,7 +747,7 @@ bool Att_GetDataOfAttEventByCod (struct Att_Event *Event) row = mysql_fetch_row (mysql_res); /* Get attendance event (except Txt) */ - Att_GetAttendanceEventDataFromRow (row,Event); + Att_GetEventDataFromRow (row,Event); } /***** Free structure that stores the query result *****/ @@ -761,7 +761,7 @@ bool Att_GetDataOfAttEventByCod (struct Att_Event *Event) /********************** Clear all attendance event data **********************/ /*****************************************************************************/ -static void Att_ResetAttendanceEvent (struct Att_Event *Event) +static void Att_ResetEvent (struct Att_Event *Event) { if (Event->AttCod <= 0) // If > 0 ==> keep values of AttCod and Selected { @@ -782,7 +782,7 @@ static void Att_ResetAttendanceEvent (struct Att_Event *Event) /************************* Get attendance event data *************************/ /*****************************************************************************/ -void Att_GetAttendanceEventDataFromRow (MYSQL_ROW row,struct Att_Event *Event) +void Att_GetEventDataFromRow (MYSQL_ROW row,struct Att_Event *Event) { /***** Get code of attendance event (row[0]) and code of course (row[1]) *****/ Event->AttCod = Str_ConvertStrCodToLongCod (row[0]); @@ -812,7 +812,7 @@ void Att_GetAttendanceEventDataFromRow (MYSQL_ROW row,struct Att_Event *Event) /********************** Free list of attendance events ***********************/ /*****************************************************************************/ -static void Att_FreeListAttEvents (struct Att_Events *Events) +static void Att_FreeListEvents (struct Att_Events *Events) { if (Events->LstIsRead && Events->Lst) { @@ -828,7 +828,7 @@ static void Att_FreeListAttEvents (struct Att_Events *Events) /********* Ask for confirmation of removing of an attendance event ***********/ /*****************************************************************************/ -void Att_AskRemAttEvent (void) +void Att_AskRemEvent (void) { extern const char *Txt_Do_you_really_want_to_remove_the_event_X; extern const char *Txt_Remove_event; @@ -846,7 +846,7 @@ void Att_AskRemAttEvent (void) Events.Event.AttCod = ParCod_GetAndCheckPar (ParCod_Att); /***** Get data of the attendance event from database *****/ - Att_GetDataOfAttEventByCodAndCheckCrs (&Events.Event); + Att_GetEventDataByCodAndCheckCrs (&Events.Event); /***** Show question and button to remove event *****/ Ale_ShowAlertAndButton (ActRemAtt,NULL,NULL, @@ -856,14 +856,14 @@ void Att_AskRemAttEvent (void) Events.Event.Title); /***** Show attendance events again *****/ - Att_SeeAttEvents (); + Att_SeeEvents (); } /*****************************************************************************/ /** Get param., remove an attendance event and show attendance events again **/ /*****************************************************************************/ -void Att_GetAndRemAttEvent (void) +void Att_GetAndRemEvent (void) { extern const char *Txt_Event_X_removed; struct Att_Event Event; @@ -873,40 +873,40 @@ void Att_GetAndRemAttEvent (void) /***** Get data of the attendance event from database *****/ // Inside this function, the course is checked to be the current one - Att_GetDataOfAttEventByCodAndCheckCrs (&Event); + Att_GetEventDataByCodAndCheckCrs (&Event); /***** Remove the attendance event from database *****/ - Att_RemoveAttEventFromDB (Event.AttCod); + Att_RemoveEventFromDB (Event.AttCod); /***** Write message to show the change made *****/ Ale_ShowAlert (Ale_SUCCESS,Txt_Event_X_removed, Event.Title); /***** Show attendance events again *****/ - Att_SeeAttEvents (); + Att_SeeEvents (); } /*****************************************************************************/ /**************** Remove an attendance event from database *******************/ /*****************************************************************************/ -void Att_RemoveAttEventFromDB (long AttCod) +void Att_RemoveEventFromDB (long AttCod) { /***** Remove users registered in the attendance event *****/ - Att_DB_RemoveAllUsrsFromAnAttEvent (AttCod); + Att_DB_RemoveAllUsrsFromAnEvent (AttCod); /***** Remove all groups of this attendance event *****/ - Att_DB_RemoveGrpsAssociatedToAnAttEvent (AttCod); + Att_DB_RemoveGrpsAssociatedToAnEvent (AttCod); /***** Remove attendance event *****/ - Att_DB_RemoveAttEventFromCurrentCrs (AttCod); + Att_DB_RemoveEventFromCurrentCrs (AttCod); } /*****************************************************************************/ /************************* Hide an attendance event **************************/ /*****************************************************************************/ -void Att_HideAttEvent (void) +void Att_HideEvent (void) { struct Att_Event Event; @@ -914,20 +914,20 @@ void Att_HideAttEvent (void) Event.AttCod = ParCod_GetAndCheckPar (ParCod_Att); /***** Get data of the attendance event from database *****/ - Att_GetDataOfAttEventByCodAndCheckCrs (&Event); + Att_GetEventDataByCodAndCheckCrs (&Event); /***** Hide attendance event *****/ - Att_DB_HideOrUnhideAttEvent (Event.AttCod,true); + Att_DB_HideOrUnhideEvent (Event.AttCod,true); /***** Show attendance events again *****/ - Att_SeeAttEvents (); + Att_SeeEvents (); } /*****************************************************************************/ /************************ Unhide an attendance event *************************/ /*****************************************************************************/ -void Att_UnhideAttEvent (void) +void Att_UnhideEvent (void) { struct Att_Event Event; @@ -935,20 +935,20 @@ void Att_UnhideAttEvent (void) Event.AttCod = ParCod_GetAndCheckPar (ParCod_Att); /***** Get data of the attendance event from database *****/ - Att_GetDataOfAttEventByCodAndCheckCrs (&Event); + Att_GetEventDataByCodAndCheckCrs (&Event); /***** Unhide attendance event *****/ - Att_DB_HideOrUnhideAttEvent (Event.AttCod,false); + Att_DB_HideOrUnhideEvent (Event.AttCod,false); /***** Show attendance events again *****/ - Att_SeeAttEvents (); + Att_SeeEvents (); } /*****************************************************************************/ /*************** Put a form to create a new attendance event *****************/ /*****************************************************************************/ -void Att_ReqCreatOrEditAttEvent (void) +void Att_ReqCreatOrEditEvent (void) { extern const char *Hlp_USERS_Attendance_new_event; extern const char *Hlp_USERS_Attendance_edit_event; @@ -987,7 +987,7 @@ void Att_ReqCreatOrEditAttEvent (void) { /* Reset attendance event data */ Events.Event.AttCod = -1L; - Att_ResetAttendanceEvent (&Events.Event); + Att_ResetEvent (&Events.Event); /* Initialize some fields */ Events.Event.CrsCod = Gbl.Hierarchy.Crs.CrsCod; @@ -999,10 +999,10 @@ void Att_ReqCreatOrEditAttEvent (void) else { /* Get data of the attendance event from database */ - Att_GetDataOfAttEventByCodAndCheckCrs (&Events.Event); + Att_GetEventDataByCodAndCheckCrs (&Events.Event); /* Get text of the attendance event from database */ - Att_DB_GetAttEventDescription (Events.Event.AttCod,Description); + Att_DB_GetEventDescription (Events.Event.AttCod,Description); } /***** Begin form *****/ @@ -1092,7 +1092,7 @@ void Att_ReqCreatOrEditAttEvent (void) HTM_TR_End (); /***** Groups *****/ - Att_ShowLstGrpsToEditAttEvent (Events.Event.AttCod); + Att_ShowLstGrpsToEditEvent (Events.Event.AttCod); /***** End table, send button and end box *****/ if (ItsANewAttEvent) @@ -1104,15 +1104,15 @@ void Att_ReqCreatOrEditAttEvent (void) Frm_EndForm (); /***** Show current attendance events *****/ - Att_GetListAttEvents (&Events,Att_NEWEST_FIRST); - Att_ShowAllAttEvents (&Events); + Att_GetListEvents (&Events,Att_NEWEST_FIRST); + Att_ShowAllEvents (&Events); } /*****************************************************************************/ /************* Show list of groups to edit and attendance event **************/ /*****************************************************************************/ -static void Att_ShowLstGrpsToEditAttEvent (long AttCod) +static void Att_ShowLstGrpsToEditEvent (long AttCod) { extern const char *Txt_Groups; extern const char *Txt_The_whole_course; @@ -1177,7 +1177,7 @@ static void Att_ShowLstGrpsToEditAttEvent (long AttCod) /*************** Receive form to create a new attendance event ***************/ /*****************************************************************************/ -void Att_ReceiveFormAttEvent (void) +void Att_ReceiveFormEvent (void) { extern const char *Txt_Already_existed_an_event_with_the_title_X; extern const char *Txt_Created_new_event_X; @@ -1195,7 +1195,7 @@ void Att_ReceiveFormAttEvent (void) { /* Get data of the old (current) attendance event from database */ OldAtt.AttCod = ReceivedAtt.AttCod; - Att_GetDataOfAttEventByCodAndCheckCrs (&OldAtt); + Att_GetEventDataByCodAndCheckCrs (&OldAtt); ReceivedAtt.Hidden = OldAtt.Hidden; } @@ -1222,7 +1222,7 @@ void Att_ReceiveFormAttEvent (void) if (ReceivedAtt.Title[0]) // If there's an attendance event title { /* If title of attendance event was in database... */ - if (Att_DB_CheckIfSimilarAttEventExists ("Title",ReceivedAtt.Title,ReceivedAtt.AttCod)) + if (Att_DB_CheckIfSimilarEventExists ("Title",ReceivedAtt.Title,ReceivedAtt.AttCod)) { ReceivedAttEventIsCorrect = false; @@ -1245,7 +1245,7 @@ void Att_ReceiveFormAttEvent (void) if (ItsANewAttEvent) { ReceivedAtt.Hidden = false; // New attendance events are visible by default - Att_CreateAttEvent (&ReceivedAtt,Description); // Add new attendance event to database + Att_CreateEvent (&ReceivedAtt,Description); // Add new attendance event to database /***** Write success message *****/ Ale_ShowAlert (Ale_SUCCESS,Txt_Created_new_event_X, @@ -1253,7 +1253,7 @@ void Att_ReceiveFormAttEvent (void) } else { - Att_UpdateAttEvent (&ReceivedAtt,Description); + Att_UpdateEvent (&ReceivedAtt,Description); /***** Write success message *****/ Ale_ShowAlert (Ale_SUCCESS,Txt_The_event_has_been_modified); @@ -1263,20 +1263,20 @@ void Att_ReceiveFormAttEvent (void) Grp_FreeListCodSelectedGrps (); } else - Att_ReqCreatOrEditAttEvent (); + Att_ReqCreatOrEditEvent (); /***** Show attendance events again *****/ - Att_SeeAttEvents (); + Att_SeeEvents (); } /*****************************************************************************/ /********************* Create a new attendance event *************************/ /*****************************************************************************/ -void Att_CreateAttEvent (struct Att_Event *Event,const char *Description) +void Att_CreateEvent (struct Att_Event *Event,const char *Description) { /***** Create a new attendance event *****/ - Event->AttCod = Att_DB_CreateAttEvent (Event,Description); + Event->AttCod = Att_DB_CreateEvent (Event,Description); /***** Create groups *****/ if (Gbl.Crs.Grps.LstGrpsSel.NumGrps) @@ -1287,14 +1287,14 @@ void Att_CreateAttEvent (struct Att_Event *Event,const char *Description) /****************** Update an existing attendance event **********************/ /*****************************************************************************/ -void Att_UpdateAttEvent (struct Att_Event *Event,const char *Description) +void Att_UpdateEvent (struct Att_Event *Event,const char *Description) { /***** Update the data of the attendance event *****/ - Att_DB_UpdateAttEvent (Event,Description); + Att_DB_UpdateEvent (Event,Description); /***** Update groups *****/ /* Remove old groups */ - Att_DB_RemoveGrpsAssociatedToAnAttEvent (Event->AttCod); + Att_DB_RemoveGrpsAssociatedToAnEvent (Event->AttCod); /* Create new groups */ if (Gbl.Crs.Grps.LstGrpsSel.NumGrps) @@ -1320,7 +1320,7 @@ static void Att_CreateGroups (long AttCod) /****** Get and write the names of the groups of an attendance event *********/ /*****************************************************************************/ -static void Att_GetAndWriteNamesOfGrpsAssociatedToAttEvent (struct Att_Event *Event) +static void Att_GetAndWriteNamesOfGrpsAssociatedToEvent (struct Att_Event *Event) { extern const char *Txt_Group; extern const char *Txt_Groups; @@ -1389,16 +1389,16 @@ static void Att_GetAndWriteNamesOfGrpsAssociatedToAttEvent (struct Att_Event *Ev /***************** Remove all attendance events of a course ******************/ /*****************************************************************************/ -void Att_RemoveCrsAttEvents (long CrsCod) +void Att_RemoveCrsEvents (long CrsCod) { /***** Remove students *****/ - Att_DB_RemoveUsrsFromCrsAttEvents (CrsCod); + Att_DB_RemoveUsrsFromCrsEvents (CrsCod); /***** Remove groups *****/ - Att_DB_RemoveGrpsAssociatedToCrsAttEvents (CrsCod); + Att_DB_RemoveGrpsAssociatedToCrsEvents (CrsCod); /***** Remove attendance events *****/ - Att_DB_RemoveCrsAttEvents (CrsCod); + Att_DB_RemoveCrsEvents (CrsCod); } /*****************************************************************************/ @@ -1407,7 +1407,7 @@ void Att_RemoveCrsAttEvents (long CrsCod) // Returns the number of attendance events // in this location (all the platform, the current degree or the current course) -unsigned Att_GetNumAttEvents (HieLvl_Level_t Scope,unsigned *NumNotif) +unsigned Att_GetNumEvents (HieLvl_Level_t Scope,unsigned *NumNotif) { MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -1418,7 +1418,7 @@ unsigned Att_GetNumAttEvents (HieLvl_Level_t Scope,unsigned *NumNotif) *NumNotif = 0; /***** Get number of attendance events from database *****/ - if (Att_DB_GetNumAttEvents (&mysql_res,Scope)) + if (Att_DB_GetNumEvents (&mysql_res,Scope)) { /***** Get number of attendance events *****/ row = mysql_fetch_row (mysql_res); @@ -1441,7 +1441,7 @@ unsigned Att_GetNumAttEvents (HieLvl_Level_t Scope,unsigned *NumNotif) /************************ Show one attendance event **************************/ /*****************************************************************************/ -void Att_SeeOneAttEvent (void) +void Att_SeeOneEvent (void) { struct Att_Events Events; @@ -1466,27 +1466,27 @@ static void Att_ShowEvent (struct Att_Events *Events) Events->CurrentPage = Pag_GetParPagNum (Pag_ATT_EVENTS); /***** Get data of this attendance event *****/ - Att_GetDataOfAttEventByCodAndCheckCrs (&Events->Event); - Events->Event.NumStdsTotal = Att_DB_GetNumStdsTotalWhoAreInAttEvent (Events->Event.AttCod); + Att_GetEventDataByCodAndCheckCrs (&Events->Event); + Events->Event.NumStdsTotal = Att_DB_GetNumStdsTotalWhoAreInEvent (Events->Event.AttCod); /***** Show attendance event inside a box *****/ Box_BoxTableBegin (NULL,Txt_Event, - Att_PutIconsOneAtt,Events, + Att_PutIconsOneEvent,Events, Hlp_USERS_Attendance,Box_NOT_CLOSABLE,2); - Att_ShowOneAttEventRow (Events, + Att_ShowOneEventRow (Events, true); // Show only this event Box_BoxTableEnd (); switch (Gbl.Usrs.Me.Role.Logged) { case Rol_STD: - Att_ListAttOnlyMeAsStudent (&Events->Event); + Att_ListEventOnlyMeAsStudent (&Events->Event); break; case Rol_NET: case Rol_TCH: case Rol_SYS_ADM: /***** Show list of students *****/ - Att_ListAttStudents (Events); + Att_ListEventStudents (Events); break; default: break; @@ -1497,7 +1497,7 @@ static void Att_ShowEvent (struct Att_Events *Events) /*************** Put contextual icons in an attendance event *****************/ /*****************************************************************************/ -static void Att_PutIconsOneAtt (void *Events) +static void Att_PutIconsOneEvent (void *Events) { char *Anchor = NULL; @@ -1505,7 +1505,7 @@ static void Att_PutIconsOneAtt (void *Events) Frm_SetAnchorStr (((struct Att_Events *) Events)->Event.AttCod,&Anchor); /***** Put icons to edit resource link *****/ - Att_PutFormsToRemEditOneAttEvent ((struct Att_Events *) Events,Anchor); + Att_PutFormsToRemEditOneEvent ((struct Att_Events *) Events,Anchor); /***** Free anchor string *****/ Frm_FreeAnchorStr (Anchor); @@ -1516,7 +1516,7 @@ static void Att_PutIconsOneAtt (void *Events) /*****************************************************************************/ // Event must be filled before calling this function -static void Att_ListAttOnlyMeAsStudent (struct Att_Event *Event) +static void Att_ListEventOnlyMeAsStudent (struct Att_Event *Event) { extern const char *Hlp_USERS_Attendance; extern const char *Txt_Attendance; @@ -1579,7 +1579,7 @@ static void Att_ListAttOnlyMeAsStudent (struct Att_Event *Event) /*****************************************************************************/ // Event must be filled before calling this function -static void Att_ListAttStudents (struct Att_Events *Events) +static void Att_ListEventStudents (struct Att_Events *Events) { extern const char *Hlp_USERS_Attendance; extern const char *Txt_Attendance; @@ -1739,7 +1739,7 @@ static void Att_WriteRowUsrToCallTheRoll (unsigned NumUsr, } /***** Check if this student is already present in the current event *****/ - Present = Att_CheckIfUsrIsPresentInAttEventAndGetComments (Event->AttCod,UsrDat->UsrCod,CommentStd,CommentTch); + Present = Att_CheckIfUsrIsPresentInEventAndGetComments (Event->AttCod,UsrDat->UsrCod,CommentStd,CommentTch); /***** Begin table row *****/ HTM_TR_Begin (NULL); @@ -1856,8 +1856,8 @@ static void Att_WriteRowUsrToCallTheRoll (unsigned NumUsr, /**************** Put link to view one attendance event **********************/ /*****************************************************************************/ -static void Att_PutLinkAttEvent (struct Att_Event *Event, - const char *Title,const char *Txt) +static void Att_PutLinkEvent (struct Att_Event *Event, + const char *Title,const char *Txt) { /***** Begin form *****/ Frm_BeginForm (ActSeeOneAtt); @@ -1935,7 +1935,7 @@ void Att_PutParsCodGrps (long AttCod) /*************** Save me as students who attended to an event ****************/ /*****************************************************************************/ -void Att_RegisterMeAsStdInAttEvent (void) +void Att_RegisterMeAsStdInEvent (void) { extern const char *Txt_Your_comment_has_been_updated; struct Att_Events Events; @@ -1949,12 +1949,12 @@ void Att_RegisterMeAsStdInAttEvent (void) /***** Get attendance event code *****/ Events.Event.AttCod = ParCod_GetAndCheckPar (ParCod_Att); - Att_GetDataOfAttEventByCodAndCheckCrs (&Events.Event); // This checks that event belong to current course + Att_GetEventDataByCodAndCheckCrs (&Events.Event); // This checks that event belong to current course if (Events.Event.Open) { /***** Get comments for this student *****/ - Present = Att_CheckIfUsrIsPresentInAttEventAndGetComments (Events.Event.AttCod,Gbl.Usrs.Me.UsrDat.UsrCod, + Present = Att_CheckIfUsrIsPresentInEventAndGetComments (Events.Event.AttCod,Gbl.Usrs.Me.UsrDat.UsrCod, CommentStd,CommentTch); if (asprintf (&ParName,"CommentStd%s",Gbl.Usrs.Me.UsrDat.EnUsrCod) < 0) Err_NotEnoughMemoryExit (); @@ -1965,11 +1965,11 @@ void Att_RegisterMeAsStdInAttEvent (void) CommentStd[0] || CommentTch[0]) /***** Register student *****/ - Att_DB_RegUsrInAttEventChangingComments (Events.Event.AttCod,Gbl.Usrs.Me.UsrDat.UsrCod, + Att_DB_RegUsrInEventChangingComments (Events.Event.AttCod,Gbl.Usrs.Me.UsrDat.UsrCod, Present,CommentStd,CommentTch); else /***** Remove student *****/ - Att_DB_RemoveUsrFromAttEvent (Events.Event.AttCod,Gbl.Usrs.Me.UsrDat.UsrCod); + Att_DB_RemoveUsrFromEvent (Events.Event.AttCod,Gbl.Usrs.Me.UsrDat.UsrCod); /***** Write final message *****/ Ale_ShowAlert (Ale_SUCCESS,Txt_Your_comment_has_been_updated); @@ -1992,7 +1992,7 @@ void Att_RegisterMeAsStdInAttEvent (void) 5. Delete from att_users all students marked as Remove=true 6. Replace (insert without duplicated) into att_users all students marked as Remove=false */ -void Att_RegisterStudentsInAttEvent (void) +void Att_RegisterStudentsInEvent (void) { extern const char *Txt_Presents; extern const char *Txt_Absents; @@ -2012,7 +2012,7 @@ void Att_RegisterStudentsInAttEvent (void) /***** Get attendance event code *****/ Events.Event.AttCod = ParCod_GetAndCheckPar (ParCod_Att); - Att_GetDataOfAttEventByCodAndCheckCrs (&Events.Event); // This checks that event belong to current course + Att_GetEventDataByCodAndCheckCrs (&Events.Event); // This checks that event belong to current course /***** Get groups selected *****/ Grp_GetParCodsSeveralGrpsToShowUsrs (); @@ -2070,7 +2070,7 @@ void Att_RegisterStudentsInAttEvent (void) NumUsr++) { /***** Get comments for this student *****/ - Att_CheckIfUsrIsPresentInAttEventAndGetComments (Events.Event.AttCod, + Att_CheckIfUsrIsPresentInEventAndGetComments (Events.Event.AttCod, Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].UsrCod, CommentStd, CommentTch); @@ -2086,11 +2086,11 @@ void Att_RegisterStudentsInAttEvent (void) CommentStd[0] || CommentTch[0]) /***** Register student *****/ - Att_DB_RegUsrInAttEventChangingComments (Events.Event.AttCod,Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].UsrCod, + Att_DB_RegUsrInEventChangingComments (Events.Event.AttCod,Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].UsrCod, Present,CommentStd,CommentTch); else /***** Remove student *****/ - Att_DB_RemoveUsrFromAttEvent (Events.Event.AttCod,Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].UsrCod); + Att_DB_RemoveUsrFromEvent (Events.Event.AttCod,Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].UsrCod); if (Present) NumStdsPresent++; @@ -2122,9 +2122,9 @@ void Att_RegisterStudentsInAttEvent (void) /********* Get number of users from a list who attended to an event **********/ /*****************************************************************************/ -static unsigned Att_GetNumUsrsFromAListWhoAreInAttEvent (long AttCod, - long LstSelectedUsrCods[], - unsigned NumUsrsInList) +static unsigned Att_GetNumUsrsFromAListWhoAreInEvent (long AttCod, + long LstSelectedUsrCods[], + unsigned NumUsrsInList) { char *SubQueryUsrs; unsigned NumUsrsInAttEvent; @@ -2136,7 +2136,7 @@ static unsigned Att_GetNumUsrsFromAListWhoAreInAttEvent (long AttCod, &SubQueryUsrs); /***** Get number of users from list in attendance event from database ****/ - NumUsrsInAttEvent = Att_DB_GetNumStdsFromListWhoAreInAttEvent (AttCod,SubQueryUsrs); + NumUsrsInAttEvent = Att_DB_GetNumStdsFromListWhoAreInEvent (AttCod,SubQueryUsrs); /***** Free memory for subquery string *****/ Usr_FreeSubqueryUsrCods (SubQueryUsrs); @@ -2151,7 +2151,7 @@ static unsigned Att_GetNumUsrsFromAListWhoAreInAttEvent (long AttCod, /***************** Check if a student attended to an event *******************/ /*****************************************************************************/ -static bool Att_CheckIfUsrIsPresentInAttEvent (long AttCod,long UsrCod) +static bool Att_CheckIfUsrIsPresentInEvent (long AttCod,long UsrCod) { bool Present; @@ -2164,7 +2164,7 @@ static bool Att_CheckIfUsrIsPresentInAttEvent (long AttCod,long UsrCod) /***************** Check if a student attended to an event *******************/ /*****************************************************************************/ -static bool Att_CheckIfUsrIsPresentInAttEventAndGetComments (long AttCod,long UsrCod, +static bool Att_CheckIfUsrIsPresentInEventAndGetComments (long AttCod,long UsrCod, char CommentStd[Cns_MAX_BYTES_TEXT + 1], char CommentTch[Cns_MAX_BYTES_TEXT + 1]) { @@ -2224,7 +2224,7 @@ static void Att_ReqListOrPrintUsrsAttendanceCrs (void *TypeOfView) Att_ResetEvents (&Events); /***** Get list of attendance events *****/ - Att_GetListAttEvents (&Events,Att_OLDEST_FIRST); + Att_GetListEvents (&Events,Att_OLDEST_FIRST); /***** List users to select some of them *****/ Usr_PutFormToSelectUsrsToGoToAct (&Gbl.Usrs.Selected, @@ -2236,7 +2236,7 @@ static void Att_ReqListOrPrintUsrsAttendanceCrs (void *TypeOfView) false); // Do not put form with date range /***** Free list of attendance events *****/ - Att_FreeListAttEvents (&Events); + Att_FreeListEvents (&Events); break; default: Err_WrongTypeExit (); @@ -2273,7 +2273,7 @@ static void Att_ListOrPrintMyAttendanceCrs (Att_TypeOfView_t TypeOfView) Att_ResetEvents (&Events); /***** Get list of attendance events *****/ - Att_GetListAttEvents (&Events,Att_OLDEST_FIRST); + Att_GetListEvents (&Events,Att_OLDEST_FIRST); /***** Get boolean parameter that indicates if details must be shown *****/ Events.ShowDetails = Par_GetParBool ("ShowDetails"); @@ -2287,7 +2287,7 @@ static void Att_ListOrPrintMyAttendanceCrs (Att_TypeOfView_t TypeOfView) NumAttEvent++) /* Get number of students in this event */ Events.Lst[NumAttEvent].NumStdsFromList = - Att_GetNumUsrsFromAListWhoAreInAttEvent (Events.Lst[NumAttEvent].AttCod, + Att_GetNumUsrsFromAListWhoAreInEvent (Events.Lst[NumAttEvent].AttCod, &Gbl.Usrs.Me.UsrDat.UsrCod,1); /***** Get list of attendance events selected *****/ @@ -2334,7 +2334,7 @@ static void Att_ListOrPrintMyAttendanceCrs (Att_TypeOfView_t TypeOfView) Grp_FreeListCodSelectedGrps (); /***** Free list of attendance events *****/ - Att_FreeListAttEvents (&Events); + Att_FreeListEvents (&Events); break; default: Err_WrongTypeExit (); @@ -2395,7 +2395,7 @@ static void Att_ListOrPrintUsrsAttendanceCrs (void *TypeOfView) Usr_GetListSelectedUsrCods (&Gbl.Usrs.Selected,NumUsrsInList,&LstSelectedUsrCods); /***** Get list of attendance events *****/ - Att_GetListAttEvents (&Events,Att_OLDEST_FIRST); + Att_GetListEvents (&Events,Att_OLDEST_FIRST); /***** Get number of students in each event *****/ for (NumAttEvent = 0; @@ -2403,7 +2403,7 @@ static void Att_ListOrPrintUsrsAttendanceCrs (void *TypeOfView) NumAttEvent++) /* Get number of students in this event */ Events.Lst[NumAttEvent].NumStdsFromList = - Att_GetNumUsrsFromAListWhoAreInAttEvent (Events.Lst[NumAttEvent].AttCod, + Att_GetNumUsrsFromAListWhoAreInEvent (Events.Lst[NumAttEvent].AttCod, LstSelectedUsrCods,NumUsrsInList); /***** Get list of attendance events selected *****/ @@ -2447,7 +2447,7 @@ static void Att_ListOrPrintUsrsAttendanceCrs (void *TypeOfView) free (Events.StrAttCodsSelected); /***** Free list of attendance events *****/ - Att_FreeListAttEvents (&Events); + Att_FreeListEvents (&Events); /***** Free list of user codes *****/ Usr_FreeListSelectedUsrCods (LstSelectedUsrCods); @@ -2718,8 +2718,8 @@ static void Att_ListEventsToSelect (struct Att_Events *Events, { /* Get data of the attendance event from database */ Events->Event.AttCod = Events->Lst[NumAttEvent].AttCod; - Att_GetDataOfAttEventByCodAndCheckCrs (&Events->Event); - Events->Event.NumStdsTotal = Att_DB_GetNumStdsTotalWhoAreInAttEvent (Events->Event.AttCod); + Att_GetEventDataByCodAndCheckCrs (&Events->Event); + Events->Event.NumStdsTotal = Att_DB_GetNumStdsTotalWhoAreInEvent (Events->Event.AttCod); /* Write a row for this event */ HTM_TR_Begin (NULL); @@ -2932,12 +2932,12 @@ static void Att_WriteTableHeadSeveralAttEvents (struct Att_Events *Events) { /***** Get data of this attendance event *****/ Events->Event.AttCod = Events->Lst[NumAttEvent].AttCod; - Att_GetDataOfAttEventByCodAndCheckCrs (&Events->Event); + Att_GetEventDataByCodAndCheckCrs (&Events->Event); /***** Put link to this attendance event *****/ HTM_TH_Begin (HTM_HEAD_CENTER); snprintf (StrNumAttEvent,sizeof (StrNumAttEvent),"%u",NumAttEvent + 1); - Att_PutLinkAttEvent (&Events->Event, + Att_PutLinkEvent (&Events->Event, Events->Event.Title, StrNumAttEvent); HTM_TH_End (); @@ -3015,7 +3015,7 @@ static void Att_WriteRowUsrSeveralAttEvents (const struct Att_Events *Events, { /* Check if this student is already registered in the current event */ // Here it is not necessary to get comments - Present = Att_CheckIfUsrIsPresentInAttEvent (Events->Lst[NumAttEvent].AttCod, + Present = Att_CheckIfUsrIsPresentInEvent (Events->Lst[NumAttEvent].AttCod, UsrDat->UsrCod); /* Write check or cross */ @@ -3195,11 +3195,11 @@ static void Att_ListAttEventsForAStd (struct Att_Events *Events, { /***** Get data of the attendance event from database *****/ Events->Event.AttCod = Events->Lst[NumAttEvent].AttCod; - Att_GetDataOfAttEventByCodAndCheckCrs (&Events->Event); - Events->Event.NumStdsTotal = Att_DB_GetNumStdsTotalWhoAreInAttEvent (Events->Event.AttCod); + Att_GetEventDataByCodAndCheckCrs (&Events->Event); + Events->Event.NumStdsTotal = Att_DB_GetNumStdsTotalWhoAreInEvent (Events->Event.AttCod); /***** Get comments for this student *****/ - Present = Att_CheckIfUsrIsPresentInAttEventAndGetComments (Events->Event.AttCod,UsrDat->UsrCod,CommentStd,CommentTch); + Present = Att_CheckIfUsrIsPresentInEventAndGetComments (Events->Event.AttCod,UsrDat->UsrCod,CommentStd,CommentTch); ShowCommentStd = CommentStd[0]; ShowCommentTch = CommentTch[0] && (Gbl.Usrs.Me.Role.Logged == Rol_TCH || diff --git a/swad_attendance.h b/swad_attendance.h index f5b8e964..c847e61a 100644 --- a/swad_attendance.h +++ b/swad_attendance.h @@ -83,34 +83,34 @@ struct Att_Events /***************************** Public prototypes *****************************/ /*****************************************************************************/ -void Att_SeeAttEvents (void); +void Att_SeeEvents (void); -bool Att_CheckIfICanEditAttEvents (void); +bool Att_CheckIfICanEditEvents (void); -void Att_ReqCreatOrEditAttEvent (void); -bool Att_GetDataOfAttEventByCod (struct Att_Event *Event); -void Att_GetAttendanceEventDataFromRow (MYSQL_ROW row,struct Att_Event *Event); +void Att_ReqCreatOrEditEvent (void); +bool Att_GetEventDataByCod (struct Att_Event *Event); +void Att_GetEventDataFromRow (MYSQL_ROW row,struct Att_Event *Event); -void Att_AskRemAttEvent (void); -void Att_GetAndRemAttEvent (void); -void Att_RemoveAttEventFromDB (long AttCod); +void Att_AskRemEvent (void); +void Att_GetAndRemEvent (void); +void Att_RemoveEventFromDB (long AttCod); -void Att_HideAttEvent (void); -void Att_UnhideAttEvent (void); -void Att_ReceiveFormAttEvent (void); -void Att_CreateAttEvent (struct Att_Event *Event,const char *Description); -void Att_UpdateAttEvent (struct Att_Event *Event,const char *Description); +void Att_HideEvent (void); +void Att_UnhideEvent (void); +void Att_ReceiveFormEvent (void); +void Att_CreateEvent (struct Att_Event *Event,const char *Description); +void Att_UpdateEvent (struct Att_Event *Event,const char *Description); -void Att_RemoveCrsAttEvents (long CrsCod); +void Att_RemoveCrsEvents (long CrsCod); -unsigned Att_GetNumAttEvents (HieLvl_Level_t Scope,unsigned *NumNotif); +unsigned Att_GetNumEvents (HieLvl_Level_t Scope,unsigned *NumNotif); -void Att_SeeOneAttEvent (void); +void Att_SeeOneEvent (void); void Att_PutParsCodGrps (long AttCod); -void Att_RegisterMeAsStdInAttEvent (void); -void Att_RegisterStudentsInAttEvent (void); +void Att_RegisterMeAsStdInEvent (void); +void Att_RegisterStudentsInEvent (void); void Att_ReqListUsrsAttendanceCrs (void); void Att_ListMyAttendanceCrs (void); diff --git a/swad_attendance_database.c b/swad_attendance_database.c index a802033b..9cda03ce 100644 --- a/swad_attendance_database.c +++ b/swad_attendance_database.c @@ -52,8 +52,8 @@ unsigned (*Att_DB_GetListAttEvents[Grp_NUM_WHICH_GROUPS]) (MYSQL_RES **mysql_res Dat_StartEndTime_t SelectedOrder, Att_OrderNewestOldest_t OrderNewestOldest) = { - [Grp_MY_GROUPS ] = Att_DB_GetListAttEventsMyGrps, - [Grp_ALL_GROUPS] = Att_DB_GetListAttEventsAllGrps, + [Grp_MY_GROUPS ] = Att_DB_GetListEventsMyGrps, + [Grp_ALL_GROUPS] = Att_DB_GetListEventsAllGrps, }; /*****************************************************************************/ @@ -73,6 +73,7 @@ static const char *Att_DB_HiddenSubQuery[Rol_NUM_ROLES] = [Rol_INS_ADM] = " AND Hidden='N'", [Rol_SYS_ADM] = "", }; + static const char *Att_DB_OrderBySubQuery[Dat_NUM_START_END_TIME][Att_NUM_ORDERS_NEWEST_OLDEST] = { [Dat_STR_TIME][Att_NEWEST_FIRST] = "StartTime DESC," @@ -81,22 +82,21 @@ static const char *Att_DB_OrderBySubQuery[Dat_NUM_START_END_TIME][Att_NUM_ORDERS [Dat_STR_TIME][Att_OLDEST_FIRST] = "StartTime," "EndTime," "Title", - [Dat_END_TIME][Att_NEWEST_FIRST] = "EndTime DESC," - "StartTime DESC," - "Title DESC", + "StartTime DESC," + "Title DESC", [Dat_END_TIME][Att_OLDEST_FIRST] = "EndTime," - "StartTime," - "Title", + "StartTime," + "Title", }; /*****************************************************************************/ /**************** Get list of attendance events in my groups *****************/ /*****************************************************************************/ -unsigned Att_DB_GetListAttEventsMyGrps (MYSQL_RES **mysql_res, - Dat_StartEndTime_t SelectedOrder, - Att_OrderNewestOldest_t OrderNewestOldest) +unsigned Att_DB_GetListEventsMyGrps (MYSQL_RES **mysql_res, + Dat_StartEndTime_t SelectedOrder, + Att_OrderNewestOldest_t OrderNewestOldest) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get attendance events", @@ -125,9 +125,9 @@ unsigned Att_DB_GetListAttEventsMyGrps (MYSQL_RES **mysql_res, /********************* Get list of all attendance events *********************/ /*****************************************************************************/ -unsigned Att_DB_GetListAttEventsAllGrps (MYSQL_RES **mysql_res, - Dat_StartEndTime_t SelectedOrder, - Att_OrderNewestOldest_t OrderNewestOldest) +unsigned Att_DB_GetListEventsAllGrps (MYSQL_RES **mysql_res, + Dat_StartEndTime_t SelectedOrder, + Att_OrderNewestOldest_t OrderNewestOldest) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get attendance events", @@ -144,7 +144,7 @@ unsigned Att_DB_GetListAttEventsAllGrps (MYSQL_RES **mysql_res, /********************* Get list of all attendance events *********************/ /*****************************************************************************/ -unsigned Att_DB_GetDataOfAllAttEvents (MYSQL_RES **mysql_res,long CrsCod) +unsigned Att_DB_GetAllEventsData (MYSQL_RES **mysql_res,long CrsCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get attendance events", @@ -170,7 +170,7 @@ unsigned Att_DB_GetDataOfAllAttEvents (MYSQL_RES **mysql_res,long CrsCod) /**************** Get attendance event data using its code *******************/ /*****************************************************************************/ -unsigned Att_DB_GetDataOfAttEventByCod (MYSQL_RES **mysql_res,long AttCod) +unsigned Att_DB_GetEventDataByCod (MYSQL_RES **mysql_res,long AttCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get attendance event data", @@ -192,8 +192,8 @@ unsigned Att_DB_GetDataOfAttEventByCod (MYSQL_RES **mysql_res,long AttCod) /***************** Get attendance event title from database ******************/ /*****************************************************************************/ -void Att_DB_GetAttEventTitle (long AttCod, - char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1]) +void Att_DB_GetEventTitle (long AttCod, + char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1]) { DB_QuerySELECTString (Title,Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE, "can not get attendance event title", @@ -209,7 +209,7 @@ void Att_DB_GetAttEventTitle (long AttCod, /***************** Get attendance event text from database *******************/ /*****************************************************************************/ -void Att_DB_GetAttEventDescription (long AttCod,char Description[Cns_MAX_BYTES_TEXT + 1]) +void Att_DB_GetEventDescription (long AttCod,char Description[Cns_MAX_BYTES_TEXT + 1]) { DB_QuerySELECTString (Description,Cns_MAX_BYTES_TEXT,"can not get attendance event text", "SELECT Txt" // row[0] @@ -224,7 +224,7 @@ void Att_DB_GetAttEventDescription (long AttCod,char Description[Cns_MAX_BYTES_T /***** Check if the title or the folder of an attendance event exists ********/ /*****************************************************************************/ -bool Att_DB_CheckIfSimilarAttEventExists (const char *Field,const char *Value,long AttCod) +bool Att_DB_CheckIfSimilarEventExists (const char *Field,const char *Value,long AttCod) { return DB_QueryEXISTS ("can not check similar attendance events", @@ -243,7 +243,7 @@ bool Att_DB_CheckIfSimilarAttEventExists (const char *Field,const char *Value,lo /********************* Create a new attendance event *************************/ /*****************************************************************************/ -long Att_DB_CreateAttEvent (const struct Att_Event *Event,const char *Description) +long Att_DB_CreateEvent (const struct Att_Event *Event,const char *Description) { return DB_QueryINSERTandReturnCode ("can not create new attendance event", @@ -271,7 +271,7 @@ long Att_DB_CreateAttEvent (const struct Att_Event *Event,const char *Descriptio /****************** Update the data of an attendance event *******************/ /*****************************************************************************/ -void Att_DB_UpdateAttEvent (const struct Att_Event *Event,const char *Description) +void Att_DB_UpdateEvent (const struct Att_Event *Event,const char *Description) { DB_QueryUPDATE ("can not update attendance event", "UPDATE att_events" @@ -299,7 +299,7 @@ void Att_DB_UpdateAttEvent (const struct Att_Event *Event,const char *Descriptio /********************** Hide/unhide an attendance event **********************/ /*****************************************************************************/ -void Att_DB_HideOrUnhideAttEvent (long AttCod,bool Hide) +void Att_DB_HideOrUnhideEvent (long AttCod,bool Hide) { DB_QueryUPDATE ("can not hide/unhide assignment", "UPDATE att_events" @@ -400,7 +400,7 @@ void Att_DB_RemoveGroupsOfType (long GrpTypCod) /****************** Remove groups of an attendance event *********************/ /*****************************************************************************/ -void Att_DB_RemoveGrpsAssociatedToAnAttEvent (long AttCod) +void Att_DB_RemoveGrpsAssociatedToAnEvent (long AttCod) { DB_QueryDELETE ("can not remove the groups" " associated to an attendance event", @@ -413,7 +413,7 @@ void Att_DB_RemoveGrpsAssociatedToAnAttEvent (long AttCod) /******* Get number of students from a list who attended to an event *********/ /*****************************************************************************/ -unsigned Att_DB_GetNumStdsTotalWhoAreInAttEvent (long AttCod) +unsigned Att_DB_GetNumStdsTotalWhoAreInEvent (long AttCod) { return (unsigned) DB_QueryCOUNT ("can not get number of students registered in an event", @@ -428,7 +428,7 @@ unsigned Att_DB_GetNumStdsTotalWhoAreInAttEvent (long AttCod) /********** Get number of users from a list in an attendance event ***********/ /*****************************************************************************/ -unsigned Att_DB_GetNumStdsFromListWhoAreInAttEvent (long AttCod,const char *SubQueryUsrs) +unsigned Att_DB_GetNumStdsFromListWhoAreInEvent (long AttCod,const char *SubQueryUsrs) { return (unsigned) DB_QueryCOUNT ("can not get number of students from a list" @@ -491,8 +491,8 @@ unsigned Att_DB_GetPresentAndComments (MYSQL_RES **mysql_res,long AttCod,long Us /*********** Return a list with the users in an attendance event *************/ /*****************************************************************************/ -unsigned Att_DB_GetListUsrsInAttEvent (MYSQL_RES **mysql_res, - long AttCod,bool AttEventIsAsociatedToGrps) +unsigned Att_DB_GetListUsrsInEvent (MYSQL_RES **mysql_res, + long AttCod,bool AttEventIsAsociatedToGrps) { char *SubQuery; unsigned NumUsrs; @@ -576,10 +576,10 @@ unsigned Att_DB_GetListUsrsInAttEvent (MYSQL_RES **mysql_res, /********* Register a user in an attendance event changing comments **********/ /*****************************************************************************/ -void Att_DB_RegUsrInAttEventChangingComments (long AttCod,long UsrCod, - bool Present, - const char *CommentStd, - const char *CommentTch) +void Att_DB_RegUsrInEventChangingComments (long AttCod,long UsrCod, + bool Present, + const char *CommentStd, + const char *CommentTch) { /***** Register user as assistant to an event in database *****/ DB_QueryREPLACE ("can not register user in an event", @@ -667,7 +667,7 @@ void Att_DB_SetUsrsAsPresent (long AttCod,const char *ListUsrs,bool SetOthersAsA Att_DB_SetUsrAsPresent (AttCod,UsrDat.UsrCod); } else // User is not in table att_users - Att_DB_RegUsrInAttEventChangingComments (AttCod,UsrDat.UsrCod,true,"",""); + Att_DB_RegUsrInEventChangingComments (AttCod,UsrDat.UsrCod,true,"",""); /* Add this user to query used to mark not present users as absent */ if (SetOthersAsAbsent) @@ -713,7 +713,7 @@ void Att_DB_SetUsrsAsPresent (long AttCod,const char *ListUsrs,bool SetOthersAsA /********************** Remove a user from an event **************************/ /*****************************************************************************/ -void Att_DB_RemoveUsrFromAttEvent (long AttCod,long UsrCod) +void Att_DB_RemoveUsrFromEvent (long AttCod,long UsrCod) { DB_QueryDELETE ("can not remove student from an event", "DELETE FROM att_users" @@ -726,7 +726,7 @@ void Att_DB_RemoveUsrFromAttEvent (long AttCod,long UsrCod) /************ Remove users absent without comments from an event *************/ /*****************************************************************************/ -void Att_DB_RemoveUsrsAbsentWithoutCommentsFromAttEvent (long AttCod) +void Att_DB_RemoveUsrsAbsentWithoutCommentsFromEvent (long AttCod) { /***** Clean table att_users *****/ DB_QueryDELETE ("can not remove users absent" @@ -743,7 +743,7 @@ void Att_DB_RemoveUsrsAbsentWithoutCommentsFromAttEvent (long AttCod) /*********** Remove all users registered in an attendance event **************/ /*****************************************************************************/ -void Att_DB_RemoveAllUsrsFromAnAttEvent (long AttCod) +void Att_DB_RemoveAllUsrsFromAnEvent (long AttCod) { DB_QueryDELETE ("can not remove attendance event", "DELETE FROM att_users" @@ -755,7 +755,7 @@ void Att_DB_RemoveAllUsrsFromAnAttEvent (long AttCod) /*** Remove one user from all attendance events where he/she is registered ***/ /*****************************************************************************/ -void Att_DB_RemoveUsrFromAllAttEvents (long UsrCod) +void Att_DB_RemoveUsrFromAllEvents (long UsrCod) { DB_QueryDELETE ("can not remove user from all attendance events", "DELETE FROM att_users" @@ -767,7 +767,7 @@ void Att_DB_RemoveUsrFromAllAttEvents (long UsrCod) /************* Remove one student from all attendance events *****************/ /*****************************************************************************/ -void Att_DB_RemoveUsrFromCrsAttEvents (long UsrCod,long CrsCod) +void Att_DB_RemoveUsrFromCrsEvents (long UsrCod,long CrsCod) { DB_QueryDELETE ("can not remove user from attendance events of a course", "DELETE FROM att_users" @@ -783,7 +783,7 @@ void Att_DB_RemoveUsrFromCrsAttEvents (long UsrCod,long CrsCod) /*********************** Remove an attendance event **************************/ /*****************************************************************************/ -void Att_DB_RemoveAttEventFromCurrentCrs (long AttCod) +void Att_DB_RemoveEventFromCurrentCrs (long AttCod) { DB_QueryDELETE ("can not remove attendance event", "DELETE FROM att_events" @@ -795,7 +795,7 @@ void Att_DB_RemoveAttEventFromCurrentCrs (long AttCod) /************* Remove users in all attendance events of a course *************/ /*****************************************************************************/ -void Att_DB_RemoveUsrsFromCrsAttEvents (long CrsCod) +void Att_DB_RemoveUsrsFromCrsEvents (long CrsCod) { DB_QueryDELETE ("can not remove users registered" " in attendance events of a course", @@ -811,7 +811,7 @@ void Att_DB_RemoveUsrsFromCrsAttEvents (long CrsCod) /************ Remove groups in all attendance events of a course *************/ /*****************************************************************************/ -void Att_DB_RemoveGrpsAssociatedToCrsAttEvents (long CrsCod) +void Att_DB_RemoveGrpsAssociatedToCrsEvents (long CrsCod) { DB_QueryDELETE ("can not remove all groups associated" " to attendance events of a course", @@ -827,7 +827,7 @@ void Att_DB_RemoveGrpsAssociatedToCrsAttEvents (long CrsCod) /***************** Remove all attendance events of a course ******************/ /*****************************************************************************/ -void Att_DB_RemoveCrsAttEvents (long CrsCod) +void Att_DB_RemoveCrsEvents (long CrsCod) { DB_QueryDELETE ("can not remove all attendance events of a course", "DELETE FROM att_events" @@ -839,7 +839,7 @@ void Att_DB_RemoveCrsAttEvents (long CrsCod) /*************** Get number of attendance events in a course *****************/ /*****************************************************************************/ -unsigned Att_DB_GetNumAttEventsInCrs (long CrsCod) +unsigned Att_DB_GetNumEventsInCrs (long CrsCod) { /***** Get number of attendance events in a course from database *****/ return (unsigned) @@ -856,7 +856,7 @@ unsigned Att_DB_GetNumAttEventsInCrs (long CrsCod) // Returns the number of courses with attendance events // in this location (all the platform, the current degree or the current course) -unsigned Att_DB_GetNumCoursesWithAttEvents (HieLvl_Level_t Scope) +unsigned Att_DB_GetNumCoursesWithEvents (HieLvl_Level_t Scope) { switch (Scope) { @@ -911,7 +911,7 @@ unsigned Att_DB_GetNumCoursesWithAttEvents (HieLvl_Level_t Scope) /********************* Get number of attendance events ***********************/ /*****************************************************************************/ -unsigned Att_DB_GetNumAttEvents (MYSQL_RES **mysql_res,HieLvl_Level_t Scope) +unsigned Att_DB_GetNumEvents (MYSQL_RES **mysql_res,HieLvl_Level_t Scope) { switch (Scope) { diff --git a/swad_attendance_database.h b/swad_attendance_database.h index 0312370f..a67a3c90 100644 --- a/swad_attendance_database.h +++ b/swad_attendance_database.h @@ -37,58 +37,58 @@ /***************************** Public prototypes *****************************/ /*****************************************************************************/ -unsigned Att_DB_GetListAttEventsMyGrps (MYSQL_RES **mysql_res, - Dat_StartEndTime_t SelectedOrder, - Att_OrderNewestOldest_t OrderNewestOldest); -unsigned Att_DB_GetListAttEventsAllGrps (MYSQL_RES **mysql_res, - Dat_StartEndTime_t SelectedOrder, - Att_OrderNewestOldest_t OrderNewestOldest); -unsigned Att_DB_GetDataOfAllAttEvents (MYSQL_RES **mysql_res,long CrsCod); -unsigned Att_DB_GetDataOfAttEventByCod (MYSQL_RES **mysql_res,long AttCod); -void Att_DB_GetAttEventTitle (long AttCod, - char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1]); -void Att_DB_GetAttEventDescription (long AttCod,char Description[Cns_MAX_BYTES_TEXT + 1]); +unsigned Att_DB_GetListEventsMyGrps (MYSQL_RES **mysql_res, + Dat_StartEndTime_t SelectedOrder, + Att_OrderNewestOldest_t OrderNewestOldest); +unsigned Att_DB_GetListEventsAllGrps (MYSQL_RES **mysql_res, + Dat_StartEndTime_t SelectedOrder, + Att_OrderNewestOldest_t OrderNewestOldest); +unsigned Att_DB_GetAllEventsData (MYSQL_RES **mysql_res,long CrsCod); +unsigned Att_DB_GetEventDataByCod (MYSQL_RES **mysql_res,long AttCod); +void Att_DB_GetEventTitle (long AttCod, + char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1]); +void Att_DB_GetEventDescription (long AttCod,char Description[Cns_MAX_BYTES_TEXT + 1]); -bool Att_DB_CheckIfSimilarAttEventExists (const char *Field,const char *Value,long AttCod); +bool Att_DB_CheckIfSimilarEventExists (const char *Field,const char *Value,long AttCod); -long Att_DB_CreateAttEvent (const struct Att_Event *Event,const char *Description); -void Att_DB_UpdateAttEvent (const struct Att_Event *Event,const char *Description); -void Att_DB_HideOrUnhideAttEvent (long AttCod,bool Hide); +long Att_DB_CreateEvent (const struct Att_Event *Event,const char *Description); +void Att_DB_UpdateEvent (const struct Att_Event *Event,const char *Description); +void Att_DB_HideOrUnhideEvent (long AttCod,bool Hide); void Att_DB_CreateGroup (long AttCod,long GrpCod); unsigned Att_DB_GetGrpCodsAssociatedToEvent (MYSQL_RES **mysql_res,long AttCod); unsigned Att_DB_GetGroupsAssociatedToEvent (MYSQL_RES **mysql_res,long AttCod); void Att_DB_RemoveGroup (long GrpCod); void Att_DB_RemoveGroupsOfType (long GrpTypCod); -void Att_DB_RemoveGrpsAssociatedToAnAttEvent (long AttCod); +void Att_DB_RemoveGrpsAssociatedToAnEvent (long AttCod); -unsigned Att_DB_GetNumStdsTotalWhoAreInAttEvent (long AttCod); -unsigned Att_DB_GetNumStdsFromListWhoAreInAttEvent (long AttCod,const char *SubQueryUsrs); +unsigned Att_DB_GetNumStdsTotalWhoAreInEvent (long AttCod); +unsigned Att_DB_GetNumStdsFromListWhoAreInEvent (long AttCod,const char *SubQueryUsrs); bool Att_DB_CheckIfUsrIsInTableAttUsr (long AttCod,long UsrCod,bool *Present); unsigned Att_DB_GetPresentAndComments (MYSQL_RES **mysql_res,long AttCod,long UsrCod); -unsigned Att_DB_GetListUsrsInAttEvent (MYSQL_RES **mysql_res, - long AttCod,bool AttEventIsAsociatedToGrps); -void Att_DB_RegUsrInAttEventChangingComments (long AttCod,long UsrCod, - bool Present, - const char *CommentStd, - const char *CommentTch); +unsigned Att_DB_GetListUsrsInEvent (MYSQL_RES **mysql_res, + long AttCod,bool AttEventIsAsociatedToGrps); +void Att_DB_RegUsrInEventChangingComments (long AttCod,long UsrCod, + bool Present, + const char *CommentStd, + const char *CommentTch); void Att_DB_SetUsrAsPresent (long AttCod,long UsrCod); void Att_DB_SetUsrsAsPresent (long AttCod,const char *ListUsrs,bool SetOthersAsAbsent); -void Att_DB_RemoveUsrFromAttEvent (long AttCod,long UsrCod); -void Att_DB_RemoveUsrsAbsentWithoutCommentsFromAttEvent (long AttCod); +void Att_DB_RemoveUsrFromEvent (long AttCod,long UsrCod); +void Att_DB_RemoveUsrsAbsentWithoutCommentsFromEvent (long AttCod); -void Att_DB_RemoveAllUsrsFromAnAttEvent (long AttCod); -void Att_DB_RemoveUsrFromAllAttEvents (long UsrCod); -void Att_DB_RemoveUsrFromCrsAttEvents (long UsrCod,long CrsCod); -void Att_DB_RemoveAttEventFromCurrentCrs (long AttCod); +void Att_DB_RemoveAllUsrsFromAnEvent (long AttCod); +void Att_DB_RemoveUsrFromAllEvents (long UsrCod); +void Att_DB_RemoveUsrFromCrsEvents (long UsrCod,long CrsCod); +void Att_DB_RemoveEventFromCurrentCrs (long AttCod); -void Att_DB_RemoveUsrsFromCrsAttEvents (long CrsCod); -void Att_DB_RemoveGrpsAssociatedToCrsAttEvents (long CrsCod); -void Att_DB_RemoveCrsAttEvents (long CrsCod); +void Att_DB_RemoveUsrsFromCrsEvents (long CrsCod); +void Att_DB_RemoveGrpsAssociatedToCrsEvents (long CrsCod); +void Att_DB_RemoveCrsEvents (long CrsCod); -unsigned Att_DB_GetNumAttEventsInCrs (long CrsCod); -unsigned Att_DB_GetNumCoursesWithAttEvents (HieLvl_Level_t Scope); +unsigned Att_DB_GetNumEventsInCrs (long CrsCod); +unsigned Att_DB_GetNumCoursesWithEvents (HieLvl_Level_t Scope); -unsigned Att_DB_GetNumAttEvents (MYSQL_RES **mysql_res,HieLvl_Level_t Scope); +unsigned Att_DB_GetNumEvents (MYSQL_RES **mysql_res,HieLvl_Level_t Scope); #endif diff --git a/swad_attendance_resource.c b/swad_attendance_resource.c index b775f6fc..d26084df 100644 --- a/swad_attendance_resource.c +++ b/swad_attendance_resource.c @@ -58,15 +58,15 @@ void AttRsc_GetLinkToEvent (void) Title); /***** Show attendance events again *****/ - Att_SeeAttEvents (); + Att_SeeEvents (); } /*****************************************************************************/ /**************** Write attendance event in course program *******************/ /*****************************************************************************/ -void AttRsc_WriteAttEventInCrsProgram (long AttCod,bool PutFormToGo, - const char *Icon,const char *IconTitle) +void AttRsc_WriteEventInCrsProgram (long AttCod,bool PutFormToGo, + const char *Icon,const char *IconTitle) { extern const char *Txt_Actions[ActLst_NUM_ACTIONS]; Act_Action_t NextAction; @@ -120,7 +120,7 @@ void AttRsc_GetTitleFromAttCod (long AttCod,char *Title,size_t TitleSize) if (AttCod > 0) { /***** Get attendance event title *****/ - Att_DB_GetAttEventTitle (AttCod,TitleFromDB); + Att_DB_GetEventTitle (AttCod,TitleFromDB); Str_Copy (Title,TitleFromDB,TitleSize); } else diff --git a/swad_attendance_resource.h b/swad_attendance_resource.h index a3e2b866..0e3044e0 100644 --- a/swad_attendance_resource.h +++ b/swad_attendance_resource.h @@ -34,8 +34,8 @@ /*****************************************************************************/ void AttRsc_GetLinkToEvent (void); -void AttRsc_WriteAttEventInCrsProgram (long AttCod,bool PutFormToGo, - const char *Icon,const char *IconTitle); +void AttRsc_WriteEventInCrsProgram (long AttCod,bool PutFormToGo, + const char *Icon,const char *IconTitle); void AttRsc_GetTitleFromAttCod (long AttCod,char *Title,size_t TitleSize); #endif diff --git a/swad_banner.c b/swad_banner.c index f71e520e..78d62b9e 100644 --- a/swad_banner.c +++ b/swad_banner.c @@ -297,7 +297,7 @@ static void Ban_GetListBanners (struct Ban_Banners *Banners, /************************* Get banner data by code ***************************/ /*****************************************************************************/ -void Ban_GetDataOfBannerByCod (struct Ban_Banner *Ban) +void Ban_GetBannerDataByCod (struct Ban_Banner *Ban) { MYSQL_RES *mysql_res; @@ -309,7 +309,7 @@ void Ban_GetDataOfBannerByCod (struct Ban_Banner *Ban) if (Ban->BanCod > 0) { /***** Get data of a banner from database *****/ - if (Ban_DB_GetDataOfBannerByCod (&mysql_res,Ban->BanCod)) // Banner found... + if (Ban_DB_GetBannerDataByCod (&mysql_res,Ban->BanCod)) // Banner found... Ban_GetBannerDataFromRow (mysql_res,Ban); /***** Free structure that stores the query result *****/ @@ -523,7 +523,7 @@ void Ban_RemoveBanner (void) Ban->BanCod = ParCod_GetAndCheckPar (ParCod_Ban); /***** Get data of the banner from database *****/ - Ban_GetDataOfBannerByCod (Ban); + Ban_GetBannerDataByCod (Ban); /***** Remove banner *****/ Ban_DB_RemoveBanner (Ban->BanCod); @@ -574,7 +574,7 @@ static void Ban_ShowOrHideBanner (struct Ban_Banner *Ban,bool Hide) Ban->BanCod = ParCod_GetAndCheckPar (ParCod_Ban); /***** Get data of the banner from database *****/ - Ban_GetDataOfBannerByCod (Ban); + Ban_GetBannerDataByCod (Ban); /***** Mark file as hidden/visible in database *****/ if (Ban->Hidden != Hide) @@ -651,7 +651,7 @@ static void Ban_RenameBanner (struct Ban_Banner *Ban, Par_GetParText (ParName,NewBanName,MaxBytes); /***** Get banner data from the database *****/ - Ban_GetDataOfBannerByCod (Ban); + Ban_GetBannerDataByCod (Ban); /***** Check if new name is empty *****/ if (!NewBanName[0]) @@ -709,7 +709,7 @@ void Ban_ChangeBannerImg (void) Par_GetParText ("Img",NewImg,Ban_MAX_BYTES_IMAGE); /***** Get banner data from the database *****/ - Ban_GetDataOfBannerByCod (Ban); + Ban_GetBannerDataByCod (Ban); /***** Check if new image is empty *****/ if (NewImg[0]) @@ -751,7 +751,7 @@ void Ban_ChangeBannerWWW (void) Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW); /***** Get banner data from the database *****/ - Ban_GetDataOfBannerByCod (Ban); + Ban_GetBannerDataByCod (Ban); /***** Check if new WWW is empty *****/ if (NewWWW[0]) @@ -1008,7 +1008,7 @@ void Ban_ClickOnBanner (void) Ban.BanCod = ParCod_GetAndCheckPar (ParCod_Ban); /***** Get data of the banner from database *****/ - Ban_GetDataOfBannerByCod (&Ban); + Ban_GetBannerDataByCod (&Ban); /***** Set banner clicked in order to log it *****/ Ban_SetBanCodClicked (Ban.BanCod); diff --git a/swad_banner.h b/swad_banner.h index 46e77e32..407b11fb 100644 --- a/swad_banner.h +++ b/swad_banner.h @@ -61,7 +61,7 @@ void Ban_EditBanners (void); void Ban_PutIconToViewBanners (void); -void Ban_GetDataOfBannerByCod (struct Ban_Banner *Ban); +void Ban_GetBannerDataByCod (struct Ban_Banner *Ban); void Ban_RemoveBanner (void); void Ban_ShowBanner (void); void Ban_HideBanner (void); diff --git a/swad_banner_database.c b/swad_banner_database.c index f14ca65c..57e3d041 100644 --- a/swad_banner_database.c +++ b/swad_banner_database.c @@ -102,7 +102,7 @@ unsigned Ban_DB_GetRandomBanners (MYSQL_RES **mysql_res) /********************* Get data of a banner from database ********************/ /*****************************************************************************/ -unsigned Ban_DB_GetDataOfBannerByCod (MYSQL_RES **mysql_res,long BanCod) +unsigned Ban_DB_GetBannerDataByCod (MYSQL_RES **mysql_res,long BanCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get data of a banner", diff --git a/swad_banner_database.h b/swad_banner_database.h index 8d6e31c7..699bb335 100644 --- a/swad_banner_database.h +++ b/swad_banner_database.h @@ -38,7 +38,7 @@ unsigned Ban_DB_GetAllBanners (MYSQL_RES **mysql_res); unsigned Ban_DB_GetVisibleBanners (MYSQL_RES **mysql_res); unsigned Ban_DB_GetRandomBanners (MYSQL_RES **mysql_res); -unsigned Ban_DB_GetDataOfBannerByCod (MYSQL_RES **mysql_res,long BanCod); +unsigned Ban_DB_GetBannerDataByCod (MYSQL_RES **mysql_res,long BanCod); bool Ban_DB_CheckIfBannerNameExists (const char *FldName,const char *Name,long BanCod); void Ban_DB_CreateBanner (const struct Ban_Banner *Ban); diff --git a/swad_browser.c b/swad_browser.c index b161c0f6..a00ec02b 100644 --- a/swad_browser.c +++ b/swad_browser.c @@ -2017,7 +2017,7 @@ static void Brw_GetDataCurrentGrp (void) if (Gbl.Crs.Grps.GrpCod > 0) { GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); switch (Gbl.Action.Act) { @@ -2197,7 +2197,7 @@ static void Brw_GetParsPathInTreeAndFileName (void) Gbl.FileBrowser.Asg.Folder[i] = *Ptr; // Copy assignment folder Gbl.FileBrowser.Asg.Folder[i] = '\0'; } - Asg_GetDataOfAssignmentByFolder (&Gbl.FileBrowser.Asg); + Asg_GetAssignmentDataByFolder (&Gbl.FileBrowser.Asg); } } @@ -2869,7 +2869,7 @@ static void Brw_FormToChangeCrsGrpZone (void) { /* Get next group */ GrpDat.GrpCod = LstMyGrps.GrpCods[NumGrp]; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); /* Select this group */ HTM_LI_Begin ("class=\"%s\"", @@ -2911,7 +2911,7 @@ static void Brw_GetSelectedGroupData (struct GroupData *GrpDat,bool AbortOnError if (GrpDat->GrpCod > 0) { /***** Get the data of the selected group *****/ - Grp_GetDataOfGroupByCod (GrpDat); + Grp_GetGroupDataByCod (GrpDat); /***** For security, check if group file zones are enabled, and check if I belongs to the selected group *****/ @@ -4102,7 +4102,7 @@ static bool Brw_WriteRowFileBrowser (unsigned Level,const char *RowId, { Str_Copy (Gbl.FileBrowser.Asg.Folder,Gbl.FileBrowser.FilFolLnk.Name, sizeof (Gbl.FileBrowser.Asg.Folder) - 1); - Asg_GetDataOfAssignmentByFolder (&Gbl.FileBrowser.Asg); + Asg_GetAssignmentDataByFolder (&Gbl.FileBrowser.Asg); // The data of this assignment remains in Gbl.FileBrowser.Asg // for all subsequent rows with Level > 1 (files or folders inside this folder), // and they are overwritten on the next row with level == 1 (next assignment) @@ -5389,7 +5389,7 @@ static void Brw_WriteCurrentClipboard (void) { case Brw_ADMI_DOC_INS: Hie.Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod; - Ins_GetDataOfInstitByCod (&Hie.Ins); + Ins_GetInstitDataByCod (&Hie.Ins); snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), "%s, %s %s", Txt_documents_management_area, @@ -5397,7 +5397,7 @@ static void Brw_WriteCurrentClipboard (void) break; case Brw_ADMI_SHR_INS: Hie.Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod; - Ins_GetDataOfInstitByCod (&Hie.Ins); + Ins_GetInstitDataByCod (&Hie.Ins); snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), "%s, %s %s", Txt_shared_files_area, @@ -5405,7 +5405,7 @@ static void Brw_WriteCurrentClipboard (void) break; case Brw_ADMI_DOC_CTR: Hie.Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod; - Ctr_GetDataOfCenterByCod (&Hie.Ctr); + Ctr_GetCenterDataByCod (&Hie.Ctr); snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), "%s, %s %s", Txt_documents_management_area, @@ -5413,7 +5413,7 @@ static void Brw_WriteCurrentClipboard (void) break; case Brw_ADMI_SHR_CTR: Hie.Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod; - Ctr_GetDataOfCenterByCod (&Hie.Ctr); + Ctr_GetCenterDataByCod (&Hie.Ctr); snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), "%s, %s %s", Txt_shared_files_area, @@ -5421,7 +5421,7 @@ static void Brw_WriteCurrentClipboard (void) break; case Brw_ADMI_DOC_DEG: Hie.Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod; - Deg_GetDataOfDegreeByCod (&Hie.Deg); + Deg_GetDegreeDataByCod (&Hie.Deg); snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), "%s, %s %s", Txt_documents_management_area, @@ -5429,7 +5429,7 @@ static void Brw_WriteCurrentClipboard (void) break; case Brw_ADMI_SHR_DEG: Hie.Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod; - Deg_GetDataOfDegreeByCod (&Hie.Deg); + Deg_GetDegreeDataByCod (&Hie.Deg); snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), "%s, %s %s", Txt_shared_files_area, @@ -5437,7 +5437,7 @@ static void Brw_WriteCurrentClipboard (void) break; case Brw_ADMI_DOC_CRS: Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; - Crs_GetDataOfCourseByCod (&Hie.Crs); + Crs_GetCourseDataByCod (&Hie.Crs); snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), "%s, %s %s", Txt_documents_management_area, @@ -5445,9 +5445,9 @@ static void Brw_WriteCurrentClipboard (void) break; case Brw_ADMI_DOC_GRP: GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); Hie.Crs.CrsCod = GrpDat.CrsCod; - Crs_GetDataOfCourseByCod (&Hie.Crs); + Crs_GetCourseDataByCod (&Hie.Crs); snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), "%s, %s %s, %s %s %s", Txt_documents_management_area, @@ -5456,7 +5456,7 @@ static void Brw_WriteCurrentClipboard (void) break; case Brw_ADMI_TCH_CRS: Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; - Crs_GetDataOfCourseByCod (&Hie.Crs); + Crs_GetCourseDataByCod (&Hie.Crs); snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), "%s, %s %s", Txt_teachers_files_area, @@ -5464,9 +5464,9 @@ static void Brw_WriteCurrentClipboard (void) break; case Brw_ADMI_TCH_GRP: GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); Hie.Crs.CrsCod = GrpDat.CrsCod; - Crs_GetDataOfCourseByCod (&Hie.Crs); + Crs_GetCourseDataByCod (&Hie.Crs); snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), "%s, %s %s, %s %s %s", Txt_teachers_files_area, @@ -5475,7 +5475,7 @@ static void Brw_WriteCurrentClipboard (void) break; case Brw_ADMI_SHR_CRS: Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; - Crs_GetDataOfCourseByCod (&Hie.Crs); + Crs_GetCourseDataByCod (&Hie.Crs); snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), "%s, %s %s", Txt_shared_files_area, @@ -5483,9 +5483,9 @@ static void Brw_WriteCurrentClipboard (void) break; case Brw_ADMI_SHR_GRP: GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); Hie.Crs.CrsCod = GrpDat.CrsCod; - Crs_GetDataOfCourseByCod (&Hie.Crs); + Crs_GetCourseDataByCod (&Hie.Crs); snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), "%s, %s %s, %s %s %s", Txt_shared_files_area, @@ -5494,7 +5494,7 @@ static void Brw_WriteCurrentClipboard (void) break; case Brw_ADMI_ASG_USR: Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; - Crs_GetDataOfCourseByCod (&Hie.Crs); + Crs_GetCourseDataByCod (&Hie.Crs); snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), "%s, %s %s, %s %s", Txt_assignments_area, @@ -5503,7 +5503,7 @@ static void Brw_WriteCurrentClipboard (void) break; case Brw_ADMI_WRK_USR: Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; - Crs_GetDataOfCourseByCod (&Hie.Crs); + Crs_GetCourseDataByCod (&Hie.Crs); snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), "%s, %s %s, %s %s", Txt_works_area, @@ -5512,7 +5512,7 @@ static void Brw_WriteCurrentClipboard (void) break; case Brw_ADMI_ASG_CRS: Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; - Crs_GetDataOfCourseByCod (&Hie.Crs); + Crs_GetCourseDataByCod (&Hie.Crs); Usr_UsrDataConstructor (&UsrDat); UsrDat.UsrCod = Gbl.FileBrowser.Clipboard.WorksUsrCod; Usr_GetAllUsrDataFromUsrCod (&UsrDat, @@ -5527,7 +5527,7 @@ static void Brw_WriteCurrentClipboard (void) break; case Brw_ADMI_WRK_CRS: Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; - Crs_GetDataOfCourseByCod (&Hie.Crs); + Crs_GetCourseDataByCod (&Hie.Crs); Usr_UsrDataConstructor (&UsrDat); UsrDat.UsrCod = Gbl.FileBrowser.Clipboard.WorksUsrCod; Usr_GetAllUsrDataFromUsrCod (&UsrDat, @@ -5544,9 +5544,9 @@ static void Brw_WriteCurrentClipboard (void) case Brw_ADMI_ASS_PRJ: Prj_AllocMemProject (&Prj); Prj.PrjCod = Gbl.FileBrowser.Clipboard.Cod; - Prj_GetDataOfProjectByCod (&Prj); + Prj_GetProjectDataByCod (&Prj); Hie.Crs.CrsCod = Prj.CrsCod; - Crs_GetDataOfCourseByCod (&Hie.Crs); + Crs_GetCourseDataByCod (&Hie.Crs); snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), "%s, %s %s, %s %s", Gbl.FileBrowser.Clipboard.FileBrowser == Brw_ADMI_DOC_PRJ ? Txt_project_documents : @@ -5557,7 +5557,7 @@ static void Brw_WriteCurrentClipboard (void) break; case Brw_ADMI_MRK_CRS: Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; - Crs_GetDataOfCourseByCod (&Hie.Crs); + Crs_GetCourseDataByCod (&Hie.Crs); snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), "%s, %s %s", Txt_marks_management_area, @@ -5565,9 +5565,9 @@ static void Brw_WriteCurrentClipboard (void) break; case Brw_ADMI_MRK_GRP: GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); Hie.Crs.CrsCod = GrpDat.CrsCod; - Crs_GetDataOfCourseByCod (&Hie.Crs); + Crs_GetCourseDataByCod (&Hie.Crs); snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), "%s, %s %s, %s %s %s", Txt_marks_management_area, @@ -5946,7 +5946,7 @@ static void Brw_PasteClipboard (struct BrwSiz_BrowserSize *Size) case Brw_ADMI_DOC_INS: case Brw_ADMI_SHR_INS: Hie.Ins.InsCod = Gbl.FileBrowser.Clipboard.Cod; - if (Ins_GetDataOfInstitByCod (&Hie.Ins)) + if (Ins_GetInstitDataByCod (&Hie.Ins)) snprintf (PathOrg,sizeof (PathOrg),"%s/%02u/%u/%s", Cfg_PATH_INS_PRIVATE, (unsigned) (Hie.Ins.InsCod % 100), @@ -5958,7 +5958,7 @@ static void Brw_PasteClipboard (struct BrwSiz_BrowserSize *Size) case Brw_ADMI_DOC_CTR: case Brw_ADMI_SHR_CTR: Hie.Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod; - if (Ctr_GetDataOfCenterByCod (&Hie.Ctr)) + if (Ctr_GetCenterDataByCod (&Hie.Ctr)) snprintf (PathOrg,sizeof (PathOrg),"%s/%02u/%u/%s", Cfg_PATH_CTR_PRIVATE, (unsigned) (Hie.Ctr.CtrCod % 100), @@ -5970,7 +5970,7 @@ static void Brw_PasteClipboard (struct BrwSiz_BrowserSize *Size) case Brw_ADMI_DOC_DEG: case Brw_ADMI_SHR_DEG: Hie.Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod; - if (Deg_GetDataOfDegreeByCod (&Hie.Deg)) + if (Deg_GetDegreeDataByCod (&Hie.Deg)) snprintf (PathOrg,sizeof (PathOrg),"%s/%02u/%u/%s", Cfg_PATH_DEG_PRIVATE, (unsigned) (Hie.Deg.DegCod % 100), @@ -5984,7 +5984,7 @@ static void Brw_PasteClipboard (struct BrwSiz_BrowserSize *Size) case Brw_ADMI_SHR_CRS: case Brw_ADMI_MRK_CRS: Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; - if (Crs_GetDataOfCourseByCod (&Hie.Crs)) + if (Crs_GetCourseDataByCod (&Hie.Crs)) snprintf (PathOrg,sizeof (PathOrg),"%s/%ld/%s", Cfg_PATH_CRS_PRIVATE,Hie.Crs.CrsCod, Gbl.FileBrowser.Clipboard.FilFolLnk.Full); @@ -5996,9 +5996,9 @@ static void Brw_PasteClipboard (struct BrwSiz_BrowserSize *Size) case Brw_ADMI_SHR_GRP: case Brw_ADMI_MRK_GRP: GrpDat.GrpCod = Gbl.FileBrowser.Clipboard.Cod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); Hie.Crs.CrsCod = GrpDat.CrsCod; - if (Crs_GetDataOfCourseByCod (&Hie.Crs)) + if (Crs_GetCourseDataByCod (&Hie.Crs)) snprintf (PathOrg,sizeof (PathOrg),"%s/%ld/%s/%ld/%s", Cfg_PATH_CRS_PRIVATE,Hie.Crs.CrsCod,Cfg_FOLDER_GRP, GrpDat.GrpCod, @@ -6009,7 +6009,7 @@ static void Brw_PasteClipboard (struct BrwSiz_BrowserSize *Size) case Brw_ADMI_ASG_CRS: case Brw_ADMI_WRK_CRS: Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; - if (Crs_GetDataOfCourseByCod (&Hie.Crs)) + if (Crs_GetCourseDataByCod (&Hie.Crs)) { Usr_UsrDataConstructor (&UsrDat); if (Usr_DB_ChkIfUsrCodExists (Gbl.FileBrowser.Clipboard.WorksUsrCod)) @@ -6031,7 +6031,7 @@ static void Brw_PasteClipboard (struct BrwSiz_BrowserSize *Size) case Brw_ADMI_ASG_USR: case Brw_ADMI_WRK_USR: Hie.Crs.CrsCod = Gbl.FileBrowser.Clipboard.Cod; - if (Crs_GetDataOfCourseByCod (&Hie.Crs)) + if (Crs_GetCourseDataByCod (&Hie.Crs)) snprintf (PathOrg,sizeof (PathOrg),"%s/%ld/%s/%02u/%ld/%s", Cfg_PATH_CRS_PRIVATE,Hie.Crs.CrsCod,Cfg_FOLDER_USR, (unsigned) (Gbl.Usrs.Me.UsrDat.UsrCod % 100), @@ -6044,7 +6044,7 @@ static void Brw_PasteClipboard (struct BrwSiz_BrowserSize *Size) case Brw_ADMI_ASS_PRJ: PrjCod = Gbl.FileBrowser.Clipboard.Cod; Hie.Crs.CrsCod = Prj_DB_GetCrsOfPrj (PrjCod); - if (Crs_GetDataOfCourseByCod (&Hie.Crs)) + if (Crs_GetCourseDataByCod (&Hie.Crs)) snprintf (PathOrg,sizeof (PathOrg),"%s/%ld/%s/%02u/%ld/%s", Cfg_PATH_CRS_PRIVATE,Hie.Crs.CrsCod,Cfg_FOLDER_PRJ, (unsigned) (PrjCod % 100), @@ -8788,7 +8788,7 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod, *CrsCod = -1L; *DegCod = -1L; *CtrCod = Ctr.CtrCod = Cod; - Ctr_GetDataOfCenterByCod (&Ctr); + Ctr_GetCenterDataByCod (&Ctr); *InsCod = Ctr.InsCod; break; case Brw_ADMI_DOC_DEG: @@ -8797,9 +8797,9 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod, *GrpCod = -1L; *CrsCod = -1L; *DegCod = Deg.DegCod = Cod; - Deg_GetDataOfDegreeByCod (&Deg); + Deg_GetDegreeDataByCod (&Deg); *CtrCod = Ctr.CtrCod = Deg.CtrCod; - Ctr_GetDataOfCenterByCod (&Ctr); + Ctr_GetCenterDataByCod (&Ctr); *InsCod = Ctr.InsCod; break; case Brw_ADMI_DOC_CRS: @@ -8811,11 +8811,11 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod, /* Cod stores the course code */ *GrpCod = -1L; *CrsCod = Crs.CrsCod = Cod; - Crs_GetDataOfCourseByCod (&Crs); + Crs_GetCourseDataByCod (&Crs); *DegCod = Deg.DegCod = Crs.DegCod; - Deg_GetDataOfDegreeByCod (&Deg); + Deg_GetDegreeDataByCod (&Deg); *CtrCod = Ctr.CtrCod = Deg.CtrCod; - Ctr_GetDataOfCenterByCod (&Ctr); + Ctr_GetCenterDataByCod (&Ctr); *InsCod = Ctr.InsCod; break; case Brw_ADMI_DOC_GRP: @@ -8824,13 +8824,13 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod, case Brw_ADMI_MRK_GRP: /* Cod stores the group code */ *GrpCod = GrpDat.GrpCod = Cod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); *CrsCod = Crs.CrsCod = GrpDat.CrsCod; - Crs_GetDataOfCourseByCod (&Crs); + Crs_GetCourseDataByCod (&Crs); *DegCod = Deg.DegCod = Crs.DegCod; - Deg_GetDataOfDegreeByCod (&Deg); + Deg_GetDegreeDataByCod (&Deg); *CtrCod = Ctr.CtrCod = Deg.CtrCod; - Ctr_GetDataOfCenterByCod (&Ctr); + Ctr_GetCenterDataByCod (&Ctr); *InsCod = Ctr.InsCod; break; case Brw_ADMI_DOC_PRJ: @@ -8838,11 +8838,11 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod, /* Cod stores the project code */ *GrpCod = -1L; *CrsCod = Crs.CrsCod = Prj_DB_GetCrsOfPrj (Cod); - Crs_GetDataOfCourseByCod (&Crs); + Crs_GetCourseDataByCod (&Crs); *DegCod = Deg.DegCod = Crs.DegCod; - Deg_GetDataOfDegreeByCod (&Deg); + Deg_GetDegreeDataByCod (&Deg); *CtrCod = Ctr.CtrCod = Deg.CtrCod; - Ctr_GetDataOfCenterByCod (&Ctr); + Ctr_GetCenterDataByCod (&Ctr); *InsCod = Ctr.InsCod; break; default: @@ -9281,7 +9281,7 @@ void Brw_RemoveUsrWorksInAllCrss (struct Usr_Data *UsrDat) Crs.CrsCod = Str_ConvertStrCodToLongCod (row[0]); /* Get data of course */ - Crs_GetDataOfCourseByCod (&Crs); + Crs_GetCourseDataByCod (&Crs); Brw_RemoveUsrWorksInCrs (UsrDat,&Crs); NumCrssWorksRemoved++; } diff --git a/swad_building.c b/swad_building.c index 098dec4d..e5926244 100644 --- a/swad_building.c +++ b/swad_building.c @@ -67,6 +67,10 @@ static void Bld_PutIconsEditingBuildings (__attribute__((unused)) void *Args); static void Bld_EditBuildingsInternal (void); +static void Bld_GetBuildingDataFromRow (MYSQL_RES *mysql_res, + struct Bld_Building *Building, + Bld_WhichData_t WhichData); + static void Bld_ListBuildingsForEdition (const struct Bld_Buildings *Buildings); static void Bld_PutParBldCod (void *BldCod); @@ -301,51 +305,33 @@ void Bld_PutIconToViewBuildings (void) } /*****************************************************************************/ -/***************************** List all buildings ***************************/ +/***************************** List all buildings ****************************/ /*****************************************************************************/ void Bld_GetListBuildings (struct Bld_Buildings *Buildings, Bld_WhichData_t WhichData) { MYSQL_RES *mysql_res; - MYSQL_ROW row; unsigned NumBuilding; - struct Bld_Building *Building; /***** Get buildings from database *****/ - Buildings->Num = Bld_DB_GetListBuildings (&mysql_res,WhichData,Buildings->SelectedOrder); + Buildings->Num = Bld_DB_GetListBuildings (&mysql_res,WhichData, + Buildings->SelectedOrder); /***** Count number of rows in result *****/ if (Buildings->Num) // Buildings found... { - /***** Create list with courses in center *****/ - if ((Buildings->Lst = calloc ((size_t) Buildings->Num,sizeof (*Buildings->Lst))) == NULL) + /***** Create list with buldings in center *****/ + if ((Buildings->Lst = calloc ((size_t) Buildings->Num, + sizeof (*Buildings->Lst))) == NULL) Err_NotEnoughMemoryExit (); /***** Get the buildings *****/ for (NumBuilding = 0; NumBuilding < Buildings->Num; NumBuilding++) - { - Building = &Buildings->Lst[NumBuilding]; - - /* Get next building */ - row = mysql_fetch_row (mysql_res); - - /* Get building code (row[0]) */ - if ((Building->BldCod = Str_ConvertStrCodToLongCod (row[0])) <= 0) - Err_WrongBuildingExit (); - - /* Get the short name of the building (row[1]) */ - Str_Copy (Building->ShrtName,row[1],sizeof (Building->ShrtName) - 1); - - if (WhichData == Bld_ALL_DATA) - { - /* Get full name (row[2]) and location (row[3]) of the building */ - Str_Copy (Building->FullName,row[2],sizeof (Building->FullName) - 1); - Str_Copy (Building->Location,row[3],sizeof (Building->Location) - 1); - } - } + Bld_GetBuildingDataFromRow (mysql_res,&Buildings->Lst[NumBuilding], + WhichData); } /***** Free structure that stores the query result *****/ @@ -353,13 +339,12 @@ void Bld_GetListBuildings (struct Bld_Buildings *Buildings, } /*****************************************************************************/ -/*************************** Get building full name **************************/ +/********************** Get building data using its code *********************/ /*****************************************************************************/ -void Bld_GetDataOfBuildingByCod (struct Bld_Building *Building) +void Bld_GetBuildingDataByCod (struct Bld_Building *Building) { MYSQL_RES *mysql_res; - MYSQL_ROW row; /***** Clear data *****/ Building->ShrtName[0] = '\0'; @@ -370,23 +355,43 @@ void Bld_GetDataOfBuildingByCod (struct Bld_Building *Building) if (Building->BldCod > 0) { /***** Get data of a building from database *****/ - if (Bld_DB_GetDataOfBuildingByCod (&mysql_res,Building->BldCod)) // Building found... - { - /* Get row */ - row = mysql_fetch_row (mysql_res); - - /* Get short name (row[0]), full name (row[1]) - and location (row[2]) of the building */ - Str_Copy (Building->ShrtName,row[0],sizeof (Building->ShrtName) - 1); - Str_Copy (Building->FullName,row[1],sizeof (Building->FullName) - 1); - Str_Copy (Building->Location,row[2],sizeof (Building->Location) - 1); - } + if (Bld_DB_GetBuildingDataByCod (&mysql_res,Building->BldCod)) // Building found... + Bld_GetBuildingDataFromRow (mysql_res,Building,Bld_ALL_DATA); /***** Free structure that stores the query result *****/ DB_FreeMySQLResult (&mysql_res); } } +/*****************************************************************************/ +/******************** Get building data from database row ********************/ +/*****************************************************************************/ + +static void Bld_GetBuildingDataFromRow (MYSQL_RES *mysql_res, + struct Bld_Building *Building, + Bld_WhichData_t WhichData) + { + MYSQL_ROW row; + + /***** Get row *****/ + row = mysql_fetch_row (mysql_res); + + /***** Get building code (row[0]) *****/ + if ((Building->BldCod = Str_ConvertStrCodToLongCod (row[0])) <= 0) + Err_WrongBuildingExit (); + + /***** Get the short name of the building (row[1]) *****/ + Str_Copy (Building->ShrtName,row[1],sizeof (Building->ShrtName) - 1); + + if (WhichData == Bld_ALL_DATA) + { + /***** Get full name (row[2]) + and location (row[3]) of the building *****/ + Str_Copy (Building->FullName,row[2],sizeof (Building->FullName) - 1); + Str_Copy (Building->Location,row[3],sizeof (Building->Location) - 1); + } + } + /*****************************************************************************/ /************************** Free list of buildings ***************************/ /*****************************************************************************/ @@ -508,7 +513,7 @@ void Bld_RemoveBuilding (void) Bld_EditingBuilding->BldCod = ParCod_GetAndCheckPar (ParCod_Bld); /***** Get data of the building from database *****/ - Bld_GetDataOfBuildingByCod (Bld_EditingBuilding); + Bld_GetBuildingDataByCod (Bld_EditingBuilding); /***** Update rooms assigned to this building *****/ Roo_DB_RemoveBuildingFromRooms (Bld_EditingBuilding->BldCod); @@ -587,7 +592,7 @@ static void Bld_RenameBuilding (Cns_ShrtOrFullName_t ShrtOrFullName) Par_GetParText (ParName,NewClaName,MaxBytes); /***** Get from the database the old names of the building *****/ - Bld_GetDataOfBuildingByCod (Bld_EditingBuilding); + Bld_GetBuildingDataByCod (Bld_EditingBuilding); /***** Check if new name is empty *****/ if (NewClaName[0]) @@ -644,7 +649,7 @@ void Bld_ChangeBuildingLocation (void) Par_GetParText ("Location",NewLocation,Bld_MAX_BYTES_LOCATION); /***** Get from the database the old location of the building *****/ - Bld_GetDataOfBuildingByCod (Bld_EditingBuilding); + Bld_GetBuildingDataByCod (Bld_EditingBuilding); /***** Check if old and new locations are the same (this happens when return is pressed without changes) *****/ diff --git a/swad_building.h b/swad_building.h index 01bf6a27..818cc67d 100644 --- a/swad_building.h +++ b/swad_building.h @@ -89,7 +89,7 @@ void Bld_FreeListBuildings (struct Bld_Buildings *Buildings); void Bld_GetListBuildingsInThisCtr (void); -void Bld_GetDataOfBuildingByCod (struct Bld_Building *Roo); +void Bld_GetBuildingDataByCod (struct Bld_Building *Roo); void Bld_RemoveBuilding (void); void Bld_RenameBuildingShort (void); diff --git a/swad_building_database.c b/swad_building_database.c index 34c0a225..20f843ff 100644 --- a/swad_building_database.c +++ b/swad_building_database.c @@ -99,13 +99,14 @@ unsigned Bld_DB_GetListBuildings (MYSQL_RES **mysql_res, /**************** Get building data giving the building code *****************/ /*****************************************************************************/ -unsigned Bld_DB_GetDataOfBuildingByCod (MYSQL_RES **mysql_res,long BldCod) +unsigned Bld_DB_GetBuildingDataByCod (MYSQL_RES **mysql_res,long BldCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get data of a building", - "SELECT ShortName," // row[0] - "FullName," // row[1] - "Location" // row[2] + "SELECT BldCod," // row[0] + "ShortName," // row[1] + "FullName," // row[2] + "Location" // row[3] " FROM bld_buildings" " WHERE BldCod=%ld", BldCod); diff --git a/swad_building_database.h b/swad_building_database.h index 70b3cae9..e1a34a59 100644 --- a/swad_building_database.h +++ b/swad_building_database.h @@ -40,7 +40,7 @@ void Bld_DB_CreateBuilding (const struct Bld_Building *Building); unsigned Bld_DB_GetListBuildings (MYSQL_RES **mysql_res, Bld_WhichData_t WhichData, Bld_Order_t SelectedOrder); -unsigned Bld_DB_GetDataOfBuildingByCod (MYSQL_RES **mysql_res,long BldCod); +unsigned Bld_DB_GetBuildingDataByCod (MYSQL_RES **mysql_res,long BldCod); bool Bld_DB_CheckIfBuildingNameExists (const char *FldName,const char *Name,long BldCod); void Bld_DB_UpdateBuildingName (long BldCod,const char *FldName,const char *NewBuildingName); diff --git a/swad_call_for_exam.c b/swad_call_for_exam.c index 318774b3..ded19ab7 100644 --- a/swad_call_for_exam.c +++ b/swad_call_for_exam.c @@ -920,7 +920,7 @@ static void Cfe_ShowCallForExam (struct Cfe_CallsForExams *CallsForExams, /***** Get data of institution of this degree *****/ Ins.InsCod = Gbl.Hierarchy.Ins.InsCod; - Ins_GetDataOfInstitByCod (&Ins); + Ins_GetInstitDataByCod (&Ins); /***** Build anchor string *****/ Frm_SetAnchorStr (ExaCod,&Anchor); @@ -1616,15 +1616,15 @@ static void Cfe_GetNotifContentCallForExam (const struct Cfe_CallsForExams *Call /***** Get data of course *****/ Hie.Crs.CrsCod = CallsForExams->CallForExam.CrsCod; - Crs_GetDataOfCourseByCod (&Hie.Crs); + Crs_GetCourseDataByCod (&Hie.Crs); /***** Get data of degree *****/ Hie.Deg.DegCod = Hie.Crs.DegCod; - Deg_GetDataOfDegreeByCod (&Hie.Deg); + Deg_GetDegreeDataByCod (&Hie.Deg); /***** Get data of institution *****/ Hie.Ins.InsCod = Deg_DB_GetInsCodOfDegreeByCod (Hie.Deg.DegCod); - Ins_GetDataOfInstitByCod (&Hie.Ins); + Ins_GetInstitDataByCod (&Hie.Ins); /***** Convert struct date to a date string *****/ Dat_ConvDateToDateStr (&CallsForExams->CallForExam.ExamDate,StrExamDate); diff --git a/swad_center.c b/swad_center.c index ae2059c0..3c44d527 100644 --- a/swad_center.c +++ b/swad_center.c @@ -155,7 +155,7 @@ void Ctr_SeeCtrWithPendingDegs (void) The_GetColorRows (); /* Get data of center */ - Ctr_GetDataOfCenterByCod (&Ctr); + Ctr_GetCenterDataByCod (&Ctr); /* Center logo and full name */ HTM_TR_Begin (NULL); @@ -345,7 +345,7 @@ static void Ctr_ListOneCenterForSeeing (struct Ctr_Center *Ctr,unsigned NumCtr) /***** Get data of place of this center *****/ Plc.PlcCod = Ctr->PlcCod; - Plc_GetDataOfPlaceByCod (&Plc); + Plc_GetPlaceDataByCod (&Plc); if (Ctr->Status & Hie_STATUS_BIT_PENDING) { @@ -580,7 +580,7 @@ void Ctr_GetFullListOfCenters (long InsCod,Ctr_Order_t SelectedOrder) /************************ Get data of center by code *************************/ /*****************************************************************************/ -bool Ctr_GetDataOfCenterByCod (struct Ctr_Center *Ctr) +bool Ctr_GetCenterDataByCod (struct Ctr_Center *Ctr) { MYSQL_RES *mysql_res; bool CtrFound = false; @@ -599,7 +599,7 @@ bool Ctr_GetDataOfCenterByCod (struct Ctr_Center *Ctr) if (Ctr->CtrCod > 0) { /***** Get data of a center from database *****/ - if (Ctr_DB_GetDataOfCenterByCod (&mysql_res,Ctr->CtrCod)) // Center found... + if (Ctr_DB_GetCenterDataByCod (&mysql_res,Ctr->CtrCod)) // Center found... { /* Get center data */ Ctr_GetCenterDataFromRow (mysql_res,Ctr, @@ -965,7 +965,7 @@ void Ctr_RemoveCenter (void) Ctr_EditingCtr->CtrCod = ParCod_GetAndCheckPar (ParCod_OthHie); /***** Get data of the center from database *****/ - Ctr_GetDataOfCenterByCod (Ctr_EditingCtr); + Ctr_GetCenterDataByCod (Ctr_EditingCtr); /***** Check if this center has teachers *****/ if (Deg_GetNumDegsInCtr (Ctr_EditingCtr->CtrCod)) // Center has degrees @@ -1040,7 +1040,7 @@ void Ctr_ChangeCtrPlc (void) NewPlcCod = ParCod_GetAndCheckParMin (ParCod_Plc,0); // 0 (another place) is allowed here /***** Get data of center from database *****/ - Ctr_GetDataOfCenterByCod (Ctr_EditingCtr); + Ctr_GetCenterDataByCod (Ctr_EditingCtr); /***** Update place in table of centers *****/ Ctr_DB_UpdateCtrPlc (Ctr_EditingCtr->CtrCod,NewPlcCod); @@ -1112,7 +1112,7 @@ void Ctr_RenameCenter (struct Ctr_Center *Ctr,Cns_ShrtOrFullName_t ShrtOrFullNam Par_GetParText (ParName,NewCtrName,MaxBytes); /***** Get from the database the old names of the center *****/ - Ctr_GetDataOfCenterByCod (Ctr); + Ctr_GetCenterDataByCod (Ctr); /***** Check if new name is empty *****/ if (!NewCtrName[0]) @@ -1167,7 +1167,7 @@ void Ctr_ChangeCtrWWW (void) Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW); /***** Get data of center *****/ - Ctr_GetDataOfCenterByCod (Ctr_EditingCtr); + Ctr_GetCenterDataByCod (Ctr_EditingCtr); /***** Check if new WWW is empty *****/ if (NewWWW[0]) @@ -1206,7 +1206,7 @@ void Ctr_ChangeCtrStatus (void) Status = Hie_GetParStatus (); // New status /***** Get data of center *****/ - Ctr_GetDataOfCenterByCod (Ctr_EditingCtr); + Ctr_GetCenterDataByCod (Ctr_EditingCtr); /***** Update status *****/ Ctr_DB_UpdateCtrStatus (Ctr_EditingCtr->CtrCod,Status); @@ -1831,7 +1831,7 @@ void Ctr_ListCtrsFound (MYSQL_RES **mysql_res,unsigned NumCtrs) Ctr.CtrCod = DB_GetNextCode (*mysql_res); /* Get data of center */ - Ctr_GetDataOfCenterByCod (&Ctr); + Ctr_GetCenterDataByCod (&Ctr); /* Write data of this center */ Ctr_ListOneCenterForSeeing (&Ctr,NumCtr); diff --git a/swad_center.h b/swad_center.h index 109d49f7..1e73e16f 100644 --- a/swad_center.h +++ b/swad_center.h @@ -90,7 +90,7 @@ void Ctr_PutIconToViewCenters (void); void Ctr_GetBasicListOfCenters (long InsCod); void Ctr_GetFullListOfCenters (long InsCod,Ctr_Order_t SelectedOrder); -bool Ctr_GetDataOfCenterByCod (struct Ctr_Center *Ctr); +bool Ctr_GetCenterDataByCod (struct Ctr_Center *Ctr); void Ctr_FreeListCenters (void); void Ctr_WriteSelectorOfCenter (void); void Ctr_RemoveCenter (void); diff --git a/swad_center_config.c b/swad_center_config.c index 5444c0c9..46bc0b1b 100644 --- a/swad_center_config.c +++ b/swad_center_config.c @@ -643,7 +643,7 @@ static void CtrCfg_Place (bool PutForm) /***** Get data of place *****/ Plc.PlcCod = Gbl.Hierarchy.Ctr.PlcCod; - Plc_GetDataOfPlaceByCod (&Plc); + Plc_GetPlaceDataByCod (&Plc); /***** Place *****/ HTM_TR_Begin (NULL); @@ -1014,7 +1014,7 @@ void CtrCfg_ChangeCtrIns (void) if (NewIns.InsCod != Gbl.Hierarchy.Ctr.InsCod) { /***** Get data of new institution *****/ - Ins_GetDataOfInstitByCod (&NewIns); + Ins_GetInstitDataByCod (&NewIns); /***** Check if it already exists a center with the same name in the new institution *****/ if (Ctr_DB_CheckIfCtrNameExistsInIns ("ShortName", diff --git a/swad_center_database.c b/swad_center_database.c index b55d163a..89d5a030 100644 --- a/swad_center_database.c +++ b/swad_center_database.c @@ -214,7 +214,7 @@ unsigned Ctr_DB_GetCtrsWithPendingDegs (MYSQL_RES **mysql_res) /************************ Get data of center by code *************************/ /*****************************************************************************/ -unsigned Ctr_DB_GetDataOfCenterByCod (MYSQL_RES **mysql_res,long CtrCod) +unsigned Ctr_DB_GetCenterDataByCod (MYSQL_RES **mysql_res,long CtrCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get data of a center", diff --git a/swad_center_database.h b/swad_center_database.h index 970968a7..0f8d1ec9 100644 --- a/swad_center_database.h +++ b/swad_center_database.h @@ -45,7 +45,7 @@ unsigned Ctr_DB_GetListOfCtrsFull (MYSQL_RES **mysql_res,long InsCod); unsigned Ctr_DB_GetListOfCtrsFullWithNumUsrs (MYSQL_RES **mysql_res, long InsCod,Ctr_Order_t SelectedOrder); unsigned Ctr_DB_GetCtrsWithPendingDegs (MYSQL_RES **mysql_res); -unsigned Ctr_DB_GetDataOfCenterByCod (MYSQL_RES **mysql_res,long CtrCod); +unsigned Ctr_DB_GetCenterDataByCod (MYSQL_RES **mysql_res,long CtrCod); long Ctr_DB_GetInsCodOfCenterByCod (long CtrCod); void Ctr_DB_GetShortNameOfCenterByCod (long CtrCod,char ShrtName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1]); unsigned Ctr_DB_GetPhotoAttribution (MYSQL_RES **mysql_res,long CtrCod); diff --git a/swad_changelog.h b/swad_changelog.h index fcbaf6a7..8fd13355 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -629,10 +629,11 @@ TODO: Emilce Barrera Mesa: Podr TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la hora de poner la foto porque la plataforma es muy exigente respecto al fondo de la imagen. */ -#define Log_PLATFORM_VERSION "SWAD 22.78.4 (2023-03-22)" +#define Log_PLATFORM_VERSION "SWAD 22.78.5 (2023-03-23)" #define CSS_FILE "swad22.57.1.css" #define JS_FILE "swad22.49.js" /* + Version 22.78.5: Mar 22, 2023 Code refactoring in banners. (337696 lines) Version 22.78.4: Mar 22, 2023 Code refactoring in file browser. (337693 lines) Version 22.78.3: Mar 22, 2023 Code refactoring. (337767 lines) Version 22.78.2: Mar 22, 2023 Code refactoring in attendance. (337779 lines) diff --git a/swad_chat.c b/swad_chat.c index 9dd1ae1f..b17690d3 100644 --- a/swad_chat.c +++ b/swad_chat.c @@ -176,7 +176,7 @@ void Cht_ShowListOfAvailableChatRooms (void) { /* Get data of this degree */ Deg.DegCod = Gbl.Usrs.Me.MyDegs.Degs[NumMyDeg].DegCod; - if (!Deg_GetDataOfDegreeByCod (&Deg)) + if (!Deg_GetDegreeDataByCod (&Deg)) Err_WrongDegreeExit (); /* Link to the room of this degree */ @@ -205,7 +205,7 @@ void Cht_ShowListOfAvailableChatRooms (void) if ((Crs.CrsCod = Str_ConvertStrCodToLongCod (row[0])) > 0) { /* Get data of this course */ - Crs_GetDataOfCourseByCod (&Crs); + Crs_GetCourseDataByCod (&Crs); /* Link to the room of this course */ IsLastItemInLevel[2] = (NumCrs == NumCrss - 1); @@ -475,7 +475,7 @@ void Cht_OpenChatWindow (void) /* Get data of this degree */ Deg.DegCod = Gbl.Usrs.Me.MyDegs.Degs[NumMyDeg].DegCod; - Deg_GetDataOfDegreeByCod (&Deg); + Deg_GetDegreeDataByCod (&Deg); snprintf (ThisRoomShortName,sizeof (ThisRoomShortName),"%s", Deg.ShrtName); @@ -502,7 +502,7 @@ void Cht_OpenChatWindow (void) /* Get data of this course */ Crs.CrsCod = Gbl.Usrs.Me.MyCrss.Crss[NumMyCrs].CrsCod; - Crs_GetDataOfCourseByCod (&Crs); + Crs_GetCourseDataByCod (&Crs); snprintf (ThisRoomShortName,sizeof (ThisRoomShortName), "%s", diff --git a/swad_country.c b/swad_country.c index aaf525a0..e15f8fef 100644 --- a/swad_country.c +++ b/swad_country.c @@ -150,7 +150,7 @@ void Cty_SeeCtyWithPendingInss (void) The_GetColorRows (); /* Get data of country */ - Cty_GetDataOfCountryByCod (&Cty); + Cty_GetCountryDataByCod (&Cty); /* Begin row for this country */ HTM_TR_Begin (NULL); @@ -935,7 +935,7 @@ void Cty_WriteCountryName (long CtyCod) /***************** Get basic data of country given its code ******************/ /*****************************************************************************/ -bool Cty_GetDataOfCountryByCod (struct Cty_Countr *Cty) +bool Cty_GetCountryDataByCod (struct Cty_Countr *Cty) { extern const char *Txt_Another_country; MYSQL_RES *mysql_res; @@ -973,7 +973,7 @@ bool Cty_GetDataOfCountryByCod (struct Cty_Countr *Cty) // Here Cty->CtyCod > 0 /***** Get data of a country from database *****/ - CtyFound = (Cty_DB_GetDataOfCountryByCod (&mysql_res,Cty->CtyCod) != 0); + CtyFound = (Cty_DB_GetCountryDataByCod (&mysql_res,Cty->CtyCod) != 0); if (CtyFound) // Country found... { /* Get row */ @@ -1191,7 +1191,7 @@ void Cty_RemoveCountry (void) Cty_EditingCty->CtyCod = ParCod_GetAndCheckPar (ParCod_OthCty); /***** Get data of the country from database *****/ - Cty_GetDataOfCountryByCod (Cty_EditingCty); + Cty_GetCountryDataByCod (Cty_EditingCty); /***** Check if this country has users *****/ if (Ins_GetNumInssInCty (Cty_EditingCty->CtyCod)) // Country has institutions ==> don't remove @@ -1258,7 +1258,7 @@ void Cty_RenameCountry (void) Par_GetParText ("Name",NewCtyName,Cty_MAX_BYTES_NAME); /***** Get from the database the data of the country *****/ - Cty_GetDataOfCountryByCod (Cty_EditingCty); + Cty_GetCountryDataByCod (Cty_EditingCty); /***** Check if new name is empty *****/ if (NewCtyName[0]) @@ -1337,7 +1337,7 @@ void Cty_ChangeCtyWWW (void) Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW); /***** Get from the database the data of the country *****/ - Cty_GetDataOfCountryByCod (Cty_EditingCty); + Cty_GetCountryDataByCod (Cty_EditingCty); /***** Update the table changing old WWW by new WWW *****/ snprintf (FldName,sizeof (FldName),"Name_%s", @@ -1811,7 +1811,7 @@ void Cty_ListCtysFound (MYSQL_RES **mysql_res,unsigned NumCtys) Cty.CtyCod = DB_GetNextCode (*mysql_res); /* Get data of country */ - Cty_GetDataOfCountryByCod (&Cty); + Cty_GetCountryDataByCod (&Cty); /* Write data of this country */ Cty_ListOneCountryForSeeing (&Cty,NumCty); diff --git a/swad_country.h b/swad_country.h index 9c91092e..cb158dca 100644 --- a/swad_country.h +++ b/swad_country.h @@ -99,7 +99,7 @@ void Cty_GetFullListOfCountries (void); void Cty_FreeListCountries (void); void Cty_WriteSelectorOfCountry (void); void Cty_WriteCountryName (long CtyCod); -bool Cty_GetDataOfCountryByCod (struct Cty_Countr *Cty); +bool Cty_GetCountryDataByCod (struct Cty_Countr *Cty); void Cty_FlushCacheCountryName (void); void Cty_GetCountryName (long CtyCod,Lan_Language_t Language, char CtyName[Cty_MAX_BYTES_NAME + 1]); diff --git a/swad_country_config.c b/swad_country_config.c index 6638f02d..309aed6b 100644 --- a/swad_country_config.c +++ b/swad_country_config.c @@ -289,11 +289,11 @@ static void CtyCfg_Map (void) Ctr.CtrCod = DB_GetNextCode (mysql_res); /* Get data of center */ - Ctr_GetDataOfCenterByCod (&Ctr); + Ctr_GetCenterDataByCod (&Ctr); /* Get data of institution */ Ins.InsCod = Ctr.InsCod; - Ins_GetDataOfInstitByCod (&Ins); + Ins_GetInstitDataByCod (&Ins); /* Add marker */ Map_AddMarker (&Ctr.Coord); diff --git a/swad_country_database.c b/swad_country_database.c index fdc558f7..d90eed14 100644 --- a/swad_country_database.c +++ b/swad_country_database.c @@ -227,7 +227,7 @@ unsigned Cty_DB_GetCtysFull (MYSQL_RES **mysql_res) /***************** Get basic data of country given its code ******************/ /*****************************************************************************/ -unsigned Cty_DB_GetDataOfCountryByCod (MYSQL_RES **mysql_res,long CtyCod) +unsigned Cty_DB_GetCountryDataByCod (MYSQL_RES **mysql_res,long CtyCod) { extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES]; diff --git a/swad_country_database.h b/swad_country_database.h index 90c414e9..96933d61 100644 --- a/swad_country_database.h +++ b/swad_country_database.h @@ -43,7 +43,7 @@ void Cty_DB_CreateCountry (const struct Cty_Countr *Cty); unsigned Cty_DB_GetCtysBasic (MYSQL_RES **mysql_res); unsigned Cty_DB_GetCtysWithPendingInss (MYSQL_RES **mysql_res); unsigned Cty_DB_GetCtysFull (MYSQL_RES **mysql_res); -unsigned Cty_DB_GetDataOfCountryByCod (MYSQL_RES **mysql_res,long CtyCod); +unsigned Cty_DB_GetCountryDataByCod (MYSQL_RES **mysql_res,long CtyCod); void Cty_DB_GetCountryName (long CtyCod,Lan_Language_t Language, char CtyName[Cty_MAX_BYTES_NAME + 1]); diff --git a/swad_course.c b/swad_course.c index 84a6a21e..e2e2a4f6 100644 --- a/swad_course.c +++ b/swad_course.c @@ -210,7 +210,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void) /***** Get data of this institution *****/ Hie.Cty.CtyCod = Str_ConvertStrCodToLongCod (row[0]); - if (!Cty_GetDataOfCountryByCod (&Hie.Cty)) + if (!Cty_GetCountryDataByCod (&Hie.Cty)) Err_WrongCountrExit (); /***** Write link to country *****/ @@ -244,7 +244,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void) /***** Get data of this institution *****/ Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[0]); - if (!Ins_GetDataOfInstitByCod (&Hie.Ins)) + if (!Ins_GetInstitDataByCod (&Hie.Ins)) Err_WrongInstitExit (); /***** Write link to institution *****/ @@ -278,7 +278,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void) /***** Get data of this center *****/ Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[0]); - if (!Ctr_GetDataOfCenterByCod (&Hie.Ctr)) + if (!Ctr_GetCenterDataByCod (&Hie.Ctr)) Err_WrongCenterExit (); /***** Write link to center *****/ @@ -312,7 +312,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void) /***** Get data of this degree *****/ Hie.Deg.DegCod = Str_ConvertStrCodToLongCod (row[0]); - if (!Deg_GetDataOfDegreeByCod (&Hie.Deg)) + if (!Deg_GetDegreeDataByCod (&Hie.Deg)) Err_WrongDegreeExit (); /***** Write link to degree *****/ @@ -346,7 +346,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void) /***** Get data of this course *****/ Hie.Crs.CrsCod = Str_ConvertStrCodToLongCod (row[0]); - if (!Crs_GetDataOfCourseByCod (&Hie.Crs)) + if (!Crs_GetCourseDataByCod (&Hie.Crs)) Err_WrongCourseExit (); /***** Write link to course *****/ @@ -1579,7 +1579,7 @@ void Crs_RemoveCourse (void) Crs_EditingCrs->CrsCod = ParCod_GetAndCheckPar (ParCod_OthHie); /***** Get data of the course from database *****/ - Crs_GetDataOfCourseByCod (Crs_EditingCrs); + Crs_GetCourseDataByCod (Crs_EditingCrs); if (Crs_CheckIfICanEdit (Crs_EditingCrs)) { @@ -1610,7 +1610,7 @@ void Crs_RemoveCourse (void) /********************* Get data of a course from its code ********************/ /*****************************************************************************/ -bool Crs_GetDataOfCourseByCod (struct Crs_Course *Crs) +bool Crs_GetCourseDataByCod (struct Crs_Course *Crs) { MYSQL_RES *mysql_res; bool CrsFound = false; @@ -1627,7 +1627,7 @@ bool Crs_GetDataOfCourseByCod (struct Crs_Course *Crs) if (Crs->CrsCod > 0) { /***** Get data of a course from database *****/ - if (Crs_DB_GetDataOfCourseByCod (&mysql_res,Crs->CrsCod)) // Course found... + if (Crs_DB_GetCourseDataByCod (&mysql_res,Crs->CrsCod)) // Course found... { /***** Get data of the course *****/ Crs_GetCourseDataFromRow (mysql_res,Crs); @@ -1714,7 +1714,7 @@ static void Crs_EmptyCourseCompletely (long CrsCod) { /***** Get course data *****/ Crs.CrsCod = CrsCod; - Crs_GetDataOfCourseByCod (&Crs); + Crs_GetCourseDataByCod (&Crs); /***** Remove all students in the course *****/ Enr_RemAllStdsInCrs (&Crs); @@ -1754,7 +1754,7 @@ static void Crs_EmptyCourseCompletely (long CrsCod) Prj_RemoveCrsProjects (CrsCod); /***** Remove attendance events of the course *****/ - Att_RemoveCrsAttEvents (CrsCod); + Att_RemoveCrsEvents (CrsCod); /***** Remove notices in the course *****/ Not_DB_RemoveCrsNotices (CrsCod); @@ -1821,7 +1821,7 @@ void Crs_ChangeInsCrsCod (void) Par_GetParText ("InsCrsCod",NewInstitutionalCrsCod,Crs_MAX_BYTES_INSTITUTIONAL_CRS_COD); /* Get data of the course */ - Crs_GetDataOfCourseByCod (Crs_EditingCrs); + Crs_GetCourseDataByCod (Crs_EditingCrs); if (Crs_CheckIfICanEdit (Crs_EditingCrs)) { @@ -1867,7 +1867,7 @@ void Crs_ChangeCrsYear (void) Par_GetParText ("OthCrsYear",YearStr,2); NewYear = Deg_ConvStrToYear (YearStr); - Crs_GetDataOfCourseByCod (Crs_EditingCrs); + Crs_GetCourseDataByCod (Crs_EditingCrs); if (Crs_CheckIfICanEdit (Crs_EditingCrs)) { @@ -1994,7 +1994,7 @@ void Crs_RenameCourse (struct Crs_Course *Crs,Cns_ShrtOrFullName_t ShrtOrFullNam Par_GetParText (ParName,NewCrsName,MaxBytes); /***** Get from the database the data of the degree *****/ - Crs_GetDataOfCourseByCod (Crs); + Crs_GetCourseDataByCod (Crs); if (Crs_CheckIfICanEdit (Crs)) { @@ -2056,7 +2056,7 @@ void Crs_ChangeCrsStatus (void) Status = Hie_GetParStatus (); // New status /***** Get data of course *****/ - Crs_GetDataOfCourseByCod (Crs_EditingCrs); + Crs_GetCourseDataByCod (Crs_EditingCrs); /***** Update status *****/ Crs_DB_UpdateCrsStatus (Crs_EditingCrs->CrsCod,Status); @@ -2400,7 +2400,7 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA /***** Get degree code (row[0]) *****/ if ((Deg.DegCod = Str_ConvertStrCodToLongCod (row[0])) <= 0) Err_WrongDegreeExit (); - if (!Deg_GetDataOfDegreeByCod (&Deg)) + if (!Deg_GetDegreeDataByCod (&Deg)) Err_WrongDegreeExit (); /***** Get course code (row[1]) *****/ diff --git a/swad_course.h b/swad_course.h index 7c264302..1b9496a5 100644 --- a/swad_course.h +++ b/swad_course.h @@ -107,7 +107,7 @@ void Crs_ReceiveFormReqCrs (void); void Crs_ReceiveFormNewCrs (void); void Crs_RemoveCourse (void); -bool Crs_GetDataOfCourseByCod (struct Crs_Course *Crs); +bool Crs_GetCourseDataByCod (struct Crs_Course *Crs); void Crs_RemoveCourseCompletely (long CrsCod); void Crs_ChangeInsCrsCod (void); void Crs_ChangeCrsYear (void); diff --git a/swad_course_config.c b/swad_course_config.c index ed0a641e..d3d71532 100644 --- a/swad_course_config.c +++ b/swad_course_config.c @@ -479,7 +479,7 @@ void CrsCfg_ChangeCrsDeg (void) if (NewDeg.DegCod != Gbl.Hierarchy.Crs.DegCod) { /***** Get data of new degree *****/ - Deg_GetDataOfDegreeByCod (&NewDeg); + Deg_GetDegreeDataByCod (&NewDeg); /***** If name of course was in database in the new degree... *****/ if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg ("ShortName",Gbl.Hierarchy.Crs.ShrtName,-1L, diff --git a/swad_course_database.c b/swad_course_database.c index 256e73ca..9a539a64 100644 --- a/swad_course_database.c +++ b/swad_course_database.c @@ -126,7 +126,7 @@ unsigned Crs_DB_GetCrssInCurrentDegFull (MYSQL_RES **mysql_res) /********************* Get data of a course from its code ********************/ /*****************************************************************************/ -unsigned Crs_DB_GetDataOfCourseByCod (MYSQL_RES **mysql_res,long CrsCod) +unsigned Crs_DB_GetCourseDataByCod (MYSQL_RES **mysql_res,long CrsCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get data of a course", diff --git a/swad_course_database.h b/swad_course_database.h index 3b71c870..8b75fdc4 100644 --- a/swad_course_database.h +++ b/swad_course_database.h @@ -40,7 +40,7 @@ void Crs_DB_CreateCourse (struct Crs_Course *Crs,Hie_Status_t Status); unsigned Crs_DB_GetCrssInDeg (MYSQL_RES **mysql_res,long DegCod); unsigned Crs_DB_GetCrssInCurrentDegBasic (MYSQL_RES **mysql_res); unsigned Crs_DB_GetCrssInCurrentDegFull (MYSQL_RES **mysql_res); -unsigned Crs_DB_GetDataOfCourseByCod (MYSQL_RES **mysql_res,long CrsCod); +unsigned Crs_DB_GetCourseDataByCod (MYSQL_RES **mysql_res,long CrsCod); long Crs_DB_GetCurrentDegCodFromCurrentCrsCod (void); void Crs_DB_GetShortNamesByCod (long CrsCod, char CrsShortName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1], diff --git a/swad_degree.c b/swad_degree.c index 9a6d778d..3540b76d 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -156,7 +156,7 @@ void Deg_SeeDegWithPendingCrss (void) The_GetColorRows (); /* Get data of degree */ - Deg_GetDataOfDegreeByCod (&Deg); + Deg_GetDegreeDataByCod (&Deg); /* Begin table row */ HTM_TR_Begin (NULL); @@ -806,7 +806,7 @@ static void Deg_ListOneDegreeForSeeing (struct Deg_Degree *Deg,unsigned NumDeg) /***** Get data of type of degree of this degree *****/ DegTyp.DegTypCod = Deg->DegTypCod; - if (!DegTyp_GetDataOfDegreeTypeByCod (&DegTyp)) + if (!DegTyp_GetDegreeTypeDataByCod (&DegTyp)) Err_WrongDegTypExit (); if (Deg->Status & Hie_STATUS_BIT_PENDING) @@ -1004,7 +1004,6 @@ void Deg_GetListDegsInCurrentCtr (void) { MYSQL_RES *mysql_res; unsigned NumDeg; - struct Deg_Degree *Deg; /***** Get degrees of the current center from database *****/ Gbl.Hierarchy.Degs.Num = Deg_DB_GetDegsOfCurrentCtrFull (&mysql_res); @@ -1138,7 +1137,7 @@ void Deg_RemoveDegree (void) Deg_EditingDeg->DegCod = ParCod_GetAndCheckPar (ParCod_OthHie); /***** Get data of degree *****/ - Deg_GetDataOfDegreeByCod (Deg_EditingDeg); + Deg_GetDegreeDataByCod (Deg_EditingDeg); /***** Check if this degree has courses *****/ if (Crs_GetNumCrssInDeg (Deg_EditingDeg->DegCod)) // Degree has courses ==> don't remove @@ -1163,7 +1162,7 @@ void Deg_RemoveDegree (void) /*****************************************************************************/ // Returns true if degree found -bool Deg_GetDataOfDegreeByCod (struct Deg_Degree *Deg) +bool Deg_GetDegreeDataByCod (struct Deg_Degree *Deg) { MYSQL_RES *mysql_res; bool DegFound = false; @@ -1181,7 +1180,7 @@ bool Deg_GetDataOfDegreeByCod (struct Deg_Degree *Deg) if (Deg->DegCod > 0) { /***** Get data of a degree from database *****/ - if (Deg_DB_GetDataOfDegreeByCod (&mysql_res,Deg->DegCod)) // Degree found... + if (Deg_DB_GetDegreeDataByCod (&mysql_res,Deg->DegCod)) // Degree found... { /***** Get data of degree *****/ Deg_GetDegreeDataFromRow (mysql_res,Deg); @@ -1348,7 +1347,7 @@ void Deg_RenameDegree (struct Deg_Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFullNam Par_GetParText (ParName,NewDegName,MaxBytes); /***** Get data of degree *****/ - Deg_GetDataOfDegreeByCod (Deg); + Deg_GetDegreeDataByCod (Deg); /***** Check if new name is empty *****/ if (NewDegName[0]) @@ -1404,7 +1403,7 @@ void Deg_ChangeDegreeType (void) NewDegTypCod = ParCod_GetAndCheckPar (ParCod_OthDegTyp); /***** Get data of degree *****/ - Deg_GetDataOfDegreeByCod (Deg_EditingDeg); + Deg_GetDegreeDataByCod (Deg_EditingDeg); /***** Update the table of degrees changing old type by new type *****/ Deg_DB_UpdateDegTyp (Deg_EditingDeg->DegCod,NewDegTypCod); @@ -1437,7 +1436,7 @@ void Deg_ChangeDegWWW (void) Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW); /***** Get data of degree *****/ - Deg_GetDataOfDegreeByCod (Deg_EditingDeg); + Deg_GetDegreeDataByCod (Deg_EditingDeg); /***** Check if new WWW is empty *****/ if (NewWWW[0]) @@ -1476,7 +1475,7 @@ void Deg_ChangeDegStatus (void) Status = Hie_GetParStatus (); // New status /***** Get data of degree *****/ - Deg_GetDataOfDegreeByCod (Deg_EditingDeg); + Deg_GetDegreeDataByCod (Deg_EditingDeg); /***** Update status *****/ Deg_DB_UpdateDegStatus (Deg_EditingDeg->DegCod,Status); @@ -1758,7 +1757,7 @@ void Deg_ListDegsFound (MYSQL_RES **mysql_res,unsigned NumDegs) Deg.DegCod = DB_GetNextCode (*mysql_res); /* Get data of degree */ - Deg_GetDataOfDegreeByCod (&Deg); + Deg_GetDegreeDataByCod (&Deg); /* Write data of this degree */ Deg_ListOneDegreeForSeeing (&Deg,NumDeg); diff --git a/swad_degree.h b/swad_degree.h index ed960cf0..8447acd3 100644 --- a/swad_degree.h +++ b/swad_degree.h @@ -92,7 +92,7 @@ void Deg_ReceiveFormReqDeg (void); void Deg_ReceiveFormNewDeg (void); void Deg_RemoveDegree (void); -bool Deg_GetDataOfDegreeByCod (struct Deg_Degree *Deg); +bool Deg_GetDegreeDataByCod (struct Deg_Degree *Deg); void Deg_RemoveDegreeCompletely (long DegCod); void Deg_RenameDegreeShort (void); void Deg_RenameDegreeFull (void); diff --git a/swad_degree_config.c b/swad_degree_config.c index 67ce21ea..813c35fc 100644 --- a/swad_degree_config.c +++ b/swad_degree_config.c @@ -367,7 +367,7 @@ void DegCfg_ChangeDegCtr (void) if (NewCtr.CtrCod != Gbl.Hierarchy.Deg.CtrCod) { /***** Get data of new center *****/ - Ctr_GetDataOfCenterByCod (&NewCtr); + Ctr_GetCenterDataByCod (&NewCtr); /***** Check if it already exists a degree with the same name in the new center *****/ if (Deg_DB_CheckIfDegNameExistsInCtr ("ShortName",Gbl.Hierarchy.Deg.ShrtName,Gbl.Hierarchy.Deg.DegCod,NewCtr.CtrCod)) diff --git a/swad_degree_database.c b/swad_degree_database.c index e37e0305..92509b8e 100644 --- a/swad_degree_database.c +++ b/swad_degree_database.c @@ -280,7 +280,7 @@ void Deg_DB_GetDegTypeNameByCod (struct DegTyp_DegreeType *DegTyp) /********************* Get data of a degree from its code ********************/ /*****************************************************************************/ -unsigned Deg_DB_GetDataOfDegreeByCod (MYSQL_RES **mysql_res,long DegCod) +unsigned Deg_DB_GetDegreeDataByCod (MYSQL_RES **mysql_res,long DegCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get data of a degree", diff --git a/swad_degree_database.h b/swad_degree_database.h index 9f791d58..a07108c5 100644 --- a/swad_degree_database.h +++ b/swad_degree_database.h @@ -44,7 +44,7 @@ unsigned Deg_DB_GetNumDegreeTypes (HieLvl_Level_t Scope); unsigned Deg_DB_GetDegreeTypes (MYSQL_RES **mysql_res, HieLvl_Level_t Scope,DegTyp_Order_t Order); void Deg_DB_GetDegTypeNameByCod (struct DegTyp_DegreeType *DegTyp); -unsigned Deg_DB_GetDataOfDegreeByCod (MYSQL_RES **mysql_res,long DegCod); +unsigned Deg_DB_GetDegreeDataByCod (MYSQL_RES **mysql_res,long DegCod); long Deg_DB_GetInsCodOfDegreeByCod (long DegCod); long Deg_DB_GetCtrCodOfDegreeByCod (long DegCod); void Deg_DB_GetShortNameOfDegreeByCod (long DegCod,char ShrtName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1]); diff --git a/swad_degree_type.c b/swad_degree_type.c index afddf297..3d3fe358 100644 --- a/swad_degree_type.c +++ b/swad_degree_type.c @@ -704,7 +704,7 @@ void DegTyp_RemoveDegreeType (void) DegTyp_EditingDegTyp->DegTypCod = ParCod_GetAndCheckPar (ParCod_OthDegTyp); /***** Get data of the degree type from database *****/ - if (!DegTyp_GetDataOfDegreeTypeByCod (DegTyp_EditingDegTyp)) + if (!DegTyp_GetDegreeTypeDataByCod (DegTyp_EditingDegTyp)) Err_WrongDegTypExit (); /***** Check if this degree type has degrees *****/ @@ -737,7 +737,7 @@ static void DegTyp_PutParOtherDegTypCod (void *DegTypCod) /****************** Get data of a degree type from its code ******************/ /*****************************************************************************/ -bool DegTyp_GetDataOfDegreeTypeByCod (struct DegTyp_DegreeType *DegTyp) +bool DegTyp_GetDegreeTypeDataByCod (struct DegTyp_DegreeType *DegTyp) { /***** Trivial check: code of degree type should be >= 0 *****/ if (DegTyp->DegTypCod <= 0) @@ -817,7 +817,7 @@ void DegTyp_RenameDegreeType (void) Par_GetParText ("DegTypName",NewNameDegTyp,DegTyp_MAX_BYTES_DEGREE_TYPE_NAME); /***** Get from the database the old name of the degree type *****/ - if (!DegTyp_GetDataOfDegreeTypeByCod (DegTyp_EditingDegTyp)) + if (!DegTyp_GetDegreeTypeDataByCod (DegTyp_EditingDegTyp)) Err_WrongDegTypExit (); /***** Check if new name is empty *****/ diff --git a/swad_degree_type.h b/swad_degree_type.h index 0fd46728..c9e4fc52 100644 --- a/swad_degree_type.h +++ b/swad_degree_type.h @@ -83,7 +83,7 @@ void DegTyp_ReceiveFormNewDegreeType (void); void DegTyp_RemoveDegreeType (void); -bool DegTyp_GetDataOfDegreeTypeByCod (struct DegTyp_DegreeType *DegTyp); +bool DegTyp_GetDegreeTypeDataByCod (struct DegTyp_DegreeType *DegTyp); void DegTyp_RenameDegreeType (void); void DegTyp_ContEditAfterChgDegTyp (void); diff --git a/swad_department.c b/swad_department.c index 33bd157f..ad0f5178 100644 --- a/swad_department.c +++ b/swad_department.c @@ -383,7 +383,7 @@ static void Dpt_GetListDepartments (struct Dpt_Departments *Departments,long Ins /****************** Get data of department using its code ********************/ /*****************************************************************************/ -void Dpt_GetDataOfDepartmentByCod (struct Dpt_Department *Dpt) +void Dpt_GetDepartmentDataByCod (struct Dpt_Department *Dpt) { extern const char *Txt_Another_department; MYSQL_RES *mysql_res; @@ -403,7 +403,7 @@ void Dpt_GetDataOfDepartmentByCod (struct Dpt_Department *Dpt) else if (Dpt->DptCod > 0) { /***** Get data of a department from database *****/ - if (Dpt_DB_GetDataOfDepartmentByCod (&mysql_res,Dpt->DptCod)) // Department found... + if (Dpt_DB_GetDepartmentDataByCod (&mysql_res,Dpt->DptCod)) // Department found... { /* Get row */ row = mysql_fetch_row (mysql_res); @@ -468,7 +468,7 @@ static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departm /* Get data of institution of this department */ Ins.InsCod = Dpt->InsCod; - Ins_GetDataOfInstitByCod (&Ins); + Ins_GetInstitDataByCod (&Ins); HTM_TR_Begin (NULL); @@ -577,7 +577,7 @@ void Dpt_RemoveDepartment (void) Dpt_EditingDpt->DptCod = ParCod_GetAndCheckPar (ParCod_Dpt); /***** Get data of the department from database *****/ - Dpt_GetDataOfDepartmentByCod (Dpt_EditingDpt); + Dpt_GetDepartmentDataByCod (Dpt_EditingDpt); /***** Check if this department has teachers *****/ if (Dpt_EditingDpt->NumTchs) // Department has teachers ==> don't remove @@ -615,7 +615,7 @@ void Dpt_ChangeDepartIns (void) NewInsCod = ParCod_GetAndCheckPar (ParCod_OthIns); /***** Get data of the department from database *****/ - Dpt_GetDataOfDepartmentByCod (Dpt_EditingDpt); + Dpt_GetDepartmentDataByCod (Dpt_EditingDpt); /***** Update institution in table of departments *****/ Dpt_DB_UpdateDptIns (Dpt_EditingDpt->DptCod,NewInsCod); @@ -690,7 +690,7 @@ static void Dpt_RenameDepartment (Cns_ShrtOrFullName_t ShrtOrFullName) Par_GetParText (ParName,NewDptName,MaxBytes); /***** Get from the database the old names of the department *****/ - Dpt_GetDataOfDepartmentByCod (Dpt_EditingDpt); + Dpt_GetDepartmentDataByCod (Dpt_EditingDpt); /***** Check if new name is empty *****/ if (NewDptName[0]) @@ -746,7 +746,7 @@ void Dpt_ChangeDptWWW (void) Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW); /***** Get data of the department from database *****/ - Dpt_GetDataOfDepartmentByCod (Dpt_EditingDpt); + Dpt_GetDepartmentDataByCod (Dpt_EditingDpt); /***** Check if new WWW is empty *****/ if (NewWWW[0]) diff --git a/swad_department.h b/swad_department.h index 52ee8d94..bf89849c 100644 --- a/swad_department.h +++ b/swad_department.h @@ -65,7 +65,7 @@ struct Dpt_Departments void Dpt_SeeDepts (void); void Dpt_EditDepartments (void); void Dpt_FreeListDepartments (struct Dpt_Departments *Departments); -void Dpt_GetDataOfDepartmentByCod (struct Dpt_Department *Dpt); +void Dpt_GetDepartmentDataByCod (struct Dpt_Department *Dpt); void Dpt_RemoveDepartment (void); void Dpt_ChangeDepartIns (void); void Dpt_RenameDepartShort (void); diff --git a/swad_department_database.c b/swad_department_database.c index 74d46c77..080830c4 100644 --- a/swad_department_database.c +++ b/swad_department_database.c @@ -109,7 +109,7 @@ unsigned Dpt_DB_GetListDepartments (MYSQL_RES **mysql_res, /****************** Get data of department using its code ********************/ /*****************************************************************************/ -unsigned Dpt_DB_GetDataOfDepartmentByCod (MYSQL_RES **mysql_res,long DptCod) +unsigned Dpt_DB_GetDepartmentDataByCod (MYSQL_RES **mysql_res,long DptCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get data of a department", diff --git a/swad_department_database.h b/swad_department_database.h index 60778f86..fa0015d7 100644 --- a/swad_department_database.h +++ b/swad_department_database.h @@ -40,7 +40,7 @@ void Dpt_DB_CreateDepartment (const struct Dpt_Department *Dpt); unsigned Dpt_DB_GetListDepartments (MYSQL_RES **mysql_res, long InsCod,Dpt_Order_t SelectedOrder); -unsigned Dpt_DB_GetDataOfDepartmentByCod (MYSQL_RES **mysql_res,long DptCod); +unsigned Dpt_DB_GetDepartmentDataByCod (MYSQL_RES **mysql_res,long DptCod); bool Dpt_DB_CheckIfDepartmentNameExists (const char *FldName,const char *Name,long DptCod); unsigned Dpt_DB_GetNumDepartmentsInInstitution (long InsCod); unsigned Dpt_DB_GetNumTchsCurrentInsInDepartment (long DptCod); diff --git a/swad_enrolment.c b/swad_enrolment.c index 37a6ce27..0599991d 100644 --- a/swad_enrolment.c +++ b/swad_enrolment.c @@ -2222,9 +2222,9 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected) /***** Link to course *****/ HTM_TD_Begin ("class=\"LT DAT_%s\"",The_GetSuffix ()); - Crs_GetDataOfCourseByCod (&Crs); + Crs_GetCourseDataByCod (&Crs); Deg.DegCod = Crs.DegCod; - Deg_GetDataOfDegreeByCod (&Deg); + Deg_GetDegreeDataByCod (&Deg); Frm_BeginFormGoTo (ActSeeCrsInf); ParCod_PutPar (ParCod_Crs,Crs.CrsCod); @@ -3104,7 +3104,7 @@ static void Enr_EffectivelyRemUsrFromCrs (struct Usr_Data *UsrDat, if (Enr_CheckIfUsrBelongsToCurrentCrs (UsrDat)) { /***** Remove user from all attendance events in course *****/ - Att_DB_RemoveUsrFromCrsAttEvents (UsrDat->UsrCod,Crs->CrsCod); + Att_DB_RemoveUsrFromCrsEvents (UsrDat->UsrCod,Crs->CrsCod); /***** Remove user from all groups in course *****/ Grp_RemUsrFromAllGrpsInCrs (UsrDat->UsrCod,Crs->CrsCod); diff --git a/swad_exam.c b/swad_exam.c index fe00f8a0..f70aa975 100644 --- a/swad_exam.c +++ b/swad_exam.c @@ -284,7 +284,7 @@ void Exa_ListAllExams (struct Exa_Exams *Exams) { /* Get data of this exam */ Exams->Exam.ExaCod = Exams->Lst[NumExam - 1].ExaCod; - Exa_GetDataOfExamByCod (&Exams->Exam); + Exa_GetExamDataByCod (&Exams->Exam); /* Show exam */ Exa_ShowOneExam (Exams, @@ -417,7 +417,7 @@ void Exa_SeeOneExam (void) Exa_GetPars (&Exams,true); /***** Get exam data *****/ - Exa_GetDataOfExamByCod (&Exams.Exam); + Exa_GetExamDataByCod (&Exams.Exam); /***** Show exam *****/ Exa_ShowOnlyOneExam (&Exams,&Session, @@ -875,7 +875,7 @@ void Exa_GetListSelectedExaCods (struct Exa_Exams *Exams) /********************** Get exam data using its code *************************/ /*****************************************************************************/ -void Exa_GetDataOfExamByCod (struct Exa_Exam *Exam) +void Exa_GetExamDataByCod (struct Exa_Exam *Exam) { MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -889,7 +889,7 @@ void Exa_GetDataOfExamByCod (struct Exa_Exam *Exam) } /***** Get exam data from database *****/ - if (Exa_DB_GetDataOfExamByCod (&mysql_res,Exam->ExaCod)) // Exam found... + if (Exa_DB_GetExamDataByCod (&mysql_res,Exam->ExaCod)) // Exam found... { /* Get row */ row = mysql_fetch_row (mysql_res); @@ -994,7 +994,7 @@ void Exa_AskRemExam (void) Exa_GetPars (&Exams,true); /***** Get data of the exam from database *****/ - Exa_GetDataOfExamByCod (&Exams.Exam); + Exa_GetExamDataByCod (&Exams.Exam); /***** Show question and button to remove exam *****/ Ale_ShowAlertAndButton (ActRemExa,NULL,NULL, @@ -1028,7 +1028,7 @@ void Exa_RemoveExam (void) Exams.Exam.ExaCod = ParCod_GetAndCheckPar (ParCod_Exa); /***** Get data of the exam from database *****/ - Exa_GetDataOfExamByCod (&Exams.Exam); + Exa_GetExamDataByCod (&Exams.Exam); /***** Remove exam from all tables *****/ Exa_RemoveExamFromAllTables (Exams.Exam.ExaCod); @@ -1216,7 +1216,7 @@ static void Exa_HideUnhideExam (bool Hide) Exa_GetPars (&Exams,true); /***** Get data of the exam from database *****/ - Exa_GetDataOfExamByCod (&Exams.Exam); + Exa_GetExamDataByCod (&Exams.Exam); /***** Unhide exam *****/ Exa_DB_HideOrUnhideExam (Exams.Exam.ExaCod,Hide); @@ -1254,7 +1254,7 @@ void Exa_ReqCreatOrEditExam (void) Exa_ResetExam (&Exams.Exam); else /* Get exam data from database */ - Exa_GetDataOfExamByCod (&Exams.Exam); + Exa_GetExamDataByCod (&Exams.Exam); /***** Put form to create/edit an exam and show sets *****/ Exa_PutFormsOneExam (&Exams,&Set,ItsANewExam); @@ -1425,7 +1425,7 @@ void Exa_ReceiveFormExam (void) // Some data, not received from form, // are necessary to show exam and sets of questions again if (!ItsANewExam) - Exa_GetDataOfExamByCod (&Exams.Exam); + Exa_GetExamDataByCod (&Exams.Exam); /***** Overwrite some exam data with the data received from form *****/ Exa_ReceiveExamFieldsFromForm (&Exams.Exam,Txt); diff --git a/swad_exam.h b/swad_exam.h index 9edbe3e6..8ea27527 100644 --- a/swad_exam.h +++ b/swad_exam.h @@ -56,8 +56,8 @@ void Exa_GetPars (struct Exa_Exams *Exams,bool CheckExaCod); void Exa_GetListExams (struct Exa_Exams *Exams,Exa_Order_t SelectedOrder); void Exa_GetListSelectedExaCods (struct Exa_Exams *Exams); -void Exa_GetDataOfExamByCod (struct Exa_Exam *Exam); -void Exa_GetDataOfExamByFolder (struct Exa_Exam *Exam); +void Exa_GetExamDataByCod (struct Exa_Exam *Exam); +void Exa_GetExamDataByFolder (struct Exa_Exam *Exam); void Exa_FreeListExams (struct Exa_Exams *Exams); void Exa_AskRemExam (void); diff --git a/swad_exam_database.c b/swad_exam_database.c index 55a846d9..b60fb1bc 100644 --- a/swad_exam_database.c +++ b/swad_exam_database.c @@ -183,7 +183,7 @@ unsigned Exa_DB_GetListExams (MYSQL_RES **mysql_res,Exa_Order_t SelectedOrder) /********************** Get exam data using its code *************************/ /*****************************************************************************/ -unsigned Exa_DB_GetDataOfExamByCod (MYSQL_RES **mysql_res,long ExaCod) +unsigned Exa_DB_GetExamDataByCod (MYSQL_RES **mysql_res,long ExaCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get exam data", @@ -663,7 +663,7 @@ unsigned Exa_DB_GetExamSets (MYSQL_RES **mysql_res,long ExaCod) /*********************** Get set data using its code *************************/ /*****************************************************************************/ -unsigned Exa_DB_GetDataOfSetByCod (MYSQL_RES **mysql_res,long SetCod) +unsigned Exa_DB_GetSetDataByCod (MYSQL_RES **mysql_res,long SetCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get set data", @@ -1461,7 +1461,7 @@ unsigned Exa_DB_GetSessions (MYSQL_RES **mysql_res,long ExaCod) /******************* Get exam session data using its code ********************/ /*****************************************************************************/ -unsigned Exa_DB_GetDataOfSessionByCod (MYSQL_RES **mysql_res,long SesCod) +unsigned Exa_DB_GetSessionDataByCod (MYSQL_RES **mysql_res,long SesCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get sessions", @@ -1788,7 +1788,7 @@ void Exa_DB_UpdatePrint (const struct ExaPrn_Print *Print) /**************** Get data of an exam print using print code *****************/ /*****************************************************************************/ -unsigned Exa_DB_GetDataOfPrintByPrnCod (MYSQL_RES **mysql_res,long PrnCod) +unsigned Exa_DB_GetPrintDataByPrnCod (MYSQL_RES **mysql_res,long PrnCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get data of an exam print", @@ -1810,8 +1810,8 @@ unsigned Exa_DB_GetDataOfPrintByPrnCod (MYSQL_RES **mysql_res,long PrnCod) /******** Get data of an exam print using session code and user code *********/ /*****************************************************************************/ -unsigned Exa_DB_GetDataOfPrintBySesCodAndUsrCod (MYSQL_RES **mysql_res, - long SesCod,long UsrCod) +unsigned Exa_DB_GetPrintDataBySesCodAndUsrCod (MYSQL_RES **mysql_res, + long SesCod,long UsrCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get data of an exam print", diff --git a/swad_exam_database.h b/swad_exam_database.h index 5ba2a08e..74abcac4 100644 --- a/swad_exam_database.h +++ b/swad_exam_database.h @@ -42,7 +42,7 @@ long Exa_DB_CreateExam (const struct Exa_Exam *Exam,const char *Txt); void Exa_DB_UpdateExam (const struct Exa_Exam *Exam,const char *Txt); void Exa_DB_HideOrUnhideExam (long ExaCod,bool Hide); unsigned Exa_DB_GetListExams (MYSQL_RES **mysql_res,Exa_Order_t SelectedOrder); -unsigned Exa_DB_GetDataOfExamByCod (MYSQL_RES **mysql_res,long ExaCod); +unsigned Exa_DB_GetExamDataByCod (MYSQL_RES **mysql_res,long ExaCod); unsigned Exa_DB_GetExamStartEnd (MYSQL_RES **mysql_res,long ExaCod); void Exa_DB_GetExamTitle (long ExaCod,char Title[Exa_MAX_BYTES_TITLE + 1]); void Exa_DB_GetExamTxt (long ExaCod,char Txt[Cns_MAX_BYTES_TEXT + 1]); @@ -64,7 +64,7 @@ void Exa_DB_LockTables (void); unsigned Exa_DB_GetNumSetsExam (long ExaCod); unsigned Exa_DB_GetNumQstsExam (long ExaCod); unsigned Exa_DB_GetExamSets (MYSQL_RES **mysql_res,long ExaCod); -unsigned Exa_DB_GetDataOfSetByCod (MYSQL_RES **mysql_res,long SetCod); +unsigned Exa_DB_GetSetDataByCod (MYSQL_RES **mysql_res,long SetCod); bool Exa_DB_CheckIfSimilarSetExists (const struct ExaSet_Set *Set, const char Title[ExaSet_MAX_BYTES_TITLE + 1]); unsigned Exa_DB_GetSetIndFromSetCod (long ExaCod,long SetCod); @@ -114,7 +114,7 @@ void Exa_DB_UpdateSession (const struct ExaSes_Session *Session); unsigned Exa_DB_GetNumSessionsInExam (long ExaCod); unsigned Exa_DB_GetNumOpenSessionsInExam (long ExaCod); unsigned Exa_DB_GetSessions (MYSQL_RES **mysql_res,long ExaCod); -unsigned Exa_DB_GetDataOfSessionByCod (MYSQL_RES **mysql_res,long SesCod); +unsigned Exa_DB_GetSessionDataByCod (MYSQL_RES **mysql_res,long SesCod); void Exa_DB_ToggleVisResultsSesUsr (const struct ExaSes_Session *Session); void Exa_DB_HideUnhideSession (const struct ExaSes_Session *Session,bool Hide); void Exa_DB_RemoveSessionFromAllTables (long SesCod); @@ -135,9 +135,9 @@ void Exa_DB_RemoveGroup (long GrpCod); //---------------------------------- Prints ----------------------------------- long Exa_DB_CreatePrint (const struct ExaPrn_Print *Print); void Exa_DB_UpdatePrint (const struct ExaPrn_Print *Print); -unsigned Exa_DB_GetDataOfPrintByPrnCod (MYSQL_RES **mysql_res,long PrnCod); -unsigned Exa_DB_GetDataOfPrintBySesCodAndUsrCod (MYSQL_RES **mysql_res, - long SesCod,long UsrCod); +unsigned Exa_DB_GetPrintDataByPrnCod (MYSQL_RES **mysql_res,long PrnCod); +unsigned Exa_DB_GetPrintDataBySesCodAndUsrCod (MYSQL_RES **mysql_res, + long SesCod,long UsrCod); void Exa_DB_RemoveAllPrintsMadeByUsrInAllCrss (long UsrCod); void Exa_DB_RemoveAllPrintsMadeByUsrInCrs (long UsrCod,long CrsCod); void Exa_DB_RemoveAllPrintsFromSes (long SesCod); diff --git a/swad_exam_print.c b/swad_exam_print.c index 4409be84..8f21365b 100644 --- a/swad_exam_print.c +++ b/swad_exam_print.c @@ -62,9 +62,9 @@ extern struct Globals Gbl; /***************************** Private prototypes ****************************/ /*****************************************************************************/ -static void ExaPrn_GetDataOfPrint (struct ExaPrn_Print *Print, - MYSQL_RES **mysql_res, - unsigned NumPrints); +static void ExaPrn_GetPrintDataFromRow (MYSQL_RES **mysql_res, + struct ExaPrn_Print *Print, + unsigned NumPrints); static void ExaPrn_GetQuestionsForNewPrintFromDB (struct ExaPrn_Print *Print,long ExaCod); static unsigned ExaPrn_GetSomeQstsFromSetToPrint (struct ExaPrn_Print *Print, @@ -185,7 +185,7 @@ void ExaPrn_ShowExamPrint (void) Print.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; /***** Get exam print data from database *****/ - ExaPrn_GetDataOfPrintBySesCodAndUsrCod (&Print); + ExaPrn_GetPrintDataBySesCodAndUsrCod (&Print); if (Print.PrnCod <= 0) // Exam print does not exists ==> create it { @@ -210,7 +210,7 @@ void ExaPrn_ShowExamPrint (void) else // Exam print exists { /***** Get exam print data from database *****/ - ExaPrn_GetDataOfPrintBySesCodAndUsrCod (&Print); + ExaPrn_GetPrintDataBySesCodAndUsrCod (&Print); /***** Get questions and current user's answers from database *****/ ExaPrn_GetPrintQuestionsFromDB (&Print); @@ -233,43 +233,43 @@ void ExaPrn_ShowExamPrint (void) /**************** Get data of an exam print using print code *****************/ /*****************************************************************************/ -void ExaPrn_GetDataOfPrintByPrnCod (struct ExaPrn_Print *Print) +void ExaPrn_GetPrintDataByPrnCod (struct ExaPrn_Print *Print) { MYSQL_RES *mysql_res; unsigned NumPrints; /***** Make database query *****/ - NumPrints = Exa_DB_GetDataOfPrintByPrnCod (&mysql_res,Print->PrnCod); + NumPrints = Exa_DB_GetPrintDataByPrnCod (&mysql_res,Print->PrnCod); /***** Get data of print *****/ - ExaPrn_GetDataOfPrint (Print,&mysql_res,NumPrints); + ExaPrn_GetPrintDataFromRow (&mysql_res,Print,NumPrints); } /*****************************************************************************/ /******** Get data of an exam print using session code and user code *********/ /*****************************************************************************/ -void ExaPrn_GetDataOfPrintBySesCodAndUsrCod (struct ExaPrn_Print *Print) +void ExaPrn_GetPrintDataBySesCodAndUsrCod (struct ExaPrn_Print *Print) { MYSQL_RES *mysql_res; unsigned NumPrints; /***** Make database query *****/ - NumPrints = Exa_DB_GetDataOfPrintBySesCodAndUsrCod (&mysql_res, - Print->SesCod, - Print->UsrCod); + NumPrints = Exa_DB_GetPrintDataBySesCodAndUsrCod (&mysql_res, + Print->SesCod, + Print->UsrCod); /***** Get data of print *****/ - ExaPrn_GetDataOfPrint (Print,&mysql_res,NumPrints); + ExaPrn_GetPrintDataFromRow (&mysql_res,Print,NumPrints); } /*****************************************************************************/ /************************* Get assignment data *******************************/ /*****************************************************************************/ -static void ExaPrn_GetDataOfPrint (struct ExaPrn_Print *Print, - MYSQL_RES **mysql_res, - unsigned NumPrints) +static void ExaPrn_GetPrintDataFromRow (MYSQL_RES **mysql_res, + struct ExaPrn_Print *Print, + unsigned NumPrints) { MYSQL_ROW row; @@ -691,7 +691,7 @@ static void ExaPrn_WriteQstAndAnsToFill (const struct ExaPrn_Print *Print, { /***** Get data of this set *****/ CurrentSet.SetCod = Print->PrintedQuestions[QstInd].SetCod; - ExaSet_GetDataOfSetByCod (&CurrentSet); + ExaSet_GetSetDataByCod (&CurrentSet); /***** Title for this set *****/ HTM_TR_Begin (NULL); @@ -960,20 +960,20 @@ void ExaPrn_ReceivePrintAnswer (void) /***** Get print data *****/ Print.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; - ExaPrn_GetDataOfPrintBySesCodAndUsrCod (&Print); + ExaPrn_GetPrintDataBySesCodAndUsrCod (&Print); if (Print.PrnCod <= 0) Err_WrongExamExit (); /***** Get session data *****/ Session.SesCod = Print.SesCod; - ExaSes_GetDataOfSessionByCod (&Session); + ExaSes_GetSessionDataByCod (&Session); if (Session.SesCod <= 0) Err_WrongExamExit (); Exams.SesCod = Session.SesCod; /***** Get exam data *****/ Exams.Exam.ExaCod = Session.ExaCod; - Exa_GetDataOfExamByCod (&Exams.Exam); + Exa_GetExamDataByCod (&Exams.Exam); if (Exams.Exam.ExaCod <= 0) Err_WrongExamExit (); if (Exams.Exam.CrsCod != Gbl.Hierarchy.Crs.CrsCod) diff --git a/swad_exam_print.h b/swad_exam_print.h index 26e36fcc..fc1deb1f 100644 --- a/swad_exam_print.h +++ b/swad_exam_print.h @@ -80,8 +80,8 @@ void ExaPrn_ResetPrint (struct ExaPrn_Print *Print); void ExaPrn_ShowExamPrint (void); -void ExaPrn_GetDataOfPrintByPrnCod (struct ExaPrn_Print *Print); -void ExaPrn_GetDataOfPrintBySesCodAndUsrCod (struct ExaPrn_Print *Print); +void ExaPrn_GetPrintDataByPrnCod (struct ExaPrn_Print *Print); +void ExaPrn_GetPrintDataBySesCodAndUsrCod (struct ExaPrn_Print *Print); void ExaPrn_GetPrintQuestionsFromDB (struct ExaPrn_Print *Print); diff --git a/swad_exam_result.c b/swad_exam_result.c index ce05d452..e8aa7087 100644 --- a/swad_exam_result.c +++ b/swad_exam_result.c @@ -198,7 +198,7 @@ void ExaRes_ShowMyResultsInExa (void) Exa_GetPars (&Exams,true); /***** Get exam data from database *****/ - Exa_GetDataOfExamByCod (&Exams.Exam); + Exa_GetExamDataByCod (&Exams.Exam); /***** Exam begin *****/ Exa_ShowOnlyOneExamBegin (&Exams,&Session, @@ -245,8 +245,8 @@ void ExaRes_ShowMyResultsInSes (void) /***** Get parameters *****/ Exa_GetPars (&Exams,true); Session.SesCod = ParCod_GetAndCheckPar (ParCod_Ses); - Exa_GetDataOfExamByCod (&Exams.Exam); - ExaSes_GetDataOfSessionByCod (&Session); + Exa_GetExamDataByCod (&Exams.Exam); + ExaSes_GetSessionDataByCod (&Session); /***** Exam begin *****/ Exa_ShowOnlyOneExamBegin (&Exams,&Session, @@ -390,7 +390,7 @@ void ExaRes_ShowAllResultsInExa (void) /***** Get parameters *****/ Exa_GetPars (&Exams,true); - Exa_GetDataOfExamByCod (&Exams.Exam); + Exa_GetExamDataByCod (&Exams.Exam); /***** Exam begin *****/ Exa_ShowOnlyOneExamBegin (&Exams,&Session, @@ -461,8 +461,8 @@ void ExaRes_ShowAllResultsInSes (void) Session.SesCod = ParCod_GetAndCheckPar (ParCod_Ses); /***** Get exam data and session *****/ - Exa_GetDataOfExamByCod (&Exams.Exam); - ExaSes_GetDataOfSessionByCod (&Session); + Exa_GetExamDataByCod (&Exams.Exam); + ExaSes_GetSessionDataByCod (&Session); /***** Exam begin *****/ Exa_ShowOnlyOneExamBegin (&Exams,&Session, @@ -598,7 +598,7 @@ static void ExaRes_ListExamsToSelect (struct Exa_Exams *Exams) { /* Get data of this exam */ Exams->Exam.ExaCod = Exams->Lst[NumExam].ExaCod; - Exa_GetDataOfExamByCod (&Exams->Exam); + Exa_GetExamDataByCod (&Exams->Exam); /* Write a row for this session */ HTM_TR_Begin (NULL); @@ -806,13 +806,13 @@ static void ExaRes_ShowResults (struct Exa_Exams *Exams, Err_WrongExamExit (); /* Get print data */ - ExaPrn_GetDataOfPrintByPrnCod (&Print); + ExaPrn_GetPrintDataByPrnCod (&Print); /* Get data of session and exam */ Session.SesCod = Print.SesCod; - ExaSes_GetDataOfSessionByCod (&Session); + ExaSes_GetSessionDataByCod (&Session); Exam.ExaCod = Session.ExaCod; - Exa_GetDataOfExamByCod (&Exam); + Exa_GetExamDataByCod (&Exam); /* Check if I can view this print result and its score */ ExaRes_CheckIfICanViewResult (&Exam,&Session,UsrDat->UsrCod,&ICanView); @@ -1249,7 +1249,7 @@ void ExaRes_ShowExaResultAfterFinish (void) /***** Get exam print data *****/ Print.SesCod = Session.SesCod; Print.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; - ExaPrn_GetDataOfPrintBySesCodAndUsrCod (&Print); + ExaPrn_GetPrintDataBySesCodAndUsrCod (&Print); /***** Set log action and print code *****/ // The user has clicked on the "I have finished" button in an exam print @@ -1304,7 +1304,7 @@ void ExaRes_ShowOneExaResult (void) /***** Get exam print data *****/ Print.SesCod = Session.SesCod; Print.UsrCod = UsrDat->UsrCod; - ExaPrn_GetDataOfPrintBySesCodAndUsrCod (&Print); + ExaPrn_GetPrintDataBySesCodAndUsrCod (&Print); /***** Get questions and user's answers of exam print from database *****/ ExaPrn_GetPrintQuestionsFromDB (&Print); diff --git a/swad_exam_session.c b/swad_exam_session.c index a5d11912..30d36598 100644 --- a/swad_exam_session.c +++ b/swad_exam_session.c @@ -206,7 +206,7 @@ void ExaSes_ListSessions (struct Exa_Exams *Exams, /******************* Get exam session data using its code ********************/ /*****************************************************************************/ -void ExaSes_GetDataOfSessionByCod (struct ExaSes_Session *Session) +void ExaSes_GetSessionDataByCod (struct ExaSes_Session *Session) { MYSQL_RES *mysql_res; @@ -219,7 +219,7 @@ void ExaSes_GetDataOfSessionByCod (struct ExaSes_Session *Session) } /***** Get exam data session from database *****/ - if (Exa_DB_GetDataOfSessionByCod (&mysql_res,Session->SesCod)) // Session found... + if (Exa_DB_GetSessionDataByCod (&mysql_res,Session->SesCod)) // Session found... /* Get exam session data from row */ ExaSes_GetSessionDataFromRow (mysql_res,Session); else @@ -853,7 +853,7 @@ void ExaSes_RemoveSession (void) Session.Title); /***** Get exam data again to update it after changes in session *****/ - Exa_GetDataOfExamByCod (&Exams.Exam); + Exa_GetExamDataByCod (&Exams.Exam); /***** Show current exam *****/ Exa_ShowOnlyOneExam (&Exams,&Session, @@ -944,12 +944,12 @@ void ExaSes_GetAndCheckPars (struct Exa_Exams *Exams, Session->SesCod = ParCod_GetAndCheckPar (ParCod_Ses); /***** Get exam data from database *****/ - Exa_GetDataOfExamByCod (&Exams->Exam); + Exa_GetExamDataByCod (&Exams->Exam); if (Exams->Exam.CrsCod != Gbl.Hierarchy.Crs.CrsCod) Err_WrongExamExit (); /***** Get set data from database *****/ - ExaSes_GetDataOfSessionByCod (Session); + ExaSes_GetSessionDataByCod (Session); if (Session->ExaCod != Exams->Exam.ExaCod) Err_WrongSetExit (); Exams->SesCod = Session->SesCod; @@ -1127,7 +1127,7 @@ void ExaSes_ReqCreatOrEditSes (void) ItsANewSession = (Session.SesCod <= 0); /***** Get exam data from database *****/ - Exa_GetDataOfExamByCod (&Exams.Exam); + Exa_GetExamDataByCod (&Exams.Exam); if (Exams.Exam.CrsCod != Gbl.Hierarchy.Crs.CrsCod) Err_WrongExamExit (); @@ -1138,7 +1138,7 @@ void ExaSes_ReqCreatOrEditSes (void) else { /* Get session data from database */ - ExaSes_GetDataOfSessionByCod (&Session); + ExaSes_GetSessionDataByCod (&Session); if (Exams.Exam.ExaCod != Session.ExaCod) Err_WrongExamExit (); Exams.SesCod = Session.SesCod; @@ -1173,7 +1173,7 @@ void ExaSes_ReceiveFormSession (void) ItsANewSession = (Session.SesCod <= 0); /***** Get exam data from database *****/ - Exa_GetDataOfExamByCod (&Exams.Exam); + Exa_GetExamDataByCod (&Exams.Exam); if (Exams.Exam.CrsCod != Gbl.Hierarchy.Crs.CrsCod) Err_WrongExamExit (); @@ -1187,7 +1187,7 @@ void ExaSes_ReceiveFormSession (void) else { /* Get session data from database */ - ExaSes_GetDataOfSessionByCod (&Session); + ExaSes_GetSessionDataByCod (&Session); if (Session.ExaCod != Exams.Exam.ExaCod) Err_WrongExamExit (); Exams.SesCod = Session.SesCod; @@ -1225,7 +1225,7 @@ void ExaSes_ReceiveFormSession (void) Ale_ShowAlert (Ale_SUCCESS,Txt_The_event_has_been_modified); /***** Get exam data again to update it after changes in session *****/ - Exa_GetDataOfExamByCod (&Exams.Exam); + Exa_GetExamDataByCod (&Exams.Exam); /***** Show current exam *****/ Exa_ShowOnlyOneExam (&Exams,&Session, diff --git a/swad_exam_session.h b/swad_exam_session.h index 49cce744..aa321ef5 100644 --- a/swad_exam_session.h +++ b/swad_exam_session.h @@ -53,7 +53,7 @@ void ExaSes_ResetSession (struct ExaSes_Session *Session); void ExaSes_ListSessions (struct Exa_Exams *Exams, struct ExaSes_Session *Session, bool PutFormSession); -void ExaSes_GetDataOfSessionByCod (struct ExaSes_Session *Session); +void ExaSes_GetSessionDataByCod (struct ExaSes_Session *Session); void ExaSes_ToggleVisResultsSesUsr (void); diff --git a/swad_exam_set.c b/swad_exam_set.c index 5be32c72..28dd01be 100644 --- a/swad_exam_set.c +++ b/swad_exam_set.c @@ -150,7 +150,7 @@ static void ExaSet_PutParsOneQst (void *Exams) /*********************** Get set data using its code *************************/ /*****************************************************************************/ -void ExaSet_GetDataOfSetByCod (struct ExaSet_Set *Set) +void ExaSet_GetSetDataByCod (struct ExaSet_Set *Set) { MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -164,7 +164,7 @@ void ExaSet_GetDataOfSetByCod (struct ExaSet_Set *Set) } /***** Get data of set of questions from database *****/ - if (Exa_DB_GetDataOfSetByCod (&mysql_res,Set->SetCod)) // Set found... + if (Exa_DB_GetSetDataByCod (&mysql_res,Set->SetCod)) // Set found... { /* Get row */ row = mysql_fetch_row (mysql_res); @@ -284,7 +284,7 @@ void ExaSet_ReceiveFormSet (void) Set.ExaCod = Exams.Exam.ExaCod; /***** Get exam data from database *****/ - Exa_GetDataOfExamByCod (&Exams.Exam); + Exa_GetExamDataByCod (&Exams.Exam); /***** Check if exam is editable *****/ if (!Exa_CheckIfEditable (&Exams.Exam)) @@ -482,7 +482,7 @@ void ExaSet_ReqCreatOrEditSet (void) ItsANewSet = (Set.SetCod <= 0); /***** Get exam data from database *****/ - Exa_GetDataOfExamByCod (&Exams.Exam); + Exa_GetExamDataByCod (&Exams.Exam); Exa_DB_GetExamTxt (Exams.Exam.ExaCod,Txt); /***** Get set data *****/ @@ -492,7 +492,7 @@ void ExaSet_ReqCreatOrEditSet (void) else { /* Get set data from database */ - ExaSet_GetDataOfSetByCod (&Set); + ExaSet_GetSetDataByCod (&Set); Exams.SetCod = Set.SetCod; } @@ -544,7 +544,7 @@ void ExaSet_ListQstsToAddToSet (void) ExaSet_GetAndCheckPars (&Exams,&Set); /***** Get set data from database *****/ - ExaSet_GetDataOfSetByCod (&Set); + ExaSet_GetSetDataByCod (&Set); Exams.SetCod = Set.SetCod; /***** List several test questions for selection *****/ @@ -1187,7 +1187,7 @@ void ExaSet_AddQstsToSet (void) ExaSet_GetAndCheckPars (&Exams,&Set); /***** Get set data from database *****/ - ExaSet_GetDataOfSetByCod (&Set); + ExaSet_GetSetDataByCod (&Set); Exams.SetCod = Set.SetCod; /***** Get selected questions *****/ @@ -1279,8 +1279,8 @@ static void ExaSet_CopyQstFromBankToExamSet (const struct ExaSet_Set *Set,long Q QstCodInSet = Exa_DB_AddQuestionToSet (Set->SetCod,&Question,CloneMedCod); /***** Get the answers from the database *****/ - Question.Answer.NumOptions = Qst_DB_GetDataOfAnswers (&mysql_res,Question.QstCod, - false); // Don't shuffle + Question.Answer.NumOptions = Qst_DB_GetAnswersData (&mysql_res,Question.QstCod, + false); // Don't shuffle /* row[0] AnsInd row[1] Answer @@ -1657,12 +1657,12 @@ static void ExaSet_GetAndCheckPars (struct Exa_Exams *Exams, Set->SetCod = ParCod_GetAndCheckPar (ParCod_Set); /***** Get exam data from database *****/ - Exa_GetDataOfExamByCod (&Exams->Exam); + Exa_GetExamDataByCod (&Exams->Exam); if (Exams->Exam.CrsCod != Gbl.Hierarchy.Crs.CrsCod) Err_WrongExamExit (); /***** Get set data from database *****/ - ExaSet_GetDataOfSetByCod (Set); + ExaSet_GetSetDataByCod (Set); if (Set->ExaCod != Exams->Exam.ExaCod) Err_WrongSetExit (); Exams->SetCod = Set->SetCod; diff --git a/swad_exam_set.h b/swad_exam_set.h index 96df3572..621a07a0 100644 --- a/swad_exam_set.h +++ b/swad_exam_set.h @@ -37,7 +37,7 @@ void ExaSet_PutParsOneSet (void *Exams); -void ExaSet_GetDataOfSetByCod (struct ExaSet_Set *Set); +void ExaSet_GetSetDataByCod (struct ExaSet_Set *Set); void ExaSet_ReceiveFormSet (void); void ExaSet_ChangeSetTitle (void); diff --git a/swad_forum.c b/swad_forum.c index 4b39e21b..67452f8f 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -1813,13 +1813,13 @@ void For_SetForumName (const struct For_Forum *Forum, break; case For_FORUM_INSTIT_USRS: Hie.Ins.InsCod = Forum->Location; - if (!Ins_GetDataOfInstitByCod (&Hie.Ins)) + if (!Ins_GetInstitDataByCod (&Hie.Ins)) Err_WrongInstitExit (); Str_Copy (ForumName,Hie.Ins.ShrtName,For_MAX_BYTES_FORUM_NAME); break; case For_FORUM_INSTIT_TCHS: Hie.Ins.InsCod = Forum->Location; - if (!Ins_GetDataOfInstitByCod (&Hie.Ins)) + if (!Ins_GetInstitDataByCod (&Hie.Ins)) Err_WrongInstitExit (); snprintf (ForumName,For_MAX_BYTES_FORUM_NAME + 1,"%s%s", Hie.Ins.ShrtName, @@ -1828,13 +1828,13 @@ void For_SetForumName (const struct For_Forum *Forum, break; case For_FORUM_CENTER_USRS: Hie.Ctr.CtrCod = Forum->Location; - if (!Ctr_GetDataOfCenterByCod (&Hie.Ctr)) + if (!Ctr_GetCenterDataByCod (&Hie.Ctr)) Err_WrongCenterExit (); Str_Copy (ForumName,Hie.Ctr.ShrtName,For_MAX_BYTES_FORUM_NAME); break; case For_FORUM_CENTER_TCHS: Hie.Ctr.CtrCod = Forum->Location; - if (!Ctr_GetDataOfCenterByCod (&Hie.Ctr)) + if (!Ctr_GetCenterDataByCod (&Hie.Ctr)) Err_WrongCenterExit (); snprintf (ForumName,For_MAX_BYTES_FORUM_NAME + 1,"%s%s", Hie.Ctr.ShrtName, @@ -1843,13 +1843,13 @@ void For_SetForumName (const struct For_Forum *Forum, break; case For_FORUM_DEGREE_USRS: Hie.Deg.DegCod = Forum->Location; - if (!Deg_GetDataOfDegreeByCod (&Hie.Deg)) + if (!Deg_GetDegreeDataByCod (&Hie.Deg)) Err_WrongDegreeExit (); Str_Copy (ForumName,Hie.Deg.ShrtName,For_MAX_BYTES_FORUM_NAME); break; case For_FORUM_DEGREE_TCHS: Hie.Deg.DegCod = Forum->Location; - if (!Deg_GetDataOfDegreeByCod (&Hie.Deg)) + if (!Deg_GetDegreeDataByCod (&Hie.Deg)) Err_WrongDegreeExit (); snprintf (ForumName,For_MAX_BYTES_FORUM_NAME + 1,"%s%s", Hie.Deg.ShrtName, @@ -1858,13 +1858,13 @@ void For_SetForumName (const struct For_Forum *Forum, break; case For_FORUM_COURSE_USRS: Hie.Crs.CrsCod = Forum->Location; - if (!Crs_GetDataOfCourseByCod (&Hie.Crs)) + if (!Crs_GetCourseDataByCod (&Hie.Crs)) Err_WrongCourseExit (); Str_Copy (ForumName,Hie.Crs.ShrtName,For_MAX_BYTES_FORUM_NAME); break; case For_FORUM_COURSE_TCHS: Hie.Crs.CrsCod = Forum->Location; - if (!Crs_GetDataOfCourseByCod (&Hie.Crs)) + if (!Crs_GetCourseDataByCod (&Hie.Crs)) Err_WrongCourseExit (); snprintf (ForumName,For_MAX_BYTES_FORUM_NAME + 1,"%s%s", Hie.Crs.ShrtName, diff --git a/swad_game.c b/swad_game.c index 59f00566..f70ca773 100644 --- a/swad_game.c +++ b/swad_game.c @@ -307,7 +307,7 @@ void Gam_ListAllGames (struct Gam_Games *Games) { /* Get data of this game */ Games->Game.GamCod = Games->Lst[NumGame - 1].GamCod; - Gam_GetDataOfGameByCod (&Games->Game); + Gam_GetGameDataByCod (&Games->Game); /* Show a pair of rows with the main data of this game */ Gam_ShowGameMainData (Games, @@ -457,7 +457,7 @@ void Gam_SeeOneGame (void) /***** Get parameters *****/ if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) Err_WrongGameExit (); - Gam_GetDataOfGameByCod (&Games.Game); + Gam_GetGameDataByCod (&Games.Game); /***** Show game *****/ Gam_ShowOnlyOneGame (&Games, @@ -944,13 +944,13 @@ void Gam_GetListSelectedGamCods (struct Gam_Games *Games) /********************** Get game data using its code *************************/ /*****************************************************************************/ -void Gam_GetDataOfGameByCod (struct Gam_Game *Game) +void Gam_GetGameDataByCod (struct Gam_Game *Game) { MYSQL_RES *mysql_res; MYSQL_ROW row; /***** Get data of game from database *****/ - if (Gam_DB_GetDataOfGameByCod (&mysql_res,Game->GamCod)) // Game found... + if (Gam_DB_GetGameDataByCod (&mysql_res,Game->GamCod)) // Game found... { /* Get row */ row = mysql_fetch_row (mysql_res); @@ -1055,7 +1055,7 @@ void Gam_AskRemGame (void) Err_WrongGameExit (); /***** Get data of the game from database *****/ - Gam_GetDataOfGameByCod (&Games.Game); + Gam_GetGameDataByCod (&Games.Game); if (!Gam_CheckIfICanEditGames ()) Err_NoPermissionExit (); @@ -1089,7 +1089,7 @@ void Gam_RemoveGame (void) Games.Game.GamCod = ParCod_GetAndCheckPar (ParCod_Gam); /***** Get data of the game from database *****/ - Gam_GetDataOfGameByCod (&Games.Game); + Gam_GetGameDataByCod (&Games.Game); if (!Gam_CheckIfICanEditGames ()) Err_NoPermissionExit (); @@ -1155,7 +1155,7 @@ void Gam_HideGame (void) Err_WrongGameExit (); /***** Get data of the game from database *****/ - Gam_GetDataOfGameByCod (&Games.Game); + Gam_GetGameDataByCod (&Games.Game); if (!Gam_CheckIfICanEditGames ()) Err_NoPermissionExit (); @@ -1185,7 +1185,7 @@ void Gam_UnhideGame (void) Err_WrongGameExit (); /***** Get data of the game from database *****/ - Gam_GetDataOfGameByCod (&Games.Game); + Gam_GetGameDataByCod (&Games.Game); if (!Gam_CheckIfICanEditGames ()) Err_NoPermissionExit (); @@ -1220,7 +1220,7 @@ void Gam_ListGame (void) Err_WrongGameExit (); /***** Get game data *****/ - Gam_GetDataOfGameByCod (&Games.Game); + Gam_GetGameDataByCod (&Games.Game); Gam_DB_GetGameTxt (Games.Game.GamCod,Txt); /***** Show game *****/ @@ -1262,7 +1262,7 @@ void Gam_ReqCreatOrEditGame (void) else { /* Get game data from database */ - Gam_GetDataOfGameByCod (&Games.Game); + Gam_GetGameDataByCod (&Games.Game); Gam_DB_GetGameTxt (Games.Game.GamCod,Txt); } @@ -1542,7 +1542,7 @@ void Gam_ReqSelectQstsToAddToGame (void) /***** Get parameters *****/ if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) Err_WrongGameExit (); - Gam_GetDataOfGameByCod (&Games.Game); + Gam_GetGameDataByCod (&Games.Game); /***** Check if game has matches *****/ if (!Gam_CheckIfEditable (&Games.Game)) @@ -1574,7 +1574,7 @@ void Gam_ListQstsToAddToGame (void) /***** Get parameters *****/ if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) Err_WrongGameExit (); - Gam_GetDataOfGameByCod (&Games.Game); + Gam_GetGameDataByCod (&Games.Game); /***** Check if game has matches *****/ if (!Gam_CheckIfEditable (&Games.Game)) @@ -1823,7 +1823,7 @@ void Gam_AddQstsToGame (void) /***** Get parameters *****/ if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) Err_WrongGameExit (); - Gam_GetDataOfGameByCod (&Games.Game); + Gam_GetGameDataByCod (&Games.Game); /***** Check if game has matches *****/ if (!Gam_CheckIfEditable (&Games.Game)) @@ -1928,7 +1928,7 @@ void Gam_ReqRemQstFromGame (void) /***** Get parameters *****/ if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) Err_WrongGameExit (); - Gam_GetDataOfGameByCod (&Games.Game); + Gam_GetGameDataByCod (&Games.Game); /***** Check if game has matches *****/ if (!Gam_CheckIfEditable (&Games.Game)) @@ -1970,7 +1970,7 @@ void Gam_RemoveQstFromGame (void) /***** Get parameters *****/ if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) Err_WrongGameExit (); - Gam_GetDataOfGameByCod (&Games.Game); + Gam_GetGameDataByCod (&Games.Game); /***** Check if game has matches *****/ if (!Gam_CheckIfEditable (&Games.Game)) @@ -2019,7 +2019,7 @@ void Gam_MoveUpQst (void) /***** Get parameters *****/ if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) Err_WrongGameExit (); - Gam_GetDataOfGameByCod (&Games.Game); + Gam_GetGameDataByCod (&Games.Game); /***** Check if game has matches *****/ if (!Gam_CheckIfEditable (&Games.Game)) @@ -2069,7 +2069,7 @@ void Gam_MoveDownQst (void) /***** Get parameters *****/ if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) Err_WrongGameExit (); - Gam_GetDataOfGameByCod (&Games.Game); + Gam_GetGameDataByCod (&Games.Game); /***** Check if game has matches *****/ if (!Gam_CheckIfEditable (&Games.Game)) @@ -2193,7 +2193,7 @@ void Gam_ReqNewMatch (void) /***** Get parameters *****/ if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) Err_WrongGameExit (); - Gam_GetDataOfGameByCod (&Games.Game); + Gam_GetGameDataByCod (&Games.Game); /***** Show game *****/ Gam_ShowOnlyOneGame (&Games, diff --git a/swad_game.h b/swad_game.h index f64edc00..f8ed0a03 100644 --- a/swad_game.h +++ b/swad_game.h @@ -123,8 +123,7 @@ long Gam_GetPars (struct Gam_Games *Games); void Gam_GetListGames (struct Gam_Games *Games,Gam_Order_t SelectedOrder); void Gam_GetListSelectedGamCods (struct Gam_Games *Games); -void Gam_GetDataOfGameByCod (struct Gam_Game *Game); -void Gam_GetDataOfGameByFolder (struct Gam_Game *Game); +void Gam_GetGameDataByCod (struct Gam_Game *Game); void Gam_FreeListGames (struct Gam_Games *Games); void Gam_AskRemGame (void); diff --git a/swad_game_database.c b/swad_game_database.c index f136a8c1..5119feba 100644 --- a/swad_game_database.c +++ b/swad_game_database.c @@ -202,7 +202,7 @@ unsigned Gam_DB_GetListAvailableGames (MYSQL_RES **mysql_res) /********************** Get game data using its code *************************/ /*****************************************************************************/ -unsigned Gam_DB_GetDataOfGameByCod (MYSQL_RES **mysql_res,long GamCod) +unsigned Gam_DB_GetGameDataByCod (MYSQL_RES **mysql_res,long GamCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get game data", diff --git a/swad_game_database.h b/swad_game_database.h index 0ad162bf..21fab4fd 100644 --- a/swad_game_database.h +++ b/swad_game_database.h @@ -43,7 +43,7 @@ void Gam_DB_HideOrUnhideGame (long GamCod,bool Hide); unsigned Gam_DB_GetListGames (MYSQL_RES **mysql_res,Gam_Order_t SelectedOrder); unsigned Gam_DB_GetListAvailableGames (MYSQL_RES **mysql_res); -unsigned Gam_DB_GetDataOfGameByCod (MYSQL_RES **mysql_res,long GamCod); +unsigned Gam_DB_GetGameDataByCod (MYSQL_RES **mysql_res,long GamCod); void Gam_DB_GetGameTitle (long GamCod,char Title[Gam_MAX_BYTES_TITLE + 1]); void Gam_DB_GetGameTxt (long GamCod,char Txt[Cns_MAX_BYTES_TEXT + 1]); bool Gam_DB_CheckIfSimilarGameExists (const struct Gam_Game *Game); diff --git a/swad_group.c b/swad_group.c index 0585926b..ec2f9ed0 100644 --- a/swad_group.c +++ b/swad_group.c @@ -130,7 +130,7 @@ static void Grp_WriteGrpHead (struct GroupType *GrpTyp); static void Grp_WriteRowGrp (struct Group *Grp,bool Highlight); static void Grp_PutFormToCreateGroupType (void); static void Grp_PutFormToCreateGroup (const struct Roo_Rooms *Rooms); -static void Grp_GetDataOfGroupTypeByCod (struct GroupType *GrpTyp); +static void Grp_GetGroupTypeDataByCod (struct GroupType *GrpTyp); static bool Grp_GetMultipleEnrolmentOfAGroupType (long GrpTypCod); static void Grp_GetLstCodGrpsUsrBelongs (long UsrCod,long GrpTypCod, struct ListCodGrps *LstGrps); @@ -170,13 +170,13 @@ void Grp_WriteNamesOfSelectedGrps (void) if ((GrpCod = Gbl.Crs.Grps.LstGrpsSel.GrpCods[NumGrpSel]) >= 0) { GrpDat.GrpCod = GrpCod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); HTM_TxtF ("%s %s",GrpDat.GrpTypName,GrpDat.GrpName); } else // GrpCod < 0 ==> students not belonging to any group of type (-GrpCod) { Gbl.Crs.Grps.GrpTyp.GrpTypCod = -GrpCod; - Grp_GetDataOfGroupTypeByCod (&Gbl.Crs.Grps.GrpTyp); + Grp_GetGroupTypeDataByCod (&Gbl.Crs.Grps.GrpTyp); HTM_TxtF ("%s (%s)",Gbl.Crs.Grps.GrpTyp.GrpTypName, Txt_users_with_no_group); } @@ -2887,13 +2887,13 @@ void Grp_FreeListGrpTypesAndGrps (void) /*****************************************************************************/ // GrpTyp->GrpTypCod must have the code of the type of group -static void Grp_GetDataOfGroupTypeByCod (struct GroupType *GrpTyp) +static void Grp_GetGroupTypeDataByCod (struct GroupType *GrpTyp) { MYSQL_RES *mysql_res; MYSQL_ROW row; /***** Get data of a type of group from database *****/ - if (Grp_DB_GetDataOfGroupTypeByCod (&mysql_res,GrpTyp->GrpTypCod) != 1) + if (Grp_DB_GetGroupTypeDataByCod (&mysql_res,GrpTyp->GrpTypCod) != 1) Err_WrongGrpTypExit (); /***** Get some data of group type *****/ @@ -2936,7 +2936,7 @@ static bool Grp_GetMultipleEnrolmentOfAGroupType (long GrpTypCod) /********************** Get data of a group from its code ********************/ /*****************************************************************************/ -void Grp_GetDataOfGroupByCod (struct GroupData *GrpDat) +void Grp_GetGroupDataByCod (struct GroupData *GrpDat) { MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -2957,7 +2957,7 @@ void Grp_GetDataOfGroupByCod (struct GroupData *GrpDat) if (GrpDat->GrpCod > 0) { /***** Get data of a group from database *****/ - if (Grp_DB_GetDataOfGroupByCod (&mysql_res,GrpDat->GrpCod) == 1) + if (Grp_DB_GetGroupDataByCod (&mysql_res,GrpDat->GrpCod) == 1) { /***** Get data of group *****/ row = mysql_fetch_row (mysql_res); @@ -3393,7 +3393,7 @@ static void Grp_AskConfirmRemGrpTypWithGrps (unsigned NumGrps) extern const char *Txt_Remove_type_of_group; /***** Get data of the group type from database *****/ - Grp_GetDataOfGroupTypeByCod (&Gbl.Crs.Grps.GrpTyp); + Grp_GetGroupTypeDataByCod (&Gbl.Crs.Grps.GrpTyp); /***** Begin section to edit group types *****/ Grp_ReqEditGroupsInternal0 (); @@ -3432,7 +3432,7 @@ static void Grp_AskConfirmRemGrp (void) /***** Get name of the group from database *****/ GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); /***** Count number of students in group *****/ NumStds = Grp_DB_CountNumUsrsInGrp (Rol_STD,Gbl.Crs.Grps.GrpCod); @@ -3501,7 +3501,7 @@ static void Grp_RemoveGroupTypeCompletely (void) char AlertTxt[256 + Grp_MAX_BYTES_GROUP_TYPE_NAME]; /***** Get name and type of the group from database *****/ - Grp_GetDataOfGroupTypeByCod (&Gbl.Crs.Grps.GrpTyp); + Grp_GetGroupTypeDataByCod (&Gbl.Crs.Grps.GrpTyp); /***** Remove file zones of all groups of this type *****/ Brw_RemoveZonesOfGroupsOfType (Gbl.Crs.Grps.GrpTyp.GrpTypCod); @@ -3554,7 +3554,7 @@ static void Grp_RemoveGroupCompletely (void) /***** Get name and type of the group from database *****/ GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); /***** Remove file zones of this group *****/ Brw_RemoveGrpZones (Gbl.Hierarchy.Crs.CrsCod,GrpDat.GrpCod); @@ -3607,7 +3607,7 @@ void Grp_OpenGroup (void) /***** Get group data from database *****/ GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); /***** Update the table of groups changing open/close status *****/ Grp_DB_OpenGrp (GrpDat.GrpCod); @@ -3637,7 +3637,7 @@ void Grp_CloseGroup (void) /***** Get group data from database *****/ GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); /***** Update the table of groups changing open/close status *****/ Grp_DB_CloseGrp (Gbl.Crs.Grps.GrpCod); @@ -3667,7 +3667,7 @@ void Grp_EnableFileZonesGrp (void) /***** Get group data from database *****/ GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); /***** Update the table of groups changing file zones status *****/ Grp_DB_EnableFileZonesGrp (Gbl.Crs.Grps.GrpCod); @@ -3698,7 +3698,7 @@ void Grp_DisableFileZonesGrp (void) /***** Get group data from database *****/ GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); /***** Update the table of groups changing file zones status *****/ Grp_DB_DisableFileZonesGrp (GrpDat.GrpCod); @@ -3736,7 +3736,7 @@ void Grp_ChangeGroupType (void) /* Get from the database the type and the name of the group */ GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); /***** If group was in database... *****/ if (Grp_DB_CheckIfGrpNameExistsForGrpTyp (NewGrpTypCod,GrpDat.GrpName,-1L)) @@ -3785,7 +3785,7 @@ void Grp_ChangeGroupRoom (void) /* Get from the database the name of the group */ GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); /***** Update the table of groups changing old room by new room *****/ Grp_DB_ChangeRoomOfGrp (Gbl.Crs.Grps.GrpCod,NewRooCod); @@ -3823,7 +3823,7 @@ void Grp_ChangeMandatGrpTyp (void) NewMandatoryEnrolment = Par_GetParBool ("MandatoryEnrolment"); /* Get from the database the name of the type and the old type of enrolment */ - Grp_GetDataOfGroupTypeByCod (&Gbl.Crs.Grps.GrpTyp); + Grp_GetGroupTypeDataByCod (&Gbl.Crs.Grps.GrpTyp); /***** Check if the old type of enrolment match the new (this happens when return is pressed without changes) *****/ @@ -3876,7 +3876,7 @@ void Grp_ChangeMultiGrpTyp (void) NewMultipleEnrolment = Par_GetParBool ("MultipleEnrolment"); /* Get from the database the name of the type and the old type of enrolment */ - Grp_GetDataOfGroupTypeByCod (&Gbl.Crs.Grps.GrpTyp); + Grp_GetGroupTypeDataByCod (&Gbl.Crs.Grps.GrpTyp); /***** Check if the old type of enrolment match the new one (this happends when return is pressed without changes) *****/ @@ -3919,7 +3919,7 @@ void Grp_ChangeOpenTimeGrpTyp (void) Gbl.Crs.Grps.GrpTyp.GrpTypCod = ParCod_GetAndCheckPar (ParCod_GrpTyp); /***** Get from the database the data of this type of group *****/ - Grp_GetDataOfGroupTypeByCod (&Gbl.Crs.Grps.GrpTyp); + Grp_GetGroupTypeDataByCod (&Gbl.Crs.Grps.GrpTyp); /***** Get open time *****/ Gbl.Crs.Grps.GrpTyp.OpenTimeUTC = Dat_GetTimeUTCFromForm (Dat_STR_TIME); @@ -3966,7 +3966,7 @@ void Grp_ChangeMaxStdsGrp (void) /* Get from the database the type, name, and old maximum of students of the group */ GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); /***** Check if the old maximum of students equals the new one (this happens when return is pressed without changes) *****/ @@ -4049,7 +4049,7 @@ void Grp_RenameGroupType (void) Par_GetParText ("GrpTypName",NewNameGrpTyp,Grp_MAX_BYTES_GROUP_TYPE_NAME); /***** Get from the database the old name of the group type *****/ - Grp_GetDataOfGroupTypeByCod (&Gbl.Crs.Grps.GrpTyp); + Grp_GetGroupTypeDataByCod (&Gbl.Crs.Grps.GrpTyp); /***** Check if new name is empty *****/ if (NewNameGrpTyp[0]) @@ -4122,7 +4122,7 @@ void Grp_RenameGroup (void) /***** Get from the database the type and the old name of the group *****/ GrpDat.GrpCod = Gbl.Crs.Grps.GrpCod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); /***** Check if new name is empty *****/ if (!NewNameGrp[0]) diff --git a/swad_group.h b/swad_group.h index 3ac5b8a7..6db8766d 100644 --- a/swad_group.h +++ b/swad_group.h @@ -193,7 +193,7 @@ void Grp_GetListGrpTypesInCurrentCrs (Grp_WhichGroupTypes_t WhichGroupTypes); void Grp_FreeListGrpTypesAndGrps (void); void Grp_OpenGroupsAutomatically (void); void Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_WhichGroupTypes_t WhichGroupTypes); -void Grp_GetDataOfGroupByCod (struct GroupData *GrpDat); +void Grp_GetGroupDataByCod (struct GroupData *GrpDat); void Grp_FlushCacheIBelongToGrp (void); bool Grp_GetIfIBelongToGrp (long GrpCod); diff --git a/swad_group_database.c b/swad_group_database.c index 94fcd8a8..cf4f82d2 100644 --- a/swad_group_database.c +++ b/swad_group_database.c @@ -105,7 +105,7 @@ void Grp_DB_CreateGroup (const struct Grp_Groups *Grps) /******************* Get data of a group type from its code ******************/ /*****************************************************************************/ -unsigned Grp_DB_GetDataOfGroupTypeByCod (MYSQL_RES **mysql_res,long GrpTypCod) +unsigned Grp_DB_GetGroupTypeDataByCod (MYSQL_RES **mysql_res,long GrpTypCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get type of group", @@ -139,7 +139,7 @@ unsigned Grp_DB_GetMultipleEnrolmentOfAGroupType (MYSQL_RES **mysql_res,long Grp /********************** Get data of a group from its code ********************/ /*****************************************************************************/ -unsigned Grp_DB_GetDataOfGroupByCod (MYSQL_RES **mysql_res,long GrpCod) +unsigned Grp_DB_GetGroupDataByCod (MYSQL_RES **mysql_res,long GrpCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get data of a group", diff --git a/swad_group_database.h b/swad_group_database.h index eade000b..5268e0a2 100644 --- a/swad_group_database.h +++ b/swad_group_database.h @@ -39,9 +39,9 @@ void Grp_DB_LockTables (void); long Grp_DB_CreateGroupType (const struct GroupType *GrpTyp); void Grp_DB_CreateGroup (const struct Grp_Groups *Grps); -unsigned Grp_DB_GetDataOfGroupTypeByCod (MYSQL_RES **mysql_res,long GrpTypCod); +unsigned Grp_DB_GetGroupTypeDataByCod (MYSQL_RES **mysql_res,long GrpTypCod); unsigned Grp_DB_GetMultipleEnrolmentOfAGroupType (MYSQL_RES **mysql_res,long GrpTypCod); -unsigned Grp_DB_GetDataOfGroupByCod (MYSQL_RES **mysql_res,long GrpCod); +unsigned Grp_DB_GetGroupDataByCod (MYSQL_RES **mysql_res,long GrpCod); bool Grp_DB_CheckIfGrpExists (long GrpCod); bool Grp_DB_CheckIfGrpBelongsToCrs (long GrpCod,long CrsCod); diff --git a/swad_hierarchy.c b/swad_hierarchy.c index fd28fcd7..3d2911ef 100644 --- a/swad_hierarchy.c +++ b/swad_hierarchy.c @@ -558,7 +558,7 @@ void Hie_InitHierarchy (void) /***** If course code is available, get course data *****/ if (Gbl.Hierarchy.Crs.CrsCod > 0) { - if (Crs_GetDataOfCourseByCod (&Gbl.Hierarchy.Crs)) // Course found + if (Crs_GetCourseDataByCod (&Gbl.Hierarchy.Crs)) // Course found Gbl.Hierarchy.Deg.DegCod = Gbl.Hierarchy.Crs.DegCod; else Hie_ResetHierarchy (); @@ -567,7 +567,7 @@ void Hie_InitHierarchy (void) /***** If degree code is available, get degree data *****/ if (Gbl.Hierarchy.Deg.DegCod > 0) { - if (Deg_GetDataOfDegreeByCod (&Gbl.Hierarchy.Deg)) // Degree found + if (Deg_GetDegreeDataByCod (&Gbl.Hierarchy.Deg)) // Degree found { Gbl.Hierarchy.Ctr.CtrCod = Gbl.Hierarchy.Deg.CtrCod; Gbl.Hierarchy.Ins.InsCod = Deg_DB_GetInsCodOfDegreeByCod (Gbl.Hierarchy.Deg.DegCod); @@ -579,7 +579,7 @@ void Hie_InitHierarchy (void) /***** If center code is available, get center data *****/ if (Gbl.Hierarchy.Ctr.CtrCod > 0) { - if (Ctr_GetDataOfCenterByCod (&Gbl.Hierarchy.Ctr)) // Center found + if (Ctr_GetCenterDataByCod (&Gbl.Hierarchy.Ctr)) // Center found Gbl.Hierarchy.Ins.InsCod = Gbl.Hierarchy.Ctr.InsCod; else Hie_ResetHierarchy (); @@ -588,7 +588,7 @@ void Hie_InitHierarchy (void) /***** If institution code is available, get institution data *****/ if (Gbl.Hierarchy.Ins.InsCod > 0) { - if (Ins_GetDataOfInstitByCod (&Gbl.Hierarchy.Ins)) // Institution found + if (Ins_GetInstitDataByCod (&Gbl.Hierarchy.Ins)) // Institution found Gbl.Hierarchy.Cty.CtyCod = Gbl.Hierarchy.Ins.CtyCod; else Hie_ResetHierarchy (); @@ -596,7 +596,7 @@ void Hie_InitHierarchy (void) /***** If country code is available, get country data *****/ if (Gbl.Hierarchy.Cty.CtyCod > 0) - if (!Cty_GetDataOfCountryByCod (&Gbl.Hierarchy.Cty)) // Country not found + if (!Cty_GetCountryDataByCod (&Gbl.Hierarchy.Cty)) // Country not found Hie_ResetHierarchy (); /***** Set current hierarchy level and code @@ -734,7 +734,7 @@ void Hie_GetAndWriteInsCtrDegAdminBy (long UsrCod,unsigned ColSpan) if ((Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[1])) > 0) { /* Get data of institution */ - Ins_GetDataOfInstitByCod (&Hie.Ins); + Ins_GetInstitDataByCod (&Hie.Ins); /* Write institution logo and name */ Ins_DrawInstitLogoAndNameWithLink (&Hie.Ins,ActSeeInsInf,"LT"); @@ -744,7 +744,7 @@ void Hie_GetAndWriteInsCtrDegAdminBy (long UsrCod,unsigned ColSpan) if ((Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[1])) > 0) { /* Get data of center */ - Ctr_GetDataOfCenterByCod (&Hie.Ctr); + Ctr_GetCenterDataByCod (&Hie.Ctr); /* Write center logo and name */ Ctr_DrawCenterLogoAndNameWithLink (&Hie.Ctr,ActSeeCtrInf,"LT"); @@ -754,7 +754,7 @@ void Hie_GetAndWriteInsCtrDegAdminBy (long UsrCod,unsigned ColSpan) if ((Hie.Deg.DegCod = Str_ConvertStrCodToLongCod (row[1])) > 0) { /* Get data of degree */ - Deg_GetDataOfDegreeByCod (&Hie.Deg); + Deg_GetDegreeDataByCod (&Hie.Deg); /* Write degree logo and name */ Deg_DrawDegreeLogoAndNameWithLink (&Hie.Deg,ActSeeDegInf,"LT"); diff --git a/swad_holiday.c b/swad_holiday.c index 909cf932..3696e63d 100644 --- a/swad_holiday.c +++ b/swad_holiday.c @@ -65,7 +65,7 @@ static void Hld_PutIconsSeeHolidays (__attribute__((unused)) void *Args); static void Hld_EditHolidaysInternal (void); -static void Hld_GetDataOfHolidayByCod (struct Hld_Holiday *Hld); +static void Hld_GetHolidayDataByCod (struct Hld_Holiday *Hld); static Hld_HolidayType_t Hld_GetParHldType (void); static Hld_HolidayType_t Hld_GetTypeOfHoliday (const char *UnsignedStr); @@ -387,7 +387,7 @@ void Hld_GetListHolidays (struct Hld_Holidays *Holidays) /************************* Get holiday data by code **************************/ /*****************************************************************************/ -static void Hld_GetDataOfHolidayByCod (struct Hld_Holiday *Hld) +static void Hld_GetHolidayDataByCod (struct Hld_Holiday *Hld) { MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -405,7 +405,7 @@ static void Hld_GetDataOfHolidayByCod (struct Hld_Holiday *Hld) Err_WrongHolidayExit (); /***** Get data of holiday from database *****/ - if (Hld_DB_GetDataOfHolidayByCod (&mysql_res,Hld->HldCod)) // Holiday found... + if (Hld_DB_GetHolidayDataByCod (&mysql_res,Hld->HldCod)) // Holiday found... { /* Get row */ row = mysql_fetch_row (mysql_res); @@ -650,7 +650,7 @@ void Hld_RemoveHoliday (void) Hld_EditingHld->HldCod = ParCod_GetAndCheckPar (ParCod_Hld); /***** Get data of the holiday from database *****/ - Hld_GetDataOfHolidayByCod (Hld_EditingHld); + Hld_GetHolidayDataByCod (Hld_EditingHld); /***** Remove holiday *****/ Hld_DB_RemoveHoliday (Hld_EditingHld->HldCod); @@ -682,10 +682,10 @@ void Hld_ChangeHolidayPlace (void) NewPlace.PlcCod = ParCod_GetPar (ParCod_Plc); /***** Get from the database the data of the place *****/ - Plc_GetDataOfPlaceByCod (&NewPlace); + Plc_GetPlaceDataByCod (&NewPlace); /***** Get from the database the data of the holiday *****/ - Hld_GetDataOfHolidayByCod (Hld_EditingHld); + Hld_GetHolidayDataByCod (Hld_EditingHld); /***** Update the place in database *****/ Hld_DB_ChangePlace (Hld_EditingHld->HldCod,NewPlace.PlcCod); @@ -714,7 +714,7 @@ void Hld_ChangeHolidayType (void) Hld_EditingHld->HldCod = ParCod_GetAndCheckPar (ParCod_Hld); /***** Get from the database the data of the holiday *****/ - Hld_GetDataOfHolidayByCod (Hld_EditingHld); + Hld_GetHolidayDataByCod (Hld_EditingHld); /***** Get the new type for the holiday *****/ Hld_EditingHld->HldTyp = Hld_GetParHldType (); @@ -766,7 +766,7 @@ static void Hld_ChangeDate (Hld_StartOrEndDate_t StartOrEndDate) Hld_EditingHld->HldCod = ParCod_GetAndCheckPar (ParCod_Hld); /***** Get from the database the data of the holiday *****/ - Hld_GetDataOfHolidayByCod (Hld_EditingHld); + Hld_GetHolidayDataByCod (Hld_EditingHld); /***** Get the new date for the holiday *****/ switch (StartOrEndDate) @@ -833,7 +833,7 @@ void Hld_RenameHoliday (void) Par_GetParText ("Name",NewHldName,Hld_MAX_BYTES_HOLIDAY_NAME); /***** Get from the database the old names of the holiday *****/ - Hld_GetDataOfHolidayByCod (Hld_EditingHld); + Hld_GetHolidayDataByCod (Hld_EditingHld); /***** Check if new name is empty *****/ if (NewHldName[0]) diff --git a/swad_holiday_database.c b/swad_holiday_database.c index e3eca2ed..d70bad62 100644 --- a/swad_holiday_database.c +++ b/swad_holiday_database.c @@ -174,7 +174,7 @@ unsigned Hld_DB_GetListHolidays (MYSQL_RES **mysql_res,Hld_Order_t SelectedOrder /************************* Get holiday data by code **************************/ /*****************************************************************************/ -unsigned Hld_DB_GetDataOfHolidayByCod (MYSQL_RES **mysql_res,long HldCod) +unsigned Hld_DB_GetHolidayDataByCod (MYSQL_RES **mysql_res,long HldCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get data of a holiday", diff --git a/swad_holiday_database.h b/swad_holiday_database.h index 0a6b2a18..d7d81ebf 100644 --- a/swad_holiday_database.h +++ b/swad_holiday_database.h @@ -42,7 +42,7 @@ void Hld_DB_ChangeDate (long HldCod,const char *StrStartOrEndDate, void Hld_DB_ChangeName (long HldCod,char NewHldName[Hld_MAX_BYTES_HOLIDAY_NAME + 1]); unsigned Hld_DB_GetListHolidays (MYSQL_RES **mysql_res,Hld_Order_t SelectedOrder); -unsigned Hld_DB_GetDataOfHolidayByCod (MYSQL_RES **mysql_res,long HldCod); +unsigned Hld_DB_GetHolidayDataByCod (MYSQL_RES **mysql_res,long HldCod); void Hld_DB_RemoveHoliday (long HldCod); diff --git a/swad_institution.c b/swad_institution.c index cfac3cfb..e813df2f 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -175,7 +175,7 @@ void Ins_SeeInsWithPendingCtrs (void) The_GetColorRows (); /* Get data of institution */ - Ins_GetDataOfInstitByCod (&Ins); + Ins_GetInstitDataByCod (&Ins); /* Institution logo and name */ HTM_TR_Begin (NULL); @@ -687,7 +687,7 @@ void Ins_WriteInstitutionNameAndCty (long InsCod) /************************* Get data of an institution ************************/ /*****************************************************************************/ -bool Ins_GetDataOfInstitByCod (struct Ins_Instit *Ins) +bool Ins_GetInstitDataByCod (struct Ins_Instit *Ins) { MYSQL_RES *mysql_res; bool InsFound = false; @@ -705,7 +705,7 @@ bool Ins_GetDataOfInstitByCod (struct Ins_Instit *Ins) if (Ins->InsCod > 0) { /***** Get data of an institution from database *****/ - if (Ins_DB_GetDataOfInstitutionByCod (&mysql_res,Ins->InsCod)) // Institution found... + if (Ins_DB_GetInsDataByCod (&mysql_res,Ins->InsCod)) // Institution found... { /* Get institution data */ Ins_GetInstitDataFromRow (mysql_res,Ins, @@ -809,7 +809,7 @@ void Ins_GetShrtNameAndCtyOfInstitution (struct Ins_Instit *Ins, /***** 3. Slow: get short name and country of institution from database *****/ Gbl.Cache.InstitutionShrtNameAndCty.InsCod = Ins->InsCod; - if (Ins_DB_GetShrtNameAndCtyOfIns (&mysql_res,Ins->InsCod) == 1) + if (Ins_DB_GetInsShrtNameAndCty (&mysql_res,Ins->InsCod) == 1) { /* Get row */ row = mysql_fetch_row (mysql_res); @@ -1108,7 +1108,7 @@ void Ins_RemoveInstitution (void) Ins_EditingIns->InsCod = ParCod_GetAndCheckPar (ParCod_OthHie); /***** Get data of the institution from database *****/ - Ins_GetDataOfInstitByCod (Ins_EditingIns); + Ins_GetInstitDataByCod (Ins_EditingIns); /***** Check if this institution has users *****/ if (!Ins_CheckIfICanEdit (Ins_EditingIns)) @@ -1228,7 +1228,7 @@ void Ins_RenameInstitution (struct Ins_Instit *Ins,Cns_ShrtOrFullName_t ShrtOrFu Par_GetParText (ParName,NewInsName,MaxBytes); /***** Get from the database the old names of the institution *****/ - Ins_GetDataOfInstitByCod (Ins); + Ins_GetInstitDataByCod (Ins); /***** Check if new name is empty *****/ if (NewInsName[0]) @@ -1298,7 +1298,7 @@ void Ins_ChangeInsWWW (void) Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW); /***** Get data of institution *****/ - Ins_GetDataOfInstitByCod (Ins_EditingIns); + Ins_GetInstitDataByCod (Ins_EditingIns); /***** Check if new WWW is empty *****/ if (NewWWW[0]) @@ -1337,7 +1337,7 @@ void Ins_ChangeInsStatus (void) Status = Hie_GetParStatus (); // New status /***** Get data of institution *****/ - Ins_GetDataOfInstitByCod (Ins_EditingIns); + Ins_GetInstitDataByCod (Ins_EditingIns); /***** Update status *****/ Ins_DB_UpdateInsStatus (Ins_EditingIns->InsCod,Status); @@ -1793,7 +1793,7 @@ void Ins_ListInssFound (MYSQL_RES **mysql_res,unsigned NumInss) Ins.InsCod = DB_GetNextCode (*mysql_res); /* Get data of institution */ - Ins_GetDataOfInstitByCod (&Ins); + Ins_GetInstitDataByCod (&Ins); /* Write data of this institution */ Ins_ListOneInstitutionForSeeing (&Ins,NumIns); @@ -2342,7 +2342,7 @@ static unsigned Ins_GetInsAndStat (struct Ins_Instit *Ins,MYSQL_RES *mysql_res) /***** Get data of this institution (row[0]) *****/ Ins->InsCod = Str_ConvertStrCodToLongCod (row[0]); - if (!Ins_GetDataOfInstitByCod (Ins)) + if (!Ins_GetInstitDataByCod (Ins)) Err_WrongInstitExit (); /***** Get statistic (row[1]) *****/ diff --git a/swad_institution.h b/swad_institution.h index b47ee217..aa540d75 100644 --- a/swad_institution.h +++ b/swad_institution.h @@ -84,7 +84,7 @@ void Ins_GetBasicListOfInstitutions (long CtyCod); void Ins_GetFullListOfInstitutions (long CtyCod); void Ins_WriteInstitutionNameAndCty (long InsCod); -bool Ins_GetDataOfInstitByCod (struct Ins_Instit *Ins); +bool Ins_GetInstitDataByCod (struct Ins_Instit *Ins); void Ins_FlushCacheFullNameAndCtyOfInstitution (void); void Ins_GetShrtNameAndCtyOfInstitution (struct Ins_Instit *Ins, char CtyName[Cns_HIERARCHY_MAX_BYTES_FULL_NAME + 1]); diff --git a/swad_institution_config.c b/swad_institution_config.c index 9d473cf7..74641200 100644 --- a/swad_institution_config.c +++ b/swad_institution_config.c @@ -284,7 +284,7 @@ static void InsCfg_Map (void) Ctr.CtrCod = DB_GetNextCode (mysql_res); /* Get data of center */ - Ctr_GetDataOfCenterByCod (&Ctr); + Ctr_GetCenterDataByCod (&Ctr); /* Add marker */ Map_AddMarker (&Ctr.Coord); @@ -546,7 +546,7 @@ void InsCfg_ChangeInsCty (void) if (NewCty.CtyCod != Gbl.Hierarchy.Ins.CtyCod) { /***** Get data of the country from database *****/ - Cty_GetDataOfCountryByCod (&NewCty); + Cty_GetCountryDataByCod (&NewCty); /***** Check if it already exists an institution with the same name in the new country *****/ if (Ins_DB_CheckIfInsNameExistsInCty ("ShortName",Gbl.Hierarchy.Ins.ShrtName,-1L,NewCty.CtyCod)) diff --git a/swad_institution_database.c b/swad_institution_database.c index b75eb007..1dba73c1 100644 --- a/swad_institution_database.c +++ b/swad_institution_database.c @@ -127,7 +127,7 @@ void Ins_DB_UpdateInsWWW (long InsCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1]) /************************* Get data of an institution ************************/ /*****************************************************************************/ -unsigned Ins_DB_GetDataOfInstitutionByCod (MYSQL_RES **mysql_res,long InsCod) +unsigned Ins_DB_GetInsDataByCod (MYSQL_RES **mysql_res,long InsCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get data of an institution", @@ -148,7 +148,7 @@ unsigned Ins_DB_GetDataOfInstitutionByCod (MYSQL_RES **mysql_res,long InsCod) /*********** Get the short name of an institution from its code **************/ /*****************************************************************************/ -void Ins_DB_GetShortNameOfInstitution (long InsCod,char ShrtName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1]) +void Ins_DB_GetInsShrtName (long InsCod,char ShrtName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1]) { /***** Trivial check: institution code should be > 0 *****/ if (InsCod <= 0) @@ -170,7 +170,7 @@ void Ins_DB_GetShortNameOfInstitution (long InsCod,char ShrtName[Cns_HIERARCHY_M /******** Get short name and country of an institution from its code *********/ /*****************************************************************************/ -unsigned Ins_DB_GetShrtNameAndCtyOfIns (MYSQL_RES **mysql_res,long InsCod) +unsigned Ins_DB_GetInsShrtNameAndCty (MYSQL_RES **mysql_res,long InsCod) { extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES]; diff --git a/swad_institution_database.h b/swad_institution_database.h index 90565c01..693d6ce5 100644 --- a/swad_institution_database.h +++ b/swad_institution_database.h @@ -43,9 +43,9 @@ void Ins_DB_UpdateInsStatus (long InsCod,Hie_Status_t Status); void Ins_DB_UpdateInsName (long InsCod,const char *FldName,const char *NewInsName); void Ins_DB_UpdateInsWWW (long InsCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1]); -unsigned Ins_DB_GetDataOfInstitutionByCod (MYSQL_RES **mysql_res,long InsCod); -void Ins_DB_GetShortNameOfInstitution (long InsCod,char ShrtName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1]); -unsigned Ins_DB_GetShrtNameAndCtyOfIns (MYSQL_RES **mysql_res,long InsCod); +unsigned Ins_DB_GetInsDataByCod (MYSQL_RES **mysql_res,long InsCod); +void Ins_DB_GetInsShrtName (long InsCod,char ShrtName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1]); +unsigned Ins_DB_GetInsShrtNameAndCty (MYSQL_RES **mysql_res,long InsCod); bool Ins_DB_CheckIfInsNameExistsInCty (const char *FldName, const char *Name, long InsCod, diff --git a/swad_layout.c b/swad_layout.c index 51df9251..2ba55e50 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -1476,15 +1476,15 @@ void Lay_WriteHeaderClassPhoto (bool PrintView,bool DrawingClassPhoto, /***** Get data of institution *****/ Hie.Ins.InsCod = InsCod; - Ins_GetDataOfInstitByCod (&Hie.Ins); + Ins_GetInstitDataByCod (&Hie.Ins); /***** Get data of degree *****/ Hie.Deg.DegCod = DegCod; - Deg_GetDataOfDegreeByCod (&Hie.Deg); + Deg_GetDegreeDataByCod (&Hie.Deg); /***** Get data of course *****/ Hie.Crs.CrsCod = CrsCod; - Crs_GetDataOfCourseByCod (&Hie.Crs); + Crs_GetCourseDataByCod (&Hie.Crs); /***** Begin table *****/ HTM_TABLE_BeginWidePadding (10); diff --git a/swad_link.c b/swad_link.c index ea2b53d4..22b3c508 100644 --- a/swad_link.c +++ b/swad_link.c @@ -79,7 +79,7 @@ static void Lnk_EditLinksInternal (void); static void Lnk_PutIconsEditingLinks (__attribute__((unused)) void *Args); static void Lnk_GetListLinks (struct Lnk_Links *Links); -static void Lnk_GetDataOfLink (MYSQL_RES *mysql_res,struct Lnk_Link *Lnk); +static void Lnk_GetLinkData (MYSQL_RES *mysql_res,struct Lnk_Link *Lnk); static void Lnk_FreeListLinks (struct Lnk_Links *Links); @@ -320,7 +320,7 @@ static void Lnk_GetListLinks (struct Lnk_Links *Links) NumLnk < Links->Num; NumLnk++) /* Get next link */ - Lnk_GetDataOfLink (mysql_res,&Links->Lst[NumLnk]); + Lnk_GetLinkData (mysql_res,&Links->Lst[NumLnk]); } /***** Free structure that stores the query result *****/ @@ -332,7 +332,7 @@ static void Lnk_GetListLinks (struct Lnk_Links *Links) /**************************** Get link full name *****************************/ /*****************************************************************************/ -void Lnk_GetDataOfLinkByCod (struct Lnk_Link *Lnk) +void Lnk_GetLinkDataByCod (struct Lnk_Link *Lnk) { MYSQL_RES *mysql_res; @@ -345,8 +345,8 @@ void Lnk_GetDataOfLinkByCod (struct Lnk_Link *Lnk) if (Lnk->LnkCod > 0) { /***** Get data of an institutional link from database *****/ - if (Lnk_DB_GetDataOfLinkByCod (&mysql_res,Lnk->LnkCod)) // Link found... - Lnk_GetDataOfLink (mysql_res,Lnk); + if (Lnk_DB_GetLinkDataByCod (&mysql_res,Lnk->LnkCod)) // Link found... + Lnk_GetLinkData (mysql_res,Lnk); /***** Free structure that stores the query result *****/ DB_FreeMySQLResult (&mysql_res); @@ -357,7 +357,7 @@ void Lnk_GetDataOfLinkByCod (struct Lnk_Link *Lnk) /**************************** Get data of link *******************************/ /*****************************************************************************/ -static void Lnk_GetDataOfLink (MYSQL_RES *mysql_res,struct Lnk_Link *Lnk) +static void Lnk_GetLinkData (MYSQL_RES *mysql_res,struct Lnk_Link *Lnk) { MYSQL_ROW row; @@ -498,7 +498,7 @@ void Lnk_RemoveLink (void) Lnk_EditingLnk->LnkCod = ParCod_GetAndCheckPar (ParCod_Lnk); /***** Get data of the link from database *****/ - Lnk_GetDataOfLinkByCod (Lnk_EditingLnk); + Lnk_GetLinkDataByCod (Lnk_EditingLnk); /***** Remove link *****/ Lnk_DB_RemoveLink (Lnk_EditingLnk->LnkCod); @@ -574,7 +574,7 @@ static void Lnk_RenameLink (Cns_ShrtOrFullName_t ShrtOrFullName) Par_GetParText (ParName,NewLnkName,MaxBytes); /***** Get link data from the database *****/ - Lnk_GetDataOfLinkByCod (Lnk_EditingLnk); + Lnk_GetLinkDataByCod (Lnk_EditingLnk); /***** Check if new name is empty *****/ if (NewLnkName[0]) @@ -630,7 +630,7 @@ void Lnk_ChangeLinkWWW (void) Par_GetParText ("WWW",NewWWW,Cns_MAX_BYTES_WWW); /***** Get link data from the database *****/ - Lnk_GetDataOfLinkByCod (Lnk_EditingLnk); + Lnk_GetLinkDataByCod (Lnk_EditingLnk); /***** Check if new WWW is empty *****/ if (NewWWW[0]) diff --git a/swad_link.h b/swad_link.h index ee3f7809..4e4b206c 100644 --- a/swad_link.h +++ b/swad_link.h @@ -52,7 +52,7 @@ void Lnk_EditLinks (void); void Lnk_PutIconToViewLinks (void); -void Lnk_GetDataOfLinkByCod (struct Lnk_Link *Lnk); +void Lnk_GetLinkDataByCod (struct Lnk_Link *Lnk); void Lnk_RemoveLink (void); void Lnk_RenameLinkShort (void); void Lnk_RenameLinkFull (void); diff --git a/swad_link_database.c b/swad_link_database.c index cdc85446..9a87e017 100644 --- a/swad_link_database.c +++ b/swad_link_database.c @@ -93,7 +93,7 @@ unsigned Lnk_DB_GetLinks (MYSQL_RES **mysql_res) /**************************** Get link full name *****************************/ /*****************************************************************************/ -unsigned Lnk_DB_GetDataOfLinkByCod (MYSQL_RES **mysql_res,long LnkCod) +unsigned Lnk_DB_GetLinkDataByCod (MYSQL_RES **mysql_res,long LnkCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get data of an institutional link", diff --git a/swad_link_database.h b/swad_link_database.h index 92488ad8..82e11abc 100644 --- a/swad_link_database.h +++ b/swad_link_database.h @@ -40,7 +40,7 @@ void Lnk_DB_UpdateLnkName (long LnkCod,const char *FldName,const char *NewLnkNam void Lnk_DB_UpdateLnkWWW (long LnkCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1]); unsigned Lnk_DB_GetLinks (MYSQL_RES **mysql_res); -unsigned Lnk_DB_GetDataOfLinkByCod (MYSQL_RES **mysql_res,long LnkCod); +unsigned Lnk_DB_GetLinkDataByCod (MYSQL_RES **mysql_res,long LnkCod); bool Lnk_DB_CheckIfLinkNameExists (const char *FldName,const char *Name,long LnkCod); void Lnk_DB_RemoveLink (long LnkCod); diff --git a/swad_log.c b/swad_log.c index 482e1168..7aa876be 100644 --- a/swad_log.c +++ b/swad_log.c @@ -257,7 +257,7 @@ void Log_GetAndShowLastClicks (void) Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[5]); Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[6]); Hie.Deg.DegCod = Str_ConvertStrCodToLongCod (row[7]); - Ins_DB_GetShortNameOfInstitution (Hie.Ins.InsCod,Hie.Ins.ShrtName); + Ins_DB_GetInsShrtName (Hie.Ins.InsCod,Hie.Ins.ShrtName); Ctr_DB_GetShortNameOfCenterByCod (Hie.Ctr.CtrCod,Hie.Ctr.ShrtName); Deg_DB_GetShortNameOfDegreeByCod (Hie.Deg.DegCod,Hie.Deg.ShrtName); diff --git a/swad_mail.c b/swad_mail.c index 62c0e6ca..1775412e 100644 --- a/swad_mail.c +++ b/swad_mail.c @@ -388,7 +388,7 @@ void Mai_WriteWarningEmailNotifications (void) /**************************** Get mail domain data ***************************/ /*****************************************************************************/ -void Mai_GetDataOfMailDomainByCod (struct Mail *Mai) +void Mai_GetMailDomainDataByCod (struct Mail *Mai) { MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -400,7 +400,7 @@ void Mai_GetDataOfMailDomainByCod (struct Mail *Mai) if (Mai->MaiCod > 0) { /***** Get data of a mail domain from database *****/ - if (Mai_DB_GetDataOfMailDomainByCod (&mysql_res,Mai->MaiCod)) // Mail found... + if (Mai_DB_GetMailDomainDataByCod (&mysql_res,Mai->MaiCod)) // Mail found... { /* Get row */ row = mysql_fetch_row (mysql_res); @@ -527,7 +527,7 @@ void Mai_RemoveMailDomain (void) Mai_EditingMai->MaiCod = ParCod_GetAndCheckPar (ParCod_Mai); /***** Get data of the mail domain rom database *****/ - Mai_GetDataOfMailDomainByCod (Mai_EditingMai); + Mai_GetMailDomainDataByCod (Mai_EditingMai); /***** Remove mail domain *****/ Mai_DB_RemoveMailDomain (Mai_EditingMai->MaiCod); @@ -603,7 +603,7 @@ static void Mai_RenameMailDomain (Cns_ShrtOrFullName_t ShrtOrFullName) Par_GetParText (ParName,NewMaiName,MaxBytes); /***** Get from the database the old names of the mail *****/ - Mai_GetDataOfMailDomainByCod (Mai_EditingMai); + Mai_GetMailDomainDataByCod (Mai_EditingMai); /***** Check if new name is empty *****/ if (NewMaiName[0]) diff --git a/swad_mail.h b/swad_mail.h index 4515dced..230d3239 100644 --- a/swad_mail.h +++ b/swad_mail.h @@ -66,7 +66,7 @@ void Mai_EditMailDomains (void); bool Mai_CheckIfUsrCanReceiveEmailNotif (const struct Usr_Data *UsrDat); void Mai_WriteWarningEmailNotifications (void); -void Mai_GetDataOfMailDomainByCod (struct Mail *Plc); +void Mai_GetMailDomainDataByCod (struct Mail *Plc); void Mai_RemoveMailDomain (void); void Mai_RenameMailDomainShort (void); void Mai_RenameMailDomainFull (void); diff --git a/swad_mail_database.c b/swad_mail_database.c index 711abab0..c99d8e56 100644 --- a/swad_mail_database.c +++ b/swad_mail_database.c @@ -394,7 +394,7 @@ unsigned Mai_DB_GetMailDomains (MYSQL_RES **mysql_res,Mai_DomainsOrder_t Selecte /**************************** Get mail domain data ***************************/ /*****************************************************************************/ -unsigned Mai_DB_GetDataOfMailDomainByCod (MYSQL_RES **mysql_res,long MaiCod) +unsigned Mai_DB_GetMailDomainDataByCod (MYSQL_RES **mysql_res,long MaiCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get data of a mail domain", diff --git a/swad_mail_database.h b/swad_mail_database.h index 4069e036..695e7f40 100644 --- a/swad_mail_database.h +++ b/swad_mail_database.h @@ -67,7 +67,7 @@ void Mai_DB_UpdateMailDomainName (long MaiCod, const char *FldName,const char *NewMaiName); unsigned Mai_DB_GetMailDomains (MYSQL_RES **mysql_res,Mai_DomainsOrder_t SelectedOrder); -unsigned Mai_DB_GetDataOfMailDomainByCod (MYSQL_RES **mysql_res,long MaiCod); +unsigned Mai_DB_GetMailDomainDataByCod (MYSQL_RES **mysql_res,long MaiCod); bool Mai_DB_CheckIfMailDomainNameExists (const char *FldName,const char *Name,long MaiCod); bool Mai_DB_CheckIfMailDomainIsAllowedForNotif (const char MailDomain[Cns_MAX_BYTES_EMAIL_ADDRESS + 1]); diff --git a/swad_mark.c b/swad_mark.c index 7e39201d..376bdfd5 100644 --- a/swad_mark.c +++ b/swad_mark.c @@ -669,7 +669,7 @@ void Mrk_GetNotifMyMarks (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], ID_GetListIDsFromUsrCod (&UsrDat); /***** Get marks data from database *****/ - if (Mrk_DB_GetDataOfMarksByCod (&mysql_res,MrkCod) == 1) // Result should have a unique row + if (Mrk_DB_GetMarksDataByCod (&mysql_res,MrkCod) == 1) // Result should have a unique row { /***** Get data of this file of marks *****/ row = mysql_fetch_row (mysql_res); diff --git a/swad_mark_database.c b/swad_mark_database.c index ba0d73b3..18c4c8fd 100644 --- a/swad_mark_database.c +++ b/swad_mark_database.c @@ -90,7 +90,7 @@ void Mrk_DB_ChangeNumRowsHeaderOrFooter (Brw_HeadOrFoot_t HeaderOrFooter,unsigne /*********************** Get marks data from database ************************/ /*****************************************************************************/ -unsigned Mrk_DB_GetDataOfMarksByCod (MYSQL_RES **mysql_res,long MrkCod) +unsigned Mrk_DB_GetMarksDataByCod (MYSQL_RES **mysql_res,long MrkCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get the number of rows" diff --git a/swad_mark_database.h b/swad_mark_database.h index 3bf27b2a..58ebc869 100644 --- a/swad_mark_database.h +++ b/swad_mark_database.h @@ -36,7 +36,7 @@ void Mrk_DB_AddMarks (long FilCod,const struct Mrk_Properties *Marks); void Mrk_DB_ChangeNumRowsHeaderOrFooter (Brw_HeadOrFoot_t HeaderOrFooter,unsigned NumRows); -unsigned Mrk_DB_GetDataOfMarksByCod (MYSQL_RES **mysql_res,long MrkCod); +unsigned Mrk_DB_GetMarksDataByCod (MYSQL_RES **mysql_res,long MrkCod); unsigned Mrk_DB_GetNumRowsHeaderAndFooter (MYSQL_RES **mysql_res); #endif diff --git a/swad_match.c b/swad_match.c index ddd1148c..147d888b 100644 --- a/swad_match.c +++ b/swad_match.c @@ -322,12 +322,12 @@ void Mch_ListMatches (struct Gam_Games *Games, /********************** Get match data using its code ************************/ /*****************************************************************************/ -void Mch_GetDataOfMatchByCod (struct Mch_Match *Match) +void Mch_GetMatchDataByCod (struct Mch_Match *Match) { MYSQL_RES *mysql_res; /***** Get data of match from database *****/ - if (Mch_DB_GetDataOfMatchByCod (&mysql_res,Match->MchCod)) // Match found... + if (Mch_DB_GetMatchDataByCod (&mysql_res,Match->MchCod)) // Match found... /* Get match data from row */ Mch_GetMatchDataFromRow (mysql_res,Match); else @@ -1146,11 +1146,11 @@ void Mch_GetAndCheckPars (struct Gam_Games *Games, if ((Games->Game.GamCod = Gam_GetPars (Games)) <= 0) Err_WrongGameExit (); Grp_GetParWhichGroups (); - Gam_GetDataOfGameByCod (&Games->Game); + Gam_GetGameDataByCod (&Games->Game); /* Get match code */ Match->MchCod = ParCod_GetAndCheckPar (ParCod_Mch); - Mch_GetDataOfMatchByCod (Match); + Mch_GetMatchDataByCod (Match); /***** Ensure parameters are correct *****/ if (Games->Game.GamCod != Match->GamCod) @@ -1447,7 +1447,7 @@ void Mch_ResumeMatch (void) /***** Get data of the match from database *****/ Match.MchCod = Mch_GetMchCodBeingPlayed (); - Mch_GetDataOfMatchByCod (&Match); + Mch_GetMatchDataByCod (&Match); /***** Check if I have permission to resume match *****/ if (!Mch_CheckIfICanEditThisMatch (&Match)) @@ -1746,7 +1746,7 @@ void Mch_PlayPauseMatch (void) /***** Get data of the match from database *****/ Match.MchCod = Mch_GetMchCodBeingPlayed (); - Mch_GetDataOfMatchByCod (&Match); + Mch_GetMatchDataByCod (&Match); /***** Update status *****/ if (Match.Status.Playing) // Match is being played ==> pause it @@ -1783,7 +1783,7 @@ void Mch_ChangeNumColsMch (void) /***** Get data of the match from database *****/ Match.MchCod = Mch_GetMchCodBeingPlayed (); - Mch_GetDataOfMatchByCod (&Match); + Mch_GetMatchDataByCod (&Match); /***** Get number of columns *****/ Match.Status.NumCols = (unsigned) @@ -1819,7 +1819,7 @@ void Mch_ToggleVisResultsMchQst (void) /***** Get data of the match from database *****/ Match.MchCod = Mch_GetMchCodBeingPlayed (); - Mch_GetDataOfMatchByCod (&Match); + Mch_GetMatchDataByCod (&Match); /***** Update status *****/ Match.Status.ShowQstResults = !Match.Status.ShowQstResults; // Toggle display @@ -1854,7 +1854,7 @@ void Mch_BackMatch (void) /***** Get data of the match from database *****/ Match.MchCod = Mch_GetMchCodBeingPlayed (); - Mch_GetDataOfMatchByCod (&Match); + Mch_GetMatchDataByCod (&Match); /***** Update status *****/ Mch_SetMatchStatusToPrev (&Match); @@ -1886,7 +1886,7 @@ void Mch_ForwardMatch (void) /***** Get data of the match from database *****/ Match.MchCod = Mch_GetMchCodBeingPlayed (); - Mch_GetDataOfMatchByCod (&Match); + Mch_GetMatchDataByCod (&Match); /***** Update status *****/ Mch_SetMatchStatusToNext (&Match); @@ -3359,7 +3359,7 @@ void Mch_JoinMatchAsStd (void) /***** Get data of the match from database *****/ Match.MchCod = Mch_GetMchCodBeingPlayed (); - Mch_GetDataOfMatchByCod (&Match); + Mch_GetMatchDataByCod (&Match); /***** Show current match status *****/ HTM_DIV_Begin ("id=\"match\" class=\"MCH_CONT\""); @@ -3381,7 +3381,7 @@ void Mch_RemMyQstAnsAndShowMchStatus (void) /***** Get data of the match from database *****/ Match.MchCod = Mch_GetMchCodBeingPlayed (); - Mch_GetDataOfMatchByCod (&Match); + Mch_GetMatchDataByCod (&Match); /***** Get question index from form *****/ QstInd = Gam_GetParQstInd (); @@ -3437,7 +3437,7 @@ void Mch_StartCountdown (void) /***** Get data of the match from database *****/ Match.MchCod = Mch_GetMchCodBeingPlayed (); - Mch_GetDataOfMatchByCod (&Match); + Mch_GetMatchDataByCod (&Match); /***** Start countdown *****/ Match.Status.Countdown = NewCountdown; @@ -3471,7 +3471,7 @@ void Mch_RefreshMatchTch (void) /***** Get data of the match from database *****/ Match.MchCod = Mch_GetMchCodBeingPlayed (); - Mch_GetDataOfMatchByCod (&Match); + Mch_GetMatchDataByCod (&Match); /***** Update countdown *****/ // If current countdown is < 0 ==> no countdown in progress @@ -3526,7 +3526,7 @@ void Mch_RefreshMatchStd (void) /***** Get data of the match from database *****/ Match.MchCod = Mch_GetMchCodBeingPlayed (); - Mch_GetDataOfMatchByCod (&Match); + Mch_GetMatchDataByCod (&Match); /***** Show current match status *****/ Mch_ShowMatchStatusForStd (&Match,Mch_REFRESH_STATUS_BY_SERVER); @@ -3579,7 +3579,7 @@ void Mch_ReceiveQuestionAnswer (void) /***** Get data of the match from database *****/ Match.MchCod = Mch_GetMchCodBeingPlayed (); - Mch_GetDataOfMatchByCod (&Match); + Mch_GetMatchDataByCod (&Match); /***** Get question index from form *****/ QstInd = Gam_GetParQstInd (); diff --git a/swad_match.h b/swad_match.h index 8b2b1a25..95c6a000 100644 --- a/swad_match.h +++ b/swad_match.h @@ -96,7 +96,7 @@ void Mch_ResetMatch (struct Mch_Match *Match); void Mch_ListMatches (struct Gam_Games *Games, bool PutFormNewMatch); -void Mch_GetDataOfMatchByCod (struct Mch_Match *Match); +void Mch_GetMatchDataByCod (struct Mch_Match *Match); void Mch_ListOneOrMoreMatchesAuthor (const struct Mch_Match *Match); void Mch_ListOneOrMoreMatchesTimes (const struct Mch_Match *Match,unsigned UniqueId); void Mch_ListOneOrMoreMatchesNumPlayers (const struct Mch_Match *Match); diff --git a/swad_match_database.c b/swad_match_database.c index 307660ff..3d33d2d1 100644 --- a/swad_match_database.c +++ b/swad_match_database.c @@ -170,7 +170,7 @@ void Mch_DB_UpdateVisResultsMchUsr (long MchCod,bool ShowUsrResults) /********************** Get match data using its code ************************/ /*****************************************************************************/ -unsigned Mch_DB_GetDataOfMatchByCod (MYSQL_RES **mysql_res,long MchCod) +unsigned Mch_DB_GetMatchDataByCod (MYSQL_RES **mysql_res,long MchCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get matches", diff --git a/swad_match_database.h b/swad_match_database.h index d45a731f..56de8fcc 100644 --- a/swad_match_database.h +++ b/swad_match_database.h @@ -40,7 +40,7 @@ void Mch_DB_UpdateMatchTitle (long MchCod, const char Title[Gam_MAX_BYTES_TITLE + 1]); void Mch_DB_UpdateVisResultsMchUsr (long MchCod,bool ShowUsrResults); -unsigned Mch_DB_GetDataOfMatchByCod (MYSQL_RES **mysql_res,long MchCod); +unsigned Mch_DB_GetMatchDataByCod (MYSQL_RES **mysql_res,long MchCod); unsigned Mch_DB_GetStartEndMatchesInGame (MYSQL_RES **mysql_res,long GamCod); unsigned Mch_DB_GetMatchesInGame (MYSQL_RES **mysql_res,long GamCod); unsigned Mch_DB_GetAvailableMatchesInGame (MYSQL_RES **mysql_res,long GamCod); diff --git a/swad_match_result.c b/swad_match_result.c index 80a7ceef..18aead9b 100644 --- a/swad_match_result.c +++ b/swad_match_result.c @@ -164,7 +164,7 @@ void MchRes_ShowMyMchResultsInGam (void) /***** Get parameters *****/ if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) Err_WrongGameExit (); - Gam_GetDataOfGameByCod (&Games.Game); + Gam_GetGameDataByCod (&Games.Game); /***** Game begin *****/ Gam_ShowOnlyOneGameBegin (&Games, @@ -215,8 +215,8 @@ void MchRes_ShowMyMchResultsInMch (void) if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) Err_WrongGameExit (); Match.MchCod = ParCod_GetAndCheckPar (ParCod_Mch); - Gam_GetDataOfGameByCod (&Games.Game); - Mch_GetDataOfMatchByCod (&Match); + Gam_GetGameDataByCod (&Games.Game); + Mch_GetMatchDataByCod (&Match); /***** Game begin *****/ Gam_ShowOnlyOneGameBegin (&Games, @@ -368,7 +368,7 @@ void MchRes_ShowAllMchResultsInGam (void) /***** Get parameters *****/ if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) Err_WrongGameExit (); - Gam_GetDataOfGameByCod (&Games.Game); + Gam_GetGameDataByCod (&Games.Game); /***** Game begin *****/ Gam_ShowOnlyOneGameBegin (&Games, @@ -441,8 +441,8 @@ void MchRes_ShowAllMchResultsInMch (void) if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0) Err_WrongGameExit (); Match.MchCod = ParCod_GetAndCheckPar (ParCod_Mch); - Gam_GetDataOfGameByCod (&Games.Game); - Mch_GetDataOfMatchByCod (&Match); + Gam_GetGameDataByCod (&Games.Game); + Mch_GetMatchDataByCod (&Match); /***** Game begin *****/ Gam_ShowOnlyOneGameBegin (&Games, @@ -571,7 +571,7 @@ static void MchRes_ListGamesToSelect (struct Gam_Games *Games) { /* Get data of this game */ Games->Game.GamCod = Games->Lst[NumGame].GamCod; - Gam_GetDataOfGameByCod (&Games->Game); + Gam_GetGameDataByCod (&Games->Game); /* Write a row for this event */ HTM_TR_Begin (NULL); @@ -765,9 +765,9 @@ static void MchRes_ShowMchResults (struct Gam_Games *Games, /* Get data of match and game */ Match.MchCod = Print.MchCod; - Mch_GetDataOfMatchByCod (&Match); + Mch_GetMatchDataByCod (&Match); Games->Game.GamCod = Match.GamCod; - Gam_GetDataOfGameByCod (&Games->Game); + Gam_GetGameDataByCod (&Games->Game); /* Check if I can view this match result and score */ MchRes_CheckIfICanSeeMatchResult (&Games->Game,&Match,UsrDat->UsrCod,&ICanView); diff --git a/swad_message.c b/swad_message.c index 8b34e8c4..31d1837c 100644 --- a/swad_message.c +++ b/swad_message.c @@ -1112,7 +1112,7 @@ static void Msg_GetParMsgsCrsCod (struct Msg_Messages *Messages) { /* Get data of course */ Crs.CrsCod = Messages->FilterCrsCod; - Crs_GetDataOfCourseByCod (&Crs); + Crs_GetCourseDataByCod (&Crs); } Str_Copy (Messages->FilterCrsShrtName,Messages->FilterCrsCod > 0 ? Crs.ShrtName : @@ -2373,7 +2373,7 @@ static bool Msg_WriteCrsOrgMsg (long CrsCod) Crs.CrsCod = CrsCod; /* Get data of current degree */ - if (Crs_GetDataOfCourseByCod (&Crs)) + if (Crs_GetCourseDataByCod (&Crs)) { ThereIsOrgCrs = true; if ((FromThisCrs = (CrsCod == Gbl.Hierarchy.Crs.CrsCod))) // Message sent from current course diff --git a/swad_notice.c b/swad_notice.c index 803448aa..796de5f5 100644 --- a/swad_notice.c +++ b/swad_notice.c @@ -498,7 +498,7 @@ static void Not_GetDataAndShowNotice (long NotCod) Not_Status_t Status; /***** Get notice data from database *****/ - if (Not_DB_GetDataOfNotice (&mysql_res,NotCod)) + if (Not_DB_GetNoticeData (&mysql_res,NotCod)) { row = mysql_fetch_row (mysql_res); diff --git a/swad_notice_database.c b/swad_notice_database.c index 8410bd0a..a4888921 100644 --- a/swad_notice_database.c +++ b/swad_notice_database.c @@ -112,7 +112,7 @@ void Not_DB_UpdateNumUsrsNotifiedByEMailAboutNotice (long NotCod, /**************************** Get data of a notice ***************************/ /*****************************************************************************/ -unsigned Not_DB_GetDataOfNotice (MYSQL_RES **mysql_res,long NotCod) +unsigned Not_DB_GetNoticeData (MYSQL_RES **mysql_res,long NotCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get notice from database", diff --git a/swad_notice_database.h b/swad_notice_database.h index 0ca583df..731a8c89 100644 --- a/swad_notice_database.h +++ b/swad_notice_database.h @@ -39,7 +39,7 @@ void Not_DB_CopyNoticeToDeleted (long NotCod); void Not_DB_UpdateNumUsrsNotifiedByEMailAboutNotice (long NotCod, unsigned NumUsrsToBeNotifiedByEMail); -unsigned Not_DB_GetDataOfNotice (MYSQL_RES **mysql_res,long NotCod); +unsigned Not_DB_GetNoticeData (MYSQL_RES **mysql_res,long NotCod); unsigned Not_DB_ContentNotice (MYSQL_RES **mysql_res,long NotCod); unsigned Not_DB_GetAllNotices (MYSQL_RES **mysql_res); unsigned Not_DB_GetActiveNotices (MYSQL_RES **mysql_res,long CrsCod); diff --git a/swad_notification.c b/swad_notification.c index 41c8bb5f..0f5a6c88 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -420,19 +420,19 @@ void Ntf_ShowMyNotifications (void) /* Get institution code (row[2]) */ Hie.Ins.InsCod = Str_ConvertStrCodToLongCod (row[2]); - Ins_GetDataOfInstitByCod (&Hie.Ins); + Ins_GetInstitDataByCod (&Hie.Ins); /* Get center code (row[3]) */ Hie.Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[3]); - Ctr_GetDataOfCenterByCod (&Hie.Ctr); + Ctr_GetCenterDataByCod (&Hie.Ctr); /* Get degree code (row[4]) */ Hie.Deg.DegCod = Str_ConvertStrCodToLongCod (row[4]); - Deg_GetDataOfDegreeByCod (&Hie.Deg); + Deg_GetDegreeDataByCod (&Hie.Deg); /* Get course code (row[5]) */ Hie.Crs.CrsCod = Str_ConvertStrCodToLongCod (row[5]); - Crs_GetDataOfCourseByCod (&Hie.Crs); + Crs_GetCourseDataByCod (&Hie.Crs); /* Get message/post/... code (row[6]) */ Cod = Str_ConvertStrCodToLongCod (row[6]); @@ -1345,10 +1345,10 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (const struct Usr_Data *ToUsrDat Hie.Crs.CrsCod = Str_ConvertStrCodToLongCod (row[5]); /* Get data of institution, center, degree and course */ - Ins_GetDataOfInstitByCod (&Hie.Ins); - Ctr_GetDataOfCenterByCod (&Hie.Ctr); - Deg_GetDataOfDegreeByCod (&Hie.Deg); - Crs_GetDataOfCourseByCod (&Hie.Crs); + Ins_GetInstitDataByCod (&Hie.Ins); + Ctr_GetCenterDataByCod (&Hie.Ctr); + Deg_GetDegreeDataByCod (&Hie.Deg); + Crs_GetCourseDataByCod (&Hie.Crs); /* Get message/post/... code (row[6]) */ Cod = Str_ConvertStrCodToLongCod (row[6]); diff --git a/swad_photo.c b/swad_photo.c index 64debd0e..998b7ac8 100644 --- a/swad_photo.c +++ b/swad_photo.c @@ -1981,7 +1981,7 @@ static void Pho_PutLinkToCalculateDegreeStats (const struct Pho_DegPhotos *DegPh Deg_GetListAllDegsWithStds (&Degs); /***** Get data of the degree from database *****/ - Deg_GetDataOfDegreeByCod (&Deg); + Deg_GetDegreeDataByCod (&Deg); /***** Contextual menu *****/ HTM_DIV_Begin ("class=\"UPD\""); @@ -2115,7 +2115,7 @@ static void Pho_ShowOrPrintClassPhotoDegrees (struct Pho_DegPhotos *DegPhotos, Err_WrongDegreeExit (); /* Get data of degree */ - Deg_GetDataOfDegreeByCod (&Deg); + Deg_GetDegreeDataByCod (&Deg); /* Get number of students and number of students with photo in this degree */ Pho_GetNumStdsInDegree (Deg.DegCod,Usr_SEX_ALL,&NumStds,&NumStdsWithPhoto); @@ -2209,7 +2209,7 @@ static void Pho_ShowOrPrintListDegrees (struct Pho_DegPhotos *DegPhotos, Err_WrongDegreeExit (); /* Get data of degree */ - Deg_GetDataOfDegreeByCod (&Deg); + Deg_GetDegreeDataByCod (&Deg); HTM_TR_Begin (NULL); diff --git a/swad_place.c b/swad_place.c index c0848f31..b11edf1d 100644 --- a/swad_place.c +++ b/swad_place.c @@ -395,7 +395,7 @@ void Plc_GetListPlaces (struct Plc_Places *Places) /**************************** Get place full name ****************************/ /*****************************************************************************/ -void Plc_GetDataOfPlaceByCod (struct Plc_Place *Plc) +void Plc_GetPlaceDataByCod (struct Plc_Place *Plc) { extern const char *Txt_Place_unspecified; extern const char *Txt_Another_place; @@ -421,7 +421,7 @@ void Plc_GetDataOfPlaceByCod (struct Plc_Place *Plc) else if (Plc->PlcCod > 0) { /***** Get data of a place from database *****/ - if (Plc_DB_GetDataOfPlaceByCod (&mysql_res,Plc->PlcCod)) // Place found... + if (Plc_DB_GetPlaceDataByCod (&mysql_res,Plc->PlcCod)) // Place found... { /* Get row */ row = mysql_fetch_row (mysql_res); @@ -553,7 +553,7 @@ void Plc_RemovePlace (void) Plc_EditingPlc->PlcCod = ParCod_GetAndCheckPar (ParCod_Plc); /***** Get data of the place from database *****/ - Plc_GetDataOfPlaceByCod (Plc_EditingPlc); + Plc_GetPlaceDataByCod (Plc_EditingPlc); /***** Check if this place has centers *****/ if (Plc_EditingPlc->NumCtrs) // Place has centers ==> don't remove @@ -636,7 +636,7 @@ static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName) Par_GetParText (ParName,NewPlcName,MaxBytes); /***** Get from the database the old names of the place *****/ - Plc_GetDataOfPlaceByCod (Plc_EditingPlc); + Plc_GetPlaceDataByCod (Plc_EditingPlc); /***** Check if new name is empty *****/ if (NewPlcName[0]) diff --git a/swad_place.h b/swad_place.h index b6b43ca7..6d097950 100644 --- a/swad_place.h +++ b/swad_place.h @@ -74,7 +74,7 @@ void Plc_EditPlaces (void); void Plc_PutIconToViewPlaces (void); void Plc_GetListPlaces (struct Plc_Places *Places); void Plc_FreeListPlaces (struct Plc_Places *Places); -void Plc_GetDataOfPlaceByCod (struct Plc_Place *Plc); +void Plc_GetPlaceDataByCod (struct Plc_Place *Plc); void Plc_RemovePlace (void); void Plc_RenamePlaceShort (void); void Plc_RenamePlaceFull (void); diff --git a/swad_place_database.c b/swad_place_database.c index 9c2c19c0..af020968 100644 --- a/swad_place_database.c +++ b/swad_place_database.c @@ -115,7 +115,7 @@ unsigned Plc_DB_GetListPlaces (MYSQL_RES **mysql_res,Plc_Order_t SelectedOrder) /********************* Get data of a place from database *********************/ /*****************************************************************************/ -unsigned Plc_DB_GetDataOfPlaceByCod (MYSQL_RES **mysql_res,long PlcCod) +unsigned Plc_DB_GetPlaceDataByCod (MYSQL_RES **mysql_res,long PlcCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get data of a place", diff --git a/swad_place_database.h b/swad_place_database.h index 16dc71ea..48c7ddc1 100644 --- a/swad_place_database.h +++ b/swad_place_database.h @@ -37,7 +37,7 @@ void Plc_DB_CreatePlace (const struct Plc_Place *Plc); void Plc_DB_UpdatePlcName (long PlcCod,const char *FldName,const char *NewPlcName); unsigned Plc_DB_GetListPlaces (MYSQL_RES **mysql_res,Plc_Order_t SelectedOrder); -unsigned Plc_DB_GetDataOfPlaceByCod (MYSQL_RES **mysql_res,long PlcCod); +unsigned Plc_DB_GetPlaceDataByCod (MYSQL_RES **mysql_res,long PlcCod); bool Plc_DB_CheckIfPlaceNameExists (long PlcCod, const char *FldName,const char *Name); diff --git a/swad_plugin.c b/swad_plugin.c index 91eafb17..e0b857d9 100644 --- a/swad_plugin.c +++ b/swad_plugin.c @@ -279,7 +279,7 @@ static void Plg_GetListPlugins (struct Plg_Plugins *Plugins) /*************************** Get data of a plugin ****************************/ /*****************************************************************************/ -bool Plg_GetDataOfPluginByCod (struct Plg_Plugin *Plg) +bool Plg_GetPluginDataByCod (struct Plg_Plugin *Plg) { MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -298,7 +298,7 @@ bool Plg_GetDataOfPluginByCod (struct Plg_Plugin *Plg) // Plg->PlgCod > 0 /***** Get data of a plugin from database *****/ - if (Plg_DB_GetDataOfPluginByCod (&mysql_res,Plg->PlgCod)) // Plugin found... + if (Plg_DB_GetPluginDataByCod (&mysql_res,Plg->PlgCod)) // Plugin found... { PluginFound = true; @@ -481,7 +481,7 @@ void Plg_RemovePlugin (void) Plg_EditingPlg->PlgCod = ParCod_GetAndCheckPar (ParCod_Plg); /***** Get data of the plugin from database *****/ - Plg_GetDataOfPluginByCod (Plg_EditingPlg); + Plg_GetPluginDataByCod (Plg_EditingPlg); /***** Remove plugin *****/ Plg_DB_RemovePlugin (Plg_EditingPlg->PlgCod); @@ -514,7 +514,7 @@ void Plg_RenamePlugin (void) Par_GetParText ("Name",NewPlgName,Plg_MAX_BYTES_PLUGIN_NAME); /***** Get plugin data from the database *****/ - Plg_GetDataOfPluginByCod (Plg_EditingPlg); + Plg_GetPluginDataByCod (Plg_EditingPlg); /***** Check if new name is empty *****/ if (NewPlgName[0]) @@ -570,7 +570,7 @@ void Plg_ChangePlgDescription (void) Par_GetParText ("Description",NewDescription,Plg_MAX_BYTES_PLUGIN_DESCRIPTION); /***** Get plugin data from the database *****/ - Plg_GetDataOfPluginByCod (Plg_EditingPlg); + Plg_GetPluginDataByCod (Plg_EditingPlg); /***** Check if new description is empty *****/ if (NewDescription[0]) @@ -611,7 +611,7 @@ void Plg_ChangePlgLogo (void) Par_GetParText ("Logo",NewLogo,Plg_MAX_BYTES_PLUGIN_LOGO); /***** Get plugin data from the database *****/ - Plg_GetDataOfPluginByCod (Plg_EditingPlg); + Plg_GetPluginDataByCod (Plg_EditingPlg); /***** Check if new logo is empty *****/ if (NewLogo[0]) @@ -652,7 +652,7 @@ void Plg_ChangePlgAppKey (void) Par_GetParText ("AppKey",NewAppKey,Plg_MAX_BYTES_PLUGIN_APP_KEY); /***** Get plugin data from the database *****/ - Plg_GetDataOfPluginByCod (Plg_EditingPlg); + Plg_GetPluginDataByCod (Plg_EditingPlg); /***** Check if new logo is empty *****/ if (NewAppKey[0]) @@ -693,7 +693,7 @@ void Plg_ChangePlgURL (void) Par_GetParText ("URL",NewURL,Cns_MAX_BYTES_WWW); /***** Get plugin data from the database *****/ - Plg_GetDataOfPluginByCod (Plg_EditingPlg); + Plg_GetPluginDataByCod (Plg_EditingPlg); /***** Check if new URL is empty *****/ if (NewURL[0]) @@ -734,7 +734,7 @@ void Plg_ChangePlgIP (void) Par_GetParText ("IP",NewIP,Cns_MAX_BYTES_IP); /***** Get plugin data from the database *****/ - Plg_GetDataOfPluginByCod (Plg_EditingPlg); + Plg_GetPluginDataByCod (Plg_EditingPlg); /***** Check if new IP is empty *****/ if (NewIP[0]) diff --git a/swad_plugin.h b/swad_plugin.h index ba5cf313..99d57466 100644 --- a/swad_plugin.h +++ b/swad_plugin.h @@ -66,7 +66,7 @@ struct Plg_Plugin void Plg_ListPlugins (void); void Plg_EditPlugins (void); -bool Plg_GetDataOfPluginByCod (struct Plg_Plugin *Plg); +bool Plg_GetPluginDataByCod (struct Plg_Plugin *Plg); void Plg_RemovePlugin (void); void Plg_RenamePlugin (void); void Plg_ChangePlgDescription (void); diff --git a/swad_plugin_database.c b/swad_plugin_database.c index f3d16c2d..6c9204e9 100644 --- a/swad_plugin_database.c +++ b/swad_plugin_database.c @@ -160,7 +160,7 @@ unsigned Plg_DB_GetListPlugins (MYSQL_RES **mysql_res) /*************************** Get data of a plugin ****************************/ /*****************************************************************************/ -unsigned Plg_DB_GetDataOfPluginByCod (MYSQL_RES **mysql_res,long PlgCod) +unsigned Plg_DB_GetPluginDataByCod (MYSQL_RES **mysql_res,long PlgCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get data of a plugin", diff --git a/swad_plugin_database.h b/swad_plugin_database.h index 3d1f53c4..2fab007b 100644 --- a/swad_plugin_database.h +++ b/swad_plugin_database.h @@ -50,7 +50,7 @@ void Plg_DB_ChangeIP (long PlgCod, const char NewIP[Cns_MAX_BYTES_IP + 1]); unsigned Plg_DB_GetListPlugins (MYSQL_RES **mysql_res); -unsigned Plg_DB_GetDataOfPluginByCod (MYSQL_RES **mysql_res,long PlgCod); +unsigned Plg_DB_GetPluginDataByCod (MYSQL_RES **mysql_res,long PlgCod); long Plg_DB_GetPlgCodFromAppKey (const char *AppKey); bool Plg_DB_CheckIfPluginNameExists (const char *Name,long PlgCod); diff --git a/swad_program.c b/swad_program.c index c86c6a40..70c0a25d 100644 --- a/swad_program.c +++ b/swad_program.c @@ -157,10 +157,10 @@ static bool Prg_CheckIfMoveDownIsAllowed (unsigned NumItem); static bool Prg_CheckIfMoveLeftIsAllowed (unsigned NumItem); static bool Prg_CheckIfMoveRightIsAllowed (unsigned NumItem); -static void Prg_GetDataOfItemByCod (struct Prg_Item *Item); -static void Prg_GetDataOfItem (struct Prg_Item *Item, - MYSQL_RES **mysql_res, - unsigned NumRows); +static void Prg_GetItemDataByCod (struct Prg_Item *Item); +static void Prg_GetItemDataFromRow (MYSQL_RES **mysql_res, + struct Prg_Item *Item, + unsigned NumRows); static void Prg_HideOrUnhideItem (bool Hide); @@ -306,7 +306,7 @@ void Prg_ShowAllItems (Prg_ListingType_t ListingType, { /* Get data of this program item */ Item.Hierarchy.ItmCod = Prg_GetItmCodFromNumItem (NumItem); - Prg_GetDataOfItemByCod (&Item); + Prg_GetItemDataByCod (&Item); /* Begin range to highlight? */ if (Item.Hierarchy.ItmInd == ToHighlight.Begin) // Begin of the highlighted range @@ -1142,14 +1142,14 @@ void Prg_GetPars (struct Prg_Item *Item) Item->Resource.Hierarchy.RscCod = ParCod_GetPar (ParCod_Rsc); /***** Get data of the program item from database *****/ - PrgRsc_GetDataOfResourceByCod (Item); + PrgRsc_GetResourceDataByCod (Item); if (Item->Hierarchy.ItmCod <= 0) // No resource specified /***** Try to get data of the program item from database *****/ Item->Hierarchy.ItmCod = ParCod_GetPar (ParCod_Itm); /***** Get data of the program item from database *****/ - Prg_GetDataOfItemByCod (Item); + Prg_GetItemDataByCod (Item); } /*****************************************************************************/ @@ -1205,7 +1205,7 @@ void Prg_GetListItems (void) /****************** Get program item data using its code *********************/ /*****************************************************************************/ -static void Prg_GetDataOfItemByCod (struct Prg_Item *Item) +static void Prg_GetItemDataByCod (struct Prg_Item *Item) { MYSQL_RES *mysql_res; unsigned NumRows; @@ -1213,10 +1213,10 @@ static void Prg_GetDataOfItemByCod (struct Prg_Item *Item) if (Item->Hierarchy.ItmCod > 0) { /***** Build query *****/ - NumRows = Prg_DB_GetDataOfItemByCod (&mysql_res,Item->Hierarchy.ItmCod); + NumRows = Prg_DB_GetItemDataByCod (&mysql_res,Item->Hierarchy.ItmCod); /***** Get data of program item *****/ - Prg_GetDataOfItem (Item,&mysql_res,NumRows); + Prg_GetItemDataFromRow (&mysql_res,Item,NumRows); } else /***** Clear all program item data *****/ @@ -1227,9 +1227,9 @@ static void Prg_GetDataOfItemByCod (struct Prg_Item *Item) /************************* Get program item data *****************************/ /*****************************************************************************/ -static void Prg_GetDataOfItem (struct Prg_Item *Item, - MYSQL_RES **mysql_res, - unsigned NumRows) +static void Prg_GetItemDataFromRow (MYSQL_RES **mysql_res, + struct Prg_Item *Item, + unsigned NumRows) { MYSQL_ROW row; @@ -1955,7 +1955,7 @@ static void Prg_ShowFormToCreateItem (long ParentItmCod) /***** Get data of the parent program item from database *****/ ParentItem.Hierarchy.ItmCod = ParentItmCod; - Prg_GetDataOfItemByCod (&ParentItem); + Prg_GetItemDataByCod (&ParentItem); /***** Initialize to empty program item *****/ Prg_ResetItem (&Item); @@ -2004,7 +2004,7 @@ static void Prg_ShowFormToChangeItem (long ItmCod) /***** Get data of the program item from database *****/ Item.Hierarchy.ItmCod = ItmCod; - Prg_GetDataOfItemByCod (&Item); + Prg_GetItemDataByCod (&Item); Prg_DB_GetItemTxt (Item.Hierarchy.ItmCod,Txt); /***** Begin form *****/ diff --git a/swad_program_database.c b/swad_program_database.c index e9b80f1a..65aaa88a 100644 --- a/swad_program_database.c +++ b/swad_program_database.c @@ -235,7 +235,7 @@ unsigned Prg_DB_GetListItems (MYSQL_RES **mysql_res) /****************** Get program item data using its code *********************/ /*****************************************************************************/ -unsigned Prg_DB_GetDataOfItemByCod (MYSQL_RES **mysql_res,long ItmCod) +unsigned Prg_DB_GetItemDataByCod (MYSQL_RES **mysql_res,long ItmCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get program item data", @@ -528,7 +528,7 @@ unsigned Prg_DB_GetListResources (MYSQL_RES **mysql_res,long ItmCod, /****************** Get item resource data using its code ********************/ /*****************************************************************************/ -unsigned Prg_DB_GetDataOfResourceByCod (MYSQL_RES **mysql_res,long RscCod) +unsigned Prg_DB_GetResourceDataByCod (MYSQL_RES **mysql_res,long RscCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get item resource data", diff --git a/swad_program_database.h b/swad_program_database.h index 93b91e6b..3e2108eb 100644 --- a/swad_program_database.h +++ b/swad_program_database.h @@ -46,7 +46,7 @@ void Prg_DB_MoveLeftRightItemRange (const struct Prg_ItemRange *ToMove, Prg_MoveLeftRight_t LeftRight); unsigned Prg_DB_GetListItems (MYSQL_RES **mysql_res); -unsigned Prg_DB_GetDataOfItemByCod (MYSQL_RES **mysql_res,long ItmCod); +unsigned Prg_DB_GetItemDataByCod (MYSQL_RES **mysql_res,long ItmCod); void Prg_DB_GetItemTxt (long ItmCod,char Txt[Cns_MAX_BYTES_TEXT + 1]); unsigned Prg_DB_GetNumCoursesWithItems (HieLvl_Level_t Scope); @@ -63,7 +63,7 @@ void Prg_DB_UpdateResourceTitle (long ItmCod,long RscCod, unsigned Prg_DB_GetListResources (MYSQL_RES **mysql_res,long ItmCod, bool ShowHiddenResources); -unsigned Prg_DB_GetDataOfResourceByCod (MYSQL_RES **mysql_res,long RscCod); +unsigned Prg_DB_GetResourceDataByCod (MYSQL_RES **mysql_res,long RscCod); unsigned Prg_DB_GetRscIndBefore (long ItmCod,unsigned RscInd); unsigned Prg_DB_GetRscIndAfter (long ItmCod,unsigned RscInd); diff --git a/swad_program_resource.c b/swad_program_resource.c index 2eac4a8d..a49931c7 100644 --- a/swad_program_resource.c +++ b/swad_program_resource.c @@ -107,8 +107,8 @@ static const char *PrgRsc_RESOURCE_SECTION_ID = "rsc_section"; static void PrgRsc_PutIconsViewResources (void *ItmCod); static void PrgRsc_PutIconsEditResources (void *ItmCod); -static void PrgRsc_GetDataOfResource (struct Prg_Item *Item, - MYSQL_RES **mysql_res); +static void PrgRsc_GetResourceDataFromRow (MYSQL_RES *mysql_res, + struct Prg_Item *Item); static void PrgRsc_WriteRowViewResource (unsigned NumRsc, const struct Prg_Item *Item); static void PrgRsc_WriteRowEditResource (unsigned NumRsc,unsigned NumResources, @@ -133,8 +133,8 @@ static void PrgRsc_WriteEmptyLinkInCrsProgram (__attribute__((unused)) long Cod, __attribute__((unused)) bool PutFormToGo, const char *Icon,const char *IconTitle); static void PrgRsc_GetResourceTitleFromLink (struct Prg_Item *Item); -static void PrgRsc_GetDataOfLinkFromClipboard (struct Prg_Link *Link, - MYSQL_RES **mysql_res); +static void PrgRsc_GetLinkDataFromRow (MYSQL_RES *mysql_res, + struct Prg_Link *Link); /*****************************************************************************/ /****************************** View resources *******************************/ @@ -281,7 +281,7 @@ void PrgRsc_ListItemResources (Prg_ListingType_t ListingType, NumRsc++, The_ChangeRowColor1 (1)) { /* Get data of this item resource */ - PrgRsc_GetDataOfResource (Item,&mysql_res); + PrgRsc_GetResourceDataFromRow (mysql_res,Item); /* Show item */ if (EditingResourcesOfThisItem) @@ -345,15 +345,15 @@ static void PrgRsc_PutIconsEditResources (void *ItmCod) /****************** Get item resource data using its code ********************/ /*****************************************************************************/ -void PrgRsc_GetDataOfResourceByCod (struct Prg_Item *Item) +void PrgRsc_GetResourceDataByCod (struct Prg_Item *Item) { MYSQL_RES *mysql_res; if (Item->Resource.Hierarchy.RscCod > 0) { /***** Get data of item resource *****/ - if (Prg_DB_GetDataOfResourceByCod (&mysql_res,Item->Resource.Hierarchy.RscCod)) - PrgRsc_GetDataOfResource (Item,&mysql_res); + if (Prg_DB_GetResourceDataByCod (&mysql_res,Item->Resource.Hierarchy.RscCod)) + PrgRsc_GetResourceDataFromRow (mysql_res,Item); else Prg_ResetItem (Item); @@ -369,14 +369,14 @@ void PrgRsc_GetDataOfResourceByCod (struct Prg_Item *Item) /************************* Get item resource data ****************************/ /*****************************************************************************/ -static void PrgRsc_GetDataOfResource (struct Prg_Item *Item, - MYSQL_RES **mysql_res) +static void PrgRsc_GetResourceDataFromRow (MYSQL_RES *mysql_res, + struct Prg_Item *Item) { MYSQL_ROW row; /***** Get data of item resource from database *****/ /* Get row */ - row = mysql_fetch_row (*mysql_res); + row = mysql_fetch_row (mysql_res); /* ItmCod row[0] RscCod row[1] @@ -939,7 +939,7 @@ static void PrgRsc_ShowClipboard (struct Prg_Item *Item) NumLink <= NumLinks; NumLink++) { - PrgRsc_GetDataOfLinkFromClipboard (&Link,&mysql_res); + PrgRsc_GetLinkDataFromRow (mysql_res,&Link); PrgRsc_WriteRowClipboard (true,&Link); } DB_FreeMySQLResult (&mysql_res); @@ -1000,7 +1000,7 @@ static void PrgRsc_WriteLinkName (const struct Prg_Link *Link,bool PutFormToGo, [PrgRsc_SURVEY ] = SvyRsc_WriteSurveyInCrsProgram, [PrgRsc_DOCUMENT ] = BrwRsc_WriteDocFileNameInCrsProgram, [PrgRsc_MARKS ] = BrwRsc_WriteMrkFileNameInCrsProgram, - [PrgRsc_ATTENDANCE_EVENT] = AttRsc_WriteAttEventInCrsProgram, + [PrgRsc_ATTENDANCE_EVENT] = AttRsc_WriteEventInCrsProgram, [PrgRsc_FORUM_THREAD ] = ForRsc_WriteThreadInCrsProgram, }; @@ -1117,14 +1117,14 @@ void PrgRsc_ChangeLink (void) /********************** Get resource data from clipboard *********************/ /*****************************************************************************/ -static void PrgRsc_GetDataOfLinkFromClipboard (struct Prg_Link *Link, - MYSQL_RES **mysql_res) +static void PrgRsc_GetLinkDataFromRow (MYSQL_RES *mysql_res, + struct Prg_Link *Link) { MYSQL_ROW row; /***** Get data of item resource from database *****/ /* Get row */ - row = mysql_fetch_row (*mysql_res); + row = mysql_fetch_row (mysql_res); /* Type row[0] Cod row[1] diff --git a/swad_program_resource.h b/swad_program_resource.h index 4faf5bdf..2b81a201 100644 --- a/swad_program_resource.h +++ b/swad_program_resource.h @@ -41,7 +41,7 @@ void PrgRsc_ListItemResources (Prg_ListingType_t ListingType, long SelectedItmCod, long SelectedRscCod); -void PrgRsc_GetDataOfResourceByCod (struct Prg_Item *Item); +void PrgRsc_GetResourceDataByCod (struct Prg_Item *Item); void PrgRsc_CreateResource (void); diff --git a/swad_project.c b/swad_project.c index f0b5e433..88081cf7 100644 --- a/swad_project.c +++ b/swad_project.c @@ -558,7 +558,7 @@ static void Prj_ShowPrjsInCurrentPage (void *Projects) { /* Get project data */ ((struct Prj_Projects *) Projects)->Prj.PrjCod = ((struct Prj_Projects *) Projects)->LstPrjCods[NumPrj - 1]; - Prj_GetDataOfProjectByCod (&((struct Prj_Projects *) Projects)->Prj); + Prj_GetProjectDataByCod (&((struct Prj_Projects *) Projects)->Prj); /* Number of index */ switch (((struct Prj_Projects *) Projects)->SelectedOrder) @@ -1348,7 +1348,7 @@ void Prj_ShowOneProjectWithFileBrowser (struct Prj_Projects *Projects) Prj_AllocMemProject (&Projects->Prj); /***** Get project data *****/ - Prj_GetDataOfProjectByCod (&Projects->Prj); + Prj_GetProjectDataByCod (&Projects->Prj); /***** Begin box *****/ Box_BoxBegin (NULL,Projects->Prj.Title, @@ -1415,7 +1415,7 @@ void Prj_PrintOneProject (void) /***** Get project data *****/ Projects.Prj.PrjCod = ParCod_GetAndCheckPar (ParCod_Prj); - Prj_GetDataOfProjectByCod (&Projects.Prj); + Prj_GetProjectDataByCod (&Projects.Prj); /***** Write header *****/ Lay_WriteHeaderClassPhoto (true,false, @@ -1657,7 +1657,7 @@ static void Prj_ShowProjectDepartment (const struct Prj_Projects *Projects, /***** Get data of department *****/ Dpt.DptCod = Projects->Prj.DptCod; - Dpt_GetDataOfDepartmentByCod (&Dpt); + Dpt_GetDepartmentDataByCod (&Dpt); /***** Show department *****/ PutLink = (Dpt.WWW[0] && @@ -2521,7 +2521,7 @@ static void Prj_ShowTableAllProjectsOneRow (struct Prj_Project *Prj) char *Id; /***** Get data of this project *****/ - Prj_GetDataOfProjectByCod (Prj); + Prj_GetProjectDataByCod (Prj); /***** Set CSS classes *****/ ClassDate = (Prj->Hidden == Prj_HIDDEN) ? "DATE_BLUE_LIGHT" : @@ -2622,7 +2622,7 @@ static void Prj_ShowTableAllProjectsDepartment (const struct Prj_Project *Prj) /***** Get data of department *****/ Dpt.DptCod = Prj->DptCod; - Dpt_GetDataOfDepartmentByCod (&Dpt); + Dpt_GetDepartmentDataByCod (&Dpt); /***** Show department *****/ HTM_TD_Begin ("class=\"LT %s_%s %s\"", @@ -3036,7 +3036,7 @@ static void Prj_ReqRemUsrFromPrj (struct Prj_Projects *Projects, Projects->Prj.PrjCod = ParCod_GetAndCheckPar (ParCod_Prj); /***** Get data of the project from database *****/ - Prj_GetDataOfProjectByCod (&Projects->Prj); + Prj_GetProjectDataByCod (&Projects->Prj); /***** Get user to be removed *****/ if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ()) @@ -3115,7 +3115,7 @@ static void Prj_RemUsrFromPrj (Prj_RoleInProject_t RoleInPrj) Projects.Prj.PrjCod = ParCod_GetAndCheckPar (ParCod_Prj); /***** Get data of the project from database *****/ - Prj_GetDataOfProjectByCod (&Projects.Prj); + Prj_GetProjectDataByCod (&Projects.Prj); /***** Get user to be removed *****/ if (Usr_GetParOtherUsrCodEncryptedAndGetUsrData ()) @@ -3344,7 +3344,7 @@ static void Prj_GetListProjects (struct Prj_Projects *Projects) /********************* Get project data using its code ***********************/ /*****************************************************************************/ -void Prj_GetDataOfProjectByCod (struct Prj_Project *Prj) +void Prj_GetProjectDataByCod (struct Prj_Project *Prj) { extern const char *Prj_Proposal_DB[Prj_NUM_PROPOSAL_TYPES]; extern const char *Prj_ReviewStatus_DB[Prj_NUM_REVIEW_STATUS]; @@ -3359,7 +3359,7 @@ void Prj_GetDataOfProjectByCod (struct Prj_Project *Prj) Prj_ResetProject (Prj); /***** Get data of project *****/ - if (Prj_DB_GetDataOfProjectByCod (&mysql_res,Prj->PrjCod)) // Project found... + if (Prj_DB_GetProjectDataByCod (&mysql_res,Prj->PrjCod)) // Project found... { /* Get row */ row = mysql_fetch_row (mysql_res); @@ -3499,7 +3499,7 @@ void Prj_ReqRemProject (void) Projects.Prj.PrjCod = ParCod_GetAndCheckPar (ParCod_Prj); /***** Get data of the project from database *****/ - Prj_GetDataOfProjectByCod (&Projects.Prj); + Prj_GetProjectDataByCod (&Projects.Prj); if (Prj_CheckIfICanEditProject (&Projects.Prj)) /***** Show question and button to remove the project *****/ @@ -3539,7 +3539,7 @@ void Prj_RemoveProject (void) Projects.Prj.PrjCod = ParCod_GetAndCheckPar (ParCod_Prj); /***** Get data of the project from database *****/ - Prj_GetDataOfProjectByCod (&Projects.Prj); // Inside this function, the course is checked to be the current one + Prj_GetProjectDataByCod (&Projects.Prj); // Inside this function, the course is checked to be the current one if (Prj_CheckIfICanEditProject (&Projects.Prj)) { @@ -3594,7 +3594,7 @@ void Prj_HideProject (void) Projects.Prj.PrjCod = ParCod_GetAndCheckPar (ParCod_Prj); /***** Get data of the project from database *****/ - Prj_GetDataOfProjectByCod (&Projects.Prj); + Prj_GetProjectDataByCod (&Projects.Prj); /***** Hide project *****/ if (Prj_CheckIfICanEditProject (&Projects.Prj)) @@ -3628,7 +3628,7 @@ void Prj_UnhideProject (void) Projects.Prj.PrjCod = ParCod_GetAndCheckPar (ParCod_Prj); /***** Get data of the project from database *****/ - Prj_GetDataOfProjectByCod (&Projects.Prj); + Prj_GetProjectDataByCod (&Projects.Prj); /***** Unhide project *****/ if (Prj_CheckIfICanEditProject (&Projects.Prj)) @@ -3695,7 +3695,7 @@ static void Prj_ReqCreatOrEditPrj (struct Prj_Projects *Projects) } else /* Get data of the project from database */ - Prj_GetDataOfProjectByCod (&Projects->Prj); + Prj_GetProjectDataByCod (&Projects->Prj); /***** Put form to edit project *****/ Prj_PutFormProject (Projects,ItsANewProject); @@ -4031,7 +4031,7 @@ void Prj_ReceiveFormProject (void) else { /* Get data of the project from database */ - Prj_GetDataOfProjectByCod (&Projects.Prj); + Prj_GetProjectDataByCod (&Projects.Prj); ICanEditProject = Prj_CheckIfICanEditProject (&Projects.Prj); } @@ -4531,7 +4531,7 @@ void Prj_LockProjectEdition (void) Projects.Prj.PrjCod = ParCod_GetAndCheckPar (ParCod_Prj); /***** Get data of the project from database *****/ - Prj_GetDataOfProjectByCod (&Projects.Prj); + Prj_GetProjectDataByCod (&Projects.Prj); if (Prj_CheckIfICanEditProject (&Projects.Prj)) { @@ -4568,7 +4568,7 @@ void Prj_UnloProjectEdition (void) Projects.Prj.PrjCod = ParCod_GetAndCheckPar (ParCod_Prj); /***** Get data of the project from database *****/ - Prj_GetDataOfProjectByCod (&Projects.Prj); + Prj_GetProjectDataByCod (&Projects.Prj); if (Prj_CheckIfICanEditProject (&Projects.Prj)) { @@ -4605,7 +4605,7 @@ void Prj_ChangeReviewStatus (void) Projects.Prj.PrjCod = ParCod_GetAndCheckPar (ParCod_Prj); /***** Get data of the project from database *****/ - Prj_GetDataOfProjectByCod (&Projects.Prj); + Prj_GetProjectDataByCod (&Projects.Prj); /***** Hide project *****/ if (Prj_CheckIfICanReviewProjects ()) diff --git a/swad_project.h b/swad_project.h index 421911ce..040cf617 100644 --- a/swad_project.h +++ b/swad_project.h @@ -252,7 +252,7 @@ void Prj_ReqEditPrj (void); void Prj_AllocMemProject (struct Prj_Project *Prj); void Prj_FreeMemProject (struct Prj_Project *Prj); -void Prj_GetDataOfProjectByCod (struct Prj_Project *Prj); +void Prj_GetProjectDataByCod (struct Prj_Project *Prj); void Prj_FreeListProjects (struct Prj_Projects *Projects); void Prj_ReqRemProject (void); diff --git a/swad_project_database.c b/swad_project_database.c index 53faed9a..a1f43c45 100644 --- a/swad_project_database.c +++ b/swad_project_database.c @@ -565,7 +565,7 @@ unsigned Prj_DB_GetCrsPrjsConfig (MYSQL_RES **mysql_res) /********************* Get project data using its code ***********************/ /*****************************************************************************/ -unsigned Prj_DB_GetDataOfProjectByCod (MYSQL_RES **mysql_res,long PrjCod) +unsigned Prj_DB_GetProjectDataByCod (MYSQL_RES **mysql_res,long PrjCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get project data", diff --git a/swad_project_database.h b/swad_project_database.h index 9ba4e8f7..3626b8d1 100644 --- a/swad_project_database.h +++ b/swad_project_database.h @@ -46,7 +46,7 @@ unsigned Prj_DB_GetListProjects (MYSQL_RES **mysql_res, const struct Prj_Projects *Projects, const char *UsrsSubQuery); // NULL if no users unsigned Prj_DB_GetCrsPrjsConfig (MYSQL_RES **mysql_res); -unsigned Prj_DB_GetDataOfProjectByCod (MYSQL_RES **mysql_res,long PrjCod); +unsigned Prj_DB_GetProjectDataByCod (MYSQL_RES **mysql_res,long PrjCod); void Prj_DB_GetProjectTitle (long PrjCod,char Title[Prj_MAX_BYTES_TITLE + 1]); unsigned Prj_DB_GetPrjDataToCheckFaults (MYSQL_RES **mysql_res,long PrjCod); unsigned Prj_DB_GetNumUsrsInPrj (long PrjCod,Prj_RoleInProject_t RoleInProject); diff --git a/swad_question.c b/swad_question.c index af5c3cd7..45ede390 100644 --- a/swad_question.c +++ b/swad_question.c @@ -2546,7 +2546,7 @@ bool Qst_GetQstDataFromDB (struct Qst_Question *Question) DB_FreeMySQLResult (&mysql_res); /***** Get the answers from the database *****/ - Question->Answer.NumOptions = Qst_DB_GetDataOfAnswers (&mysql_res,Question->QstCod, + Question->Answer.NumOptions = Qst_DB_GetAnswersData (&mysql_res,Question->QstCod, false); // Don't shuffle /* row[0] AnsInd diff --git a/swad_question_database.c b/swad_question_database.c index 59d76f93..f431b8ae 100644 --- a/swad_question_database.c +++ b/swad_question_database.c @@ -1310,7 +1310,7 @@ unsigned Qst_DB_GetNumAnswersQst (long QstCod) /***************** Get answers of a question from database *******************/ /*****************************************************************************/ -unsigned Qst_DB_GetDataOfAnswers (MYSQL_RES **mysql_res,long QstCod,bool Shuffle) +unsigned Qst_DB_GetAnswersData (MYSQL_RES **mysql_res,long QstCod,bool Shuffle) { unsigned NumOptions; diff --git a/swad_question_database.h b/swad_question_database.h index 24bf9f98..7d43303f 100644 --- a/swad_question_database.h +++ b/swad_question_database.h @@ -65,7 +65,7 @@ unsigned Qst_DB_GetQstCodFromTypeAnsStem (MYSQL_RES **mysql_res, const struct Qst_Question *Question); unsigned Qst_DB_GetNumAnswersQst (long QstCod); -unsigned Qst_DB_GetDataOfAnswers (MYSQL_RES **mysql_res,long QstCod,bool Shuffle); +unsigned Qst_DB_GetAnswersData (MYSQL_RES **mysql_res,long QstCod,bool Shuffle); unsigned Qst_DB_GetTextOfAnswers (MYSQL_RES **mysql_res,long QstCod); unsigned Qst_DB_GetQstAnswersCorr (MYSQL_RES **mysql_res,long QstCod); unsigned Qst_DB_GetShuffledAnswersIndexes (MYSQL_RES **mysql_res, diff --git a/swad_record.c b/swad_record.c index e8224b82..d8c90aef 100644 --- a/swad_record.c +++ b/swad_record.c @@ -2098,7 +2098,7 @@ void Rec_ShowSharedUsrRecord (Rec_SharedRecordViewType_t TypeOfView, Ins.InsCod = UsrDat->InsCod; if (Ins.InsCod > 0) - Ins_GetDataOfInstitByCod (&Ins); + Ins_GetInstitDataByCod (&Ins); /***** Begin box and table *****/ sprintf (StrRecordWidth,"%upx",Rec_RECORD_WIDTH); @@ -3398,7 +3398,7 @@ static void Rec_ShowCenter (struct Usr_Data *UsrDat,bool ShowData) if (UsrDat->Tch.CtrCod > 0) { Ctr.CtrCod = UsrDat->Tch.CtrCod; - Ctr_GetDataOfCenterByCod (&Ctr); + Ctr_GetCenterDataByCod (&Ctr); if (Ctr.WWW[0]) HTM_A_Begin ("href=\"%s\" target=\"_blank\"" " class=\"DAT_STRONG_%s\"", @@ -3436,7 +3436,7 @@ static void Rec_ShowDepartment (struct Usr_Data *UsrDat,bool ShowData) if (UsrDat->Tch.DptCod > 0) { Dpt.DptCod = UsrDat->Tch.DptCod; - Dpt_GetDataOfDepartmentByCod (&Dpt); + Dpt_GetDepartmentDataByCod (&Dpt); if (Dpt.WWW[0]) HTM_A_Begin ("href=\"%s\" target=\"_blank\"" " class=\"DAT_STRONG_%s\"", @@ -4012,7 +4012,7 @@ void Rec_UpdateMyInstitution (void) /* Get country of institution */ if (Ins.InsCod > 0) { - Ins_GetDataOfInstitByCod (&Ins); + Ins_GetInstitDataByCod (&Ins); if (Gbl.Usrs.Me.UsrDat.InsCtyCod != Ins.CtyCod) Gbl.Usrs.Me.UsrDat.InsCtyCod = Ins.CtyCod; } @@ -4048,7 +4048,7 @@ void Rec_UpdateMyCenter (void) /* Get institution of center */ if (Ctr.CtrCod > 0) { - Ctr_GetDataOfCenterByCod (&Ctr); + Ctr_GetCenterDataByCod (&Ctr); if (Gbl.Usrs.Me.UsrDat.InsCod != Ctr.InsCod) { Gbl.Usrs.Me.UsrDat.InsCod = Ctr.InsCod; @@ -4081,7 +4081,7 @@ void Rec_UpdateMyDepartment (void) /* Get institution of department */ if (Dpt.DptCod > 0) { - Dpt_GetDataOfDepartmentByCod (&Dpt); + Dpt_GetDepartmentDataByCod (&Dpt); if (Gbl.Usrs.Me.UsrDat.InsCod != Dpt.InsCod) { Gbl.Usrs.Me.UsrDat.InsCod = Dpt.InsCod; diff --git a/swad_report.c b/swad_report.c index 34373811..a773ded3 100644 --- a/swad_report.c +++ b/swad_report.c @@ -511,7 +511,7 @@ static void Rep_WriteSectionUsrInfo (void) /***** User's institution *****/ Ins.InsCod = Gbl.Usrs.Me.UsrDat.InsCod; - Ins_GetDataOfInstitByCod (&Ins); + Ins_GetInstitDataByCod (&Ins); fprintf (Rep_File,"
  • %s: %s
  • ", Txt_Institution, Ins.FullName); @@ -1041,11 +1041,11 @@ static void Rep_WriteRowCrsData (long CrsCod,Rol_Role_t Role, /***** Get course data *****/ Crs.CrsCod = CrsCod; - Crs_GetDataOfCourseByCod (&Crs); + Crs_GetCourseDataByCod (&Crs); /***** Get degree data *****/ Deg.DegCod = Crs.DegCod; - Deg_GetDataOfDegreeByCod (&Deg); + Deg_GetDegreeDataByCod (&Deg); /***** Begin row *****/ fprintf (Rep_File,"
  • "); diff --git a/swad_room.c b/swad_room.c index b1708fc2..1d575726 100644 --- a/swad_room.c +++ b/swad_room.c @@ -102,7 +102,7 @@ static void Roo_PutIconsListingRooms (__attribute__((unused)) void *Args); static void Roo_PutIconToEditRooms (void); static void Roo_PutIconsEditingRooms (__attribute__((unused)) void *Args); -static void Roo_GetDataOfRoomByCod (struct Roo_Room *Room); +static void Roo_GetRoomDataByCod (struct Roo_Room *Room); static void Roo_GetBldShrtName (struct Roo_Room *Room,const char *BldShrtNameFromDB); static Roo_RoomType_t Roo_GetTypeFromString (const char *Str); @@ -356,7 +356,7 @@ void Roo_ChangeMAC (void) NewMACnum = MAC_GetMACnumFromForm ("NewMAC"); /***** Get data of the room from database *****/ - Roo_GetDataOfRoomByCod (Roo_EditingRoom); + Roo_GetRoomDataByCod (Roo_EditingRoom); /***** Check if the new MAC is different from the old MAC *****/ if (OldMACnum) @@ -556,7 +556,7 @@ void Roo_GetListRooms (struct Roo_Rooms *Rooms,Roo_WhichData_t WhichData) /************* Get room data from database using the room code ***************/ /*****************************************************************************/ -static void Roo_GetDataOfRoomByCod (struct Roo_Room *Room) +static void Roo_GetRoomDataByCod (struct Roo_Room *Room) { MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -566,7 +566,7 @@ static void Roo_GetDataOfRoomByCod (struct Roo_Room *Room) return; /***** Get data of a room from database *****/ - if (Roo_DB_GetDataOfRoomByCod (&mysql_res,Room->RooCod)) // Room found... + if (Roo_DB_GetRoomDataByCod (&mysql_res,Room->RooCod)) // Room found... { /* Get row */ row = mysql_fetch_row (mysql_res); @@ -891,7 +891,7 @@ void Roo_RemoveRoom (void) Roo_EditingRoom->RooCod = ParCod_GetAndCheckPar (ParCod_Roo); /***** Get data of the room from database *****/ - Roo_GetDataOfRoomByCod (Roo_EditingRoom); + Roo_GetRoomDataByCod (Roo_EditingRoom); /***** Update groups assigned to this room *****/ Grp_DB_ResetRoomInGrps (Roo_EditingRoom->RooCod); @@ -926,7 +926,7 @@ void Roo_ChangeBuilding (void) NewBldCod = ParCod_GetAndCheckPar (ParCod_Bld); /***** Get data of the room from database *****/ - Roo_GetDataOfRoomByCod (Roo_EditingRoom); + Roo_GetRoomDataByCod (Roo_EditingRoom); /***** Check if the old building equals the new one (this happens when return is pressed without changes) *****/ @@ -943,7 +943,7 @@ void Roo_ChangeBuilding (void) Roo_DB_UpdateRoomBuilding (Roo_EditingRoom->RooCod,NewBldCod); /***** Get updated data of the room from database *****/ - Roo_GetDataOfRoomByCod (Roo_EditingRoom); + Roo_GetRoomDataByCod (Roo_EditingRoom); /***** Message to show the change made *****/ Ale_CreateAlert (Ale_SUCCESS,NULL, @@ -973,7 +973,7 @@ void Roo_ChangeFloor (void) NewFloor = Roo_GetParFloor (); /***** Get data of the room from database *****/ - Roo_GetDataOfRoomByCod (Roo_EditingRoom); + Roo_GetRoomDataByCod (Roo_EditingRoom); /***** Check if the old floor equals the new one (this happens when return is pressed without changes) *****/ @@ -988,7 +988,7 @@ void Roo_ChangeFloor (void) Roo_DB_UpdateRoomFloor (Roo_EditingRoom->RooCod,NewFloor); /***** Get updated data of the room from database *****/ - Roo_GetDataOfRoomByCod (Roo_EditingRoom); + Roo_GetRoomDataByCod (Roo_EditingRoom); /***** Message to show the change made *****/ Ale_CreateAlert (Ale_SUCCESS,NULL, @@ -1019,7 +1019,7 @@ void Roo_ChangeType (void) NewType = Roo_GetParType (); /***** Get data of the room from database *****/ - Roo_GetDataOfRoomByCod (Roo_EditingRoom); + Roo_GetRoomDataByCod (Roo_EditingRoom); /***** Check if the old type equals the new one (this happens when return is pressed without changes) *****/ @@ -1036,7 +1036,7 @@ void Roo_ChangeType (void) Roo_DB_UpdateRoomType (Roo_EditingRoom->RooCod,NewType); /***** Get updated data of the room from database *****/ - Roo_GetDataOfRoomByCod (Roo_EditingRoom); + Roo_GetRoomDataByCod (Roo_EditingRoom); /***** Message to show the change made *****/ Ale_CreateAlert (Ale_SUCCESS,NULL, @@ -1110,7 +1110,7 @@ static void Roo_RenameRoom (Cns_ShrtOrFullName_t ShrtOrFullName) Par_GetParText (ParName,NewClaName,MaxBytes); /***** Get from the database the old names of the room *****/ - Roo_GetDataOfRoomByCod (Roo_EditingRoom); + Roo_GetRoomDataByCod (Roo_EditingRoom); /***** Check if new name is empty *****/ if (NewClaName[0]) @@ -1174,7 +1174,7 @@ void Roo_ChangeCapacity (void) Roo_UNLIMITED_CAPACITY); /***** Get data of the room from database *****/ - Roo_GetDataOfRoomByCod (Roo_EditingRoom); + Roo_GetRoomDataByCod (Roo_EditingRoom); /***** Check if the old capacity equals the new one (this happens when return is pressed without changes) *****/ diff --git a/swad_room_database.c b/swad_room_database.c index ccba2c8d..ddc90129 100644 --- a/swad_room_database.c +++ b/swad_room_database.c @@ -283,7 +283,7 @@ bool Roo_DB_CheckIfRoomNameExists (long CtrCod,long RooCod, /************* Get room data from database using the room code ***************/ /*****************************************************************************/ -unsigned Roo_DB_GetDataOfRoomByCod (MYSQL_RES **mysql_res,long RooCod) +unsigned Roo_DB_GetRoomDataByCod (MYSQL_RES **mysql_res,long RooCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get data of a room", diff --git a/swad_room_database.h b/swad_room_database.h index 4fcba724..9e4d877c 100644 --- a/swad_room_database.h +++ b/swad_room_database.h @@ -43,7 +43,7 @@ unsigned Roo_DB_GetListRooms (MYSQL_RES **mysql_res, Roo_Order_t SelectedOrder); bool Roo_DB_CheckIfRoomNameExists (long CtrCod,long RooCod, const char *FldName,const char *Name); -unsigned Roo_DB_GetDataOfRoomByCod (MYSQL_RES **mysql_res,long RooCod); +unsigned Roo_DB_GetRoomDataByCod (MYSQL_RES **mysql_res,long RooCod); unsigned Roo_DB_GetMACAddresses (MYSQL_RES **mysql_res,long RooCod); void Roo_DB_RemoveRoom (long RooCod); diff --git a/swad_rubric.c b/swad_rubric.c index 4e8c0d25..ee4130d4 100644 --- a/swad_rubric.c +++ b/swad_rubric.c @@ -190,7 +190,7 @@ void Rub_ListAllRubrics (struct Rub_Rubrics *Rubrics) { /* Get data of this rubric */ Rubrics->Rubric.RubCod = Rubrics->Lst[NumRubric - 1]; - Rub_GetDataOfRubricByCod (&Rubrics->Rubric); + Rub_GetRubricDataByCod (&Rubrics->Rubric); /* Show a pair of rows with the main data of this rubric */ Rub_ShowRubricMainData (Rubrics, @@ -317,7 +317,7 @@ void Rub_SeeOneRubric (void) /***** Get parameters *****/ Rub_GetPars (&Rubrics,true); - Rub_GetDataOfRubricByCod (&Rubrics.Rubric); + Rub_GetRubricDataByCod (&Rubrics.Rubric); /***** Show rubric *****/ Rub_ShowOnlyOneRubric (&Rubrics, @@ -562,13 +562,13 @@ void Rub_GetListRubrics (struct Rub_Rubrics *Rubrics) /********************* Get rubric data using its code ************************/ /*****************************************************************************/ -void Rub_GetDataOfRubricByCod (struct Rub_Rubric *Rubric) +void Rub_GetRubricDataByCod (struct Rub_Rubric *Rubric) { MYSQL_RES *mysql_res; MYSQL_ROW row; /***** Get data of rubric from database *****/ - if (Rub_DB_GetDataOfRubricByCod (&mysql_res,Rubric->RubCod)) // Rubric found... + if (Rub_DB_GetRubricDataByCod (&mysql_res,Rubric->RubCod)) // Rubric found... { /* Get row */ row = mysql_fetch_row (mysql_res); @@ -632,7 +632,7 @@ void Rub_AskRemRubric (void) Rub_GetPars (&Rubrics,true); /***** Get data of the rubric from database *****/ - Rub_GetDataOfRubricByCod (&Rubrics.Rubric); + Rub_GetRubricDataByCod (&Rubrics.Rubric); if (!Rub_CheckIfICanEditRubrics ()) Err_NoPermissionExit (); @@ -666,7 +666,7 @@ void Rub_RemoveRubric (void) Rubrics.Rubric.RubCod = ParCod_GetAndCheckPar (ParCod_Rub); /***** Get data of the rubric from database *****/ - Rub_GetDataOfRubricByCod (&Rubrics.Rubric); + Rub_GetRubricDataByCod (&Rubrics.Rubric); if (!Rub_CheckIfICanEditRubrics ()) Err_NoPermissionExit (); @@ -726,7 +726,7 @@ void Rub_ListRubric (void) Rub_GetPars (&Rubrics,true); /***** Get rubric data *****/ - Rub_GetDataOfRubricByCod (&Rubrics.Rubric); + Rub_GetRubricDataByCod (&Rubrics.Rubric); Rub_DB_GetRubricTxt (Rubrics.Rubric.RubCod,Txt); /***** Show rubric *****/ @@ -763,7 +763,7 @@ void Rub_ReqCreatOrEditRubric (void) Rub_ResetRubric (&Rubrics.Rubric); else /* Get rubric data from database */ - Rub_GetDataOfRubricByCod (&Rubrics.Rubric); + Rub_GetRubricDataByCod (&Rubrics.Rubric); /***** Put form to create/edit a rubric and show criteria *****/ Rub_PutFormsOneRubric (&Rubrics,&Criterion,ItsANewRubric); @@ -904,7 +904,7 @@ void Rub_ReceiveFormRubric (void) // Some data, not received from form, // are necessary to show rubric and criteria again if (!ItsANewRubric) - Rub_GetDataOfRubricByCod (&Rubrics.Rubric); + Rub_GetRubricDataByCod (&Rubrics.Rubric); /***** Overwrite some rubric data with the data received from form *****/ Rub_ReceiveRubricFieldsFromForm (&Rubrics.Rubric,Txt); diff --git a/swad_rubric.h b/swad_rubric.h index 70384f19..cbad247f 100644 --- a/swad_rubric.h +++ b/swad_rubric.h @@ -59,8 +59,8 @@ void Rub_PutPars (void *Rubrics); void Rub_GetPars (struct Rub_Rubrics *Rubrics,bool CheckRubCod); void Rub_GetListRubrics (struct Rub_Rubrics *Rubrics); -void Rub_GetDataOfRubricByCod (struct Rub_Rubric *Rubric); -void Rub_GetDataOfRubricByFolder (struct Rub_Rubric *Rubric); +void Rub_GetRubricDataByCod (struct Rub_Rubric *Rubric); +void Rub_GetRubricDataByFolder (struct Rub_Rubric *Rubric); void Rub_FreeListRubrics (struct Rub_Rubrics *Rubrics); void Rub_AskRemRubric (void); diff --git a/swad_rubric_criteria.c b/swad_rubric_criteria.c index 405719b0..e1f55fe0 100644 --- a/swad_rubric_criteria.c +++ b/swad_rubric_criteria.c @@ -109,7 +109,7 @@ static void RubCri_PutParsOneCriterion (void *Rubrics) /******************** Get criterion data using its code **********************/ /*****************************************************************************/ -void RubCri_GetDataOfCriterionByCod (struct RubCri_Criterion *Criterion) +void RubCri_GetCriterionDataByCod (struct RubCri_Criterion *Criterion) { MYSQL_RES *mysql_res; @@ -122,7 +122,7 @@ void RubCri_GetDataOfCriterionByCod (struct RubCri_Criterion *Criterion) } /***** Get data of rubric criterion from database *****/ - if (Rub_DB_GetDataOfCriterionByCod (&mysql_res,Criterion->CriCod)) // Criterion found... + if (Rub_DB_GetCriterionDataByCod (&mysql_res,Criterion->CriCod)) // Criterion found... RubCri_GetCriterionDataFromRow (mysql_res,Criterion); else /* Initialize to empty criterion */ @@ -228,7 +228,7 @@ void RubCri_ReceiveFormCriterion (void) Criterion.RubCod = Rubrics.Rubric.RubCod; /***** Get rubric data from database *****/ - Rub_GetDataOfRubricByCod (&Rubrics.Rubric); + Rub_GetRubricDataByCod (&Rubrics.Rubric); /***** Check if rubric is editable *****/ if (!Rub_CheckIfEditable (&Rubrics.Rubric)) @@ -1014,12 +1014,12 @@ static void RubCri_GetAndCheckPars (struct Rub_Rubrics *Rubrics, Criterion->CriCod = ParCod_GetAndCheckPar (ParCod_Cri); /***** Get rubric data from database *****/ - Rub_GetDataOfRubricByCod (&Rubrics->Rubric); + Rub_GetRubricDataByCod (&Rubrics->Rubric); if (Rubrics->Rubric.CrsCod != Gbl.Hierarchy.Crs.CrsCod) Err_WrongRubricExit (); /***** Get criterion data from database *****/ - RubCri_GetDataOfCriterionByCod (Criterion); + RubCri_GetCriterionDataByCod (Criterion); if (Criterion->RubCod != Rubrics->Rubric.RubCod) Err_WrongCriterionExit (); Rubrics->CriCod = Criterion->CriCod; diff --git a/swad_rubric_criteria.h b/swad_rubric_criteria.h index d6d1067b..aade5d20 100644 --- a/swad_rubric_criteria.h +++ b/swad_rubric_criteria.h @@ -33,7 +33,7 @@ /***************************** Public prototypes *****************************/ /*****************************************************************************/ -void RubCri_GetDataOfCriterionByCod (struct RubCri_Criterion *Criterion); +void RubCri_GetCriterionDataByCod (struct RubCri_Criterion *Criterion); void RubCri_ReceiveFormCriterion (void); void RubCri_ChangeCriterionTitle (void); diff --git a/swad_rubric_database.c b/swad_rubric_database.c index d2ddb4a6..e0b5a187 100644 --- a/swad_rubric_database.c +++ b/swad_rubric_database.c @@ -109,7 +109,7 @@ unsigned Rub_DB_GetListRubrics (MYSQL_RES **mysql_res) /********************* Get rubric data using its code ************************/ /*****************************************************************************/ -unsigned Rub_DB_GetDataOfRubricByCod (MYSQL_RES **mysql_res,long RubCod) +unsigned Rub_DB_GetRubricDataByCod (MYSQL_RES **mysql_res,long RubCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get rubric data", @@ -609,7 +609,7 @@ unsigned Rub_DB_GetCriteria (MYSQL_RES **mysql_res,long RubCod) /***************** Get rubric criterion data using its code ******************/ /*****************************************************************************/ -unsigned Rub_DB_GetDataOfCriterionByCod (MYSQL_RES **mysql_res,long CriCod) +unsigned Rub_DB_GetCriterionDataByCod (MYSQL_RES **mysql_res,long CriCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get criterion data", diff --git a/swad_rubric_database.h b/swad_rubric_database.h index 89453f3f..a5d77ef7 100644 --- a/swad_rubric_database.h +++ b/swad_rubric_database.h @@ -43,7 +43,7 @@ void Rub_DB_UpdateRubric (const struct Rub_Rubric *Rubric,const char *Txt); void Rub_DB_HideOrUnhideRubric (long RubCod,bool Hide); unsigned Rub_DB_GetListRubrics (MYSQL_RES **mysql_res); -unsigned Rub_DB_GetDataOfRubricByCod (MYSQL_RES **mysql_res,long RubCod); +unsigned Rub_DB_GetRubricDataByCod (MYSQL_RES **mysql_res,long RubCod); void Rub_DB_GetRubricTitle (long RubCod,char Title[Rub_MAX_BYTES_TITLE + 1]); void Rub_DB_GetRubricTxt (long RubCod,char Txt[Cns_MAX_BYTES_TEXT + 1]); bool Rub_DB_CheckIfSimilarRubricExists (const struct Rub_Rubric *Rubric); @@ -71,7 +71,7 @@ unsigned Rub_DB_GetMaxCriterionIndexInRubric (long RubCod); unsigned Rub_DB_GetPrevCriterionIndexInRubric (long RubCod,unsigned QstInd); unsigned Rub_DB_GetNextCriterionIndexInRubric (long RubCod,unsigned QstInd); unsigned Rub_DB_GetCriteria (MYSQL_RES **mysql_res,long RubCod); -unsigned Rub_DB_GetDataOfCriterionByCod (MYSQL_RES **mysql_res,long CriCod); +unsigned Rub_DB_GetCriterionDataByCod (MYSQL_RES **mysql_res,long CriCod); bool Rub_DB_CheckIfSimilarCriterionExists (const struct RubCri_Criterion *Criterion, const char Title[RubCri_MAX_BYTES_TITLE + 1]); diff --git a/swad_statistic.c b/swad_statistic.c index b4ccb66c..dcdc2137 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -2740,7 +2740,7 @@ static void Sta_ShowNumHitsPerPlugin (Sta_CountType_t CountType, if (sscanf (row[0],"%ld",&Plg.PlgCod) != 1) Err_WrongPluginExit (); HTM_TD_Begin ("class=\"RT LOG_%s\"",The_GetSuffix ()); - if (Plg_GetDataOfPluginByCod (&Plg)) + if (Plg_GetPluginDataByCod (&Plg)) HTM_Txt (Plg.Name); else HTM_Txt ("?"); @@ -2857,7 +2857,7 @@ static void Sta_ShowNumHitsPerBanner (Sta_CountType_t CountType, /* Write the banner */ if (sscanf (row[0],"%ld",&(Ban.BanCod)) != 1) Err_WrongBannerExit (); - Ban_GetDataOfBannerByCod (&Ban); + Ban_GetBannerDataByCod (&Ban); HTM_TD_Begin ("class=\"LT LOG_%s\"",The_GetSuffix ()); HTM_A_Begin ("href=\"%s\" title=\"%s\" target=\"_blank\"" " class=\"DAT_%s\"", @@ -2951,7 +2951,7 @@ static void Sta_WriteCountry (long CtyCod) { /***** Get data of country *****/ Cty.CtyCod = CtyCod; - Cty_GetDataOfCountryByCod (&Cty); + Cty_GetCountryDataByCod (&Cty); /***** Form to go to country *****/ Cty_DrawCountryMapAndNameWithLink (&Cty,ActSeeCtyInf, @@ -3037,7 +3037,7 @@ static void Sta_WriteInstit (long InsCod) { /***** Get data of institution *****/ Ins.InsCod = InsCod; - Ins_GetDataOfInstitByCod (&Ins); + Ins_GetInstitDataByCod (&Ins); /***** Title in cell *****/ HTM_TD_Begin ("class=\"LM LOG_%s\" title=\"%s\"", @@ -3128,7 +3128,7 @@ static void Sta_WriteCenter (long CtrCod) { /***** Get data of center *****/ Ctr.CtrCod = CtrCod; - Ctr_GetDataOfCenterByCod (&Ctr); + Ctr_GetCenterDataByCod (&Ctr); /***** Title in cell *****/ HTM_TD_Begin ("class=\"LM LOG_%s\" title=\"%s\"", @@ -3219,7 +3219,7 @@ static void Sta_WriteDegree (long DegCod) { /***** Get data of degree *****/ Deg.DegCod = DegCod; - Deg_GetDataOfDegreeByCod (&Deg); + Deg_GetDegreeDataByCod (&Deg); /***** Title in cell *****/ HTM_TD_Begin ("class=\"LM LOG_%s\" title=\"%s\"", @@ -3285,7 +3285,7 @@ static void Sta_ShowNumHitsPerCourse (Sta_CountType_t CountType, Crs.CrsCod = Str_ConvertStrCodToLongCod (row[0]); /* Get data of current degree */ - CrsOK = Crs_GetDataOfCourseByCod (&Crs); + CrsOK = Crs_GetCourseDataByCod (&Crs); HTM_TR_Begin (NULL); diff --git a/swad_survey.c b/swad_survey.c index 9df73d8e..7d998a09 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -441,7 +441,7 @@ static void Svy_ShowOneSurvey (struct Svy_Surveys *Surveys, char Txt[Cns_MAX_BYTES_TEXT + 1]; /***** Get data of this survey *****/ - Svy_GetDataOfSurveyByCod (&Surveys->Svy); + Svy_GetSurveyDataByCod (&Surveys->Svy); /***** Begin box *****/ if (ShowOnlyThisSvyComplete) @@ -1157,13 +1157,13 @@ static void Svy_SetAllowedAndHiddenScopes (unsigned *ScopesAllowed, /********************* Get survey data using its code ************************/ /*****************************************************************************/ -void Svy_GetDataOfSurveyByCod (struct Svy_Survey *Svy) +void Svy_GetSurveyDataByCod (struct Svy_Survey *Svy) { MYSQL_RES *mysql_res; MYSQL_ROW row; /***** Get data of survey from database *****/ - if (Svy_DB_GetDataOfSurveyByCod (&mysql_res,Svy->SvyCod)) // Survey found... + if (Svy_DB_GetSurveyDataByCod (&mysql_res,Svy->SvyCod)) // Survey found... { /* Get row */ row = mysql_fetch_row (mysql_res); @@ -1426,7 +1426,7 @@ void Svy_AskRemSurvey (void) Surveys.Svy.SvyCod = ParCod_GetAndCheckPar (ParCod_Svy); /***** Get data of the survey from database *****/ - Svy_GetDataOfSurveyByCod (&Surveys.Svy); + Svy_GetSurveyDataByCod (&Surveys.Svy); if (!Surveys.Svy.Status.ICanEdit) Err_NoPermissionExit (); @@ -1462,7 +1462,7 @@ void Svy_RemoveSurvey (void) Surveys.Svy.SvyCod = ParCod_GetAndCheckPar (ParCod_Svy); /***** Get data of the survey from database *****/ - Svy_GetDataOfSurveyByCod (&Surveys.Svy); + Svy_GetSurveyDataByCod (&Surveys.Svy); if (!Surveys.Svy.Status.ICanEdit) Err_NoPermissionExit (); @@ -1514,7 +1514,7 @@ void Svy_AskResetSurvey (void) Surveys.Svy.SvyCod = ParCod_GetAndCheckPar (ParCod_Svy); /***** Get data of the survey from database *****/ - Svy_GetDataOfSurveyByCod (&Surveys.Svy); + Svy_GetSurveyDataByCod (&Surveys.Svy); if (!Surveys.Svy.Status.ICanEdit) Err_NoPermissionExit (); @@ -1550,7 +1550,7 @@ void Svy_ResetSurvey (void) Surveys.Svy.SvyCod = ParCod_GetAndCheckPar (ParCod_Svy); /***** Get data of the survey from database *****/ - Svy_GetDataOfSurveyByCod (&Surveys.Svy); + Svy_GetSurveyDataByCod (&Surveys.Svy); if (!Surveys.Svy.Status.ICanEdit) Err_NoPermissionExit (); @@ -1588,7 +1588,7 @@ void Svy_HideSurvey (void) Surveys.Svy.SvyCod = ParCod_GetAndCheckPar (ParCod_Svy); /***** Get data of the survey from database *****/ - Svy_GetDataOfSurveyByCod (&Surveys.Svy); + Svy_GetSurveyDataByCod (&Surveys.Svy); if (!Surveys.Svy.Status.ICanEdit) Err_NoPermissionExit (); @@ -1619,7 +1619,7 @@ void Svy_UnhideSurvey (void) Surveys.Svy.SvyCod = ParCod_GetAndCheckPar (ParCod_Svy); /***** Get data of the survey from database *****/ - Svy_GetDataOfSurveyByCod (&Surveys.Svy); + Svy_GetSurveyDataByCod (&Surveys.Svy); if (!Surveys.Svy.Status.ICanEdit) Err_NoPermissionExit (); @@ -1694,7 +1694,7 @@ void Svy_ReqCreatOrEditSvy (void) else { /* Get data of the survey from database */ - Svy_GetDataOfSurveyByCod (&Surveys.Svy); + Svy_GetSurveyDataByCod (&Surveys.Svy); if (!Surveys.Svy.Status.ICanEdit) Err_NoPermissionExit (); @@ -1986,7 +1986,7 @@ void Svy_ReceiveFormSurvey (void) { /* Get data of the old (current) survey from database */ OldSvy.SvyCod = NewSvy.SvyCod; - Svy_GetDataOfSurveyByCod (&OldSvy); + Svy_GetSurveyDataByCod (&OldSvy); if (!OldSvy.Status.ICanEdit) Err_NoPermissionExit (); NewSvy.Scope = OldSvy.Scope; @@ -3199,7 +3199,7 @@ void Svy_ReceiveSurveyAnswers (void) Surveys.Svy.SvyCod = ParCod_GetAndCheckPar (ParCod_Svy); /***** Get data of the survey from database *****/ - Svy_GetDataOfSurveyByCod (&Surveys.Svy); + Svy_GetSurveyDataByCod (&Surveys.Svy); /***** Check if I have no answered this survey formerly *****/ if (Surveys.Svy.Status.IHaveAnswered) diff --git a/swad_survey.h b/swad_survey.h index 1f4c293e..6e4fd966 100644 --- a/swad_survey.h +++ b/swad_survey.h @@ -94,8 +94,8 @@ void Svy_ListAllSurveys (struct Svy_Surveys *Surveys); void Svy_SeeOneSurvey (void); void Svy_PutParSvyOrder (Dat_StartEndTime_t SelectedOrder); void Svy_ReqCreatOrEditSvy (void); -void Svy_GetDataOfSurveyByCod (struct Svy_Survey *Svy); -void Svy_GetDataOfSurveyByFolder (struct Svy_Survey *Svy); +void Svy_GetSurveyDataByCod (struct Svy_Survey *Svy); +void Svy_GetSurveyDataByFolder (struct Svy_Survey *Svy); void Svy_FreeListSurveys (struct Svy_Surveys *Surveys); void Svy_GetNotifSurvey (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], char **ContentStr, diff --git a/swad_survey_database.c b/swad_survey_database.c index ec2b5cba..a91de634 100644 --- a/swad_survey_database.c +++ b/swad_survey_database.c @@ -267,7 +267,7 @@ unsigned Svy_DB_GetListSurveys (MYSQL_RES **mysql_res, /********************* Get survey data using its code ************************/ /*****************************************************************************/ -unsigned Svy_DB_GetDataOfSurveyByCod (MYSQL_RES **mysql_res,long SvyCod) +unsigned Svy_DB_GetSurveyDataByCod (MYSQL_RES **mysql_res,long SvyCod) { return (unsigned) DB_QuerySELECT (mysql_res,"can not get survey data", diff --git a/swad_survey_database.h b/swad_survey_database.h index 85add109..26750377 100644 --- a/swad_survey_database.h +++ b/swad_survey_database.h @@ -47,7 +47,7 @@ unsigned Svy_DB_GetListSurveys (MYSQL_RES **mysql_res, unsigned ScopesAllowed, unsigned HiddenAllowed, Dat_StartEndTime_t SelectedOrder); -unsigned Svy_DB_GetDataOfSurveyByCod (MYSQL_RES **mysql_res,long SvyCod); +unsigned Svy_DB_GetSurveyDataByCod (MYSQL_RES **mysql_res,long SvyCod); void Svy_DB_GetSurveyTitle (long SvyCod,char Title[Svy_MAX_BYTES_SURVEY_TITLE + 1]); unsigned Svy_DB_GetSurveyTitleAndText (MYSQL_RES **mysql_res,long SvyCod); void Svy_DB_GetSurveyTxt (long SvyCod,char Txt[Cns_MAX_BYTES_TEXT + 1]); diff --git a/swad_system_config.c b/swad_system_config.c index f2474c86..2e38fda8 100644 --- a/swad_system_config.c +++ b/swad_system_config.c @@ -227,11 +227,11 @@ static void SysCfg_Map (void) Ctr.CtrCod = DB_GetNextCode (mysql_res); /* Get data of center */ - Ctr_GetDataOfCenterByCod (&Ctr); + Ctr_GetCenterDataByCod (&Ctr); /* Get data of institution */ Ins.InsCod = Ctr.InsCod; - Ins_GetDataOfInstitByCod (&Ins); + Ins_GetInstitDataByCod (&Ins); /* Add marker */ Map_AddMarker (&Ctr.Coord); diff --git a/swad_test.c b/swad_test.c index 43dd1796..7ab64feb 100644 --- a/swad_test.c +++ b/swad_test.c @@ -573,7 +573,7 @@ static void Tst_GenerateChoiceIndexes (struct TstPrn_PrintedQuestion *PrintedQue Question.QstCod = PrintedQuestion->QstCod; /***** Get answers of question from database *****/ - Question.Answer.NumOptions = Qst_DB_GetDataOfAnswers (&mysql_res,Question.QstCod,Shuffle); + Question.Answer.NumOptions = Qst_DB_GetAnswersData (&mysql_res,Question.QstCod,Shuffle); /* row[0] AnsInd row[1] Answer diff --git a/swad_timeline.c b/swad_timeline.c index 0cb132c5..e3066fc2 100644 --- a/swad_timeline.c +++ b/swad_timeline.c @@ -487,7 +487,7 @@ static unsigned Tml_ListRecentPubs (const struct Tml_Timeline *Timeline, { /* Get data of note */ Not.NotCod = Pub->NotCod; - TmlNot_GetDataOfNoteByCod (&Not); + TmlNot_GetNoteDataByCod (&Not); /* Write list item (note) */ if (Not.NotCod == NotCodToHighlight) diff --git a/swad_timeline_comment.c b/swad_timeline_comment.c index 10685eef..d1e27533 100644 --- a/swad_timeline_comment.c +++ b/swad_timeline_comment.c @@ -764,7 +764,7 @@ static long TmlCom_ReceiveComm (void) /***** Get data of note *****/ Not.NotCod = ParCod_GetAndCheckPar (ParCod_Not); - TmlNot_GetDataOfNoteByCod (&Not); + TmlNot_GetNoteDataByCod (&Not); /***** Trivial check: note code *****/ if (Not.NotCod <= 0) @@ -870,7 +870,7 @@ static void TmlCom_RequestRemovalComm (struct Tml_Timeline *Timeline) /***** Get data of comment *****/ Com.PubCod = ParCod_GetAndCheckPar (ParCod_Pub); - TmlCom_GetDataOfCommByCod (&Com); + TmlCom_GetCommDataByCod (&Com); /***** Do some checks *****/ if (!TmlUsr_CheckIfICanRemove (Com.PubCod,Com.UsrCod)) @@ -980,7 +980,7 @@ static void TmlCom_RemoveComm (void) /***** Get data of comment *****/ Com.PubCod = ParCod_GetAndCheckPar (ParCod_Pub); - TmlCom_GetDataOfCommByCod (&Com); + TmlCom_GetCommDataByCod (&Com); /***** Trivial check 1: publication code *****/ if (Com.PubCod <= 0) @@ -1040,7 +1040,7 @@ void TmlCom_RemoveCommMediaAndDBEntries (long PubCod) /******************* Get data of comment using its code **********************/ /*****************************************************************************/ -void TmlCom_GetDataOfCommByCod (struct TmlCom_Comment *Com) +void TmlCom_GetCommDataByCod (struct TmlCom_Comment *Com) { MYSQL_RES *mysql_res; @@ -1053,7 +1053,7 @@ void TmlCom_GetDataOfCommByCod (struct TmlCom_Comment *Com) } /***** Get data of comment from database *****/ - if (Tml_DB_GetDataOfCommByCod (Com->PubCod,&mysql_res)) + if (Tml_DB_GetCommDataByCod (Com->PubCod,&mysql_res)) TmlCom_GetCommDataFromRow (mysql_res,Com); else /* Reset fields of comment */ diff --git a/swad_timeline_comment.h b/swad_timeline_comment.h index e9a1c56d..c1f070ca 100644 --- a/swad_timeline_comment.h +++ b/swad_timeline_comment.h @@ -72,6 +72,6 @@ void TmlCom_RemoveComGbl (void); void TmlCom_RemoveCommMediaAndDBEntries (long PubCod); -void TmlCom_GetDataOfCommByCod (struct TmlCom_Comment *Com); +void TmlCom_GetCommDataByCod (struct TmlCom_Comment *Com); #endif diff --git a/swad_timeline_database.c b/swad_timeline_database.c index b99aac4a..6d4ba31c 100644 --- a/swad_timeline_database.c +++ b/swad_timeline_database.c @@ -104,7 +104,7 @@ void Tml_DB_UpdateWho (Usr_Who_t Who) /*****************************************************************************/ // Returns the number of rows got -unsigned Tml_DB_GetDataOfNoteByCod (long NotCod,MYSQL_RES **mysql_res) +unsigned Tml_DB_GetNoteDataByCod (long NotCod,MYSQL_RES **mysql_res) { /***** Trivial check: note code should be > 0 *****/ if (NotCod <= 0) @@ -712,7 +712,7 @@ unsigned Tml_DB_GetFinalComms (long NotCod,unsigned NumFinalCommsToGet, /*****************************************************************************/ // Returns the number of rows got -unsigned Tml_DB_GetDataOfCommByCod (long PubCod,MYSQL_RES **mysql_res) +unsigned Tml_DB_GetCommDataByCod (long PubCod,MYSQL_RES **mysql_res) { /***** Trivial check: publication code should be > 0 *****/ if (PubCod <= 0) @@ -944,7 +944,7 @@ unsigned Tml_DB_SelectTheMostRecentPub (MYSQL_RES **mysql_res, /*****************************************************************************/ // Returns the number of rows got -unsigned Tml_DB_GetDataOfPubByCod (long PubCod,MYSQL_RES **mysql_res) +unsigned Tml_DB_GetPubDataByCod (long PubCod,MYSQL_RES **mysql_res) { /***** Trivial check: publication code should be > 0 *****/ if (PubCod <= 0) diff --git a/swad_timeline_database.h b/swad_timeline_database.h index 3008bb57..8b19acb6 100644 --- a/swad_timeline_database.h +++ b/swad_timeline_database.h @@ -44,7 +44,7 @@ unsigned Tml_DB_GetWho (MYSQL_RES **mysql_res); void Tml_DB_UpdateWho (Usr_Who_t Who); /*********************************** Notes ***********************************/ -unsigned Tml_DB_GetDataOfNoteByCod (long NotCod,MYSQL_RES **mysql_res); +unsigned Tml_DB_GetNoteDataByCod (long NotCod,MYSQL_RES **mysql_res); long Tml_DB_GetPubCodOfOriginalNote (long NotCod); long Tml_DB_CreateNewNote (TmlNot_Type_t NoteType,long Cod, long PublisherCod,long HieCod); @@ -82,7 +82,7 @@ unsigned Tml_DB_GetInitialComms (long NotCod,unsigned NumInitialCommsToGet, MYSQL_RES **mysql_res); unsigned Tml_DB_GetFinalComms (long NotCod,unsigned NumFinalCommsToGet, MYSQL_RES **mysql_res); -unsigned Tml_DB_GetDataOfCommByCod (long PubCod,MYSQL_RES **mysql_res); +unsigned Tml_DB_GetCommDataByCod (long PubCod,MYSQL_RES **mysql_res); void Tml_DB_InsertCommContent (long PubCod, const struct TmlPst_Content *Content); long Tml_DB_GetMedCodFromComm (long PubCod); @@ -100,7 +100,7 @@ void Tml_DB_CreateSubQueryRange (TmlPub_Range_t Range,long PubCod, char SubQuery[TmlPub_MAX_BYTES_SUBQUERY + 1]); unsigned Tml_DB_SelectTheMostRecentPub (MYSQL_RES **mysql_res, const struct TmlPub_SubQueries *SubQueries); -unsigned Tml_DB_GetDataOfPubByCod (long PubCod,MYSQL_RES **mysql_res); +unsigned Tml_DB_GetPubDataByCod (long PubCod,MYSQL_RES **mysql_res); long Tml_DB_GetNotCodFromPubCod (long PubCod); long Tml_DB_GetPubCodFromSession (TmlPub_FirstLast_t FirstLast); unsigned Tml_DB_GetNumPubsUsr (long UsrCod); diff --git a/swad_timeline_favourite.c b/swad_timeline_favourite.c index 30ba368f..98eb1c39 100644 --- a/swad_timeline_favourite.c +++ b/swad_timeline_favourite.c @@ -70,7 +70,7 @@ void TmlFav_ShowAllFaversNoteGbl (void) /***** Get data of note *****/ Not.NotCod = ParCod_GetAndCheckPar (ParCod_Not); - TmlNot_GetDataOfNoteByCod (&Not); + TmlNot_GetNoteDataByCod (&Not); /***** Write HTML inside DIV with form to fav/unfav *****/ TmlUsr_PutIconFavSha (TmlUsr_FAV_UNF_NOTE, @@ -132,7 +132,7 @@ static void TmlFav_FavNote (struct TmlNot_Note *Not) /***** Get data of note *****/ Not->NotCod = ParCod_GetAndCheckPar (ParCod_Not); - TmlNot_GetDataOfNoteByCod (Not); + TmlNot_GetNoteDataByCod (Not); /***** Do some checks *****/ if (!TmlUsr_CheckIfICanFavSha (Not->NotCod,Not->UsrCod)) @@ -162,7 +162,7 @@ static void TmlFav_UnfNote (struct TmlNot_Note *Not) /***** Get data of note *****/ Not->NotCod = ParCod_GetAndCheckPar (ParCod_Not); - TmlNot_GetDataOfNoteByCod (Not); + TmlNot_GetNoteDataByCod (Not); /***** Do some checks *****/ if (!TmlUsr_CheckIfICanFavSha (Not->NotCod,Not->UsrCod)) @@ -205,7 +205,7 @@ void TmlFav_ShowAllFaversComGbl (void) /***** Get data of comment *****/ Med_MediaConstructor (&Com.Content.Media); Com.PubCod = ParCod_GetAndCheckPar (ParCod_Pub); - TmlCom_GetDataOfCommByCod (&Com); + TmlCom_GetCommDataByCod (&Com); Med_MediaDestructor (&Com.Content.Media); /***** Write HTML inside DIV with form to fav/unfav *****/ @@ -269,7 +269,7 @@ static void TmlFav_FavComm (struct TmlCom_Comment *Com) /***** Get data of comment *****/ Com->PubCod = ParCod_GetAndCheckPar (ParCod_Pub); - TmlCom_GetDataOfCommByCod (Com); + TmlCom_GetCommDataByCod (Com); /***** Do some checks *****/ if (!TmlUsr_CheckIfICanFavSha (Com->PubCod,Com->UsrCod)) @@ -308,7 +308,7 @@ static void TmlFav_UnfComm (struct TmlCom_Comment *Com) /***** Get data of comment *****/ Com->PubCod = ParCod_GetAndCheckPar (ParCod_Pub); - TmlCom_GetDataOfCommByCod (Com); + TmlCom_GetCommDataByCod (Com); /***** Do some checks *****/ if (!TmlUsr_CheckIfICanFavSha (Com->PubCod,Com->UsrCod)) diff --git a/swad_timeline_note.c b/swad_timeline_note.c index c6fc63c3..8526271d 100644 --- a/swad_timeline_note.c +++ b/swad_timeline_note.c @@ -149,7 +149,7 @@ void TmlNot_ShowHighlightedNote (struct Tml_Timeline *Timeline, NotifyEvent = Ntf_GetParNotifyEvent (); /***** Get data of the note *****/ - TmlNot_GetDataOfNoteByCod (Not); + TmlNot_GetNoteDataByCod (Not); /***** Show the note highlighted *****/ /* Begin box */ @@ -438,19 +438,19 @@ static void TmlNot_GetLocationInHierarchy (const struct TmlNot_Note *Not, case TmlNot_INS_SHA_PUB_FILE: /* Get institution data */ Hie->Ins.InsCod = Not->HieCod; - Ins_GetDataOfInstitByCod (&Hie->Ins); + Ins_GetInstitDataByCod (&Hie->Ins); break; case TmlNot_CTR_DOC_PUB_FILE: case TmlNot_CTR_SHA_PUB_FILE: /* Get center data */ Hie->Ctr.CtrCod = Not->HieCod; - Ctr_GetDataOfCenterByCod (&Hie->Ctr); + Ctr_GetCenterDataByCod (&Hie->Ctr); break; case TmlNot_DEG_DOC_PUB_FILE: case TmlNot_DEG_SHA_PUB_FILE: /* Get degree data */ Hie->Deg.DegCod = Not->HieCod; - Deg_GetDataOfDegreeByCod (&Hie->Deg); + Deg_GetDegreeDataByCod (&Hie->Deg); break; case TmlNot_CRS_DOC_PUB_FILE: case TmlNot_CRS_SHA_PUB_FILE: @@ -458,7 +458,7 @@ static void TmlNot_GetLocationInHierarchy (const struct TmlNot_Note *Not, case TmlNot_NOTICE: /* Get course data */ Hie->Crs.CrsCod = Not->HieCod; - Crs_GetDataOfCourseByCod (&Hie->Crs); + Crs_GetCourseDataByCod (&Hie->Crs); break; case TmlNot_FORUM_POST: /* Get forum type of the post */ @@ -1011,7 +1011,7 @@ static void TmlNot_ReqRemNote (struct Tml_Timeline *Timeline) /***** Get data of note *****/ Not.NotCod = ParCod_GetAndCheckPar (ParCod_Not); - TmlNot_GetDataOfNoteByCod (&Not); + TmlNot_GetNoteDataByCod (&Not); /***** Do some checks *****/ if (!TmlUsr_CheckIfICanRemove (Not.NotCod,Not.UsrCod)) @@ -1106,7 +1106,7 @@ static void TmlNot_RemoveNote (void) /***** Get data of note *****/ Not.NotCod = ParCod_GetAndCheckPar (ParCod_Not); - TmlNot_GetDataOfNoteByCod (&Not); + TmlNot_GetNoteDataByCod (&Not); /***** Trivial check 1: note code should be > 0 *****/ if (Not.NotCod <= 0) @@ -1272,7 +1272,7 @@ static void TmlNot_ResetNote (struct TmlNot_Note *Not) /******************** Get data of note using its code ************************/ /*****************************************************************************/ -void TmlNot_GetDataOfNoteByCod (struct TmlNot_Note *Not) +void TmlNot_GetNoteDataByCod (struct TmlNot_Note *Not) { MYSQL_RES *mysql_res; @@ -1285,7 +1285,7 @@ void TmlNot_GetDataOfNoteByCod (struct TmlNot_Note *Not) } /***** Get data of note from database *****/ - if (Tml_DB_GetDataOfNoteByCod (Not->NotCod,&mysql_res)) + if (Tml_DB_GetNoteDataByCod (Not->NotCod,&mysql_res)) TmlNot_GetNoteDataFromRow (mysql_res,Not); else /* Reset fields of note */ diff --git a/swad_timeline_note.h b/swad_timeline_note.h index ffaf6cff..e5633362 100644 --- a/swad_timeline_note.h +++ b/swad_timeline_note.h @@ -111,6 +111,6 @@ void TmlNot_ReqRemNoteGbl (void); void TmlNot_RemoveNoteUsr (void); void TmlNot_RemoveNoteGbl (void); -void TmlNot_GetDataOfNoteByCod (struct TmlNot_Note *Not); +void TmlNot_GetNoteDataByCod (struct TmlNot_Note *Not); #endif diff --git a/swad_timeline_notification.c b/swad_timeline_notification.c index 50799a0c..d3ceb81c 100644 --- a/swad_timeline_notification.c +++ b/swad_timeline_notification.c @@ -106,9 +106,9 @@ void TmlNtf_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], Content.Txt[0] = '\0'; /***** Get summary and content from post from database *****/ - if (Tml_DB_GetDataOfPubByCod (PubCod,&mysql_res) == 1) // Result should have a unique row + if (Tml_DB_GetPubDataByCod (PubCod,&mysql_res) == 1) // Result should have a unique row /* Get data of publication from row */ - TmlPub_GetDataOfPubFromNextRow (mysql_res,&Pub); + TmlPub_GetPubDataFromNextRow (mysql_res,&Pub); /***** Free structure that stores the query result *****/ DB_FreeMySQLResult (&mysql_res); @@ -122,7 +122,7 @@ void TmlNtf_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], case TmlPub_SHARED_NOTE: /* Get data of note */ Not.NotCod = Pub.NotCod; - TmlNot_GetDataOfNoteByCod (&Not); + TmlNot_GetNoteDataByCod (&Not); if (Not.Type == TmlNot_POST) { @@ -159,7 +159,7 @@ void TmlNtf_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], break; case TmlPub_COMMENT_TO_NOTE: /***** Get content of comment from database *****/ - if (Tml_DB_GetDataOfCommByCod (Pub.PubCod,&mysql_res) == 1) // Result should have a unique row + if (Tml_DB_GetCommDataByCod (Pub.PubCod,&mysql_res) == 1) // Result should have a unique row { /* Get row */ row = mysql_fetch_row (mysql_res); diff --git a/swad_timeline_publication.c b/swad_timeline_publication.c index a2daa02d..114ae705 100644 --- a/swad_timeline_publication.c +++ b/swad_timeline_publication.c @@ -361,7 +361,7 @@ static struct TmlPub_Publication *TmlPub_SelectTheMostRecentPub (const struct Tm Err_NotEnoughMemoryExit (); /* Get data of publication */ - TmlPub_GetDataOfPubFromNextRow (mysql_res,Pub); + TmlPub_GetPubDataFromNextRow (mysql_res,Pub); Pub->Next = NULL; } else @@ -390,7 +390,7 @@ void TmlPub_InsertNewPubsInTimeline (struct Tml_Timeline *Timeline) { /* Get data of note */ Not.NotCod = Pub->NotCod; - TmlNot_GetDataOfNoteByCod (&Not); + TmlNot_GetNoteDataByCod (&Not); /* Write note */ HTM_LI_Begin ("class=\"Tml_WIDTH Tml_SEP Tml_NEW_PUB_%s\"" @@ -421,7 +421,7 @@ void TmlPub_ShowOldPubsInTimeline (struct Tml_Timeline *Timeline) { /* Get data of note */ Not.NotCod = Pub->NotCod; - TmlNot_GetDataOfNoteByCod (&Not); + TmlNot_GetNoteDataByCod (&Not); /* Write note */ HTM_LI_Begin ("class=\"Tml_WIDTH Tml_SEP\""); @@ -510,7 +510,7 @@ void TmlPub_PutLinkToViewOldPubs (void) /***************** Get data of publication using its code ********************/ /*****************************************************************************/ -void TmlPub_GetDataOfPubFromNextRow (MYSQL_RES *mysql_res, +void TmlPub_GetPubDataFromNextRow (MYSQL_RES *mysql_res, struct TmlPub_Publication *Pub) { MYSQL_ROW row; diff --git a/swad_timeline_publication.h b/swad_timeline_publication.h index 47672682..06a09ca7 100644 --- a/swad_timeline_publication.h +++ b/swad_timeline_publication.h @@ -115,7 +115,7 @@ Tml_TopMessage_t TmlPub_GetTopMessage (TmlPub_Type_t PubType); void TmlPub_PutLinkToViewNewPubs (void); void TmlPub_PutLinkToViewOldPubs (void); -void TmlPub_GetDataOfPubFromNextRow (MYSQL_RES *mysql_res, +void TmlPub_GetPubDataFromNextRow (MYSQL_RES *mysql_res, struct TmlPub_Publication *Pub); void TmlPub_PublishPubInTimeline (struct TmlPub_Publication *Pub); diff --git a/swad_timeline_share.c b/swad_timeline_share.c index f611011a..3e26cae1 100644 --- a/swad_timeline_share.c +++ b/swad_timeline_share.c @@ -67,7 +67,7 @@ void TmlSha_ShowAllSharersNoteGbl (void) /***** Get data of note *****/ Not.NotCod = ParCod_GetAndCheckPar (ParCod_Not); - TmlNot_GetDataOfNoteByCod (&Not); + TmlNot_GetNoteDataByCod (&Not); /***** Write HTML inside DIV with form to share/unshare *****/ TmlUsr_PutIconFavSha (TmlUsr_SHA_UNS_NOTE, @@ -108,7 +108,7 @@ static void TmlSha_ShaNote (struct TmlNot_Note *Not) /***** Get data of note *****/ Not->NotCod = ParCod_GetAndCheckPar (ParCod_Not); - TmlNot_GetDataOfNoteByCod (Not); + TmlNot_GetNoteDataByCod (Not); /***** Do some checks *****/ if (!TmlUsr_CheckIfICanFavSha (Not->NotCod,Not->UsrCod)) @@ -166,7 +166,7 @@ static void TmlSha_UnsNote (struct TmlNot_Note *Not) /***** Get data of note *****/ Not->NotCod = ParCod_GetAndCheckPar (ParCod_Not); - TmlNot_GetDataOfNoteByCod (Not); + TmlNot_GetNoteDataByCod (Not); /***** Do some checks *****/ if (!TmlUsr_CheckIfICanFavSha (Not->NotCod,Not->UsrCod)) diff --git a/swad_timetable.c b/swad_timetable.c index 710c226b..0d8b3b52 100644 --- a/swad_timetable.c +++ b/swad_timetable.c @@ -1433,7 +1433,7 @@ static void Tmt_TimeTableDrawCellView (const struct Tmt_Timetable *Timetable, ClassType == Tmt_PRACTICAL)) { Crs.CrsCod = CrsCod; - Crs_GetDataOfCourseByCod (&Crs); + Crs_GetCourseDataByCod (&Crs); HTM_Txt (Crs.ShrtName[0] ? Crs.ShrtName : Txt_unknown_removed_course); HTM_BR (); @@ -1451,7 +1451,7 @@ static void Tmt_TimeTableDrawCellView (const struct Tmt_Timetable *Timetable, GrpCod > 0) { GrpDat.GrpCod = GrpCod; - Grp_GetDataOfGroupByCod (&GrpDat); + Grp_GetGroupDataByCod (&GrpDat); HTM_BR (); HTM_Txt (GrpDat.GrpTypName); HTM_BR (); diff --git a/swad_user.c b/swad_user.c index 4045ef9b..1371ef45 100644 --- a/swad_user.c +++ b/swad_user.c @@ -2238,7 +2238,7 @@ void Usr_WriteRowUsrMainData (unsigned NumUsr,struct Usr_Data *UsrDat, /***** Write rest of main user's data *****/ Ins.InsCod = UsrDat->InsCod; - Ins_GetDataOfInstitByCod (&Ins); + Ins_GetInstitDataByCod (&Ins); Usr_WriteMainUsrDataExceptUsrID (UsrDat,BgColor); HTM_TD_Begin ("class=\"LM %s\"",BgColor); @@ -2288,7 +2288,7 @@ static void Usr_WriteRowGstAllData (struct Usr_Data *UsrDat) /***** Write rest of guest's main data *****/ Ins.InsCod = UsrDat->InsCod; - Ins_GetDataOfInstitByCod (&Ins); + Ins_GetInstitDataByCod (&Ins); Usr_WriteMainUsrDataExceptUsrID (UsrDat,The_GetColorRows ()); Usr_WriteEmail (UsrDat,The_GetColorRows ()); Usr_WriteUsrData (The_GetColorRows (), @@ -2299,7 +2299,7 @@ static void Usr_WriteRowGstAllData (struct Usr_Data *UsrDat) if (UsrDat->Tch.CtrCod > 0) { Ctr.CtrCod = UsrDat->Tch.CtrCod; - Ctr_GetDataOfCenterByCod (&Ctr); + Ctr_GetCenterDataByCod (&Ctr); } Usr_WriteUsrData (The_GetColorRows (), UsrDat->Tch.CtrCod > 0 ? Ctr.FullName : @@ -2308,7 +2308,7 @@ static void Usr_WriteRowGstAllData (struct Usr_Data *UsrDat) if (UsrDat->Tch.DptCod > 0) { Dpt.DptCod = UsrDat->Tch.DptCod; - Dpt_GetDataOfDepartmentByCod (&Dpt); + Dpt_GetDepartmentDataByCod (&Dpt); } Usr_WriteUsrData (The_GetColorRows (), UsrDat->Tch.DptCod > 0 ? Dpt.FullName : @@ -2384,7 +2384,7 @@ static void Usr_WriteRowStdAllData (struct Usr_Data *UsrDat,char *GroupNames) /***** Write rest of main student's data *****/ Ins.InsCod = UsrDat->InsCod; - Ins_GetDataOfInstitByCod (&Ins); + Ins_GetInstitDataByCod (&Ins); Usr_WriteMainUsrDataExceptUsrID (UsrDat,The_GetColorRows ()); Usr_WriteEmail (UsrDat,The_GetColorRows ()); Usr_WriteUsrData (The_GetColorRows (), @@ -2493,7 +2493,7 @@ static void Usr_WriteRowTchAllData (struct Usr_Data *UsrDat) /***** Write rest of main teacher's data *****/ Ins.InsCod = UsrDat->InsCod; - Ins_GetDataOfInstitByCod (&Ins); + Ins_GetInstitDataByCod (&Ins); Usr_WriteMainUsrDataExceptUsrID (UsrDat,The_GetColorRows ()); Usr_WriteEmail (UsrDat,The_GetColorRows ()); Usr_WriteUsrData (The_GetColorRows (), @@ -2504,7 +2504,7 @@ static void Usr_WriteRowTchAllData (struct Usr_Data *UsrDat) if (ShowData && UsrDat->Tch.CtrCod > 0) { Ctr.CtrCod = UsrDat->Tch.CtrCod; - Ctr_GetDataOfCenterByCod (&Ctr); + Ctr_GetCenterDataByCod (&Ctr); } Usr_WriteUsrData (The_GetColorRows (), (ShowData && UsrDat->Tch.CtrCod > 0) ? Ctr.FullName : @@ -2513,7 +2513,7 @@ static void Usr_WriteRowTchAllData (struct Usr_Data *UsrDat) if (ShowData && UsrDat->Tch.DptCod > 0) { Dpt.DptCod = UsrDat->Tch.DptCod; - Dpt_GetDataOfDepartmentByCod (&Dpt); + Dpt_GetDepartmentDataByCod (&Dpt); } Usr_WriteUsrData (The_GetColorRows (), (ShowData && UsrDat->Tch.DptCod > 0) ? Dpt.FullName : @@ -2577,7 +2577,7 @@ static void Usr_WriteRowAdmData (unsigned NumUsr,struct Usr_Data *UsrDat) /***** Write rest of main administrator's data *****/ Ins.InsCod = UsrDat->InsCod; - Ins_GetDataOfInstitByCod (&Ins); + Ins_GetInstitDataByCod (&Ins); Usr_WriteMainUsrDataExceptUsrID (UsrDat,The_GetColorRows ()); HTM_TD_Begin ("class=\"LM %s\"",The_GetColorRows ());